-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsalesinquiry.php
More file actions
726 lines (538 loc) · 24.3 KB
/
salesinquiry.php
File metadata and controls
726 lines (538 loc) · 24.3 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
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
<?php session_start();
require_once __DIR__."/includes/headerincludes.php";
require_once __DIR__."/includes/dbconfig.php";
require_once __DIR__."/functions/allfunctions.php";
if(empty($_SESSION["itemarrayinventory"]))
{
$itemarray = array();
}
else
{
$itemarray = $_SESSION["itemarrayinventory"];
}
if(empty($_SESSION["MEMBER_ID"]) && empty($_SESSION["TYPE"]))
{
$itemarray = array();
}
else
{
$memberid = $_SESSION['MEMBER_ID'];
$type = $_SESSION['TYPE'];
}
if(empty($_GET['sid']))
{
}
else
{
$sales_inquiry_id = $_GET['sid'];
}
if(empty( $_GET['action']))
{
}
else
{
$action = $_GET['action'];
}
$sales_inquiry_id = isset($sales_inquiry_id)?$sales_inquiry_id:'';
$action = isset($action)?$action:'';
//before we store information of our member, we need to start first the session
//create a new function to check if the session variable member_id is on set
function logged_in() {
return isset($_SESSION['MEMBER_ID']);
}
//this function if session member is not set then it will be redirected to index.php
function confirm_logged_in() {
if (!logged_in()) {
?>
<script type="text/javascript">
window.location = "pages/login.php";
</script>
<?php
}
}
confirm_logged_in();
?>
<!DOCTYPE html>
<head>
<title>GBG Enterprise - Dashboard</title>
</head>
<body id="page-top">
<!-- Page Wrapper -->
<div id="wrapper">
<!-- Sidebar -->
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">
<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="index.php">
<div class="sidebar-brand-icon">
<img src="img/gbg.jpg" alt="Company Logo" class="img-thumbnail">
</div>
<div class="sidebar-brand-text mx-3">GBG Enterprise</div>
</a>
<!-- Divider -->
<hr class="sidebar-divider my-0">
<!-- Nav Item - Dashboard -->
<li class="nav-item active">
<a class="nav-link" href="index.php">
<i class="fas fa-fw fa-tachometer-alt"></i>
<span>Dashboard</span></a>
<a class="nav-link" href="tasklist.php">
<i class="fas fa-fw fa-tasks"></i>
<span>Task</span></a>
</li>
<?php echo sidebar(); ?>
<!-- Divider -->
<!-- <hr class="sidebar-divider">-->
<!-- Divider -->
<hr class="sidebar-divider d-none d-md-block">
</ul>
<!-- End of Sidebar -->
<!-- Content Wrapper -->
<div id="content-wrapper" class="d-flex flex-column">
<!-- Main Content -->
<div id="content">
<!-- Topbar -->
<nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">
<!-- Sidebar Toggle (Topbar) -->
<button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
<i class="fa fa-bars"></i>
</button>
<!-- Topbar Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Nav Item - User Information -->
<!-- <li class="nav-item dropdown no-arrow">
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="mr-2 d-none d-lg-inline text-gray-600 small"><?php echo $type; ?></span>
<img class="img-profile rounded-circle"
src="pic/undraw_profile.svg">
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
aria-labelledby="userDropdown">
<a class="dropdown-item" href="#">
<i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>
Profile
</a>
<a class="dropdown-item" href="#">
<i class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i>
Settings
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">
<i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
Logout
</a>
</div>
</li> -->
<?php echo logindetails(); ?>
</ul>
</nav>
<!-- End of Topbar -->
<!-- Begin Page Content -->
<div class="container-fluid">
<!-- Content Row -->
<div class="row gy-5">
<!-- Customer Div -->
<div class="col-sm-12">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-sm font-weight-bold text-info text-uppercase mb-4">Customer</div>
<div class="row align-items-center">
<div class="col-auto">
<form class="user">
<div class="form-group row">
<div class="col-auto">
<?php echo $action;
if ($action != 'edit')
{
echo '<a href="#" data-toggle="modal" data-target="#createcustomerModal" class="d-none createcust d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i
class="fas fa-address-card fa-sm text-white-50"></i> Create Customer</a>';
}
else
{
}
?>
</div>
<div class="col-auto">
<select class="form-control form-select customerdropdown" name="customer" aria-label="Default select example">
<option selected value="NONE">Select customer</option>
<?php
echo getDropdown('tbl_customer',"customer_status = 'Active'",'customer_id',"customer_company_name");
?>
</select>
</div>
</div>
</form>
<div class="row gy-5">
</div>
<div class="col-auto customerdata hidden" id="customerdata">
</div>
<div class="col-auto customeradd hidden">
<!-- Logout Modal-->
<div class="modal fade" id="createcustomerModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Create Customer</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form class="user custadddata" name="custadddata" id="custadddata">
<div class="form-group row ">
<div class="row" id="notif" style="display:none;">
<div class="col-md-12">
<div class="alert alert-success" id="notitext">
</div>
</div>
</div>
<div class=" form-group row" >
<div class="col-sm-6">
<p>Customer Company Name:</p>
</div>
<div class="col-sm-6">
<input type="text" class="form-control custnameval" name="custnameval" required placeholder="Enter Company Name " aria-label="Recipient's username" aria-describedby="basic-addon2">
</div>
<div class="col-sm-6">
<p>Customer Representative:</p>
</div>
<div class="col-sm-6">
<input type="text" class="form-control custrepval" name="custrepval" required placeholder="Enter Representative " aria-label="Recipient's username" aria-describedby="basic-addon2">
</div>
<div class="col-sm-6">
<p>Customer Email:</p>
</div>
<div class="col-sm-6">
<input type="email" class="form-control custemailval" name="custemailval" required placeholder="Enter Email" aria-label="Recipient's username" aria-describedby="basic-addon2">
</div>
<div class="col-sm-6">
<p>Customer Contact:</p>
</div>
<div class="col-sm-6">
<input type="number" class="form-control custcontval" name="custcontval" required placeholder="Enter Contact Number" aria-label="Recipient's username" aria-describedby="basic-addon2">
</div>
</div>
</div>
<div class="form-group row ">
<div class="col-sm-6">
<p>Customer Address:</p>
</div>
<div class="col-sm-12">
<input type="text" class="form-control custaddval" name="custaddval" required placeholder="Enter Address" aria-label="Recipient's username" aria-describedby="basic-addon2">
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
<button class="btn btn-primary custsubmit" name="custsubmit" type="submit" id="custsubmit">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Image Content Row -->
<div class="row gy-5">
<div class="col-lg-12">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-sm font-weight-bold text-info text-uppercase mb-4">Image</div>
<div class="row align-items-center">
<div class="card-body">
<div id="image_preview"></div>
<!-- <img src="img/imgprev.png" alt="Preview Image" class="img-fluid imgPlaceholder" id="imgPlaceholder"> -->
<div class="row gy-5 align-items-center"></div></br></br>
<input type="file" class="form-control-user chooseFile" accept="image/*" name='inputfile' id='inputfile' multiple>
<script type="text/javascript">
$(document).ready(function(){
$("#inputfile").change(function(){
$('#image_preview').html("");
var total_file=document.getElementById("inputfile").files.length;
for(var i=0;i<total_file;i++)
{
$('#image_preview').append("<img src='"+URL.createObjectURL(event.target.files[i])+"'></br> </br></br> </br>");
}
});
});
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Image and Material and MFG Process Row -->
<div class="row gy-5">
<div class="col-lg-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-sm font-weight-bold text-info text-uppercase mb-4">Product</div>
<div class="row align-items-center">
<div class="card-body">
<form class="user">
<div class="form-group row">
<div class="col-lg-3">
<a href="#" data-toggle="modal" data-target="#createprodModal" class="d-none createprod d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-box-open fa-sm text-white-50"></i> Create Product</a>
</div>
<div class="col-sm-8">
<select class="form-control form-select productdropdown" name="product" aria-label="Default select example">
<option selected value="none">Select Product</option>
</select>
</div>
<div class="row gy-5">
</div>
<div class="col-auto productdata hidden" id="productdata">
</div>
</form>
<div class="col-auto productadd hidden">
<!-- Logout Modal-->
<div class="modal fade" id="createprodModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel1">Create Product</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="row" id="notif2" style="display:none;">
<div class="col-md-12">
<div class="alert alert-success" id="notitext2">
</div>
</div>
</div>
<div class="form-group row ">
<form class="user prodadddata" name="prodadddata" id="prodadddata">
<div class="col-sm-6">
<p>Product Name:</p>
</div>
<div class="col-sm-6">
<input type="text" class="form-control prodnameval" name="prodnameval" required placeholder="Enter Product name" aria-label="Recipient's username" aria-describedby="basic-addon2">
</div>
<!-- <div class="col-sm-6">
<p>Material:</p>
</div>
<div class="col-sm-6">
<input type="text" class="form-control" placeholder="Enter Material name" aria-label="Recipient's username" aria-describedby="basic-addon2">
</div> -->
<div class="col-sm-6">
<p>Product Size:</p>
</div>
<div class="col-sm-6">
<input type="text" class="form-control prodsizeval" name="prodsizeval" required placeholder="Enter Product size" aria-label="Recipient's username" aria-describedby="basic-addon2">
</div>
<div class="col-sm-6">
<p>Product Material Type:</p>
</div>
<div class="col-sm-6">
<input type="text" class="form-control prodmattypeval" name="prodmattypeval" required placeholder="Enter Material type" aria-label="Recipient's username" aria-describedby="basic-addon2">
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
<button class="btn btn-primary prodsubmit" name="prodsubmit" id="prodsubmit" type="submit" >Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-sm font-weight-bold text-info text-uppercase mb-4">Material</div>
<div class="row align-items-center">
<div class="card-body">
<div class="form-group row ">
<!-- <select class="selectpicker form-control materialdata" multiple data-live-search="true" >
<?php
echo getDropdown('tbl_material',"material_status='Active'",'material_id',"material_name");
?>
</select> -->
<div class="col-lg-8">
<select class="form-control selecttable" id="inv" >
<?php
echo getDropdown('tbl_material',"material_status='Active'",'material_id',"material_name");
?>
</select>
</div>
<div class="col-lg-4">
<a href="#" class="btn btn-sm btn-primary shadow-sm" onclick="addMaterial(); return false"><i class="far fa-plus-square"></i> Add Item</a>
</div>
<div class="row gy-5"></div>
<!-- <button class="btn btn-primary test" type="button" >Submit</button> -->
</div>
<div class="form-group row txtResult1" id="txtResult1">
<table class="table table-bordered materialtable" id="materialtable" width="100%" cellspacing="0">
<thead>
<th>ID</th>
<th>Material Name</th>
<th></th>
</thead>
<tbody>
<?php
for($a=0;$a<count($itemarray);$a++)
{
$MaterialListDetails = MaterialListDetails($itemarray[$a]);
if($MaterialListDetails["material_id"]!="")
{
?>
<tr>
<td><?php echo $itemarray[$a]; ?> </td>
<td><?php echo strtoupper($MaterialListDetails["material_name"]); ?> </td>
<td> <a href="#" class="btn btn-sm btn-primary shadow-sm" onclick="deleteMaterial(<?php echo $a; ?>); return false"><i class="far fa-trash-alt"></i></a></td>
</tr>
<?php }
}?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-sm font-weight-bold text-info text-uppercase mb-4">Manufacturing Process</div>
<div class="row align-items-center">
<div class="card-body">
<div class="row gy-5"></div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="extrusion" name="chk[]" id="extrusion">
<label class="form-check-label" for="flexCheckDefault">
Extrusion
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="printing" name="chk[]" id="printing">
<label class="form-check-label" for="flexCheckDefault">
Printing
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="1stlamination" name="chk[]" id="1stlamination">
<label class="form-check-label" for="flexCheckDefault">
1st Lamination
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="2ndlamination" name="chk[]" id="2ndlamination">
<label class="form-check-label" for="flexCheckDefault">
2nd Lamination
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="curing" name="chk[]" id="curing">
<label class="form-check-label" for="flexCheckDefault">
Curing
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="slitting" name="chk[]" id="slitting">
<label class="form-check-label" for="flexCheckDefault">
Slitting
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="cuttingandbagging" name="chk[]" id="cuttingandbagging">
<label class="form-check-label" for="flexCheckDefault">
Cutting and Bagging
</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row gy-5 align-items-center">
<div class="col-lg-3">
</div>
<div class="col-lg-6">
<button type="button" class="btn btn-success btn-lg btn-block submitsalesinquiry" id="submitsalesinquiry">Submit</button>
</div>
<div class="col-lg-3">
</div>
</div>
</br></br>
<div class="row gy-5 align-items-center">
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
<!-- Footer -->
<footer class="sticky-footer bg-white">
<div class="container my-auto ">
<div class="copyright text-center my-auto">
<span>Copyright © GBG 2020</span>
</div>
</div>
</footer>
<!-- End of Footer -->
</div>
<!-- End of Content Wrapper -->
</div>
<!-- End of Page Wrapper -->
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
<i class="fas fa-angle-up"></i>
</a>
<!-- Logout Modal-->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
<a class="btn btn-primary" href="../gbgv2/destroy.php">Logout</a>
</div>
</div>
</div>
</div>
</body>
</html>