           
    <div class="panel panel-default">
    <?php         
    $query = $this->main_model->debitcredit_info($debitcredit_id);
    foreach($query as $row): 
    ?>
        <div class="panel-heading">
            <h6 class="panel-title"><i class="fa fa fa-align-justify"></i> Debit Note Information</h6>
            <a href="<?php echo site_url('everbright/debit'); ?>" class="pull-right btn btn-circle btn-xs btn-default"><i class="fa fa-step-backward"></i> Back</a>
        </div>

        <div class="panel-body">
            <form action="<?php echo site_url('everbright/debit/edit/'.$row['debitcredit_id']); ?>" method="post" class="form-horizontal validate" role="form"> 
                  
                <div class="row">
                    <!-- Date -->
                    <div class="col-md-6">                   
                        <div class="form-group">
                            <label class="col-sm-4 control-label text-right">Date <span class="mandatory">*</span></label>
                            <div class="col-sm-8">
                                <input type="text" class="required form-control datepicker" placeholder="Date" name="date" value="<?php echo $row['date']; ?>">
                            </div>
                        </div> 
                    </div> 
                    <!-- Invoice No. -->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-4 text-right">Invoice No. </label>
                            <div class="col-md-8">
                                <select data-placeholder="(:-- Select Invoice No. --:)" name="invoice_no" class="select-search">
                                    <option value=""></option>
                                    <?php
                                    $query_invno = $this->main_model->freight_invoice_no(); 
                                    foreach($query_invno as $row_invno):
                                    ?>
                                    <option value="<?php echo $row_invno['invoice_no']; ?>" <?php if($row['invoice_no']==$row_invno['invoice_no']): ?>selected="selected"<?php endif; ?>>
                                        <?php echo $row_invno['invoice_no']; ?>
                                    </option>													
                                    <?php endforeach; ?>
                                </select> 
                            </div>
                        </div>
                    </div>                    
                </div> 
                <!-- To -->
                <div class="form-group">
                    <label class="control-label col-md-2 text-right">To </label>
                    <div class="col-md-10">
                        <textarea type="text" class="form-control" placeholder="To" name="to"><?php echo $row['to']; ?></textarea>                
                    </div>
                </div> 
                <div class="row">                 
                    <!-- ATTN -->
                    <div class="col-md-6">                   
                        <div class="form-group">
                            <label class="col-sm-4 control-label text-right">ATTN </label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" placeholder="ATTN" name="ATTN" value="<?php echo $row['ATTN']; ?>">
                            </div>
                        </div> 
                    </div> 
                    <!-- SHIPPER -->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-4 text-right">SHIPPER </label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="SHIPPER" name="SHIPPER" value="<?php echo $row['SHIPPER']; ?>">
                            </div>
                        </div>
                    </div>                    
                </div>
                <div class="row">
                    <!-- CNEE -->
                    <div class="col-md-6">                   
                        <div class="form-group">
                            <label class="col-sm-4 control-label text-right">CNEE </label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" placeholder="CNEE" name="CNEE" value="<?php echo $row['CNEE']; ?>">
                            </div>
                        </div> 
                    </div> 
                    <!-- VOL -->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-4 text-right">VOL </label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="VOL" name="VOL" value="<?php echo $row['VOL']; ?>">
                            </div>
                        </div>
                    </div>                    
                </div>
                <div class="row">
                    <!-- LCNO -->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-4 text-right">L/C No. </label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="L/C No." name="LCNO" value="<?php echo $row['LCNO']; ?>">
                            </div>
                        </div>
                    </div>
                    <!-- HBLNO -->
                    <div class="col-md-6">                   
                        <div class="form-group">
                            <label class="col-sm-4 control-label text-right">HBL No. </label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" placeholder="HBLNO" name="HBLNO" value="<?php echo $row['HBLNO']; ?>">
                            </div>
                        </div> 
                    </div> 
                </div>
                <div class="row">
                    <!-- MBLNO -->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-4 text-right">MBL No. </label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="MBLNO" name="MBLNO" value="<?php echo $row['MBLNO']; ?>">
                            </div>
                        </div>
                    </div>                    
                    <!-- HAWABLNO -->
                    <div class="col-md-6">                   
                        <div class="form-group">
                            <label class="col-sm-4 control-label text-right">HAWABL No. </label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" placeholder="HAWABLNO" name="HAWABLNO" value="<?php echo $row['HAWABLNO']; ?>">
                            </div>
                        </div> 
                    </div> 
                </div>
                <div class="row">
                    <!-- MAWBLNO -->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-4 text-right">MAWBL No. </label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="MAWBLNO" name="MAWBLNO" value="<?php echo $row['MAWBLNO']; ?>">
                            </div>
                        </div>
                    </div> 
                    <!-- NOSOFCNTRS -->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-4 text-right">NOSOFCNTRS CONTAINER</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="NOSOFCNTRS" name="NOSOFCNTRS" value="<?php echo $row['NOSOFCNTRS']; ?>">
                            </div>
                        </div>
                    </div> 
                </div>
                <div class="row">
                    <!-- POL -->
                    <div class="col-md-6">                   
                        <div class="form-group">
                            <label class="col-sm-4 control-label text-right">POL </label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" placeholder="POL" name="POL" value="<?php echo $row['POL']; ?>">
                            </div>
                        </div> 
                    </div>                     
                    <!-- POD -->
                    <div class="col-md-6">                   
                        <div class="form-group">
                            <label class="col-sm-4 control-label text-right">POD </label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" placeholder="POD" name="POD" value="<?php echo $row['POD']; ?>">
                            </div>
                        </div> 
                    </div> 
                </div> 
                <div class="row">
                    <!-- CARRIER -->
                    <div class="col-md-6">                   
                        <div class="form-group">
                            <label class="col-sm-4 control-label text-right">CARRIER </label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" placeholder="CARRIER" name="CARRIER" value="<?php echo $row['CARRIER']; ?>">
                            </div>
                        </div> 
                    </div> 
                </div>                 
                <!-- Invoice -->
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right">Invoice <span class="mandatory">*</span></label> 
                    <div class="col-sm-9">
                        <div class="row">
                            <div class="col-xs-3"><label class="col-sm-2 control-label text-right">Description</label></div>
                            <div class="col-xs-3"><label class="col-sm-2 control-label text-right">Unit</label></div>
                            <div class="col-xs-3"><label class="col-sm-2 control-label text-right">Amount</label></div> 
                            <div class="col-xs-3"><label class="col-sm-2 control-label text-right">Exchange</label></div> 
                        </div>                          
                        <?php 
                        $query_dc = $this->main_model->debitcreditinvoice_info($row['debitcredit_id']); 
                        foreach($query_dc as $row_dc): 
                        ?>
                        <div class="item_fi mb5">
                            <a class="delete delete_fi btn btn-default" href="javascript:;" title=""><i class="fa fa-times"></i></a>
                            <div class="row">
                                <div class="col-xs-3"><input type="text" class="form-control" placeholder="Description" name="dc_description[]" value="<?php echo $row_dc['description']; ?>"></div>
                                <div class="col-xs-3"><input type="text" class="form-control" placeholder="Unit" name="dc_unit[]" value="<?php echo $row_dc['unit']; ?>"></div>
                                <div class="col-xs-3"><input type="text" class="form-control" placeholder="Amount" name="dc_amount[]" value="<?php echo $row_dc['amount']; ?>"></div>
                                <div class="col-xs-3"><input type="text" class="required form-control" placeholder="Exchange Rate" name="ex_rate[]" value="<?php echo $row_dc['ex_rate']; ?>"></div>
                            </div>                                    
                        </div>
                        <?php endforeach; ?>
                        <a id="add_fi" class="btn btn-default" href="javascript:;" title="Add Row"><i class="fa fa-plus"></i></a>
                    </div>
                </div> 
                <script type="text/javascript">
                $(document).ready(function() {
                    $("#add_fi").click(function(){
                        $(".item_fi:last").after('<div class="item_fi mb5"><a class="delete delete_fi btn btn-default" href="javascript:;" title=""><i class="fa fa-times"></i></a><div class="row"><div class="col-xs-3"><input type="text" class="form-control" placeholder="Description" name="dc_description[]"></div><div class="col-xs-3"><input type="text" class="form-control" placeholder="Unit" name="dc_unit[]"></div><div class="col-xs-3"><input type="text" class="form-control" placeholder="Amount" name="dc_amount[]"></div><div class="col-xs-3"><input type="text" class="required form-control" placeholder="Exchange Rate" name="ex_rate[]"></div></div></div>');
                        if ($(".delete_fi").length > 0) $(".delete_fi").show();
                    });    
                    $(".delete_fi").live('click',function(){
                        $(this).parents('.item_fi').remove();
                        if ($(".delete_fi").length < 2) $(".delete_fi").hide();
                    });    
                });
                </script>                
                                
                <div class="form-actions text-right">
                    <button type="submit" value="Update" class="btn btn-primary"><i class="fa fa-check"></i> Update</button>
                </div>

            </form> 

        </div>

        <?php endforeach; ?>
        
    </div>
