<table id="myTable" class="table table-bordered table-striped">
    <thead>
        <tr>
            <th> <label class="pos-rel"><input type="checkbox" class="ace" /><span class="lbl"></span> All</label></th>
            <th>S.No</th>
            <th>Booking Number</th>
            <th>Booking Type</th>
            <th>Vehicle Type</th>
            <th>Booked City</th>
            <th>Agent Reference</th>
            <th>Passenger Name</th>
            <th>Address</th>
            <th>Travel Date</th>
            <th>Booking Date</th>
            <th>Booking Status</th>
            <th>Payment States</th>
            <th>Bill Amount</th>
            <th>Action</th>

        </tr>
    </thead>
    <tbody>
        <?php
        //echo '<pre>';print_r($accountListing);//die();
        if ($accountListing) {
            $i = 1;
            foreach ($accountListing as $listing) {
               $booking_year  = date('Y',strtotime($listing['booking_date']));
               $booking_month = date('m',strtotime($listing['booking_date']));
               $voucherPath  = $this->voucherpath.$booking_year."/".$booking_month."/"."voucher_".$listing['ref'].".pdf";
               $invoicePath  = $this->voucherpath.$booking_year."/".$booking_month."/"."invoice_".$listing['ref'].".pdf";
                ?>
                <tr>
                    <td class="center"><label class="pos-rel">
                        <?php if($listing['booking_amt_balance']!=0){?><input type="checkbox" name="checkbox" id="checkbox" class="ace list-checkbox" rel="<?php echo $listing['ref']; ?>" /><?php }?>
                        <span class="lbl"></span> </label>
                    </td>
                    <td><?php echo $i; ?></td>
                    <td><?php echo $listing['ref']; ?></td>
                    <td><?php echo $listing['booking_type']; ?></td>
                    <td><?php echo $listing['vehicle']; ?></td>
                    <td><?php echo $listing['city_name']; ?></td>
                    <td><?php echo $listing['agent_reference']; ?></td>
                    <td><?php echo $listing['clientname']; ?></a><br><small><?php echo $listing['client_mobile']; ?></small></td>
                    <td><?php echo $listing['pickup_area']; ?><br/><?php echo $listing['departure']; ?></td>
                    <td><?php echo date('d-m-Y H:i:s',strtotime($listing['ordertime']));?></td>
                    <td><?php echo date('d-m-Y',strtotime($listing['booking_date']));?></td>
                    <td><?php echo $listing['status']; ?></td>
                    <td><?php if($listing['booking_amt_balance']!=0){echo "Partially Paid";}else{ echo "Paid";}?></td>
                    <td><i class="fa fa-inr"></i> <?php echo $listing['estimated_final_price']; ?><br>
                    <span class="font-size10" style="font-size: 10px;">Credit: <i class="fa fa-inr"></i> <?php echo $listing['booking_amt_paid']; ?></span>
                    </td>
                    <td>
                        <a download target='_blank' href="<?php echo $voucherPath;?>" class="label label-success">Download Voucher</a>
                        <a download target='_blank' href="<?php echo $invoicePath;?>" class="label label-success">Download Invoice</a>
                    </td>

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