<div class="col-lg-6">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>DUE BILLS</h5> 
        </div>
        <div class="ibox-content">
            <table class="table">
                <thead>
                    <tr>
                        <th>Bill Date</th>
                        <th>Due Date</th>
                        <th>Bill#</th>
                        <th>Amount</th>
                        <th>Pay</th>
                    </tr>
                </thead>
                <tbody>
                    <?php if (count($bill_list) > count($paid_bill)) {?>
                        <?php foreach ($bill_list as $key => $value) {
                            if(!in_array($value->purchase_bill_id, $paid_bill)){ ?>
                        <tr class="paybill bill_<?php echo $value->bill_no;?>" data-bill_no="<?php echo $value->bill_no;?>" data-bill_id="<?php echo $value->purchase_bill_id;?>" data-amount="<?php echo $value->total;?>">
                            <td><?php echo date('d/m/Y',strtotime(str_replace('-', '/', $value->bill_date)));?></td>
                            <td><?php echo date('d/m/Y',strtotime(str_replace('-', '/', $value->due_date)));?></td>
                            <td><?php echo $value->bill_no;?></td>
                            <td><?php echo number_format((float)$value->total, 2, '.', '');?></td>
                            <td><input type="checkbox" name="bill-pay" class="pay-bill-select"></td>
                        </tr>
                        <?php }
                        } 
                    } else {?>
                        <tr>
                            <td colspan="4">No Due Bills</td>
                        </tr>
                    <?php }?>
                </tbody>
            </table>
        </div>
    </div>
</div>



<div class="col-lg-6">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>PAID BILLS</h5> 
        </div>
        <div class="ibox-content">
            <table class="table">
                <thead>
                    <tr>
                        <th>Bill Date</th>
                        <th>Due Date</th>
                        <th>Bill#</th>
                        <th>Amount</th>
                    </tr>
                </thead>
                <tbody>
                    <?php if (count($paid_bill) > 0) {?>
                        <?php foreach ($bill_list as $key => $value) {
                            if(in_array($value->purchase_bill_id, $paid_bill)){ ?>
                            <tr>
                                <td><?php echo date('d/m/Y',strtotime(str_replace('-', '/', $value->bill_date)));?></td>
                                <td><?php echo date('d/m/Y',strtotime(str_replace('-', '/', $value->due_date)));?></td>
                                <td><?php echo $value->bill_no;?></td>
                                <td><?php echo number_format((float)$value->total, 2, '.', '');?></td>
                            </tr>
                        <?php }
                        } 
                    } else {?>
                        <tr>
                            <td colspan="4">No Paid Bills</td>
                        </tr>
                    <?php }?>
                </tbody>
            </table>
        </div>
    </div>
</div> 
