<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); //die();
        if (count($bookingHistoryListing)>0) {
            $i = 1;
            foreach ($bookingHistoryListing as $listing) {
                ?>
                <tr>
                    <td><label data="<?php echo $listing['id']; ?>" class="clickme open  text-green pointer booking_id"><?php echo $listing['ref']; ?></label></td>
                    <td><?php echo $listing['ordertime']; ?></td>
                    <td><?php echo (isset($listing['vehicle']))? $listing['vehicle']:''; ?></td>
                    <td><?php echo $listing['booking_type']; if($listing['booking_type']=="Outstation"){?><br><span style="font-size: 11px;">(Multicity)</span><br><a class="trip-detail" rel="<?php echo $listing['id']; ?>" >Trip Detail</a><?php } ?></td>
                    <td><?php echo (isset($listing['partner']))? $listing['partner']:''; ?></td>
                    <td><?php echo $listing['clientname']; ?></td>
                    <td><?php echo (isset($listing['departure']))? $listing['departure']:''; ?></td>
                    <td><?php  echo $listing['drop_area']; ?></td>
                    <td><?php echo $listing['status']; ?></td>
                    <td><?php echo (isset($listing['c_share']))? $listing['c_share']:'';?></td>
                    <td><?php echo (isset($listing['d_share']))? $listing['d_share']:'';?></td>
                    <td><?php echo (isset($listing['p_share']))? $listing['p_share']:'';?></td>
                    <td><?php //echo $listing['action'];   ?> <a href="#" data-toggle="modal" data-target="#booking-detailModal">Action</a></td>
                </tr>
                <?php if($listing['booking_type']=="Outstation"){?><tr id="removetrip-<?php echo $listing['id']; ?>" class="removetrip"></tr><?php }?>
                <?php
                $i++;
            }
        } else { ?>
                <tr><td colspan="13" style="text-align: center;">No Records Found</td></tr>
<?php } ?>
    </tbody>
</table>

