MSV FM

dot.antimicrobial@66.96.161.157: ~ $
Path : /hermes/sb_web/b2680/childrendccom.domain.com/
File Upload :
Current < : /hermes/sb_web/b2680/childrendccom.domain.com/product-details.php

<?php
session_start();
include("includes/database.php");
include("functions/functions.php");

include("count.php");
hit_count();

$get_idef = mysqli_real_escape_string($con, $_GET["product-id"]);
$get_idef = preg_replace("/[^a-z0-9-]/", "", $get_idef);

$get_single = mysqli_query($con, "select * from product where product_urlslug = '$get_idef' LIMIT 1");
$_cntGetSing = mysqli_num_rows($get_single);
if($_cntGetSing <= 0){
    header("Location: ./");
}else{}

$pro = mysqli_fetch_array($get_single);
$get_id = $pro["product_id"];
$pro_id = $pro["product_id"];
$pro_name = $pro["product_name"];
$pro_image = $pro["product_image"];

$pro_shortDesc = $pro["prod_shortdesc"];
$pro_desc = $pro["product_desc"];
$pro_urlSlug = $pro["product_urlslug"];
include("product_view.php");

?>
<!DOCTYPE html>
<html lang="en">
<head>
<title><?php echo $pro_name; ?> | Babykish</title>

<meta name="keywords" content="<?php echo $website_keywords; ?>" />
<meta name="description" content="<?php echo $pro_shortDesc; ?>" />

<!--/tags -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<meta http-equiv="Content-Type, x-ua-compatible" content="text/html; charset=utf-8" />

<meta name="author" content="Babykish" />
<meta name="generator" content="Babykish">

<meta property="og:url"           content="<?php echo $website_url; ?>bk-<?php echo $pro_urlSlug; ?>" />
<meta property="og:type"          content="website" />
<meta property="og:title"         content="<?php echo $pro_name; ?> | Babykish" />
<meta property="og:description"   content="<?php echo $pro_shortDesc; ?>" />
<meta property="og:image"         content="<?php echo $website_url; ?>images/product_images/<?php echo $pro_image; ?>" />

<!-- Favicon and touch icons -->
<link rel="shortcut icon" type="image/x-icon" href="assets/images/favicon.png" />
<link rel="shortcut icon" type="image/x-icon" href="assets/images/favicon.ico" />
<meta name="robots" content="INDEX,FOLLOW" />
<!-- Favicon and touch icons -->

<script>
WebFontConfig = {
	google: { families: [ 'Poppins:400,500,600,700,800' ] }
};
( function ( d ) {
	var wf = d.createElement( 'script' ), s = d.scripts[ 0 ];
	wf.src = 'js/webfont.js';
	wf.async = true;
	s.parentNode.insertBefore( wf, s );
} )( document );
</script>

<link rel="stylesheet" type="text/css" href="vendor/fontawesome-free/css/all.min.css" />
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.min.css" />

<!-- Plugins CSS File -->
<link rel="stylesheet" type="text/css" href="vendor/magnific-popup/magnific-popup.min.css" />
<link rel="stylesheet" type="text/css" href="vendor/owl-carousel/owl.carousel.min.css" />
<link rel="stylesheet" type="text/css" href="vendor/photoswipe/photoswipe.min.css" />
<link rel="stylesheet" type="text/css" href="vendor/photoswipe/default-skin/default-skin.min.css" />

<!-- Main CSS File -->
<link rel="stylesheet" type="text/css" href="css/style.min.css" />
<link rel="stylesheet" href="assets/css/screen.css" />

<script src="assets/js/admin/sweetalert.min.js"></script>
<script src="assets/js/jquery-3.5.1.js"></script>
<script src="assets/js/admin/main.js"></script>

<script>
function numbersOnly(input){
    var regex = /[^0-9+]/g;
    input.value = input.value.replace(regex, "");
}

