<!--Change Status-->
<div id="modalStatus" class="modal-block modal-block-primary mfp-hide">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Change Reservation Status?</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/changeresstatus.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">

                        <div class="form-row">
                            <div class="form-group col mb-3">
                                <label>Status</label>
                                <select class="form-control form-control-modern" name="orderStatus">

                                    <option value="on-hold" <?php if($row['status']=="standby"){echo "selected";}?>>
                                        StandBy
                                    </option>

                                    <option value="completed" <?php if($row['status']=="confirmed"){echo "selected";}?>>
                                        Confrimed
                                    </option>
                                    <option value="cancelled" <?php if($row['status']=="cancelled"){echo "selected";}?>>
                                        Cancelled
                                    </option>
                                    <option value="refunded" disabled
                                        <?php if($row['status']=="contract"){echo "selected";}?>>
                                        Contract
                                    </option>

                                </select>
                            </div>

                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <button class="btn btn-default modal-dismiss">Cancel</button>
                </div>
                <input type="hidden" name="oldstatus" value="<?php echo $row['status'];?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                </form>
            </div>
        </footer>
    </section>
</div>
<!--Change Customer-->
<div id="modalCustomer" class="modal-block modal-block-primary mfp-hide">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Change Customer Details?</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/changecustomer.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">

                    <div class="form-row">
                                        <div class="form-group col mb-3">
                                            <label>Drivers Name</label>
                                            <input type="text" class="form-control form-control-modern"
                                                name="nominative" value="<?php echo $row['nominative'];  ?>"
                                                />
                                        </div>
                                    </div>
                                    <div class="form-row">
                                    <div class="form-group col-6 mb-3 pt-0" style="border-top:none;">
                                            <label>Date of Birth</label>
                                            <input type="text" class="form-control form-control-modern" name="cd_dob"
                                                value="<?php echo $row['cd_dob'];  ?>"  />
                                        </div>
                                        <div class="form-group col-6 mb-3 pt-0" style="border-top:none;">
                                            <label>Phone</label>
                                            <input type="text" class="form-control form-control-modern" name="phone"
                                                value="<?php echo $row['phone'];  ?>"  />
                                        </div>
                                    </div>
                                    <div class="form-row">
                                        <div class="form-group col mb-3">
                                            <label>Email</label>
                                            <input type="text" class="form-control form-control-modern" name="custmail"
                                                value="<?php echo $row['custmail'];  ?>"  />
                                        </div>
                                    </div>
                                 
                                    <div class="form-row">
                                        <div class="form-group col-4 mb-3 pt-0" style="border-top:none;">
                                            <label>Flight</label>
                                            <input type="text" class="form-control form-control-modern" name="flight"
                                                value="<?php echo $row['cd_flight'];  ?>"  />
                                        </div>
                                        <div class="form-group col-4 mb-3 pt-0" style="border-top:none;">
                                            <label>Hotel</label>
                                            <input type="text" class="form-control form-control-modern" name="hotel"
                                                value="<?php echo $row['cd_hotel'];  ?>"  />
                                        </div>
                                        <div class="form-group col-4 mb-3 pt-0" style="border-top:none;">
                                            <label>Room</label>
                                            <input type="text" class="form-control form-control-modern" name="room"
                                                value="<?php echo $row['cd_hotelroom'];  ?>" />
                                        </div>
                                    </div>
                                    <div class="form-row">
                                        <div class="form-group col-6 mb-3 pt-0" style="border-top:none;">
                                            <label>Drivers Licence</label>
                                            <input type="text" class="form-control form-control-modern" name="cd_dlnumber"
                                                value="<?php echo $row['cd_dlnumber'];  ?>" />
                                        </div>
                                        <div class="form-group col-6 mb-3 pt-0" style="border-top:none;">
                                            <label>Passport/ID Number</label>
                                            <input type="text" class="form-control form-control-modern" name="cd_passnum"
                                                value="<?php echo $row['cd_passnum'];  ?>"  />
                                        </div>
                                    </div>
                                    <div class="form-row">
                                        <div class="form-group col mb-3">
                                            <label>Address</label>
                                            <textarea rows="1" class="form-control" name="cd_address" id="cd_address"
                                                ><?php echo $row['cd_address'];?> </textarea>
                                        </div>
                                    </div>
                                   <!-- <div class="form-row">
                                        <div class="form-group col mb-3">
                                            <label>Customer Data</label>
                                            <textarea rows="7" class="form-control" name="custdata" id="custdata"
                                                <?php echo $disfunct;?>><?php echo $row['custdata'];?> </textarea>
                                        </div>
                                    </div>-->
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <button class="btn btn-default modal-dismiss">Cancel</button>
                </div>
                <input type="hidden" name="oldnominative" value="<?php echo $row['nominative'];?>">
                <input type="hidden" name="oldphone" value="<?php echo $row['phone'];?>">
                <input type="hidden" name="oldcustmail" value="<?php echo $row['custmail'];?>">
                <input type="hidden" name="oldcd_dob" value="<?php echo $row['cd_dob'];?>">
                <input type="hidden" name="oldcd_flight" value="<?php echo $row['cd_flight'];?>">
                <input type="hidden" name="oldcd_hotel" value="<?php echo $row['cd_hotel'];?>">
                <input type="hidden" name="oldcd_hotelroom" value="<?php echo $row['cd_hotelroom'];?>">
                <input type="hidden" name="oldcd_dlnumber" value="<?php echo $row['cd_dlnumber'];?>">
                <input type="hidden" name="oldcd_address" value="<?php echo $row['cd_address'];?>">
                <input type="hidden" name="oldcd_passnum" value="<?php echo $row['cd_passnum'];?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                </form>
            </div>
        </footer>
    </section>
