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

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

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

$formname = "Karigar Register";
$action = "outrawreg_fr.php";
mysqli_select_db($conn, $zdb);
?>
<?php 
include("includes/files.php");
include ('includes/combo2.php');
?>
    <form class="form-horizontal" action='<?= $action ?>' method='POST'>
        <div class="row">
            <div class="col-lg-12">
                <div class="box">
                    <header>
                        <div class="icons">
                            <i class="fa fa-edit"></i>
                        </div>
                        <h5><?= $formname ?></h5>
                        <div class="toolbar">
                            <ul class="nav pull-right">
                                <li>
                                    <input type='submit' id="excel" name='export' class='btn btn-primary' value='Export to Excel'>
                                    <input type='submit' id="view" name='view' class='btn btn-success' value='View'>                                    
                                </li>
                                <li>
                                    <a class="minimize-box" data-toggle="collapse" href="#div-4">
                                        <i class="fa fa-chevron-up"></i>
                                    </a>
                                </li>
                            </ul>
                        </div><!-- /.toolbar -->
                    </header>
                    <div id="div-4" class="accordion-body collapse in body">
                        <div class="form-group">
                            <label class="control-label col-lg-3">Karigar</label>
                            <div class="col-lg-8">
                                <div class="input-group">
                                    <select id="party" name="cmbparty" class="form-control " style='height:33px;' >
                                        <option value="<?php echo ($addflag != 1) ? $getp['accode'] : " "; ?>"><?php echo ($addflag != 1) ? $getp['name'] : " "; ?></option>
                                        <?php
                                        $mown = mysqli_query($conn, "SELECT accode, `name` FROM `accmast` WHERE grpcode='006' ORDER BY name") or die(mysqli_error($conn));
                                        while ($trow = mysqli_fetch_array($mown)) {
                                            echo "<option value=$trow[accode]>$trow[name]</option>";
                                        }
                                        ?>
                                    </select> 

                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-lg-3">From Date</label>
                            <div class="col-lg-5">
                                <div class="input-group">
                                    <input type="date" id="mfrdt" name="frmdt" class="form-control" value="<?php echo $mfrdate; ?>" />  
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-lg-3">To Date</label>
                            <div class="col-lg-5">
                                <div class="input-group">
                                    <input type="date" id="mtodt" name="todt" class="form-control" value="<?php echo $mtodate; ?>" />  
                                </div>
                            </div>
                        </div>
<!--                        <div class="form-group">
                            <label class="control-label col-lg-3">Type</label>
                            <div class="col-lg-5">
                                <div class="input-group">
                                    <select name="mtype" class="form-control" style="height:33px;width:297px;">
                                        <option value="">All</option>
                                        <option value="0">Credit</option>
                                        <option value="1">Cash</option>
                                    </select>
                                </div>
                            </div>
                        </div>-->
                        <div class="form-group">
                            <label class="control-label col-lg-3">Report Type</label>
                            <div class="col-lg-5">
                                <div class="input-group">
                                    <select name="dtype" class="form-control" style="height:33px;width:297px;">
                                        <option value="1">Summary</option>
                                        <option value="2">Detail</option>
                                    </select>
                                </div>
                            </div>
                        </div>
<!--                        <div class="form-group">
                            <label class="control-label col-lg-3">Print Zero Balance</label>
                            <div class="col-lg-5">
                                <div class="input-group">
                                    <select name="prinzero" class="form-control" style="height:33px;width:297px;">
                                        <option value="2">No</option>
                                        <option value="1">Yes</option>
                                    </select>
                                </div>
                            </div>
                        </div>-->


                    </div>
                </div>
            </div>
        </div>
    </form>