-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathheader.inc.php
246 lines (246 loc) · 9.32 KB
/
header.inc.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
<?php
session_start('air');
?>
<?php include("connection.inc.php"); ?>
<?php
if (!isset($_SESSION['matric'])) {
header ('Location: login.php');
}
date_default_timezone_get();
?>
<?php include("date.inc.php"); ?>
<!DOCTYPE html>
<html lang="en" class=" ">
<head>
<meta charset="utf-8" />
<title>Welcome To Cette</title>
<meta name="description" content="web app, meals, e-wallet" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="stylesheet" href="css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="css/animate.css" type="text/css" />
<link rel="stylesheet" href="css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="css/icon.css" type="text/css" />
<link rel="stylesheet" href="css/font.css" type="text/css" />
<link rel="stylesheet" href="css/app.css" type="text/css" />
<link rel="stylesheet" href="js/datatables/datatables.css" type="text/css"/>
<!--[if lt IE 9]>
<script src="js/ie/html5shiv.js"></script>
<script src="js/ie/respond.min.js"></script>
<script src="js/ie/excanvas.js"></script>
<![endif]-->
</head>
<body onload="myFunction()" class="container" style="background-color:#fff;width: 1000px;margin: auto;">
<script>
// function myFunction() {
// window.print();
// }
</script>
<section class="vbox">
<header class="bg-info header header-md navbar navbar-fixed-top-xs box-shadow">
<div class="navbar-header aside-md dk">
<a class="btn btn-link visible-xs" data-toggle="class:nav-off-screen" data-target="#nav">
<i class="fa fa-bars"></i>
</a>
<a href="index.php" class="navbar-brand">
<!-- <img src="images/logo_white.png" class="m-r-sm" alt="scale"> -->
<i class="fa fa-coffee"></i>
<span class="hidden-nav-xs">Cette</span>
</a>
<a class="btn btn-link visible-xs" data-toggle="dropdown" data-target=".user">
<i class="fa fa-cog"></i>
</a>
</div>
<ul class="nav navbar-nav hidden-xs">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="i i-grid"></i>
</a>
<section class="dropdown-menu aside-lg bg-white on animated fadeInLeft">
<div class="row m-l-none m-r-none m-t m-b text-center">
<div class="col-xs-4">
<div class="padder-v">
<a href="wallet.php">
<span class="m-b-xs block">
<i class="i i-mail i-2x text-primary-lt"></i>
</span>
<small class="text-muted">Wallet</small>
</a>
</div>
</div>
<div class="col-xs-4">
<div class="padder-v">
<a href="meals.php">
<span class="m-b-xs block">
<i class="fa fa-coffee i-2x text-info-lt"></i>
</span>
<small class="text-muted">Menu</small>
</a>
</div>
</div>
<?php
$username = $_SESSION['matric'];
$query44 = "SELECT * FROM user WHERE matric = '$username'";
$result44 = mysql_query($query44)
or die ("Couldn't execute query44.");
while ($row44 = mysql_fetch_array($result44,MYSQL_ASSOC))
{
if($row44['section'] == 'Admin'){
?>
<div class="col-xs-4">
<div class="padder-v">
<a href="users.php">
<span class="m-b-xs block">
<i class="fa fa-user i-2x text-info-lt"></i>
</span>
<small class="text-muted">Users</small>
</a>
</div>
</div>
<?php
}
}
?>
</div>
</section>
</li>
</ul>
<ul class="nav navbar-nav navbar-right m-n hidden-xs nav-user user">
<li class="hidden-xs">
<?php
$username = $_SESSION['matric'];
$query44 = "SELECT * FROM user WHERE matric = '$username'";
$result44 = mysql_query($query44)
or die ("Couldn't execute query44.");
while ($row44 = mysql_fetch_array($result44,MYSQL_ASSOC))
{
if($row44['section'] == 'Admin'){
?>
<a href="top_wallet.php" class="dropdown-toggle">
Top Up Wallet
</a>
<?php
} }
?>
</li>
<?php
$username = $_SESSION['matric'];
$query22 = "SELECT * FROM cart WHERE matric = '$username'";
$result22 = mysql_query($query22)
or die ("Couldn't execute query22.");
$cart = mysql_num_rows($result22);
?>
<li class="hidden-xs">
<a href="" class="dropdown-toggle" data-toggle="dropdown">
<i class="i i-cart"></i>
<span class="badge badge-sm up bg-info">
<?php
if ($cart == '0') {
echo '';
}else{
echo $cart;
}
?>
</span>
</a>
<section class="dropdown-menu aside-xl animated flipInY">
<section class="panel bg-white">
<div class="panel-heading b-light bg-light">
<strong>Your Orders</strong>
</div>
<div class="list-group-alt" id="cartsInner">
<?php
while ($row22 = mysql_fetch_array($result22,MYSQL_ASSOC))
{
$meal = $row22['meal'];
$query32 = "SELECT * FROM meals WHERE id = '$meal'";
$result32 = mysql_query($query32)
or die ("Couldn't execute query32.");
while ($row32 = mysql_fetch_array($result32,MYSQL_ASSOC))
{
?>
<a class="media list-group-item" style="display: block;">
<span class="pull-left thumb-sm text-center">
<i class="i i-cart fa-2x text-success"></i>
</span>
<span class="media-body block m-b-none">
<?php echo $row32['meal']; ?><br><small class="text-muted"><?php echo $row32['price']; ?></small>
</span>
</a>
<?php } } ?>
</div>
<div class="panel-footer text-sm">
<?php
$matric = $_SESSION['matric'];
$query = "SELECT SUM(amount) FROM cart WHERE matric='$matric'";
$result = mysql_query($query) or die(mysql_error());
$cartcount = mysql_num_rows($result);
while($row = mysql_fetch_array($result)){
$one = $row['SUM(amount)'];
if (!empty($one)) {
?>
<a class="pull-left">Total #<?php echo $one; ?> </a>
<a href="checkout.php" class="pull-right btn btn-info"><i class="fa fa-shopping-cart"></i> Checkout</a>
<?php
}
}
?>
</div>
</section>
</section>
</li>
<?php
$username = $_SESSION['matric'];
$query40 = "SELECT * FROM wallet WHERE matric = '$username'";
$result40 = mysql_query($query40)
or die ("Couldn't execute query40.");
while ($row40 = mysql_fetch_array($result40,MYSQL_ASSOC))
{
?>
<li class="hidden-xs">
<a class="dropdown-toggle" >
<i class="fa fa-credit-card"></i>
<span class="badge badge-sm up bg-info"><?php echo $row40['amount']; ?></span>
</a>
</li>
<?php
}
?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span class="thumb-sm avatar pull-left">
<img src="images/default-avatar.png" alt="...">
</span>
<?php
$username = $_SESSION['matric'];
$query44 = "SELECT * FROM user WHERE matric = '$username'";
$result44 = mysql_query($query44)
or die ("Couldn't execute query44.");
while ($row44 = mysql_fetch_array($result44,MYSQL_ASSOC))
{
?>
<?php echo $row44['firstname'] .' '. $row44['lastname']; ?><b class="caret"></b>
<?php
}
?>
</a>
<ul class="dropdown-menu animated fadeInRight">
<!-- <li>
<span class="arrow top"></span>
<a href="settings.php">Settings</a>
</li> -->
<li>
<a href="password.php">Change Password</a>
</li>
<li class="divider"></li>
<li>
<a href="logout.php">Logout</a>
</li>
</ul>
</li>
</ul>
</header>
<section>
<section class="hbox stretch">
<section id="content">
<section class="wrapper">
<div class="m-b">