Server IP : 51.89.169.208 / Your IP : 216.73.216.57 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/yellowleaf/public_html/members/ |
Upload File : |
<?php $path = $_SERVER['DOCUMENT_ROOT']; include_once $path.'/connect_db.php'; include "accesscontrol.php"; $ad_del=$_GET['ad_del']; // css for menu $styleManage = 'color:#ff6131;background-color:#fff;border-top:1px solid #c9c9c9;font-weight:bold;'; /////////////////////DELETE ADVERT/////////////////////// //////////////////////////////////////////////////////////// if(!empty($ad_del)){ $connect->query("delete from favourite where email ='$memberemail' and id ='$ad_del'"); $message = '<div class="alert alert-error">Advert has been removed successfully.</div>'; } ?> <!DOCTYPE html> <html lang="en"> <head> <title>YellowLeaf - My Yellowleaf</title> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href='https://unpkg.com/boxicons@2.0.9/css/boxicons.min.css' rel='stylesheet'> <link rel="stylesheet" href="/header-footer/global.css"> <link rel="stylesheet" href="index.css"> </head> <body> <? include 'member_menu.php'; $ads_sql = $connect->query("SELECT * FROM favourite join ads on favourite.advert_id = ads.adid where favourite.email ='{$memberemail}' order by id desc"); ?> <!-- NAVBAR --> <section id="content"> <!-- NAVBAR --> <nav> <i class='bx bx-menu toggle-sidebar' ></i> <a href="/members/logout.html" class="logout"> <i class='bx bx-log-out'></i> Logout </a> </nav> <!-- NAVBAR --> <!-- MAIN --> <main> <div class="container"> <h1 class="title">My Yellowleaf</h1> <div class="main-content"> <?php echo $ads_sql->num_rows > 0 ? '<p>You currently have '.$ads_sql->num_rows.' Advert(s) advertised.</p>' : ''; ?> <div class="advert-wrapper"> <?php echo $message; while($ads_row = $ads_sql->fetch_assoc()) { $img = $ads_row['image'] && file_exists($path.'/members/uploads/logo/'.$ads_row['image']) ? '<img alt="Listing" src="/members/uploads/logo/'.$ads_row['image'].'">' : '<img alt="Listing" src="/img/not-found.jpg">'; $r_ad_name=strtolower($ads_row['companyname']); $r_ad_name = preg_replace("/[^A-Za-z 0-9]/", "", $r_ad_name); $r_ad_name=str_replace(" "," ",$r_ad_name); $company_name_url=str_replace(" ","-",$r_ad_name); ?> <div class="advert-item"> <div class="advert-item-image"> <?=$img?> </div> <div class="advert-item-info"> <div class="advert-item-top"> <span class="advert-item-location"><i class='bx bxs-map'></i> <?=$ads_row['street1']?> <?=$ads_row['postcode']?></span> <a href="?ad_del=<?=$ads_row['id']?>" class="advert-item-status inactive">Remove</a> </div> <a href="#" class="advert-item-title"><?=$ads_row['companyname']?></a> <p class="advert-item-description"> <? $lngth = 100; $subDesc=substr($ads_row['description'],0,$lngth); if(strlen($str)<$lngth){ echo $subDesc.'...'; }else{ echo $ads_row['description']; } ?> </p> </div> </div> <? } ?> </div> </div> </div> </main> <!-- MAIN --> </section> <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> <script src="script.js"></script> <script> setTimeout(function(){ $(".alert-error").remove() }, 2000); let searchParams = new URLSearchParams(window.location.search); let param = searchParams.get('ad_del'); if(param>0) { $(document).ready(function(){ if (window.location.href.indexOf('?') > -1) { history.pushState('', document.title, window.location.pathname); } }); } </script> </body> </html>