<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'];?>">
                <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['igedl_importer_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="igedl_vat_amount" value="<?php echo $igedl_data['igedl_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="igedl_invoice_date" value="<?php echo $igedl_data['igedl_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="igedl_total_amount" value="<?php echo $igedl_data['igedl_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="igedl_sub_total" value="<?php echo $igedl_data['igedl_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>
                    <?php
                        if(sizeOf($igetl_list)=='0'){
                    ?>
                            <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="igedl_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" name="igedl_token_no[]" value="<?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="igedl_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="text" class="form-control token_type_cls" name="igedl_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" name="igedl_token_no[]"  value="<?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="igedl_expiry_date[]" required>

                                    </div>
                                </div>
                            </div>
                    <?php
                        }if(sizeOf($igetl_list)!='0'){
                            foreach($igetl_list as $igetl_key=>$igetl_row){
                                $igetl_key_val = $igetl_key+1;
                    ?>
                                <div class="form-group col-md-6">
                                    <label class="col-lg-4 col-sm-4">Token Type <?php echo $igetl_key_val;?></label>
                                    <div class="col-lg-8">    
                                        <input type="hidden" class="form-control" name="igetl_id[]" value="<?php echo $igetl_row['igetl_id'];?>" readonly required>
                                                                            
                                        <input type="text" class="form-control" name="igedl_token_type[]" value="<?php echo $igetl_row['igetl_token_type'];?>" readonly required>
                                        
                                    </div>
                                </div>

                                <div class="form-group col-md-6">
                                    <label class="col-lg-4 col-sm-4">Token No <?php echo $igetl_key_val;?></label>
                                    <div class="col-lg-8">                                        
                                        <input type="text" class="form-control" name="igedl_token_no[]" value="<?php echo $igetl_row['igetl_token_no'];?>" readonly required>
                                        
                                    </div>
                                </div>

                                <div class="form-group col-md-6">
                                    <label class="col-lg-4 col-sm-4">Expiry. Date <?php echo $igetl_key_val;?></label>
                                    <div class="col-lg-8">                                        
                                        <input type="text" class="form-control" name="igedl_expiry_date[]" value="<?php echo $igetl_row['igetl_expiry_date'];?>"  required>
                                        
                                    </div>
                                </div>
                    <?php
                            }
                        }
                    ?>
                                     

                                      
                    
                   
                </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">   
                            <?php
                                foreach($ivcl_list as $ivcl_row){
                            ?>  
                                    <tr> 
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $ivcl_row['icdl_c_no'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $ivcl_row['icdl_c_size'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $ivcl_row['icdl_c_type'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $ivcl_row['icdl_goods_desc'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $ivcl_row['icdl_verification_cycle'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $ivcl_row['icdl_new_seal_no'];?>" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $ivcl_row['icdl_stripping'];?>" readonly> 
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $ivcl_row['icdl_extra_field'];?>" id="relase_for_id" readonly>  
                                        </td>
                                        <td> 
                                            <input type="text" class="form-control" value="<?php echo $ivcl_row['icdl_remarks'];?>" readonly>  
                                        </td>
                                        
                                    </tr>
                            <?php
                                }
                            ?>
                            </tbody>
                        </table>

                        <div class=" col-lg-offset-5">
                            <div class="col-lg-6">
                                <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'> 
    $(document).ready(function(){
        csl_name = '<?php echo $igedl_data['csl_name'];?>';
        relase_for_val = $('#relase_for_id').val();
        // console.log(relase_for_val);
        if(relase_for_val!="Container with Material & Extra Material"){
            $('#token_type_2_div_cls').html('');
        }

        // 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-Container with Material');
            }else if(relase_for_val=="Container with Material & Extra Material"){
                $('.token_type_cls').val('Transit-Material');
            }else if(relase_for_val=="LCL & Empty Container"){
                $('.token_type_cls').val('Transit-Empty-Container');
            }
        }
    });
	$('#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>