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/edit/ |
Upload File : |
<? require('../../connect.php'); $adid=$_GET['adid']; $memberid=$_GET['memberid']; $companyname=$_GET['adname']; // css for menu $styleManage = 'color:#ff6131;background-color:#fff;border-top:1px solid #c9c9c9;font-weight:bold;'; if(isset($_POST['submit'])){ $prom_title=$_POST['prom_title']; $prom_desc=$_POST['prom_desc']; $prom_date=time(); $expiry_day=$_POST['expiry_day']; $expiry_month=$_POST['expiry_month']; $expiry_year=$_POST['expiry_year']; $valid_day=$_POST['valid_day']; $valid_month=$_POST['valid_month']; $valid_year=$_POST['valid_year']; // converting valid $val=$valid_month.'/'.$valid_day.'/'.$valid_year; $prom_valid=strtotime($val); // converting expiry $expiry_dmy=$expiry_month.'/'.$expiry_day.'/'.$expiry_year; $prom_expiry=strtotime($expiry_dmy); $q3 = "INSERT INTO promotions SET ad_id = '$adid', prom_title = '$prom_title', prom_desc = '$prom_desc', prom_date = '$prom_date', prom_valid = '$prom_valid', prom_expiry = '$prom_expiry'"; $r3 = mysql_query($q3) or die(mysql_error()); } // for opening times $add_que = mysql_query("SELECT * FROM promotions WHERE ad_id ='{$adid}' ORDER BY prom_id DESC"); $promo_numRow=mysql_num_rows($add_que); if($promo_numRow==0){$showAdPromo='showPromo()';} ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>YellowLeaf UK</title> <link href="../../style.css" rel="stylesheet" type="text/css"> <link href="../style_staff.css" rel="stylesheet" type="text/css"> <script language="javascript"> <!-- function CheckRegister(){ if(document.RegForm.prom_title.value==""){ window.alert('Please enter the title of your business promotion.'); document.RegForm.prom_title.focus(); return false; } if(document.RegForm.prom_desc.value==""){ window.alert('Please enter the description of your promotion.'); document.RegForm.prom_desc.focus(); return false; } if(document.RegForm.valid_day.value==""){ window.alert('Please select the \'Day\' for the \'Valid From\' date.'); document.RegForm.valid_day.focus(); return false; } if(document.RegForm.valid_month.value==""){ window.alert('Please select the \'Month\' for the \'Valid From\' date.'); document.RegForm.valid_month.focus(); return false; } if(document.RegForm.valid_year.value==""){ window.alert('Please select the \'Year\' for the \'Valid From\' date.'); document.RegForm.valid_year.focus(); return false; } if(document.RegForm.expiry_day.value==""){ window.alert('Please select the\'Day\' for the \'Expiry\' date.'); document.RegForm.expiry_day.focus(); return false; } if(document.RegForm.expiry_month.value==""){ window.alert('Please select the \'Month\' for the \'Expiry\' date.'); document.RegForm.expiry_month.focus(); return false; } if(document.RegForm.expiry_year.value==""){ window.alert('Please select the\'Year\' for the \'Expiry\' date.'); document.RegForm.expiry_year.focus(); return false; } } function showPromo(){ document.getElementById("showPromo").style.display='none'; document.getElementById("addPromo").style.display=''; } function hidePromo(){ document.getElementById("showPromo").style.display=''; document.getElementById("addPromo").style.display='none'; } //--> </script> </head> <body onload="<?=$showAdPromo?>"> <? include '../staff_header.php'; include 'edit_menu.php';?> <table class="tbwdth"> <tr> <td valign="top"> <? // business details $ad_sql = mysql_query("SELECT * FROM ads WHERE memberid ='{$memberid}' AND adid='{$adid}'"); $ad_row=mysql_fetch_array($ad_sql); ?> <div class="cnHead" style="margin-bottom:5px;">Manage Promotions and Deals</div> <div style="color:#555;font-size:14pt;margin-bottom:40px;"><?=$ad_row['companyname']?></div> <? /////////////// /// current promotions /////////////// if($promo_numRow>0){ ?> <table class="cnTbl" width="100%"> <tr> <td valign="top" colspan="2" style="background-color:#f3f3f3;padding:8px 15px 6px;border-bottom:1px solid #ccc;"><span class="subHead">Your Current Promotion(s) or Deal(s)</span></td> </tr> <tr> <td valign="top" colspan="2"></td> </tr> <? while($add_que_sql = mysql_fetch_array($add_que)){ echo '<tr><td style="padding-left:25px" style="padding-left:25px;" valign="top">'; echo '<div style="font-size:17pt;">'.$add_que_sql['prom_title'].'</div>'; echo '<div style="font-size:11pt;" class="cnTitleDesc">'.$add_que_sql['prom_desc'].'</div>'; echo '<div style="float:left;margin-top:15px;color:#666;"><b>Valid From </b><br>'.date('d/m/Y',$add_que_sql['prom_valid']).'</div>'; echo '<div style="float:left;margin-left:20px;margin-top:15px;color:#666;"><b>Expiry Date </b><br>'.date('d/m/Y',$add_que_sql['prom_expiry']).'</div>'; echo '</td><td width="150" valign="top" style="padding:10px;"><b>Promotion Added: </b>'.date('d/m/Y', $add_que_sql['prom_date']).'<br><br>'; echo '<a href="promo_edit.html?adid='.$adid.'&memberid='.$memberid.'&pid='.$add_que_sql['prom_id'].'">Edit this Promotion</a><br>'; echo '<a href="promo_delete.html?adid='.$adid.'&memberid='.$memberid.'&pid='.$add_que_sql['prom_id'].'" onclick="return confirm(\'Are you sure that you want to delete this promotion.\');">Delete this Promotion</a></td>'; echo '</tr><tr><td colspan="2"><hr noshade color="#C9C9C9" size="1"></td></tr>'; } ?> </table> <?}else{ echo '<div style="border-top:1px solid #ddd;padding-top:25px;font-weight:bold;text-align:center;color:#888;">You have no promotions or deals added.</div>'; }?> </td> </tr> </table> </body> </html>