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

$formname = "REVENUE";
$action = "revenuereg_fr.php";

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

$zyear = right($zdb, 4);

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

$myyear = $_SESSION[$myyear];
$zroot = $_SESSION["zdbroot"];

include("includes/linkshead.php");
?>
</head>
<body>
    <form method='POST' action="<?= $action; ?>">
        <!-- Default box -->
        <div>
            <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-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Pax Name</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control " name="name" >
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Surname</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control " name="surname" >
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">From Haji No.</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control " name="fromhaji" >
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">To Haji No.</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control " name="tohaji" >
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">From Pax No.</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control " name="frompax" >
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">To Pax No.</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control " name="topax" >
                            </div>
                        </div>
                        <div class="row">
                           <div class="col-lg-2 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-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control " name="passno" >
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">District</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class=' party form-control select2' name='district'>
                                    <option value=>
                                        <?php
                                        $getdis = mysql_query("SELECT DISTINCT `district` FROM `pax` ORDER BY `district` ") or die(mysql_error());
                                        while ($getdis2 = mysql_fetch_assoc($getdis)) {
                                            Echo "<option value='$getdis2[district]'>$getdis2[district]</option>";
                                        }
                                        ?>
                                    </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">State</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class=' party form-control select2' name='state'>
                                    <option value=>
                                        <?php
                                        $getsta = mysql_query("SELECT DISTINCT `state` FROM `pax` ORDER BY `state` ") or die(mysql_error());
                                        while ($fetsta = mysql_fetch_assoc($getsta)) {
                                            Echo "<option value='$fetsta[state]'>$fetsta[state]</option>";
                                        }
                                        ?>
                                    </option>

                                </select>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">For</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class=' party form-control select2' name='for'>
                                    <option value=>
                                        <?php
                                        $getfor = mysql_query("SELECT `name` FROM $zroot.`vistingfor`") or die(mysql_error());
                                        while ($getfor2 = mysql_fetch_assoc($getfor)) {
                                            Echo "<option value='$getfor2[name]'>$getfor2[name]</option>";
                                        }
                                        ?>
                                    </option>

                                </select>
                            </div>
                        </div> 
                        <div class="row">
                            <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-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control " name="class" >
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Batch</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="text" class="form-control " name="batch" >
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Airline</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class=' party form-control select2' name='airline'>
                                    <option value=>
                                        <?php
                                        $getair = mysql_query("SELECT DISTINCT `airline_code` FROM `airline_detail`") or die(mysql_error());
                                        while ($fetair = mysql_fetch_assoc($getair)) {
                                            Echo "<option value='$fetair[airline_code]'>$fetair[airline_code]</option>";
                                        }
                                        ?>
                                    </option>

                                </select>
                            </div>
                        </div> 
                        <div class="row">
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">B/J Date</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class=' party form-control select2' name='bjdate'>
                                    <option value=>
                                        <?php
                                        $getbjd = mysql_query("SELECT  DATE_FORMAT(`dept_date`, '%d-%m-%Y') AS dept_date FROM `airline_detail` WHERE srno = 1
                                                               group by dept_date ORDER BY `dept_date` ") or die(mysql_error());
                                        while ($fetbjd = mysql_fetch_assoc($getbjd)) {
                                            Echo "<option value='$fetbjd[dept_date]'>$fetbjd[dept_date]</option>";
                                        }
                                        ?>
                                    </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">J/B Date</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class=' party form-control select2' name='jbdate'>
                                    <option value=>
                                        <?php
                                        $getjbd = mysql_query("SELECT DATE_FORMAT(`dept_date`, '%d-%m-%Y') AS dept_date FROM `airline_detail`
                                                               WHERE srno = 2 group by dept_date ORDER BY `dept_date` ") or die(mysql_error());
                                        while ($fetjbd = mysql_fetch_assoc($getjbd)) {
                                            Echo "<option value='$fetjbd[dept_date]'>$fetjbd[dept_date]</option>";
                                        }
                                        ?>
                                    </option>

                                </select>
                            </div>
                        </div>
                         <div class="row">
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Sister's Concern</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class=' party form-control select2' name='siscono'>
                                    <option value=>
                                        <?php
                                        $getsis = mysql_query("SELECT `siscono`, `name` FROM $zroot.`sisterconcern` ORDER BY `name` ") or die(mysql_error());
                                        while ($fetsis = mysql_fetch_assoc($getsis)) {
                                            Echo "<option value='$fetsis[siscono]'>$fetsis[name]</option>";
                                        }
                                        ?>
                                    </option>

                                </select>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Agent</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class=' party form-control select2' name='agent'>
                                    <option value=>
                                        <?php
                                        $getage = mysql_query("SELECT DISTINCT `agent` FROM `pax` ORDER BY `agent` ") or die(mysql_error());
                                        while ($fetage = mysql_fetch_assoc($getage)) {
                                            Echo "<option value='$fetage[agent]'>$fetage[agent]</option>";
                                        }
                                        ?>
                                    </option>

                                </select>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="label-control marg">Sort By</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class=' party form-control select2' name='sortby'>
                                    <option value=''>Both</option>
                                    <option value='1'>Pax No</option>
                                    <option value='2'>Haji No</option>

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