-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayoffline.php
More file actions
177 lines (169 loc) · 3.75 KB
/
Copy pathpayoffline.php
File metadata and controls
177 lines (169 loc) · 3.75 KB
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
<?php
include("inc/header.php");
?>
<?php
$login = Session::get('cslogin');
if ($login == false) {
header("Location: login.php");
}
?>
<?php
if (isset($_GET['orderid']) && $_GET['orderid']=='order') {
$csid = Session::get('csid');
$insertOrder = $csmr->orderProduct($csid);
$delCart = $ct->delCustomerCart();
header("Location: success.php");
}
?>
<style>
.errpage{
text-align: center;
font-size: 100px;
color: red;
}
.division{
width: 510px;
float: left;
overflow: hidden;
}
.tbl_two{
overflow: hidden;
display: block;
padding: 20px;
background: #ddd;
}
.ordernow a{
text-decoration: none;
text-align: center;
display: block;
padding: 20px;
color: #fff;
font-size: 20px;
background: green;
width: 100px;
margin: 0 auto;
border-radius: 5px;
}
</style>
<div class="main">
<div class="content">
<div class="section group">
<div class="division">
<!-- Cart info -->
<table class="tblone">
<tr>
<th width="5%">No</th>
<th width="20%">Product Name</th>
<th width="15%">Price</th>
<th width="25%">Quantity</th>
<th width="20%">Total</th>
</tr>
<?php
$getProd = $ct->getCartProduct();
if ($getProd) {
$sum = 0;
$qty = 0;
$i = 1;
while ($cartpd = $getProd->fetch_assoc()) {
?>
<tr>
<td><?php echo $i?></td>
<td><?php echo $cartpd['productName'];?></td>
<td>$ <?php echo $cartpd['price'];?></td>
<td><?php echo $cartpd['quantity'];?></td>
<td><?php
$sp = $cartpd['price'];
$qn = $cartpd['quantity'];
$total = $sp*$qn;
echo $total;
?></td>
</tr>
<?php
$sum = $total+$sum;
$qty = $qty+ $cartpd['quantity'];
?>
<?php $i++; } } ?>
</table>
<!-- grand total table -->
<table class="tbl_two" style="float:right;text-align:left;" width="50%">
<tr>
<th>Sub Total : </th>
<td>TK. <?php echo $sum; ?></td>
</tr>
<tr>
<th>VAT :</th>
<th> 10% </th>
</tr>
<tr>
<th>Grand Total :</th>
<td>TK. <?php
$vat = ($sum*10)/100;
echo $grandTotal = $sum+$vat;
?></td>
</tr>
<th>Quantity :</th>
<th> <?php echo $qty; ?></th>
</tr>
</table>
</div>
<!-- Divided cart info and customer info -->
<div class="division">
<!-- Customer info -->
<?php
$csid = Session::get('csid');
$getCsInfo = $csmr->getCustomerInfo($csid);
if ($getCsInfo) {
while ($row = $getCsInfo->fetch_assoc()) {
?>
<table class="tblone">
<tr><td colspan='3'><h2 style="text-align:center">Your profile details</h2></td></tr>
<tr>
<td>Name</td>
<td>:</td>
<td><?php echo $row['name'];?></td>
</tr>
<tr>
<td>City</td>
<td>:</td>
<td><?php echo $row['city'];?></td>
</tr>
<tr>
<td>Zip</td>
<td>:</td>
<td><?php echo $row['zip'];?></td>
</tr>
<tr>
<td>E-mail</td>
<td>:</td>
<td><?php echo $row['email'];?></td>
</tr>
<tr>
<td>Address</td>
<td>:</td>
<td><?php echo $row['address'];?></td>
</tr>
<tr>
<td>Country</td>
<td>:</td>
<td><?php echo $row['country'];?></td>
</tr>
<tr>
<td>Phone</td>
<td>:</td>
<td><?php echo $row['phone'];?></td>
</tr>
<tr><td colspan='3'><h2 style="text-align:center"><button ><a href="editprofile.php">Edit profile</a></button></h2></td></tr>
</table>
<?php } }?>
</div>
</div>
<div class="ordernow">
<a href="?orderid=order">Order Now</a>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<?php
include("inc/footer.php");
?>