-
Notifications
You must be signed in to change notification settings - Fork 0
/
cart.php
238 lines (193 loc) · 4.67 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
<?php
session_start();
if($_SESSION['CName']==NULL)
header("location:index.php")
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="favicon.ico">
<title>My Cart</title>
</head>
<body>
<div id = 'heading'>
<?php echo ucwords($_SESSION['CName'].'\'s Cart');
?>
</div>
<div class='thetable'>
<?php
$conn=mysqli_connect("localhost","root","","russianggdb");
$result=mysqli_query($conn,"select * from cart");
if(mysqli_num_rows($result))
{
$query="select Prod_Name, Prod_Price, Prod_Quantity, Cum_Price from cart where 1 order by Prod_Name";
$result=mysqli_query($conn,$query);
$num = mysqli_num_rows($result);
echo '
<table class=cartTable>
<tr>
<td>Item Name</td>
<td>Price per kg</td>
<td>Quantity</td>
<td>Final Price</td>
</tr>';
for($i=0;$i<$num;$i++)
{
$row=mysqli_fetch_assoc($result);
echo '
<tr>
<td>'.$row['Prod_Name'].'</td>
<td align="right">₹ '.$row['Prod_Price'].'</td>
<td align=center>'.$row['Prod_Quantity'].'</td>
<td align="right">₹ '.$row['Cum_Price'].'</td>
<tr>';
}
$sql=mysqli_query($conn,"CALL FINALBILL()");
$row=mysqli_fetch_assoc($sql);
$billamount=$row['billamount'];
echo '
<tr>
<td colspan=3>Total Payable Amount (cash only)</td>
<td align=right>₹ '.$billamount.'
</table>';
mysqli_close($conn);
}
else
{
header("Location:emptycart.php");
}
?>
</div>
<a href="shopping.php"><div id=backbutton><img src="images/back.png" width=61.5px height=61.5px></div></a>
<a href="deliveryinfo.php"><div id=orderbutton><img src="images/order.png" width=61.5px height=61.5px></div></a>
<div id=footText>
<span id=copyright>©</span>2019 SANTOSH PANDEY | ALL RIGHTS RESERVED | RGG™
</div>
</body>
</html>
<style>
@font-face { font-family: "XiaoWei";
src: url('fonts/XiaoWei.ttf'); }
@font-face { font-family: "Comfortaa";
src: url('fonts/Comfortaa.ttf'); }
@font-face {font-family: 'creteround';
src:url('fonts/Crete_Round/CreteRound-Regular.ttf');}
@font-face {font-family: 'OldStandard';
src:url('fonts/Old Standard/OldStandardTT-Regular.ttf');}
body {
margin:0;
background-image: url("background-images/green-bg.jpg");
background-size: 120vmax;
background-attachment: fixed;
}
#heading{
text-shadow:0px 0px 2px black,0px 0px 2px black,0px 0px 15px black;
color:rgb(240,240,240);
border-radius:20px;
font-size:45px;
background-color:rgb(0,0,0,0.7);
width:fit-content;
display:absolute;
margin:0 auto;
padding:10px 25px;
font-family: impact;
letter-spacing:1.4px;
box-shadow:3px 3px 16px black;
border-top:rgb(100,100,100), 0.5px solid;
border-left:rgb(50,50,50), 0.5px solid;
border-right:white 1px solid;
border-bottom:white 0.5px solid;
margin-top:1vw;
margin-bottom:3vw;
}
#backbutton{
display:inline;
position:absolute;
margin:35px auto;
cursor: pointer;
left:2vw;
top:0.4vw;
width:61.5px;
height:61.5px;
}
#backbutton:active{
transform:translateY(2px);
}
#orderbutton{
display:inline;
position:absolute;
margin:35px auto;
cursor: pointer;
right:2vw;
top:0.4vw;
width:61.5px;
height:61.5px;
}
#orderbutton:active{
transform:translateY(2px);
}
.cartTable{
margin:1vw;
font-weight:700;
background-color:rgb(11,11,11,0.93);
font-size:31px;
border:0;
border-radius:7px;
text-shadow:0px 0px 5px black;
font-family:comfortaa;
margin-top:0;
}
.cartTable:hover{
background-color:rgb(0,0,0,0.95);
}
.cartTable td {
border:2px #ff6200 solid;
padding:12px;
color:#ffc5a1;
border-radius:6px;
}
.thetable{
overflow-y:auto;
height:500px;
position:absolute;
top:55%;
left:50%;
transform:translate(-50%,-50%);
width:fit-content;
}
.thetable::-webkit-scrollbar{
width:25px;
}
.thetable::-webkit-scrollbar-thumb{
background-color:rgb(209,77,0);
}
.thetable::-webkit-scrollbar-track{
background-color:rgba(0,0,0,0.9 );
}
/*styling the footer*/
#footText {
color:white;
position:fixed;
bottom:0;
left:0;
right:0;
background-image: linear-gradient(to right,rgb(0,0,0,.5),rgb(0,0,0,.2),rgba(0, 0, 0, 0.7),rgba(0, 0, 0, 0.7),rgba(0, 0, 0, 0.7),rgb( 0, 0,0,0.7),rgb(0,0,0,.2),rgb(0,0,0,.5));
font-family: xiaowei;
text-align: center;
font-size: 14px;
letter-spacing: 7px;
padding: 2px;
margin: 0 4px;
margin-bottom: 2px;
margin-top: 1vw;
border-radius: 10px;
text-shadow:0px 0px 50px black;
}
#copyright{
font-size: 18px;
vertical-align: -.75px;
text-shadow:0px 0px 10px black;
}
</style>