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

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

$zyear = right($zdb, 4);
$mfrdate = getzdates($zyear, 'S');
$mtodate = getzdates($zyear, 'E');

$para = $_GET['para'];

$formname = "Data To Excel";
$action = "dataxl_fr.php";
$tourcode = $_SESSION['tourcode'];
$tourname = $_SESSION['tourname'];
$myyear = $_SESSION[$myyear];
mysqli_select_db($conn, $zdb);

include("includes/linkshead.php");
?>
</head>

<body>
    <form method='POST' action="<?= $action; ?>">
        <div class="col-lg-8 col-md-12 col-sm-12 col-xs-12  pad">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><?php echo $formname; ?></h3>
                </div>
                <div class="panel-body">

                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Tour</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <select class="form-control select2 tour" name="tour" required>
                                <option value="<?=$tourcode?>"><?=$tourname?></option>
                                <?php
//                                $gettour = mysqli_query($conn, "SELECT code,name FROM tour order by name") or die(mysqli_error($conn));
//                                while ($fettour = mysqli_fetch_array($gettour)) {
//                                    echo "<option value='$fettour[code]'>$fettour[name]</option>";
//                                }
                                ?>
                            </select>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Name</label>
                        </div>
                        <div class="col-lg-6 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="name" class="form-control name" autofocus="autofocus">
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg" style="color: #2FBFFD;">Regn. No.</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="regnno" class="form-control regnno">
                        </div>
                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg" style="color: #2FBFFD;">Pax. No.</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="paxno" class="form-control paxno">
                        </div>
                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg" style="color: blue;">Only Infant</label>
                        </div>
                        <div class="col-lg-1 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="checkbox" name="inf" value="1" class="form-control inf" style="width: 30px">
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Group</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="group" class="form-control group">
                        </div>
                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Class</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <!--<input type="text" name="class" class="form-control class">-->
                            <select name="class[]" class="form-control class select2" style="width:100%" multiple>
                                <option value=""></option>
                                <?php
                                $mgrp = mysqli_query($conn, "SELECT distinct(`batchno`) FROM bookform where batchno != '' AND tourno = '$tourcode' ") or die(mysqli_error($conn));
                                while ($tgrp = mysqli_fetch_array($mgrp)) {
                                    echo "<option value='$tgrp[batchno]'>$tgrp[batchno]</option>";
                                }
                                ?>
                            </select>
                        </div>
                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg" style="color: red;">Only Cancelled</label>
                        </div>
                        <div class="col-lg-1 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="checkbox" name="canc" value="1" class="form-control canc" style="width: 30px">
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg"></label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                        </div>

                        <!--                        <div class="col-lg-6 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg" style="color: green;">Print Photo</label>
                        </div>
                        <div class="col-lg-1 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="checkbox" name="prphoto" value="1" class="form-control prphoto" style="width: 30px">
                        </div>-->


                    </div>

                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">City</label>
                        </div>
                        <div class="col-lg-4 col-md-5 col-sm-8 col-xs-8 pad">
                            <select name="city" class="form-control city select2" style="width:100%">
                                <option value=""></option>
                                <?php
                                $mcity = mysqli_query($conn, "SELECT distinct(`city`) FROM bookform where haji != ''") or die(mysqli_error($conn));
                                while ($tcity = mysqli_fetch_array($mcity)) {
                                    echo "<option value='$tcity[city]'>$tcity[city]</option>";
                                }
                                ?>
                            </select>
                            <!-- <input type="text" name="city" class="form-control city"> -->
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">State</label>
                        </div>
                        <div class="col-lg-4 col-md-5 col-sm-8 col-xs-8 pad">
                            <select name="state" class="form-control state select2" style="width:100%">
                                <option value=""></option>
                                <?php
                                $mown4 = mysqli_query($conn, "SELECT `code`, `name` FROM `state` ORDER BY name") or die(mysqli_error($conn));
                                while ($trow4 = mysqli_fetch_array($mown4)) {
                                    echo "<option value='$trow4[name]'>$trow4[name]</option>";
                                }
                                ?>
                            </select>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Sex</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <select class='form-control select2 sex' name='sex'>
                                <option value=""></option>
                                <option value='M'>Male</option>
                                <option value='F'>Female</option>
                            </select>
                        </div>
                    </div>

                    <br>
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Passport Expiry In</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <select class='form-control select2 ppexpiry' name='ppexpiry'>
                                <option value="99">All</option>
                                <option value="1">1 Month</option>
                                <option value="2">2 Month</option>
                                <option value="3">3 Month</option>
                                <option value="4">4 Month</option>
                                <option value="5">5 Month</option>
                                <option value="6">6 Month</option>
                            </select>
                        </div>
                        <!--                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Passport In Hand</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <select class='form-control select2 ppinhand' name='ppinhand'>
                                <option value="0">Both</option>
                                <option value="1">Yes</option>
                                <option value="2">No</option>
                            </select>
                        </div>-->
                    </div>
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control ">Dep. Date</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="date" id="depdate" name="depdate" class="form-control depdate" />
                        </div>
                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Dep. PNR</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <select class='form-control select2 deppnr' name='deppnr'>
                                <option value="A">All</option>
                                <option value="P">Pending</option>
                            </select>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Airlines/Carrier</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="airlines" class="form-control airlines">
                        </div>
                    </div>
                    <br>
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Agent Name</label>
                        </div>
                        <div class="col-lg-6 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="agent" class="form-control agent">
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control ">Arrival Date</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="date" id="arrvdate" name="arrvdate" class="form-control arrvdate" />
                        </div>
                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Arrival PNR</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <select class='form-control select2 arrvpnr' name='arrvpnr'>
                                <option value="A">All</option>
                                <option value="P">Pending</option>
                            </select>
                        </div>
                    </div>
                </div>

                <div class="panel-footer">
                    <?php //include("includes/but_rep.php"); 
                    ?>
                    <div style="overflow: auto; ">
                        <table class="table-condensed" style="margin: 0 auto;">
                            <tr>
                                <td class=" buttonform tooltip-bottom" id="sexcel" style="display: <? echo $exceldisabled ?>" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Excel">
                                    <button id='excel' type='submit' name='excel' class="btn btn-pad btn-square" style="background-color:#34a853; ">
                                        <i class="fa fa-file-excel-o" style="color:#ffffff;" title="Excel"></i>
                                    </button>
                                </td>
                                <!-- <td class=" buttonform tooltip-bottom" id="ssubmit" style="display: <? echo $savedisabled ?>" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="View">
                <button id='view' type='submit' formtarget="_blank" name='view' class="btn btn-pad btn-square" style="background-color:#05B2EA; ">
                    <i class="fa fa-desktop" style="color:#ffffff"></i>
                </button>
            </td> -->
                                <!--            <td class=" buttonform tooltip-bottom" id="ssubmit" style="display: <? echo $savedisabled ?>" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="View Chart">
                <button id='graph' type='submit' formtarget="_blank" name='graph' class="btn btn-pad btn-square" style="background-color:red; ">
                    <i class="fa fa-download" style="color:#ffffff"></i>
                </button>
            </td>-->
                                <td class=" buttonform tooltip-bottom" id="scancel" style="display: <? echo $canceldisabled ?>" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Close">
                                    <button id='cancel' type="reset" class="btn btn-pad btn-square " style="background-color:red;" onClick="window.location.href = '<?= 'default.php' ?>'">
                                        <i class="fa fa-power-off" style="color:#ffffff"></i>
                                    </button>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <?php include("includes/linksfoot.php"); ?>
</body>

</html>