</div>
<!--Change Pick up-->
<div id="modalpickup" class="modal">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Change Pick Up Details?</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/changepickup.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">
                        <div class="row">
                            <div class="col-md-12">



                                <div class="form-row">
                                    <div class="form-group col mb-1">
                                        <label>Pick Up Date / Time</label>
                                        <input class="form-control" type="text" name="newritiro" id="newritiro"
                                            value="<?php echo $picktime;  ?>">
                                    </div>

                                </div>
                                <span style="color:red;font-size:x-small;"><?php echo $pickdet;?></span>
                                <div class="form-row">
                                    <div class="form-group col mb-3">
                                        <label>Pick Up Location</label>
                                        <select data-plugin-selectTwo class="form-control form-control-modern populate"
                                            name="newidplace">
                                            <?php $sqlcat = "SELECT * FROM jostj_vikrentcar_places";
                                                    $result = mysqli_query($db2,$sqlcat);
                                                    while($rowcat = mysqli_fetch_array($result)) {?>

                                            <option value="<?php echo $rowcat['id'];?>"
                                                <?php if ($row['idplace']==$rowcat['id']){ echo "selected";} else {};?>>
                                                <?php echo $rowcat['name'];?></option>


                                            <?php } ?>

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




                            </div>

                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <a class="btn btn-default" type="button" href="#" rel="modal:close">Cancel</a>
                </div>
                <input type="hidden" name="oldritiro" value="<?php echo $row['ritiro'];?>">
                <input type="hidden" name="oldidplace" value="<?php echo $row['idplace'];?>">

                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                </form>
            </div>
        </footer>
    </section>
