GIF89a
<?php ob_start(); ini_set('error_reporting', E_STRICT); /*include("session.php");*/ include("connect.php"); include("libs.php"); mysqli_set_charset($conn,'utf8'); date_default_timezone_set('Asia/Kolkata'); if($_GET['prod_id']<>"") { prodView($conn,$_GET['prod_id']); ?> <!DOCTYPE html> <html> <?php include'head.php'; ?> <body> <?php include'header.php'; ?> <?php $sqlP="SELECT * FROM `products` WHERE `sr`='".$_GET['prod_id']."'"; $rsP=mysqli_query($conn,$sqlP); $rowP=mysqli_fetch_assoc($rsP); ?> <div onclick="closeNav()"> <div class="container no-gutters"> <div class="row row-spac no-gutters"> <div class="col-md-5 no-gutters" style="margin: auto;padding: 0px;"> <div class="container m-0 p-0"> <div class="row my-3"> <div class="col-12"> <div> <button type="button" class="btn btn-primary py-0 px-2 rounded-pill"><?php echo discountCal($rowP["sale_price"],$rowP["real_price"]); ?>% OFF</button> <figure class="figure"> <img src="<?php echo "../admin.cpanel/".$rowP["image"]; ?>" class="figure-img img-fluid mx-auto d-flex" style="width: 350px; height:250px"> <span><i class="bi bi-stopwatch-fill text-success"><small>35 Mins. delivery time</small></i></span><br> <h6 class="mb-0"><?php echo ucfirst($rowP["p_name"]); ?></h6><hr class="my-1 text-muted"> <!-- <span class="text-dark p-0"><b>Amul Gold Full Cream Fresh Milk</b></span><hr class="my-1 text-muted"> --> <?php $sqlS="SELECT * FROM `products` WHERE `p_code`='".$rowP["p_code"]."'"; $rsS=mysqli_query($conn,$sqlS); while($rowS=mysqli_fetch_array($rsS)){ ?> <span class="p-0"><?php echo ucfirst($rowS['p_code']); ?></span><br> <?php } ?> <span class="text-dark fs-6"><b>RS: <?php echo $rowP["sale_price"]; ?> </b> <del> <?php echo $rowP["real_price"]; ?></del></span> </figure> <button class="btn btn-outline-success" type="button" onclick="addCart('<?php echo $rowP["sr"]; ?>','<?php echo $_COOKIE["user_id"]; ?>','<?php echo $rowP["sale_price"]; ?>','1')">ADD TO CART</button> <hr class="my-1 text-muted"> </div> </div> </div> <div class="row my-3"> <div class="col-12"> <h6 class="mb-2 fw-bold">Product Details</h6> <h6 class="mb-2 ">Description</h6> <p class="text-muted"><?php echo ucfirst(substr($rowP["p_desc"],0,120)); ?> <span id="dots">...</span> <span id="more" > <?php echo ucfirst($rowP["p_desc"]); ?> <br> </span> <a onclick="myFunction()" id="myBtn" class="text-success fw-bold">Read more</a> </p> </div> </div> <?php $sqlP2="SELECT * FROM `products` WHERE `cat_name`='".$rowP2["cat_name"]."' && `subcat_name`='".$rowP["subcat_name"]."' && `sr`<>'".$rowP["sr"]."'"; $rsP2=mysqli_query($conn,$sqlP2); $chk2=mysqli_num_rows($rsP2); if($chk2>0){ ?> <div class="row my-3"> <h6 class="my-3 fw-bold">You might also like</h6> <?php while($rowP2=mysqli_fetch_array($rsP2)){ ?> <div class="col-6"> <div class="card py-2"> <span><button type="button" class="btn btn-primary btn-sm py-0 px-1 mx-1 rounded-pill"><small><?php echo discountCal($rowP2['sale_price'],$rowP2['real_price']); ?>% OFF</small></button></span> <img src="<?php echo "../admin.cpanel/".$rowP2['image']; ?>" class="figure-img img-fluid mx-auto d-flex" style="max-width: 70%; height: auto"> <div class="card-body"> <p class="latter-size fw-bold text-success m-0"><?php echo ucfirst($rowP2['p_name']); ?></p> <span class="card-link text-dark">Weight : <?php echo ucfirst($rowP2['p_size']); ?> </span><br> <span class="card-link text-dark fw-bold">Price :<?php echo $rowP2['sale_price']; ?></span> <span class="card-link"><button onclick="addCart('<?php echo $rowP2['sr']; ?>','<?php echo $_COOKIE["user_id"]; ?>','<?php echo $rowP2['sale_price']; ?>','1')" type="button" class="btn btn-outline-success btn-sm float-end py-1">ADD</button></span> </div> </div> </div> <?php } ?> </div> <?php } ?> </div> </div> </div> </div> <div class="container no-gutters mb-5"> <div class="row row-spac no-gutters"> <div class="col-md-5 no-gutters" style="margin: auto;padding: 0px;"> <!-- <img src="assest/images/banner/img-12.png" class="img-fluid mx-auto d-flex" style="height: auto; max-width: 90%;"> --> </div> </div> </div> </div> <?php include 'footer.php';?> <script> function myFunction() { var dots = document.getElementById("dots"); var moreText = document.getElementById("more"); var btnText = document.getElementById("myBtn"); if (dots.style.display === "none") { dots.style.display = "inline"; btnText.innerHTML = "Read more"; moreText.style.display = "none"; } else { dots.style.display = "none"; btnText.innerHTML = "Read less"; moreText.style.display = "inline"; } } </script> <script> function openNav() { document.getElementById("mySidebar").style.width = "250px"; document.getElementById("main").style.marginLeft = "250px"; } function closeNav() { document.getElementById("mySidebar").style.width = "0"; document.getElementById("main").style.marginLeft= "0"; } </script> </body> </html> <div id="snackbar"><span id="snack_msgg" style="color: white"></span></div> <?php } else { echo '<script>window.location.href="dashboard.php";</script>'; } ?>