This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
header.php
executable file
·333 lines (326 loc) · 12.6 KB
/
header.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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<!DOCTYPE html>
<html>
<head>
<title>AgMarket - Marketing Network for Agriculture Commodities</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no" />
<!--===============================================================================================-->
<link rel="icon" type="image/png" href="images/icons/favicon.png"/>
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href='vendor/jquery-bar-rating/dist/themes/fontawesome-stars.css' rel='stylesheet' type='text/css'>
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/themify/themify-icons.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/elegant-font/html-css/style.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css?v=1">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animsition/css/animsition.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/daterangepicker/daterangepicker.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/slick/slick.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/lightbox2/css/lightbox.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="css/util.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/alert/jAlert-v3.min.css" />
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="weather-icons/css/weather-icons.css" />
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="css/main.min.css?v=3">
<!--===============================================================================================-->
</head>
<body class="animsition">
<!-- Header -->
<header class="header1">
<!-- Header desktop -->
<div class="container-menu-header">
<div class="topbar">
<div class="topbar-social">
<a href="https://fb.me/in.AgMarket" class="topbar-social-item fa fa-facebook"></a>
<a href="https://www.instagram.com/agmarket.in" class="topbar-social-item fa fa-instagram"></a>
<a href="https://twitter.com/AgMarket_in" class="topbar-social-item fa fa-twitter"></a>
</div>
<span class="topbar-child1 noselect">
AgMarket - A Marketing Network for Agriculture Commodities
</span>
<div class="topbar-child2">
<span class="topbar-email">
help@agmarket.in
</span>
</div>
</div>
<div class="wrap_header">
<!-- Logo -->
<div class="logo">
<h1 class="notranslate">
<img src="images/icons/logo.png" alt="IMG-LOGO" />
<span class="text-success">Ag</span><span class="text-primary">Ma</span><span class="text-danger">rk</span><span class="text-warning">et</span>
</h1>
</div>
<!-- Menu -->
<div class="wrap_menu">
<nav class="menu">
<ul class="main_menu">
<?php
$index = "index";
$c = isset($_SESSION['customer']);
$v = isset($_SESSION['vendor']);
if($c) $index = "customer-index";
if($v) $index = "vendor-index";
?>
<li>
<a href="<?php echo $index; ?>.php">Home</a>
</li>
<?php
if($c) {
?>
<li>
<a href="product.php">Shop</a>
<ul class="sub_menu">
<li><a href="product.php?categoryid=1">Crops</a></li>
<li><a href="product.php?categoryid=2">Livestock</a></li>
<li><a href="product.php?categoryid=3">Machineries</a></li>
<li><a href="product.php?categoryid=4">Seeds</a></li>
</ul>
</li>
<?php
}
else if($v) {
?>
<li>
<a href="addcommodity.php">Add commodity</a>
</li>
<li>
<a href="weather.php">Weather Utility</a>
</li>
<?php
}
// Check if Android (in-app)
if(!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] != "in.agmarket") {
?>
<li>
<a href="https://bit.ly/agmarket-in" target="_blank">Download our App</a>
</li>
<?php
}
?>
<li>
<a href="about.php">About us</a>
</li>
<?php
if(!$c && !$v) {
?>
<li>
<a href="vendor-login.php">Vendor Portal</a>
</li>
<li>
<a href="customer-login.php">Customer Sign-in</a>
</li>
<?php
}
?>
</ul>
</nav>
</div>
<?php
if( $c | $v ) {
?>
<!-- Header Icon -->
<div class="header-icons">
<div class="header-wrapicon2">
<?php
if($c) {
$phone = $_SESSION["customer"];
$name = $_SESSION["name"];
$id = $_SESSION["id"];
$countorders = 0;
$countcart = 0;
$res = mysqli_query($db, "SELECT uid,count(uid) as countcart FROM cart WHERE uid='$id' GROUP BY uid");
if(mysqli_num_rows($res)>0) {
$first = mysqli_fetch_assoc($res);
$id = $first['uid']; // already in session. Redundant -,- but anyway..
$countcart = $first['countcart'];
}
$res = mysqli_query($db, "SELECT uid,count(uid) as countorders FROM orders WHERE uid='$id' and status not in ('done','cancelled','rejected') GROUP BY uid");
if(mysqli_num_rows($res)>0) {
$first = mysqli_fetch_assoc($res);
$countorders = $first['countorders'];
}
$url = "customer-orders";
}
elseif ($v) {
$phone = $_SESSION['vendor'];
$name = $_SESSION["name"];
$id = $_SESSION["id"];
$countorders = 0;
$res = mysqli_query($db, "SELECT v.id,count(v.id) as countorders FROM orders as o, commodities as c, vendors as v WHERE v.id = c.vid and o.comid = c.id and v.id='$id' and status not in ('done','cancelled','rejected') GROUP BY v.id");
if(mysqli_num_rows($res)>0) {
$first = mysqli_fetch_assoc($res);
$countorders = $first['countorders']; // Not Redundant for Vendor ID
}
$url = "vendor-orders";
}
?>
<a href="userprofile.php?<?php if($c) echo "customerid=".$id; if($v) echo "vendorid=".$id; ?>">
<img src="images/icons/icon-header-01.png" class="bg3 header-icon1" alt="ICON" />
</a>
</div>
<span class="linedivide1"></span>
<a href="<?php echo $url; ?>.php" class="header-wrapicon1 dis-block">
<img src="images/icons/icon-header-03.png" class="header-icon1" alt="ICON">
<span class="header-icons-noti"><?php echo $countorders; ?></span>
</a>
<?php
if($c) {
?>
<span class="linedivide1"></span>
<a href="cart.php" class="header-wrapicon1 dis-block">
<img src="images/icons/icon-header-02.png" class="bg3 header-icon1" alt="ICON" />
<span class="cartcount header-icons-noti"><?php echo $countcart; ?></span>
</a>
<?php
}
?>
<span class="linedivide1"></span>
<a href="server.php?logout" class="flex-c-m bg1 bo-rad-20 hov1 s-text1 trans-0-4 p-l-10 p-r-10"> Log Out</a>
</div>
<?php
}
?>
</div>
</div>
<!-- Header Mobile -->
<div class="wrap_header_mobile">
<!-- Logo moblie -->
<h3 class="logo-mobile header-wrapicon1 notranslate">
<a href="index.php">
<img src="images/icons/logo.png" alt="IMG-LOGO">
</a>
<span class="text-success">Ag</span><span class="text-primary">Ma</span><span class="text-danger">rk</span><span class="text-warning">et</span>
</h3>
<!-- Button show menu -->
<div class="btn-show-menu">
<?php
if(isset($_SESSION['customer']) || isset($_SESSION['vendor'])) {
if(isset($_SESSION['vendor']))
$url = "cart";
if(isset($_SESSION['vendor']))
$url = "vendor-orders";
?>
<!-- Header Icon mobile -->
<div class="header-icons-mobile">
<div class="header-wrapicon1 dis-block">
<a href="userprofile.php?<?php if($c) echo "customerid=".$id; if($v) echo "vendorid=".$id; ?>">
<img src="images/icons/icon-header-01.png" class="header-icon1" alt="ICON" title="Profile" />
</a>
</div>
<span class="linedivide2"></span>
<div class="header-wrapicon2">
<a href="<?php echo $url; ?>.php">
<img src="images/icons/icon-header-03.png" class="header-icon1 js-show-header-dropdown" alt="ICON" title="Orders" />
<span class="header-icons-noti"><?php echo $countorders; ?></span>
</a>
</div>
<?php
if($c) {
?>
<span class="linedivide2"></span>
<div class="header-wrapicon2">
<a href="cart.php">
<img src="images/icons/icon-header-02.png" class="header-icon1 js-show-header-dropdown" alt="ICON" title="Cart" />
<span class="cartcount header-icons-noti"><?php echo $countcart; ?></span>
</a>
</div>
<?php
}
?>
</div>
<?php
}
?>
<div class="btn-show-menu-mobile hamburger hamburger--squeeze">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</div>
</div>
</div>
<!-- Menu Mobile -->
<div class="wrap-side-menu" >
<nav class="side-menu">
<ul class="main-menu">
<li class="item-menu-mobile">
<a href="<?php echo $index; ?>.php">Home</a>
</li>
<?php
if($c) {
?>
<li class="item-menu-mobile">
<a href="product.php">Shop</a>
<ul class="sub-menu">
<li><a href="product.php?categoryid=1">Crops</a></li>
<li><a href="product.php?categoryid=2">Livestock</a></li>
<li><a href="product.php?categoryid=3">Machineries</a></li>
<li><a href="product.php?categoryid=4">Plants and Seeds</a></li>
</ul>
<i class="arrow-main-menu fa fa-angle-right" aria-hidden="true"></i>
</li>
<?php
}
else if($v) {
?>
<li class="item-menu-mobile">
<a href="addcommodity.php">Add commodity</a>
</li>
<li class="item-menu-mobile">
<a href="weather.php">Weather Utility</a>
</li>
<?php
}
// Check if Android (in-app)
if(!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] != "in.agmarket") {
?>
<li class="item-menu-mobile">
<a href="https://bit.ly/agmarket-in" target="_blank">Download our App</a>
</li>
<?php
}
?>
<li class="item-menu-mobile">
<a href="about.php">About us</a>
</li>
<?php
if(!$c && !$v) {
?>
<li class="item-menu-mobile">
<a href="vendor-login.php">Vendor Portal</a>
</li>
<li class="item-menu-mobile">
<a href="customer-login.php">Customer Sign-in</a>
</li>
<?php
}
else {
?>
<li class="item-menu-mobile">
<a href="index.php?logout">Log Out</a>
</li>
<?php
}
?>
</ul>
</nav>
</div>
</header>