[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: single-product.php
<!-- Header include --> <?php include("header.php"); $pid=base64_decode($_REQUEST['pid']); ?> <script> function check_login(val1){ var val="<?=$_SESSION['user_id']?>"; if(val==""){ alert('Please login to give review'); }else{ window.location = "given-reviews.php?pid="+val1; } } </script> <!--Single Product--> <div class="single-product"> <div class="container"> <div class="row"> <form method="post" enctype="" action="single-product.php?pid=<?=$_REQUEST['pid']?>&action=add&code=<?=$_REQUEST['pid']?>"> <?php $sr='product'; $stmt =$show->readwithdata($sr,'product_id',$pid); $num = $stmt->rowCount(); if($num>0){ $count=1; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ $ptitle=$row['title']; $description=$row['description']; $product_id=$row['product_id']; $cate=$row['category'];$rn=$row['rating_num']; $rnum=$row['review_num']; ?> <div class="col-md-5 col-sm-5 col-xs-12"> <div class="grid images_3_of_2"> <div class="flexslider"> <div class="clearfix"></div> <div class="flex-viewport" style="overflow: hidden; position: relative;"> <ul class="slides" style="width: 1400%; transition-duration: 0.6s; transform: translate3d(-890px, 0px, 0px);"> <?php $c=1; $sq=$show->readwithdata('product_img','product_id',$pid); while ($row1 = $sq->fetch(PDO::FETCH_ASSOC)){ $img=$row1['img']; ?> <li data-thumb="<?=$pic_img?>/<?=$row1['img']?>" class="clone" style="width: 445px; float: left; display: block;"> <div class="thumb-image"> <img src="<?=$pic_img?>/<?=$row1['img']?>" data-imagezoom="true" class="img-responsive_1" alt=""> </div> </li> <?php } ?> </ul> </div> </div> </div> </div> <div class="col-md-7 col-sm-7 col-xs-12"> <div class="righttextbox-single"> <div class="right-box-content"> <h6><?=$row['category']?></h6> <h3><?=$row['title']?></h3> <h4> <!--<b><?=$rn?> <span>★</span></b> </a><a href="review.php?pid=<?=base64_encode($product_id)?>"> <?=$rnum?> Reviews </a>--> </h4> <div class="price"> <h4>₹ <?=$row['discounted_price']?><del>₹ <?=$row['price']?></del><span>(<?=$row['discount']?>% Off)</span></h4> <h6>(MRP Inclusive of all taxes)</h6> </div> <!--<div class="discount">--> <!-- <p>Flat <?=$row['discount']?>% off on MRP</p>--> <!--</div>--> <!--<div class="rating"> <h5><a href="#">5<i class="fa-solid fa-star"></i></a></h5> <h6><a href="#">300 Ratings</a></h6> </div>--> <div class="customise"> <h6>Size:<span>Free</span></h6> <!--<ul> <li><a href="#"> <h6>Size</h6> <h5><?=$row['size']?></h5> </a></li> <li><a href="#"> <h6>Metal</h6> <h5><?=$row['metal']?></h5> </a></li> <li><a href="#"> <h6>Diamond</h6> <h5><?=$row['stone']?></h5> </a></li> <li><a href="#" class="customise-btn">Customize </a></li> </ul>--> </div> <div class="product-order-form"> <input type="hidden" name="img" value="<?=$img?>"> <input type="hidden" name="product_name" value="<?=$ptitle?>"> <input type="hidden" name="price" value="<?=$row['discounted_price']?>"> <input type="hidden" name="ori_price" value="<?=$row['price']?>"> <input type="hidden" name="code" value="<?=$pid?>"> <input type="hidden" name="quantity" value="1"> <div class="message cart-btn"> <?php function searchForId($search_value, $array, $id_path) { // Iterating over main array foreach ($array as $key1 => $val1) { $temp_path = $id_path; // Adding current key to search path array_push($temp_path, $key1); // Check if this value is an array // with atleast one element if(is_array($val1) and count($val1)) { // Iterating over the nested array foreach ($val1 as $key2 => $val2) { if($val2 == $search_value) { // Adding current key to search path array_push($temp_path, $key2); //return join(" --> ", $temp_path); return 1; } } } elseif($val1 == $search_value) { // return join(" --> ", $temp_path); return 1; } } return null; } $search_path = searchForId($pid,$_SESSION["cart_item"], array('$')); //print($search_path); if($search_path==1) {?> <i class="fa-solid fa-cart-shopping"></i> <a href="cart.php" class="button">Go to Cart</a> <?php }else{ ?> <i class="fa-solid fa-cart-shopping"></i> <input type="submit" name="cart" id="cart" value="Add to Cart" onclick="runMyFunction();return true"> <?php } ?> </div> </div> <p><b>Description :</b> <?=htmlspecialchars_decode($row['description'])?></p> </div> <div class="review"> <h4>Ratings & Reviews</h4> <h3><span><?=$rn?> ★</span> <?=$rnum?> Ratings & Reviews<a onclick="check_login('<?=base64_encode($pid)?>')"><u>Rate Product</u></a></h3> <?php //echo $pid; //$stmt=$show->readwithdata_clause('review','user_id',$_SESSION['login_id'],"and product_id='.$pid.'"); $s="select * from review where product_id='".$pid."'"; $stmt=$con->prepare($s); $stmt->execute(); $num = $stmt->rowCount(); if($num>0){ $count=1; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ $sq1=$show->readwithdata('product','product_id',$row['product_id']); while($row1=$sq1->fetch(PDO::FETCH_ASSOC)){ $product_name=$row1['product_name']; } ?> <div class="review-customer"> <div class="review-lt-box-icon"> <!--<img src="images/Reviewsuser01.png" alt="reviews-man">--> </div> <div class="review-rt-box-icon"> <h5><?=$row['name']?></h5> <img src="images/<?=$row['rating']?>.png" alt="star-rating"> <p><?=$row['review']?></p> </div> </div> <?php } }?> <div class="review-btn"> <!--<input type="submit" value="All Review">--> <a href="review.php?pid=<?=$_REQUEST['pid']?>"><u>All Review</u></a> </div> </div> </div> </div> <?php } } ?> </form> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="trending"> <h2>Other Products under <?=$cate?></h2> <div id="other-product-slider" class="owl-carousel"> <?php $sr='product'; $stmt =$show->readwithdata($sr,'category',$cate); $num = $stmt->rowCount(); if($num>0){ $count=1; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ extract($row); $id=$row['id']; // echo $row['product_id']; $sq=$show->readwithdata('product_img','product_id',$row['product_id']); $row1 = $sq->fetch(PDO::FETCH_ASSOC); $img=$row1['img']; ?> <div class="item"> <a href="single-product.php?pid=<?=base64_encode($row['product_id'])?>"> <div class="trending-box"> <div class="image-product"> <img src="<?=$pic_img?>/<?=$img?>" alt=""> </div> <img src="images/5.png" class="reting"> <div class="price"> <h4><?=$row['title']?></h4> <h3><b>₹</b> <?=$row['discounted_price']?> <del>₹ <?=$row['price']?></del><span><?=$row['discount']?>% Discount</span></h3> <!--<h6><?=$row['discount']?>% Discount</h6>--> <a href="single-product.php?pid=<?=base64_encode($row['product_id'])?>" class="buy-btn">Buy Now</a> </div> </div> </a> </div> <?php } } ?> </div> </div> </div> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="trending"> <h2>Trending Products</h2> <div id="category-slider-3" class="owl-carousel"> <?php $sr='product'; $stmt =$show->readwithdata($sr,'trending','Yes'); $num = $stmt->rowCount(); if($num>0){ $count=1; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ extract($row); $id=$row['id']; // echo $row['product_id']; $sq=$show->readwithdata('product_img','product_id',$row['product_id']); $row1 = $sq->fetch(PDO::FETCH_ASSOC); $img=$row1['img']; ?> <div class="item"> <a href="single-product.php?pid=<?=base64_encode($row['product_id'])?>"> <div class="trending-box"> <div class="image-product"> <img src="<?=$pic_img?>/<?=$img?>" alt=""> </div> <img src="images/4.png" class="reting"> <div class="price"> <h4><?=$row['title']?></h4> <h3><b>₹</b> <?=$row['discounted_price']?> <del>₹ <?=$row['price']?></del><span><?=$row['discount']?>% Discount</span></h3> <!--<h6><?=$row['discount']?>% Discount</h6>--> <a href="single-product.php?pid=<?=base64_encode($row['product_id'])?>" class="buy-btn">Buy Now</a> </div> </div> </a> </div> <?php } } ?> </div> </div> </div> </div> </div> </div> <style> .flex-control-thumbs li { width: 25%; float: left; margin: 0 auto; text-align: center; border: 1px solid #cccccc4f; } .flex-control-thumbs img { width: 100%; display: block; opacity: .7; cursor: pointer; margin: 0 auto; } .thumb-image{ width: 100%; height: 500px; } img.img-responsive_1{ width: 100%; height: 100%;} </style> <!-- Footer include --> <?php include("footer.php"); ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 677.54 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619