<?php $total_tax = $bookingdetail['cgst_tax'] + $bookingdetail['igst_tax'] + $bookingdetail['sgst_tax']; ?>
<div class="ticket-form">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h2 class="modal-title">Booking (<?php echo $booking_id; ?>)</h2>
    </div>
    <div class="modal-body">
        <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-12" id="genbillresults">
                            <div style="height:500px;overflow:scroll;width:100%;">
                                <form method="post" id="chngchrgsform" onsubmit="return addextrachrg('/bookinghistory/live-bill-gen-admin',addextrachrgresults,'<?php echo $bookingdetail['id']; ?>','<?php echo $bookingdetail['driver_id']; ?>');">
                                    <fieldset>
                                        <legend>General description</legend>
                                        <div class="settings">
                                            <ul>
                                                <li>Bill No</li>
                                                <li><?php echo $bookingdetail['ref']; ?></li>
                                                <li>Booking Date</li>
                                                <li><?php echo date('Y-m-d H:i:s', strtotime($bookingdetail['booking_date'])); ?></li>
                                                <li>Starting Time</li>
                                                <li><?php echo $bookingdetail['ordertime']; ?></li>
                                                <li>Distance</li>
                                                <li><input type="text" name="km" value="0"></li>
                                                <li>Start Time</li>
                                                <li><input type="text" class="timecalender" name="start_time" value="00:00:00"></li>
                                                <li>End Time</li>
                                                <li><input type="text" class="timecalender" name="end_time" value="00:00:00"></li>
                                                <li>Pre-Waiting Time</li>
                                                <li><input type="text" class="timecalender" name="pre_wait" value="00:00:00"></li>
                                                <li>Waiting Time</li>
                                                <li><input type="text" class="timecalender" name="wait" value="00:00:00"></li>
                                                <li>Total Time</li>
                                                <li><input type="text" class="timecalender" name="total_time" value="00:00:00"></li>
                                                <li>Running Bill</li>
                                                <li><i class="fa fa-inr"></i>  <span class="fright">For 1 Cab</span></li>
                                                <li>Extra Charges</li>
                                                <li><input type="button" id="add-extra-charges" value="click here"></li>
                                                <li>Night Charge</li>
                                                <li><i class="fa fa-inr"></i> <?php echo isset($bookingdetail['night_charge_price']) ? $bookingdetail['night_charge_price'] : 0; ?></li>
                                                <li>Tax Amount</li>
                                                <li><i class="fa fa-inr"></i> <?php echo $bookingdetail['total_tax_price']; ?> (<?php echo $total_tax; ?> % )</li>
                                                <li><strong>Total Amount</strong></li>
                                                <li><strong><i class="fa fa-inr"></i> <?php echo $bookingdetail['estimated_final_price']; ?></strong>
                                                    <input type="hidden" name="total_amount" id="total-amount" value="<?php echo $bookingdetail['estimated_final_price']; ?>">
                                                </li>

                                            </ul>
                                        </div>
                                    </fieldset>

                                    <fieldset>
                                        <legend>Fare description</legend>
                                        <div class="settings">
                                            <ul>
                                                <li>Night Charge</li>
                                                <li><i class="fa fa-inr"></i> <?php echo isset($bookingdetail['night_charge_price']) ? $bookingdetail['night_charge_price'] : 0; ?></li>
                                                <li>Night Time</li>
                                                <li><?php echo $bookingdetail['night_rate_begins']; ?>  to   <?php echo $bookingdetail['night_rate_ends']; ?></li>
                                                <li>Extra charge</li>
                                                <li>
                                                    <textarea name="extrachrgs" rows="3" cols="40" id="extrachrgesdesc">             =
                                                    </textarea>
                                                    <input type="hidden" name="parking_charge" id="parking-charge" value="0">
                                                    <input type="hidden" name="toll_tax" id="toll-tax" value="0">
                                                    <input type="hidden" name="other_charge" id="other-charge" value="0">
                                                </li>
                                                <!--<li>Peak Time</li>
                                                <li><?php echo $bookingdetail['peak_time_from']; ?>  to  <?php echo $bookingdetail['peak_time_to']; ?></li>
                                                <li>Peak Time Apply</li>
                                                <li>% for Minimum Charges</li>-->
                                                <input type="hidden" name="btnval" id="btnval">
                                            </ul>
                                        </div>
                                    </fieldset>

                                    <legend class="show_hide">Fare Charge Details</legend>
                                    <fieldset class="slidingDiv" style="display:none;">
                                        <legend>Fare Details</legend>
                                        <div class="settings ">
                                            <ul>
                                                <li>Minimum Charge</li>
                                                <li><i class="fa fa-inr"></i> 0</li>
                                                <li>Extra Price</li>
                                                <li><i class="fa fa-inr"></i> <?php echo $bookingdetail['extra_price']; ?></li>
                                                <li>Night Charges</li>
                                                <li><i class="fa fa-inr"></i> <?php echo isset($bookingdetail['night_charge_price']) ? $bookingdetail['night_charge_price'] : 0; ?></li>
                                                <li style="margin-bottom:0;">Peak Charges</li>
                                                <li style="margin-bottom:0;"><i class="fa fa-inr"></i> <?php echo $bookingdetail['peak_time_price']; ?></li>
                                                <li style="border-bottom:1px solid #333;width:90%; margin-bottom:0;"></li>
                                                <li>Total Charges</li>
                                                <li><i class="fa fa-inr"></i> 0</li>
                                                <li style="border-bottom:1px solid #333;width:90%;"></li>
                                                <li>Basic Tax Type</li>
                                                <li><?php echo $total_tax; ?> % of Total Charges</li>
                                                <li>Basic Tax Charges</li>
                                                <li><i class="fa fa-inr"></i> <?php echo $bookingdetail['total_tax_price']; ?></li>
                                                <li style="border-bottom:1px solid #333;width:90%;"></li>
                                                <li>Total Bill</li>
                                                <li><i class="fa fa-inr"></i> <?php echo $bookingdetail['estimated_final_price']; ?></li>
                                            </ul>
                                        </div>
                                    </fieldset>

                                    <input type="submit" name="ReGenerate" onclick="$('#btnval').val($(this).val())" value="ReGenerate" style="cursor:pointer;">
                                    <!--<input type="submit" name="Save" onclick="$('#btnval').val($(this).val())" value="Save" style="cursor:pointer;">-->
                                </form>
                            </div>
                        </div>

                    </div>
                </div>
            </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>