ok
Direktori : /home2/selectio/public_html/lilyexpresslive/software/admin/ |
Current File : /home2/selectio/public_html/lilyexpresslive/software/admin/cargo-pickup-entry-edit.php |
<?php require_once('header.php');?> <!-- Script --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src='js/select2.full.min.js' type='text/javascript'></script> <!-- CSS --> <link href='css/select2.full.min.css' rel='stylesheet' type='text/css'> <script> $(document).ready(function() { // Initialize select2 $("#pincode").select2(); }); $(document).ready(function() { // Initialize select2 $("#customer_name").select2(); }); $(document).ready(function() { // Initialize select2 $("#customer_id").select2(); $("#client_id").select2(); $("#content_desc").select2(); }); </script> <?php $customer_id=0; $state_1 = $pdo->prepare("SELECT * FROM `pickup_entry` WHERE id=? "); $state_1->execute(array($_REQUEST['id'])); $result_1 = $state_1->fetchAll(PDO::FETCH_ASSOC); $customer_id=$result_1[0]['customer_id']; ?> <section class="content-header" style="background-color: white;" > <input type="hidden" id="cust_id" value="<?=$customer_id?>"> <div class="row"> <div class="col-md-12" style="text-align: center;"> <h4><i class="fa fa-info-circle"></i> Update Cargo Entry Details</h4> </div> </div> <?php foreach ($result_1 as $row_1) { $clientid=$row_1['client_id']; $created=$row_1['created_at']; // $date_added=date_format($created,'Y-m-d'); $date_added=date("Y-m-d", strtotime($created)); ?> <form class="form-horizontal" action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="type" value="update_cargo_entry"> <input type="hidden" name="pickup_entry_id" value="<?=$_REQUEST['id']?>"> <div class="form-group"> <label for="" class="col-sm-2 control-label">Select Client Name <span>*</span></label> <div class="col-sm-6"> <select class="form-control" name="client_id" id="client_id"> <option value="none">Select Client Name </option> <?php if($clientType=="Admin") { $statement = $pdo->prepare("SELECT * FROM tbl_user WHERE role='Cargo' ORDER BY id ASC");} else{ $statement = $pdo->prepare("SELECT * FROM tbl_user WHERE role='Cargo' and id=$clientId ORDER BY id ASC");} $statement->execute(); $result = $statement->fetchAll(PDO::FETCH_ASSOC); foreach ($result as $row) { ?> <option value="<?php echo $row['id']; ?>" <?php if($row_1['client_id']==$row['id']){ echo 'selected';}?>><?php echo $row['full_name']; ?></option> <?php } ?> </select> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">Select DB Number-<?=$row_1['client_id'].'-'?> <span>*</span></label> <div class="col-sm-6"> <select class="form-control" name="customer_id" id="customer_id"> <option value="none">Select Client First !</option> </select> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">Pincode <span>*</span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" class="form-control" name="pincode" id="pincodes" value="<?php if(isset($row_1['pincode'])){echo $row_1['pincode'];} ?>"> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">Address <span>*</span></label> <div class="col-sm-6"> <textarea class="form-control" name="address" id="address" style="height:100px;"><?php if(isset($row_1['address'])){echo $row_1['address'];} ?></textarea> </div> <div class="col-sm-4"> <span id="remain">110</span><span id="remain_txt"> characters remaining</span> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">City <span>*</span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" id="city" class="form-control" name="city" value="<?php if(isset($row_1['city'])){echo $row_1['city'];} ?>"> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">State </label> <div class="col-sm-6"> <input type="text" autocomplete="off" id="state" class="form-control" name="state" value="<?php if(isset($row_1['state'])){echo $row_1['state'];} ?>"> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">Destination <span>*</span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" id="destination" class="form-control" name="destination" value="<?php if(isset($row_1['destination'])){echo $row_1['destination'];} ?>"> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">Phone Number <span>*</span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" class="form-control" name="phone" id="phone" value="<?php if(isset($row_1['phone'])){echo $row_1['phone'];} ?>"> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">Pickup Entry Date <span>*</span></label> <div class="col-sm-6"> <input type="date" autocomplete="off" class="form-control" name="created" id="created" value="<?php if(isset($row_1['created_at'])){echo $row_1['created_at'];} ?>"> </div> </div> <input type="hidden" autocomplete="off" class="form-control" name="payment_mode" id="payment_mode" value="credit"> <input type="hidden" autocomplete="off" class="form-control" name="other_charges" id="other_charges" value="0"> <input type="hidden" autocomplete="off" class="form-control" name="total_charges" id="total_charges" value="0"> <div class="form-group"> <label for="" class="col-sm-2 control-label">AWB No <span>*</span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" id="awb_no" class="form-control" name="awb_no" value="<?php if(isset($row_1['ref_no'])){echo $row_1['ref_no'];} ?>" ><span style="color:red" id="awb_status"></span> <input type="hidden" autocomplete="off" id="old_awb_value" name="old_awb_value" value="<?php if(isset($row_1['ref_no'])){echo $row_1['ref_no'];} ?>" > <input type="hidden" autocomplete="off" id="print_id" name="print_id" value="<?php if(isset($row_1['awb_no'])){echo $row_1['awb_no'];} ?>" > <input type="hidden" autocomplete="off" id="id" name="id" value="<?php if(isset($row_1['id'])){echo $row_1['id'];} ?>" > <input type="hidden" autocomplete="off" id="awb_value" class="form-control" name="awb_value" value="yes"> </div> <div class="col-sm-4"> <span id="awb_txt"> </span> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">E-Way Bill Number <span></span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" class="form-control" name="e_way_bill_number" id="e_way_bill_number" value="<?php if(isset($row_1['e_way_bill_no'])){echo $row_1['e_way_bill_no'];} ?>"> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">Invoice Number <span></span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" class="form-control" name="invoice_no" id="invoice_no" value="<?php if(isset($row_1['invoice_no'])){echo $row_1['invoice_no'];} ?>"> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">Invoice Value <span></span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" class="form-control" name="invoice_value" id="invoice_value" value="<?php if(isset($row_1['invoice_value'])){echo $row_1['invoice_value'];} ?>"> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">Content Description <span class='required'>*</span></label> <div class="col-sm-6"> <select class="form-control" name="content_desc" id="content_desc"> <?php $statements = $pdo->prepare("SELECT * FROM material_desc"); $statements->execute(); $results = $statements->fetchAll(PDO::FETCH_ASSOC); foreach ($results as $rows) { ?> <option value="<?=$rows['id']?>" <?php if($row_1['content_desc']==$rows['id']) ?>><?=$rows['short_desc']?></option> <?php } ?> </select> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">Volumetrix Weight Details <span class='required'>*</span></label> <div class="col-sm-10"> <span style="display: inline-block;width: 100px;height: 20px;text-align: center;padding:10px;"><b>Length</b></span> <span style="display: inline-block;width: 100px;height: 20px;text-align: center;"><b>Width</b></span> <span style="display: inline-block;width: 100px;height: 20px;text-align: center;"><b>Height</b></span> <span style="display: inline-block;width: 100px;height: 20px;text-align: center;"><b>No of Box</b></span> <span style="display: inline-block;width: 100px;height: 20px;text-align: center;"><b>Act WT</b></span> <span style="display: inline-block;width: 100px;height: 20px;text-align: center;"><b>Charged WT</b></span> <br> <div style="padding:2px;"><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length1" id="length1" value="<?=$row_1['length1']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width1" id="width1" value="<?=$row_1['width1']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Height" style="width:100px;text-align:center;" name="height1" id="height1" value="<?=$row_1['height1']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="No of Box" style="width:100px;text-align:center;" name="nob1" id="nob1" value="<?=$row_1['nob1']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt1" id="act_wt1" value="<?=$row_1['act_wt1']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Act Wt" style="width:100px;text-align:center;" name="char_wt1" id="char_wt1" value="0" onkeypress="return isNumberKey(this, event);" readonly><br> </div><div style="padding:2px;"><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length2" id="length2" value="<?=$row_1['length2']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width2" id="width2" value="<?=$row_1['width2']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Height" style="width:100px;text-align:center;" name="height2" id="height2" value="<?=$row_1['height2']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="No of Box" style="width:100px;text-align:center;" name="nob2" id="nob2" value="<?=$row_1['nob2']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt2" id="act_wt2" value="<?=$row_1['act_wt2']?>" onkeypress="return isNumberKey(this, event); " onchange="calcuate_actual_wt();"> <input type="text" placeholder="Act Wt" style="width:100px;text-align:center;" name="char_wt2" id="char_wt2" value="0" onkeypress="return isNumberKey(this, event);" readonly><br> </div><div style="padding:2px;"><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length3" id="length3" value="<?=$row_1['length3']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width3" id="width3" value="<?=$row_1['width3']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Height" style="width:100px;text-align:center;" name="height3" id="height3" value="<?=$row_1['height3']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="No of Box" style="width:100px;text-align:center;" name="nob3" id="nob3" value="<?=$row_1['nob3']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt3" id="act_wt3" value="<?=$row_1['act_wt3']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Act Wt" style="width:100px;text-align:center;" name="char_wt3" id="char_wt3" value="0" onkeypress="return isNumberKey(this, event);" readonly><br> </div><div style="padding:2px;"><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length4" id="length4" value="<?=$row_1['length4']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width4" id="width4" value="<?=$row_1['width4']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Height" style="width:100px;text-align:center;" name="height4" id="height4" value="<?=$row_1['height4']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="No of Box" style="width:100px;text-align:center;" name="nob4" id="nob4" value="<?=$row_1['nob4']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt4" id="act_wt4" value="<?=$row_1['act_wt4']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Act Wt" style="width:100px;text-align:center;" name="char_wt4" id="char_wt4" value="0>" onkeypress="return isNumberKey(this, event);" readonly><br> </div><div style="padding:2px;"><input type="text" placeholder="Length" style="width:100px;text-align:center;" name="length5" id="length5" value="<?=$row_1['length5']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Width" style="width:100px;text-align:center;" name="width5" id="width5" value="<?=$row_1['width5']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Height" style="width:100px;text-align:center;" name="height5" id="height5" value="<?=$row_1['height5']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="No of Box" style="width:100px;text-align:center;" name="nob5" id="nob5" value="<?=$row_1['nob5']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Act Wt" style="width:100px;text-align:center;" name="act_wt5" id="act_wt5" value="<?=$row_1['act_wt5']?>" onkeypress="return isNumberKey(this, event);" onchange="calcuate_actual_wt();"> <input type="text" placeholder="Act Wt" style="width:100px;text-align:center;" name="char_wt5" id="char_wt5" value="0" onkeypress="return isNumberKey(this, event);" readonly> <!--<br><br> <div class="col-sm-6" style="padding:2px;text-align:right;">Actual Weight  : <input type="text" placeholder="Width" style="width:100px;text-align:center;" name="a_weight" id="a_weight" value="0" onkeypress="return isNumberKey(this, event);"><br> <div style="padding:2px;text-align:right;">Charged weight  :<input type="text" placeholder="Width" style="width:100px;text-align:center;" name="c_weight" id="c_weight" value="0" onkeypress="return isNumberKey(this, event);"> </div></div>--> </div> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">Actual Weight <span class='required'>*</span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" value="<?php if(isset($row_1['a_weight'])){echo $row_1['a_weight'];} ?>" class="form-control" name="a_weight" id="a_weight"> </div> </div> <input type="hidden" autocomplete="off" id="gst" class="form-control" name="gst_no" value="<?php if(isset($_POST['gst_no'])){echo $_POST['gst_no'];} ?>"> <div class="form-group"> <label for="" class="col-sm-2 control-label">Charged Weight <span></span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" class="form-control" name="c_weight" id="c_weight" value="<?php if(isset($row_1['c_weight'])){echo $row_1['c_weight'];} ?>"> </div> </div> <div class="form-group"> <label for="" class="col-sm-2 control-label">Number of Pieces <span class='required'>*</span></label> <div class="col-sm-6"> <input type="number" autocomplete="off" class="form-control" name="pics" id="pics" value="<?php if(isset($row_1['pics'])){echo $row_1['pics'];} ?>"> </div> </div> <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>Successfully!</strong>Cargo Pickup Entry Updated !     <a href="#" id='btn_awb' class="btn btn-md btn-primary">Print AWB Number</a> <a href="#" id='btn_label' class="btn btn-md btn-primary">Print Label</a> </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 Check the Form ! </div> <div class="form-group"> <label for="" class="col-sm-2 control-label"></label> <div class="col-sm-6"> <button type="submit" id='form_submit' class="btn btn-success pull-left" name="form1"><span id='submit_txt'>Update</span><i id='submit_spin'></i></button> <button type="text" id='form_reset' class="btn btn-primary pull-right">Reset <i class="fa fa-spin fa-recycle" style="color:white" aria-hidden="true"></i></button> </div> </div> </form> <?php }?> <br><br><br><br><br><br> </section> <script> $(document).ready(function(){ customer_drop_down();calcuate_actual_wt(); /*********** For fetching customer address and phone number ***********/ $("#awb_no").keyup(function() { var awb1 = $(this).val(); var awb_old = $('#old_awb_value').val(); if(awb1 == '' || awb1 == awb_old ) { $("#awb_txt").text(''); $("#awb_value").val('yes'); } else { $.ajax({ type: 'POST', url: 'get_unique_awb.php', data: { awb: awb1, type: 'awb_no' }, dataType: 'json', success: function(response) { console.log(response); if(response[0]['error'] == '0') { $("#awb_value").val('yes'); $("#awb_txt").css('color', 'green'); $("#awb_txt").text(response[0]['txt']); } else if(response[0]['error'] == '1') { $("#awb_value").val('no'); $("#awb_txt").css('color', 'red'); $("#awb_txt").text(response[0]['txt']); } else { $("#awb_value").val('no'); $("#awb_txt").css('color', 'red'); $("#awb_txt").text(''); } } }); } }); $('#customer_id').on('change',function(){ var cust_id=$(this).val(); if(cust_id){ $.ajax({ type:'POST', url:'get_customer_data.php', data:{id:cust_id}, dataType: 'json', success:function(response){ var len = response.length; $('textarea#address').val(response[0]['address']); $('#phone').val(response[0]['mobile']); $('#city').val(response[0]['city']); $('#state').val(response[0]['state']); $('#pincodes').val(response[0]['pincode']); $('#destination').val(response[0]['destination']); address_limit(); } }); } }); /*********** For fetching gst number ***********/ $('#client_id').on('change',function(){ var client_id=$(this).val(); if(client_id){ $.ajax({ type:'POST', url:'get_client_data.php', data:{id:client_id}, dataType: 'json', success:function(response){ var len = response.length; $('#gst').val(response[0]['gst']); } }); } }); $('#form_reset').on('change',function(){ location.reload(); }); $('#form_submit').on('click', function(e) { e.preventDefault(); $("#form_submit").prop('disabled', true); var validate = 1; validate = formValidate(); //alert(validate); if(validate) { $('#submit_txt').text('Wait'); $.ajax({ type: 'POST', url: 'cargo-entry-edit-api.php', data: $("form").serialize(), beforeSend: function() { // setting a timeout $('#submit_spin').addClass('fa fa-spinner fa-spin'); }, dataType: 'json', success: function(response) { console.log("dgdg"+response); $('#submit_txt').text('Cargo Entry Updated Successfully!!'); var res_text = response[0]['txt']; console.log("message : "+res_text); if(response[0]['error'] == '1') { var awb_num = response[0]['awb_number']; $('#status_success').show(); $('#status_failure').hide(); $("#btn_awb").attr('href', 'cargo-invoice-preview.php?list_id=' + awb_num); $("#btn_label").attr('href', 'cargo-lable-print.php?list_id=' + awb_num); $('#form_submit').removeClass('btn-danger'); $('#form_submit').addClass('btn-success'); $('#submit_txt').text(res_text); $("#submit_spin").removeClass("fa fa-spinner fa-spin"); } else { $('#status_success').hide(); $('#status_failure').show(); $("#form_submit").prop('disabled', false); $('#form_submit').removeClass('btn-success'); $('#form_submit').addClass('btn-danger'); $('#submit_txt').text(res_text); $("#submit_spin").removeClass("fa fa-spinner fa-spin"); } $("#form_submit").prop('disabled', false); } }); }else{ console.log('error'); } }); /*********** For fetching Customer ***********/ $('#client_id').on('change',function(){ customer_drop_down(); }); }); function formValidate() { var valid = 1; if ($('#client_id').val() == 'none') { $('#client_id_txt').text('Please select the Client'); $('#client_id_txt').css('color', 'red'); valid=0; console.log('client error : '); } else { $('#client_id_txt').text(''); } if ($('#customer_id').val() == 'none') { $('#customer_id_txt').text('Please select the Customer'); $('#customer_id_txt').css('color', 'red'); valid=0; console.log('customer error : '); } else { $('#customer_id_txt').text(''); } if ($('#awb_value').val() == 'no') { $('#awb_txt').text('Please Enter Valid AWB Number'); $('#awb_txt').css('color', 'red'); valid=0; console.log('awb error : '); } else { $('#awb_txt').text(''); } return valid; } function customer_drop_down(){ var client_id=$('#client_id').val(); var cust_id=$('#cust_id').val(); //alert(client_id); if(client_id){ $.ajax({ type:'POST', url:'cargo-entry-edit-api.php', data:{id:client_id,customer_id:cust_id,type:'get_client_customer'}, success:function(html){ $('#customer_id').html(html); } }); } } 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() { var length1=$('#length1').val(); var width1=$('#width1').val(); var height1=$('#height1').val(); var nob1=$('#nob1').val(); var act_wt1=$('#act_wt1').val(); if(length1==""){ length1=0;$('#length1').val('0'); } if(width1==""){ width1=0;$('#width1').val('0'); } if(height1==""){ height1=0;$('#height1').val('0'); } if(nob1==""){ nob1=0;$('#nob1').val('0'); } if(act_wt1==""){ act_wt1=0;$('#act_wt1').val('0'); } var char_wt1=length1*width1*height1*nob1; if(char_wt1!=0 && char_wt1!=0.00){ char_wt1=char_wt1/4500; } $('#char_wt1').val(parseFloat(char_wt1).toFixed(2)); var length2 =$('#length2').val(); var width2 =$('#width2').val(); var height2 =$('#height2').val(); var nob2 =$('#nob2').val(); var act_wt2=$('#act_wt2').val(); if(length2 ==""){ length2 =0;$('#length2').val('0'); } if(width2 ==""){ width2 =0;$('#width2').val('0'); } if(height2 ==""){ height2 =0;$('#height2').val('0'); } if(nob2 ==""){ nob2 =0;$('#nob2').val('0'); } if(act_wt2 ==""){ act_wt2 =0;$('#act_wt2').val('0'); } var char_wt2 =length2 *width2 *height2 *nob2 ; if(char_wt2 !=0 && char_wt2 !=0.00){ char_wt2 =char_wt2 /4500; } $('#char_wt2').val(parseFloat(char_wt2 ).toFixed(2)); var length3=$('#length3').val(); var width3=$('#width3').val(); var height3=$('#height3').val(); var nob3=$('#nob3').val(); var act_wt3=$('#act_wt3').val(); if(length3==""){ length3=0;$('#length3').val('0'); } if(width3==""){ width3=0;$('#width3').val('0'); } if(height3==""){ height3=0;$('#height3').val('0'); } if(nob3==""){ nob3=0;$('#nob3').val('0'); } if(act_wt3==""){ act_wt3=0;$('#act_wt3').val('0'); } var char_wt3=length3*width3*height3*nob3; if(char_wt3!=0 && char_wt3!=0.00){ char_wt3=char_wt3/4500; } $('#char_wt3').val(parseFloat(char_wt3).toFixed(2)); var length4=$('#length4').val(); var width4=$('#width4').val(); var height4=$('#height4').val(); var nob4=$('#nob4').val(); var act_wt4=$('#act_wt4').val(); if(length4==""){ length4=0;$('#length4').val('0'); } if(width4==""){ width4=0;$('#width4').val('0'); } if(height4==""){ height4=0;$('#height4').val('0'); } if(nob4==""){ nob4=0;$('#nob4').val('0'); } if(act_wt4==""){ act_wt4=0;$('#act_wt4').val('0'); } var char_wt4=length4*width4*height4*nob4; if(char_wt4!=0 && char_wt4!=0.00){ char_wt4=char_wt4/4500; } $('#char_wt4').val(parseFloat(char_wt4).toFixed(2)); var length5=$('#length5').val(); var width5=$('#width5').val(); var height5=$('#height5').val(); var nob5=$('#nob5').val(); var act_wt5=$('#act_wt5').val(); if(length5==""){ length5=0;$('#length5').val('0'); } if(width5==""){ width5=0;$('#width5').val('0'); } if(height5==""){ height5=0;$('#height5').val('0'); } if(nob5==""){ nob5=0;$('#nob5').val('0'); } if(act_wt5==""){ act_wt5=0;$('#act_wt5').val('0'); } var char_wt5=length5*width5*height5*nob5; if(char_wt5!=0 && char_wt5!=0.00){ char_wt5=char_wt5/4500; } $('#char_wt5').val(parseFloat(char_wt5).toFixed(2)); if(act_wt1 > char_wt1){ char_wt1=act_wt1; } if(act_wt2 > char_wt2){ char_wt2=act_wt2; } if(act_wt3 > char_wt3){ char_wt3=act_wt3; } if(act_wt4 > char_wt4){ char_wt4=act_wt4; } if(act_wt5 > char_wt5){ char_wt5=act_wt5; } var c_weight=(parseFloat(char_wt1)+parseFloat(char_wt2)+parseFloat(char_wt3)+parseFloat(char_wt4)+parseFloat(char_wt5)).toFixed(2); $('#c_weight').val(c_weight); var a_weight=(parseFloat(act_wt1)+parseFloat(act_wt2)+parseFloat(act_wt3)+parseFloat(act_wt4)+parseFloat(act_wt5)); $('#a_weight').val(parseFloat(a_weight).toFixed(2)); var pics=parseInt(nob1)+parseInt(nob2)+parseInt(nob3)+parseInt(nob4)+parseInt(nob5); $('#pics').val(pics); console.log("a wight :"+a_weight); } </script> <?php require_once('footer.php'); ?>