</div>
<!-- Change Drop Off-->
<div id="modaldropoff" class="modal">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Change Drop Off Details?</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/changedropoff.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">
                        <div class="row">

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

                                <div class="form-row">
                                    <div class="form-group col mb-1">
                                        <label>Drop Off Date / Time</label>
                                        <input class="form-control" type="text" name="newconsegna" id="newconsegna"
                                            value="<?php echo $droptime;  ?>">
                                    </div>

                                </div>
                                <span style="color:red;font-size:x-small;"><?php echo $dropdet;?></span>
                                <div class="form-row">
                                    <div class="form-group col mb-3">
                                        <label>Drop Off Location</label>
                                        <select class="form-control form-control-modern" name="newidreturnplace"
                                            data-plugin-selectTwo>
                                            <?php $sqlcat = "SELECT * FROM jostj_vikrentcar_places";
                                                        $result = mysqli_query($db2,$sqlcat);
                                                        while($rowcat = mysqli_fetch_array($result)) {?>

                                            <option value="<?php echo $rowcat['id'];?>"
                                                <?php if ($row['idreturnplace']==$rowcat['id']){ echo "selected";} else {};?>>
                                                <?php echo $rowcat['name'];?></option>


                                            <?php } ?>
                                        </select>
                                    </div>
                                </div>




                            </div>
                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <a class="btn btn-default" type="button" href="#" rel="modal:close">Cancel</a>
                </div>

                <input type="hidden" name="oldconsegna" value="<?php echo $row['consegna'];?>">
                <input type="hidden" name="oldidreturnplace" value="<?php echo $row['idreturnplace'];?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                </form>
            </div>
        </footer>
    </section>
</div>
<!--Change Veh-->
<div id="modalveh" class="modal">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Change Vehicle Details?</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/changeveh.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">
                        <div class="row">

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

                                <div class="form-row">

                                    <div class="form-group col mb-3">
                                        <label>Selected Vehicle</label>
                                        <select data-plugin-selectTwo class="form-control form-control-modern populate"
                                            name="newveh" id="veh2">
                                            <?php $sqlcat = "SELECT * FROM jostj_vikrentcar_cars";
                                                    $result = mysqli_query($db2,$sqlcat);
                                                    while($rowcat = mysqli_fetch_array($result)) {?>

                                            <option value="<?php echo $rowcat['id'];?>"
                                                <?php if ($row['idcar']==$rowcat['id']){ echo "selected";} else {};?>>
                                                <?php echo $rowcat['name'];?></option>


                                            <?php } ?>

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

                            </div>





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

        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <a class="btn btn-default" type="button" href="#" rel="modal:close">Cancel</a>
                </div>

                <input type="hidden" name="oldidcar" value="<?php echo $row['idcar'];?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                </form>
            </div>
        </footer>
    </section>
