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

$formname = 'Hotel Purchase';
$maindb = 'hotelpmain';
$trandb = 'hotelptran';
$accdb = 'actran';

$printfile = "estimate_print.php";
$file = 'hotelpurch.php';
$trandbexist = 1;
$keyfld = "vouchno";
$source = "PU";

$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"];
    $city = $_POST["city"];
    $hotelnm = $_POST["hotelnm"];
    $hotelcatg = $_POST["hotelcatg"];
    $agent = $_POST["agent"];
    $netamt = $_POST['netamt'];
    $totamt = $_POST["totamt"];

    $count = $_POST["items"];

    $mvouch = $qvouch;

    $salecode = 11;

    if ($a == 1) {
        // mysqli_query($conn, "LOCK TABLES `$maindb` WRITE, `$trandb` 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));
        mysqli_query($conn, "DELETE FROM `roomsacn` WHERE `$keyfld`='$mvouch' and source = '$source' ") 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"];
            $checkin = $_POST["checkin_$i"];
            $checkout = $_POST["checkout_$i"];
            $nonights = $_POST["nonights_$i"];
            $roomcatg = $_POST["roomcatg_$i"];
            $roomtype = $_POST["roomtype_$i"];
            $qty = $_POST["qty_$i"];
            $rate = $_POST["rate_$i"];
            $amount = $_POST["amount_$i"];
            $remarks = mysqli_real_escape_string($conn, $_POST["remarks_$i"]);

            $nigctr = $nonights;

            if (!empty($checkin)) {
                $srl++;
                mysqli_query($conn, "INSERT INTO `$trandb`(`vouchno`, `vouchdt`, `srno`, `checkin`, `checkout`, `nonights`, `roomcatg`, `roomtype`, 
                                                            `qty`, `rate`, `amount`, `remarks`)
                                                    VALUES('$mvouch', '$vouchdt', '$srl', '$checkin', '$checkout', '$nonights', '$roomcatg', '$roomtype',
                                                           '$qty', '$rate', '$amount', '$remarks' )") or die(mysqli_error($conn));
                ///////// roomsacn

                $bookdate = $checkin;
                for ($r = 0; $r < $nigctr; $r++) {

                    mysqli_query($conn, "INSERT INTO `roomsacn`(`source`, `vouchno`, `bookdate`, `hotel`, `city`, 
                                                                      `roomcatg`, `roomtype`, `qty`, `rate`, `hotelcatg`)
                                                      VALUES('$source', '$mvouch', '$bookdate', '$hotelnm', '$city', 
                                                                      '$roomcatg', '$roomtype', '$qty', '$rate', '$hotelcatg' )") or die(mysqli_error($conn));

                    $bookdate = date('Y-m-d', strtotime($bookdate . ' + 1 days'));
                    if ($bookdate > $checkout) {
                        break;
                    }
                }
            }
            $tnetamt = $tnetamt + $amount;
        }

        #################################TRAN PART END #################################
        mysqli_query($conn, "DELETE FROM `$accdb` WHERE `vouchno` = '$mvouch' AND `source` = 'FPUH'") or die(mysqli_error($conn));
        $purcode = 12;

        if ($tnetamt > 0) {
            $samtmin = $tnetamt * -1;
            // purchase part
            mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno, source, trnno, accode, grpcode, amount, ord)
                    VALUES ('$vouchdt','$mvouch', 'FPUH', '001', '$purcode','004', '$samtmin', '18')") or die(mysqli_error($conn));
            // party part
            mysqli_query($conn, "INSERT INTO `$accdb`(date, vouchno, source, trnno, accode, grpcode, amount, ord)
                     VALUES ('$vouchdt','$mvouch', 'FPUH', '002', '$agent','009', '$tnetamt', '18')") or die(mysqli_error($conn));
        }



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

            $uuid = $_SESSION["uuid"];

            mysqli_query($conn, "INSERT INTO `$maindb`(`vouchno`, `vouchdt`, `city`, `hotelnm`, `hotelcatg`, `agent`,uuid)
                                               VALUES ($qvouch, '$vouchdt',  '$city', '$hotelnm','$hotelcatg', '$agent', '$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', `city`='$city', `hotelnm`='$hotelnm', `hotelcatg`='$hotelcatg', `agent`='$agent'
                                     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);

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

    $mhotcatg = mysqli_query($conn, "SELECT code,name FROM hotelcatg where code='$get[hotelcatg]'") or die(mysqli_error($conn));
    $thotcatg = mysqli_fetch_array($mhotcatg);

    $mhotcity = mysqli_query($conn, "SELECT code,name FROM city where code='$get[city]'") or die(mysqli_error($conn));
    $thotcity = mysqli_fetch_array($mhotcity);

    $magent = mysqli_query($conn, "SELECT accode,name FROM accmast where accode='$get[agent]'") or die(mysqli_error($conn));
    $lagent = mysqli_fetch_array($magent);
}

