    <div class="panel panel-default">
    <?php     
    $sl_no = 1; 
    $query = $this->main_model->debitcredit_info($debitcredit_id);
    foreach($query as $row): 
    ?>
        <div class="panel-heading hidden-print">
            <h6 class="panel-title"><i class="fa fa-desktop"></i> Debit Note Information</h6> 
            <a onclick="window.print();" style="cursor:pointer;" class="pull-right btn btn-circle btn-xs btn-default hidden-print"><i class="fa fa-print"></i> Print</a> 					
        </div>

        <div class="panel-body">

            <p class="text-center hidden-print"><strong style="font-size: 16px;"><?php echo $this->main_model->company_name(); ?></strong><br /></p> 
            
            <br />
            <p class="text-center"><strong style="font-size: 15px;"><u>DEBIT NOTE</u></strong></p>
            <br />

            <div class="row"><div class="col-xs-3">Date </div> 
            <div class="col-xs-9 text-left">: <?php echo date('F d, Y', strtotime($row['date'])); ?></div></div>
            
            <?php if(!empty($row['invoice_no'])): ?>
            <div class="row"><div class="col-xs-3">Invoice No. </div> 
            <div class="col-xs-9 text-left">: <?php echo $row['invoice_no']; ?></div></div>
            <?php endif; ?>
            <br />
            
            <p>To<br />
            <pre><?php echo $row['to']; ?></pre></p>
            
            <?php if(!empty($row['ATTN'])): ?>
            <p>ATTN: <strong><?php echo $row['ATTN']; ?></strong></p>
            <?php endif; ?>

            <?php if(!empty($row['SHIPPER'])): ?>
            <div class="row"><div class="col-xs-3">SHIPPER </div>
            <div class="col-xs-9 text-left">: <?php echo $row['SHIPPER']; ?></div></div> 
            <?php endif; ?>   
            <?php if(!empty($row['CARRIER'])): ?>
            <div class="row"><div class="col-xs-3">CARRIER </div>
            <div class="col-xs-9 text-left">: <?php echo $row['CARRIER']; ?></div></div> 
            <?php endif; ?>            
            <?php if(!empty($row['CNEE'])): ?>
            <div class="row"><div class="col-xs-3">CNEE/ NOTIFY PARTY</div>
            <div class="col-xs-9 text-left">: <?php echo $row['CNEE']; ?></div></div> 
            <?php endif; ?>            
            <?php if(!empty($row['VOL'])): ?>
            <div class="row"><div class="col-xs-3">VOL</div>
            <div class="col-xs-9 text-left">: <?php echo $row['VOL']; ?></div></div> 
            <?php endif; ?>            
            <?php if(!empty($row['HBLNO'])): ?>
            <div class="row"><div class="col-xs-3">HBLNO </div>
            <div class="col-xs-9 text-left">: <?php echo $row['HBLNO']; ?></div></div> 
            <?php endif; ?>            
            <?php if(!empty($row['MBLNO'])): ?>
            <div class="row"><div class="col-xs-3">MBLNO </div>
            <div class="col-xs-9 text-left">: <?php echo $row['MBLNO']; ?></div></div> 
            <?php endif; ?>            
            <?php if(!empty($row['LCNO'])): ?>
            <div class="row"><div class="col-xs-3">L/C No. </div>
            <div class="col-xs-9 text-left">: <?php echo $row['LCNO']; ?></div></div> 
            <?php endif; ?>            
            <?php if(!empty($row['HAWABLNO'])): ?>
            <div class="row"><div class="col-xs-3">HAWABLNO </div>
            <div class="col-xs-9 text-left">: <?php echo $row['HAWABLNO']; ?></div></div> 
            <?php endif; ?>            
            <?php if(!empty($row['MAWBLNO'])): ?>
            <div class="row"><div class="col-xs-3">MAWBLNO </div>
            <div class="col-xs-9 text-left">: <?php echo $row['MAWBLNO']; ?></div></div> 
            <?php endif; ?>            
            <?php if(!empty($row['NOSOFCNTRS'])): ?>
            <div class="row"><div class="col-xs-3">NOSOFCNTRS CONTAINER</div>
            <div class="col-xs-7 text-left">: <?php echo $row['NOSOFCNTRS']; ?></div></div> 
            <?php endif; ?>
            <?php if(!empty($row['POL'])): ?>
            <div class="row"><div class="col-xs-3">POL:</div>
            <div class="col-xs-9 text-left">: <?php echo $row['POL']; ?></div></div> 
            <?php endif; ?>            
            <?php if(!empty($row['POD'])): ?>
            <div class="row"><div class="col-xs-3">POD:</div>
            <div class="col-xs-9 text-left">: <?php echo $row['POD']; ?></div></div> 
            <?php endif; ?>            
            <br />  
                       
            <div style="min-height: 250px;">
                <div class="row">
                    <div class="col-xs-12">						
                        <table class="table table-bordered">
                            <thead><tr>
                                <td align="center"><strong>SL No.</strong></td> 
                                <td align="center"><strong>Description</strong></td> 
                                <td align="center"><strong>Unit</strong></td> 
                                <td align="center"><strong>Amount (In USD.)</strong></td> 
                            </tr></thead>
                            <tbody> 
                                <?php 
                                $amount = '';
                                $query_dc = $this->main_model->debitcreditinvoice_info($row['debitcredit_id']);
                                foreach($query_dc as $row_dc): 
                                ?>
                                <tr class="item-row">
                                    <td><?php if($row_dc['debitcredit_invoice_id']): echo $sl_no; $sl_no++; endif; ?></td> 
                                    <td><?php echo $row_dc['description']; ?></td>
                                    <td><?php echo $row_dc['unit']; ?></td>
                                    <td class="text-right">$ <?php echo $row_dc['amount']; $amount += $row_dc['amount']; ?></td>
                                </tr>
                                <?php endforeach; ?>
                                <tr class="item-row">
                                    <td colspan="4" class="text-right"><strong>Total = $ <?php echo number_format((float)$amount,'2','.',''); ?></strong></td> 
                                </tr>                                
                            </tbody>
                        </table> 
                    </div>
                </div>
                <br/>  
                
                <p style="text-transform: uppercase;">In Words: <?php echo $this->main_model->get_bd_amount_in_text($amount); ?></p>
                <br />
                 
            </div>
            
	    <div class="row">
                <div class="col-xs-4 text-center">______________________<br/>Prepared By</div>												
                <div class="col-xs-4 text-center">______________________<br/>Checked By</div>												
                <div class="col-xs-4 text-center">______________________<br/>Approved By</div>						
            </div>
            
            <br />
            <div class="hidden-print text-center">
                <strong><?php echo $this->main_model->company_address();?></strong>
            </div>
            
        </div>
        
    <?php endforeach; ?>
    </div>
