403Webshell
Server IP : 51.89.169.208  /  Your IP : 18.216.230.65
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/yellowleaf/public_html/members/edit_3.php
<?php
$path  = $_SERVER['DOCUMENT_ROOT'];
include_once $path.'/connect_db.php';
include "accesscontrol.php";
// css for menu
$styleManage = 'color:#ff6131;background-color:#fff;border-top:1px solid #c9c9c9;font-weight:bold;';
$adid=$_GET['adid'];
// check if advert beleongs to members
if(advert_check($adid,$memberid)===false){header('Location: index.html');exit();}

if(isset($_POST['submit'])){

	$monday=$_POST['monday'];
	$tuesday=$_POST['tuesday'];
	$wednesday=$_POST['wednesday'];
	$thursday=$_POST['thursday'];
	$friday=$_POST['friday'];
	$saturday=$_POST['saturday'];
	$sunday=$_POST['sunday'];

	$serv1 = array_filter(array_map('trim',$_POST['serv']));
	$serv=implode(" || ", $serv1);
	
	$urlPattern='#^http[s]?://+#i';
	$facebook=preg_replace($urlPattern,"",$_POST['facebook']);
	$twitter=preg_replace($urlPattern,"",$_POST['twitter']);
	$google=preg_replace($urlPattern,"",$_POST['google']);
	$youtube=preg_replace($urlPattern,"",$_POST['youtube']);
	$linkedin=preg_replace($urlPattern,"",$_POST['linkedin']);
	$time=time();

	$opQuery = "
		 `monday` = '$monday',
		 `tuesday` = '$tuesday',
		 `wednesday` = '$wednesday',
		 `thursday` = '$thursday',
		 `friday` = '$friday',
		 `saturday` = '$saturday',
		 `sunday` = '$sunday'";
	
	$q3 = "INSERT INTO `opening_hours` SET `opadid` = '{$adid}', {$opQuery} ON DUPLICATE KEY UPDATE {$opQuery}"; 
	$r3 =  $connect->query($q3) or die($connect->error);
	
	/// ads table
	$promo = "UPDATE `ads` SET `services_offered`= '$serv',`last_update`= '$time',`completed` = '1',`decline` = '0' WHERE `adid` = '$adid' and `memberid` = '$memberid'";
	$promo_row =  $connect->query($promo) or die($connect->error);
	
	if($_POST['facebook']!=""||$_POST['twitter']!=""||$_POST['google']!=""||$_POST['youtube']!=""||$_POST['linkedin']!=""){
	$q6 = "INSERT INTO social_links SET
			so_member_id = '$memberid',
			so_ad_id = '$adid',
			facebook = '$facebook',
			googleplus = '$google',
			twitter = '$twitter',
			youtube = '$youtube',
			linkedin = '$linkedin'
			ON DUPLICATE KEY UPDATE 
			facebook = '$facebook',	googleplus = '$google',	twitter = '$twitter',youtube = '$youtube', linkedin = '$linkedin'";

	$r6 = $connect->query($q6) or die($connect->error);
	}
	
	$success=TRUE;
	header('Location: edit_4.html?adid='.$adid);
}
// for opening times
$add_que_sql = $connect->query("SELECT * FROM opening_hours WHERE opadid ='{$adid}'");
$add_row = $add_que_sql->fetch_assoc();

// for promotion
$promo_que_sql = $connect->query("SELECT * FROM ads WHERE `adid` = '$adid' and `memberid` = '$memberid'");
$promo_row = $promo_que_sql->fetch_assoc();
$services = array_filter(explode("||",$promo_row['services_offered']));
$min_limit = 10; // MIN amount of services to be made
$max_limit = 50; // MAX amount of services to be made
$count_serv = count($services);
foreach($services as $key=>$service){
	$del_html = ($key < $min_limit ? '' : '<div class="remRow">remove</div>');
	if($key < $max_limit){$serv_html.='<tr><td><input type="text" size="30" name="serv[]" value="'.$service.'"></td><td>'.$del_html.'</td></tr>';}
}

// adding blank service input boxes if less than minimum in DB
if($count_serv < $min_limit){
	$rem = $min_limit - $count_serv;
	for($i=0;$i<$rem;$i++){$serv_html.='<tr><td><input type="text" size="30" name="serv[]" value=""></td><td></td></tr>';}
}

// for social
$social_que_sql = $connect->query("SELECT * FROM social_links WHERE `so_ad_id` = '$adid' and `so_member_id` = '$memberid'");
$social_row = $social_que_sql->fetch_assoc();