$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/hotelpurch.js?a=3" type="text/javascript"></script>
<script src="MyScript/hotelpurch_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">City</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-4 col-xs-4  pad">
                                <select name="city" class="form-control form city select2">
                                    <option value='<?php echo ($addflag != 1) ? $thotcity['code'] : '' ?>'><?php echo ($addflag != 1) ? $thotcity['name'] : '' ?></option>
                                    <?php
                                    $mhsncode = mysqli_query($conn, "SELECT code,name FROM city order by name ") or die(mysqli_error($conn));
                                    while ($thsncode = mysqli_fetch_array($mhsncode)) {
                                        echo "<option value='$thsncode[code]'>$thsncode[name]</option>";
                                    }
                                    ?>
                                </select>
                            </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">Hotel Name</label>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-4 col-xs-4  pad">
                                <select name="hotelnm" class="form-control form hotelnm select2">
                                    <option value="<?php echo ($addflag != 1) ? $get['hotelnm'] : '' ?>"><?php echo ($addflag != 1) ? $thotel['hotelnm'] : '' ?></option>
                                    <?php
                                    $mhotl = mysqli_query($conn, "SELECT code,hotelnm FROM hotels  order by hotelnm ") or die(mysqli_error($conn));
                                    while ($thotl = mysqli_fetch_array($mhotl)) {
                                        echo "<option value='$thotl[code]'>$thotl[hotelnm]</option>";
                                    }
                                    ?>
                                </select>
                            </div>

                            <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Category</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-4 col-xs-4  pad">
                                <select name="hotelcatg" class="form-control form hotelcatg select2">
                                    <option value='<?php echo ($addflag != 1) ? $thotcatg['code'] : '' ?>'><?php echo ($addflag != 1) ? $thotcatg['name'] : '' ?></option>
                                    <?php
                                    $mhotl1 = mysqli_query($conn, "SELECT code, name FROM hotelcatg  order by name ") or die(mysqli_error($conn));
                                    while ($thotl1 = mysqli_fetch_array($mhotl1)) {
                                        echo "<option value='$thotl1[code]'>$thotl1[name]</option>";
                                    }
                                    ?>
                                </select>
                            </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">Agent/Supplier</label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-4 col-xs-4  pad">
                                <select name="agent" class="form-control form agent select2">
                                    <option value='<?php echo ($addflag != 1) ? $get['agent'] : '' ?>'><?php echo ($addflag != 1) ? $lagent['name'] : '' ?></option>
                                    <?php
                                    $maccm = mysqli_query($conn, "SELECT accode, name FROM accmast WHERE grpcode = '009' order by name  ") or die(mysqli_error($conn));
                                    while ($faccm = mysqli_fetch_array($maccm)) {
                                        echo "<option value='$faccm[accode]'>$faccm[name]</option>";
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>

                        <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="5%">Check In</th>
                                        <th width="5%">Check Out</th>
                                        <th width="7%" class='text-right'>No. Nights</th>
                                        <th width="15%">Room Category</th>
                                        <th width="7%">Type</th>
                                        <th width="5%" class='text-right'>Qty.</th>
                                        <th width="5%" class='text-right'>Rate</th>
                                        <th width="5%" class='text-right'>Amount</th>
                                        <th width="15%">Remarks</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)) {
                                            $mhotcatg = mysqli_query($conn, "SELECT code,name FROM roomcatg where code='$tran[roomcatg]'") or die(mysqli_error($conn));
                                            $thotcatg = mysqli_fetch_array($mhotcatg);

                                            $mrtype = mysqli_query($conn, "SELECT code,name FROM roomtype where code='$tran[roomtype]'") or die(mysqli_error($conn));
                                            $trtype = mysqli_fetch_array($mrtype);
                                            $mctr++;
                                            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><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='number' class='form-control form text-right nonights'        name='nonights_$ctr' value='$tran[nonights]'></td>";

                                            echo "<td>";
                                            echo "<select class='form-control form roomcatg select2' name='roomcatg_$ctr' style='width:100%'  required>";
                                            echo "<option value='$thotcatg[code]'>$thotcatg[name]</option>";
                                            $git = mysqli_query($conn, "SELECT `code`,`name` FROM `roomcatg` ORDER BY `name`") or die(mysqli_error($conn));
                                            while ($itm = mysqli_fetch_array($git)) {
                                                echo "<option value='$itm[code]'>$itm[name]</option>";
                                            }
                                            echo "</select>";
                                            echo "</td>";
                                            echo "<td>";
                                            echo "<select class='form-control form roomtype select2' name='roomtype_$ctr' style='width:100%'  required>";
                                            echo "<option value='$tran[roomtype]'>$trtype[name]</option>";
                                            $git2 = mysqli_query($conn, "SELECT `code`,`name` FROM `roomtype` ORDER BY `name`") or die(mysqli_error($conn));
                                            while ($itm2 = mysqli_fetch_array($git2)) {
                                                echo "<option value='$itm2[code]'>$itm2[name]</option>";
                                            }

                                            echo "</select>";
                                            echo "</td>";
                                            echo "<td><input type='text' class='form-control form text-right qty'    name='qty_$ctr'  value='$tran[qty]'></td>";
                                            echo "<td><input type='text' class='form-control form text-right rate'    name='rate_$ctr'  value='$tran[rate]'></td>";
                                            echo "<td><input type='text' class='form-control form text-right amount'  name='amount_$ctr'  value='$tran[amount]'readonly ></td>";
                                            echo "<td><input type='text' class='form-control form remarks'  name='remarks_$ctr'  value='$tran[remarks]' ></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><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='number' class='form-control form text-right nonights'        name='nonights_0' value='$tran[nonights]'></td>";

                                        echo "<td>";
                                        echo "<select class='form-control form roomcatg select2' name='roomcatg_$pctr' style='width:100%'  required>";
                                        echo "<option value=''></option>";
                                        $git = mysqli_query($conn, "SELECT `code`,`name` FROM `roomcatg` ORDER BY `name`") or die(mysqli_error($conn));
                                        while ($itm = mysqli_fetch_array($git)) {
                                            echo "<option value='$itm[code]'>$itm[name]</option>";
                                        }
                                        echo "</select>";
                                        echo "</td>";
                                        echo "<td>";
                                        echo "<select class='form-control form roomtype select2' name='roomtype_$pctr' style='width:100%'  required>";
                                        echo "<option value=''></option>";
                                        $git2 = mysqli_query($conn, "SELECT `code`,`name` FROM `roomtype` ORDER BY `name`") or die(mysqli_error($conn));
                                        while ($itm2 = mysqli_fetch_array($git2)) {
                                            echo "<option value='$itm2[code]'>$itm2[name]</option>";
                                        }

                                        echo "</select>";
                                        echo "</td>";

                                        echo "<td><input type='text' class='form-control form text-right qty'    name='qty_0'  value='0'></td>";
                                        echo "<td><input type='text' class='form-control form text-right rate'    name='rate_0'  value='0'></td>";
                                        echo "<td><input type='text' class='form-control form text-right amount'  name='amount_0'  value='0' readonly ></td>";
                                        echo "<td><input type='text' class='form-control form remarks'  name='remarks_0'  value='' ></td>";

                                        echo "</tr>";
                                    }
                                    $pctr++;
                                    ?>
                                <input type="hidden" id="items" name="items" value="<?php echo ($addflag != 1) ? $ctr : 1; ?>" />
                                </tbody>
                            </table>
                        </div>
                        <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 class="row">
                            <div class="col-lg-10 col-md-7 col-sm-8 col-xs-8 text-right pad">
                                <?php include("includes/buttons.php"); ?>
                            </div>
                        </div>

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

        </div>

    </form>
    <div class="modal fade itemModal" 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">
                    <input type="hidden" value="<?php // Echo $fseries                                                                                                                                
                                ?>" class="form-control series">
                    <input type="hidden" value="<?php echo $get['vouchno']; ?>" class="form-control vouchno">
                    <input type="hidden" value="<?php echo $file ?>" class="form-control file">
                    <div class="row">
                        <div class="col-lg-3">
                            <select class="form-control ifield">
                                <option value="1">Product Name</option>
                                <option value="2">Size</option>
                                <option value="3">Brand</option>
                                <option value="4">Quality</option>
                                <option value="5">Code</option>
                            </select>
                        </div>

                        <div class="col-lg-2">
                            <select class="form-control ioperator">
                                <option value=""></option>
                                <option value="%">Like</option>
                                <option value="=">Exactly</option>
                            </select>
                        </div>

                        <div class="col-lg-4">
                            <input type="text" value="" class="form-control isearch">
                        </div>

                        <div class="col-lg-3">
                            <input type="button" class="btn btn-primary iload" value="Search">
                        </div>

                    </div>

                    <div class="col-lg-12 iloader text-center">
                        <img src="images/search.gif" alt="loading">
                    </div>

                    <div class="col-lg-12 inoRecord text-center">
                        <h3>NO RECORDS FOUND</h3>
                    </div>

                    <div class="table-responsive" style="max-height: 400px;overflow: auto;">
                        <table id="" class="table table-striped table-condensed " width="100%">
                            <thead>
                                <tr class="mySearchTr">
                                    <th width="20%">Product Name</th>
                                    <th width="10%">Size</th>
                                    <th width="10%">Brand</th>
                                    <th width="10%">Quality</th>
                                    <th width="10%">Itemcode</th>
                                    <th width="10%">Stk.</th>
                                    <th width="10%">Prod Type</th>
                                </tr>
                            </thead>
                            <tbody class="iTbody">
                            </tbody>
                        </table>
                    </div>

                    <div class="row">
                        <div class="col-xs-12 text-right search-action-bar">
                            <input type="button" class="btn btn-primary iprevious" value="Previous">
                            <input type="button" class="btn btn-primary inext" value="Next">
                        </div>
                    </div>

                </div>
                <div class="modal-footer"></div>
            </div>
        </div>
    </div>
    <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">City</option>
                                <option value="4">Hotel Name</option>
                                <option value="5">Category</option>
                                <option value="6">Agent</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="">Sort By</option>
                                <option value="1">Voucher</option>
                                <option value="2">Date</option>
                                <option value="3">City</option>
                                <option value="4">Hotel Name</option>
                                <option value="5">Category</option>
                                <option value="6">Agent</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:10%">City</th>
                                    <th style="width:20%">Hotel Name</th>
                                    <th style="width:8%">Category</th>
                                    <th style="width:18%">Agent</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>