<?php
ob_start();
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');
$formname = "Jobwork Balance";
$action = "jobpend_rep_fr.php";
$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$zyear = right($zdb, 4);
$mfrdate = getzdates($zyear, 'S');
$mnewdate = date('Y-m-d', strtotime($mfrdate . ' - 1 days'));


$mtodate = getzdates($zyear, 'E');
mysqli_select_db($conn, $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-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>
                    <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">Product</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pad">
                                <select class=' party form-control select2' name='prod'>
                                    <option value=>
                                        <?php
                                        $gprod = mysqli_query($conn, "SELECT `code`,`name` FROM `item` ORDER BY name")or die(mysqli_error($conn));
                                        while ($fprod = mysqli_fetch_array($gprod)) {
                                            Echo "<option value='$fprod[code]'>$fprod[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">Size</label>
                            </div>
                            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pad">
                                <select class=' party form-control select2' name='size'>
                                    <option value=>
                                        <?php
                                        $gsize= mysqli_query($conn, "SELECT `size` FROM `prodsize` group by `size` order by `size`")or die(mysqli_error($conn));
                                        while ($fsize = mysqli_fetch_array($gsize)) {
                                            Echo "<option value='$fsize[size]'>$fsize[size]</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">From Date</label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="date" id="mfrdt" name="frmdt" class="form-control" value="<?php echo $mnewdate; ?>" /> 
                            </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">To Date</label>
                            </div>
                            <div class="col-lg-4 col-md-3 col-sm-3 col-xs-3 pad">
                                <input type="date" id="mtodt" name="todt" class="form-control" value="<?php Echo $mtodate; ?>" /> 
                            </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>
