-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdashboard.php
1853 lines (1704 loc) · 85.6 KB
/
dashboard.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
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?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>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">
<!-- 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">
<!-- Custome CSS-->
<link href="css/custom/custom-style.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;
}
table.dataTable thead th, table.dataTable thead td {
padding: 10.4px 18px !important;
}
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="php/logout.php"><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="#" data-navid="1" class="waves-effect waves-deep-purple darken-4 dash_click"><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>
<?php
if($type !== 'user'){
echo '<li class="bold"><a href="#create_inv" data-navid="2" class="waves-effect waves-deep-purple darken-4 dash_click"><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 dash_click"><i class="mdi-action-search"></i> Search Inventory</a>
</li>';
}
?>
<li class="bold"><a href="#running_inv" data-navid="4" class="waves-effect waves-deep-purple darken-4 dash_click"><i class="mdi-action-input"></i> Inventory Running</a>
</li>
<?php
if($type === 'superadmin'){
echo '<li class="bold"><a href="#bulk_inv" data-navid="5" class="waves-effect waves-deep-purple darken-4 dash_click"><i class="mdi-action-receipt"></i> Bulk Purchase Input</a>
</li>';
}
?>
<li class="bold"><a href="#download_inv" data-navid="6" class="waves-effect waves-deep-purple darken-4 dash_click"><i class="mdi-communication-call-received"></i> Download Data</a>
</li>
<li class="bold"><a href="#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="change_password.php"><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 DASHBOARD CONTENT -->
<section id="dashboard" data-navitem="1" class="dashboard 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">Dashboard</h5>
<ol class="breadcrumbs">
<li><a href="index.html">Dashboard</a></li>
</ol>
</div>
</div>
</div>
</div>
<!--breadcrumbs end-->
<!--start container-->
<div class="container">
<div class="section">
<p class="caption">Welcome To Bofik Nigeria Limited.</p>
<div class="divider"></div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</div>
<!-- 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 DASHBOARD CONTENT -->
<!-- START CREATE INVENTORY CONTENT -->
<section id="create_inv" data-navitem="2" class="create_inv sections" style="display:none;">
<!--<a name="timeline" />-->
<!--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">Create Inventory</h5>
<ol class="breadcrumbs">
<li><a href="index.html">Dashboard</a></li>
<li><a href="#">Create Inventory</a></li>
<!-- <li class="active">Blank Page</li> -->
</ol>
</div>
</div>
</div>
</div>
<!--breadcrumbs end-->
<!--start container-->
<div class="container">
<div class="section">
<p class="caption">Complete the form below to create an inventory : </p>
<div class="divider"></div>
<!-- MY FORM DETAILS -->
<form class="" action="php/create_inv.php" method="post">
<!--######################## CREATE INVENTORY #############################3 -->
<!-- Company Name -->
<div class="row company">
<div class="col s12">
<div class="row">
<div class="input-field col s12">
<!--<label>Select Company Name</label>-->
<!--onchange="showBrand(this.value)"-->
<select id="company_name" name="company_name" required>
<option value="" disabled selected>Select Company Name</option>
<?php
$sql = "SELECT DISTINCT company_name FROM add_product_name";
$res = mysqli_query($conn, $sql);
if (!$res) {
die("No results from the table");
}
$i = 1;
while ($row=mysqli_fetch_assoc($res)) {
foreach ($row as $key => $value) {
if($key == 'company_name'){
echo '<option value="'.$value.'">'.$value.'</option>';
}
$i++;
}
}
?>
</select>
<!--<input type="text" placeholder="Enter The Company's Name" id="autocomplete-input" name="company_name" class="autocompleteCompany" required>-->
<label for="autocomplete-input">Company Name :</label>
</div>
</div>
</div>
</div>
<!-- End Company name -->
<!-- Brand Name -->
<div class="row brand">
<div class="col s12">
<div class="row">
<div class="input-field col s12">
<div class="input-field col s12">
<!--<ul id="lis"></ul>-->
<select id="sel" name="brand_name" class="browser-default" required>
<option value=" ">Select Brand Name</option>
</select>
<!--<select id="" name="brand_name" required style="display:none;">-->
<!-- <option value="" disabled selected>Select Brand Name</option>-->
<?php
// $sql = "SELECT DISTINCT brand_name FROM add_product_name";
// $res = mysqli_query($conn, $sql);
// if (!$res) {
// die("No results from the table");
// }
// $i = 1;
// while ($row=mysqli_fetch_assoc($res)) {
// foreach ($row as $key => $value) {
// if($key == 'brand_name'){
// echo '<option value="'.$value.'">'.$value.'</option>';
// }
// $i++;
// }
// }
?>
<!--</select>-->
</div>
<!--<i class="mdi-action-verified-user prefix"></i>-->
<!--<input type="text" placeholder="Specify The Brand Name" id="autocomplete-input-brand" name="brand_name" class="autocompleteBrand" required>-->
<!--<p id="brand_name"></p>-->
<label for="autocomplete-input-brand">Brand Name :</label>
</div>
</div>
</div>
</div>
<!-- End Brand Name -->
<!-- Sub Brand Name -->
<div class="row sub_brand">
<div class="col s12">
<div class="row">
<div class="input-field col s12">
<i class="mdi-social-domain prefix"></i>
<input type="text" placeholder="Specify The Sub Brand Name If Available" id="autocomplete-input-sub_brand" name="sub_name" class="autocompleteSubBrand">
<label for="autocomplete-input-sub_brand">Sub Brand Name :</label>
</div>
</div>
</div>
</div>
<!-- End Sub Brand Name -->
<!-- Input Date -->
<div class="row inputDate">
<div class="col s12">
<div class="row">
<div class="input-field col s12">
<i class="mdi-notification-event-available prefix"></i>
<input type="date" placeholder="Date Of Inventory Creation" id="autocomplete-input-date" name="inv_date" class="datepicker" required>
<label for="autocomplete-input-date">Date :</label>
</div>
</div>
</div>
</div>
<!-- End Input Date -->
<!-- Order & Weighbill No. -->
<div class="row">
<div class="input-field col s12 m4">
<i class="mdi-action-assignment prefix"></i>
<input placeholder="Invoice No." id="invc_no" name="invc_no" type="text">
<label for="invc_no">Invoice No.</label>
</div>
<div class="input-field col s12 m4">
<i class="mdi-action-assignment prefix"></i>
<input placeholder="Order No." id="order_no" name="order_no" type="text">
<label for="order_no">Order No.</label>
</div>
<div class="input-field col s12 m4">
<i class="mdi-action-book prefix"></i>
<input placeholder="Weighbill No." id="weighbill_no" name="weighbill_no" type="text" required>
<label for="weighbill_no">Weigh Bill No.</label>
</div>
</div>
<!-- End Order & Weighbill No. -->
<!-- Quantity & Vehicle No. -->
<div class="row">
<div class="input-field col s12 m6">
<i class="mdi-action-shopping-basket prefix"></i>
<input placeholder="Quantity Details" id="quantity" name="quantity" type="text" required>
<label for="quantity">Quantity Of Product</label>
</div>
<div class="input-field col s12 m6">
<i class="mdi-maps-directions-bus prefix"></i>
<input placeholder="Vehicle No." id="vehicle_no" name="vehicle_no" type="text" required>
<label for="vehicle_no">Vehicle No.</label>
</div>
</div>
<!-- End Quantity & Vehicle No. -->
<!-- Issue & Invoice Date -->
<div class="row">
<div class="input-field col s12 m4">
<i class="mdi-notification-event-note prefix"></i>
<input placeholder="Issued Date" id="issue_date" type="date" name="iss_date" class="datepicker" required>
<label for="issue_date">Date Of Product Issuance</label>
</div>
<div class="input-field col s12 m4">
<i class="mdi-notification-event-note prefix"></i>
<input placeholder="Invoice Date" id="invoice_date" type="date" name="invoice_date" class="datepicker" required>
<label for="invoice_date">Invoice Date</label>
</div>
<div class="input-field col s12 m4">
<i class="mdi-notification-event-note prefix"></i>
<input placeholder="Receiving Date" id="receive_date" type="date" name="receive_date" class="datepicker" required>
<label for="receive_date">Receiving Date</label>
</div>
</div>
<!-- End Issue & Invoice Date -->
<!-- Expiry Date & alert Time. -->
<div class="row">
<div class="input-field col s12 m4">
<i class="mdi-notification-event-note prefix"></i>
<input placeholder="Set Production Date" id="production_date" type="date" name="production_date" class="datepicker" required>
<label for="production_date">Production Date</label>
</div>
<div class="input-field col s12 m4">
<i class="mdi-notification-event-note prefix"></i>
<input placeholder="Set Expiry Date" id="expiry_date" type="date" name="expiry_date" required>
<!--<label for="expiry_date">Expiry Date</label> -->
</div>
<div class="input-field col s12 m4">
<!-- <i class="mdi-notification-event-note prefix"></i> -->
<!--<label>Months Before Alert</label>-->
<select id="expire_month" name="alert_month" required>
<option value="" disabled selected>Months Before Alert</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
<label for="expire_month">Alert Month</label>
</div>
</div>
<!-- End Expiry date & Alert Time. -->
<!-- Driver's Name & Destination -->
<div class="row">
<div class="input-field col s12 m6">
<i class="mdi-action-assignment-ind prefix"></i>
<input placeholder="Driver's Name" id="driver_name" name="driver_name" type="text" required>
<label for="driver_name">Driver's Name</label>
</div>
<div class="input-field col s12 m6">
<i class="mdi-communication-call-split prefix"></i>
<input placeholder="Outlet" id="outlet" name="outlet" type="text" required>
<label for="outlet">Destination / Outlet</label>
</div>
</div>
<!-- End Driver's Name & Destination -->
<!--###### SUBMIT BUTTON ########-->
<div class="row">
<div class="col s12 m4 offset-m4">
<button type="submit" class="btn full_btn waves-effect waves-light btn-large teal darken-4" name="submit_inv" id="submit_inv">Submit Inventory</button>
</div>
</div>
<!--###### END SUBMIT BUTTON ########-->
<!--######################## END CREATE INVENTORY #############################3 -->
</form>
<!-- FORM DETAILS END HERE -->
</div>
<!-- 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 CREATE INVENTORY CONTENT -->
<!-- START SEARCH CONTENT -->
<section id="search_inv" data-navitem="3" class="search_inv sections" style="display:none">
<!--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="Explore Materialize">-->
<!--</div>-->
<div class="container">
<div class="row">
<div class="col s12 m12 l12">
<h5 class="breadcrumbs-title">Search Inventory</h5>
<ol class="breadcrumbs">
<li><a href="index.html">Dashboard</a></li>
<li><a href="#">Search Inventory</a></li>
<!-- <li class="active">Blank Page</li> -->
</ol>
</div>
</div>
</div>
</div>
<!--breadcrumbs end-->
<!--start container-->
<div class="container">
<div class="section">
<p class="caption">Search For Any Product/Brand Details</p>
<div class="divider"></div>
<form class="" action="#" method="get">
<div class="row">
<div class="col s12 m12 valign-wrapper">
<div class="col s12 m6 offset-m3">
<div class="input-field brand_search">
<select id="" onchange="getNodes(this.value)" name="search_brand" required>
<option value="" disabled selected>Select Company Name</option>
<?php
$sql = "SELECT DISTINCT company_name FROM add_product_name";
$res = mysqli_query($conn, $sql);
if (!$res) {
die("No results from the table");
}
$i = 1;
while ($row=mysqli_fetch_assoc($res)) {
foreach ($row as $key => $value) {
if($key == 'company_name'){
echo '<option value="'.$value.'">'.$value.'</option>';
}
$i++;
}
}
?>
</select>
<!--<i class="mdi-action-verified-user prefix"></i>-->
<!--<input type="text" class="autocompleteBrand" onkeyup="getNodes(this.value)" name="search_brand" value="" placeholder="Brand Details">-->
</div>
</div>
</div>
</div>
</form>
<div class="divider"></div>
<div class="container col s12 m12 l12 search_result">
<table id="data-table-row-grouping" class="display demo2 responsive-table edit_table" cellspacing="0" width="100%">
<thead>
<tr>
<th>Date</th>
<th>Company</th>
<th>Outlet</th>
<th>Brand name</th>
<th>Sub brand</th>
<th>Quantity</th>
<th>Order no</th>
<th>Weighbill no</th>
<th>Vehicle no</th>
<th>Issued date</th>
<th>Invoice date</th>
<th>Receiving date</th>
<th>Driver Name</th>
<th>Outlet</th>
<th>Expiry Date</th>
<th>Edit Details</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Date</th>
<th>Company</th>
<th>Outlet</th>
<th>Brand name</th>
<th>Sub brand</th>
<th>Quantity</th>
<th>Order no</th>
<th>Weighbill no</th>
<th>Vehicle no</th>
<th>Issued date</th>
<th>Invoice date</th>
<th>Receiving date</th>
<th>Driver Name</th>
<th>Outlet</th>
<th>Expiry Date</th>
<th>Edit Details</th>
</tr>
</tfoot>
<tbody id="resulting">
</tbody>
</table>
</div>
</div>
<!-- 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 SEARCH CONTENT -->
<!-- START RUNNING INVENTORY -->
<section id="running_inv" data-navitem="4" class="running_inv sections" style="display:none">
<!--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="Explore Materialize">-->
<!--</div>-->
<div class="container">
<div class="row">
<div class="col s12 m12 l12">
<h5 class="breadcrumbs-title">Inventory Running</h5>
<ol class="breadcrumbs">
<li><a href="index.html">Dashboard</a></li>
<li><a href="#">Check Running Inventory</a></li>
<!-- <li class="active">Blank Page</li> -->
</ol>
</div>
</div>
</div>
</div>
<!--breadcrumbs end-->
<!--start container-->
<div class="container">
<div class="section">
<div class="row">
<p class="caption">All Running Inventory</p>
</div>
<div class="divider"></div>
<div class="container col s12 m12 l12">
<table id="data-table-simple" class="display demo2 responsive-table data-table-simple" cellspacing="0" width="100%">
<thead>
<tr>
<th>DATE</th>
<th>COMPANY</th>
<th>OUTLET</th>
<th>BRAND NAME</th>
<th>SUB BRAND</th>
<th>QUANTITY</th>
<th>INVOICE NO.</th>
<th>ORDER NO.</th>
<th>WEIGHBILL NO.</th>
<th>VEHICLE NO</th>
<th>ISSUED DATE</th>
<th>INVOICE DATE</th>
<th>RECEIVING DATE</th>
<th>DRIVER NAME</th>
<th>OUTLET</th>
<th>PROD. DATE</th>
<th>EXPIRY DATE</th>
<th style="display:none" >ALERT TIME</th>
<th>COUNTDOWN</th>
<?php
if($type == 'superadmin'){
echo '<th>Edit</th>';
}
?>
</tr>
</thead>
<tfoot>
<tr class="noExl">
<th>Date</th>
<th>Company</th>
<th>Outlet</th>
<th>Brand name</th>
<th>Sub brand</th>
<th>Quantity</th>
<th>Invoice no</th>
<th>Order no</th>
<th>Weighbill no</th>
<th>Vehicle no</th>
<th>Issued date</th>
<th>Invoice date</th>
<th>Receiving date</th>
<th>Driver Name</th>
<th>Outlet</th>
<th>Prod. Date</th>
<th>Expiry Date</th>
<th style="display:none;">Alert Time</th>
<th>Countdown</th>
<?php
if($type == 'superadmin'){
echo '<th>Edit</th>';
}
?>
</tr>
</tfoot>
<tbody>
<?php
$sqlinvt = "SELECT * FROM inventory WHERE pur_order_no = '' ORDER BY company_name";
$resultinvt = mysqli_query($conn, $sqlinvt);
while($rowinvt = mysqli_fetch_assoc($resultinvt))
{
echo '<tr class="set_well">';
echo '<td>'.$rowinvt["inv_date"].'</td>';
echo '<td>'.$rowinvt["company_name"].'</td>';
echo '<td>'.$rowinvt["outlet"].'</td>';
echo '<td>'.$rowinvt["brand_name"].'</td>';
echo '<td>'.$rowinvt["sub_name"].'</td>';
echo '<td>'.$rowinvt["quantity"].' bags.</td>';
echo '<td>'.$rowinvt["invoice_no"].'</td>';
echo '<td>'.$rowinvt["order_no"].'</td>';
echo '<td>'.$rowinvt["weighbill_no"].'</td>';
echo '<td>'.$rowinvt["vehicle_no"].'</td>';
echo '<td>'.$rowinvt["iss_date"].'</td>';
echo '<td>'.$rowinvt["invoice_date"].'</td>';
echo '<td>'.$rowinvt["receive_date"].'</td>';
echo '<td>'.$rowinvt["driver_name"].'</td>';
echo '<td>'.$rowinvt["outlet"].'</td>';
$date = $rowinvt["expiry_date"];
$prod_date = $rowinvt["production_date"];
$prod_format = date("M d, Y", strtotime($prod_date));
$new_format = date("M d, Y", strtotime($date));
$now_date = date('Y-m-d');
$getMonthNo = date("n j, y", strtotime($new_format));
$diff = abs(strtotime($date) - strtotime($now_date));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
echo '<td data-countid="2">'.$prod_format.'</td>';
echo '<td data-countid="1" class="counter">'.$new_format.'</td>';
$alertMonth = $rowinvt["alert_month"];
echo '<td class="alert_time" value="'.$rowinvt["alert_month"].'" style="display:none" >'.$alertMonth.'</td>';
if($months <= $alertMonth){
$weighbillNo = $rowinvt["weighbill_no"];
echo '<td data-countext="1" class="showCounter" style="background:red; color:#fff;">'.$months.' Months To Expire. PLEASE TAKE ACTIONS</td>';
}else {
echo '<td data-countext="1" class="showCounter">'.$months.' Months To Expire</td>';
}
$id = $rowinvt["id"];
$inv_date = $rowinvt["inv_date"];
$company_name = $rowinvt["company_name"];
$brand_name = $rowinvt["brand_name"];
$sub_name = $rowinvt["sub_name"];
$quantity = $rowinvt["quantity"];
$invoice_no = $rowinvt["invoice_no"];
$order_no = $rowinvt["order_no"];
$weighbill_no = $rowinvt["weighbill_no"];
$vehicle_no = $rowinvt["vehicle_no"];
$iss_date = $rowinvt["iss_date"];
$invoice_date = $rowinvt["invoice_date"];
$receive_date = $rowinvt["receive_date"];
$driver_name = $rowinvt["driver_name"];
$outlet = $rowinvt["outlet"];
$prod_date = $rowinvt["production_date"];
$expiry_date = $rowinvt["expiry_date"];
$alert_month = $rowinvt["alert_month"];
$str = "id={$id}&inv_date={$inv_date}&company_name={$company_name}&brand_name={$brand_name}&sub_name={$sub_name}&quantity={$quantity}".
"&invoice_no={$invoice_no}&order_no={$order_no}&weighbill_no={$weighbill_no}&vehicle_no={$vehicle_no}&iss_date={$iss_date}&invoice_date={$invoice_date}".
"&receive_date={$receive_date}&driver_name={$driver_name}&outlet={$outlet}&production_date={$prod_date}&expiry_date={$expiry_date}&alert_month={$alert_month}";
if($type == 'superadmin'){
echo '<td>
<a href="edit_inv.php?'.$str.'" class="waves-effect waves-light btn-floating"><i class="mdi-content-redo left"></i>Edit</a>
<a href="javascript:delete_inv('.$rowinvt["id"].')" class="waves-effect waves-light btn-floating"><i class="mdi-action-delete left"></i>Delete</a>
</td>';
}
echo '</tr>';
}
?>
</tbody>
</table>
<div class="right-align" style="margin-top: 20px;">
<button class="waves-effect waves-light btn download_csv"><i class="mdi-action-get-app right"></i>Download As CSV</button>
</div>
<?php
if($type === 'superadmin'){
echo '<div class="right-align" style="margin-top: 20px; display:none;">
<form class="form-horizontal" action="functions.php" method="post" name="upload_excel" enctype="multipart/form-data">
<input type="file" name="file" id="file" class="input-large">
<button type="submit" id="submit" class="waves-effect waves-light btn" name="Import"><i class="mdi-action-backup right"></i>Upload CSV</button>
</form>
</div>';
}
?>
</div>
</div>
<!-- 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 RUNNING INVENTORY -->
<!-- START BULK PURCHASE INPUT CONTENT -->
<section id="bulk_inv" data-navitem="5" class="bulk_inv sections" style="display:none">
<!--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">Bulk Purchase Input Page</h5>
<ol class="breadcrumbs">
<li><a href="index.html">Bulk Purchase Input</a></li>
</ol>
</div>
</div>
</div>
</div>
<!--breadcrumbs end-->
<!--start container-->
<div class="container">
<div class="section">
<p class="caption">Bulk Purchase Input Page.</p>
<div class="divider"></div>
<!--action="php/bulk_inv.php" method="post"-->
<!--method="POST" onsubmit="return submitdata();"-->
<form id="sub_form" action="php/bulk_inv.php" method="post">
<!--######################## CREATE PURCHASE INVENTORY #############################3 -->
<!-- Company Name -->
<div class="row company">
<div class="col s12">
<div class="row">
<div class="input-field col s12">
<select id="bulk_company" name="company_name" required>
<option value="" disabled selected>Select Company Name</option>
<?php
$sql = "SELECT DISTINCT company_name FROM add_product_name";
$res = mysqli_query($conn, $sql);
if (!$res) {
die("No results from the table");
}
$i = 1;
while ($row=mysqli_fetch_assoc($res)) {
foreach ($row as $key => $value) {
if($key == 'company_name'){
echo '<option value="'.$value.'">'.$value.'</option>';
}
$i++;
}
}
?>
</select>
<!--<i class="mdi-communication-business prefix"></i>-->
<!--<input type="text" placeholder="Enter The Company's Name" id="bulk_company" name="company_name" class="autocompleteCompany" required>-->
<!-- <label for="autocomplete-input">Company Name :</label> -->
</div>
</div>
</div>
</div>
<!-- End Company name -->
<!-- Brand Name -->
<div class="row brand">
<div class="col s12">
<div class="row">
<div class="input-field col s12">
<select id="sel2" name="brand_name" class="browser-default" required>
<option value=" ">Select Brand Name</option>
</select>
<!--<select id="bulk_brand" name="brand_name" required>-->
<!-- <option value="" disabled selected>Select Brand Name</option>-->
<?php
// $sql = "SELECT DISTINCT brand_name FROM add_product_name";
// $res = mysqli_query($conn, $sql);
// if (!$res) {
// die("No results from the table");
// }
// $i = 1;
// while ($row=mysqli_fetch_assoc($res)) {
// foreach ($row as $key => $value) {
// if($key == 'brand_name'){
// echo '<option value="'.$value.'">'.$value.'</option>';
// }
// $i++;
// }
// }
?>
<!--</select>-->
<!--<i class="mdi-action-verified-user prefix"></i>-->
<!--<input type="text" placeholder="Specify The Brand Name" id="bulk_brand" name="brand_name" class="autocompleteBrand" required>-->
<!-- <label for="autocomplete-input-brand">Brand Name :</label> -->
</div>
</div>
</div>
</div>
<!-- End Brand Name -->
<!-- Sub Brand Name -->
<div class="row sub_brand">
<div class="col s12">
<div class="row">
<div class="input-field col s12">
<i class="mdi-social-domain prefix"></i>
<input type="text" placeholder="Specify The Sub Brand Name If Available" id="bulk_sub_brand" name="sub_name" class="autocompleteSubBrand">
<!-- <label for="autocomplete-input-sub_brand">Sub Brand Name :</label> -->
</div>