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

ini_set('display_errors', 1);
error_reporting(E_ERROR);

$formname = "Salary Process -  Monthwise";
$action = "salproc.php";
$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];

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

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

include("includes/linkshead.php");
?>
<script src="MyScript/salpd_sc.js?a=<?= mt_rand() ?>" type="text/javascript"></script>

</head>
<body>
    <form method='POST' action="<?= $action; ?>">
        <!-- Default box -->
        <div>
            <div class="col-lg-6 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">Employee</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class=' party form-control select2 empname' name="cmbemp">
                                    <option value="">
                                        <?php
                                        $getcust = mysqli_query($conn, "SELECT accode,  name FROM `accmast` where grpcode = '040' AND active = '1'  ORDER BY name")or die(mysqli_error($conn));
                                        while ($fetcust = mysqli_fetch_array($getcust)) {
                                            Echo "<option value='$fetcust[accode]'>$fetcust[name]</option>";
                                        }
                                        ?>
                                    </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">Department</label>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pad">
                                <select class=' party form-control select2 depart dept' name="cmbdept" required>
                                    <option value= "">
                                        <?php
                                        $getcust2 = mysqli_query($conn, "SELECT code,  name FROM `dept` ORDER BY name")or die(mysqli_error($conn));
                                        while ($fetcust2 = mysqli_fetch_array($getcust2)) {
                                            Echo "<option value='$fetcust2[code]'>$fetcust2[name]</option>";
                                        }
                                        ?>
                                    </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">Month</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6 pad">
                                <select  class="form-control  select2 mon monname" required name="month">
                                    <option value="1">January</option>
                                    <option value="2">February</option>
                                    <option value="3">March</option>
                                    <option value="4">April</option>
                                    <option value="5">May</option>
                                    <option value="6">June</option>
                                    <option value="7">July</option>
                                    <option value="8">August</option>
                                    <option value="9">September</option>
                                    <option value="10">October</option>
                                    <option value="11">November</option>
                                    <option value="12">December</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">Year No.</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-3 col-xs-3 pad">
                                <input type="text" name="yearno" class="form-control yearno" value="<?= date("Y") ?>" required>
                            </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">Processing Date</label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="date" name="procdt" class="form-control procdt" value=""> 
                            </div>
                        </div>
                    </div>

                    <div class="panel-footer text-center pad">
                        <input type="submit" name="process" class=" cmdproc btn btn-primary" value="Proceed" >
                    </div>
                </div>
            </div>
        </div>
    </form>
    <?php include("includes/linksfoot.php"); ?>
</body>
</html>