<div id="booking-detailModal" class="modal fade" role="dialog">
    <div class="modal-dialog">

        <!-- Modal content-->
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" style="font-size:35px;">&times;</button>
                <h4 style="margin: 0 0 15px;"><large>Booking</large>&nbsp;<b class="booking_no">HWRA0028</b></h4>
            </div>
            <div class="modal-body" >

                <div style="width:100%; float:left;">
                    <div class="" id="booking_action" style="background: rgb(255, 255, 255) none repeat scroll 0% 0%; display: block;">
                        <!--padding: 20px; border-radius: 10px;left: 16% !important; right: 16% !important; background: rgb(255, 255, 255);-->
                        <form id="myform">

                            <div class="col-sm-12">

                                <ul id="userTab" class="nav nav-tabs">
                                    <li class=""><a href="#options" id="distanceVehiclep" data-toggle="tab">Options</a></li>
                                    <li class=""><a href="#statewrp" id="HourVehiclep" data-toggle="tab">State</a></li>
                                    <li class="active"><a href="#financialwrp" id="" data-toggle="tab">Financial</a></li>
                                    <li class="dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Client<span class="caret"></span></a>
                                        <ul class="dropdown-menu" role="menu">
                                            <li><a href="#" data-toggle="tab">Liks</a></li>
                                            <li><a href="http://hello42cab.com/admin/client?client=24" class="client_profile" target="_blank">Profile</a></li>
                                            <li><a href="http://hello42cab.com/admin/client?client=24" class="client_profile" target="_blank">Booking history</a></li>
                                            <li><a href="#" data-toggle="tab">Actions</a></li>
                                            <li><a href="javascript:void(0)" relbookingid="HWRA0028" data-toggle="tab" class="sms_to_client">Send SMS to client</a></li>
                                            <li><a href="#" data-toggle="tab">Block</a></li>
                                        </ul>
                                    </li>
                                    <li class="dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Driver<span class="caret"></span></a>
                                        <ul class="dropdown-menu" role="menu">
                                            <li><a href="#" data-toggle="tab">Links</a></li>
                                            <li><a href="http://hello42cab.com/admin/driver?driver=0" class="driver_profile" target="_blank">Profile</a></li>
                                            <li><a href="http://hello42cab.com/admin/driver?driver=0" class="driver_profile" target="_blank">Group</a></li>
                                            <li><a href="#" data-toggle="tab">Vehicle</a></li>
                                            <li><a href="#" data-toggle="tab">Booking history</a></li>
                                            <li><a href="#" data-toggle="tab">Allocation history</a></li>
                                            <li>&nbsp;</li>
                                            <li><small style="margin-left:15px; color:#a0a0a0 !important;">Actions</small></li>
                                            <li><a href="#" data-toggle="tab">Send SMS to driver</a></li>
                                        </ul>
                                    </li>

                                </ul>
                                <div id="userTabContent" class="tab-content">

                                    <!--options box Start-->

                                    <div class="tab-pane fade" id="options">
                                        <div class="row border" style="margin: -1px 0;">
                                            <div class="col-sm-12 col-md-12">
                                                <div class="portlet-body" style="margin:0 5px;">

                                                    <div class="form-group clearfix">

                                                        <div class="col-sm-8">
                                                            <h5>Actions	</h5>
                                                            <button class="btn btn-default col-sm-9" id="change_picktime" onclick="$('#showchngtymbox').fadeToggle()">Change pickup time</button>


                                                        </div>
                                                        <div class="col-sm-4">
                                                            <h5>Links</h5>
                                                            <a href="#">Track and trace</a>
                                                        </div>
                                                    </div>
                                                    <div class="form-group clearfix">

                                                        <div class="col-sm-12">
                                                            <input disabled="disabled" style="" id="datetimepicker" class="col-sm-6 hasDatepicker" value="02-01-2018 15:51:00" type="text">

                                                            <div class="col-sm-12">
                                                                <input id="reschddata" type="hidden">28
                                                                <div id="showchngtymbox" style="display:none;">
                                                                    <div class="col-sm-12" style="margin:5px 0;">
                                                                        <input id="datetime" data-format="DD-MM-YYYY HH:mm:ss" data-template="DD / MM / YYYY     HH : mm :ss" name="datetime" onchange="setreschdtime($(this).val())" style="display: none;" type="text"><span class="combodate"><select class="day " style="width: auto;"><option value="" selected="selected"></option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select>&nbsp;/&nbsp;<select class="month " style="width: auto;"><option value="" selected="selected"></option><option value="0">01</option><option value="1">02</option><option value="2">03</option><option value="3">04</option><option value="4">05</option><option value="5">06</option><option value="6">07</option><option value="7">08</option><option value="8">09</option><option value="9">10</option><option value="10">11</option><option value="11">12</option></select>&nbsp;/&nbsp;<select class="year " style="width: auto;"><option value="" selected="selected"></option><option value="2017">2017</option><option value="2016">2016</option><option value="2015">2015</option><option value="2014">2014</option><option value="2013">2013</option><option value="2012">2012</option><option value="2011">2011</option><option value="2010">2010</option><option value="2009">2009</option><option value="2008">2008</option><option value="2007">2007</option><option value="2006">2006</option><option value="2005">2005</option><option value="2004">2004</option><option value="2003">2003</option><option value="2002">2002</option><option value="2001">2001</option><option value="2000">2000</option><option value="1999">1999</option><option value="1998">1998</option><option value="1997">1997</option><option value="1996">1996</option><option value="1995">1995</option><option value="1994">1994</option><option value="1993">1993</option><option value="1992">1992</option><option value="1991">1991</option><option value="1990">1990</option><option value="1989">1989</option><option value="1988">1988</option><option value="1987">1987</option><option value="1986">1986</option><option value="1985">1985</option><option value="1984">1984</option><option value="1983">1983</option><option value="1982">1982</option><option value="1981">1981</option><option value="1980">1980</option><option value="1979">1979</option><option value="1978">1978</option><option value="1977">1977</option><option value="1976">1976</option><option value="1975">1975</option><option value="1974">1974</option><option value="1973">1973</option><option value="1972">1972</option><option value="1971">1971</option><option value="1970">1970</option></select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select class="hour " style="width: auto;"><option value="" selected="selected"></option><option value="0">00</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option></select>&nbsp;:&nbsp;<select class="minute " style="width: auto;"><option value="" selected="selected"></option><option value="0">00</option><option value="5">05</option><option value="10">10</option><option value="15">15</option><option value="20">20</option><option value="25">25</option><option value="30">30</option><option value="35">35</option><option value="40">40</option><option value="45">45</option><option value="50">50</option><option value="55">55</option></select>&nbsp;:<select class="second " style="width: auto;"><option value="" selected="selected"></option><option value="0">00</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option><option value="32">32</option><option value="33">33</option><option value="34">34</option><option value="35">35</option><option value="36">36</option><option value="37">37</option><option value="38">38</option><option value="39">39</option><option value="40">40</option><option value="41">41</option><option value="42">42</option><option value="43">43</option><option value="44">44</option><option value="45">45</option><option value="46">46</option><option value="47">47</option><option value="48">48</option><option value="49">49</option><option value="50">50</option><option value="51">51</option><option value="52">52</option><option value="53">53</option><option value="54">54</option><option value="55">55</option><option value="56">56</option><option value="57">57</option><option value="58">58</option><option value="59">59</option></select></span>
                                                                    </div>
                                                                    <button id="change" class="btn btn-default col-sm-6">Save</button>


                                                                </div>
                                                            </div>
                                                        </div>

                                                    </div>
                                                    <div class="form-group clearfix">

                                                        <div class="col-sm-6">
                                                            <button class="btn btn-default col-sm-12" onclick="$('#ratebox').toggle();">Change rating
                                                            </button>
                                                        </div>
                                                        <div class="col-sm-6" id="ratebox" style="display:none;">
                                                            <fieldset class="rating">
                                                                <legend>Please rate:</legend>


                                                                <input id="star5" onclick="drvrrate($('#reschddata').text(), $(this).val(), 'http://hello42cab.com/tunnel/menu/UserRatingfrmbackend', drvrrateresults, '100002')" name="rating" value="5" type="radio"><label for="star5" title="Rocks!">5 stars</label>





                                                                <input id="star4" onclick="drvrrate($('#reschddata').text(), $(this).val(), 'http://hello42cab.com/tunnel/menu/UserRatingfrmbackend', drvrrateresults, '100002')" name="rating" value="4" type="radio"><label for="star4" title="Rocks!">5 stars</label>





                                                                <input id="star3" onclick="drvrrate($('#reschddata').text(), $(this).val(), 'http://hello42cab.com/tunnel/menu/UserRatingfrmbackend', drvrrateresults, '100002')" name="rating" value="3" type="radio"><label for="star3" title="Rocks!">5 stars</label>





                                                                <input id="star2" onclick="drvrrate($('#reschddata').text(), $(this).val(), 'http://hello42cab.com/tunnel/menu/UserRatingfrmbackend', drvrrateresults, '100002')" name="rating" value="2" type="radio"><label for="star2" title="Rocks!">5 stars</label>





                                                                <input id="star1" onclick="drvrrate($('#reschddata').text(), $(this).val(), 'http://hello42cab.com/tunnel/menu/UserRatingfrmbackend', drvrrateresults, '100002')" name="rating" value="1" type="radio"><label for="star1" title="Rocks!">5 stars</label>



                                                            </fieldset>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--options box End-->

                                    <!--state box Start-->

                                    <div class="tab-pane fade" id="statewrp">
                                        <div class="row border" style="margin: -1px 0;">
                                            <div class="col-sm-12 col-md-12">
                                                <div class="portlet-body" style="margin:0 5px;">

                                                    <div class="form-group clearfix">

                                                        <div class="col-sm-6">
                                                            <h5>Actions	</h5>
                                                            <button class="btn btn-default col-sm-12" onclick="$('#noshowbox').fadeToggle();">Execute cancel</button>
                                                        </div>

                                                        <div class="col-sm-6" id="noshowbox" style="display:none; float:right" align="right">

                                                            <h5 style="float:left;">Specify Reason:</h5><h5>

                                                                <div class="col-sm-9">

                                                                    <select class="form-control" name="ExeReason" id="ExeReason" onchange="Exereason($(this).val())">
                                                                        <option value="0" selected="selected">Select Reason</option>
                                                                        <option value="Getting Late">Getting Late</option>
                                                                        <option value="Client cancel">Client cancel</option>
                                                                        <option value="Break down">Break down</option>
                                                                        <option value="Wrong Address">Wrong Address</option>
                                                                        <option value="other">other</option>
                                                                    </select>
                                                                </div>

                                                                <div class="col-sm-3">
                                                                    <input id="ExeSubmit" name="submit" value="Save" onclick="ExecuteCancel($('#reschddata').text(), $('#ExeReason').val(), $('#otherreason').val(), this.id, 'http://hello42cab.com/tunnel/CustomerCare/CancelCabbkngfrmbackend', ExecuteCancelresults, '100002')" type="submit">
                                                                </div>
                                                                <div class="col-sm-9" style="margin-top:5px;">

                                                                    <input class="form-control" placeholder="Please Specify Other" name="otherreason" id="otherreason" style="display:none;" onkeyup="shoattr($(this).val())" type="text">

                                                                </div>
                                                            </h5></div>
                                                        <!--<div class="col-sm-6">
                                                                        <h5>Links</h5>
                                                                        <a href="#"></a>
                                                        </div>-->
                                                    </div>

                                                    <div class="form-group clearfix">

                                                        <div class="col-sm-6">
                                                            <button class="btn btn-default col-sm-12" onclick="ExeNoShow($('#reschddata').text(), 'http://hello42cab.com/tunnel/BookingCabFare/ExecuteNoShow', ExeNoShowresults, '100002')">Execute no show</button>
                                                        </div>

                                                        <div class="col-sm-6">
                                                            <a href="#"></a>
                                                        </div>
                                                    </div>
                                                    <div class="form-group clearfix">

                                                        <div class="col-sm-6">
                                                            <button class="btn btn-default col-sm-12" id="claim_btn">Claim</button>
                                                        </div>
                                                        <div class="col-sm-6">
                                                            <a href="#"></a>
                                                        </div>
                                                    </div>
                                                    <div class="form-group clearfix">

                                                        <div class="col-sm-6">
                                                            <button class="btn btn-default col-sm-12" onclick="ReDispatch($('#reschddata').text(), 'http://hello42cab.com/tunnel/BookingCabFare/ReDispatch', ReDispatchresults, '100002')">Redispatch</button>
                                                        </div>
                                                        <div class="col-sm-6">
                                                            <a href="#"></a>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--state box End-->

                                    <!--Financial box Start-->

                                    <div class="tab-pane fade in active" id="financialwrp">
                                        <div class="row border" style="margin: -1px 0;">
                                            <div class="col-sm-12 col-md-12">
                                                <div class="portlet-body">

                                                    <div class="form-group clearfix">

                                                        <div class="col-sm-6">
                                                            <h5>Actions	</h5>
                                                        </div>
                                                        <div class="col-sm-6">
                                                            <h5>Send Receipes</h5>
                                                        </div>

                                                    </div>

                                                    <div class="form-group clearfix">

                                                        <div class="col-sm-6">
                                                            <button class="btn btn-default col-sm-12" id="genbill" drvrid="0"> Generate Bill</button>
                                                            <button class="btn btn-default col-sm-12 disabled">Manual payment</button>
                                                        </div>
                                                        <div class="col-sm-6">
                                                            <!--<button class="btn btn-default col-sm-12 disabled" id="clientreceipt" bokid="" onclick="sendclntinvoice($(this).attr('bokid'),'http://hello42cab.com/hello42/tunnel/Menu/sendinvoicemail',sendclntinvoiceresults)">Send receipt to client</button>-->
                                                            <button class="btn btn-default col-sm-12 disabled" id="clientreceipt" bokid="" clientid="">Send receipt to client</button>
                                                            <button class="btn btn-default col-sm-12 disabled" id="driverreceipt">Send receipt to driver</button>
                                                        </div>

                                                    </div>

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--Financial box End-->


                                </div>
                            </div>
                        </form></div>
                </div>

            </div>
            <div class="modal-footer" style="border:none;">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>

    </div>
</div>

<!-- /.modal -->