?>
<!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">
<script language="javascript">
<!--
function CheckPostAd(){
// mon
 if(document.getElementById('monCheck').checked==false){ // if not closed, then validate
	 if(document.RegForm.monday.value==""){
	  window.alert('Please your business opening and closing time for Monday.');
	  document.RegForm.monday.focus();
	  return false;
	 }
 }
 // tue
 if(document.getElementById('tueCheck').checked==false){ // if not closed, then validate
	if(document.RegForm.tuesday.value==""){
	  window.alert('Please your business opening and closing time for Tuesday.');
	  document.RegForm.tuesday.focus();
	  return false;
	}
 }
 // wed
 if(document.getElementById('wedCheck').checked==false){ // if not closed, then validate
	if(document.RegForm.wednesday.value==""){
	  window.alert('Please your business opening and closing time for Wednesday');
	  document.RegForm.wednesday.focus();
	  return false;
	}
 }
 // thur
 if(document.getElementById('thuCheck').checked==false){ // if not closed, then validate  
	if(document.RegForm.thursday.value==""){
	  window.alert('Please your business opening and closing time for Thursday');
	  document.RegForm.thursday.focus();
	  return false;
	}
 }
 // fri
 if(document.getElementById('friCheck').checked==false){ // if not closed, then validate
	if(document.RegForm.friday.value==""){
	  window.alert('Please your business opening and closing time for Friday');
	  document.RegForm.friday.focus();
	  return false;
	}
 }
  // sat
if(document.getElementById('satCheck').checked==false){ // if not closed, then validate
	if(document.RegForm.saturday.value==""){
	  window.alert('Please your business opening and closing time for Saturday');
	  document.RegForm.saturday.focus();
	  return false;
	}
}
 // sun
 if(document.getElementById('sunCheck').checked==false){ // if not closed, then validate
	if(document.RegForm.sunday.value==""){
	  window.alert('Please your business opening and closing time for Sunday');
	  document.RegForm.sunday.focus();
	  return false;
	}
 }
 
}

