forked from AnkDos/The-Canteen-Project
-
Notifications
You must be signed in to change notification settings - Fork 1
/
getorder.php
executable file
·217 lines (134 loc) · 4.12 KB
/
getorder.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
<?php
ob_start();
session_start();
require_once 'dbconnect.php';
if( !isset($_SESSION['user']) ) {
header("Location: index.php");
exit;
}
$ses=$_SESSION['user'];
$res=mysql_query("SELECT * FROM goods WHERE UID=$ses order by order_num desc");
$fetch=mysql_query("SELECT * FROM users WHERE userId=".$_SESSION['user']);
$userRow=mysql_fetch_array($fetch);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="Smart Cart 2 - a javascript jQuery shopping cart plugin" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome - <?php echo $userRow['userEmail']; ?></title>
<!-- Smart Cart Files Include -->
<link href="styles/smart_cart.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.smartCart-2.0.js"></script>
<script type="text/javascript">
$(document).ready(function(){
// Call Smart Cart
$('#SmartCart').smartCart();
});
</script>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all">
<link href="css/style.css" rel="stylesheet" type="text/css" media="all"/>
</head><body>
<header>
<div class="header-bottom">
<div class="fixed-header">
<div class="container">
<div class="top-menu">
<span class="menu"><img src="images/nav.png" alt=""/> </span>
<ul>
<nav class="cl-effect-5">
<li><a href="index.php"><span data-hover="Home">home</span></a></li>
<?php
if( !isset($_SESSION['user']) ) {
?>
<li><a href="index.php">signin</a></li>
<?
}
else{
?>
<li> <span data-hover="Home"><a>HI <?php echo $userRow['userName'];?></a></li>
<?
}
?>
<li><a class="scroll" href="#about"><span data-hover="help">assist</span></a></li>
<li><a href="home.php"><span data-hover="food">menu/cart</span></a></li>
</ul>
<!-- script for menu -->
<!--script-nav-->
<script>
$("span.menu").click(function(){
$(".top-menu ul").slideToggle("slow" , function(){
});
});
</script>
<!-- //script for menu -->
<!-- //script-for sticky-nav -->
</div>
</div>
</div>
</div>
</header>
<style>
table {
border-collapse: collapse;
width: 100%;
}
th, td {
text-align: left;
padding: 8px;
font-size:11px;
}
tr:nth-child(even){background-color: #f2f2f2}
th {
background-color: #4CAF50;
color: white;
}
</style>
<table>
<tr>
<th>Pname</th>
<th>quantity</th>
<th>TOTAL</th>
<th>order_DT</th>
<th>delivery_status</th>
<th>Bill</th>
</tr>
<?php
//Qr Code Part
require_once("qrcode.php");
//---------------------------------------------------------
// if(isset($_GET['order']))
// {
// }
$i=0;
//
while($row = mysql_fetch_array($res))
{
$pname =$row['Pname'];
$mname =$row['quantity'];
$jname =$row['TOTAL'];
$sname =$row['order_DT'];
$ab=$row['delivery_status'];
$on=$row['order_num'];
$qr = QRCode::getMinimumQRCode("Product : ".$pname ."\n"."Quantity : ". $mname."\n"."Total : ".$jname."\n"."Date/Time :".$sname."\n "."Order Num :".$on,QR_ERROR_CORRECT_LEVEL_L);
?>
<tr>
<td> <?php echo $pname; ?></td>
<td> <?php echo $mname; ?></td>
<td> <?php echo $jname; ?></td>
<td> <?php echo $sname; ?></td>
<td> <?php echo $ab; ?></td>
<td> <?
if($ab=="NOT DELIVERED"){
$qr->printHTML(); } ?> </td>
<?
}
?>
</td>
</tr>
</table><center>
<font face='monotype corosiva' size="5">WALLET BALANCE : <?php echo $userRow['Wallet_Bal']; ?><br>
<a href="logout.php?logout"><span class="glyphicon glyphicon-log-out"></span> Sign Out</a>
</center>