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

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

$formname = "Category-Wise Total";
$action = "repcat_lst.php";
mysqli_select_db($conn, $zdb);

include("includes/files.php");
?>
<!-- Select2 Combo -->

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/select2/3.5.0/select2.min.css" />
<!-- CSS to make Select2 fit in with Bootstrap 3.x -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/select2/3.5.0/select2-bootstrap.min.css" />
<!-- Include Select2 JS -->
<script src="//cdnjs.cloudflare.com/ajax/libs/select2/3.5.0/select2.min.js"></script>
<script>
    $(function () {
        // turn the element to select2 select style
        $('select').select2();
    });

</script>

<body>
    <form method="POST" action='<?php echo  $action; ?>' name="centre" >
        <div class="row" style="">
            <div class="col-lg-6" style=''>
                <div class="box dark">
                    <header>
                        <div class="icons"><i class="fa fa-edit"></i></div>
                        <h5 style="font-family: cipher-regular,helvetica;;"><?= $formname ?></h5>
                        <!-- .toolbar -->
                        <div class="toolbar">
                            <ul class="nav">
                                <li>
                                    <a class="accordion-toggle minimize-box" data-toggle="collapse" href="#div-1">
                                        <i class="fa fa-chevron-up"></i>
                                    </a>
                                </li>
                            </ul>
                        </div>
                        <button class="btn btn-danger" Onclick="JavaScript:window.close()" name="exit" value="Exit" style="float: right; height: 40px;">Exit</button>
                        <button class="btn btn-success" type="submit" name="submit" value="View" style="float: right; height: 40px;">View</button>
                        <!-- /.toolbar -->
                    </header>
                    <div id="div-1" class="accordion-body collapse in body" >
                        <div class="form-horizontal">
                            <div class="form-group">
                                <label class="control-label col-lg-4" style="width: 150px;font-family: cipher-regular,helvetica;;"> Country </label>
                                <div class="col-lg-8"> 
                                    <select name="cmbcount" id="cmbcount" class="form-control " style="font-size:14px; height: 33px;">
                                        <option value=""></option>
                                        <?php
                                        $result = mysqli_query($conn, "SELECT code, `name` FROM country ORDER BY `name`") or die(mysqli_error($conn));
                                        while ($coun = mysqli_fetch_array($result)) {
                                            echo "<option value='$coun[code]'>$coun[name]</option>";
                                        }
                                        ?>
                                    </select>
                                </div> 
                            </div>
                            <div class="form-group">
                                <label class="control-label col-lg-4" style="width: 150px;font-family: cipher-regular,helvetica;;"> State </label>
                                <div class="col-lg-8"> 
                                    <select name="cmbstate" id="cmbstate" class="form-control " style="font-size:14px; height: 33px;" >
                                        <option value=""></option>
                                        <?php
                                        $result = mysqli_query($conn, "SELECT code, `name` FROM state ORDER BY `name`") or die(mysqli_error($conn));
                                        while ($coun = mysqli_fetch_array($result)) {
                                            echo "<option value='$coun[code]'>$coun[name]</option>";
                                        }
                                        ?>
                                    </select>
                                </div> 
                            </div>
                            <div class="form-group">
                                <label class="control-label col-lg-4" style="width: 150px;font-family: cipher-regular,helvetica;;"> District </label>
                                <div class="col-lg-8"> 
                                    <select name="cmbdist" id="cmbdist" class="form-control " style="font-size:14px; height: 33px;" >
                                        <option value=""></option>
                                        <?php
                                        $result = mysqli_query($conn, "SELECT code, `name` FROM district ORDER BY `name`") or die(mysqli_error($conn));
                                        while ($coun = mysqli_fetch_array($result)) {
                                            echo "<option value='$coun[code]'>$coun[name]</option>";
                                        }
                                        ?>
                                    </select>
                                </div> 
                            </div>
                            <div class="form-group">
                                <label class="control-label col-lg-4" style="width: 150px;font-family: cipher-regular,helvetica;;"> Tehsil </label>
                                <div class="col-lg-8"> 
                                    <select name="cmbtehsil" id="cmbteh" class="form-control " style="font-size:14px; height: 33px;" >
                                        <option value=""></option>
                                        <?php
                                        $result = mysqli_query($conn, "SELECT code, `name` FROM tehsil ORDER BY `name`") or die(mysqli_error($conn));
                                        while ($coun = mysqli_fetch_array($result)) {
                                            echo "<option value='$coun[code]'>$coun[name]</option>";
                                        }
                                        ?>
                                    </select>
                                </div> 
                            </div>
                            <div class="form-group">
                                <label class="control-label col-lg-4" style="width: 150px; font-family: cipher-regular,helvetica;;"> City </label>
                                <div class="col-lg-8"> 
                                    <select name="cmbcity" id="cmbcity" class="form-control " style="font-size:14px; height: 33px;" >
                                        <option value=""></option>
                                        <?php
                                        $result = mysqli_query($conn, "SELECT code, `name` FROM city ORDER BY `name`") or die(mysqli_error($conn));
                                        while ($coun = mysqli_fetch_array($result)) {
                                            echo "<option value='$coun[code]'>$coun[name]</option>";
                                        }
                                        ?>
                                    </select>
                                </div> 
                            </div> 
                            <div class="form-group">
                                <label class="control-label col-lg-4" style="width: 150px; font-family: cipher-regular,helvetica;;"> Category </label>
                                <div class="col-lg-8"> 
                                    <select name="cmbcity" id="cmbcat" class="form-control " style="font-size:14px; height: 33px;" >
                                        <option value=""></option>
                                        <?php
                                        $result = mysqli_query($conn, "SELECT code, `name` FROM category ORDER BY `name`") or die(mysqli_error($conn));
                                        while ($coun = mysqli_fetch_array($result)) {
                                            echo "<option value='$coun[code]'>$coun[name]</option>";
                                        }
                                        ?>
                                    </select>
                                </div> 
                            </div> 
                        </div>   
                    </div> 
                </div> 
            </div> 
        </div>

    </form>

    <script>
        $(function () {
            formGeneral();
        });
    </script>
</body>
</html>