<table id="myTable" class="table table-bordered table-striped">
    <thead>
        <tr>
            <th><?php echo $this->translate('Id'); ?></th>
            <th><?php echo $this->translate('Pickup Time'); ?></th>
            <th><?php echo $this->translate('Vehicle'); ?></th>
            <th><?php echo $this->translate('Booking Type'); ?></th>
            <th><?php echo $this->translate('Partner'); ?></th>
            <th><?php echo $this->translate('Client'); ?></th>
            <th><?php echo $this->translate('Departure'); ?></th>
            <th><?php echo $this->translate('Drop Area'); ?></th>
            <th><?php echo $this->translate('Status'); ?></th>
            <th><?php echo $this->translate('C Share'); ?></th>
            <th><?php echo $this->translate('D Share'); ?></th>
            <th><?php echo $this->translate('P Share'); ?></th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>
        <?php
        //echo '<pre>';print_r($bookingHistoryListing);
        if (count($bookingHistoryListing) > 0) {
            $i = 1;
            $departure_address = '';
            $drop_area = '';
            foreach ($bookingHistoryListing as $listing) {
                $departure_address = substr($listing['departure'], 0, 30);
                $drop_area = substr($listing['drop_area'], 0, 30);
                ?>
                <tr>
                    <td><label rel='<?php echo $listing['ref']; ?>' data="<?php echo $listing['id']; ?>" bookingtype="<?php echo $listing['booking_type_id'] ?>" driver_id="<?php echo $listing['driver_id']; ?>" class="clickme text-green pointer booking_id"><?php echo $listing['ref']; ?></label></td>
                    <td width="7%"><?php echo $listing['ordertime']; ?></td>
                    <td width="10%"><img style="width:20px;" src="/images/vehicle.png"/><?php echo (isset($listing['vehicle_name'])) ? $listing['vehicle_name'] : ''; ?><br/>
                        <?php if ($listing['driver_name'] != "") { ?><small><a class="driver_click pointer" data="<?php echo $listing['ref']; ?>"><?php echo (isset($listing['driver_name'])) ? $listing['driver_name'] : ''; ?></a></small> <?php } ?>
                        <?php if ($listing['vehicle_no'] != "") { ?><small><?php echo (isset($listing['vehicle_no'])) ? $listing['vehicle_no'] : ''; ?></small><?php } ?>
                    </td>
                    <td width="10%"><img src="<?php echo $listing['booking_type_image']; ?>"> <?php echo $listing['booking_type']; ?> <br><small>(<?php echo (isset($listing['vehicle'])) ? $listing['vehicle'] : ''; ?>)</small><?php if ($listing['booking_type'] == "Outstation") { ?><br><small>(Multicity)</small><a class="trip-detail pointer" rel="<?php echo $listing['id']; ?>" ><small>Trip Detail</small></a><?php } ?></td>
                    <td><?php echo $listing['domain_name'].' ('.$listing['device_type'].')'; ?></td>
                    <td><a class="clientinfo pointer" data="<?php echo $listing['ref']; ?>"><?php echo $listing['clientname']; ?></a><br><small><?php echo $listing['client_mobile']; ?></small></td>
                    <td>
                        <p>
                            <span class="departure-<?php echo $listing['id']; ?>"><?php echo $departure_address; ?></span>
                            <span style="display: none;" class="departure-more-<?php echo $listing['id']; ?>"><?php echo $listing['departure']; ?></span>
                            <?php if(strlen($listing['departure'])>30) {?><a  class="myBtn" rel="<?php echo $listing['id']; ?>" relclass="departure"> <small class="pointer">..more</small></a><?php }?>
                        </p>
                    </td>
                    <td>
                        <?php if($drop_area!="") {?>
                        <p>
                            <span class="droparea-<?php echo $listing['id']; ?>"><?php echo $drop_area; ?></span>
                            <span style="display: none;" class="droparea-more-<?php echo $listing['id']; ?>"><?php echo $listing['drop_area']; ?></span>
                            <?php if(strlen($listing['drop_area'])>30) {?><a  class="myBtn" rel="<?php echo $listing['id']; ?>" relclass="droparea"> <small class="pointer">..more</small></a><?php }?>
                        </p>
                        <?php }?>
                    </td>
                    <!--<td><?php echo $listing['departure']; ?></td>
                    <td><?php echo $listing['drop_area']; ?></td>-->
                    <td><?php echo $listing['status']; ?></td>
                    <td><?php echo (isset($listing['comp_share_amt'])) ? '<i class="fa fa-inr"></i> '.$listing['comp_share_amt'] : ''; ?></td>
                    <td><?php echo (isset($listing['driver_share_amt'])) ? '<i class="fa fa-inr"></i> '.$listing['driver_share_amt'] : ''; ?></td>
                    <td><?php echo (isset($listing['partner_share_amt'])) ? '<i class="fa fa-inr"></i> '.$listing['partner_share_amt'] : ''; ?></td>
                    <td><a class="bookinghistory pointer" refid="<?php echo $listing['ref']; ?>">Action</a></td>
                </tr>
                <?php
                $i++;
            }
        } else {
            ?>
            <tr><td colspan="14" style="text-align: center;">No Records Found</td></tr>
        <?php } ?>
    </tbody>
</table>

<!-- /.modal -->

<div class="modal fade" id="myModalBookingDetails" role="dialog">
    <div class="modal-dialog modal-dialog">
        <div class="modal-content"></div>
    </div>
</div>


<div class="modal fade" id="myModalClaimBooking" role="dialog">
    <div class="modal-dialog modal-dialog">
        <div class="modal-content"></div>
    </div>
</div>

<div class="modal fade" id="myModalGenerateBill" role="dialog">
    <div class="modal-dialog modal-dialog">
        <div class="modal-content"></div>
    </div>
</div>

<div class="modal fade" id="myModalAddExtra" role="dialog">
    <div class="modal-dialog modal-dialog">
        <div class="modal-content"></div>
    </div>
</div>

<div class="modal fade" id="myModalClientReceipt" role="dialog">
    <div class="modal-dialog modal-dialog">
        <div class="modal-content"></div>
    </div>
</div>