function lettersOnly(input){
    var regex = /[^a-zA-Z0-9 -/,]/g;
    input.value = input.value.replace(regex, "");
}
</script>
</head>
<body>
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v7.0" nonce="2WjhQDJ2"></script>
<!-- Load Facebook SDK for JavaScript -->

	<div class="page-wrapper">
		
		<?php include("includes/header.php"); ?>
		
		<main class="main mt-6 single-product">
			<div class="page-content mb-10 pb-6">
				<div class="container">
					<div class="product product-single row mb-7">
						<?php

							include("includes/database.php");

							if(isset($_GET["product-id"])){
								
								$grab_id = $get_id;
								
								$new_query = "select * from product where product_id = '$grab_id'";
								$run_newquery = mysqli_query($con, $new_query);
								$new_rowq = mysqli_fetch_array($run_newquery);
									
								$prod_id = $new_rowq["product_id"];
								$prod_name = $new_rowq["product_name"];
								$prod_oldprice = $new_rowq["old_price"];
								$prod_price = $new_rowq["product_price"];
								$prod_image = $new_rowq["product_image"];
								$prod_desc = $new_rowq["product_desc"];
								$qty_desc = $new_rowq["quantity_desc"];
								$nuProCat = $new_rowq["product_category"];
								$nuProSubCat = $new_rowq["product_sub_category"];
								$nuPro_URLSlug = $new_rowq["product_urlslug"];
								
								$nuProSerNum = $new_rowq["product_serialNo"];
								$nuProFeatures = $new_rowq["prod_features"];
								$nuProDimensions = $new_rowq["prod_dimensions"];
								$nuProVideoLink = $new_rowq["prod_videoLink"];
								
								$prod_price = number_format((float) $prod_price);
								
								$anth_shQuer = mysqli_query($con, "select * from product_brand where brand_urlSlug = '$qty_desc'");
								$row_anth_shQuer = mysqli_fetch_array($anth_shQuer);
								$anthShop_brandName = $row_anth_shQuer["brand_name"];
								
								//getting the number of views 1
								$current_page = "/product-details.php?product-id=$grab_id";
								$page_query = "select * from product_view where page = '$current_page'";
								$run_page = mysqli_query($con, $page_query);
								$count_pag = mysqli_num_rows($run_page);
								
								//getting category name
								$catNameQ = "select * from category where category_id = '$nuProCat'";
								$run_catNameQ = mysqli_query($con, $catNameQ);
								$new_rowcatNameQ = mysqli_fetch_array($run_catNameQ);
								$fetchCatName = $new_rowcatNameQ["category_title"];
								$fetchCatUrlSlug = $new_rowcatNameQ["category_urlslug"];
								
								//getting sub_category name
								$subCatNameQ = "select * from sub_category where sub_category_id = '$nuProSubCat'";
								$run_subCatNameQ = mysqli_query($con, $subCatNameQ);
								$new_rowsubCatNameQ = mysqli_fetch_array($run_subCatNameQ);
								$fetchSubCatName = $new_rowsubCatNameQ["sub_category_title"];
								
								//getting number of product review
								$proRevQ = "select * from product_review where product_id = '$prod_id'";
								$run_proRevQ = mysqli_query($con, $proRevQ);
								$cnt_proRevQ = mysqli_num_rows($run_proRevQ);
							}

						?>
						<div class="col-md-6 sticky-sidebar-wrapper">
							<div class="product-gallery pg-vertical sticky-sidebar" data-sticky-options="{'minWidth': 767}">
								
								<div class="product-single-carousel owl-carousel owl-theme owl-nav-inner row cols-1">
									
									<?php
										include("includes/database.php");
										$run_get_proImgQ = mysqli_query($con, "select * from product_images where proimages_pid = '$prod_id'");
										$_cntProImgQ = mysqli_num_rows($run_get_proImgQ);
										if($_cntProImgQ <= 0){}else{
											while($row_get_proImgQ = mysqli_fetch_array($run_get_proImgQ)){
												$_imgIDa = $row_get_proImgQ["proimages_images"];
									?>
									<figure class="product-image">
										<img src="images/product_images/<?php echo $_imgIDa; ?>" data-zoom-image="images/product_images/<?php echo $_imgIDa; ?>" alt="<?php echo $prod_name; ?>" width="800" height="900" />
									</figure>
									<?php }} ?>
									
								</div>
								
								<div class="product-thumbs-wrap">
									<div class="product-thumbs">
										
										<?php
											include("includes/database.php");
											$_clsActv = "";
											$run_get_proImgQ2b = mysqli_query($con, "select * from product_images where proimages_pid = '$prod_id' ORDER BY 1 ASC");
											$_cntProImgQ2b = mysqli_num_rows($run_get_proImgQ2b);
											if($_cntProImgQ2b <= 0){}else{
												while($row_get_proImgQ2b = mysqli_fetch_array($run_get_proImgQ2b)){
													$_imgIDa2b = $row_get_proImgQ2b["proimages_images"];
													
													if($_imgIDa2b == $prod_image){$_clsActv = "active";}else{$_clsActv = "";}
										?>
										<div class="product-thumb <?php echo $_clsActv; ?>">
											<img src="images/product_images/<?php echo $_imgIDa2b; ?>" alt="<?php echo $prod_name; ?>" width="122" height="122" />
										</div>
										<?php }} ?>
										
									</div>
									<button class="thumb-up disabled"><i class="fas fa-chevron-left"></i></button>
									<button class="thumb-down disabled"><i class="fas fa-chevron-right"></i></button>
								</div>
								<!--<div class="product-label-group">
									<label class="product-label label-new">new</label>
								</div>-->
							</div>
						</div>
						
						<div class="col-md-6">
							<div class="product-details">
								<div class="product-navigation">
									<ul class="breadcrumb breadcrumb-lg">
										<li><a href="./"><i class="d-icon-home"></i></a></li>
										<li><a href="bk-<?php echo $pro_urlSlug; ?>" class="active">Products</a></li>
										<li>Detail</li>
									</ul>

									<!--<ul class="product-nav">
										<li class="product-nav-prev">
											<a href="product-details.php">
												<i class="d-icon-arrow-left"></i> Prev
												<span class="product-nav-popup">
													<img src="images/product_images/product-1.jpg" alt="" width="110" height="123" />
													<span class="product-name">Sed egtas Dnte Comfort</span>
												</span>
											</a>
										</li>
										<li class="product-nav-next">
											<a href="product-details.php">
												Next <i class="d-icon-arrow-right"></i>
												<span class="product-nav-popup">
													<img src="images/product_images/product-1.jpg" alt="" width="110" height="123" />
													<span class="product-name">Sed egtas Dnte Comfort</span>
												</span>
											</a>
										</li>
									</ul>-->
								</div>

								<h1 class="product-name"><?php echo $prod_name; ?></h1>
								<div class="product-meta">
									SKU: <span class="product-sku"><?php echo $nuProSerNum; ?></span>
									BRAND: <span class="product-brand"><?php echo $anthShop_brandName; ?></span>
								</div>
								
								<div class="product-price">
									<?php echo $wiscoy_currency." ".$prod_price." &nbsp; <del class='old-price'>".$prod_oldprice."</del>"; ?>
									
								</div>
								
								<p class="product-short-desc text-justify"><?php echo $pro_shortDesc; ?></p>
								
								<hr class="product-divider">

								<div class="product-form product-qty">
									<div class="product-form-group">
										<div class="input-group mr-2">
											<button class="quantity-minus d-icon-minus"></button>
											<input class="quantity form-control" type="number" min="1" max="1000000" id="qtyVal<?php echo $prod_id; ?>" />
											<button class="quantity-plus d-icon-plus"></button>
										</div>
										<button class="btn-product btn-cart text-normal ls-normal font-weight-semi-bold productQty" pid="<?php echo $prod_id; ?>">
											<i class="d-icon-bag"></i>Add to Cart
										</button>
									</div>
								</div>

								<hr class="product-divider mb-3">

								<div class="product-footer">
									<?php
										include("includes/database.php");
										$_tgQu1 = mysqli_query($con, "select * from product_tag where product_id = '$get_id'");
										$_rowTgQu1 = mysqli_fetch_array($_tgQu1);
										$_grbTgName = $_rowTgQu1["tag_name"];
										
										if($_grbTgName == ""){ $_grbTgName = "null"; }
										
										$_tgQu2 = mysqli_query($con, "select * from product_tag where tag_name = '$_grbTgName' AND product_id != '$get_id'");
										$_cntTgQu1 = mysqli_num_rows($_tgQu2);
										if($_cntTgQu1 <= 0){}else{
											while($_rowTgQu2 = mysqli_fetch_array($_tgQu2)){
												$_grbTgUrl = $_rowTgQu2["product_url"];
												$_grbTgImg = $_rowTgQu2["product_img"];
									?>
									<a href="bk-<?php echo $_grbTgUrl; ?>" class="mr-3">
										<img src="images/product_images/<?php echo $_grbTgImg; ?>" class="shadow" alt="<?php echo $_grbTgUrl; ?>" width="80" />
									</a>
									<?php }} ?>
								</div>
							</div>
						</div>
					</div>
					
					<?php include("includes/product-description.php"); ?>
					
					<?php
						include("includes/database.php");
						$nuPg_bestSellProQu = mysqli_query($con, "select * from product where quantity_desc = '$qty_desc' AND product_id != '$get_id' ORDER BY RAND() LIMIT 0,12");
						$cnt_bestSellProQu = mysqli_num_rows($nuPg_bestSellProQu);
						if($cnt_bestSellProQu <= 0){}else{
					?>
					<section class="pt-3 mt-10">
						<h2 class="title justify-content-center">Related Products</h2>

						<div class="owl-carousel owl-theme owl-nav-full row cols-2 cols-md-3 cols-lg-4" data-owl-options="{ 'items': 5, 'nav': false, 'loop': false, 'dots': true, 'margin': 20, 'responsive': { '0': { 'items': 2 }, '768': { 'items': 3 }, '992': { 'items': 4, 'dots': false, 'nav': true } } }">
							<?php
								while($row_nuPg_catQu = mysqli_fetch_array($nuPg_bestSellProQu)){
									$nuFch_bsProID = $row_nuPg_catQu["product_id"];
									$nuFch_bsProTitle = $row_nuPg_catQu["product_name"];
									$nuFch_bsProSlug = $row_nuPg_catQu["product_urlslug"];
									$nuFch_bsProImg = $row_nuPg_catQu["product_image"];
									$nuFch_bsProPrice = $row_nuPg_catQu["product_price"];
									$nuFch_bsProBrand = $row_nuPg_catQu["quantity_desc"];
									
									$nuFch_bsOldProPrice = $row_nuPg_catQu["old_price"];
									
									$anth_quer = mysqli_query($con, "select * from product_brand where brand_urlSlug = '$nuFch_bsProBrand'");
									$row_anth_quer = mysqli_fetch_array($anth_quer);
									$anthFch_brandName = $row_anth_quer["brand_name"];
							?>
							<div class="product text-center shadow mb-3 mt-1">
								<figure class="product-media">
									<a href="bk-<?php echo $nuFch_bsProSlug; ?>">
										<img src="images/product_images/<?php echo $nuFch_bsProImg; ?>" alt="<?php echo $nuFch_bsProTitle; ?>" width="280" height="315" />
									</a>
									<div class="product-action-vertical">
										<a href="#" class="btn-product-icon btn-cart" data-toggle="modal" data-target="#addCartModal" title="Add to cart"><i class="d-icon-bag"></i></a>
									</div>
									<div class="product-action">
										<a href="bk-<?php echo $nuFch_bsProSlug; ?>" class="btn-product">View Product</a>
									</div>
								</figure>
								<div class="product-details">
									<div class="product-cat">
										<a href="brand-<?php echo $nuFch_bsProBrand; ?>"><?php echo $anthFch_brandName; ?></a>
									</div>
									<h3 class="product-name">
										<a href="bk-<?php echo $nuFch_bsProSlug; ?>"><?php echo $nuFch_bsProTitle; ?></a>
									</h3>
									<div class="product-price">
										<span class="price"><?php echo $wiscoy_currency." ".$nuFch_bsProPrice; ?></span>
										<del class="old-price"><?php echo $wiscoy_currency." ".$nuFch_bsOldProPrice; ?></del>
									</div>
								</div>
							</div>
							<?php } ?>
						</div>
					</section>
					<?php } ?>
				</div>
			</div>
		</main>
		<!-- End Main -->

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

<script src="vendor/photoswipe/photoswipe.min.js"></script>
<script src="vendor/photoswipe/photoswipe-ui-default.min.js"></script>
</body>
</html>