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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/u615232177/domains/bond-lounge.com/public_html/search.php
<?php session_start();
$page_name = basename($_SERVER['PHP_SELF']); 
include("header.php"); ?>
<title><?php echo $company_name; ?> - Search</title>
<link rel="stylesheet" href="blog.css">
<div class="col-md-12 col-xs-12" id="product_msg"></div>
<?php
if(isset($_POST["search_for"])){
	$search_term1 = $_POST["search"];
	$search_term = trim("$search_term1");
}
?>

<?php 
$page_title = "Search";
$page_header = "shop_header.jpg";
include("page_header.php");
?>
<br><br>
    <!-- Start Shop Page  -->
    <section class="section-b-space pt-0">
        <div class="custom-container container">
            <div class="row">
                <div class="col-xl-12 col-lg-12 col-sm-12 col-xs-12 shop-content-right">
<form  action="search" method="post" id="">
						<div class="row">
								<div class="col-md-6">
										<div class="form-group">
												<input type="text" class="form-control" name="search" placeholder="Search" required>
										</div>
								</div>
								
								<div class="col-md-12">
										
										<div class="submit-button"> <br>
												<button class="btn btn-primary hvr-hover" id="submit" type="submit" name='search_for'>Search</button>
												<div id="msgSubmit" class="h3 text-center hidden"></div>
												<div class="clearfix"></div>
										</div>
								</div>
						</div>
				</form>
				<div class="product-tab-content ratio1_3">
				<div class="row-cols-lg-4 row-cols-md-3 row-cols-2 grid-section view-option row g-3 g-xl-4">
	<?php
	if(isset($_POST["search_for"])){					
	$product_query = "SELECT * FROM products WHERE 
	product_keywords LIKE '%$search_term%'";
	$run_query = mysqli_query($con,$product_query);
	$numrows = mysqli_num_rows($run_query);
	if(mysqli_num_rows($run_query) > 0){
		echo"
	<div class='col-sm-12 col-md-12 col-lg-12 col-xl-12'>
	<form method='post' action='$link'>
		<div class='headi'><h5>You searched for <span>\"$search_term\"</span>, $numrows result(s) found.</h5></div>
		<input class='btn btn-primary mt-30' style='width:30%;' type='submit' name='back' value='Back'><br><br>
	</form>
	<br/>
	</div><br><br>
	
	";
		while($row = mysqli_fetch_array($run_query)){
			$product_id    = $row['product_id'];
			$product_cat   = $row['product_cat'];
			$pro_brand = $row['product_brand'];
			$product_title = $row['product_title'];
			$product_price = $row['product_price'];
			$product_image = $row['product_image'];
			$old_price = $row['old_price'];
			$new_tag = $row['new'];
			$in_stock = $row['in_stock'];

			//calculate the rating of each product
			$stmt_reviews1 = $con -> prepare('SELECT rating FROM product_reviews WHERE product_id = ?');
			$stmt_reviews1 -> bind_param('s',$product_id);
			$stmt_reviews1 -> execute(); 
			$stmt_reviews1 -> store_result();
			$stmt_reviews1 -> bind_result($product_rating); 
			$numrows_reviews1 = $stmt_reviews1 -> num_rows();
			if($numrows_reviews1 > 0){
					$total_rating = array();
					while ($stmt_reviews1 -> fetch()) {
							array_push($total_rating,$product_rating);
					}
					$all_ratings = array_sum($total_rating);
					$average_rating = $all_ratings / $numrows_reviews1;
					$rounded_up = round($average_rating);
					$rating_display = " &nbsp;$rounded_up / 5";
			}
			else{$rating_display = "";$rounded_up = 0;}
				
			echo"<div class='col-6 col-md-4'>";
      include("product_snippet.php");
			echo"</div>";
			
			
		}
	}
	else{echo"
	<div class='col-sm-12 col-md-12 col-lg-12 col-xl-12'> <br>
	<form method='post' action=''>
		<div class='headi'><h5>You searched for <span>\"$search_term\"</span>, $numrows result(s) found.</h5></div>
		<input class='btn btn-primary mt-30' style='width:100px;' type='submit' name='back' value='Back'> 
	</form>
	</div>
	<br/> <br>
	";}
	}
?>	
</div>
                                </div>
                           
                    

				
            </div>
        </div>
    </div>
</section>

<?php include("footer.php"); ?>

Al-HUWAITI Shell