-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewcart.php
73 lines (68 loc) · 2.83 KB
/
viewcart.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
<!DOCTYPE html>
<html>
<head>
<title>Students Space</title>
<?php include 'head.php'; ?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<?php include 'header.php'; ?>
<div class="container-fluid row text-center">
<div class="col-md-12">
<h2 class="mb-4" style="margin-top: 30px">
Your Shopping Cart
</h2>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Course Name</th>
<th>Course Price</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$q = mysqli_query($con, "select * from tblcart,tblcourse where tblcourse.courseid=tblcart.courseid and uid='" . $_SESSION['uid'] . "' and status='0'");
while ($r = mysqli_fetch_array($q)) {
?>
<tr>
<td><?php echo $r['coursename']; ?></td>
<td>
₹<?php $z += $r['coursedprice'];
echo $r['coursedprice']; ?>/-
</td>
<td>
<a href="delete.php?id=<?php echo $r['cartid']; ?>" class="btn btn-danger btn-sm"><i class="fa fa-trash"></i> Remove</a>
</td>
</tr>
<?php } ?>
<tr>
<td colspan="2" class="text-right">
<strong>Total Bill:</strong>
</td>
<td>₹<?php echo $z; ?>/-</td>
</tr>
</tbody>
</table>
<div class="text-center">
<?php if (isset($_SESSION['uid'])) { ?>
<table class="table">
<tr>
<td>
<a href="bill.php?id=<?php echo $r1['addressid']; ?>" class="btn btn-success">Proceed to Checkout</a>
</td>
</tr>
</table>
<?php } else { ?>
<p class="lead">
Please <a href="register.php">signup</a> or
<a href="login.php">login</a> to proceed to checkout.
</p>
<?php } ?>
</div>
</div>
</div>
<?php include 'footer.php'; ?>
</body>
</html>