Uname : Linux V-ShopU01 4.18.0-348.20.1.el8_5.x86_64 #1 SMP Thu Mar 10 20:59:28 UTC 2022 x86_64
Server : Apache/2.4.37 (rocky) OpenSSL/1.1.1k
Whoami : apache
Safe Mode : OFF
DOCUMENT ROOT : /var/www/html/site_shopudietDisable Function :
Path : /var/www/html/site_shopudiet/
Server IP : 65.20.74.164
Client IP : 18.220.244.7
Current File : /var/www/html/site_shopudiet/cart.php |
<?php
include 'dbconnect.php';
session_start();
?>
<!DOCTYPE html>
<html lang="en" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Online Organic Grocery Store in Kochi | ShopUdiet</title>
<link rel="icon" type="image/png" href="images/favicon.png"/>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no">
<meta name="description" content="All the products we bring you are 100% Organic Certified. Customers can pick and choose the grocery items for their monthly home requirements from our site.">
<meta name="keywords" content="100% Organic Certified, Organic Store, Grocery store, Kochi Organic Store, Organic products">
<meta name="robots" content="*">
<meta name="viewport" content="initial-scale=1.0, width=device-width">
<link rel="icon" href="#" type="image/x-icon">
<link rel="shortcut icon" href="#" type="image/x-icon">
<!-- CSS Style -->
<link rel="stylesheet" type="text/css" href="stylesheet/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="stylesheet/revslider.css" >
<link rel="stylesheet" type="text/css" href="stylesheet/owl.carousel.css">
<link rel="stylesheet" type="text/css" href="stylesheet/owl.theme.css">
<link rel="stylesheet" type="text/css" href="stylesheet/jquery.bxslider.css">
<link rel="stylesheet" type="text/css" href="stylesheet/jquery.mobile-menu.css">
<link rel="stylesheet" type="text/css" href="stylesheet/style.css" media="all">
<link rel="stylesheet" type="text/css" href="stylesheet/responsive.css" media="all">
<link href="https://fonts.googleapis.com/css?family=Merriweather:300,300i,400,400i,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Oswald:300,400,500,600,700" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:700,600,800,400' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/css?family=Rubik:400,400i,500,500i,700,700i,900" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.js"></script>
<link rel="stylesheet" href="/path/to/flickity.css" media="screen">
<script src="/path/to/flickity.pkgd.min.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
// $(window).load(function(){
// $('.loader').fadeOut("slow");
// });
$(document).ready(function () {
setTimeout(function(){
$('.loader').fadeOut(100);
}, 2500);
});
</script>
</head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-170593298-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-170593298-1');
</script>
<body>
<div class="loader">
</div>
<div id="page">
<?php
include('header.php');
?>
<div class="page-heading hidden-xs">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="page-title">
<h2>Shopping Cart</h2>
</div>
</div>
</div>
</div>
</div>
<!-- BEGIN Main Container -->
<div class="main-container col1-layout wow bounceInUp animated">
<div class="main">
<div class="cart wow bounceInUp animated">
<div class="row">
<!--<h4 align="center" class="blinking">Delivery Within 24 Hrs!!</h4>-->
</div>
<div class="row">
<div class="col-md-8 col-sm-6 col-xs-12">
<div class="table shopping-cart-tbl ">
<h4 style="color: #013969;padding-left: 10px;">YOUR ORDER</h4>
<input name="form_key" type="hidden" value="EPYwQxF6xoWcjLUr">
<fieldset>
<table id="shopping-cart-table" class="data-table cart-table table-striped">
<!-- <colgroup><col width="1">
<col>
<col width="1">
<col width="1">
<col width="1">
<col width="1">
<col width="1">
</colgroup> -->
<?php
include('dbconnect.php');
// $home_id = $_SESSION['id'];
// echo $home_id;
$cart_id=$_SESSION['cart_id'];
$status1='order';
$status2='enquiry';
// echo $cart_id;
if($_SESSION['cart_id'] !='') {
$squery = "SELECT * FROM product_cart WHERE cart_id='$cart_id' AND status != 'confirm'";
$result = mysqli_query($conn,$squery);
$i=mysqli_num_rows($result);
// echo $i;
if($i>0){
//$j=1;
while( $row = mysqli_fetch_array($result))
{
$prdctname =$row['prdctname'];
$prdct_id=$row['prduct_id'];
$query = "SELECT * FROM product WHERE id='$prdct_id' AND product_name='$prdctname'";
$result2 = mysqli_query($conn,$query);
if(mysqli_num_rows($result2) > 0)
{
$row2 = mysqli_fetch_array($result2);
$mrp=$row2['mrp'];
if($mrp==0){
$price=$row['price'];
}
else{
$price=$row2['mrp'];
}
} else {
$price = $row['price'];
}
//$price=$row['price'];
// echo $price;
$item=$row['no_of_item'];
$total=$item*$price;
?> <tbody id="delete_product<?php echo $row['id'];?>">
<tr class="first last odd">
<td class="image hidden-table"><a href="product-detail.php?id=<?php echo $row['prduct_id']?>" title="Women's Georgette Animal Print" ><img src="admin/img/<?php echo $row['feature_image']?>" alt="Women's Georgette Animal Print" class="product-image"></a></td>
<td>
<h2 class="product-name">
<a href="product-detail1.php?id=<?php echo $row['prduct_id']?>"><?php echo $row['prdctname']?></a>
<p><?php echo $row['quantity']?></p>
</h2><form method="post">
<div class="def-number-input number-input safari_only">
<button type="button" onclick="stepdown(<?php echo $row['id'];?>)" class="minus"></button>
<input class="quantity1" min="1" name="quantity" id="quantity<?php echo $row['id'];?>" value="<?php echo $item;?>" type="number"readonly>
<button type="button" onclick="stepup(<?php echo $row['id'];?>)" class="plus"></button>
</div></form>
</td>
<!-- <?php if($row['flag']=='0'){?>
<td class="a-center hidden-table">
<a href="product-detail_edit.php?id=<?php echo $row['id']?>" class="edit-bnt" title="Edit item parameters"></a>
</td>
<?php } ?>
<?php if($row['flag']=='1'){?>
<td class="a-center hidden-table">
<a href="package-detail_edit.php?id=<?php echo $row['id']?>" class="edit-bnt" title="Edit item parameters"></a>
</td>
<?php } ?> -->
<td class="a-right hidden-table">
<span class="cart-price">
<span class="price" id="price<?php echo $row['id'];?>"><?php if ($total>0) { echo "₹". $total; } ?></span>
</span>
</td>
<!-- <td class="a-center movewishlist">
<input name="no_of_item" value="<?php echo $row['no_of_item']?>" size="4" title="Qty" class="input-text qty" maxlength="12">
</td> -->
<!-- <td class="a-right movewishlist">
<span class="cart-price">
<span class="price"><?php if ($total>0) { echo "₹". $total; } ?></span>
</span>
</td> -->
<td class="a-center last">
<a onclick="delete_product(<?php echo $row['id']; ?>)" title="Remove item" class="button remove-item"><span><span>Remove item</span></span></a></td>
</tr>
<?php } } ?>
</tbody>
<tfoot class="hidden-xs">
<tr class="first last">
<td colspan="50" class="a-right last">
<!-- <button type="button" title="Continue Shopping" class="button btn-continue" onClick=""><span><span>Continue Shopping</span></span></button> -->
<a href="checkout.php" class="button btn-empty delbtn">Checkout</a>
<!-- <button type="submit" name="update_cart_action" value="update_qty" title="Update Cart" class="button btn-update"><span><span>Update Cart</span></span></button> -->
<!-- <button type="submit" name="delete_cart_action" value="empty_cart" title="Clear Cart" class="button btn-empty" id="empty_cart_button" ><span><span>Clear Cart</span></span></button> -->
<!-- <a href="delete_cart.php" class="button btn-empty delbtn">Clear Cart</a> -->
<a href="grid.php" class="button btn-empty delbtn">Continue Shopping</a>
</td>
</tr>
</tfoot>
<?php
}
else {
?>
<tbody>
<div class="empty">
<h5>Your cart is currently empty</h5><p>
Before proceed to checkout you must add some products to your shopping cart. You will find a lot of interesting products on our "Shop" page.</p>
<center><a href="home.php?" title="Remove item"><button class="btn empty_btn">Start Shopping</button></a></center></td>
</div>
<?php } ?>
</tbody>
</table>
</fieldset>
</div>
</div>
<?php
include('dbconnect.php');
// $home_id = $_SESSION['id'];
if($_SESSION['cart_id'] !='') {
$squery = "select * from product_cart where cart_id='$cart_id' AND status != 'confirm'";
$result = mysqli_query($conn,$squery);
$i=mysqli_num_rows($result);
//$j=1;
$grandtotal=0;
while( $row = mysqli_fetch_array($result))
{
$grandtotal=$grandtotal+$row['total'];
}
}
$grandtotal1=$grandtotal+30;
?>
<div class="col-md-4 col-sm-6 col-xs-12 pricedetails">
<!-- <h4>PAYMENT DETAILS</h4> -->
<!-- <div class="row ">
<div class="row item">
<div class="col-md-6 col-sm-6 col-xs-6 itemtotal">
<p>Total Item</p>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 itemtotalval">
<p><?php echo $i;?></p>
</div>
</div>
<div class="row item">
<div class="col-md-6 col-sm-6 col-xs-6 itemtotal">
<p>Delivery Charge</p>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 itemtotalval">
<p><i class="fa fa-inr" aria-hidden="true"></i>30</p>
</div>
</div>
<div class="row item">
<div class="col-md-6 col-sm-6 col-xs-6 itemtotal">
<p>Grand Total</p>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 itemtotalval">
<p><?php if ($grandtotal>0) { echo "₹". $grandtotal; } ?></p>
</div></div>
</div> -->
<!-- BEGIN CART COLLATERALS -->
<!--cart-collaterals-->
<!-- <div class="payment"> -->
<?php
if($i>0){ ?>
<table class="table order_table1">
<thead>
<th>
<h4>PAYMENT DETAILS</h4>
</th>
</thead>
<tbody>
<tr>
<td>
No Of Items:
</td>
<td>
<?php echo $i;?>
</td>
</tr>
<tr>
<td>
Total Amount
</td>
<td id="grand">
<?php if ($grandtotal>0) { echo "₹". $grandtotal; } ?>
</td>
</tr>
<tr>
<td>
Delivery Charge
</td>
<td>
<i class="fa fa-inr" aria-hidden="true"></i>30
</td>
</tr>
<tr>
<td>
<?php
if(isset($_SESSION['coupon'])){
$coupon=$_SESSION['coupon'];
?>
<div class="col-md-10 col-sm-10 col-xs-10">
<h5 class="total_savings" style="color: #000;
font-weight: 600;"><?php echo $coupon;?> Coupon Applied</h5>
</div>
<div class="col-md-2 col-sm-2 col-xs-2">
<form action="cancel_coupon.php" method="post">
<button class="btn" type="submit" style="background: #013969;
border: none;
border-radius: none;
border-radius: 0px;
color: #fff;
padding: 6px 21px;">CANCEL</button>
</form>
</div>
<?php
}
else
{
?>
<form action="coupon.php" method="post">
<div class="col-md-10 col-sm-10 col-xs-10">
<input type="text" name="coupon" class="form-control" placeholder="Apply Coupon">
</div>
<div class="col-md-2 col-sm-2 col-xs-2">
<button class="btn" type="submit" style="background: #013969;
border: none;
border-radius: none;
border-radius: 0px;
color: #fff;
padding: 6px 21px;">APPLY</button>
</div>
</form>
<?php
}
?>
</td>
</tr>
<tr>
<?php
if(isset($_SESSION['discount_rate'])){
$discount_rate=$_SESSION['discount_rate'];
?>
<td class="total_savings">
Total Savings
</td>
<td class="total_grand">
<?php if ($discount_rate>0) { echo "₹". $discount_rate; } ?>
</td>
<?php }
?>
</tr>
<tr>
<?php
if(isset($_SESSION['grand_total1'])){
$grand_to=$_SESSION['grand_total1'];
?>
<td class="total_grand">
Grand Total
</td>
<td class="total_grand grandtotal" >
<?php if ($grand_to>0) { echo "₹". $grand_to; } ?>
</td>
<?php }
else{
?>
<td class="total_grand">
Grand Total
</td>
<td class="total_grand grandtotal">
<?php if(isset($_SESSION['discount_rate'])) {
echo $grandtotal1-$_SESSION['discount_rate'];
} else { ?>
<?php if ($grandtotal1>0) { echo "₹". $grandtotal1; } }?>
</td>
<?php
}
?>
</tr>
</tbody>
</table>
<?php }?>
<!-- </div> -->
</div>
</div>
</div>
</div> <!--cart-->
</div><!--main-container-->
</div> <!--col1-layout-->
<!-- For version 1,2,3,4,6 -->
<div class="hidden-xs">
<?php
include('footer.php');
?></div>
</div><!--main-container-->
<?php
if($i>0){ ?>
<div class="hidden-lg hidden-md hidden-sm">
<!-- End For version 1,2,3,4,6 -->
<footer">
<!-- BEGIN INFORMATIVE FOOTER -->
<!--container-->
<!--footer-inner-->
<!--footer-middle-->
<div class="footer-top1">
<div class="container">
<div class="row">
<div class="col-sm-12 col-xs-12 coppyright"> © 2020 All Rights Reserved. Develop by<a href="http://ephphathasoftech.com/" target="blank">Ephphatha Softech.</a> </div>
</div>
</div>
</div>
<!--footer-bottom-->
<!-- BEGIN SIMPLE FOOTER -->
</footer>
<div class="container-fluid hidden-lg hiddem-md">
<div class="row fix2">
<div class="d-md-none d-sm-none col-xs-6 fix-row3">
<?php if(isset($_SESSION['name'])){?>
<a href="grid.php">
CONTINUE SHOPPING
</a>
<?php }
else
{?>
<a href="product_grid.php">
CONTINUE SHOPPING
</a>
<?php }?>
</div>
<div class="d-md-none d-sm-none col-xs-6 fix-row3"><a href="checkout.php">
CONFIRM ORDER</a>
</div>
</div>
<!-- <div class="row">
<div class="coppyright"> © 2020 All Rights Reserved. Develop by<a href="http://ephphathasoftech.com/" target="blank">Ephphatha Softech.</a> </div>
</div> -->
</div>
</div>
</div>
<?php }
else {?>
<div class="hidden-lg hidden-md hidden-sm">
<!-- End For version 1,2,3,4,6 -->
<!-- <footer">
<div class="footer-top1">
<div class="container">
<div class="row">
<div class="col-sm-12 col-xs-12 coppyright"> © 2020 All Rights Reserved. Develop by<a href="http://ephphathasoftech.com/" target="blank">Ephphatha Softech.</a> </div>
</div>
</div>
</div>
</footer> -->
<div class="container-fluid hidden-lg hiddem-md">
<div class="row fix2">
<!-- <div class="d-md-none d-sm-none col-xs-6 fix-row3"><a href="shopping_cart.php">
COFIRM ORDER</a>
</div> -->
<div class="d-md-none d-sm-none col-xs-12 fix-row3"><a href="grid.php">
<?php if(isset($_SESSION['name'])){?>
<a href="grid.php">
CONTINUE SHOPPING
</a>
<?php }
else
{?>
<a href="product_grid.php">
CONTINUE SHOPPING
</a>
<?php }?>
</div>
</div>
<!-- <div class="row">
<div class="coppyright"> © 2020 All Rights Reserved. Develop by<a href="http://ephphathasoftech.com/" target="blank">Ephphatha Softech.</a> </div>
</div> -->
</div>
</div>
</div><?php }?>
<!--page-->
<!-- Mobile Menu-->
<?php
include('mobile-menu.php');
?>
<a href="#" id="toTop" style="display: block;"><span class="fa fa-arrow-up"></span></a>
<!-- JavaScript -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/parallax.js"></script>
<script type="text/javascript" src="js/revslider.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/jquery.bxslider.min.js"></script>
<script type="text/javascript" src="js/jquery.flexslider.js"></script>
<script type="text/javascript" src="js/owl.carousel.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-menu.min.js"></script>
<style type="text/css">
.empty h5{
font-size: 25px;
color: #013969;
font-weight: 600;
text-align: center;
padding-top: 5px;
}
.empty p{
margin: 0 0 10px;
text-align: center;
padding: 10px;
font-size: 15px;
}
.empty_btn{
background: #013969;
color: #fff;
font-size: 15px;
border-radius: 18px;
align-items: center;
margin-bottom: 10px;
}
}
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: scroll; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
/* Modal Content */
.modal-content {
background-color: #f9fbf9;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 50%;
}
@media (min-width: 280px) and (max-width: 580px){
.modal-content {
width: 100%;
}
}
/* The Close Button */
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
#myBtn{
background: none;
border: none;
}
.coupon_border{
border-bottom: 1px dotted #bdbdc4;
}
.coupon_code{
font-weight: 600;
font-size: 15px;
color: #000;
}
.coupon_button{
display: inline-block;
background-color: #efecec;
font-size: 13px;
text-align: center;
white-space: nowrap;
font-weight: 500;
border: none;
letter-spacing: 0.5px;
padding: 12px 20px 10px 20px;
font-family: 'Rubik', sans-serif;
background: #013969;
color: #fff;
}
.total_savings{
color: green;
}
.coupon_close{
text-align: center;
padding: 10px;
}
.blinking{
animation:blinkingText 1.2s infinite;
font-size: 29px;
/* line-height: 16px; */
margin-bottom: 10px;
}
@keyframes blinkingText{
0%{ color: #013969; }
49%{ color: #013969; }
60%{ color: #ed6663; }
99%{ color: #ed6663; }
100%{ color: #013969; }
}
</style>
<!-- <script type="text/javascript">
$(function () {
$("#check_account").click(function () {
if ($(this).is(":checked")) {
$("#coupon").removeAttr("disabled");
$("#coupon_send").removeAttr("disabled");
// $("#txtPassportNumber").focus();
} else {
$("#coupon").attr("disabled", "disabled");
$("#coupon_send").attr("disabled", "disabled");
}
});
});
</script> -->
<script>
// Get the modal
var modal = document.getElementById("myModal");
// Get the button that opens the modal
var btn = document.getElementById("myBtn");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks the button, open the modal
btn.onclick = function() {
modal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
function delete_product(id)
{
var grand = $("#grand").text();
var grandtotal = $(".grandtotal").text();
$("#grand").text('');
$(".grandtotal").text('');
$.ajax({
url: 'delete_product.php',
data: {id:id},
type: 'post',
async: false,
dataType: 'json',
success:function(data){
$("#delete_product"+id).text('');
if(data.grand > 0) {
$("#grand").text('₹'+data.grand);
$(".grandtotal").text('₹'+data.grandtotal);
} else {
$("#grand").text('₹'+grand);
$(".grandtotal").text('₹'+grandtotal);
} if(data.count==0) {
window.location.reload();
}
console.log(data.count);
}
});
}
function stepup(id) {
var qty = $("#quantity"+id).val();
var quantity = parseInt(qty)+1;
var price = $("#price"+id).text();
var grand = $("#grand").text();
var grandtotal = $(".grandtotal").text();
$("#grand").text('');
$(".grandtotal").text('');
$.ajax({
url: 'edit_cart.php',
data: {id:id,quantity:quantity},
type: 'post',
async: false,
dataType: 'json',
success:function(data){
if(data.limit == 0) {
alert('Limited Stocks are available !');
$("#quantity"+id).val(qty);
$("#price"+id).text(price);
} if(data.total > 0) {
$("#quantity"+id).val(quantity);
$("#price"+id).text('₹'+data.total);
console.log(data.grandtotal);
} if(data.grand > 0) {
$("#grand").text('₹'+data.grand);
$(".grandtotal").text('₹'+data.grandtotal);
} else {
$("#grand").text('₹'+grand);
$(".grandtotal").text('₹'+grandtotal);
}
}
});
}
function stepdown(id) {
var qty = $("#quantity"+id).val();
var quantity = parseInt(qty)-1;
var price = $("#price"+id).text();
var grand = $("#grand").text();
var grandtotal = $(".grandtotal").text();
$("#grand").text('');
$(".grandtotal").text('');
$.ajax({
url: 'edit_cart.php',
data: {id:id,quantity:quantity},
type: 'post',
async: false,
dataType: 'json',
success:function(data){
if(data.limit == 0) {
alert('Limited Stocks are available !');
$("#quantity"+id).val(qty);
$("#price"+id).text(price);
} if(data.total > 0) {
$("#quantity"+id).val(quantity);
$("#price"+id).text('₹'+data.total);
console.log(data.grandtotal);
} if(data.grand > 0) {
$("#grand").text('₹'+data.grand);
$(".grandtotal").text('₹'+data.grandtotal);
} else {
$("#grand").text('₹'+grand);
$(".grandtotal").text('₹'+grandtotal);
}
}
});
}
</script>
</body></html>
<?php
unset($_SESSION['error']);
?>