-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd-booking.php
More file actions
1518 lines (1114 loc) · 44.9 KB
/
add-booking.php
File metadata and controls
1518 lines (1114 loc) · 44.9 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
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('header.php'); ?>
<!--
<script type="text/javascript" src="fancybox/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.0.pack.js"></script>
<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.0.css" media="screen" />
<script type="text/javascript" src="fancybox/popup.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link rel="stylesheet" href="date/jquery-ui.css">
<script src="date/jquery-1.9.1.js"></script>
<script src="date/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/js/standalone/selectize.min.js" ></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.bootstrap3.min.css" />
<script>
$( function() {
$( "#datepicker" ).datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd'
});
// $("#datepicker").datepicker().datepicker("setDate", new Date());
} );
$( function() {
$( "#invoice_datepicker" ).datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd'
});
// $("#datepicker").datepicker().datepicker("setDate", new Date());
} );
$( function() {
$( "#forwarder_airway_bill_date" ).datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd'
});
// $("#datepicker").datepicker().datepicker("setDate", new Date());
} );
</script>
<style>
.btn33{
background-color:white;
border-radius:6px;
outline:none;
padding-top:5px;
padding-bottom:5px;
padding-left:15px;
padding-right:15px;
}
.btn33:hover{
background-color:#00aeef;
}
</style>
<script>
$(document).ready(function () {
$('.dropdown_list').selectize({
sortField: 'text'
});
});
</script>
<?php
$package_id=$_REQUEST['pack_id'];
// new id
if(isset($_POST['final_submit'])){
if($package_id!="")
{
$final_total=$_POST['grand_total']+$_POST['service_tax'];
$query=db_query("update tbl_package set
booking_date='$_POST[booking_date]',
origin_city_name='$_POST[origin_city_name]',
shipper_id='$_POST[customer_code_shipper_id]',
shipper_name='$_POST[shipper_name]',
shipper_mobile='$_POST[shipper_mobile]',
shipper_address='$_POST[shipper_address]',
shipper_gst='$_POST[shipper_gst]',
shipper_gst_rate='$_POST[shipper_gst_rate]',
shipper_docket_charge='$_POST[shipper_docket_charge]',
shipper_handling_charge='$_POST[shipper_handling_charge]',
shipper_other_charge='$_POST[shipper_other_charge]',
shipper_fov='$_POST[shipper_fov]',
shipper_fov_min='$_POST[shipper_fov_min]',
shipper_fov_amount='$_POST[shipper_fov_amount]',
pickup_city='$_POST[pickup_city]',
destination_city='$_POST[destination_city]',
delivery_city='$_POST[delivery_city]',
payment_mode='$_POST[payment_mode]',
transit_mode='$_POST[transit_mode]',
invoice_no='$_POST[invoice_no]',
invoice_date='$_POST[invoice_date]',
invoice_value='$_POST[invoice_value]',
consignee_name='$_POST[consignee_name]',
consignee_mobile='$_POST[consignee_mobile]',
consignee_gst='$_POST[consignee_gst]',
consignee_address='$_POST[consignee_address]',
said_to_contain='$_POST[said_to_contain]',
no_of_package='$_POST[no_of_package]',
type_nv='$_POST[type_nv]',
total_cft='$_POST[total_cft]',
one_cft_weight='$_POST[one_cft_weight]',
actual_weight='$_POST[actual_weight]',
changeable_weight='$_POST[changeable_weight]',
forwarder_user_id='$_POST[forwarder_user_id]',
forwarder_airway_bill_no='$_POST[forwarder_airway_bill_no]',
forwarder_airway_bill_date='$_POST[forwarder_airway_bill_date]',
freight='$_POST[freight]',
service_tax='$_POST[service_tax]',
grand_total='$_POST[grand_total]',
final_total='$final_total',
package_update_date='$CURR_date' where package_id='$package_id' ");
if($query)
{?>
<script>
alert("Package Updated Successfully !");
window.location.href="add-booking.php?pack_id=<?=$package_id?>";
</script>
<?}
}else{
$final_total=$_POST['grand_total']+$_POST['service_tax'];
$_SESSION['last_awb_no']=$_POST['airway_bill_no']+1;
$_SESSION['last_shipper_id']=$_POST['customer_code_shipper_id'];
$query=db_query("insert into tbl_package set
airway_bill_no='$_POST[airway_bill_no]',
booking_date='$_POST[booking_date]',
origin_city_name='$_POST[origin_city_name]',
shipper_id='$_POST[customer_code_shipper_id]',
shipper_name='$_POST[shipper_name]',
shipper_mobile='$_POST[shipper_mobile]',
shipper_address='$_POST[shipper_address]',
shipper_gst='$_POST[shipper_gst]',
shipper_gst_rate='$_POST[shipper_gst_rate]',
shipper_docket_charge='$_POST[shipper_docket_charge]',
shipper_handling_charge='$_POST[shipper_handling_charge]',
shipper_other_charge='$_POST[shipper_other_charge]',
shipper_fov='$_POST[shipper_fov]',
shipper_fov_min='$_POST[shipper_fov_min]',
shipper_fov_amount='$_POST[shipper_fov_amount]',
pickup_city='$_POST[pickup_city]',
destination_city='$_POST[destination_city]',
delivery_city='$_POST[delivery_city]',
payment_mode='$_POST[payment_mode]',
transit_mode='$_POST[transit_mode]',
invoice_no='$_POST[invoice_no]',
invoice_date='$_POST[invoice_date]',
invoice_value='$_POST[invoice_value]',
consignee_name='$_POST[consignee_name]',
consignee_mobile='$_POST[consignee_mobile]',
consignee_gst='$_POST[consignee_gst]',
consignee_address='$_POST[consignee_address]',
said_to_contain='$_POST[said_to_contain]',
no_of_package='$_POST[no_of_package]',
type_nv='$_POST[type_nv]',
total_cft='$_POST[total_cft]',
one_cft_weight='$_POST[one_cft_weight]',
actual_weight='$_POST[actual_weight]',
changeable_weight='$_POST[changeable_weight]',
forwarder_user_id='$_POST[forwarder_user_id]',
forwarder_airway_bill_no='$_POST[forwarder_airway_bill_no]',
forwarder_airway_bill_date='$_POST[forwarder_airway_bill_date]',
freight='$_POST[freight]',
service_tax='$_POST[service_tax]',
grand_total='$_POST[grand_total]',
final_total='$final_total',
package_add_date='$CURR_date'");
if($query)
{?>
<script>
alert("Package Added Successfully !");
window.location.href="add-booking.php";
</script>
<?}
}
}
?>
<?php
if($package_id!='')
{
$pack_sql=db_query("select * from tbl_package where package_id='$package_id' ");
$pack_res=mysql_fetch_array($pack_sql);
}
?>
<tr>
<td valign="top" width="17%" style="border-right: #2E005B solid 3px; height:505px;" >
<?php include('left-menu.php'); ?>
</td>
<td valign="top" width="83%"><p class="b xlarge mt10px ml10px"><i class="fa fa-truck"></i> Add Booking
<a href="add-booking.php" class="mr20px fr " style="color:#0033CC;font-size:14px"><i class="fa fa-refresh"></i> Refresh</a>
|
<a href="manage-booking.php" class="mr20px fr " style="color:#0033CC;font-size:14px"><i class="fa fa-arrow-circle-left"></i> Go back |</a>
</p>
<p class="bdr0 m5px mr30px"></p>
<form method="post" action="" id="myform" enctype="multipart/form-data" onsubmit="return step2_form_validation();">
<table cellpadding="0" cellspacing="0" width="99%" class="bdrAll mt20px ml10px step1_form">
<tr>
<th style="text-align: center;" width="34%">
<p class="b ml20px blue p5px">
Airway Bill No. *
<input type="text" name="airway_bill_no" id="airway_bill_no" placeholder="Enter Airway Bill No. " <?php if($package_id!=""){?> value="<?=$pack_res['airway_bill_no']?>" readonly <?}else if(!empty($_SESSION['last_awb_no'])){?> value="<?=$_SESSION['last_awb_no']?>" <?}?> >
</p>
</th>
<th>
<p class="b ml20px blue p5px">Booking Date *
<input type="text" name="booking_date" id="datepicker" onchange="setNextTab()" <?php if($package_id!=""){?>autofocus<?}?> <?php if($pack_res['booking_date']!=""){?>value="<?=$pack_res['booking_date']?>"<?}else{?>value="<?=date('Y-m-d')?>"<?}?> >
</p>
</th>
</tr>
<!--
<tr style="text-align: center;">
<td ><p class="b ml20px blue p5px">Customer/User Code * </p></td>
<td ><p class="b ml20px blue p5px">Origin *</p></td>
</tr>
<tr style="text-align: center;">
<td rowspan="2" width="34%">
<center>
<select name="customer_code" id="customer_code" style="width:220px;" class="dropdown_list" placeholder="Select Customer/User *">
<option value="">Select Customer/User *</option>
<?php
$customer_sql=db_query("select * from tbl_parcel_user where user_status='Active'");
while($customer_res=mysql_fetch_array($customer_sql))
{?>
<option value="<?=$customer_res['user_id']?>" <?php if($pack_res['user_id']==$customer_res['user_id']){?>selected<?}?> ><?=$customer_res['user_code']?></option>
<?}?>
</select>
</center>
</td>
<td >
<?php
$SHIPPER_SQL=db_query("select * from tbl_shipper where 1 and shipper_status='Active' order by shipper_id asc");
?>
<center>
<select style="width:200px;" name="origin_shipper_id" id="origin_shipper_id" onchange="getShipperDetails(this.value)" class="dropdown_list" placeholder="Select Origin *">
<option value="">Select Origin *</option>
<?php
while($SHIPPER_RES=mysql_fetch_array($SHIPPER_SQL))
{?>
<option value="<?=$SHIPPER_RES['shipper_id']?>" <?php if($pack_res['shipper_id']==$SHIPPER_RES['shipper_id']){?>selected<?}?>><?=$SHIPPER_RES['shipper_code']?></option>
<?}?>
</select>
</center>
</td>
</tr>
<tr style="text-align: left;">
<td style="padding-left:70px;">
<p class="b ml20px blue p5px">
Name * <input type="text" placeholder="Enter Name" style="width:210px;" name="shipper_name" id="shipper_name" readonly value="<?=$pack_res['shipper_name']?>"/>
Mobile *<input type="number" placeholder="Enter Mobile No." name="shipper_mobile" id="shipper_mobile" readonly value="<?=$pack_res['shipper_mobile']?>"/>
</p>
<p class="b ml20px blue p5px">
Address *<input type="text" placeholder="Enter Address" style="width:489px;" name="shipper_address" id="shipper_address" readonly value="<?=$pack_res['shipper_address']?>"/>
</p>
<p class="b ml20px blue p5px">
Docket Charge <input type="number" placeholder="Enter Docket Charge"name="shipper_docket_charge" id="shipper_docket_charge" value="<?=$pack_res['shipper_docket_charge']?>"/>
Other Charges<input type="number" placeholder="Enter Other Charges" name="shipper_other_charge" id="shipper_other_charge" value="<?=$pack_res['shipper_other_charge']?>"/>
</p>
<p class="b ml20px blue p5px">
Handling charge <input type="number" placeholder="Enter Handling charge" name="shipper_handling_charge" id="shipper_handling_charge" value="<?=$pack_res['shipper_handling_charge']?>"/>
FOV (%) <input type="number" placeholder="Enter FOV" name="shipper_fov" id="shipper_fov" value="<?=$pack_res['shipper_fov']?>"/>
</p>
</td>
</tr>-->
<tr style="text-align: center;">
<td ><p class="b ml20px blue p5px">Customer Code * </p></td>
<td ><p class="b ml20px blue p5px">Origin *</p></td>
</tr>
<tr style="text-align: center;">
<td>
<?php
$SHIPPER_SQL=db_query("select * from tbl_shipper where 1 and shipper_status='Active' order by shipper_id asc");
?>
<center style=" margin:10px;">
<select style="width:200px;" name="customer_code_shipper_id" id="customer_code_shipper_id" onchange="getShipperDetails(this.value)" class="dropdown_list" placeholder="Select Customer Code *">
<option value="">Select Customer Code *</option>
<?php
while($SHIPPER_RES=mysql_fetch_array($SHIPPER_SQL))
{?>
<option value="<?=$SHIPPER_RES['shipper_id']?>" <?php if($pack_res['shipper_id']==$SHIPPER_RES['shipper_id'] || $_SESSION['last_shipper_id']==$SHIPPER_RES['shipper_id']){?>selected<?}?>><?=$SHIPPER_RES['shipper_code']?></option>
<?}?>
</select>
</center>
</td>
<td rowspan="2" width="34%">
<center>
<p class="b ml20px blue p5px" >
<select name="origin_city_name" id="origin_city_name" onchange="setPickUpCity(this.value)" style="width:220px; padding:10px; border-radius:5px;" tabindex=-1>
<option value="">Select Origin *</option>
<?php
$origin_city_sql=db_query("select * from tbl_city_master where city_status='Active'");
while($origin_city_res=mysql_fetch_array($origin_city_sql))
{?>
<option value="<?=$origin_city_res['city_name']?>" <?php if($pack_res['origin_city_name']==$origin_city_res['city_name']){?>selected<?}?> ><?=$origin_city_res['city_name']?></option>
<?}?>
</select>
</p>
</center>
</td>
</tr>
<tr style="text-align: left; text">
<td style="padding-left:50px;">
<p class="b blue p5px">
Name * <input type="text" style="" name="shipper_name" id="shipper_name" readonly tabindex=-1 value="<?=$pack_res['shipper_name']?>"/>
Mobile *<input type="number" name="shipper_mobile" id="shipper_mobile" readonly tabindex=-1 value="<?=$pack_res['shipper_mobile']?>"/>
</p>
<p class="b blue p5px">
Address * <input type="text" name="shipper_address" id="shipper_address" readonly tabindex=-1 value="<?=$pack_res['shipper_address']?>"/>
GST No. *<input type="text" name="shipper_gst" id="shipper_gst" readonly tabindex=-1 value="<?=$pack_res['shipper_gst']?>" style="width:140px;"/>
<input type="text" name="shipper_gst_rate" id="shipper_gst_rate" readonly tabindex=-1 value="<?=$pack_res['shipper_gst_rate']?>" style="width:40px;"/>
</p>
<p class="b blue p5px">
Docket Charge <input type="number" style="width:50px;" name="shipper_docket_charge" id="shipper_docket_charge" value="<?=$pack_res['shipper_docket_charge']?>"/>
Handling charge <input type="number" style="width:50px;" name="shipper_handling_charge" id="shipper_handling_charge" value="<?=$pack_res['shipper_handling_charge']?>"/>
</p>
<p class="b blue p5px">
Other Charges/Fuel Charges <input type="number" style="width:50px;" name="shipper_other_charge" id="shipper_other_charge" value="<?=$pack_res['shipper_other_charge']?>"/>
FOV (%)
<input type="number" style="width:50px;" name="shipper_fov" id="shipper_fov" value="<?=$pack_res['shipper_fov']?>"/>
Min <input type="number" style="width:50px;" name="shipper_fov_min" id="shipper_fov_min" value="<?=$pack_res['shipper_fov_min']?>"/>
<input type="number" style="width:50px;" name="shipper_fov_amount" id="shipper_fov_amount" value="<?=$pack_res['shipper_fov_amount']?>" readonly tabindex=-1/>
</p>
<!-- <p class="b ml20px blue p5px">
Address *<input type="text" placeholder="Enter Address" style="width:489px;" name="shipper_address" id="shipper_address" readonly value="<?=$pack_res['shipper_address']?>"/>
</p>
<p class="b ml20px blue p5px">
Docket Charge <input type="number" placeholder="Enter Docket Charge" name="shipper_docket_charge" id="shipper_docket_charge" value="<?=$pack_res['shipper_docket_charge']?>"/>
Other Charges<input type="number" placeholder="Enter Other Charges" name="shipper_other_charge" id="shipper_other_charge" value="<?=$pack_res['shipper_other_charge']?>"/>
</p>
<p class="b ml20px blue p5px">
Handling charge <input type="number" placeholder="Enter Handling charge" name="shipper_handling_charge" id="shipper_handling_charge" value="<?=$pack_res['shipper_handling_charge']?>"/>
FOV (%) <input type="number" placeholder="Enter FOV" name="shipper_fov" id="shipper_fov" value="<?=$pack_res['shipper_fov']?>"/>
</p>
-->
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" width="100%" class="bdrAll">
<tr style="text-align: center;">
<td width="34%"> <p class="b ml20px blue p5px">
<!-- Pick Up City * <input type="text" placeholder="Pick Up City *" name="shipper_pickup_city" id="shipper_pickup_city" value="<?=$pack_res['pickup_city']?>"/>
-->
Pick Up City * <select name="pickup_city" id="pickup_city">
<option value="">Select City *</option>
<?php
$pick_city_sql=db_query("select * from tbl_city_master where city_status='Active'");
while($pick_city_res=mysql_fetch_array($pick_city_sql))
{?>
<option value="<?=$pick_city_res['city_name']?>" <?php if($pack_res['pickup_city']==$pick_city_res['city_name']){?>selected<?}?> ><?=$pick_city_res['city_name']?></option>
<?}?>
</select>
</p>
</td>
<td>
<p class="b ml20px blue p5px">
Destination City *
<select name="destination_city" id="destination_city" onchange="setDeliveryBranchCity(this.value)">
<option value="">Select City *</option>
<?php
$des_city_sql=db_query("select * from tbl_city_master where city_status='Active'");
while($des_city_res=mysql_fetch_array($des_city_sql))
{?>
<option value="<?=$des_city_res['city_name']?>" <?php if($pack_res['destination_city']==$des_city_res['city_name']){?>selected<?}?> ><?=$des_city_res['city_name']?></option>
<?}?>
</select>
</p>
</td>
<td>
<p class="b ml20px blue p5px">
Delivery Branch *
<select name="delivery_city" id="delivery_city">
<option value="">Select City *</option>
<?php
$del_city_sql=db_query("select * from tbl_city_master where city_status='Active'");
while($del_city_res=mysql_fetch_array($del_city_sql))
{?>
<option value="<?=$del_city_res['city_name']?>" <?php if($pack_res['delivery_city']==$del_city_res['city_name']){?>selected<?}?> ><?=$del_city_res['city_name']?></option>
<?}?>
</select>
</p>
</td>
</tr>
<tr>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Payment Mode *
</p>
</td>
<td colspan="2" style="text-align: left;">
<p class="ml20px p5px">
<select name="payment_mode" id="payment_mode" style="padding:5px;">
<option value="">Choose Payment Mode</option>
<option value="Cash" <?php if($pack_res['payment_mode']=="Cash"){?>selected<?}?>>Cash</option>
<option value="Credit" <?php if($pack_res['payment_mode']=="Credit" || $pack_res['payment_mode']==""){?>selected<?}?>>Credit</option>
<option value="To Pay" <?php if($pack_res['payment_mode']=="To Pay"){?>selected<?}?>>To Pay</option>
</select>
<!-- Cash <input type="radio" name="payment_mode" value="Cash" <?php if($pack_res['payment_mode']=="Cash"){?>checked<?}?>>
Cheque <input type="radio" name="payment_mode" value="Cheque" <?php if($pack_res['payment_mode']=="Cheque" || $pack_res['payment_mode']==""){?>checked<?}?> >
To Pay <input type="radio" name="payment_mode" value="To Pay" <?php if($pack_res['payment_mode']=="To Pay"){?>checked<?}?>>-->
<!--<input type="text" placeholder="Cheque Number" name="cheque_number" id="cheque_number" value="<?=$pack_res['cheque_number']?>" <?php if($pack_res['payment_mode']=="Cheque" || $pack_res['payment_mode']==""){?><?}else{?>style="display:none;"<?}?> />
-->
</p>
</td>
</tr>
<tr>
<td style="text-align: center;"><p class="b ml20px blue p5px">Transit Mode *</p></td>
<td colspan="2">
<p class="ml20px p5px">
<select style="padding:5px; width:185px;" name="transit_mode" id="transit_mode" >
<option value="">Select Mode *</option>
<option value="Air" <?php if($pack_res['transit_mode']=="Air"){?>selected<?}?>>Air</option>
<option value="Surface" <?php if($pack_res['transit_mode']=="Surface" || $pack_res['transit_mode']==""){?>selected<?}?>>Surface</option>
<option value="Cargo" <?php if($pack_res['transit_mode']=="Cargo"){?>selected<?}?>>Cargo</option>
</select>
</p></td>
</tr>
<tr>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Invoice No.
<input type="text" name="invoice_no" id="invoice_no" value="<?=$pack_res['invoice_no']?>">
</p>
</td>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Invoice Date
<input type="text" name="invoice_date" id="invoice_datepicker" value="<?=$pack_res['invoice_date']?>">
<!-- <input type="date" name="invoice_date" id="invoice_date" value="<?=$pack_res['invoice_date']?>">-->
</p>
</td>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Invoice Value
<input type="number" name="invoice_value" id="invoice_value" value="<?=$pack_res['invoice_value']?>" onkeyup="cal_FOV(this.value)">
</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" style="text-align: center;">
<p class="b ml20px blue p5px">
<button type="button" name="next_btn" id="next_btn">Next</button>
</p>
</td>
</tr>
</table>
<p class="b ml20px blue p5px back_btn_display" style="display:none;">
<button type="button" name="back_btn" id="back_btn">Back</button>
</p>
<table cellpadding="0" cellspacing="0" width="99%" class="bdrAll mt20px ml10px step2_form" style="display:none;" >
<tr>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Consignee Name
</p>
</td>
<td colspan="3">
<p class="ml20px p5px">
<input type="text" placeholder="Enter Consignee Name" style="width:290px;" name="consignee_name" id="consignee_name" value="<?=$pack_res['consignee_name']?>" >
</p>
</td>
</tr>
<tr>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
<!-- Name/-->Mobile/GST
</p>
</td>
<td colspan="3">
<p class="ml20px p5px">
<!-- <input type="text" placeholder="Name" name="name" id="name" value="<?=$pack_res['name']?>"> -->
<input type="number" placeholder="Mobile No." name="consignee_mobile" id="consignee_mobile" style="width:143px;" maxlength="10" value="<?=$pack_res['consignee_mobile']?>">
<input type="text" placeholder="GST" name="consignee_gst" id="consignee_gst" style="width:143px;" value="<?=$pack_res['consignee_gst']?>">
</p>
</td>
</tr>
<tr>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Address
</p>
</td>
<td colspan="3">
<p class="ml20px p5px">
<textarea name="consignee_address" id="consignee_address" style="width:290px; height:70px; resize:none;"><?=$pack_res['consignee_address']?></textarea>
<!-- <input type="text" placeholder="Address" name="address" id="address" style="width:470px;" value="<?=$pack_res['address']?>">-->
</p>
</td>
</tr>
<tr>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Said to Contain
</p>
</td>
<td >
<p class="ml20px p5px">
<input type="text" placeholder="Said to Contain" name="said_to_contain" id="said_to_contain" value="<?=$pack_res['said_to_contain']?>" >
</p>
</td>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
No. of Package *
</p>
</td>
<td >
<p class="ml20px p5px">
<input type="number" placeholder="Enter No. of Package *" name="no_of_package" id="no_of_package" value="<?=$pack_res['no_of_package']?>">
</p>
</td>
</tr>
<tr>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Type N/V * <i class="fa fa-question-circle" style="cursor:pointer;" data-toggle="tooltip" data-placement="right" title="(N for Normal and V for Volumetric)"></i>
</p>
</td>
<td >
<p class="ml20px p5px">
<!-- <select name="type_nv" id="type_nv" style="width:154px; padding:4px;" onchange="show_hide_total_cft_field(this.value)">
<option value="">Select Type</option>
<option value="Normal" <?php if($pack_res['type_nv']=="Normal"){?>selected<?}?> >Normal</option>
<option value="Volumetric" <?php if($pack_res['type_nv']=="Volumetric"){?>selected<?}?> >Volumetric</option>
</select>-->
Normal <input type="radio" name="type_nv" value="Normal" <?php if($pack_res['type_nv']=="Normal" || $pack_res['type_nv']==""){?>checked<?}?> onclick="show_hide_total_cft_field(this.value)">
Volumetric <input type="radio" name="type_nv" value="Volumetric" <?php if($pack_res['type_nv']=="Volumetric"){?>checked<?}?> onclick="show_hide_total_cft_field(this.value)">
<!-- <input type="text" placeholder="Enter Type *" name="type_nv" id="type_nv" value="<?=$pack_res['type_nv']?>">-->
</p>
</td>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Total CFT *
</p>
</td>
<td >
<p class="ml20px p5px">
<input type="number" placeholder="Enter Total CFT *" name="total_cft" id="total_cft" value="<?=$pack_res['total_cft']?>" disabled onkeyup="calculate_cft(this.value)">
<?php $sh_code=db_scalar("select shipper_code from tbl_shipper where shipper_id='$pack_res[shipper_id]' "); ?>
<!-- <input type="hidden" name="one_cft_weight" id="one_cft_weight" value="<?=$pack_res['one_cft_weight']?>">-->
<input type="hidden" name="one_cft_weight" id="one_cft_weight" value="<?=db_scalar("select tariff_volumetric from tbl_tariff where tariff_shipper_code='$sh_code' ")?>">
</p>
</td>
</tr>
<tr>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Actual Weight (In Grams) *
</p>
</td>
<td >
<p class="ml20px p5px">
<input type="number" placeholder="Enter Actual Weight *" name="actual_weight" id="actual_weight" value="<?=$pack_res['actual_weight']?>" onchange="setChangeableWeight(this.value)">
</p>
</td>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Chargeable Weight (In Grams) *
</p>
</td>
<td >
<p class="ml20px p5px">
<input type="number" placeholder="Chargeable Weight *" name="changeable_weight" id="changeable_weight" value="<?=$pack_res['changeable_weight']?>" onkeyup="calculate_total()">
</p>
</td>
</tr>
<tr>
<td colspan="4">
<table cellpadding="0" cellspacing="0" width="100%" class="bdrAll" >
<tr>
<td><p class="b ml20px blue p5px">Forwarder *</p></td>
<td style="text-align: left;"><p class="b ml20px blue p5px">
<select name="forwarder_user_id" id="forwarder_user_id" style="padding:5px;">
<option value="">--- Choose Forwarder ---</option>
<?php //and user_type='Branch'
$sql_forw=db_query("select * from tbl_parcel_user where 1 and type='Forwarder' order by user_id desc");
while($res_forw=mysql_fetch_array($sql_forw))
{
?>
<option value="<?=$res_forw['user_id']?>" <?php if($pack_res['forwarder_user_id']==$res_forw['user_id']){?> selected <?}?>><?=$res_forw['user_name']?></option>
<?}?>
</select>
</p></td>
<td><p class="b ml20px blue p5px">Airway Bill No.</p></td>
<td style="text-align: left;">
<p class="b ml20px blue p5px">
<input type="text" name="forwarder_airway_bill_no" id="forwarder_airway_bill_no" value="<?=$pack_res['forwarder_airway_bill_no']?>"/>
</p>
</td>
<td><p class="b ml20px blue p5px">Airway Bill Date</p></td>
<td style="text-align: left;">
<p class="b ml20px blue p5px">
<input type="text" name="forwarder_airway_bill_date" id="forwarder_airway_bill_date" value="<?=$pack_res['forwarder_airway_bill_date']?>"/>
</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Freight
</p>
</td>
<td >
<p class="ml20px p5px">
<input type="text" placeholder="Enter Freight" name="freight" id="freight" value="<?=$pack_res['freight']?>" onkeyup="calculate_total()">
</p>
<input type="hidden" name="weight_upto" id="weight_upto" >
<input type="hidden" name="freight_rate" id="freight_rate" >
<input type="hidden" name="additional_weight" id="additional_weight" >
<input type="hidden" name="additional_charge" id="additional_charge" >
<!-- <input type="text" name="tariff_service_tax" id="tariff_service_tax" > -->
</td>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Service Tax *
</p>
</td>
<td >
<p class="ml20px p5px">
<input type="number" placeholder="Enter Service Tax *" name="service_tax" id="service_tax" value="<?=$pack_res['service_tax']?>">
</p>
</td>
</tr>
<tr>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Grand Total *
</p>
</td>
<td colspan="3">
<p class="ml20px p5px">
<input type="number" placeholder="Enter Grand Total *" style="width:100%" name="grand_total" id="grand_total" value="<?=$pack_res['grand_total']?>">
</p>
</td>
</tr>
<tr>
<td colspan="4" style="text-align: center;">
<table width="100%">
<tr style="text-align: center;" >
<td ><p class="b ml20px blue p5px">
<input type="submit" id="final_submit" name="final_submit" value="Save">
</p></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<script>
function setNextTab()
{
document.getElementById('datepicker').focus();
}
<?php
if(!empty($_SESSION['last_shipper_id']))
{?>
getShipperDetails(<?=$_SESSION['last_shipper_id']?>);
<?}?>
<?php
if($package_id!="")
{?>
// getShipperDetails(<?=$pack_res['shipper_id']?>);
cal_FOV(<?=$pack_res['invoice_value']?>);
show_hide_total_cft_field("<?=$pack_res['type_nv']?>");
calculate_cft(<?=$pack_res['total_cft']?>);
$("#changeable_weight").val('<?=$pack_res[changeable_weight]?>');
$("#service_tax").val('<?=$pack_res[service_tax]?>');
$("#grand_total").val('<?=$pack_res[grand_total]?>');
calculate_total();
<?}?>
var tariff_id="";
function getShipperDetails(shipper_id)
{
$.ajax({
url:"get_shipper_details_for_booking_ajax.php",
type:"POST",
data:{shipper_id:shipper_id},
success:function(data){
var fetch_shipper_data=JSON.parse(data);
document.getElementById('shipper_name').value=fetch_shipper_data.ship_name;
document.getElementById('shipper_mobile').value=fetch_shipper_data.ship_mobile;
document.getElementById('shipper_gst').value=fetch_shipper_data.ship_gst;
document.getElementById('shipper_gst_rate').value=fetch_shipper_data.ship_gst_rate;
document.getElementById('shipper_address').value=fetch_shipper_data.ship_address;
document.getElementById('shipper_docket_charge').value=fetch_shipper_data.ship_docket_charge;
document.getElementById('shipper_fov').value=fetch_shipper_data.ship_fov;
document.getElementById('shipper_fov_min').value=fetch_shipper_data.ship_fov_min;
document.getElementById('shipper_handling_charge').value=fetch_shipper_data.ship_handling_charge;
document.getElementById('shipper_other_charge').value=fetch_shipper_data.ship_other_charge;
// document.getElementById('shipper_pickup_city').value=fetch_shipper_data.ship_city;
document.getElementById("origin_city_name").value = fetch_shipper_data.ship_city;
if(fetch_shipper_data.transit_mode!=null)
{
document.getElementById("transit_mode").value = fetch_shipper_data.transit_mode;
}else{
document.getElementById("transit_mode").value = "Surface";
}
document.getElementById("one_cft_weight").value = fetch_shipper_data.tariff_volumetric;
setPickUpCity(fetch_shipper_data.ship_city);
tariff_id=fetch_shipper_data.tariff_id;
}
});
}
function setPickUpCity(origin_cityName)
{
document.getElementById('pickup_city').value=origin_cityName;
}
function setDeliveryBranchCity(delivery_branchCityName)
{
document.getElementById('delivery_city').value=delivery_branchCityName;
}
function cal_FOV(inv_value)
{
var shipper_fov_percentage=$('#shipper_fov').val();
var shipper_fov_min=$('#shipper_fov_min').val();
var percentage_amount=(shipper_fov_percentage / 100) * inv_value;
if(inv_value!="" || inv_value>0)
{
if(shipper_fov_percentage!="" || shipper_fov_percentage>0 || shipper_fov_min!="" || shipper_fov_min>0)
{
if(percentage_amount>shipper_fov_min)
{
$('#shipper_fov_amount').val(percentage_amount);
$("#shipper_fov_amount").attr("readonly", false);
}else if(shipper_fov_min>percentage_amount){
$('#shipper_fov_amount').val(shipper_fov_min);
$("#shipper_fov_amount").attr("readonly", true);
}
}
}
<?php/*
if($package_id!="")
{?>
calculate_total();
<?}*/?>
}
function show_hide_total_cft_field(typeNV)
{
if(typeNV=="Normal")
{
$('#total_cft').attr("disabled", true);
$('#total_cft').val("");
}else{
$('#total_cft').attr("disabled", false);