//-->
</script>
<style>
.optmeDv{color:#444;padding:5px 15px;border-bottom:1px solid #ddd}
.closedTd{font-size:11pt;}
.socialTbl td{color:#444;}
.opFields input{width:70px !important;margin:0px !important;padding:8px 5px !important;}
.opFields td{border:1px solid #ddd;}
.opFields .days td{background:#f1f1f1;}
.remRow{cursor:pointer}
</style>
</head>

<body>

<? include 'header.php'; ?>
<table class="tbwdth">
	<tr>
		<td valign="top" style="width:210px;">
		<? include 'member_menu.php'; ?>
		</td>
		<td valign="top" class="cnGrad">
		<div class="cnHead">Manage Advert</div>	
		<div style="position:relative;margin-bottom:70px">
		<hr class="stpBar" noshade size="1" color="#cccccc">
		<img style="position:absolute;left:482px;top:-33px;" src="/img/arr_nav2.png" />
		<a href="edit_1.html?adid=<?=$adid?>"><img border="0" class="nav step1 pos1" src="/img/img_trans.gif" width="1" height="1" /></a>
		<a href="edit_2.html?adid=<?=$adid?>"><img border="0" class="nav step2 pos2" src="/img/img_trans.gif" width="1" height="1" /></a>
		<img class="nav sel3 pos3" src="/img/img_trans.gif" width="1" height="1" />
		<a href="edit_4.html?adid=<?=$adid?>"><img border="0" class="nav step4 pos4" src="/img/img_trans.gif" width="1" height="1" /></a>
		</div>
		<?if($success==TRUE){?>
		<div class="successDvBx">
		Update Successful. Your details have been saved. <br><a href="edit_4.html?adid=<?=$adid?>">Click here to go to Section 4 ></a>
		</div>
		<?}?>		
		<form name="RegForm" action="edit_3.html?adid=<?=$adid?>" method="POST" enctype="multipart/form-data" onsubmit="return CheckPostAd();" autocomplete="off">
			<table width="100%" class="cnTbl">
			<tr>
				<td align="left" valign="top" class="cnTitle" style="padding-left:25px">Products, Services or Facilities*:<br>
					<div class="cnTitleDesc">Please enter products, services or facilities that your business offers.</div><br>
					<table class="servTbl">
						<tbody>
							<?=$serv_html?>
						</tbody>
					</table>		
					<div style="padding:10px 5px;"><button type="button" class="redBtn fancyBtn" id="addServ" style="float:none">Add Another +</button></div>
				</td>
			</tr>
			<tr>
				<td>
					<hr style="background-color: rgb(204, 204, 204);" width="100%" size="1" noshade="noshade" color="#cccccc">
				</td>
			</tr>
			<tr>
				<td align="left" valign="top" class="cnTitle" style="padding-left:25px">Opening Times*:<br>
					<div class="cnTitleDesc">Please enter the business opening times.</div><br>
					<table class="opFields">
						<tr class="days">
							<td style="color:#244471" class="cnTitle">Mon</td>
							<td style="color:#244471" class="cnTitle">Tue</td>
							<td style="color:#244471" class="cnTitle">Wed</td>
							<td style="color:#244471" class="cnTitle">Thur</td>
							<td style="color:#244471" class="cnTitle">Fri</td>
							<td style="color:#244471" class="cnTitle">Sat</td>
							<td style="color:#244471" class="cnTitle">Sun</td>
						</tr>
						<tr>
							<td><div id="monOp"><input type="text" size="30" name="monday" id="monday" value="<?=$add_row['monday']?>"></div></td>
							<td><div id="tueOp"><input type="text" size="30" name="tuesday" id="tuesday" value="<?=$add_row['tuesday']?>"></div></td>
							<td><div id="wedOp"><input type="text" size="30" name="wednesday" id="wednesday" value="<?=$add_row['wednesday']?>"></div></td>
							<td><div id="thuOp"><input type="text" size="30" name="thursday" id="thursday" value="<?=$add_row['thursday']?>"></div></td>
							<td><div id="friOp"><input type="text" size="30" name="friday" id="friday" value="<?=$add_row['friday']?>"></div></td>
							<td><div id="satOp"><input type="text" size="30" name="saturday" id="saturday" value="<?=$add_row['saturday']?>"></div></td>
							<td><div id="sunOp"><input type="text" size="30" name="sunday" id="sunday" value="<?=$add_row['sunday']?>"></div></td>
						</tr>
					</table>		
				</td>
			</tr>
			<tr>
				<td>
					<hr style="background-color: rgb(204, 204, 204);" width="100%" size="1" noshade="noshade" color="#cccccc">
				</td>
			</tr>
			<tr>
				<td align="left" valign="top" class="cnTitle" style="padding-left:25px">
					Promotional Deals & Offers(optional):</span><br><br>
					<a class="redBtn fancyBtn" style="float:none;" href="promo.html?adid=<?=$adid?>">Manage Your Business Promotions ></a>
					<br><br>
				</td>
			</tr>
			<tr>
				<td><hr noshade color="#C9C9C9" size="1"></td>
			</tr>
			<tr>
				<td align="left" valign="top" class="cnTitle" style="padding-left:25px">Your Social Links (optional)<br>
					<div class="cnTitleDesc">Please provide the links to your social pages.</div>
					<table class="socialTbl">
							<tr>
								<td><b>Facebook:</b></td>
								<td>
								<? if($social_row['facebook']==''){$social_fb='http://';}else{$social_fb=$social_row['facebook'];}?>
								<input name="facebook" type="text" class="txbox" size="30" value="<?=$social_fb?>" /><i><span style="font-weight:normal"> e.g http://www.facebook.com/</span><b>YourPageName</b></i></td>
							</tr>
							<tr>
								<td><b>Twitter:</b></td>
								<td>
								<? if($social_row['twitter']==''){$social_twit='http://';}else{$social_twit=$social_row['twitter'];}?>
								<input name="twitter" type="text" class="txbox" size="30" value="<?=$social_twit?>" /><i><span style="font-weight:normal"> e.g http://www.twitter.com/</span><b>YourPageName</b></i></td>
							</tr>
							<tr>
								<td><b>Google+:</b></td>
								<td>
								<? if($social_row['googleplus']==''){$social_ggl='http://';}else{$social_ggl=$social_row['googleplus'];}?>
								<input name="google" type="text" class="txbox" size="30" value="<?=$social_ggl?>" /><i><span style="font-weight:normal"> e.g http://plus.google.com/</span><b>+YourPageName</b></i></td>
							</tr>
							<tr>
								<td><b>YouTube:</b></td>
								<td>
								<? if($social_row['youtube']==''){$social_utube='http://';}else{$social_utube=$social_row['youtube'];}?>
								<input name="youtube" type="text" class="txbox" size="30" value="<?=$social_utube?>" /><i><span style="font-weight:normal"> e.g http://www.youtube.com/user/</span><b>YourPageName</b></i></td>
							</tr>
							<tr>
								<td><b>LinkedIn:</b></td>
								<td>
								<? if($social_row['linkedin']==''){$social_lnkdin='http://';}else{$social_lnkdin=$social_row['linkedin'];}?>
								<input name="linkedin" type="text" class="txbox" size="30" value="<?=$social_lnkdin?>" /><i><span style="font-weight:normal"> e.g http://www.linkedin.com/in/</span><b>YourPageName</b></i></td>
							</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td><hr noshade color="#C9C9C9" size="1"></td>
			</tr>
			<tr>
				<td>
				<span style="font-size:9pt;color:#666;">* mandatory fields that must be filled in.</span>
				</td>
			</tr>
		</table>
		<input class="blueBtn fancyBtn" style="border:0px;float:left;" type="submit" value="Update & Go to next step >" name="submit">
		</form>
		</td>
	</tr>
</table>
<? include 'footer.php'; ?>
<script type="text/javascript">
function getScript(e,t){var n=document.createElement("script");n.src=e;var r=document.getElementsByTagName("head")[0],i=false;n.onload=n.onreadystatechange=function(){if(!i&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){t();n.onload=n.onreadystatechange=null;r.removeChild(n)}};r.appendChild(n)}

getScript('http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js',function(){
	
	$('.servTbl').on('click','.remRow',function(){
		$(this).parent().parent().remove();
	});
	
	var limit = <?=$max_limit?>;
	$('#addServ').click(function(){
		var rowCount = $('.servTbl tr').length;
		if(rowCount < limit){
			$('.servTbl > tbody:last').append('<tr><td><input type="text" size="30" name="serv[]" value=""></td><td><div class="remRow">remove</div></td></tr>');
		}else{
			alert('You cannot add more than '+limit+' products, services or facilities.');
		}
	});
	
});
</script>
</body>

</html>

Youez - 2016 - github.com/yon3zu
LinuXploit