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 session_start(); $path = $_SERVER['DOCUMENT_ROOT']; include_once $path.'/connect_db.php'; include "accesscontrol.php"; $adid=$_GET['adid']; $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)){ // deleting ad $q6 = "DELETE FROM ads WHERE adid='{$adid}' AND memberid ='{$memberid}'"; $r6 = $connect->query($q6) or die($connect->error); $del_query = "SELECT image, photo_1, photo_2, photo_3, photo_4 FROM ads WHERE adid='{$adid}' AND memberid = '{$memberid}' GROUP BY adid"; $del_result = $connect->query($del_query) or die($connect->error); $del_row = $del_result->fetch_assoc(); $photos_array=array(1 =>$del_row['photo_1'],$del_row['photo_2'],$del_row['photo_3'],$del_row['photo_4']); // deleting associating photos to ad foreach($photos_array as $photo_key=>$photo_array){ $file = 'uploads/'.$photo_key.'/'.$photo_array; // name of file if (file_exists($file)) { @unlink($file); } } // deleting logo $logo_file= 'uploads/logo/'.$del_row['image']; // name of file if (file_exists($logo_file)) { @unlink($logo_file); } $message = 'Your Ad has been successfully deleted.'; } ?> <!DOCTYPE html> <html lang="en"> <head> <title>YellowLeaf - Manage Advert</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"> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-NF24NXM');</script> <!-- End Google Tag Manager --> <style> .upload-logo { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; text-align: center; color: var(--white); background-color: rgba(0, 0, 0, .5); transition: all .2s; font-weight: 500; } .upload-logo:hover { background-color: var(--yellow); color: var(--black); } </style> </head> <body> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NF24NXM" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <? include 'member_menu.php'; $ads_sql = $connect->query("SELECT * FROM ads where memberid ='{$memberid}'"); ?> <!-- NAVBAR --> <section id="content"> <!-- NAVBAR --> <nav> <i class='bx bx-menu toggle-sidebar' ></i> <a href="/members/logout.php" class="logout"> <i class='bx bx-log-out'></i> Logout </a> </nav> <!-- NAVBAR --> <!-- MAIN --> <main> <div class="container"> <h1 class="title">Manage Advert</h1> <!-- <ul class="breadcrumbs"> <li><a href="#">Home</a></li> <li class="divider">/</li> <li><a href="#" class="active">Dashboard</a></li> </ul> --> <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="listing-wrapper"> <?php $adCounter=1; // counter for the info box ////////////////////////////////// ///////// STEPS BOX FUNC ///////// function stepBox($stepNo,$step_adid){ if($stepNo!=4){ echo '<a class="btn btn-outline btn-sm btn-outline-black" href="edit_'.$stepNo.'.html?adid='.$step_adid.'">Complete advert</a>'; }else{ echo '<a class="btn btn-outline btn-sm btn-outline-black" href="edit_'.$stepNo.'.html?adid='.$step_adid.'">Upload photos</a>'; } } ////////////////////////////////// //////// ADVERTS DISPLAY ///////// while($ads_row = $ads_sql->fetch_assoc()) { if(!empty($ads_row['image']) && $ads_row['image'] && file_exists($path.'/members/uploads/logo/'.$ads_row['image'])){ $img = '<img alt="Listing" src="/members/uploads/logo/'.$ads_row['image'].'">'; }else{ $img = '<img alt="Listing" src="./uploads/no-logo.png"><a href="editbusiness2.php?adid='.$ads_row['adid'].'" class="upload-logo">Upload Logo</a>'; } $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="listing-item"> <div class="listing-item-image"> <?=$img?> </div> <div class="listing-item-info"> <div class="listing-item-top"> <span class="listing-item-location"><i class='bx bxs-map'></i> <?=$ads_row['street1']?> <?=$ads_row['postcode']?></span> <span class="listing-item-status <?=$ads_row['active']=='1' ? 'active' : 'inactive'?>"><?=$ads_row['active']=='1' ? 'Active' : 'Not active'?></span> </div> <a href="#" class="listing-item-title"><?=$ads_row['companyname']?></a> <p class="listing-item-description"> <? $lngth = 100; $subDesc=substr($ads_row['description'],0,$lngth); if(strlen($str)<$lngth){ echo $subDesc.'...'; }else{ echo $ads_row['description']; } ?> </p> <div class="listing-item-actions"> <a target="_blank" href="/pages/<?=$ads_row['adid']?>-<?=$company_name_url?>.html">View Ad</a> <a href="editbusiness1.php?adid=<?=$ads_row['adid']?>">Edit</a> <a href="promo.php?adid=<?=$ads_row['adid']?>">Promotions</a> <a href="review.php?adid=<?=$ads_row['adid']?>">Reviews</a> <a href="editbusiness4.php?adid=<?=$ads_row['adid']?>">Categories/Tags</a> </div> <?php if (empty(trim($ads_row['description']))) { ?> <p style="font-size: 12px;margin-top: 10px;font-weight: 600;color: red;">Please write your decription to send your business for approval review.</p> <?php }else{ ?> <p style="font-size: 12px;margin-top: 10px;font-weight: 600;color: #37990b;">Your business is ready for review.</p> <?php } ?> <!-- <div class="advert-item-dropdown"> <button>Actions <i class='bx bx-chevron-down' ></i></button> <div class="advert-item-dropdown-list"> <a target="_blank" href="/pages/<?=$ads_row['adid']?>-<?=$company_name_url?>.php">View Ad</a> <a href="edit_1.html?adid=<?=$ads_row['adid']?>">Edit</a> <a href="editbusiness1.php?adid=<?=$ads_row['adid']?>">Edit</a> <a href="promo.php?adid=<?=$ads_row['adid']?>">Promotions</a> <a href="review.php?adid=<?=$ads_row['adid']?>">Reviews</a> <a href="category.php?adid=<?=$ads_row['adid']?>">Categories/Tags</a> <a href="index.php?ad_del=yes&adid=<?=$ads_row['adid']?>" onclick="return confirm('By deleting this Advert you indicate that this business is now closed. This listing will now be deleted.');">Delete</a> </div> </div> --> </div> </div> <? } ?> </div> </div> </div> </main> <!-- MAIN --> </section> <!-- NAVBAR --> <!-- <script> var google_conversion_id = 1002183308; var google_conversion_language = "en"; var google_conversion_format = "1"; var google_conversion_color = "ffffff"; var google_conversion_label = "VkY6CNTn7FEQjLXw3QM"; var google_conversion_value = 0; // start: Remove Unknown Character For About var advertDescription = document.querySelector('.advert-item-description') advertDescription.textContent = advertDescription.textContent.replace(/\uFFFD/g, '') // end: Remove Unknown Character For About </script> <script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1002183308/?value=0&label=VkY6CNTn7FEQjLXw3QM&guid=ON&script=0"/> </div> </noscript> --> <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> </body> </html> <!-- <section> <div class="container"> <div class="advert-wrapper"> <div class="advert-main"> <div class="advert-main-header"> <div> <div class="advert-main-title">Manage Advert</div> </div> </div> <div class="advert-list"> <?php die(); $adCounter=1; // counter for the info box ////////////////////////////////// ///////// STEPS BOX FUNC ///////// function stepBox1($stepNo,$step_adid){ if($stepNo!=4){ echo '<a class="btn btn-outline btn-sm btn-outline-black" href="edit_'.$stepNo.'.html?adid='.$step_adid.'">Complete advert</a>'; }else{ echo '<a class="btn btn-outline btn-sm btn-outline-black" href="edit_'.$stepNo.'.html?adid='.$step_adid.'">Upload photos</a>'; } } ////////////////////////////////// //////// ADVERTS DISPLAY ///////// 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-detail"> <?=$img?> <div class="advert-item-info"> <div class="advert-item-title"><?=$ads_row['companyname']?></div> <div class="advert-item-address"><?=$ads_row['street1']?> <?=$ads_row['postcode']?></div> <div class="advert-item-description"> <? $lngth = 100; $subDesc=substr($ads_row['description'],0,$lngth); if(strlen($str)<$lngth){ echo $subDesc.'...'; }else{ echo $ads_row['description']; } ?> </div> </div> <div class="advert-item-more"> <div class="advert-item-status"><?=$ads_row['active']=='1' ? 'Active' : 'Not active'?></div> <div class="advert-item-substatus"><?if($ads_row['completed']!='1'){echo 'Your advert is still incomplete.';}?></div> <? $st2=FALSE; $st3=FALSE; // checking step 2 if($ads_row['description']==''){echo stepBox(2,$ads_row['adid']);$st2=TRUE;} // checking step 3 $qstep3 = $connect->query("SELECT * FROM opening_hours WHERE opadid='{$ads_row['adid']}' LIMIT 1"); $row_step3 = $qstep3->num_rows; if($row_step3<1&&$st2==FALSE){echo stepBox(3,$ads_row['adid']);$st3=TRUE;} // checking step 4 if($st2==FALSE&&$st3==FALSE){ // counting how many photos the ad has $pic_count=0; $photos=array($ads_row['photo_1'],$ads_row['photo_2'],$ads_row['photo_3'],$ads_row['photo_4']); foreach($photos as $photo){if($photo!='0'){$pic_count++;}} // if no photos show message if($pic_count==0){echo '<div class="advert-item-substatus">You have no photos for this advert.</div>';} if($pic_count<1){echo stepBox(4,$ads_row['adid']);} } ?> </div> </div> <div class="advert-item-action"> <a target="_blank" href="/pages/<?=$ads_row['adid']?>-<?=$company_name_url?>.html">View Ad</a> <a href="edit_1.html?adid=<?=$ads_row['adid']?>">Edit</a> <a href="promo.html?adid=<?=$ads_row['adid']?>">Promotions</a> <a href="review.html?adid=<?=$ads_row['adid']?>">Reviews</a> <a href="category.html?adid=<?=$ads_row['adid']?>">Categories/Tags</a> <a href="index.html?ad_del=yes&adid=<?=$ads_row['adid']?>" onclick="return confirm('By deleting this Advert you indicate that this business is now closed. This listing will now be deleted.');">Delete</a> </div> </div> <? } ?> </div> </div> </div> </div> </section> -->