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

$formname = "Receipt Register - Residential";
$action = "recpreg_fr.php";

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

$zyear = right($zdb, 4);

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


//browse($zyear);
include("includes/linkshead.php");
?>
<script src="MyScript/monfromtodt.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">
                        </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="label-control ">Tenant</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <select name="tenant" class="form-control select2">
                                    <option value=""></option>
                                    <?php
                                    $gten = mysqli_query($conn, "SELECT accode,name FROM `accmast` WHERE `grpcode`='042' ORDER BY name")or die(mysqli_error($conn));
                                    while ($tenant = mysqli_fetch_array($gten)) {
                                        Echo "<option value='$tenant[accode]'>$tenant[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 ">From Date</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="date" class="form-control fdate" name="fdate" value="<? 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 ">To Date</label>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad">
                                <input type="date" class="form-control tdate" name="tdate" value="<? echo $mtodate; ?>" >
                            </div>
                        </div>
                        
<!--                        <div class="row">
                            <div class="col-lg-3 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Month No.</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pad">                            
                                <select name="monthno" class="form-control  monthno month pad select2">
                                    <option></option>
                                    <option value='01'>January</option>
                                    <option value='02'>February</option>
                                    <option value='03'>March</option>
                                    <option value='04'>April</option>
                                    <option value='05'>May</option>
                                    <option value='06'>June</option>
                                    <option value='07'>July</option>
                                    <option value='08'>August</option>
                                    <option value='09'>September</option>
                                    <option value='10'>October</option>
                                    <option value='11'>November</option>
                                    <option value='12'>December</option>
                                </select>
                                <input type="hidden" class="form-control fdate" name="fdate" value="<? echo $mfrdate; ?>" >
                                <input type="hidden" class="form-control tdate" name="tdate" value="<? echo $mtodate; ?>" >

                            </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 ">Floor Type</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pad">
                                <select name="floortype" class="form-control select2">
                                    <option value=""></option>
                                    <option value="G">Ground Floor</option>
                                    <option value="M">Mezzanine Floor</option>
                                    <option value="F">Floor</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 lblfloor">Flat No.</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad">                            
                                <input type="text" class="form-control alphanumeric flatno" name="flatno" >
                            </div>
                        </div>
<!--                        <div class="row">
                            <div class="col-lg-3 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                <label class="label-control marg">Receipt Type</label>
                            </div>
                            <div class="col-lg-3 col-md-2 col-sm-2 col-xs-2 pad">                            
                                <select name="recptype" class="form-control  recptype pad select2">
                                    <option value="">All</option>
                                    <option value='A'>Auto</option>
                                    <option value='M'>Manual</option>
                                </select>
                            </div>
                        </div>-->
                    </div>
                    <div class="panel-footer">
                        <div class="text-center pad">
                            <div class="panel-footer">
                                <?php include("includes/but_rep.php"); ?>
                            </div>
                        </div>                       
                    </div>
                </div>
            </div>
        </div>
    </form>
    <?php include("includes/linksfoot.php"); ?>
</body>
</html>
