<table id="myTable" class="table table-bordered table-striped">
    <thead>
        <tr>
            <th>S.No.</th>
            <th>Ref.No.</th>
            <th>Driver Name</th>
            <th>Deposited Date</th>
            <th>Transaction Mode</th>
            <th> Amount</th>
            <th>Deposited Bank</th>
            <th>Deposited Branch</th>
            <th>Status</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>

        <?php
        //echo '<pre>';print_r($billListing);//die();
        if ($creditListing > 0) {
            $i = 1;
            foreach ($creditListing as $listing) {
                if($listing['status']==0){
                    $action_type="approve-request";
                    $action_label="Approve";
                    $status="Pending";
                }else if($listing['status']==1){
                    $action_type="audit-request";
                    $action_label="Audit";
                    $status="Approved";
                }else{
                    $action_type="audit-request";
                    $action_label="Audit";
                    $status="Audited";
                }
                ?>
                <tr>
                    <td><?php echo $listing['id'];?></td>
                    <td><?php echo $listing['payment_ref_no'];?></td>
                    <td><?php echo $listing['first_name'].' '.$listing['last_name'];?></td>
                    <td><?php echo date('d-m-Y', strtotime($listing['deposit_date']));?></td>
                    <td><?php echo $listing['transaction_mode'];?></td>
                    <td><?php echo $listing['amount'];?></td>
                    <td><?php echo $listing['deposit_bank'];?></td>
                    <td><?php echo $listing['deposit_branch'];?></td>
                    <td><?php echo $status; ?></td>
                    <td>
                        <?php if($listing['status']<2){ ?>
                        <div class="hidden-sm hidden-xs action-buttons">
                            <ul class="icons-list" style="list-style:none; padding:0;">
                                <li class="dropdown text-muted">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></a>
                                    <ul class="dropdown-menu dropdown-menu-right">
                                        <li><a href="javascript: void(0);" onclick="creditRequest('<?php echo $action_type;?>','<?php echo $listing['id'];?>')"><i class="ace-icon fa fa-check bigger-130"></i> <?php echo $action_label; ?></a></li>
                                        <li><a href="#"><i class="ace-icon fa fa-trash-o bigger-130"></i> Remove</a></li>
                                    </ul>
                                </li>
                            </ul>
                        </div>
                        <?php }?>
                    </td>
                </tr>

                <?php
                $i++;
            }
        } else {
            ?>
            <tr><td colspan="11" style="text-align: center;">No Records Found</td></tr>
        <?php } ?>

    </tbody>
    <tfoot>
        <tr>
            <th>S.No.</th>
            <th>Ref.No.</th>
            <th>Driver Name</th>
            <th>Deposited Date</th>
            <th>Transaction Mode</th>
            <th> Amount</th>
            <th>Deposited Bank</th>
            <th>Deposited Branch</th>
            <th>Status</th>
            <th>Action</th>
        </tr>
    </tfoot>
</table>