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

$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
if ($_GET["para"] == "R") {
    $formname = " Outstanding Receiveable";
    $action = "osbill_fr.php";
    $hgrp = "R";
    $group = "010";
} else {
    $formname = " Outstanding Payable";
    $action = "osbill_fr.php";
    $group = "009";
    $hgrp = "P";
}
include("includes/linkshead.php");
?>
<style>
    .align{
        margin-left: -15px;
    }
</style>
</head>
<body>
    <div class="panel panel-widget forms-panel my-div fiftyperc width col-lg-6" >
        <div class="forms">
            <div class="form-grids widget-shadow" data-example-id="basic-forms"> 
                <div class="form-title">
                    <h4><?php echo $formname ?> </h4>
                </div>
                <form name="salereg" class="validation" action="<?= $action ?>" method="post">
                    <div class="row">
                        <div class="form-body">
                            <div class="row">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">A/C Name</label>
                                    <div class="col-sm-9">
                                        <div class="col-sm-12 align">
                                            <select class='form-control select2' name='acname' style="height:33px;">
                                                <option value=""></option>
                                                <?php
                                                $macc = mysqli_query($conn, "SELECT accode, `name` FROM `accmast`WHERE $group ORDER BY `name`") or die(mysqli_error($conn));
                                                while ($trow = mysqli_fetch_array($macc)) {
                                                    echo "<option value='$trow[accode]'>$trow[name]</option>";
                                                }
                                                ?>
                                            </select>
                                        </div>
                                    </div>
                                </div>                            
                            </div>
                            <div class="row">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">From Date</label>
                                    <div class="col-sm-9">
                                        <div class="col-sm-6 align">
                                            <input type="date" id="frmdt" name="frmdt" class="form-control" style='height:33px;' value="<?php echo date("Y-m-d"); ?>" />  
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">    
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Report Type</label>
                                    <div class="col-sm-9">
                                        <div class="col-sm-3 align">
                                            <select name="dtype" class="form-control" style="height:33px;width:190px;">
                                                <option value="1">Summary</option>
                                                <option value="2">Detail</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"></label>
                                    <div class="col-sm-9">
                                        <div class="col-sm-3 align">
                                            <input type="hidden" name="hiddenval" class="form-control" value="<?= $hgrp ?>">
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                    <div class="row">
                        <?php include("includes/but_rep.php"); ?>
                    </div>
                </form> 
            </div>
        </div>
    </div>            
    <!--//grids-->
    <!--<script type="text/javascript">
    
        $(document).ready(function(){
        $('.date').mask('00/00/0000');
                $('.time').mask('00:00:00');
                $('.date_time').mask('00/00/0000 00:00:00');
                $('.cep').mask('00000-000');
                $('.mobile').mask('0000-0000');
                $('.phone_with_ddd').mask('(00) 0000-0000');
                $('.phone_us').mask('(000) 000-0000');
                $('.mixed').mask('AAA 000-S0S');
                $('.cpf').mask('000.000.000-00', {reverse: true});
                $('.money').mask('000.000.000.000.000,00', {reverse: true});
                $('.money2').mask("#.##0,00", {reverse: true});
                $('.ip_address').mask('0ZZ.0ZZ.0ZZ.0ZZ', {
        translation: {
        'Z': {
        pattern: /[0-9]/, optional: true
        }
        }
        });
                $('.ip_address').mask('099.099.099.099');
                $('.percent').mask('##0,00%', {reverse: true});
                $('.clear-if-not-match').mask("00/00/0000", {clearIfNotMatch: true});
                $('.placeholder').mask("00/00/0000", {placeholder: "__/__/____"});
                $('.fallback').mask("00r00r0000", {
        translation: {
        'r': {
        pattern: /[\/]/,
                fallback: '/'
        },
                placeholder: "__/__/____"
        }
        });
                $('.selectonfocus').mask("00/00/0000", {selectOnFocus: true});
                );
    </script>-->
    <!--//validator js-->
    <?php
    include("includes/linksfoot.php");
    ?>
</body>
</html>
