-
Notifications
You must be signed in to change notification settings - Fork 2
/
edit_bulk_inv.php
692 lines (631 loc) · 29.1 KB
/
edit_bulk_inv.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
<?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');
$id = ucfirst($_GET["pur_id"]);
$inv_date = ucfirst($_GET["pur_inv_date"]);
$company_name = ucfirst($_GET["pur_company_name"]);
$brand_name = ucfirst($_GET["pur_brand_name"]);
$sub_name = ucfirst($_GET["pur_sub_name"]);
$quantity = ucfirst($_GET["pur_quantity"]);
$inv_date = ucfirst($_GET["pur_date"]);
$pur_order_no = ucfirst($_GET["pur_order_no"]);
$str= "id={$id}";
?>
<!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>Edit Bulk Purchase | 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">
<!-- 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;
}
</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/login-logo.jpeg" 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#" 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" 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" 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" 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" 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" class="waves-effect waves-deep-purple darken-4 "><i class="mdi-communication-call-received"></i> Download Data</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 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">Edit Bulk Purchase</h5>
<ol class="breadcrumbs">
<li><a href="index.html">Edit Bulk Purchase</a></li>
</ol>
</div>
</div>
</div>
</div>
<!--breadcrumbs end-->
<!--start container-->
<div class="container">
<div class="section">
<p class="caption">Complete the form below to update this bulk purchase : </p>
<div class="divider"></div>
<!-- MY FORM DETAILS -->
<form class="" action="php/edit_bulk_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)"-->
<input type="text" value="<?php echo $id; ?>" name="id" style="display:none;"/>
<select id="company_name" name="company_name" required>
<option value="" disabled selected><?php echo $company_name; ?> : Select Company Name</option>
<?php
$sql = "SELECT DISTINCT company_name FROM add_product_name"; // Select all data from the table
$res = mysqli_query($conn, $sql); // use the function on it and assign it to a variable
if (!$res) { // if the variable does not contain any data, use a die function on it
die("No results from the table");
}
$i = 1;
while ($row=mysqli_fetch_assoc($res)) { // This returns data in form of associative array.
foreach ($row as $key => $value) {
// echo "{$key}: " . "{$value}";
// echo "<br /><hr /></br />";
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">
<select id="sel" name="brand_name" class="browser-default" required>
<option value=" "><?php echo $brand_name; ?> : Select Brand Name</option>
</select>
<!--<select id="brand_name" name="brand_name" required>-->
<!-- <option value="" disabled selected><?php echo $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>-->
<!--<select id="brand_name" name="brand_name">-->
<!-- <option value="0" disabled selected></option>-->
<!-- <option value="Flour">Flour</option>-->
<!-- <option value="Pasta">Pasta</option>-->
<!--</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" value="<?php echo $sub_name; ?>" 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 -->
<!-- Purchase Order No -->
<div class="row company">
<div class="col s12">
<div class="row">
<div class="input-field col s12">
<i class="mdi-action-assignment prefix"></i>
<input type="text" placeholder="Edit The Purchase Order No." value="<?php echo $pur_order_no; ?>" id="bulk_order" name="pur_order_no" class="" required>
<!-- <label for="autocomplete-input">Company Name :</label> -->
</div>
</div>
</div>
</div>
<!-- End Purchase Order No -->
<!-- Quantity & Vehicle No. -->
<div class="row">
<div class="input-field col s12 m6">
<i class="mdi-action-shopping-basket prefix"></i>
<input placeholder="Edit Quantity Details" id="quantity" value="<?php echo $quantity; ?>" name="quantity" type="text" required>
<!-- <label for="quantity">Quantity Of Product</label> -->
</div>
</div>
<!-- End Quantity & Vehicle No. -->
<!-- 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="Edit Purchase Date" value="<?php echo $inv_date; ?>" id="autocomplete-input-date" name="inv_date" class="datepicker" required>
<!-- <label for="autocomplete-input-date">Date :</label> -->
</div>
</div>
</div>
</div>
<!-- End Input Date -->
<!--###### 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="edit_inv" id="submit_inv">Edit Bulk Purchase</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 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);
}
});
}
$("#company_name").change(function(){
var companyName = $(this).val();
var METHOD = "POST";
var URL = 'brand_result.php';
var VALUE = companyName;
$.ajax({
url: URL,
type : METHOD,
data: {
companyName: VALUE,
},
dataType:"json",
error: function(){
console.log("Error");
},
success:function(data){
$('#sel').empty();
for (var i = 0; i < data.length; i++) {
var brandId = data[i]['brandId'];
var brandName = data[i]['brandName'];
option = '<option value="' + brandName + '">'
+ brandName + '</option>';
$('#sel').append(option);
}
}
});
});
</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>