-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.php
More file actions
468 lines (407 loc) · 20.7 KB
/
profile.php
File metadata and controls
468 lines (407 loc) · 20.7 KB
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
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
<?php
session_start();
if(!$_SESSION['s_id']){
header("location:index.php");
}
$user_id=$_SESSION['s_id'];
?>
<!doctype html>
<html lang="en"><!-- InstanceBegin template="/Templates/pharmacyFinder.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/png" href="assets/img/favicon.ico">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>My Profile</title>
<!-- InstanceEndEditable -->
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta name="viewport" content="width=device-width" />
<SCRIPT TYPE="text/javascript"> function popup(mylink, windowname) {
if (! window.focus)return true; var href; if (typeof(mylink) == 'string')
href=mylink;
else href=mylink.href; window.open(href, windowname, 'width=800,height=400,scrollbars=yes');
return false; }
</SCRIPT>
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet" />
<!-- Animation library for notifications -->
<link href="assets/css/animate.min.css" rel="stylesheet"/>
<!-- Light Bootstrap Table core CSS -->
<link href="assets/css/light-bootstrap-dashboard.css" rel="stylesheet"/>
<!-- CSS for Demo Purpose, don't include it in your project -->
<!-- Fonts and icons -->
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,300' rel='stylesheet' type='text/css'>
<link href="assets/css/pe-icon-7-stroke.css" rel="stylesheet" />
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>
<body>
<div class="wrapper">
<div class="sidebar" data-color="red" data-image="assets/img/sidebar-5.jpg">
<!--
Tip 1: you can change the color of the sidebar using: data-color="blue | azure | green | orange | red | purple"
Tip 2: you can also add an image using data-image tag
-->
<div class="sidebar-wrapper">
<div class="logo">
<a href="#" class="simple-text">
Pharmacy Finder
</a>
</div>
<ul class="nav">
<li class="active">
<a href="dashboard.php">
<i class="pe-7s-graph"></i>
<p>Dashboard</p>
</a>
</li>
<li>
<a href="profile.php">
<i class="pe-7s-user"></i>
<p>Pharmacy Profile</p>
</a>
</li>
<li>
<a href="stockManagement.php">
<i class="pe-7s-note2"></i>
<p>Stock Managment</p>
</a>
</li>
<li>
<a href="checkout.php" onClick="return popup(this, 'notes')">
<i class="pe-7s-map-marker"></i>
<p>Update Location</p>
</a>
</li>
</ul>
</div>
</div>
<div class="main-panel">
<nav class="navbar navbar-default navbar-fixed">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navigation-example-2">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- InstanceBeginEditable name="EditRegion4" --><a class="navbar-brand" href="#">Pharmacy Profile</a><!-- InstanceEndEditable --></div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-left">
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-dashboard"></i>
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
My Account
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="changePassword.php" >Change Password</a></li>
<li class="divider"></li>
<li><a href="logout.php">Sign Out</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div class="content"><!-- InstanceBeginEditable name="EditRegion3" -->
<div class="row">
<?php
include'Database/config.php';
$select="SELECT * FROM profile WHERE PharmacyID='$user_id'";
$run_select= mysqli_query($conn,$select);
$rows=mysqli_fetch_array($run_select);
$physicalAddress=$rows['physicalAddress'];
$PharmacyID=$rows['PharmacyID'];
$latitude=$rows['latitude'];
$longitude=$rows['longitude'];
$dateProfile=$rows['dateProfile'];
$user_email=$rows['email'];
$cont_numbers=$rows['cont_number'];
/*to select the name of the phamacy from users table*/
$sel="SELECT pharmacy_name FROM users WHERE id='$user_id'";
$run_sel=mysqli_query($conn,$sel);
$rw=mysqli_fetch_array($run_sel);
$name=$rw['pharmacy_name'];
?>
<div class="container-fluid">
<div class="row">
<div class="col-md-8">
<div class="card">
<div class="header">
<h4 class="title">Edit Profile</h4>
</div>
<div class="content">
<form>
<div class="row">
<div class="col-md-12">
<div id="getResult"></div>
<div class="form-group">
<label>Pharmacy Name (cannot be modified)</label>
<input type="text" id="pharmacy_id" class="form-control" disabled placeholder="Company" value="<?php echo $name ?>">
<input type="hidden" id="PharmacyID" value="<?php echo $user_id; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label>Physical Address</label>
<input type="text" class="form-control" id="address" placeholder="Home Address"
value="<?php echo $physicalAddress;?> " disabled>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Co-odinatets(Latitude)</label>
<input type="text" class="form-control" id="latitude" placeholder="Latitude" value="<?php echo $latitude; ?> " disabled>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Co-odinates(Longitude)</label>
<input type="text" class="form-control" id="longitude" value="<?php echo $longitude; ?> " disabled>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Contact Numbers</label>
<input type="text" class="form-control" id="cont_numbers" value="<?php echo $cont_numbers; ?>" >
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Email</label>
<input type="text" class="form-control" id="email" value="<?php echo $user_email; ?>" >
</div>
</div>
</div>
<button type="button" id="btn" class="btn btn-sm btn-danger btn-fill pull-right" onClick="update()">Update Profile</button>
<div class="clearfix"></div>
</form>
<script type="text/javascript">
function update() {
var btn =$("#btn").val();
var PharmacyID=$("#PharmacyID").val();
var latitude=$("#latitude").val();
var longitude=$("#longitude").val();
var dateProfile=$("#dateProfile").val();
var address=$("#address").val();
var email =$("#email").val();
var cont_numbers =$("cont_numbers").val();
$.post("updateProfile/", {
btn :btn ,
PharmacyID:PharmacyID,
latitude:latitude,
longitude:longitude,
dateProfile:dateProfile,
address:address,
email:email,
cont_numbers:cont_numbers,
},
function(data) {
$('#getResult').html(data);
$('#custo')[0].reset()
});
}
</script>
</div>
</div>
</div>
<div class="col-md-4">
</div>
</div>
</div>
</div>
<!-- InstanceEndEditable -->
</div>
<footer class="footer">
<div class="container-fluid">
<nav class="pull-left">
<ul>
<li>
<a href="#">
Home
</a>
</li>
<li>
<a href="#">
Company
</a>
</li>
<li>
<a href="#">
Portfolio
</a>
</li>
<li>
<a href="#">
Blog
</a>
</li>
</ul>
</nav>
<p class="copyright pull-right">
© 2017 <a href="#">Pharmacy Finder</a>, made with love for a patience web
</p>
</div>
</footer>
</div>
</div>
<!-- Load a modal to notify the user to create a profile-->
<div id="createProfile" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<center><img src="img/logo.jpg" class="img-responsive img-rounded"></center>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!--- modal to add a drug-->
<div id="addDrug" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Add Stock</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<div id="display"></div>
<form id="custo">
<div class="form-group">
<label>Drug Name</label>
<!-- select all drugs for enrolment-->
<select id="drugName" class="form-control">
<?php
include 'Database/config.php';
$sele="SELECT `DrugID`, `Drugname` FROM `drugs`";
$run_sele=mysqli_query($conn,$sele);
while($row=mysqli_fetch_array($run_sele)){
$drugname=$row['Drugname'];
?>
<option value="<?php echo $drugname; ?>"><?php echo $drugname; ?></option>
<?php
}
?>
</select>
<input type="hidden" id="pharmacy_id" value="<?php echo $user_id; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label>Prescription</label>
<input type="text" class="form-control" id="prescription" placeholder="Prescription" >
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label>Price</label>
<input type="number" id="price" class="form-control" placeholder="price">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label>Status</label>
<select class="form-control" id="status">
<option value="instock">Instock</option>
<option value="notInstock">Not instock</option>
</select>
</form>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<button type="button" id="btn" class="btn btn-sm btn-danger btn-fill pull-right" onClick="enrole()">Enroll</button>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function enrole() {
var btn =$("#btn").val();
var drugName=$("#drugName").val();
var status=$("#status").val();
var prescription=$("#prescription").val();
var price=$("#price").val();
var pharmacy_id=$("#pharmacy_id").val();
$.post("StockManagment/enrolDrug.php", {
btn:btn ,
drugName:drugName,
status:status,
price:price,
prescription:prescription,
pharmacy_id:pharmacy_id,
},
function(data) {
$('#display').html(data);
$('#displayDrugs').load('StockManagment/getDrugs.php')
$('#custo')[0].reset()
});
}
</script>
</body>
<!-- Core JS Files -->
<script src="assets/js/jquery-1.10.2.js" type="text/javascript"></script>
<script src="assets/js/bootstrap.min.js" type="text/javascript"></script>
<!-- Checkbox, Radio & Switch Plugins -->
<script src="assets/js/bootstrap-checkbox-radio-switch.js"></script>
<!-- Charts Plugin -->
<!--<script src="../assets/js/chartist.min.js"></script>
<!-- Notifications Plugin -->
<script src="assets/js/bootstrap-notify.js"></script>
<!-- Google Maps Plugin -->
<!-- Light Bootstrap Table Core javascript and methods for Demo purpose -->
<script src="assets/js/light-bootstrap-dashboard.js"></script>
<!-- Light Bootstrap Table DEMO methods, don't include it in your project! -->
<script src="assets/js/demo.js"></script>
<script type="text/javascript">
$(document).ready(function(){
demo.initChartist();
$.notify({
icon: 'pe-7s-gift',
message: "Welcome to <b>Light Bootstrap Dashboard</b> - a beautiful freebie for every web developer."
},{
type: 'info',
timer: 4000
});
});
</script>
<!-- InstanceEnd --></html>