-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart.php
executable file
·247 lines (234 loc) · 9.14 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<?php
session_start();
include 'controller/cp_cart.php';?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include'script.php';?>
</script>
</head>
<body>
<?php include 'links.php';?>
<div class="bg-light py-3">
<div class="container">
<div class="row">
<div class="col-md-12 mb-0">
<a href="index.php">Home</a> <span class="mx-2 mb-0">/</span>
<strong class="text-black">Cart</strong>
</div>
</div>
</div>
</div>
<div class="site-section">
<div class="container">
<div class="row mb-5">
<div class="site-blocks-table">
<table class="table table-bordered">
<thead>
<tr>
<th class="product-thumbnail">Image</th>
<th class="product-name">Product Name</th>
<th class="product-price">Price</th>
<th class="product-total">Total</th>
<th class="product-quantity">Quantity</th>
<th class="product-remove">Update Quantity</th>
<th class="product-remove">Remove</th>
</tr>
</thead>
<tbody>
<?php
$total=0;
$subtotal=0;
if(empty($cart_view))
{
echo '<tr>
<td colspan="7"><img src="cart_img/c1.png" alt="image not found" height="200px" width="200px" /></td>
</tr>';
}
else
{ $pre='';
foreach ($cart_view as $item){
if($item->u_pre=="yes")
{
$pre="yes";
}
?>
<tr>
<td class="product-thumbnail">
<img src="admin/productimg/<?php echo $item->image; ?>" alt="Image" class="img-fluid" name="pimg" height="100px" width="100px">
</td>
<td class="product-name">
<h2 class="h5 text-black"><?php echo $item->p_name; ?></h2>
</td>
<td>RS/-<?php echo $item->p_price; ?></td>
<td>RS/-
<?php
$total=$item->p_qty * $item->p_price;
echo $total;
?>
<form action="cart.php?aaa=update&Uid=<?php echo $item->p_id;?>" method="post">
<td><select name="drop1" class="form-control dropdown-item">
<?php
for($i=1;$i<=$item->qty;$i++)
{
?>
<option value="<?php echo $i; ?>"
<?php if($item->p_qty==$i)
echo "selected"; ?> >
<?php echo $i;?>
</option>
<?php
}
?>
</option>
</td>
<td><input type="submit" name="sub" class="btn btn-primary height-auto btn-sm" value="update"/>
</td>
</form>
<td><a href="cart.php?aaa=delete&did=<?php echo $item->p_id; ?>" class="btn btn-primary height-auto btn-sm">X</a>
</td>
</tr>
<?php
$subtotal+=$total;
}
}
?>
</form>
</tbody>
</table>
</div>
</div>
<form method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-md-6">
<?php
if(!empty($pre))
{
if($pre=="yes")
{ ?>
<div class="row mb-5">
<div class="col-md-12">
<div class="col-md-6" style="float: left;"><a href="#" class="btn btn-info ">Upload Prescription:</a></div>
<div class="col-md-6 mb-3 mb-md-0" style="float: left;">
<input type="file" name="fname" />
<p style="color: red" ><?php echo $val5;?> </p>
</div>
</div>
</div>
<?php
}
} ?>
<div class="row mb-5">
<div class=""><a href="shop.php" class="btn btn-info ">Continue shopping</a></div>
</div>
</div>
<div class="col-md-6 pl-5">
<div class="row justify-content-end">
<div class="col-md-7">
<div class="row">
<div class="col-md-12 text-right border-bottom mb-5">
<h3 class="text-black h4 text-uppercase">Cart Totals</h3>
</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<span class="text-black">Subtotal</span>
</div>
<div class="col-md-6 text-right">
<strong class="text-black">
<?php echo $subtotal;?>
</strong>
</div>
</div>
<div class="row mb-5">
<div class="col-md-6">
<span class="text-black">Shipping Charge</span>
</div>
<div class="col-md-6 text-right">
<strong class="text-black">
<?php
if(!empty($cart_view))
{
if($subtotal<500)
{
$sc=49;
echo $sc;
}
else
{
$sc=0;
echo $sc;
}
}
else
{
echo $sc=0;
}
?>
</strong>
</div>
</div>
<div class="row mb-5">
<div class="col-md-6">
<span class="text-black">Total</span>
</div>
<div class="col-md-6 text-right">
<strong class="text-black"><?php
echo $sc+$subtotal; ?></strong>
</div>
</div>
<div class="row">
<div class="col-md-12">
<?php
if(!empty($cart_view))
{
if(!empty($pre))
{
if($pre=="yes"){
?>
<button type="submit" class="btn btn-primary btn-lg btn-block" name="sub123">Proceed To Checkout</button>
<?php
}
}
else
{
?>
<a href="checkout.php">
<button type="button" class="btn btn-primary btn-lg btn-block" name="yyyy">Proceed To Checkout</button></a>
<?php
}
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<div class="site-section bg-secondary bg-image" style="background-image: url('images/bg_2.jpg');">
<div class="container">
<div class="row align-items-stretch">
<div class="col-lg-6 mb-5 mb-lg-0">
<a href="#" class="banner-1 h-100 d-flex" style="background-image: url('images/bg_1.jpg');">
<div class="banner-1-inner align-self-center">
<h2>Pharma Products</h2>
</div>
</a>
</div>
<div class="col-lg-6 mb-5 mb-lg-0">
<a href="#" class="banner-1 h-100 d-flex" style="background-image: url('images/bg_2.jpg');">
<div class="banner-1-inner ml-auto align-self-center">
<h2>Rated by Experts</h2>
</div>
</a>
</div>
</div>
</div>
</div>
<?php include'footer_user.php';?>
</div>
</body>
</html>