<?php
$datetime = explode(" ", $bookingdetail['ordertime']);
//echo '<pre>';print_r($bookingdetail);die();
?>
<div class="booking-detail-form">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title"><large>Booking</large>&nbsp;<b id="booking_no"> (<?php echo $booking_id; ?>)</b></h4>
    </div>
    <span class="checkbox_error"></span>
    <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;">
                <form id="myform">
                    <input type="hidden" name="bookingid" id="bookingid" value="<?php echo $bookingdetail['id']; ?>" type="text">
                    <input type="hidden" name="bookingref_id" id="bookingref-id" value="<?php echo $bookingdetail['ref']; ?>" type="text">
                    <input type="hidden" name="clientid" id="clientid"  value="<?php echo $bookingdetail['client_id']; ?>" type="text">
                    <input type="hidden" name="driverid" id="driverid"  value="<?php echo $bookingdetail['driver_id']; ?>" type="text">

                    <div class="col-sm-12">
                        <ul id="userTab" class="nav nav-tabs">
                            <li class="active"><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=""><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  data-toggle="tab" id="client_link"><font style="color:red">Links</font></a></li>
                                    <li><a  id="client_profile" class="client_profile" style="cursor:pointer;">Profile</a></li>
                                    <li><a  data-toggle="tab" id="client_action"><font style="color:red">Actions</font></a></li>
                                    <li><a data-toggle="tab" class="sms_to_client" rel="booking" style="cursor:pointer;">Send SMS to client(Booking Details)</a></li>
                                    <li><a data-toggle="tab" class="sms_to_client" rel="driver" style="cursor:pointer;">Send SMS to client(Driver Details)</a></li>
                                    <li><a href="" data-toggle="tab" id="client_block"><font style="color:red">Block</font></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 data-toggle="tab" id="driver_link"><font style="color:red">Links</font></a></li>
                                    <li><a class="driver_profile" id="driver_group"><font style="color:red">Group</font></a></li>
                                    <li><a data-toggle="tab" id="driver_vehicle"><font style="color:red">Vehicle</font></a></li>
                                    <?php if($bookingdetail['driver_id']!=0){?>
                                    <li><a data-toggle="tab" id="driver_booking_hi" style="cursor:pointer;">Booking history</a></li>
                                    <li><a data-toggle="tab" id="driver_allocation_hi" style="cursor:pointer;">Allocation history</a></li>
                                    <li><a class="driver_profile" id="driver_profile" style="cursor:pointer;">Profile</a></li>
                                    <li><a href="#" data-toggle="tab" style="cursor:pointer;"><font style="color:red">Send SMS to driver</font></a></li>
                                    <?php }?>
                                </ul>
                            </li>-->
                        </ul>
                        <div id="userTabContent" class="tab-content">
                            <!--options box Start-->
                            <div class="tab-pane fade in active" 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-6">
                                                    <h5>Actions	</h5>
                                                    <div class="col-sm-8 no-padding">
                                                        <input disabled="disabled" style="" id="datetimepicker" class="form-control" value="<?php echo $bookingdetail['ordertime']; ?>" type="text">
                                                    </div>
                                                    <div class="col-sm-4 no-padding">
                                                        <button class="form-control btn btn-linkedin" id="change_picktime">Change</button>
                                                    </div>
                                                </div>
                                                <!--<div class="col-sm-4">
                                                    <h5>Links</h5>
                                                    <a href="#"><font style="color:red;">Track and trace</font></a>
                                                </div>-->
                                            </div>
                                            <div class="form-group clearfix">


                                                <div class="col-sm-12">
                                                    <input id="reschddata" type="hidden">
                                                    <div id="showchngtymbox"  style="display:none;">
                                                        <div class="col-sm-12 no-padding" style="margin:5px 0;">
                                                            <div class="row">
                                                                <div class="col-sm-3"><input class="form-control pickupdate pointer" value="<?php echo $datetime[0]; ?>" type="text"></div>
                                                                <div class="col-sm-3">
                                                                    <div class="input-group clockpicker" data-placement="bottom" data-align="left" data-donetext="Done">
                                                                        <input class="form-control pickuptime pointer" value="<?php echo $datetime[1]; ?>" type="text">
                                                                        <span class="input-group-addon">
                                                                            <span class="glyphicon glyphicon-time"></span>
                                                                        </span>
                                                                    </div>
                                                                </div>
                                                                <div class="col-sm-2"><button id="changeDateTime" class="form-control btn2 btn-facebook">Save</button></div>
                                                            </div>

                                                        </div>

                                                    </div>
                                                </div>


                                            </div>
                                            <!--<div class="form-group clearfix">
                                                <div class="col-sm-6">
                                                    <button class="btn btn-default col-sm-12" id="changerate">Change rating</button>
                                                </div>
                                                <div class="col-sm-6" id="ratebox" style="display:none;">
                                                    <fieldset class="rating">
                                                        <legend>Please rate:</legend>
                                                        <?php
                                                        for ($i = 5; $i > 0; $i--) {
                                                            ?>
                                                            <input class="user_rating" type="radio" id="star<?= $i ?>" name="rating" value="<?= $i ?>" /><label for="star<?= $i ?>" title="Rocks!">5 stars</label>
                                                            <?php
                                                        }
                                                        ?>
                                                    </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" id="execute-cancel" <?php if ($bookingdetail['status_id'] == '10') { ?>disabled="disabled"<?php } ?>>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" >
                                                                <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" 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;"  type="text">

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

                                            </div>

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

                                                <div class="col-sm-6">
                                                    <button class="btn btn-default col-sm-12" id="execute_no_show" <?php if ($bookingdetail['status_id'] == '14') { ?>disabled="disabled"<?php } ?>>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" <?php if (!($bookingdetail['status_id']<8 && $bookingdetail['status_id']>0)) { ?>disabled="disabled"<?php } ?>>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" id="redispatch" >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" 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">
                                                    <!--<label class="btn btn-default col-sm-12" id="genbill" data-target="#genbill-detailModal" data-toggle="modal" > Generate Bill</label>-->
                                                    <button class="btn btn-default col-sm-12" id="genbill">Generate Bill</button>
                                                    <button class="btn btn-default col-sm-12 disabled" disabled="disabled" id="manualpayment">Manual payment</button>
                                                </div>
                                                <div class="col-sm-6">

                                                    <button class="btn btn-default col-sm-12" id="clientreceipt" bokid="" clientid="">Send receipt to client</button>
                                                    <button class="btn btn-default col-sm-12 disabled" disabled="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=" padding-top:2px !important;">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    </div>
</div>