ok
Direktori : /home2/selectio/www/lilyexpresslive/software/admin/ |
Current File : /home2/selectio/www/lilyexpresslive/software/admin/cargo-entry-easy-edit.php |
<?php require_once('header.php'); $total_p=0; ?> <script> $(document).ready(function() { $(function(){ $("[data-hide]").on("click", function(){ // -or-, see below $(this).closest("." + $(this).attr("data-hide")).hide() }) }) /*********** For fetching Driver ***********/ $('#update_all').click(function() { var all_awb = $("input[name='awb_ids[]']") .map(function(){return $(this).val();}).get(); /*var nopics = $("input[name='no_pics[]']") .map(function(){return $(this).val();}).get(); var update_day = $("input[name='update_date[]']") .map(function(){return $(this).val();}).get();*/ var invoice_no = $("input[name='invoice_no[]']") .map(function(){return $(this).val();}).get(); var invoice_value = $("input[name='invoice_value[]']") .map(function(){return $(this).val();}).get(); var e_way_bill_no = $("input[name='e_way_bill_no[]']") .map(function(){return $(this).val();}).get(); var nob = $("input[name='nob[]']") .map(function(){return $(this).val();}).get(); var a_weight = $("input[name='a_weight[]']") .map(function(){return $(this).val();}).get(); var c_weight = $("input[name='c_weight[]']") .map(function(){return $(this).val();}).get(); var date = $("input[name='date[]']") .map(function(){return $(this).val();}).get(); var length1 = $("input[name='length1[]']") .map(function(){return $(this).val();}).get(); var width1 = $("input[name='width1[]']") .map(function(){return $(this).val();}).get(); var height1 = $("input[name='height1[]']") .map(function(){return $(this).val();}).get(); var nob1 = $("input[name='nob1[]']") .map(function(){return $(this).val();}).get(); var act_wt1 = $("input[name='act_wt1[]']") .map(function(){return $(this).val();}).get(); var length2 = $("input[name='length2[]']") .map(function(){return $(this).val();}).get(); var width2 = $("input[name='width2[]']") .map(function(){return $(this).val();}).get(); var height2 = $("input[name='height2[]']") .map(function(){return $(this).val();}).get(); var nob2 = $("input[name='nob2[]']") .map(function(){return $(this).val();}).get(); var act_wt2 = $("input[name='act_wt2[]']") .map(function(){return $(this).val();}).get(); var length3 = $("input[name='length3[]']") .map(function(){return $(this).val();}).get(); var width3 = $("input[name='width3[]']") .map(function(){return $(this).val();}).get(); var height3 = $("input[name='height3[]']") .map(function(){return $(this).val();}).get(); var nob3 = $("input[name='nob3[]']") .map(function(){return $(this).val();}).get(); var act_wt3 = $("input[name='act_wt3[]']") .map(function(){return $(this).val();}).get(); var length4 = $("input[name='length4[]']") .map(function(){return $(this).val();}).get(); var width4 = $("input[name='width4[]']") .map(function(){return $(this).val();}).get(); var height4 = $("input[name='height4[]']") .map(function(){return $(this).val();}).get(); var nob4 = $("input[name='nob4[]']") .map(function(){return $(this).val();}).get(); var act_wt4 = $("input[name='act_wt4[]']") .map(function(){return $(this).val();}).get(); var length5 = $("input[name='length5[]']") .map(function(){return $(this).val();}).get(); var width5 = $("input[name='width5[]']") .map(function(){return $(this).val();}).get(); var height5 = $("input[name='height5[]']") .map(function(){return $(this).val();}).get(); var nob5 = $("input[name='nob5[]']") .map(function(){return $(this).val();}).get(); var act_wt5 = $("input[name='act_wt5[]']") .map(function(){return $(this).val();}).get(); var destination = $("input[name='destination[]']") .map(function(){return $(this).val();}).get(); var arr_len = all_awb.length; var user_id = $('#user_id').val(); var user_location = $('#user_location').val(); if(arr_len != 0) { $.ajax({ url: 'get_cargo_unique_awb.php', type: 'post', data: { awb_id: all_awb, invoice_no:invoice_no, invoice_value:invoice_value, e_way_bill_no:e_way_bill_no, nob:nob, a_weight:a_weight, c_weight:c_weight, length1:length1,width1:width1,height1:height1,nob1:nob1,act_wt1:act_wt1, length2:length2,width2:width2,height2:height2,nob2:nob2,act_wt2:act_wt2, length3:length3,width3:width3,height3:height3,nob3:nob3,act_wt3:act_wt3, length4:length4,width4:width4,height4:height4,nob4:nob4,act_wt4:act_wt4, length5:length5,width5:width5,height5:height5,nob5:nob5,act_wt5:act_wt5, user_id:user_id,destination:destination, user_location:user_location,date:date, type:'easyEdit' }, dataType: 'json', beforeSend: function() { // setting a timeout $('#update_fa').removeClass('fa fa-paper-plane'); $('#update_txt').text('Please Wait'); $('#update_fa').addClass('fa fa-spinner fa-spin'); }, success: function(response) { $('#update_fa').removeClass('fa fa-spinner fa-spin'); if(response[0]['error'] == 1) { $('#success_msg').text(''); var tmsg=response[0]['msg'].length; for(var i=0; i<tmsg;i++) { $('#success_msg').append(response[0]['msg'][i]+"<br>") } $('#status_success').show(); $('#status_failure').hide(); $('#update_txt').text('Done'); $('#update_fa').addClass('fa fa fa-check'); } else { $('#status_success').hide(); $('#status_failure').show(); $('#update_txt').text('Submit Again'); $('#update_fa').addClass('fa fa-paper-plane'); } } }); } else { alert('No Pickup Entries is Selected'); } }); }); </script> <script> const array = []; var count = 0; $(document).ready(function() { /*********** For fetching customer address and phone number ***********/ $('#awb').bind('input',function() { //alert('keyup function'); process(1); }); }); function setText(element) { // alert('set text function'); var value = $(element).text(); var userid = $(element).val(); $("#awb").val(value); process(2); $("#searchResult").empty(); } function process(dynamic) { // alert(dynamic); var gvalue=dynamic; // console.log(gvalue); var type_id = $('#awb').val(); var awb_id = $('#i').val(); var destination = $('#destination').val(); if(type_id != "") { $.ajax({ type: 'POST', url: 'check-cargo-awb.php', data: { id: type_id, gvalue:gvalue }, dataType: 'json', success: function(response) { $('#f').text(''); $('#s').text(''); if(response[0]['id'] == 0) { $('#s').text(response[0]['status']); $('#f').text(''); $("#searchResult").empty(); } if(response[0]['status'] == 2) { var len = response.length; $("#searchResult").empty(); for(var i = 0; i < len; i++) { var id = response[i]['id']; var awb_number = response[i]['ref_no']; $("#searchResult").append("<li value='" + awb_number + "'>" + awb_number + "</li>"); } $("#searchResult li").bind("click", function() { setText(this); }); } if(response[0]['status'] == "Success") { if(array.includes(response[0]['id'])) { $('#f').text('AWB Number Already Added'); $('#s').text(''); $("#searchResult").empty(); } else { var ct_day=response[0]['created']; var up_day=response[0]['today']; ct_day = Date.parse(ct_day); up_day = Date.parse(up_day); /*Confirm Dialog Start*/ $('#awb').val(''); if(awb_id == "") { var sd = response[0]['id']; }else { var sd = awb_id + ',' + response[0]['id']; } var k = response[0]['id']; if(response[0]['read_status']=='1' || 1==1){ $('#s').text(response[0]['status']); if (ct_day === up_day) { array.push(k); count++; $('#myTable').prepend('<tr id=' + count + '><td><button class="btn btn-sm btn-danger" onclick="remove(' + k + ',' + count + ')">X</button></td><td>Awb No : ' + response[0]['ref_no'] + ' <br>Client Name : ' + response[0]['client_id'] + '<br>Db Code : ' + response[0]['dpcode'] + '<br>Customer Name : ' + response[0]['customer_name'] + '<br>Destination City : ' + response[0]['destination'] + '</td><td>Inv No : <input onkeypress="goToSearch(event)" type="text" placeholder="Invoice No" value=" '+ response[0]['invoice_no'] + '" style="width:100px;text-align:center;text-align:center;" name="invoice_no[]"><br>Inv Val: <input type="text" placeholder="Invoice Val" value="'+ response[0]['invoice_value'] +'" style="width:100px;text-align:center;text-align:center;" name="invoice_value[]"><br>E-Way: <input type="text" placeholder="E-Way" value="'+ response[0]['e_way_bill_no'] +'" style="width:100px;text-align:center;text-align:center;" name="e_way_bill_no[]"><br>NOB: <input type="text" placeholder="nob" value="'+ response[0]['pics'] +'" style="width:100px;text-align:center;text-align:center;" name="nob[]" id="nob-' + count + '" ><br>Act Wt: <input type="text" placeholder="Act weight" value="'+ response[0]['a_weight'] +'" style="width:100px;text-align:center;text-align:center;" name="a_weight[]" id="a_weight-' + count + '" ><br>Char Wt: <input type="text" placeholder="C Wt" value="'+ response[0]['c_weight'] +'" style="width:100px;text-align:center;text-align:center;" name="c_weight[]" id="c_weight-' + count + '"><br>Destination City: <input type="text" placeholder="Destination" value="'+ response[0]['destination'] +'" style="width:100px;text-align:center;text-align:center;" name="destination[]" id="destination-' + count + '"><br>Date: <input type="date" placeholder="C Wt" value="'+ response[0]['created'] +'" style="width:200px;text-align:center;text-align:center;" name="date[]" id="date-' + count + '"></td><td><span style="display: inline-block;width: 50px;height: 12px;text-align: center;padding:10px;"><b>L</b></span><span style="display: inline-block;width: 50px;height: 12px;text-align: center;"><b>W</b></span><span style="display: inline-block;width: 50px;height: 12px;text-align: center;"><b>H</b></span><span style="display: inline-block;width: 50px;height: 12px;text-align: center;"><b>Box</b></span><span style="display: inline-block;width: 50px;height: 12px;text-align: center;"><b>A.WT</b></span><span style="display: inline-block;width: 50px;height: 12px;text-align: center;"><b>C.WT</b></span><br><input type="text" placeholder="Length" style="width:50px;text-align:center;" name="length1[]" id="length1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length1'] + '"><input type="text" placeholder="Width" style="width:50px;text-align:center;" name="width1[]" id="width1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:50px;text-align:center;" name="height1[]" id="height1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" value=" '+ response[0]['height1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:50px;text-align:center;" name="nob1[]" id="nob1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" value=" '+ response[0]['nob1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:50px;text-align:center;" name="act_wt1[]" value=" '+ response[0]['act_wt1'] + '" id="act_wt1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Char Wt" style="width:50px;text-align:center;" name="char_wt1[]" value="0" id="char_wt1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" readonly><br><input type="text" placeholder="Length" style="width:50px;text-align:center;" name="length2[]" id="length2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length2'] + '"><input type="text" placeholder="Width" style="width:50px;text-align:center;" name="width2[]" id="width2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:50px;text-align:center;" name="height2[]" id="height2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');" value=" '+ response[0]['height2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:50px;text-align:center;" name="nob2[]" id="nob2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');" value=" '+ response[0]['nob2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:50px;text-align:center;" name="act_wt2[]" value=" '+ response[0]['act_wt2'] + '" id="act_wt2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Char Wt" style="width:50px;text-align:center;" name="char_wt2[]" value="0" id="char_wt2-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" readonly><br><input type="text" placeholder="Length" style="width:50px;text-align:center;" name="length3[]" id="length3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length3'] + '"><input type="text" placeholder="Width" style="width:50px;text-align:center;" name="width3[]" id="width3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:50px;text-align:center;" name="height3[]" id="height3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');" value=" '+ response[0]['height3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:50px;text-align:center;" name="nob3[]" id="nob3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');" value=" '+ response[0]['nob3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:50px;text-align:center;" name="act_wt3[]" value=" '+ response[0]['act_wt3'] + '" id="act_wt3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Char Wt" style="width:50px;text-align:center;" name="char_wt3[]" value="0" id="char_wt3-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" readonly><br><input type="text" placeholder="Length" style="width:50px;text-align:center;" name="length4[]" id="length4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length4'] + '"><input type="text" placeholder="Width" style="width:50px;text-align:center;" name="width4[]" id="width4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:50px;text-align:center;" name="height4[]" id="height4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');" value=" '+ response[0]['height4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:50px;text-align:center;" name="nob4[]" id="nob4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');" value=" '+ response[0]['nob4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:50px;text-align:center;" name="act_wt4[]" value=" '+ response[0]['act_wt4'] + '" id="act_wt4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Char Wt" style="width:50px;text-align:center;" name="char_wt4[]" value="0" id="char_wt4-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" readonly><br><input type="text" placeholder="Length" style="width:50px;text-align:center;" name="length5[]" id="length5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length5'] + '"><input type="text" placeholder="Width" style="width:50px;text-align:center;" name="width5[]" id="width5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:50px;text-align:center;" name="height5[]" id="height5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');" value=" '+ response[0]['height5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:50px;text-align:center;" name="nob5[]" id="nob5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');" value=" '+ response[0]['nob5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:50px;text-align:center;" name="act_wt5[]" value=" '+ response[0]['act_wt5'] + '" id="act_wt5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Char Wt" style="width:50px;text-align:center;" name="char_wt5[]" value="0" id="char_wt5-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" readonly><br></td><input type="hidden" class="form-control" step="any" name="awb_ids[]" value="' + response[0]['id'] + '"></tr>'); //$('#myTable').prepend('<tr id=' + count + '><td><button class="btn btn-sm btn-danger" onclick="remove(' + k + ',' + count + ')">X</button></td><td>Awb No : ' + response[0]['ref_no'] + ' <br>Client Name : ' + response[0]['client_id'] + '<br>Db Code : ' + response[0]['dpcode'] + '<br>Customer Name : ' + response[0]['customer_name'] + '<br>Destination City : ' + response[0]['destination'] + '</td><td>Inv No : <input onkeypress="goToSearch(event)" type="text" placeholder="Invoice No" value=" '+ response[0]['invoice_no'] + '" style="width:100px;text-align:center;text-align:center;" name="invoice_no[]"><br>Inv Val: <input type="text" placeholder="Invoice Val" value="'+ response[0]['invoice_value'] +'" style="width:100px;text-align:center;text-align:center;" name="invoice_value[]"><br>E-Way: <input type="text" placeholder="E-Way" value="'+ response[0]['e_way_bill_no'] +'" style="width:100px;text-align:center;text-align:center;" name="e_way_bill_no[]"><br>NOB: <input type="text" placeholder="nob" value="'+ response[0]['pics'] +'" style="width:100px;text-align:center;text-align:center;" name="nob[]" id="nob-' + count + '" ><br>Act Wt: <input type="text" placeholder="Act weight" value="'+ response[0]['a_weight'] +'" style="width:100px;text-align:center;text-align:center;" name="a_weight[]" id="a_weight-' + count + '" ><br>Char Wt: <input type="text" placeholder="C Wt" value="'+ response[0]['c_weight'] +'" style="width:100px;text-align:center;text-align:center;" name="c_weight[]"></td><td><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length1[]" id="length1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length1'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width1[]" id="width1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height1[]" id="height1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" value=" '+ response[0]['height1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob1[]" id="nob1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" value=" '+ response[0]['nob1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt1[]" value=" '+ response[0]['act_wt1'] + '" id="act_wt1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" readonly><br><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length2[]" id="length2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length2'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width2[]" id="width2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height2[]" id="height2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');" value=" '+ response[0]['height2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob2[]" id="nob2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');" value=" '+ response[0]['nob2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt2[]" value=" '+ response[0]['act_wt2'] + '" id="act_wt2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');"><br><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length3[]" id="length3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length3'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width3[]" id="width3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height3[]" id="height3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');" value=" '+ response[0]['height3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob3[]" id="nob3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');" value=" '+ response[0]['nob3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt3[]" value=" '+ response[0]['act_wt3'] + '" id="act_wt3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');"><br><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length4[]" id="length4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length4'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width4[]" id="width4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height4[]" id="height4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');" value=" '+ response[0]['height4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob4[]" id="nob4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');" value=" '+ response[0]['nob4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt4[]" value=" '+ response[0]['act_wt4'] + '" id="act_wt4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');"><br><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length5[]" id="length5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length5'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width5[]" id="width5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height5[]" id="height5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');" value=" '+ response[0]['height5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob5[]" id="nob5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');" value=" '+ response[0]['nob5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt5[]" value=" '+ response[0]['act_wt5'] + '" id="act_wt5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');"><br></td><input type="hidden" class="form-control" step="any" name="awb_ids[]" value="' + response[0]['id'] + '"></tr>'); //$('#myTable').prepend('<tr id=' + count + '><td><button class="btn btn-sm btn-danger" onclick="remove(' + k + ',' + count + ')">X</button></td><td>Awb No : ' + response[0]['ref_no'] + ' <br>Client Name : ' + response[0]['client_id'] + '<br>Db Code : ' + response[0]['dpcode'] + '<br>Customer Name : ' + response[0]['customer_name'] + '<br>Destination City : ' + response[0]['destination'] + '</td><td>Inv No : <input onkeypress="goToSearch(event)" type="text" placeholder="Invoice No" value=" '+ response[0]['invoice_no'] + '" style="width:100px;text-align:center;text-align:center;" name="invoice_no[]"><br>Inv Val: <input type="text" placeholder="Invoice Val" value="'+ response[0]['invoice_value'] +'" style="width:100px;text-align:center;text-align:center;" name="invoice_value[]"><br>E-Way: <input type="text" placeholder="E-Way" value="'+ response[0]['e_way_bill_no'] +'" style="width:100px;text-align:center;text-align:center;" name="e_way_bill_no[]"><br>NOB: <input type="text" placeholder="nob" value="'+ response[0]['pics'] +'" style="width:100px;text-align:center;text-align:center;" name="nob[]"><br>Act Wt: <input type="text" placeholder="Act weight" value="'+ response[0]['a_weight'] +'" style="width:100px;text-align:center;text-align:center;" name="a_weight[]"><br>Char Wt: <input type="text" placeholder="C Wt" value="'+ response[0]['c_weight'] +'" style="width:100px;text-align:center;text-align:center;" name="c_weight[]"></td><td><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length1[]" id="length1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length1'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width1[]" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height1[]" value=" '+ response[0]['height1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob1[]" value=" '+ response[0]['nob1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt1[]" value=" '+ response[0]['act_wt1'] + '"><br><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length2[]" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length2'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width2[]" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height2[]" value=" '+ response[0]['height2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob2[]" value=" '+ response[0]['nob2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt2[]" value=" '+ response[0]['act_wt2'] + '"><br><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length3[]" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length3'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width3[]" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height3[]" value=" '+ response[0]['height3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob3[]" value=" '+ response[0]['nob3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt3[]" value=" '+ response[0]['act_wt3'] + '"><br><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length4[]" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length4'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width4[]" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height4[]" value=" '+ response[0]['height4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob4[]" value=" '+ response[0]['nob4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt4[]" value=" '+ response[0]['act_wt4'] + '"><br><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length5[]" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length5'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width5[]" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height5[]" value=" '+ response[0]['height5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob5[]" value=" '+ response[0]['nob5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt5[]" value=" '+ response[0]['act_wt5'] + '"><br></td><input type="hidden" class="form-control" step="any" name="awb_ids[]" value="' + response[0]['id'] + '"></tr>'); //$('#myTable').prepend('<tr id=' + count + '><td><button class="btn btn-sm btn-danger" onclick="remove(' + k + ',' + count + ')">X</button></td><td>' + response[0]['ref_no'] + '</td><td class="pics"><input type="number" id="autofocus'+count+'" onkeypress="goToSearch(event)" class="form-control" step="any" name="no_pics[]" value="' + response[0]['pics'] + '"></td><td><input type="date" class="form-control" name="update_date[]" value="' + response[0]['created'] + '"></td><td>' + response[0]['dpcode'] + '</td><td>' + response[0]['customer_name'] + '</td><td class="weight"><input type="hidden" class="form-control" step="any" name="awb_ids[]" value="' + response[0]['id'] + '">' + response[0]['c_weight'] + '</td><td>' + response[0]['destination'] + '</td><td>' + response[0]['client_id'] + '</td></tr>'); calcuate_actual_wt('1',count); }else { var isConfirm=confirm('This pickup entry '+response[0]['ref_no']+' is Back dated('+response[0]['created']+'). Do you want to add..? '); if(isConfirm) { array.push(k); count++; // $('#myTable').prepend('<tr id=' + count + '><td><button class="btn btn-sm btn-danger" onclick="remove(' + k + ',' + count + ')">X</button></td><td>' + response[0]['ref_no'] + '</td><td class="pics"><input type="number" id="autofocus'+count+'" onkeypress="goToSearch(event)" class="form-control" step="any" name="no_pics[]" value="' + response[0]['pics'] + '"></td><td><input type="date" class="form-control" name="update_date[]" value="' + response[0]['created'] + '"></td><td>' + response[0]['dpcode'] + '</td><td>' + response[0]['customer_name'] + '</td><td class="weight"><input type="hidden" class="form-control" step="any" name="awb_ids[]" value="' + response[0]['id'] + '">' + response[0]['c_weight'] + '</td><td>' + response[0]['destination'] + '</td><td>' + response[0]['client_id'] + '</td></tr>'); //$('#myTable').prepend('<tr id=' + count + '><td><button class="btn btn-sm btn-danger" onclick="remove(' + k + ',' + count + ')">X</button></td><td>Awb No : ' + response[0]['ref_no'] + ' <br>Client Name : ' + response[0]['client_id'] + '<br>Db Code : ' + response[0]['dpcode'] + '<br>Customer Name : ' + response[0]['customer_name'] + '<br>Destination City : ' + response[0]['destination'] + '</td><td>Inv No : <input onkeypress="goToSearch(event)" type="text" placeholder="Invoice No" value=" '+ response[0]['invoice_no'] + '" style="width:100px;text-align:center;text-align:center;" name="invoice_no[]"><br>Inv Val: <input type="text" placeholder="Invoice Val" value="'+ response[0]['invoice_value'] +'" style="width:100px;text-align:center;text-align:center;" name="invoice_value[]"><br>E-Way: <input type="text" placeholder="E-Way" value="'+ response[0]['e_way_bill_no'] +'" style="width:100px;text-align:center;text-align:center;" name="e_way_bill_no[]"><br>NOB: <input type="text" placeholder="nob" value="'+ response[0]['pics'] +'" style="width:100px;text-align:center;text-align:center;" name="nob[]" id="nob-' + count + '" ><br>Act Wt: <input type="text" placeholder="Act weight" value="'+ response[0]['a_weight'] +'" style="width:100px;text-align:center;text-align:center;" name="a_weight[]" id="a_weight-' + count + '" ><br>Char Wt: <input type="text" placeholder="C Wt" value="'+ response[0]['c_weight'] +'" style="width:100px;text-align:center;text-align:center;" name="c_weight[]"></td><td><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length1[]" id="length1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length1'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width1[]" id="width1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height1[]" id="height1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" value=" '+ response[0]['height1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob1[]" id="nob1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" value=" '+ response[0]['nob1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt1[]" value=" '+ response[0]['act_wt1'] + '" id="act_wt1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" readonly><br><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length2[]" id="length2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length2'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width2[]" id="width2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height2[]" id="height2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');" value=" '+ response[0]['height2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob2[]" id="nob2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');" value=" '+ response[0]['nob2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt2[]" value=" '+ response[0]['act_wt2'] + '" id="act_wt2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');"><br><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length3[]" id="length3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length3'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width3[]" id="width3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height3[]" id="height3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');" value=" '+ response[0]['height3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob3[]" id="nob3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');" value=" '+ response[0]['nob3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt3[]" value=" '+ response[0]['act_wt3'] + '" id="act_wt3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');"><br><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length4[]" id="length4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length4'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width4[]" id="width4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height4[]" id="height4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');" value=" '+ response[0]['height4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob4[]" id="nob4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');" value=" '+ response[0]['nob4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt4[]" value=" '+ response[0]['act_wt4'] + '" id="act_wt4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');"><br><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length5[]" id="length5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length5'] + '"><input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width5[]" id="width5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:100px;text-align:center;" name="height5[]" id="height5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');" value=" '+ response[0]['height5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:100px;text-align:center;" name="nob5[]" id="nob5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');" value=" '+ response[0]['nob5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt5[]" value=" '+ response[0]['act_wt5'] + '" id="act_wt5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');"><br></td><input type="hidden" class="form-control" step="any" name="awb_ids[]" value="' + response[0]['id'] + '"></tr>'); $('#myTable').prepend('<tr id=' + count + '><td><button class="btn btn-sm btn-danger" onclick="remove(' + k + ',' + count + ')">X</button></td><td>Awb No : ' + response[0]['ref_no'] + ' <br>Client Name : ' + response[0]['client_id'] + '<br>Db Code : ' + response[0]['dpcode'] + '<br>Customer Name : ' + response[0]['customer_name'] + '<br>Destination City : ' + response[0]['destination'] + '</td><td>Inv No : <input onkeypress="goToSearch(event)" type="text" placeholder="Invoice No" value=" '+ response[0]['invoice_no'] + '" style="width:100px;text-align:center;text-align:center;" name="invoice_no[]"><br>Inv Val: <input type="text" placeholder="Invoice Val" value="'+ response[0]['invoice_value'] +'" style="width:100px;text-align:center;text-align:center;" name="invoice_value[]"><br>E-Way: <input type="text" placeholder="E-Way" value="'+ response[0]['e_way_bill_no'] +'" style="width:100px;text-align:center;text-align:center;" name="e_way_bill_no[]"><br>NOB: <input type="text" placeholder="nob" value="'+ response[0]['pics'] +'" style="width:100px;text-align:center;text-align:center;" name="nob[]" id="nob-' + count + '" ><br>Act Wt: <input type="text" placeholder="Act weight" value="'+ response[0]['a_weight'] +'" style="width:100px;text-align:center;text-align:center;" name="a_weight[]" id="a_weight-' + count + '" ><br>Char Wt: <input type="text" placeholder="C Wt" value="'+ response[0]['c_weight'] +'" style="width:100px;text-align:center;text-align:center;" name="c_weight[]" id="c_weight-' + count + '"><br>Destination City: <input type="text" placeholder="Destination" value="'+ response[0]['destination'] +'" style="width:100px;text-align:center;text-align:center;" name="destination[]" id="destination-' + count + '"><br>Date: <input type="date" placeholder="C Wt" value="'+ response[0]['created'] +'" style="width:200px;text-align:center;text-align:center;" name="date[]" id="date-' + count + '"></td><td><span style="display: inline-block;width: 50px;height: 12px;text-align: center;padding:10px;"><b>L</b></span><span style="display: inline-block;width: 50px;height: 12px;text-align: center;"><b>W</b></span><span style="display: inline-block;width: 50px;height: 12px;text-align: center;"><b>H</b></span><span style="display: inline-block;width: 50px;height: 12px;text-align: center;"><b>Box</b></span><span style="display: inline-block;width: 50px;height: 12px;text-align: center;"><b>A.WT</b></span><span style="display: inline-block;width: 50px;height: 12px;text-align: center;"><b>C.WT</b></span><br><input type="text" placeholder="Length" style="width:50px;text-align:center;" name="length1[]" id="length1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length1'] + '"><input type="text" placeholder="Width" style="width:50px;text-align:center;" name="width1[]" id="width1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:50px;text-align:center;" name="height1[]" id="height1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" value=" '+ response[0]['height1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:50px;text-align:center;" name="nob1[]" id="nob1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" value=" '+ response[0]['nob1'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:50px;text-align:center;" name="act_wt1[]" value=" '+ response[0]['act_wt1'] + '" id="act_wt1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Char Wt" style="width:50px;text-align:center;" name="char_wt1[]" value="0" id="char_wt1-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" readonly><br><input type="text" placeholder="Length" style="width:50px;text-align:center;" name="length2[]" id="length2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length2'] + '"><input type="text" placeholder="Width" style="width:50px;text-align:center;" name="width2[]" id="width2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:50px;text-align:center;" name="height2[]" id="height2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');" value=" '+ response[0]['height2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:50px;text-align:center;" name="nob2[]" id="nob2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');" value=" '+ response[0]['nob2'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:50px;text-align:center;" name="act_wt2[]" value=" '+ response[0]['act_wt2'] + '" id="act_wt2-' + count + '" onchange="calcuate_actual_wt(2,' + count + ');"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Char Wt" style="width:50px;text-align:center;" name="char_wt2[]" value="0" id="char_wt2-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" readonly><br><input type="text" placeholder="Length" style="width:50px;text-align:center;" name="length3[]" id="length3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length3'] + '"><input type="text" placeholder="Width" style="width:50px;text-align:center;" name="width3[]" id="width3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:50px;text-align:center;" name="height3[]" id="height3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');" value=" '+ response[0]['height3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:50px;text-align:center;" name="nob3[]" id="nob3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');" value=" '+ response[0]['nob3'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:50px;text-align:center;" name="act_wt3[]" value=" '+ response[0]['act_wt3'] + '" id="act_wt3-' + count + '" onchange="calcuate_actual_wt(3,' + count + ');"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Char Wt" style="width:50px;text-align:center;" name="char_wt3[]" value="0" id="char_wt3-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" readonly><br><input type="text" placeholder="Length" style="width:50px;text-align:center;" name="length4[]" id="length4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length4'] + '"><input type="text" placeholder="Width" style="width:50px;text-align:center;" name="width4[]" id="width4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:50px;text-align:center;" name="height4[]" id="height4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');" value=" '+ response[0]['height4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:50px;text-align:center;" name="nob4[]" id="nob4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');" value=" '+ response[0]['nob4'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:50px;text-align:center;" name="act_wt4[]" value=" '+ response[0]['act_wt4'] + '" id="act_wt4-' + count + '" onchange="calcuate_actual_wt(4,' + count + ');"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Char Wt" style="width:50px;text-align:center;" name="char_wt4[]" value="0" id="char_wt4-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" readonly><br><input type="text" placeholder="Length" style="width:50px;text-align:center;" name="length5[]" id="length5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');" onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['length5'] + '"><input type="text" placeholder="Width" style="width:50px;text-align:center;" name="width5[]" id="width5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');"onkeypress="return isNumberKey(this, event);" value=" '+ response[0]['width5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Height" style="width:50px;text-align:center;" name="height5[]" id="height5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');" value=" '+ response[0]['height5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="No of Box" style="width:50px;text-align:center;" name="nob5[]" id="nob5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');" value=" '+ response[0]['nob5'] + '"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Act Wt" style="width:50px;text-align:center;" name="act_wt5[]" value=" '+ response[0]['act_wt5'] + '" id="act_wt5-' + count + '" onchange="calcuate_actual_wt(5,' + count + ');"><input type="text" onkeypress="return isNumberKey(this, event);" placeholder="Char Wt" style="width:50px;text-align:center;" name="char_wt5[]" value="0" id="char_wt5-' + count + '" onchange="calcuate_actual_wt(1,' + count + ');" readonly><br></td><input type="hidden" class="form-control" step="any" name="awb_ids[]" value="' + response[0]['id'] + '"></tr>'); calcuate_actual_wt('1',count); } } }else { $('#f').text('This AWB Number is Already Picked'); } $("#autofocus"+count).focus(); $("#searchResult").empty(); total_summary(); /*Confirm Dialog End*/ } } } }); } } function isNumberKey(txt, evt) { var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode == 46) { //Check if the text already contains the . character if (txt.value.indexOf('.') === -1) { return true; } else { return false; } } else { if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; } return true; } function calcuate_actual_wt(row,row1) { console.log("function called"+row+"--"+row1); var tot_c_weight=0;tot_a_weight=0;var tot_nob=0; for(var row=1;row<=5;row++){ var length=$('#length'+row+'-'+row1).val(); var width=$('#width'+row+'-'+row1).val(); var height=$('#height'+row+'-'+row1).val(); var nob=$('#nob'+row+'-'+row1).val(); var act_wt=$('#act_wt'+row+'-'+row1).val(); if(length==""){ length=0;$('#length'+row+'-'+row1).val('0'); } if(width==""){ width=0;$('#width'+row+'-'+row1).val('0'); } if(height==""){ height=0;$('#height'+row+'-'+row1).val('0'); } if(nob==""){ nob=0;$('#nob'+row+'-'+row1).val('0'); } if(act_wt==""){ act_wt=0;$('#act_wt'+row+'-'+row1).val('0'); } var char_wt=length*width*height*nob; if(char_wt!=0 && char_wt!=0.00){ char_wt=char_wt/4000; } $('#char_wt'+row+'-'+row1).val(parseFloat(char_wt).toFixed(2)); if(act_wt > char_wt){ char_wt=act_wt; } tot_c_weight=parseFloat(tot_c_weight)+parseFloat(char_wt); tot_a_weight=parseFloat(tot_a_weight)+parseFloat(act_wt); tot_nob=parseInt(tot_nob)+parseInt(nob); } $('#c_weight-'+row1).val((tot_c_weight).toFixed(2)); $('#a_weight-'+row1).val((tot_a_weight).toFixed(2)); $('#nob-'+row1).val(tot_nob); } </script> <script> function remove(k, count) { var len = array.length; len = len - 1; for(var i = len; i >= 0; i--) { if(array[i] == k) { var i_val = i; array.splice(i_val, 1); $('table#my_data tr#' + count).remove(); break; } } total_summary(); } function total_summary() { var no_pics = 0; var no_weights = 0; var tot_records = $('#my_data tr').length - 1; // iterate through each td based on class and add the values if(tot_records >= 1) { $(".pics").each(function() { var value = $(this).text(); // add only if the value is number if(!isNaN(value) && value.length != 0) { no_pics += parseFloat(value); } }); $(".weight").each(function() { var value1 = $(this).text(); // add only if the value is number if(!isNaN(value1) && value1.length != 0) { no_weights += parseFloat(value1); no_weight = no_weights.toFixed(2); } }); } else { no_pics = 0; no_weight = 0; tot_records = 0; } $("#tot_record").text(tot_records); } function goToSearch(event) { var code = event.keyCode || event.which; if(code == 13) { //Enter keycode $('#awb').focus(); } } </script> <section class="content-header" style="background-color: white;"> <div class="row"> <div class="col-md-12" style="text-align: center;"> <h4><i class="fa fa-info-circle"></i> Edit Cargo Entry Details</h4> </div> </div> <div class="row"> <input type="hidden" id="user_id" value="<?=$clientId?>"> <input type="hidden" id="user_location" value="<?=$clientLocation?>"> <div class="col-md-12"> <div class="alert alert-success alert-dismissible fade in" id="status_success" style="display:none;"> <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a> <strong>Success!</strong> Pick Entry Updated ! <p id="success_msg"></p> </div> <div class="alert alert-danger alert-dismissible fade in" id="status_failure" style="display:none;"> <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a> <strong>Failed!</strong> Please Try Again ! </div> <div class="row"> <div class="col-md-4"> <label>Total Records Scanned: <span id="tot_record">0</span> </label> </div> </div> <div class="row"> <div class="col-md-2"></div> <div class="col-md-4"> <input placeholder="Enter AWB Number" type="text" class="form-control" name="awb" id="awb"> <br> <ul id="searchResult"></ul> <center><span style="color:green;" id="s"></span><span style="color:red;" id="f"></span></center> <input type="hidden" class="form-control" name="i" id="i"> </div> <div class="col-md-3"> <button class="btn btn-sm btn-success" id="a">Search <i class="fa fa-search-plus"></i></button> </div> <div class="col-md-3"> <button id='update_all' class="btn btn-warning btn-sm"><span id="update_txt">Update All</span> <i id="update_fa" class="fa fa-paper-plane"></i></button> </div> </div> <div > <div class="box-body table-responsive"> <table id="my_data" class="table table-bordered table-striped"> <thead> <tr> <th width="2%">Action</th> <th width="25%">Cargo Entry Details</th> <th width="20%">Editable Column's</th> <th >Dimensions's</th> </tr> </thead> <tbody id="myTable"> </tbody> </table> </div> </div> </div> </div> </section> <?php require_once('footer.php'); ?>