-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.php
426 lines (272 loc) · 8.82 KB
/
user.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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
<?php
session_start();
if(!isset($_SESSION['login_id']))
{
header('Location:http://localhost/Fairway/login.php');
exit();
}
if($_SESSION['designation']!='Medical Representative')
{
header('Location:http://localhost/Fairway/login.php');
exit();
}
$pdo = new PDO('mysql:host=localhost;dbname=fairway','root','');
$sql="SELECT name from employee WHERE id=:id";
$sqlm=$pdo->prepare($sql);
$sqlm->execute(array('id'=>$_SESSION['login_id']));
$row=$sqlm->fetch();
$_SESSION['user_name']=$row['name'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Admin : Fairway Pharmaceuticals | The Right choice </title>
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="css/components.css">
<style type="text/css">
html {
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
.column1 {
float: left;
width: 25%;
margin-bottom: 16px;
padding: 0 8px;
padding: 20px;
}
@media screen and (max-width: 650px) {
.column1 {
width: 100%;
display: block;
}
}
.card1 {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
.card1:hover {
box-shadow: 0px 0px 150px #000000;
transform: scale(1.008);
}
.container1 {
padding: 0 16px;
}
.container1::after,
.row1::after {
content: "";
clear: both;
display: table;
}
.title1 {
color: grey;
font-size: 1em;
}
.button1 {
border: none;
outline: 0;
display: inline-block;
padding: 8px;
color: white;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
}
.button1:hover {
background-color: #555;
}
* {
box-sizing: border-box;
}
#myInput {
background-image: url('search_emp.png');
background-position: 10px 10px;
background-repeat: no-repeat;
width: 100%;
font-size: 16px;
padding: 20px 20px 12px 63px;
border: 1px solid #ddd;
margin-bottom: 12px;
background-size: 45px 45px;
}
#myTable {
border-collapse: collapse;
width: 100%;
border: 1px solid #ddd;
font-size: 18px;
}
#myTable th,
#myTable td {
text-align: left;
padding: 12px;
border: 1px solid #eee;
}
#myTable tr {
border-bottom: 1px solid #ddd;
}
#myTable tr.header {
background-color: #A1BEB4;
}
#myTable tr:hover {
background-color: #f1f1f1;
cursor: pointer;
}
#myTable tr.header:hover {
background-color: #A1BEB4;
}
#myInput2 {
background-image: url('search_emp.png');
background-position: 10px 10px;
background-repeat: no-repeat;
width: 100%;
font-size: 16px;
padding: 20px 20px 12px 63px;
border: 1px solid #ddd;
margin-bottom: 12px;
background-size: 45px 45px;
}
#myTable2 {
border-collapse: collapse;
width: 100%;
border: 1px solid #ddd;
font-size: 18px;
}
#myTable2 th,
#myTable2 td {
text-align: left;
padding: 12px;
border: 1px solid #eee;
}
#myTable2 tr {
border-bottom: 1px solid #ddd;
}
#myTable2 tr.header {
background-color: #A1BEB4;
}
#myTable2 tr:hover {
background-color: #f1f1f1;
cursor: pointer;
}
#myTable2 tr.header:hover {
background-color: #A1BEB4;
}
</style>
</head>
<body style="background: linear-gradient(to right, #2bc0e4, #eaecc6);">
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<!-- Title -->
<span class="mdl-layout-title">Fairway</span>
<span style="position: absolute;top:40px;">Hello <?=$_SESSION['user_name']?>!</span>
<!-- Add spacer, to align navigation to the right -->
<div class="mdl-layout-spacer"></div>
<!-- Navigation. We hide it in small screens. -->
<nav class="mdl-navigation mdl-layout--large-screen-only">
<a class="mdl-navigation__link" href="user.php"><i class="zmdi zmdi-card-giftcard"></i> Running Offers</a>
<a class="mdl-navigation__link" href="saleEntry.php"><i class="zmdi zmdi-hospital"></i> Sale Entry</a>
<a class="mdl-navigation__link" href="travel.php"><i class="zmdi zmdi-car"></i> Travel Detail</a>
<a class="mdl-navigation__link" href="userReport.php"><i class="zmdi zmdi-chart"></i> Report</a>
<a class="mdl-navigation__link" href="backend/logout.php"><i class="zmdi zmdi-lock-open zmdi-hc-lg"></i> Logout</a>
</nav>
</div>
</header>
<div class="mdl-layout__drawer">
<span class="mdl-layout-title">Fairway</span>
<nav class="mdl-navigation">
<a class="mdl-navigation__link" href="user.php"><i class="zmdi zmdi-card-giftcard"></i> Running Offers</a>
<a class="mdl-navigation__link" href="saleEntry.php"><i class="zmdi zmdi-hospital"></i> Sale Entry</a>
<a class="mdl-navigation__link" href="travel.php"><i class="zmdi zmdi-car"></i> Travel Detail</a>
<a class="mdl-navigation__link" href="userReport.php"><i class="zmdi zmdi-chart"></i> Report</a>
<a class="mdl-navigation__link" href="backend/logout.php"><i class="zmdi zmdi-lock-open zmdi-hc-lg"></i> Logout</a>
</nav>
</div>
<main class="mdl-layout__content">
<div class="page-content">
<!-- Your content goes here -->
<div class="mdl-tabs mdl-js-tabs mdl-js-ripple-effect">
<div class="mdl-tabs__tab-bar">
<a href="#runningOffers" class="mdl-tabs__tab is-active" style="text-decoration: none;">Offers</a>
<a href="#tableView" class="mdl-tabs__tab" style="text-decoration: none;">Table View</a>
</div>
<div class="mdl-tabs__panel is-active" id="runningOffers">
<div class="row">
<div id="runningO" style="cursor: pointer;">
</div>
</div>
<br>
</div>
<div class="mdl-tabs__panel" id="tableView" style="position: relative;margin:0 auto;line-height: 1.4em;overflow-x:scroll;overflow-y:hidden;">
<center> <table class="mdl-data-table mdl-js-data-table mdl-shadow--2dp">
<thead>
<tr>
<th class="mdl-data-table__cell--non-numeric">Medicine Name</th>
<th>Packaging</th>
<th class="mdl-data-table__cell--non-numeric">Offer Title</th>
<th>On Sale of</th>
<th>Quantity FREE</th>
<th class="mdl-data-table__cell--non-numeric">Remarks</th>
<th>Validity</th>
<th>Offer Image</th>
</tr>
</thead>
<tbody id="table-view">
</tbody>
</table>
</center>
</div>
</div>
</div>
</main>
</div>
<script src="js/components.js"></script>
<script type="text/javascript">
$(document).ready(function () {
fetch_offer();
function fetch_offer() {
$.ajax({
url: 'backend/offer.php',
method: 'POST',
success: function (data) {
$('#runningO').html(data);
}
})
}
setInterval(function () { fetch_offer(); }, 1000);
offer_table_view();
function offer_table_view() {
$.ajax({
url: 'backend/offer_table_view.php',
method: 'POST',
success: function (data) {
$('#table-view').html(data);
}
})
}
});
</script>
<script type="text/javascript">
var Tawk_API = Tawk_API || {}, Tawk_LoadStart = new Date();
(function () {
var s1 = document.createElement("script"), s0 = document.getElementsByTagName("script")[0];
s1.async = true;
s1.src = 'https://embed.tawk.to/5b7cf754f31d0f771d840655/default';
s1.charset = 'UTF-8';
s1.setAttribute('crossorigin', '*');
s0.parentNode.insertBefore(s1, s0);
})();
</script>
</body>
</html>