forked from Karwann/Online-Grocery-shopping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselect.php
97 lines (81 loc) · 2.68 KB
/
select.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
include("connection.php");
error_reporting(0);
if(isset($_POST["id"])){
$output = '';
$q = "SELECT * FROM products WHERE product_id = '".$_POST["id"]."'";
$data= mysqli_query($conn, $q);
while($row = mysqli_fetch_array($data)){
$pro_id = $row['product_id'];
$pro_cat = $row['product_cat'];
$pro_brand = $row['product_brand'];
$pro_title = $row['product_title'];
$pro_price = $row['product_price'];
$pro_image = $row['product_image'];
$pro_desc = $row['product_desc'];
echo "
<div class='col-md-5 span-2'>
<div class='item'>
<img src='images/$pro_image' class='img-responsive' alt=''>
</div>
</div>
<div class='col-md-7 span-1'>
<h3>$pro_title</h3>
<p class='in-para'>$pro_desc </p>
<div class='price_single'>
<span class='reducedfrom'><del></del> Dinnar $pro_price</span>
<div class='clearfix'></div>
</div>
<h4 class='quick'>Quick Overview:</h4>
<p class='quick_desc'> $pro_desc </p>
<div class='add-to'>
<button class='btn btn-danger my-cart-btn my-cart-btn1' data-id='$pro_id' data-name='$pro_title' data-summary='summary' data-price='$pro_price' data-quantity='1' data-image='images/$pro_image'>Add to Cart</button>
</div>
</div>
<div class='clearfix'> </div>
";
}
}
?>
<script type="text/javascript">
$(document).ready(function() {
$().UItoTop({ easingType: 'easeOutQuart' });
});
</script>
<script type='text/javascript' src="admin/js/jquery.mycart.js"></script>
<script type="text/javascript">
$(function () {
var goToCartIcon = function($addTocartBtn){
var $cartIcon = $(".my-cart-icon");
var $image = $('<img width="30px" height="30px" src="' + $addTocartBtn.data("image") + '"/>').css({"position": "fixed", "z-index": "999"});
$addTocartBtn.prepend($image);
var position = $cartIcon.position();
$image.animate({
top: position.top,
left: position.left
}, 500 , "linear", function() {
$image.remove();
});
}
$('.my-cart-btn').myCart({
classCartIcon: 'my-cart-icon',
classCartBadge: 'my-cart-badge',
affixCartIcon: true,
checkoutCart: function(products) {
$.each(products, function(){
console.log(this);
});
},
clickOnAddToCart: function($addTocart){
goToCartIcon($addTocart);
},
getDiscountPrice: function(products) {
var total = 0;
$.each(products, function(){
total += this.quantity * this.price;
});
return total * 1;
}
});
});
</script>