-
Notifications
You must be signed in to change notification settings - Fork 0
/
add-booking-old-16-10-2020.php
1133 lines (880 loc) · 29.6 KB
/
add-booking-old-16-10-2020.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('header.php');
//Old file header
?>
<!--
<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" />
<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'];
if(isset($_POST['final_submit'])){
if($package_id!="")
{
$query=db_query("update tbl_package set
airway_bill_no='$_POST[airway_bill_no]',
booking_date='$_POST[booking_date]',
user_id='$_POST[customer_code]',
shipper_id='$_POST[origin_shipper_id]',
shipper_name='$_POST[shipper_name]',
shipper_mobile='$_POST[shipper_mobile]',
shipper_address='$_POST[shipper_address]',
shipper_docket_charge='$_POST[shipper_docket_charge]',
shipper_fov='$_POST[shipper_fov]',
shipper_handling_charge='$_POST[shipper_handling_charge]',
shipper_other_charge='$_POST[shipper_other_charge]',
pickup_city='$_POST[shipper_pickup_city]',
destination_city='$_POST[destination_city]',
delivery_city='$_POST[delivery_city]',
payment_mode='$_POST[payment_mode]',
cheque_number='$_POST[cheque_number]',
transit_mode='$_POST[transit_mode]',
invoice_no='$_POST[invoice_no]',
invoice_date='$_POST[invoice_date]',
invoice_value='$_POST[invoice_value]',
consignee='$_POST[consignee]',
name='$_POST[name]',
mobile='$_POST[mobile]',
gst='$_POST[gst]',
address='$_POST[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]',
actual_weight='$_POST[actual_weight]',
changeable_weight='$_POST[changeable_weight]',
freight='$_POST[freight]',
service_tax='$_POST[service_tax]',
grand_total='$_POST[grand_total]' where package_id='$package_id' ");
if($query)
{?>
<script>
alert("Package Updated Successfully !");
window.location.href="add-booking.php?pack_id=<?=$package_id?>";
</script>
<?}
}else{
$query=db_query("insert into tbl_package set
airway_bill_no='$_POST[airway_bill_no]',
booking_date='$_POST[booking_date]',
user_id='$_POST[customer_code]',
shipper_id='$_POST[origin_shipper_id]',
shipper_name='$_POST[shipper_name]',
shipper_mobile='$_POST[shipper_mobile]',
shipper_address='$_POST[shipper_address]',
shipper_docket_charge='$_POST[shipper_docket_charge]',
shipper_fov='$_POST[shipper_fov]',
shipper_handling_charge='$_POST[shipper_handling_charge]',
shipper_other_charge='$_POST[shipper_other_charge]',
pickup_city='$_POST[shipper_pickup_city]',
destination_city='$_POST[destination_city]',
delivery_city='$_POST[delivery_city]',
payment_mode='$_POST[payment_mode]',
cheque_number='$_POST[cheque_number]',
transit_mode='$_POST[transit_mode]',
invoice_no='$_POST[invoice_no]',
invoice_date='$_POST[invoice_date]',
invoice_value='$_POST[invoice_value]',
consignee='$_POST[consignee]',
name='$_POST[name]',
mobile='$_POST[mobile]',
gst='$_POST[gst]',
address='$_POST[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]',
actual_weight='$_POST[actual_weight]',
changeable_weight='$_POST[changeable_weight]',
freight='$_POST[freight]',
service_tax='$_POST[service_tax]',
grand_total='$_POST[grand_total]'");
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. " value="<?=$pack_res['airway_bill_no']?>" <?php if($package_id!=""){?> readonly <?}?>>
</p>
</th>
<th>
<p class="b ml20px blue p5px">Booking Date *
<input type="date" name="booking_date" id="booking_date" <?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>
<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']?>"/>
</p>
</td>
<td>
<p class="b ml20px blue p5px">
Destination City *
<select name="destination_city" id="destination_city">
<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">
Cash <input type="radio" name="payment_mode" value="Cash" onclick="show_cheque_number_field()" <?php if($pack_res['payment_mode']=="Cash"){?>checked<?}?>>
Cheque <input type="radio" name="payment_mode" value="Cheque" onclick="show_cheque_number_field()" <?php if($pack_res['payment_mode']=="Cheque" || $pack_res['payment_mode']==""){?>checked<?}?> >
To Pay <input type="radio" name="payment_mode" value="To Pay" onclick="show_cheque_number_field()" <?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;" 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="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']?>">
</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
</p>
</td>
<td colspan="3">
<p class="ml20px p5px">
<input type="text" placeholder="Enter Consignee" name="consignee" id="consignee" value="<?=$pack_res['consignee']?>" >
</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="mobile" id="mobile" maxlength="10" value="<?=$pack_res['mobile']?>">
<input type="text" placeholder="GST" name="gst" id="gst" value="<?=$pack_res['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">
<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">
<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']?>">
</p>
</td>
</tr>
<tr>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Actual Weight *
</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']?>">
</p>
</td>
<td style="text-align: center;">
<p class="b ml20px blue p5px">
Chargeable Weight *
</p>
</td>
<td >
<p class="ml20px p5px">
<input type="number" placeholder="Chargeable Weight *" name="changeable_weight" id="changeable_weight" value="<?=$pack_res['changeable_weight']?>">
</p>
</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']?>">
</p>
</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>
<?php
if($package_id!="")
{?>
getShipperDetails(<?=$pack_res['shipper_id']?>);
<?}?>
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_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_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;
tariff_id=fetch_shipper_data.tariff_id;
}
});
}
$(document).ready(function(){
var airway_bill_no="";
var booking_date="";
var customer_code="";
var origin_shipper_id="";
var shipper_name="";
var shipper_mobile="";
var shipper_address="";
var shipper_docket_charge="";
var shipper_fov="";
var shipper_handling_charge="";
var shipper_other_charge="";
var shipper_pickup_city="";
var destination_city="";
var delivery_city="";
var payment_mode="";
var cheque_number="";
var transit_mode="";
var invoice_no="";
var invoice_date="";
var invoice_value="";
$("#next_btn").click(function(){
airway_bill_no=$('#airway_bill_no').val();
booking_date=$('#booking_date').val();
customer_code=$('#customer_code').val();
origin_shipper_id=$('#origin_shipper_id').val();
shipper_name=$('#shipper_name').val();
shipper_mobile=$('#shipper_mobile').val();
shipper_address=$('#shipper_address').val();
shipper_docket_charge=$('#shipper_docket_charge').val();
shipper_fov=$('#shipper_fov').val();
shipper_handling_charge=$('#shipper_handling_charge').val();
shipper_other_charge=$('#shipper_other_charge').val();
shipper_pickup_city=$('#shipper_pickup_city').val();
destination_city=$('#destination_city').val();
delivery_city=$('#delivery_city').val();
payment_mode=$('input[name="payment_mode"]:checked').val();
if(payment_mode=="Cheque")
{
cheque_number=$('#cheque_number').val();
}
transit_mode=$('#transit_mode').val();
invoice_no=$('#invoice_no').val();
invoice_date=$('#invoice_date').val();
invoice_value=$('#invoice_value').val();
if(airway_bill_no==''){
alert("Enter Airway Bill No. !");
document.getElementById('airway_bill_no').focus();
return false;
}
if(customer_code==''){
alert("Select Customer Code !");
document.getElementById('customer_code').focus();
return false;
}
if(origin_shipper_id==''){
alert("Select Origin !");
document.getElementById('origin_shipper_id').focus();
return false;
}
if(shipper_name==''){
alert("Enter Origin Name !");
document.getElementById('shipper_name').focus();
return false;
}
if(shipper_mobile==''){
alert("Enter Origin Mobile No. !");
document.getElementById('shipper_mobile').focus();
return false;
}
if(shipper_address==''){
alert("Enter Origin Address !");
document.getElementById('shipper_address').focus();
return false;
}
if(shipper_docket_charge!="")
{
if(isNaN(shipper_docket_charge)){
alert("Enter Numeric Value Only !");
document.getElementById('shipper_docket_charge').focus();
return false;
}
}
if(shipper_other_charge!="")
{
if(isNaN(shipper_other_charge)){
alert("Enter Numeric Value Only !");
document.getElementById('shipper_other_charge').focus();
return false;
}
}
if(shipper_handling_charge!="")
{
if(isNaN(shipper_handling_charge)){
alert("Enter Numeric Value Only !");
document.getElementById('shipper_handling_charge').focus();
return false;
}
}
if(shipper_fov!="")
{
if(isNaN(shipper_fov)){
alert("Enter Numeric Value Only !");
document.getElementById('shipper_fov').focus();
return false;
}
}
if(shipper_pickup_city==''){
alert("Enter Pick up City !");
document.getElementById('shipper_pickup_city').focus();
return false;
}
if(destination_city==''){
alert("Select Destination City !");
document.getElementById('destination_city').focus();
return false;
}
if(delivery_city==''){
alert("Select Delivery City !");
document.getElementById('delivery_city').focus();
return false;
}
if( !$('input[name="payment_mode"]').is(":checked") )
{
alert("Select Payment Mode !");
document.getElementById('payment_mode').focus();
return false;
}
/*if(payment_mode=="Cheque" && cheque_number=="")
{
alert("Enter Cheque Number !");
document.getElementById('cheque_number').focus();
return false;
}*/
if(transit_mode=="")
{
alert("Select Transit Mode !");
document.getElementById('transit_mode').focus();
return false;
}
/*if(invoice_no=="")
{
alert("Enter Invoice Number !");
document.getElementById('invoice_no').focus();
return false;
}
if(invoice_date=="")
{
alert("Select Invoice Date !");
document.getElementById('invoice_date').focus();
return false;
}
if(invoice_value=="")
{
alert("Enter Invoice Value !");
document.getElementById('invoice_value').focus();
return false;
}
if(isNaN(invoice_value)){
alert("Enter Numeric Value Only !");
document.getElementById('invoice_value').focus();
return false;
}
*/
$.ajax({
url:"get_booking_freight_ajax.php",
type:"POST",
data:{from_city:shipper_pickup_city,destination_city:destination_city,tariff_id:tariff_id},
success:function(data){
var fetch_tariff_data=JSON.parse(data);
document.getElementById('freight').value=fetch_tariff_data.freight;
}
});
$('.step1_form').hide();
$('.back_btn_display').show();
$('.step2_form').show();
});
$("#back_btn").click(function(){
$('.step1_form').show();
$('.back_btn_display').hide();
$('.step2_form').hide();
});
});
function step2_form_validation(){
var consignee="";
var name="";
var mobile="";
var gst="";
var address="";
var said_to_contain="";
var no_of_package="";
var type_nv="";
var total_cft="";
var actual_weight="";
var changeable_weight="";
var freight="";
var service_tax="";
var grand_total="";
consignee=$('#consignee').val();
name=$('#name').val();
mobile=$('#mobile').val();
gst=$('#gst').val();
address=$('#address').val();
said_to_contain=$('#said_to_contain').val();
no_of_package=$('#no_of_package').val();
type_nv=$('#type_nv').val();
total_cft=$('#total_cft').val();
actual_weight=$('#actual_weight').val();
changeable_weight=$('#changeable_weight').val();
service_tax=$('#service_tax').val();
grand_total=$('#grand_total').val();
/*if(consignee=="")
{
alert("Enter Consignee !");
document.getElementById('consignee').focus();
return false;
}
if(name=="")
{
alert("Enter Name !");
document.getElementById('name').focus();
return false;
}
if(mobile=="")
{
alert("Enter Mobile No. !");
document.getElementById('mobile').focus();
return false;
}
if(isNaN(mobile)){
alert("Mobile no. should be no. !");
document.getElementById('mobile').focus();
return false;
}*/
if(mobile!="")
{
if(mobile.length < 10){
alert("Mobile no. should be 10 digit long !");
document.getElementById('mobile').focus();
return false;
}
}
/*if(gst=="")
{
alert("Enter GST No. !");
document.getElementById('gst').focus();
return false;
}
if(address=="")
{
alert("Enter Address !");
document.getElementById('address').focus();
return false;
}
if(said_to_contain=="")
{
alert("Enter Said To Contain !");
document.getElementById('said_to_contain').focus();
return false;
}*/
if(no_of_package=="")
{
alert("Enter No. Of Package !");
document.getElementById('no_of_package').focus();
return false;
}
if(isNaN(no_of_package)){
alert("Enter Numeric Value Only !");
document.getElementById('no_of_package').focus();
return false;
}
if(type_nv=="")
{
alert("Enter Type N/V !");
document.getElementById('type_nv').focus();
return false;
}
if(total_cft=="")
{
alert("Enter Total CFT !");
document.getElementById('total_cft').focus();
return false;
}
if(isNaN(total_cft)){
alert("Enter Numeric Value Only !");
document.getElementById('total_cft').focus();