<!-- <div class="col-lg-10 col-lg-offset-1"> -->
<div class="col-lg-12">
    <section class="panel">
        <header class="panel-heading" style="min-height:120px">
            <div class="col-lg-3"> <span>Ref No : <?php echo $idl_data['idl_ref_no'];?></span> </div>
            <div class="col-lg-6">
                <h4 class="text-center"><i class="fa fa-truck truck_icon"></i><br/> <b>ETC Cargo Limited(ICD018) - Finance Entry- Finance Controller </b></h4></div>
            <div class="col-lg-3"><span>Date : <?php echo $idl_data['idl_date'];?></span></div>
        </header>
        <div class="clear"></div>
        <div class="panel-body"> 
            <form class="form-horizontal" method="post" action="<?php echo base_url();?>icd/feao_ctrl/update_icdl_addition_details/<?php echo $idl_data['idl_id'];?>">
                <div class="col-lg-12">
                    <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4">Vessel Name </label>
                        <div class="col-lg-8">

							<input type="text" class="form-control" value="<?php echo $idl_data['idl_vessel_name'];?>" readonly required>

                        </div> 
                    </div>

                    <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4">Time In </label>
                        <div class="col-lg-8">

							<input type="text" class="form-control" value="<?php echo $idl_data['idl_time_in'];?>" readonly required>

                        </div>
                    </div>
                    <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4">Bill Of Lading </label>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" value="<?php echo $idl_data['idl_bill_of_loading'];?>" readonly required>

                        </div>
                    </div>

					<div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4">Container Status </label>
                        <div class="col-lg-8">
							<input type="text" class="form-control" value="<?php echo $idl_data['csl_name'];?>" readonly required>

                        </div>
                    </div>
                    <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4">Shipping Line </label>
                        <div class="col-lg-8">
							<input type="text" class="form-control" value="<?php echo $idl_data['idl_shipping_line'];?>" readonly required>
                        </div>
                    </div>

                     <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4 ">Type Of Cargo </label>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" value="<?php echo $idl_data['ctl_name'];?>" readonly required>

                        </div>
                    </div>
                    <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4">Payment Agency </label>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" value="<?php echo $idl_data['pal_name'];?>" readonly required>

                        </div>
                    </div>

                     <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4">Proforma Invoice  </label>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" name="idl_proforma_invoice" value="<?php echo $idl_data['idl_proforma_invoice'];?>" >

                        </div>
                    </div>


                     <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4">Billing Reference </label>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" value="<?php echo $idl_data['idl_bill_refer'];?>" readonly>

                        </div>
                    </div>
                    
                    <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4"> Destination </label>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" value="<?php echo $idl_data['idl_destination'];?>" readonly>

                        </div>
                    </div>
                    <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4"> Invoice No </label>
                        <div class="col-lg-8">
                            <textarea class="form-control" name="idl_invoice_no" required><?php echo $idl_data['idl_invoice_no'];?></textarea>

                        </div>
                    </div>
                   
                </div>
				<header class="panel-heading">
                    <h4 class="text-center"> 
                        <b> Container Details </b>                    
                    </h4>
                </header>

                <div class="panel-body">
                    <section id="unseen">
                        <table class="table table-bordered table-striped table-condensed col-md-12">
                            <thead>
                                <tr>
                                    <th class="" width="100">C.No </th>
                                    <th class="numeric" width="100"> Size </th>
                                    <th class="" width="100">  Type </th>
                                    <th class="" width="100">  Status </th>
                                    <th class="" width="100">   Seal <br>S.NO1 </th>
                                    <th class="" width="100">   Seal <br>S.NO2  </th>
                                    <th class="" width="100">Service </th>
                                    <th class="" width="100">Cur </th>
                                    <th class="" width="100">H .<br> Charges </th>
                                    <th class="" width="100">Levy </th> 
                                    <th class="" width="100">addition </th>  
                                    <th class="" width="100">Sub <br> Total </th>
                                    <th class="" width="100">VAT <br>(%)</th>
                                    <th class="" width="100">Total </th>
                                    <th class="" width="100">Debit To </th>

                                </tr>
                            </thead>
                            <tbody id="tbody_id">   
                            <?php
                                foreach($icdl_list as $icdl_key=>$icdl_row){
                            ?>  
                                    <tr> 
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $icdl_row['icdl_c_no'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $icdl_row['icdl_c_size'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $icdl_row['icdl_c_type'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $icdl_row['icdl_c_status'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $icdl_row['icdl_c_seal_s_no1'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $icdl_row['icdl_c_seal_s_no2'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $icdl_row['isl_name'];?>" readonly>    
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $icdl_row['cul_name'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control handling_cls" id="hand_t_id_<?php echo $icdl_key;?>" data-const_h_val="<?php echo $icdl_key;?>" value="<?php echo $icdl_row['icdl_handling_charges'];?>" readonly>  
                                        </td>
                                        <td> 
                                        <input type="text" class="form-control levy_input_cls" id="levy_t_id_<?php echo $icdl_key;?>" data-const_l_val="<?php echo $icdl_key;?>" name="icdl_levy[]" value="<?php echo $icdl_row['icdl_levy'];?>" required> 
                                        </td>

                                        <td> 
                                            <input type="hidden" value="<?php echo $icdl_row['icdl_id'];?>"  name="icdl_id[]" required>  

                                            <input type="text" class="form-control icdl_addition_cls" id="icdl_addition_id_<?php echo $icdl_key;?>" data-const_a_val="<?php echo $icdl_key;?>"value="<?php echo $icdl_row['icdl_addition'];?>"  name="icdl_addition[]" required>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control sub_total_cls" id="sub_t_id_<?php echo $icdl_key;?>" data-const_s_val="<?php echo $icdl_key;?>" name="icdl_sub_total[]" value="<?php echo $icdl_row['icdl_sub_total'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control val_cls" id="vat_id_<?php echo $icdl_key;?>" data-const_v_val="<?php echo $icdl_key;?>" value="<?php echo $icdl_row['icdl_vat'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control total_input_cls" id="total_val_<?php echo $icdl_key;?>" value="<?php echo $icdl_row['icdl_total'];?>" name="icdl_total[]" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $icdl_row['icdl_debit_to'];?>" name="icdl_debit_to[]" required>  
                                        </td>
                                    </tr>
                            <?php
                                }
                            ?>
                            </tbody>
                        </table>

                        <div class=" col-lg-offset-5">
                            <div class="col-lg-5">
                                <button type="submit" class="btn btn-success" name="update" value="1"> <i class="fa fa-thumbs-up"></i>&nbsp; Update</button>

                                <button type="submit" class="btn btn-success" name="final_update" value="2"> <i class="fa fa-thumbs-up"></i>&nbsp; Final Update </button>
                            </div>

                        </div>

                    </section>
                </div>
                <!---->

            </form>
        </div>
    </section>

</div>

<script type='text/javascript'> 
	$('.levy_input_cls').on('keypress keyup keypress', function() {
        this_id     = $(this).attr('id');
        const_val   = $('#'+this_id).data('const_l_val'); 
        this_h_val  = $('#hand_t_id_'+const_val).val();                       
        this_l_val  = $('#'+this_id).val(); 
        this_a_val  = $('#icdl_addition_id_'+const_val).val();          
        // this_v_val  = $('#vat_id_'+const_val).val(); 
        amt_t_val = 0; 
        if(this_h_val!=''){
            amt_t_val = parseFloat(amt_t_val)+parseFloat(this_h_val);
            $('#sub_t_id_'+const_val).val(amt_t_val);
        }       
        if(this_l_val!=''){
            amt_t_val = parseFloat(this_l_val)+parseFloat(amt_t_val);
            
            $('#sub_t_id_'+const_val).val(amt_t_val);
        }
        if(this_a_val!=''){
            amt_t_val = parseFloat(this_a_val)+parseFloat(amt_t_val);                        
            $('#sub_t_id_'+const_val).val(amt_t_val);
        }
        v_val = amt_t_val*(18/100);
        $('#vat_id_'+const_val).val(v_val); 
        amt_t_val = parseFloat(amt_t_val)+parseFloat(v_val);      
        $('#total_val_'+const_val).val(amt_t_val);      
    });
    

    $('.icdl_addition_cls').on('keypress keyup keypress', function() {
        this_id     = $(this).attr('id');
        const_val   = $('#'+this_id).data('const_a_val'); 
        this_h_val  = $('#hand_t_id_'+const_val).val();                       
        this_l_val  = $('#levy_t_id_'+const_val).val(); 
        this_a_val  = $('#'+this_id).val(); 
        this_v_val  = $('#vat_id_'+const_val).val();  
        amt_t_val = 0; 
        if(this_h_val!=''){
            amt_t_val = parseFloat(amt_t_val)+parseFloat(this_h_val);
            $('#sub_t_id_'+const_val).val(amt_t_val);
        }       
        if(this_l_val!=''){
            amt_t_val = parseFloat(this_l_val)+parseFloat(amt_t_val);            
            $('#sub_t_id_'+const_val).val(amt_t_val);
        }
        
        if(this_a_val!=''){
            amt_t_val = parseFloat(this_a_val)+parseFloat(amt_t_val);                        
            $('#sub_t_id_'+const_val).val(amt_t_val);
        }
        v_val = amt_t_val*(18/100);
        $('#vat_id_'+const_val).val(v_val); 
        amt_t_val = parseFloat(amt_t_val)+parseFloat(v_val);      
        $('#total_val_'+const_val).val(amt_t_val); 
    });
</script>