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

$maindb = 'visamain';
$trandb = 'visatran';
$formname = "Immigration List";
$action = "immigration_fr.php";
$file = "submission_sc.php";

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$zyear = right($zdb, 4);

$mfrdate = getzdates($zyear, 'S');
$mtodate = getzdates($zyear, 'E');
$myyear = $_SESSION[$myyear];
mysqli_select_db($conn, $zdb);

include("includes/linkshead.php");
?>
<script src="MyScript/item.js" type="text/javascript"></script>
</head>
<body>
    <form method='POST' action="<?= $action; ?>">
        <!-- Default box -->
        <div>
            <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 class="actions pull-right">
                            <i class="fa fa-chevron-down"></i>
                            <i class="fa fa-times"></i>
                        </div>
                    </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="control-label marg">Immigration From</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-8 col-xs-8 pad">
                                <input type="date" size="80" name="frmdate" value="<?php echo "$mfrdate"; ?>" required class="form-control"/>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="control-label marg">Immigration To</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-8 col-xs-8 pad">
                                <input type="date" size="80" name="todate" value="<?php echo "$mtodate"; ?>" required class="form-control"/>
                            </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">File No</label>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-8 col-xs-8 pad">
                                <input type="text" name="manualno" class="form-control " >
                            </div>
                        </div>-->
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="control-label marg">Visa Type</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-8 col-xs-8 pad">
                                <select id="cmbtype" name="visatype" class="form-control select2">
                                    <option></option>   
                                    <option value="W">Work</option>
                                    <option value="F">Family</option>
                                    <option value="R">Residency</option>
                                    <option value="V">Visit</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">Visa No</label>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-8 col-xs-8 pad">
                                <input type="text" name="visano" class="form-control "  >
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Passport</label>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="text" name="passport" class="form-control " >
                            </div>
                        </div>-->
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="control-label marg">Agent </label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-8 col-xs-8 pad">
                                <select id="cmbtype" name="agent" class="form-control select2">
                                    <option></option>   
                                    <?php
                                    $atype = mysqli_query($conn, "SELECT `broker` FROM `visamain` group by broker order by broker") or die(mysqli_error($conn));
                                    while ($getatype = mysqli_fetch_array($atype)) {
                                        echo "<option value='$getatype[broker]'>$getatype[broker]</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="control-label marg">Candidate Name</label>
                            </div>
                            <div class="col-lg-5 col-md-5 col-sm-8 col-xs-8 pad">
                                <input type="text" name="partyname" class="form-control " >
                            </div>
                        </div>              
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="control-label marg">Sponsor Name</label>
                            </div>
                            <div class="col-lg-5 col-md-5 col-sm-8 col-xs-8 pad">
                                <input type="text" name="sponser" class="form-control " >
                            </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">Contact No</label>
                            </div>
                            <div class="col-lg-5 col-md-5 col-sm-8 col-xs-8 pad">
                                <input type="text" name="contact" class="form-control number" >
                            </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">Mobile</label>
                            </div>
                            <div class="col-lg-5 col-md-5 col-sm-8 col-xs-8 pad">
                                <input type="text" name="mobile" class="form-control number" >
                            </div>
                        </div>-->
<!--                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                <label class="control-label marg">Report Type</label>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-8 col-xs-8 pad">
                                <select id="cmbtype" name="dtype" class="form-control select2">
                                    <option value="1">Summary</option>   
                                    <option value="2">Detail</option>   
                                </select>
                            </div>
                        </div>-->

                        <div class="panel-footer">
                            <?php include("includes/but_rep.php"); ?>
                            <script>
                                $("#subpdf").hide();
//                                $("#excel").hide();
                            </script>
                        </div>
                        <!--</div>-->
                    </div>
                </div>
            </div>
        </div>
    </form>
    <?php include("includes/linksfoot.php"); ?>
</body>
</html>