</div>
<!--Change Finance-->
<div id="modalFinance" class="modal-block modal-block-primary mfp-hide">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Change Finance Details?</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/changefinance.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">

                        <div class="form-row">
                            <div class="form-group col mb-3">
                                <label>Reservation Price</label>
                                <input type="text" class="form-control form-control-modern" name="neworder_total"
                                    value="<?php echo $row['order_total'];  ?>" />
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-group col mb-3">
                                <label>Total Paid</label>
                                <input type="text" class="form-control form-control-modern" name="newtotpaid"
                                    value="<?php echo $row['totpaid'];  ?>" />
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-group col mb-3">
                                <label>Pay Locally</label>
                                <input type="text" class="form-control form-control-modern" name="newcust_cost"
                                    value="<?php echo $resttopay;  ?>" />
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-group col mb-3">
                                <label>Extra Costs</label>
                                <input type="text" class="form-control form-control-modern" name="newextracosts"
                                    value="<?php echo $row['extracosts'];  ?>" />
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-group col mb-3">
                                <label>Payment Method</label>
                                <select class="form-control form-control-modern" name="newidpayment"
                                    data-plugin-selectTwo>
                                    <option value="" disabled selected hidden>
                                        <?php if (is_null($row['idpayment'])){echo "Not Set";} else{ echo trim(explode('=', $row['idpayment'])[1]);} ?>
                                    </option>
                                    <?php $sqlcat = "SELECT * FROM jostj_vikrentcar_gpayments";
                                                        $result = mysqli_query($db2,$sqlcat);
                                                        while($rowcat = mysqli_fetch_array($result)) {?>

                                    <option value="<?php echo $rowcat['id'];?>=<?php echo $rowcat['name'];?>">
                                        <?php echo $rowcat['name'];?></option>


                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <button class="btn btn-default modal-dismiss">Cancel</button>
                </div>
                <input type="hidden" name="oldorder_total" value="<?php echo $row['order_total'];?>">
                <input type="hidden" name="oldtotpaid" value="<?php echo $row['totpaid'];?>">
                <input type="hidden" name="oldcust_cost" value="<?php echo $row['cust_cost'];?>">
                <input type="hidden" name="oldextracosts" value="<?php echo $row['extracosts'];?>">
                <input type="hidden" name="oldidpayment"
                    value="<?php if (is_null($row['idpayment'])){echo "Not Set";} else{ echo trim(explode('=', $row['idpayment'])[1]);}?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                </form>
            </div>
        </footer>
    </section>
</div>
<!--Change Optionals-->
<div id="modaloptionals" class="modal-block modal-block-primary mfp-hide">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Change Extra Optionals?</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/changeoptionals.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">

                        <div class="card-body">
                            <?php
                                    if (is_null($row['optionals'])) {
                                        $optionals="1:0;2:0;3:0;4:0;5:0;6:0;7:0";
                                    }
                                    else {
                                        $optionals=$row['optionals'];
                                    }
                                    $st2=explode(';', $optionals);
                            foreach ($st2 as $index=>$value){
                                if ($value == NULL) {
                                    break;
                                }
                                $optionalname=trim(explode(':', $value)[0]);
                                $optionalquant=trim(explode(':', $value)[1]);
                                $sqlopt = $db2->query("SELECT * FROM jostj_vikrentcar_optionals  WHERE jostj_vikrentcar_optionals.id='$optionalname'  ") or die(mysql_error());
                                                    $rowopt = mysqli_fetch_array( $sqlopt );
                            if ($row['source']==16){
                                $sqlopt2 = $db->query("SELECT * FROM jos8r_vikrentcar_optionals  WHERE jos8r_vikrentcar_optionals.id='$optionalname'  ") or die(mysql_error());
                                $rowopt2 = mysqli_fetch_array( $sqlopt2 );
                                $optionalvalue=$rowopt2['cost']*$optionalquant;
                            }
                            else{
                                $optionalvalue=$rowopt['cost']*$optionalquant;
                            }                    
                            ?>
                            <div class="form-row">
                                <div class="form-group col-4 mb-3">

                                    <input type="text" class="form-control form-control-modern"
                                        name="op<?php echo $index+1;?>n" value="<?php echo $rowopt['name'];  ?>" />
                                </div>
                                <div class="form-group col-1 mb-3 pt-0 text-center" style="border-top:none;"> X </div>
                                <div class="form-group col-2  mb-3 pt-0" style="border-top:none;">

                                    <input type="text" class="form-control form-control-modern"
                                        name="op<?php echo $index+1;?>q" value="<?php echo $optionalquant;  ?>" />
                                </div>
                                <div class="form-group col-1 mb-3 pt-0 text-center" style="border-top:none;"> = </div>
                                <div class="form-group col-3  mb-3 pt-0" style="border-top:none;">

                                    <input type="text" class="form-control form-control-modern"
                                        name="op<?php echo $index+1;?>v" value="<?php echo $optionalvalue;  ?>" />
                                </div>
                                <div class="form-group col-1 mb-3 pt-0 text-left" style="border-top:none;"> € </div>
                            </div>

                            <?php
                            
                            }
                        
                            ?>
                            <div class="form-row">
                                <div class="form-group col mb-3">
                                    <label>Update Also Extra Costs and Reservation Price?</label>
                                    <select class="form-control form-control-modern" name="updateprice"
                                        data-plugin-selectTwo>
                                        <option value="no">
                                            NO
                                        </option>
                                        <option value="yes">
                                            YES
                                        </option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <button class="btn btn-default modal-dismiss">Cancel</button>
                </div>
                <input type="hidden" name="oldop" value="<?php echo $optionals;?>">
                <input type="hidden" name="oldopcost" value="<?php echo $row['extracosts'];?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                </form>
            </div>
        </footer>
    </section>
</div>
<!--Change Finance-->
<div id="modalFinance" class="modal-block modal-block-primary mfp-hide">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Change Finance Details?</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/changefinance.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">

                        <div class="form-row">
                            <div class="form-group col mb-3">
                                <label>Reservation Price</label>
                                <input type="text" class="form-control form-control-modern" name="neworder_total"
                                    value="<?php echo $row['order_total'];  ?>" />
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-group col mb-3">
                                <label>Total Paid</label>
                                <input type="text" class="form-control form-control-modern" name="newtotpaid"
                                    value="<?php echo $row['totpaid'];  ?>" />
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-group col mb-3">
                                <label>Pay Locally</label>
                                <input type="text" class="form-control form-control-modern" name="newcust_cost"
                                    value="<?php echo $resttopay;  ?>" />
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-group col mb-3">
                                <label>Extra Costs</label>
                                <input type="text" class="form-control form-control-modern" name="newextracosts"
                                    value="<?php echo $row['extracosts'];  ?>" />
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="form-group col mb-3">
                                <label>Payment Method</label>
                                <select class="form-control form-control-modern" name="newidpayment"
                                    data-plugin-selectTwo>
                                    <option value="" disabled selected hidden>
                                        <?php if (is_null($row['idpayment'])){echo "Not Set";} else{ echo trim(explode('=', $row['idpayment'])[1]);} ?>
                                    </option>
                                    <?php $sqlcat = "SELECT * FROM jostj_vikrentcar_gpayments";
                                                        $result = mysqli_query($db2,$sqlcat);
                                                        while($rowcat = mysqli_fetch_array($result)) {?>

                                    <option value="<?php echo $rowcat['id'];?>=<?php echo $rowcat['name'];?>">
                                        <?php echo $rowcat['name'];?></option>


                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <button class="btn btn-default modal-dismiss">Cancel</button>
                </div>
                <input type="hidden" name="oldorder_total" value="<?php echo $row['order_total'];?>">
                <input type="hidden" name="oldtotpaid" value="<?php echo $row['totpaid'];?>">
                <input type="hidden" name="oldcust_cost" value="<?php echo $row['cust_cost'];?>">
                <input type="hidden" name="oldextracosts" value="<?php echo $row['extracosts'];?>">
                <input type="hidden" name="oldidpayment"
                    value="<?php if (is_null($row['idpayment'])){echo "Not Set";} else{ echo trim(explode('=', $row['idpayment'])[1]);}?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                </form>
            </div>
        </footer>
    </section>
</div>
<!--Change Admin Notes-->
<div id="modaladmin" class="modal-block modal-block-primary mfp-hide">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Change Admin Notes?</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/changeadminnotes.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">

                        <div class="card-body">
                        <div class="form-row">
                                        <div class="form-group col-xl-12 mb-3">
                                            <label>Admin Notes  </label>
                                            <textarea rows="10" class="form-control" name="newadminnotes" id="newadminnotes"
                                                ><?php echo $row['adminnotes'];?> </textarea>
                                               
                                        </div>
                                        
                                    </div>
                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <button class="btn btn-default modal-dismiss">Cancel</button>
                </div>
                <input type="hidden" name="oldadminnotes" value="<?php echo $row['adminnotes'];?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                </form>
            </div>
        </footer>
    </section>
</div>
<!--Change Email Text-->
<div id="modalemail" class="modal-block modal-block-primary mfp-hide">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Change Email Text?</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/changeemailtext.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">

                        <div class="card-body">
                        <div class="form-row">
                                        <div class="form-group col-xl-12 mb-3">
                                            <label>Email Text  </label>
                                            <textarea rows="10" class="form-control" name="newemailtext" id="newemailtext"
                                                ><?php echo $row['email_text'];?> </textarea>
                                               
                                        </div>
                                        
                                    </div>
                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <button class="btn btn-default modal-dismiss">Cancel</button>
                </div>
                <input type="hidden" name="oldemailtext" value="<?php echo $row['email_text'];?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                </form>
            </div>
        </footer>
    </section>
</div>
<!--Select Customer-->

<div id="modalselectCustomer" class="modal" >
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Select Customer</h2>
        </header>
        <div class="card-body">
            <form method="get" action="customersearch.php?">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">

                        <div class="card-body">
                        <div class="form-row">
                        <div class="form-group col mb-3">
                                <label>Customer</label>
                                <input type="text" class="form-control form-control-modern" name="q"
                                    value=""  placeholder="Type Customer Name, Phone or email"  />
                            </div>
                                        
                                    </div>
                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Search</button>
                   
                    <a class="btn btn-default" type="button" href="#" rel="modal:close">New Customer</a>
                </div>
               
                </form>
            </div>
        </footer>
    </section>
</div>
<!-- extend contract-->
<div id="modalextend" class="modal">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Extend Contract</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/extendcontract.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">
                        <div class="row">

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

                                <div class="form-row">
                                    <div class="form-group col mb-1">
                                        <label>New Drop Off Date / Time</label>
                                        <input class="form-control" type="text" name="newconsegna3" id="newconsegna3"
                                            value="<?php echo $droptime;  ?>">
                                    </div>

                                </div>
                                <span style="color:red;font-size:x-small;"><?php echo $dropdet;?></span>
                                <div class="form-row">
                                    <div class="form-group col mb-3">
                                        <label>New Drop Off Location</label>
                                        <select class="form-control form-control-modern" name="newidreturnplace"
                                            data-plugin-selectTwo>
                                            <?php $sqlcat = "SELECT * FROM jostj_vikrentcar_places";
                                                        $result = mysqli_query($db2,$sqlcat);
                                                        while($rowcat = mysqli_fetch_array($result)) {?>

                                            <option value="<?php echo $rowcat['id'];?>"
                                                <?php if ($row['idreturnplace']==$rowcat['id']){ echo "selected";} else {};?>>
                                                <?php echo $rowcat['name'];?></option>


                                            <?php } ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-row">
                            <div class="form-group col mb-3">
                                <label>Extension Cost</label>
                                <input type="text" class="form-control form-control-modern" name="extcost"
                                    value="" />
                            </div>
                        </div>



                            </div>
                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <a class="btn btn-default" type="button" href="#" rel="modal:close">Cancel</a>
                </div>

                <input type="hidden" name="oldconsegna" value="<?php echo $row['consegna'];?>">
                <input type="hidden" name="oldidreturnplace" value="<?php echo $row['idreturnplace'];?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                <input type="hidden" name="contid" value="<?php echo $rowcont['contract_id'];?>">
                <input type="hidden" name="currcost" value="<?php echo $rowcont['Contract_value'];?>">
                </form>
            </div>
        </footer>
    </section>
</div>
<!-- change Vehicle-->
<div id="modalvehcontractchange" class="modal">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Change vehicle</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/vehchangecontract.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">
                        <div class="row">

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

                                <div class="form-row">
                                    <div class="form-group col mb-1">
                                        <label>Date / Time of Change</label>
                                        <input class="form-control" type="text" name="newpick" id="newpick"
                                            value="<?php echo $picktime;  ?>">
                                    </div>

                                </div>
                                <span style="color:red;font-size:x-small;"><?php echo $dropdet;?></span>
                                <div class="form-row">
                                    <div class="form-group col mb-3">
                                        <label>New Vehicle</label>
                                        <select class="form-control form-control-modern" name="newveh"
                                               data-plugin-selectTwo >
                                               <option value="" disabled selected>Select Vehicle</option>
                                               <?php $sqlcat = "SELECT * FROM fleet LEFT JOIN jostj_vikrentcar_cars ON jostj_vikrentcar_cars.id=fleet.veh_id WHERE fleet.active=1";
                                                       $result = mysqli_query($db2,$sqlcat);
                                                       while($rowcat = mysqli_fetch_array($result)) {?>

                                               <option value="<?php echo $rowcat['fleet_id'];?>"
                                                  >
                                                   <?php echo $rowcat['name']." - ".$rowcat['lic_num'];?></option>


                                               <?php } ?>
                                           </select>
                                    </div>
                                </div>
                                
                                <div class="form-row">
                                        <div class="form-group col-xl-12 mb-3">
                                            <label>Reason  </label>
                                            <input type="text" class="form-control form-control-modern" name="reason"
                                    value="" />
                                               
                                        </div>
                                        
                                    </div>

                                    <div class="form-row">
                                        <div class="form-group col-xl-12 mb-3">
                                            <label>Notes  </label>
                                            <textarea rows="4" class="form-control" name="contnotes" id="contnotes"
                                                > </textarea>
                                               
                                        </div>
                                        
                                    </div>

                            </div>
                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <a class="btn btn-default" type="button" href="#" rel="modal:close">Cancel</a>
                </div>

                <input type="hidden" name="oldconsegna" value="<?php echo $row['consegna'];?>">

                <input type="hidden" name="oldveh" value="<?php echo $rowccc['vehfleet_id'];?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                <input type="hidden" name="contid" value="<?php echo $rowcont['contract_id'];?>">
          
                </form>
            </div>
        </footer>
    </section>
</div>
<div id="modalcontrdropoff" class="modal">
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Early Drop Off ?</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/changecontrdropoff.php">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">
                        <div class="row">

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

                                <div class="form-row">
                                    <div class="form-group col mb-1">
                                        <label>Drop Off Date / Time</label>
                                        <input class="form-control" type="text" name="cont_ret" id="cont_ret"
                                            value="<?php echo $droptime;  ?>">
                                    </div>

                                </div>
                                <span style="color:red;font-size:x-small;"><?php echo $dropdet;?></span>
                                




                            </div>
                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-primary " type="submit">Change</button>
                    <a class="btn btn-default" type="button" href="#" rel="modal:close">Cancel</a>
                </div>

                <input type="hidden" name="oldreturn" value="<?php echo $droptime;?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                <input type="hidden" name="fid2" value="<?php echo $rowcont['contract_id'];?>">
                </form>
            </div>
        </footer>
    </section>
</div>
<!--cancel contract-->

<div id="modalcontractcancel" class="modal" >
    <section class="card">
        <header class="card-header">
            <h2 class="card-title">Cancel Contract?</h2>
        </header>
        <div class="card-body">
            <form method="post" action="actions/cancelcontract.php?">
                <div class="modal-wrapper">
                    <div class="modal-icon">
                        <i class="fas fa-question-circle"></i>
                    </div>

                    <div class="modal-text">

                        <div class="card-body">
                        <div class="form-row">
                        <div class="form-group col mb-3">
                                <label>Cancellation Reason</label>
                                <input type="text" class="form-control form-control-modern" name="reason"
                                    value=""  placeholder="Type reason"  />
                            </div>
                                        
                                    </div>
                        </div>
                    </div>
                </div>
        </div>
        <footer class="card-footer">
            <div class="row">
                <div class="col-md-12 text-right">
                    <button class="btn btn-warning " type="submit">Cancel</button>
                    <a class="btn btn-default" type="button" href="#" rel="modal:close">close</a>
                   
                </div>
                <input type="hidden" name="contid" value="<?php echo $rowcont['contract_id'];?>">
                <input type="hidden" name="fid" value="<?php echo $fid;?>">
                </form>
            </div>
        </footer>
    </section>
</div>