-
Notifications
You must be signed in to change notification settings - Fork 2
/
change_password.php
551 lines (500 loc) · 21.8 KB
/
change_password.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
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
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
<?php
//include auth.php file on all secure pages
require("php/connect.php");
require("php/auth.php");
$sql2 = "SELECT * FROM users WHERE id = '".$_SESSION['user_id']."' LIMIT 1";
$res2 = mysqli_query($conn, $sql2);
if (!$res2) {
die("No results from the table");
}
$row2=mysqli_fetch_assoc($res2);
foreach ($row2 as $key => $value) {
$type = $row2[type];
}
date_default_timezone_set('UTC');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="msapplication-tap-highlight" content="no">
<title>Change Password | Admin Dashboard | Bofik Nigeria Limited.</title>
<!-- CORE CSS-->
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection">
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection">
<!-- JQUERY CSS -->
<link rel="stylesheet" href="css/jquery-ui.min.css">
<link rel="stylesheet" href="css/jquery-ui.theme.min.css">
<!-- Custome CSS-->
<link href="css/custom/custom-style.css" type="text/css" rel="stylesheet" media="screen,projection">
<!-- INCLUDED PLUGIN CSS ON THIS PAGE -->
<link href="js/plugins/prism/prism.css" type="text/css" rel="stylesheet" media="screen,projection">
<link href="js/plugins/data-tables/css/jquery.dataTables.min.css" type="text/css" rel="stylesheet" media="screen,projection">
<link href="js/plugins/perfect-scrollbar/perfect-scrollbar.css" type="text/css" rel="stylesheet" media="screen,projection">
<link href="js/plugins/chartist-js/chartist.min.css" type="text/css" rel="stylesheet" media="screen,projection">
<link rel="shortcut icon" href="images/bofik_logo.png" type="image/x-icon">
<!-- fonts -->
<link href="https://fonts.googleapis.com/css?family=Varela|Varela+Round" rel="stylesheet">
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- stylesheets for older browsers -->
<!-- ie6/7 micro clearfix -->
<!--[if lte IE 7]>
<style>
.grouping {
*zoom: 1;
}
</style>
<![endif]-->
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style media="screen">
.brand_search_details {
position: relative;
left: 50%;
transform: translateX(-50%);
margin-top: 30px;
}
.hide_side_nav {
cursor: pointer;
width: 50px;
margin-left: 10px;
}
/*.set_well > td {*/
/* padding: 10px 10px !important;*/
/* border-bottom: 0.5px solid #111 !important;*/
/*}*/
.header-search-wrapper {
display: none !important;
}
table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td {
border-top: 1px solid transparent !important;
padding: 10px 10px !important;
border-bottom: 0.5px solid #111 !important;
}
.divider {
background-color: #311b92;
}
input#download_data_month, input#download_data {
padding: 20px;
width: auto;
}
</style>
</head>
<body>
<!-- Start Page Loading -->
<div id="loader-wrapper">
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
</div>
<!-- End Page Loading -->
<!-- //////////////////////////////////////////////////////////////////////////// -->
<!-- START HEADER -->
<header id="header" class="page-topbar">
<!-- start header nav-->
<div class="navbar-fixed">
<nav class="navbar-color deep-purple darken-4">
<div class="nav-wrapper">
<ul class="left">
<li>
<i class="mdi-navigation-menu hide-on-med-and-down hide_side_nav waves-effect waves-light deep-purple darken-4"></i>
<!-- <a href="#" data-activates="slide-out" class="sidebar-collapse btn-floating btn-medium waves-effect waves-light hide-on-med-and-down hide_side_nav deep-purple darken-4"><i class="mdi-navigation-menu"></i></a> -->
</li>
<li><h1 class="logo-wrapper"><a href="index.html" class="brand-logo darken-1"> <h6>Bofik Nigeria Limited</h6> </a></h1></li>
</ul>
<div class="header-search-wrapper hide-on-med-and-down">
<i class="mdi-action-search"></i>
<input type="text" name="Search" class="header-search-input z-depth-2" placeholder="Search..."/>
</div>
</div>
</nav>
</div>
<!-- end header nav-->
</header>
<!-- END HEADER -->
<!-- //////////////////////////////////////////////////////////////////////////// -->
<!-- START MAIN -->
<div id="main">
<!-- START WRAPPER -->
<div class="wrapper">
<!-- START LEFT SIDEBAR NAV-->
<aside id="left-sidebar-nav">
<ul id="slide-out" class="side-nav fixed leftside-navigation">
<li class="user-details deep-purple darken-4 darken-2">
<div class="row">
<div class="col col s4 m4 l4">
<img src="images/bofik_logo.png" alt="" class="circle responsive-img valign profile-image">
</div>
<div class="col col s8 m8 l8">
<ul id="profile-dropdown" class="dropdown-content">
<!-- <li><a href="#"><i class="mdi-action-face-unlock"></i> Profile</a>
</li>
<li><a href="#"><i class="mdi-action-settings"></i> Settings</a>
</li> -->
<!-- <li class="divider"></li> -->
<li><a href="#"><i class="mdi-hardware-keyboard-tab"></i> Logout</a>
</li>
</ul>
<?php
if (isset($_SESSION['username'])) {
echo '<a class="btn-flat dropdown-button waves-effect waves-light white-text profile-btn" href="#" data-activates="profile-dropdown">' .$_SESSION['username'].'<i class="mdi-navigation-arrow-drop-down right"></i></a>';
}
?>
</div>
</div>
</li>
<li class="bold"><a href="dashboard.php#" data-navid="1" class="waves-effect waves-deep-purple darken-4"><i class="mdi-action-dashboard"></i> Dashboard</a>
</li>
<li class="li-hover"><div class="divider"></div></li>
<li class="li-hover"><p class="ultra-small margin more-text">INVENTORY</p></li>
<li class="bold"><a href="dashboard.php#create_inv" data-navid="2" class="waves-effect waves-deep-purple darken-4 "><i class="mdi-content-add-box"></i> Create Inventory</a>
</li>
<?php
if($type === 'superadmin'){
echo '<li class="bold"><a href="#search_inv" data-navid="3" class="waves-effect waves-deep-purple darken-4"><i class="mdi-action-search"></i> Search Inventory</a>
</li>';
}
?>
<li class="bold"><a href="dashboard.php#running_inv" data-navid="4" class="waves-effect waves-deep-purple darken-4"><i class="mdi-action-input"></i> Inventory Running</a>
</li>
<?php
if($type === 'superadmin'){
echo '<li class="bold"><a href="dashboard.php#bulk_inv" data-navid="5" class="waves-effect waves-deep-purple darken-4 "><i class="mdi-action-receipt"></i> Bulk Purchase Input</a>
</li>
<li class="bold"><a href="dashboard.php#download_inv" data-navid="6" class="waves-effect waves-deep-purple darken-4"><i class="mdi-communication-call-received"></i> Download Data</a>
</li>
<li class="bold"><a href="dashboard.php#download_month" data-navid="8" class="waves-effect waves-deep-purple darken-4 dash_click"><i class="mdi-action-event"></i> Download Monthly Data <span class="new badge"></span></a>
</li>';
}
?>
<li class="li-hover"><div class="divider"></div></li>
<li class="li-hover"><p class="ultra-small margin more-text">SETTINGS</p></li>
<?php
if($type === 'superadmin'){
echo '
<li class="bold"><a href="settings.php" class="waves-effect waves-deep-purple darken-4"><i class="mdi-action-settings"></i> Settings</a>
</li>';
}
?>
<li><a href="#"><i class="mdi-action-lock-outline"></i> Change Password</a>
</li>
<li><a href="php/logout.php"><i class="mdi-action-launch"></i> Sign Out</a>
</li>
</ul>
<a href="#" data-activates="slide-out" class="sidebar-collapse btn-floating btn-medium waves-effect waves-light hide-on-large-only deep-purple darken-4"><i class="mdi-navigation-menu"></i></a>
</aside>
<!-- END LEFT SIDEBAR NAV-->
<!-- //////////////////////////////////////////////////////////////////////////// -->
<!-- START SETTINGS CONTENT -->
<section id="settings" class="settings sections">
<!--breadcrumbs start-->
<div id="breadcrumbs-wrapper">
<!-- Search for small screen -->
<div class="header-search-wrapper grey hide-on-large-only">
<i class="mdi-action-search active"></i>
<input type="text" name="Search" class="header-search-input z-depth-2" placeholder="Search...">
</div>
<div class="container">
<div class="row">
<div class="col s12 m12 l12">
<h5 class="breadcrumbs-title">Change Password</h5>
<ol class="breadcrumbs">
<li><a href="index.html">Change Password</a></li>
</ol>
</div>
</div>
</div>
</div>
<!--breadcrumbs end-->
<!--start container-->
<div class="container">
<div class="section">
<p class="caption">Change Your Password.</p>
<div class="divider"></div>
<section id="change_password" class="sections">
<div class="center-align card blue" style="padding:10px; color:#fff;"><h5>CHANGE PASSWORD</h5></div>
<div class="col s12">
<form class="container formValidate" id="formValidate" name="RegForm" method="get" action="php/change_password.php" style="width:500px;">
<div class="row margin">
<div class="input-field col s12">
<i class="mdi-action-lock-outline prefix"></i>
<input id="old_pass" name="old_pass" type="password" required data-error=".errorTxt1">
<div class="errorTxt1"></div>
<label for="old_pass" class="center-align">Old Password</label>
</div>
</div>
<div class="row margin">
<div class="input-field col s12">
<i class="mdi-action-lock-outline prefix"></i>
<input id="password" name="password" type="password" required data-error=".errorTxt3">
<div class="errorTxt3"></div>
<label for="password">New Password</label>
</div>
</div>
<div class="row margin">
<div class="input-field col s12">
<i class="mdi-action-lock-outline prefix"></i>
<input id="password-again" name="password-again" type="password" required data-error=".errorTxt4">
<div class="errorTxt4"></div>
<label for="password-again">New Password again</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<button id="change_password" type="submit" name="change_password" class="btn waves-effect waves-light col s12">Change Password</button>
</div>
</div>
<div class="row">
<div class="col 12 message_box" style="margin:10px 0px;"></div>
</div>
</form>
</div>
</section>
<!-- Floating Action Button -->
<div class="fixed-action-btn" style="bottom: 50px; right: 19px;">
<a class="btn-floating btn-large">
<i class="mdi-action-wallet-travel deep-purple darken-4 darken-4"></i>
</a>
<ul>
<li><a href="#create_inv" class="btn-floating deep-purple darken-4 darken-4"><i class="large mdi-content-add-box"></i></a></li>
<li><a href="#search_inv" class="btn-floating yellow darken-1"><i class="large mdi-action-search"></i></a></li>
<li><a href="#running_inv" class="btn-floating green"><i class="large mdi-action-input"></i></a></li>
<!-- <li><a href="app-email.html" class="btn-floating blue"><i class="large mdi-communication-email"></i></a></li> -->
</ul>
</div>
<!-- Floating Action Button -->
</div>
<!--end container-->
</section>
<!-- END SETTINGS CONTENT -->
<!-- //////////////////////////////////////////////////////////////////////////// -->
</div>
<!-- END WRAPPER -->
</div>
<!-- END MAIN -->
<!-- //////////////////////////////////////////////////////////////////////////// -->
<!-- START FOOTER -->
<footer class="page-footer">
<div class="footer-copyright">
<div class="container">
<span>© 2018 Bofik Nigeria Limited.</span>
</div>
</div>
</footer>
<!-- END FOOTER -->
<!-- ================================================
Scripts
================================================ -->
<!-- jQuery Library -->
<script type="text/javascript" src="js/plugins/jquery-1.11.2.min.js"></script>
<!--<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.js"></script>-->
<!-- JQUERY UI JS -->
<!-- <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script> -->
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
<!--materialize js-->
<script type="text/javascript" src="js/materialize.js"></script>
<!-- data-tables -->
<script type="text/javascript" src="js/plugins/data-tables/js/jquery.dataTables.min.js"></script>
<!--<script type="text/javascript" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>-->
<script type="text/javascript" src="js/plugins/data-tables/data-tables-script.js"></script>
<!--editabletable-->
<script type="text/javascript" src="js/plugins/editable-table/mindmup-editabletable.js"></script>
<script type="text/javascript" src="js/plugins/editable-table/numeric-input-example.js"></script>
<!--prism
<script type="text/javascript" src="js/prism/prism.js"></script>-->
<!--scrollbar-->
<!-- <script type="text/javascript" src="js/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script> -->
<!--plugins.js - Some Specific JS codes for Plugin Settings-->
<script type="text/javascript" src="js/plugins.js"></script>
<!--custom-script.js - Add your own theme custom JS-->
<script type="text/javascript" src="js/custom-script.js"></script>
<script type="text/javascript">
var brand = $('.brand input');
var subBrand = $('.sub_brand');
$(brand).on('blur click',function() {
if ($(this).val() !== "") {
subBrand.css({display : 'block', background : 'rgba(204, 204, 204, 0.18)', padding : '10px'});
}else {
subBrand.css({display : 'none', background : 'rgba(204, 204, 204, 0.18)', padding : '5px'});
}
});
</script>
<script type="text/javascript">
// AUTOCOMPLETE FEATURE
var company = ["Dangote",
"Golden Penny",
"Crown Flour Mills",
"Pure Flour Mills",
"Honeywell Flour Mills"];
$('.autocompleteCompany').autocomplete( {source : company});
</script>
<script type="text/javascript">
// SHOW OTHER SECTIONS
// var a = $('#left-sidebar-nav ul li');
// console.log(a);
$(".dash_click").click(function() {
var b = $(this).data('navid');
// console.log(b);
$(".sections").fadeOut("300");
showSection(b);
// console.log(this);
});
function showSection(b){
var element = $('section[data-navitem="'+b+'"]');;
element.fadeIn(2000);
element.addClass('active');
}
</script>
<script type="text/javascript">
$('.allbuttons').on('click', function (e) {
e.preventDefault();
});
</script>
<script>
// FOR COUNTER EFFECT
(function(){
$('.counter').each(function(){
var counter = $(this).text();
var showCounter = $('.showCounter');
var counterDate = Date.parse(counter);
var now = new Date().getTime();
var distance = counterDate - now;
var d = new Date(distance);
var getMonth = d.getMonth() + 1;
var showError = $('.show_alert_error');
// setInterval(function() {
// showCounter.text(getMonth + " Months to expire");
// }, 1000);
if (getMonth === $('.alert_time').val()) {
showCounter.css({color:"#fff", background:"red"});
}
});
})();
// FOR SIDE NAV TOGGLE
(function(){
$('#left-sidebar-nav').addClass('active');
$('.hide_side_nav').on('click', function() {
$('#left-sidebar-nav').slideToggle(1000, function() {
$('#main, .page-footer').css({paddingLeft:"0px"});
$(this).toggleClass('active');
if ($('#left-sidebar-nav').hasClass('active')) {
$('#main, .page-footer').css({paddingLeft:"240px"});
}
});
});
})();
</script>
<script src="js/jquery.table2excel.js"></script>
<script>
$(".download_csv").click(function(){
var showDate = new Date();
// showDate.toDateString()
// alert("yes");
$(".data-table-simple").table2excel({
// exclude CSS class
exclude: ".noExl",
name: "Excel Document Name",
filename: "Bofik Inventory Table on " + showDate,
fileext: ".xls",
exclude_img: true,
exclude_links: true,
exclude_inputs: true
});
// $("#data-table-simple").table2excel({
// // exclude CSS class
// exclude: ".noExl",
// name: "Excel Document Name",
// filename: "Bofik Inventory Table on " + showDate,
// fileext: ".xls",
// exclude_img: true,
// exclude_links: true,
// exclude_inputs: true
// });
});
function getNodes(value){
if(this.value == ""){
$("#resulting").html("Enter a search query");
}else{
$.post("search.php",{partialNode:value},function(data){
$("#resulting").html(data);
});
}
}
$('#data-table-row-grouping').editableTableWidget().numericInputExample().find('td:first').focus();
</script>
<script>
$("#resulting tr td").click(function(){
$(this).replaceWith('<input type="text" />');
});
</script>
<script type="text/javascript">
function insertBulk() {
var company_name=$("#company_name").val();
var brand_name=$("#brand_name").val();
var sub_name=$("#sub_name").val();
var pur_order_no=$("#pur_order_no").val();
var pur_quantity=$("#pur_quantity").val();
var pur_date=$("#pur_date").val();
// AJAX code to send data to php file.
$.ajax({
type: "POST",
url: "php/bulk_inv.php",
data: {company_name:company_name,brand_name:brand_name,sub_name:sub_name,pur_order_no:pur_order_no,pur_quantity:pur_quantity,pur_date:pur_date},
dataType: "JSON",
success: function(data) {
$("#message").html(data);
$("p").addClass("alert alert-success");
},
error: function(err) {
alert(err);
}
});
}
</script>
<script type="text/javascript">
function delete_id(id)
{
if(confirm('Sure To Remove This Mail ?'))
{
window.location.href='php/delete_mail.php?delete_id='+id;
}
}
</script>
<script type="text/javascript">
function delete_inv(id)
{
if(confirm('Sure To Remove This Record ?'))
{
window.location.href='php/delete.php?delete_inv='+id;
}
}
</script>
<script type="text/javascript">
function delete_prod(id)
{
if(confirm('Sure To Remove This Product Details ?'))
{
window.location.href='php/delete_prod.php?delete_prod='+id;
}
}
function delete_acc(id)
{
if(confirm('Sure To Remove This Account ?'))
{
window.location.href='php/delete_acc.php?delete_acc='+id;
}
}
function edit_acc(str)
{
if(confirm('Sure To Edit This Account ?'))
{
window.location.href='php/edit_acc.php?edit_acc='+str;
}
}
</script>
</body>
</html>