/
cart.php
executable file
·171 lines (151 loc) · 7.02 KB
/
cart.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
session_start();
// error_reporting( error_reporting() & ~E_NOTICE );
?>
<!doctype html>
<head>
<meta charset="utf-8">
<title>Mexcellent Cart- Stephanie Garay</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="css/gridiculous.css">
<link rel="stylesheet" href="css/styles.css">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-56803382-1', 'auto');
ga('send', 'pageview');
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
$(function() {
var pull = $('#pull');
menu = $('nav ul');
menuHeight = menu.height();
$(pull).on('click', function(e) {
e.preventDefault();
menu.slideToggle();
});
$(window).resize(function(){
var w = $(window).width();
if(w > 320 && menu.is(':hidden')) {
menu.removeAttr('style');
}
});
});
</script>
</head>
<body>
<!--Header-->
<?php include("includes/header.php"); ?>
<!--Content-->
<div id="site-content">
<div id="cartPage" class="grid">
<div id="cartTitle" class="c12">
<h3 class="subheadings">SHOPPING CART</h3>
</div>
<div class="row">
<div id="cartTable" class="c8">
<!-- <?php
// echo "Number of Items in the cart = ".sizeof($_SESSION['cart'])."<br />";
// while (list ($key, $val) = each ($_SESSION['cart'])) {
// echo "$key -> $val <br>";
// }
?> -->
<table>
<tr>
<th></th>
<th>Item</th>
<th>Price</th>
<th>Edit</th>
</tr>
<?php
echo "<tr>
<td><img src='img/".$_SESSION["image"]."' alt=''></td>
<td>".$_SESSION["product"]."</td>
<td>".$_SESSION["price"]."</td>
<td><form method='post' action='backend/updateCart.php'><input type='submit' value='Remove' /></form></td>
</tr>";
?>
</table>
</div>
<div id="pickupCheckout" class="c4">
<div id="checkout">
<h4>CHECKOUT TOTAL:</h4>
<p id="totalAmount"><?php echo $_SESSION["price"]; ?></p>
<!-- <a href="signin.php" id="buyButton" >CHECKOUT</a> -->
<?php
$userSession = $_SESSION['currentUser'];
$query = "SELECT * FROM Users WHERE Email ='$userSession'";
$result = mysqli_query($con,$query);
$row = mysqli_fetch_array($result);
?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="<?php echo $userSession; ?>" />
<input type="hidden" name="item_name_1" value="<?php echo $_SESSION['product']; ?>" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="amount_1" value="<?php echo $_SESSION['price']; ?>" />
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
</div>
</div>
</div>
<div id="recommmendedProducts">
<h3 class="c12">Recently Viewed</h3><hr/>
<div id="productSection" class="row">
<div id="productImages" >
<div class="c2">
<div class="productThumb">
<img src="img/nachos.jpg" alt="nachos">
<a href="nachosProduct.php"><h3 class="productTitle">Cheesy Nachos</h3></a>
<p>$8.95</p>
</div>
</div>
<div class="c2">
<div class="productThumb">
<img src="img/quesadilla.jpg" alt="nachos">
<a href="quesadillaProduct.php"><h3 class="productTitle">Quesadilla</h3></a>
<p>$8.95</p>
</div>
</div>
<div class="c2">
<div class="productThumb">
<img src="img/taquitos.jpg" alt="nachos">
<a href="taquitosProduct.php"><h3 class="productTitle">Taquitos</h3></a>
<p>$8.95</p>
</div>
</div>
<div class="c2">
<div class="productThumb">
<img src="img/locosTacos.jpg" alt="taco">
<a href="locostacosProduct.php"><h3 class="productTitle">Locos Tacos</h3></a>
<p>$7.95</p>
</div>
</div>
<div class="c2">
<div class="productThumb">
<img src="img/burrito.jpg" alt="burrito">
<a href="burritoProduct.php"><h3 class="productTitle">Burrito</h3></a>
<p>$8.95</p>
</div>
</div>
<div class="c2">
<div class="productThumb">
<img src="img/tostadas.jpg" alt="tostadas">
<a href="tostadosProduct.php"><h3 class="productTitle">Tostados</h3></a>
<p>$7.95</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Footer-->
<?php include("includes/footer.php"); ?>
</body>
</html>