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

$formname = "PARTY EXPENSE";
$action = "partyexp_fr.php";
$fuser = $_SESSION["usertype"];
$fseries = $_SESSION["series_" . $dbname];

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

$zyear = right($zdb, 4);
$mfrdate = getzdates($zyear, 'S');
$mtodate = getzdates($zyear, 'E');
$zroot = $_SESSION["zdir"];
//browsE($zroot);
$myyear = $_SESSION[$myyear];
mysqli_select_db($conn,$zdb);

include("includes/linkshead.php");
?>

</head>
<body>
    <form method='POST' action="<?= $action; ?>">
        <!-- Default box -->
        <div class="col-lg-6 col-md-62 col-sm-12 col-xs-12  pad">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title" style=""><?php Echo $formname; ?></h3>
                    <div class="actions pull-right">
                        <i class="fa fa-chevron-down"></i>
                        <i class="fa fa-times"></i>
                    </div>
                </div>
                <div class="panel-body">
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-4 col-xs-4 text-right pad">
                            <label class="label-control">Party</label>
                        </div>
                        <div class="col-lg-7 col-md-7 col-sm-8 col-xs-8 ">
                            <select name="party" class="form-control select2" autofocus >
                                <option></option>
                                <?php
                                $mown = mysqli_query($conn,"SELECT `name`,`accode` FROM `accmast` where grpcode = '009' 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 class="row">
                        <div class="col-lg-3 col-md-3 col-sm-4 col-xs-4 text-right pad">
                            <label class="label-control">Expense</label>
                        </div>
                        <div class="col-lg-7 col-md-7 col-sm-8 col-xs-8 ">
                            <select name="expense" class="form-control select2" >
                                <option></option>
                                <?php
                                $mexp = mysqli_query($conn,"SELECT `name`,`accode` FROM `accmast` where grpcode = '012' ORDER BY `name`") or die(mysqli_error($conn));
                                while ($texp = mysqli_fetch_array($mexp)) {
                                    echo "<option value=$texp[accode]>$texp[name]</option>";
                                }
                                ?>
                            </select>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-4 col-xs-4 text-right pad">
                            <label class="label-control">From Date</label>
                        </div>
                        <div class="col-lg-4 col-md-3 col-sm-8 col-xs-8 ">
                            <input type="date" class="form-control" name="fdate" value="<? echo $mfrdate; ?>" required >
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-4 col-xs-4 text-right pad">
                            <label class="label-control">To Date</label>
                        </div>
                        <div class="col-lg-4 col-md-3 col-sm-8 col-xs-8 ">
                            <input type="date" class="form-control" name="tdate" value="<? echo $mtodate; ?>" required >
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-4 col-xs-4 text-right pad">
                            <label class="label-control">Report Type</label>
                        </div>
                        <div class="col-lg-4 col-md-3 col-sm-8 col-xs-8 ">
                            <select name="dtype" class="form-control select2">
                                <option value="1">Summary</option>
                                <option value="2">Detail</option>
                            </select>
                        </div>
                    </div>
                </div>

                <div class="panel-footer text-center">
                    <?php include("includes/but_rep.php"); ?>
                </div>

            </div>
        </div>

    </form>
    <?php include("includes/linksfoot.php"); ?>
</body>
</html>
