<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 $igedl_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) - Container Release Finance Entry Window – Finance Officer </b></h4></div>
            <div class="col-lg-3"><span>Date : <?php echo $igedl_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/cro_ctrl/update_container_release_details/<?php echo $igedl_data['igedl_id'];?>">
				<input type="hidden" name="igedl_cro_re_c_no" value="<?php echo $igedl_data['igedl_cro_re_c_no'];?>" readonly required>
                
                <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 $igedl_data['idl_vessel_name'];?>" readonly required>

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

                        </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 $igedl_data['idl_bill_of_loading'];?>" readonly required>

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

                        </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 $igedl_data['idl_shipping_line'];?>" readonly required>
                        </div>
                    </div>
                    <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4">Agent Name  </label>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" value="<?php echo $igedl_data['agl_name'];?>" readonly>
                        </div>
                    </div>
                    <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4">Registration No</label>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" value="<?php echo $igedl_data['igedl_regi_no'];?>" readonly>

                        </div>
                    </div>    
                    <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4">Initiated By</label>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" value="<?php echo $igedl_data['igedl_initiated_by'];?>" 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" rows="3" readonly><?php echo $igedl_data['idl_invoice_no'];?></textarea>

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

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

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

							<input type="text" class="form-control" name="igetl_vat_amount" id="inv_val_t_val" readonly required >

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

							<input type="text" class="form-control" name="igetl_invoice_date"  required >

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

							<input type="text" class="form-control" name="igetl_total_amount" id="inv_t_val" readonly required >

                        </div>
                    </div>
                    <div class="form-group col-md-6">
                        <label class="col-lg-4 col-sm-4">Inv Sub Total  </label>
                        <div class="col-lg-8">

							<input type="text" class="form-control" name="igetl_sub_total" id="inv_sub_t_val" required >

                        </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 $igedl_data['idl_destination'];?>" readonly>

                        </div>
                    </div>
                     <div class="col-md-6">
                        <div class="form-group col-md-12">
                            <label class="col-lg-4 col-sm-4">Token Type 1</label>
                            <div class="col-lg-8">
                                <input type="hidden" class="form-control" name="igetl_id[]" value="0" readonly required>                                   
                                <input type="text" class="form-control token_type_cls" name="igetl_token_type[]" readonly required>
                                        
                            </div>
                        </div>                                
                        <div class="form-group col-md-12">
                            <label class="col-lg-4 col-sm-4">Token No 1</label>
                            <div class="col-lg-8">
                                <input type="text" class="form-control" value="TKN-<?php echo $aginl_no['aginl_val'];?>" readonly required>
                            </div>
                        </div>  
                        <div class="form-group col-md-12">
                            <label class="col-lg-4 col-sm-4">Expiry. Date 1</label>
                            <div class="col-lg-8">
                                <input type="text" class="form-control" name="igetl_expiry_date[]" required>
                            </div>
                        </div>
                    </div>  
                    <div class="col-md-6" id="token_type_2_div_cls">
                        <div class="form-group col-md-12">
                            <label class="col-lg-4 col-sm-4">Token Type 2</label>
                            <div class="col-lg-8">
                                <input type="hidden" class="form-control" name="igetl_id[]" value="0" readonly required>         
                                <input type="text" class="form-control token_type_cls" name="igetl_token_type[]" readonly required>
                            </div>
                        </div>                                     
                        <div class="form-group col-md-12">
                            <label class="col-lg-4 col-sm-4">Token No 2</label>
                            <div class="col-lg-8">
                                <input type="text" class="form-control" value="TKN-<?php echo ($aginl_no['aginl_val']+1);?>" readonly required>
                            </div>
                        </div>                                
                        <div class="form-group col-md-12">
                            <label class="col-lg-4 col-sm-4">Expiry. Date 2</label>
                            <div class="col-lg-8">
                                <input type="text" class="form-control" name="igetl_expiry_date[]" required>
                            </div>
                        </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="col-md-1">Container No </th>
                                    <th class="numeric col-md-1"> Size </th>
                                    <th class="col-md-1">  Type </th>
                                    <th class="col-md-1">  Goods Description </th>
                                    <th class="col-md-1">  Verification Cycle </th>
                                    <th class="col-md-1">  New Seal.No </th>
                                    <th class="col-md-1">  Stripping </th>
                                    <th class="col-md-2">  Release For </th>
                                    <th class="col-md-2"> Remarks </th>

                                </tr>
                            </thead>
                            <tbody id="tbody_id">   
                             
                                <tr> 
                                    <td> 
                                        <!-- <input type="text" class="form-control" value="<?php echo $ivcl_row['icdl_c_no'];?>" readonly>   -->

                                        <select class="form-control container_no_cls" name="icdl_id" required>
                                            <option value="0">--Select--</option>
                                            <?php
                                                foreach($ivcl_list as $ivcl_row){
                                            ?>
                                                    <option value="<?php echo $ivcl_row['icdl_id']; ?>"><?php echo $ivcl_row['icdl_c_no']; ?></option>
                                                            
                                            <?php
                                                 }
                                            ?>
                                        </select>
                                    </td>
                                    <td> 
                                        <input type="text" class="form-control con_n_cls_11" readonly>  
                                    </td>
                                    <td> 
                                        <input type="text" class="form-control con_n_cls_12" readonly>  
                                    </td>
                                    <td> 
                                        <input type="text" class="form-control con_n_cls_13" readonly>  
                                    </td>
                                    <td> 
                                        <input type="text" class="form-control con_n_cls_14" readonly>  
                                    </td>
                                    <td> 
                                        <input type="text" class="form-control con_n_cls_15" readonly>  
                                    </td>
                                    <td> 
                                        <input type="text" class="form-control con_n_cls_16" readonly> 
                                    </td>
                                    <td> 
                                        <input type="text" class="form-control con_n_cls_17" id="relase_for_id" readonly>  
                                    </td>
                                    <td> 
                                        <input type="text" class="form-control con_n_cls_18" readonly>  
                                    </td>
                                        
                                </tr>
                           
                            </tbody>
                        </table>

                        <div class=" col-lg-offset-6">
                            <div class="col-lg-7">
                                <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'> 
    ivcl_list = <?php echo json_encode($ivcl_list);?>

    $('.container_no_cls').change(function() {
        this_val    = $(this).val();
        $.each(ivcl_list , function(i,n){
            if(n.icdl_id==this_val){
                $('.con_n_cls_11').val(n.icdl_c_size);                
                $('.con_n_cls_12').val(n.icdl_c_type);                
                $('.con_n_cls_13').val(n.icdl_goods_desc);     
                $('.con_n_cls_14').val(n.icdl_verification_cycle);     
                $('.con_n_cls_15').val(n.icdl_new_seal_no);     
                $('.con_n_cls_16').val(n.icdl_stripping);     
                $('.con_n_cls_17').val(n.icdl_extra_field);     
                $('.con_n_cls_18').val(n.icdl_remarks);     



                csl_name = '<?php echo $igedl_data['csl_name'];?>';
                relase_for_val = $('#relase_for_id').val();
                $('#token_type_2_div_cls').html('');
                // console.log(relase_for_val);
                if(relase_for_val=="Container with Material"){
                    $('#token_type_2_div_cls').css({'display':'none'});                    
                }else{
                    $('#token_type_2_div_cls').html('<div class="form-group col-md-12">'+
                            '<label class="col-lg-4 col-sm-4">Token Type 2</label>'+
                            '<div class="col-lg-8">'+
                            '<input type="hidden" class="form-control" name="igetl_id[]" value="0" readonly required> '+        
                            '<input type="text" class="form-control token_type_cls" name="igetl_token_type[]" readonly required>'+
                            '</div> </div> <div class="form-group col-md-12"> '+
                            '<label class="col-lg-4 col-sm-4">Token No 2</label> <div class="col-lg-8">'+
                            '<input type="text" class="form-control" value="TKN-<?php echo ($aginl_no['aginl_val']+1);?>" readonly required>'+
                            '</div> </div>   <div class="form-group col-md-12">'+
                            '<label class="col-lg-4 col-sm-4">Expiry. Date 2</label> <div class="col-lg-8">'+
                            '<input type="text" class="form-control" name="igetl_expiry_date[]" required>'+
                            '</div>  </div>');                    
                    $('#token_type_2_div_cls').css({'display':'block'});                    
                    
                }

                // Local-Container&Material
                // Local-LCL/Extra Material
                // Local-Empty Container
                if(csl_name=='Local'){
                    if(relase_for_val=="Container with Material"){ 
                        $('.token_type_cls').val('Local-Container&Material');
                    }else if(relase_for_val=="Container with Material & Extra Material"){
                        $('.token_type_cls').val('Local-LCL/Extra Material');
                    }else if(relase_for_val=="LCL & Empty Container"){
                        $('.token_type_cls').val('Local-Empty Container');
                    }
                }
                if(csl_name=='Transit'){
                    if(relase_for_val=="Container with Material"){
                        $('.token_type_cls').val('Transit-Material');
                    }else if(relase_for_val=="Material & Empty-Container"){
                        $('.token_type_cls').val('Transit-Empty-Container');
                    }
                }
                
                            
            }
        });

    });
</script>

<script type='text/javascript'> 
    $(document).ready(function(){
        
    });
	$('#inv_sub_t_val').on('keypress keyup keypress', function() {
        this_val = $(this).val();
             
        v_val = this_val*(18/100);
        $('#inv_val_t_val').val(v_val); 
        amt_t_val = parseFloat(this_val)+parseFloat(v_val);
        $('#inv_t_val').val(amt_t_val);
        
        
    });
</script>