<?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 = "Main Detail ";
$action = "maindtlrep_fr.php";

$myyear = $_SESSION[$myyear];
mysqli_select_db($conn, $zdb);

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

</head>

<body>
    <form method='POST' action="<?= $action; ?>">
        <!-- Default box -->

        <div class="col-lg-5 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">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">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">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>
                    <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">CR No.</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="crno" class="form-control crno">
                        </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">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">
                        </div>
                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Tour No.</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="tour" class="form-control tour">
                        </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-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="city" class="form-control city">
                        </div>
                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">State</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="state" class="form-control state">
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad" <?php if ($para != "") { ?> style="display:none" <?php } ?>>
                            <label class="label-control marg">Sex</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad" <?php if ($para != "") { ?> style="display:none" <?php } ?>>
                            <select class='form-control select2 sex' name='sex'>
                                <option value=""></option>
                                <option value='M'>Male</option>
                                <option value='F'>Female</option>
                            </select>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad" <?php if ($para == "") { ?> style="display:none" <?php } ?>>
                            <label class="label-control marg">Only Infant</label>
                        </div>
                        <div class="col-lg-1 col-md-5 col-sm-8 col-xs-8 pad" <?php if ($para == "") { ?> style="display:none" <?php } ?>>
                            <input type="checkbox" name="infant" value="1" class="form-control infant" style="width: 30px">
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad" <?php if ($para == "") { ?> style="display:none" <?php } ?>>
                            <label class="label-control marg">Only Cancelled</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad" <?php if ($para == "") { ?> style="display:none" <?php } ?>>
                            <input type="checkbox" name="cancelled" value="1" class="form-control cancelled" style="width: 30px">
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-7 col-md-3 col-sm-3 col-xs-3 text-right pad" <?php if ($para == "") { ?> style="display:none" <?php } ?>>
                            <label class="label-control marg">Print Address</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad" <?php if ($para == "") { ?> style="display:none" <?php } ?>>
                            <input type="checkbox" name="pradd" value="1" class="form-control pradd" style="width: 30px">
                        </div>
                    </div>
                    <hr>
                    <span style="text-align:center;color:blue;text-decoration:underline">
                        <h5>Passport Details</h5>
                    </span>
                    <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 No.</label>
                        </div>
                        <div class="col-lg-3 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="passno" class="form-control passno">
                        </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">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=""></option>
                                <?php
                                $getitem = mysqli_query($conn, "SELECT code, `name` FROM `product` ORDER BY `name`") or die(mysqli_error($conn));
                                while ($iget = mysqli_fetch_array($getitem)) {
                                    echo "<option value='$iget[code]'>$iget[name]</option>";
                                }
                                ?>
                            </select>
                        </div>
                        <div class="col-lg-3 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=""></option>
                                <?php
                                $getitem = mysqli_query($conn, "SELECT code, `name` FROM `product` ORDER BY `name`") or die(mysqli_error($conn));
                                while ($iget = mysqli_fetch_array($getitem)) {
                                    echo "<option value='$iget[code]'>$iget[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 ">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">
                            <input type="text" name="deppnr" class="form-control deppnr">
                        </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>
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad" <?php if ($para == "") { ?> style="display:none" <?php } ?>>
                            <label class="label-control marg">Print Regn. no</label>
                        </div>
                        <div class="col-lg-1 col-md-5 col-sm-8 col-xs-8 pad" <?php if ($para == "") { ?> style="display:none" <?php } ?>>
                            <input type="checkbox" name="prregno" value="1" class="form-control prregno" style="width: 30px">
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad" <?php if ($para == "") { ?> style="display:none" <?php } ?>>
                            <label class="label-control marg">Print Photo</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad" <?php if ($para == "") { ?> style="display:none" <?php } ?>>
                            <input type="checkbox" name="prphoto" value="1" class="form-control prphoto" style="width: 30px">
                        </div>
                    </div>
                    <hr>
                    <span style="text-align:center;color:red;text-decoration:underline">
                        <h5>Other Details</h5>
                    </span>
                    <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">
                            <input type="text" name="arrvpnr" class="form-control arrvpnr">
                        </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">Bus No</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="busno" class="form-control busno">
                        </div>
                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                            <label class="label-control marg">Room No</label>
                        </div>
                        <div class="col-lg-2 col-md-5 col-sm-8 col-xs-8 pad">
                            <input type="text" name="roomno" class="form-control roomno">
                        </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">Order By</label>
                        </div>
                        <div class="col-lg-3 col-md-5 col-sm-8 col-xs-8 pad">
                            <select class='form-control select2 sorton' name='sorton'>
                                <option value=""></option>
                                <?php
                                $getitem = mysqli_query($conn, "SELECT code, `name` FROM `product` ORDER BY `name`") or die(mysqli_error($conn));
                                while ($iget = mysqli_fetch_array($getitem)) {
                                    echo "<option value='$iget[code]'>$iget[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">From Date</label>
                        </div>
                        <div class="col-lg-3 col-md-2 col-sm-6 col-xs-6 pad">
                            <input type="date" id="mfrdt" name="frmdt" class="form-control" value="<?php echo $mfrdate; ?>" >   
                        </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">To Date</label>
                        </div>
                        <div class="col-lg-3 col-md-2 col-sm-8 col-xs-8 pad">
                            <input type="date" id="mtodt" name="todt" class="form-control" value="<?php echo $mtodate; ?>" > 
                        </div>
                    </div>
                </div>

                <div class="panel-footer">
                    <?php include("includes/but_rep.php"); ?>
                </div>
            </div>
        </div>
    </form>
    <?php include("includes/linksfoot.php"); ?>
</body>

</html>