<?php
ob_start();
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');

$maindb = 'quotmain';
$trandb = 'quottran';
$formname = 'Quotation Pax';

$printfile = "quote_pax_print.php";
$file = 'quotepax.php';
$trandbexist = 1;
$keyfld = "vouchno";
$source = "QP";

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$myyear = $_SESSION[$myyear];
$compcd = $_SESSION["comp_" . $dbname];

$zroot = $_SESSION["zdir"];

mysqli_select_db($conn, $zdb);
include("includes/vouchno_generate.php");
include("includes/prev&next.php");

if (isset($_POST["submit"])) {
    $a = 1;
    $qvouch = $_POST["vouchno"];
    $vouchdt = $_POST["vouchdt"];
    $name = $_POST["name"];
    $surname = $_POST["surname"];
    $classno = $_POST["classno"];
    $airline = $_POST["airline"];
    $depdt = $_POST["depdt"];
    $childchg = $_POST["childchg"];
    $adultchg = $_POST["adultchg"];
    $infantchg = $_POST["infantchg"];
    $chwobed = $_POST["chwobed"];
    $inc1 = $_POST["inc1"];
    $inc2 = $_POST["inc2"];
    $inc3 = $_POST["inc3"];
    $inc4 = $_POST["inc4"];
    $inc5 = $_POST["inc5"];

    $adultpax = $_POST["adultpax"];
    $totadult = $_POST["totadult"];
    $childpax = $_POST["childpax"];
    $totchildbed = $_POST["totchildbed"];
    $chwobedpax = $_POST["chwobedpax"];
    $totchildwobed = $_POST["totchildwobed"];
    $infantpax = $_POST["infantpax"];
    $totinfant = $_POST["totinfant"];
    $netamt = $_POST["netamt"];

    $count = $_POST["items"];

    $mvouch = $qvouch;

    $salecode = 11;

    if ($a == 1) {
        mysqli_query($conn, "LOCK TABLES `$maindb` WRITE, `$trandb` WRITE, `hotels` WRITE, `city` WRITE");

        if ($addflag == 1) {
            $gen1 = mysqli_query($conn, "SELECT MAX(vouchno) AS maxcode FROM `$maindb` where vouchno != '' LIMIT 0,1 ") or die(mysqli_error($conn));
            if (mysqli_num_rows($gen1) > 0) {
                $vvouch = mysqli_fetch_assoc($gen1);
                $qvouch = $vvouch["maxcode"] + 1;
            } else {
                $qvouch = '1';
            }
            $mvouch = $qvouch;
        }

        ################################# TRAN PART #################################

        mysqli_query($conn, "DELETE FROM `$trandb` WHERE `$keyfld`='$mvouch'") or die(mysqli_error($conn));

        $srl = 0;
        $batch = date("Y-m-d") . $mvouch;
        $cnt = 0;
        $tnetamt = 0;
        for ($i = 0; $i <= $count; $i++) {

            $srno = $_POST["srno_$i"];
            $city = $_POST["city_$i"];
            $hotelnm = $_POST["hotelnm_$i"];
            $checkin = $_POST["checkin_$i"];
            $checkout = $_POST["checkout_$i"];
            $roomtype = $_POST["roomtype_$i"];
            $roomsno = $_POST["roomsno_$i"];
            $nonights = $_POST["nonights_$i"];
            $mealplan = $_POST["mealplan_$i"];

            $nigctr = $nonights;

            if (!empty($checkin)) {
                $srl++;
                mysqli_query($conn, "INSERT INTO `$trandb`(`vouchno`, `vouchdt`, `srno`, `city`, `hotelnm`, `checkin`, `checkout`, `nonights`, `roomtype`, `roomsno`,`mealplan`)
                                                        VALUES('$mvouch', '$vouchdt', '$srl', '$city', '$hotelnm', '$checkin', '$checkout', '$nonights', '$roomtype', '$roomsno','$mealplan')") or die(mysqli_error($conn));
            }
            $tnetamt = $tnetamt + $amount;
        }

        ################################# TRAN PART END #################################



        ############################################### MAIN ######################################################
        if ($addflag == 1) {

            $uuid = $_SESSION["uuid"];

            mysqli_query($conn, "INSERT INTO `$maindb`(`vouchno`, `vouchdt`, `name`, `surname`, `classno`, `airline`,`depdt`, `childchg`,
                                                       `adultchg`, `infantchg`, `chwobed`, `inc1`, `inc2`, `inc3`, `inc4`, `inc5`, `adultpax`,
                                                       `totadult`, `childpax`, `totchildbed`, `chwobedpax`, `totchildwobed`, `infantpax`, `totinfant`,
                                                       `netamt`, `uuid`)

                                VALUES ('$qvouch', '$vouchdt',  '$name', '$surname','$classno', '$airline', '$depdt', '$childchg',
                                                    '$adultchg', '$infantchg', '$chwobed', '$inc1', '$inc2', '$inc3', '$inc4', '$inc5',
                                                    '$adultpax', '$totadult', '$childpax', '$totchildbed', '$chwobedpax', '$totchildwobed', '$infantpax', 
                                                    '$totinfant', '$netamt', '$uuid')") or die(mysqli_error($conn));
            insmess();
            $mvouch = $qvouch; //1
            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit");
        } else {
            $mvouch = $qvouch; //1
            mysqli_query($conn, "UPDATE `$maindb` SET `vouchdt`='$vouchdt', `name`='$name', `surname`='$surname', `classno`='$classno',
                                                      `airline`='$airline', `depdt`='$depdt', `childchg`='$childchg', `adultchg`='$adultchg',
                                                      `infantchg`='$infantchg', `chwobed`='$chwobed', `inc1`='$inc1', `inc2`='$inc2', `inc3`='$inc3',
                                                      `inc4`='$inc4', `inc5`='$inc5', `adultpax`='$adultpax', `totadult`='$totadult', `childpax`='$childpax',
                                                      `totchildbed`='$totchildbed', `chwobedpax`='$chwobedpax', `totchildwobed`='$totchildwobed', `infantpax`='$infantpax',
                                                      `totinfant`='$totinfant', `netamt`='$netamt' WHERE `vouchno`= '$mvouch' ") or die(mysqli_error($conn));
            updmess();
            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit");
        }

        ############################################### MAIN PART END ###############################################
    }
}
// }

if ($addflag != 1) {

    $getvouch = '';
    if ($addflag == 0) {
        $getvouch = $_GET[$keyfld];
    } else {
        $getvouch = $qvouch;
    }

    $result = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE $keyfld='$getvouch'") or die(mysqli_error($conn));
    $get = mysqli_fetch_array($result);
}

$senable = "";
$cenable = "";

if (isset($_GET["delete"])) {
    delete($zdb, "$maindb", "$keyfld", $_GET[$keyfld], "$file?mode=last");
    delete($zdb, "$trandb", "$keyfld", $_GET[$keyfld], "$file?mode=last");
    $delcond = " source = 'FPUH' and vouchno = '$_GET[vouchno]' ";
    $delcond2 = " source = 'PU' and vouchno = '$_GET[vouchno]' ";
    delnew($zdb, "$accdb", "$delcond", "$file?mode=last");
    delnew($zdb, "roomsacn", "$delcond2", "$file?mode=last");
}

include("includes/linkshead.php");
?>
<script src="MyScript/shortkeys.js?a=2" type="text/javascript"></script>
<script src="MyScript/quotepax.js?a=3" type="text/javascript"></script>
<script src="MyScript/quotepax_search.js?a=2" type="text/javascript"></script>
</head>

<body>
    <form action='' method='POST'>
        <!-- Default box -->
        <div>
            <div class="col-lg-10 col-md-10 col-sm-12 col-xs-12  pad">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title" style="color:inherit"><?php echo $formname; ?></h3>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-2  col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Voucher</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 pad">
                                <input type="text" class="form-control text-size form" name="vouchno"
                                    value="<?php echo ($addflag != 1) ? $get["vouchno"] : "$qvouch"; ?>" required
                                    readonly>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Date</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4 pad">
                                <input type="date" class="form-control form focusfield" name="vouchdt"
                                    value="<?php echo ($addflag != 1) ? $get["vouchdt"] : date('Y-m-d'); ?>" autofocus>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Name</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-4 col-xs-4  pad">
                                <input type="text" class="form-control form" name="name"
                                    value="<?php echo ($addflag != 1) ? $get["name"] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Surname</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-4 col-xs-4  pad">
                                <input type="text" class="form-control form" name="surname"
                                    value="<?php echo ($addflag != 1) ? $get["surname"] : ""; ?>">
                            </div>
                        </div>

                        <div class="row">

                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Class No</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4  pad">
                                <input type="text" class="form-control form" name="classno"
                                    value="<?php echo ($addflag != 1) ? $get["classno"] : ""; ?>">
                            </div>

                            <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Airline</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4 pad">
                                <input type="text" class="form-control form airline" name="airline"
                                    value="<?php echo ($addflag != 1) ? $get["airline"] : ""; ?>">
                            </div>

                            <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Dep. Date</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4 pad">
                                <input type="date" class="form-control form" name="depdt"
                                    value="<?php echo ($addflag != 1) ? $get["depdt"] : ""; ?>">
                            </div>
                        </div>

                        <br>

                        <div class="table-responsive">
                            <table class="table table-striped table-condensed table-bordered table-padd" width="100%">
                                <thead class="mySearchTr">
                                    <tr>
                                        <th width="2%"></th>
                                        <th width="3%" class='text-center'>Sr.</th>
                                        <th width="7%">City</th>
                                        <th width="15%">Hotel Name</th>
                                        <th width="5%">Check In</th>
                                        <th width="5%">Check Out</th>
                                        <th width="5%">Room Type</th>
                                        <th width="5%" class='text-right'>No. of Rooms</th>
                                        <th width="5%" class='text-right'>No. of Nights</th>
                                        <th width="5%">Meal Plan</th>
                                    </tr>
                                </thead>

                                <tbody class="tbody">
                                    <?php
                                    if ($addflag != 1) {
                                        $ctr = 0;
                                        $mctr = 0;
                                        $tqty = 0;
                                        $tamt = 0;
                                        $gettran = mysqli_query($conn, "SELECT * FROM `$trandb` WHERE `vouchno`='$get[vouchno]' ORDER BY `srno`") or die(mysqli_error($conn));
                                        while ($tran = mysqli_fetch_array($gettran)) {


                                            $mhotel = mysqli_query($conn, "SELECT code,hotelnm FROM hotels where code='$tran[hotelnm]'") or die(mysqli_error($conn));
                                            $thotel = mysqli_fetch_array($mhotel);

                                            $mctr++;
                                            if ($tran['city'] == 99) {
                                                $cityname = "OTHER";
                                            } else {
                                                $mhotcity = mysqli_query($conn, "SELECT code,name FROM city where code='$tran[city]'") or die(mysqli_error($conn));
                                                $thotcity = mysqli_fetch_array($mhotcity);
                                                $cityname = $thotcity['name'];
                                            }

                                            echo "<tr>";
                                            echo "<td><i class='fa fa-close remove' style='display:none'></i></td>";
                                            echo "<td><input type='text' class='form-control form text-right srno' name='srno_$ctr' value='$mctr'></td>";

                                            echo "<td>";
                                            echo "<select class='form-control form city select2' name='city_$ctr' style='width:100%'  required>";
                                            echo "<option value='$tran[city]'>$cityname</option>";
                                            $getcity = mysqli_query($conn, "SELECT `code`,`name` FROM `city` WHERE code = '2' OR code = '3' ORDER BY `name` DESC") or die(mysqli_error($conn));
                                            while ($fetcity = mysqli_fetch_array($getcity)) {
                                                echo "<option value='$fetcity[code]'>$fetcity[name]</option>";
                                            }
                                            echo "<option value='99'>OTHER</option>";
                                            echo "</select>";
                                            echo "</td>";

                                            echo "<td>";
                                            echo "<select class='form-control form hotelnm select2' name='hotelnm_$ctr' style='width:100%'  required>";
                                            echo "<option value='$tran[hotelnm]'>$thotel[hotelnm]</option>";
                                            $gethotel = mysqli_query($conn, "SELECT `code`,`hotelnm` FROM `hotels` ORDER BY `hotelnm`") or die(mysqli_error($conn));
                                            while ($fethotel = mysqli_fetch_array($gethotel)) {
                                                echo "<option value='$fethotel[code]'>$fethotel[hotelnm]</option>";
                                            }
                                            echo "</select>";
                                            echo "</td>";

                                            echo "<td><input type='date' class='form-control form checkin' name='checkin_$ctr' value='$tran[checkin]'></td>";
                                            echo "<td><input type='date' class='form-control form checkout' name='checkout_$ctr' value='$tran[checkout]'></td>";

                                            echo "<td><input type='text' class='form-control form roomtype' name='roomtype_$ctr' value='$tran[roomtype]'></td>";
                                            echo "<td><input type='number' class='text-right form-control form roomsno' name='roomsno_$ctr' value='$tran[roomsno]'></td>";
                                            echo "<td><input type='number' class='text-right form-control form nonights' name='nonights_$ctr' value='$tran[nonights]'></td>";
                                            echo "<td><input type='text' class='form-control form mealplan' name='mealplan_$ctr' value='$tran[mealplan]'></td>";
                                            echo "</tr>";
                                            $ctr++;
                                        }
                                    } else {
                                        $pctr = 0;
                                        echo "<tr>";
                                        echo "<td><i class='fa fa-close remove' style=''></i></td>";
                                        echo "<td><input type='text' class='form-control form text-right srno' name='srno_0' value='1'></td>";

                                        echo "<td>";
                                        echo "<select class='form-control form city select2' name='city_0' style='width:100%'  required>";
                                        echo "<option value='$tran[city]'>$trtype[name]</option>";
                                        $getcity = mysqli_query($conn, "SELECT `code`,`name` FROM `city` WHERE code = '2' OR code = '3' ORDER BY `name` DESC") or die(mysqli_error($conn));
                                        while ($fetcity = mysqli_fetch_array($getcity)) {
                                            echo "<option value='$fetcity[code]'>$fetcity[name]</option>";
                                        }
                                        echo "<option value='99'>Other</option>";
                                        echo "</select>";
                                        echo "</td>";

                                        echo "<td>";
                                        echo "<select class='form-control form hotelnm select2' name='hotelnm_0' style='width:100%'  required>";
                                        echo "<option value='$tran[code]'>$trtype[hotelnm]</option>";
                                        $gethotel = mysqli_query($conn, "SELECT `code`,`hotelnm` FROM `hotels` ORDER BY `hotelnm`") or die(mysqli_error($conn));
                                        while ($fethotel = mysqli_fetch_array($gethotel)) {
                                            echo "<option value='$fethotel[code]'>$fethotel[hotelnm]</option>";
                                        }
                                        echo "</select>";
                                        echo "</td>";

                                        echo "<td><input type='date' class='form-control form checkin' name='checkin_0' value='$tran[checkin]'></td>";
                                        echo "<td><input type='date' class='form-control form checkout' name='checkout_0' value='$tran[checkout]'></td>";

                                        echo "<td><input type='text' class='form-control form roomtype' name='roomtype_0' value='$tran[roomtype]'></td>";
                                        echo "<td><input type='number' class='text-right form-control form roomsno' name='roomsno_0' value='$tran[roomsno]'></td>";
                                        echo "<td><input type='number' class='text-right form-control form nonights' name='nonights_0' value='$tran[nonights]'></td>";
                                        echo "<td><input type='text' class='form-control form mealplan' name='mealplan_0' value='$tran[mealplan]'></td>";

                                        echo "</tr>";
                                    }
                                    $pctr++;
                                    ?>
                                    <input type="hidden" id="items" name="items"
                                        value="<?php echo ($addflag != 1) ? $ctr : 1; ?>" />
                                </tbody>
                            </table>
                        </div>
                        <div class="row" style="margin-left: auto;">
                            <div class="col-lg-12 pad">
                                <button type="button" class="btn btn-primary btn-square form" id="addnew">
                                    <i class="fa fa-plus" data-toggle='tooltip' title='Add Row'></i>
                                </button>
                            </div>
                        </div>

                        <div class="row" style="margin-left: auto">
                            <div class="col-lg-8 pad">
                                <div class="table-responsive">
                                    <table class="table table-striped table-condensed table-bordered" style='width:62%'>
                                        <thead class="mySearchTr">
                                            <tr>
                                                <!-- <th width="1%">Sr.</th> -->
                                                <th width="20%">Pax Type</th>
                                                <th class="text-right" width="15%">Charges Per Pax</th>
                                                <th class="text-right" width="7%">Pax No.</th>
                                                <th class="text-right" width="15%">Total</th>
                                            </tr>
                                        </thead>

                                        <tbody class="tbody1">
                                            <?php
                                            echo "<tr>";
                                            // echo "<td><input class='form-control form' value='1' readonly></td>";
                                            echo "<td>ADULT</td>";
                                            echo "<td><input type='number' class='form-control text-right form adultchg' name='adultchg' value='$get[adultchg]'></td>";
                                            echo "<td><input type='number' class='form-control text-right form adultpax' name='adultpax' value='$get[adultpax]'></td>";
                                            echo "<td><input type='number' class='form-control text-right form totadult' name='totadult' value='$get[totadult]' readonly tabindex='-1'></td>";
                                            echo "</tr>";
                                            
                                            echo "<tr>";
                                            // echo "<td><input class='form-control form' value='2' readonly></td>";
                                            echo "<td>CHILD &nbsp; &nbsp; <span style='color:#ff0000'>(With Bed)</span></td>";
                                            echo "<td><input type='number' class='form-control form text-right childchg' name='childchg' value='$get[childchg]'></td>";
                                            echo "<td><input type='number' class='form-control form text-right childpax' name='childpax' value='$get[childpax]'></td>";
                                            echo "<td><input type='number' class='form-control form text-right totchildbed' name='totchildbed' value='$get[totchildbed]' readonly tabindex='-1'></td>";
                                            echo "</tr>";

                                            echo "<tr>";
                                            echo "<td>CHILD &nbsp; &nbsp; <span style='color:#0000ff'>(Without Bed)</span></td>";
                                            echo "<td><input type='number' class='form-control form text-right chwobed' name='chwobed' value='$get[chwobed]'></td>";
                                            echo "<td><input type='number' class='form-control form text-right chwobedpax' name='chwobedpax' value='$get[chwobedpax]'></td>";
                                            echo "<td><input type='number' class='form-control form text-right totchildwobed' name='totchildwobed' value='$get[totchildwobed]' readonly tabindex='-1'></td>";
                                            echo "</tr>";

                                            echo "<tr>";
                                            // echo "<td><input class='form-control form' value='3' readonly></td>";
                                            echo "<td>INFANT</td>";
                                            echo "<td><input type='number' class='form-control form text-right infantchg' name='infantchg' value='$get[infantchg]'></td>";
                                            echo "<td><input type='number' class='form-control form text-right infantpax' name='infantpax' value='$get[infantpax]'></td>";
                                            echo "<td><input type='number' class='form-control form text-right totinfant' name='totinfant' value='$get[totinfant]' readonly tabindex='-1'></td>";
                                            echo "</tr>";

                                            echo "<tr>";
                                            echo "<td colspan='3' class='text-right'><b>FINAL TOTAL</b></td>";
                                            // echo "<td><input type='number' class='form-control form text-right totchg' name='totchg' value='$get[totchg]'></td>";
                                            // echo "<td><input type='number' class='form-control form text-right totpax' name='totpax' value='$get[totpax]'></td>";
                                            echo "<td><input style='background:#CFE4FA' type='number' class='form-control form text-right fw-bold netamt' name='netamt' value='$get[netamt]' readonly></td>";
                                            echo "</tr>";
                                            ?>
                                        </tbody>
                                    </table>
                                    <br>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Inclusion</label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-4 col-xs-4  pad">
                                <input type="text" class="form-control inc1 form" name="inc1"
                                    value="<?php echo ($addflag != 1) ? $get["inc1"] : "ACCOMODATION IN ABOVE HOTEL"; ?>">
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg"></label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-4 col-xs-4  pad">
                                <input type="text" class="form-control inc2 form" name="inc2"
                                    value="<?php echo ($addflag != 1) ? $get["inc2"] : "3 TIME MEAL"; ?>">
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg"></label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-4 col-xs-4  pad">
                                <input type="text" class="form-control inc3 form" name="inc3"
                                    value="<?php echo ($addflag != 1) ? $get["inc3"] : "AIRPORT PICKUP DROP"; ?>">
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg"></label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-4 col-xs-4  pad">
                                <input type="text" class="form-control inc4 form" name="inc4"
                                    value="<?php echo ($addflag != 1) ? $get["inc4"] : "MAK-MAD TRANSFER"; ?>">
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg"></label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-4 col-xs-4 pad">
                                <input type="text" class="form-control inc5 form" name="inc5"
                                    value="<?php echo ($addflag != 1) ? $get["inc5"] : "LAUNDRY"; ?>">
                            </div>
                        </div>
                        <br>
                        <div class="panel-footer">
                            <div class="col-lg-10 col-md-7 col-sm-8 col-xs-8 text-center pad">
                                <?php include("includes/buttons.php"); ?>
                            </div>
                            <!-- <div class="col-lg-2 text-left ">
                                <div style="overflow: auto;">
                                    <table class="table-condensed" style="margin: 0 auto;">
                                        <tr>
                                            <td class=" buttonform tooltip-bottom normalinv">
                                                <button type="button"
                                                    style="background-image: linear-gradient(135deg, #3C8CE7 10%, #00EAFF 100%) !important;color:white !important;"
                                                    class="btn btn-pad btn-square skbtn"
                                                    onclick="window.open('quote_pax_print.php?vouchno=<?= $qvouch; ?>', 'popUponclickWindow', 'height=600,width=970,left=20,top=20, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');">
                                                    <i class="fa fa-print"></i>
                                                </button>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div> -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>

    <div class="modal fade bs-example-modal-lg searchModal" tabindex="-1" role="dialog"
        aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myLargeModalLabel">Search <? echo $formname; ?></h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-lg-2">
                            <select class="form-control sfield">
                                <option value="1">Voucher</option>
                                <option value="2">Date</option>
                                <option value="3">Name</option>
                                <option value="4">Surname</option>
                                <option value="5">Class No</option>
                                <option value="6">Airline</option>
                                <option value="7">Dep. Date</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control soperator">
                                <option value="">Type of Search</option>
                                <option value="%">Like</option>
                                <option value="=">Exactly</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control sortBy">
                                <option value="1">Voucher</option>
                                <option value="2">Date</option>
                                <option value="3">Name</option>
                                <option value="4">Surname</option>
                                <option value="5">Class No</option>
                                <option value="6">Airline</option>
                                <option value="7">Dep. Date</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control orderAs">
                                <option value="desc">Desc</option>
                                <option value="asc">Asc</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <input type="text" value="" class="form-control ssearch" placeholder="Search Here">
                        </div>
                        <div class="col-lg-2">
                            <input type="button" class="btn btn-primary sload" value="Search">
                        </div>
                    </div>
                    <div class="col-lg-12 sloader text-center">
                    </div>
                    <div class="col-lg-12 snoRecord text-center">
                        <h3>NO RECORDS FOUND</h3>
                    </div>
                    <div class="table-responsive" style="max-height: 400px;overflow: auto;">
                        <table id="" class="table-striped table-condensed table-bordered" width="100%">
                            <thead>
                                <tr class="mySearchTr">
                                    <th style="width:7%">Voucher</th>
                                    <th style="width:7%">Date</th>
                                    <th style="width:17%">Name</th>
                                    <th style="width:15%">Surname</th>
                                    <th style="width:7%">Class No</th>
                                    <th style="width:9%">Airline</th>
                                    <th style="width:9%">Dep. Date</th>
                                    <th style="width:5%">Action</th>
                                </tr>
                            </thead>
                            <tbody class="sTbody">
                            </tbody>
                        </table>
                    </div>
                    <div class="row">
                        <div class="col-xs-12 text-right search-action-bar">
                            <input type="button" class="btn btn-primary sprev" value="Previous">
                            <input type="button" class="btn btn-primary snext" value="Next">
                        </div>
                    </div>
                </div>
                <div class="modal-footer"></div>
            </div>
        </div>
    </div>
    <?php include("includes/linksfoot.php"); ?>
</body>

</html>