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

$formname = "Ageing";
$action = "ageingamt_fr.php";

$maindb = "accmast";
$ztit = $_SESSION["tit_" . $dbname];
$zroot = $_SESSION["zdir"];

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

$zyear = right($zdb, 4);
$mfrdate = getzdates($zyear, 'S');
$mtodate = getzdates($zyear, 'E');
//browse($mfrdate);
$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-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">Company</label>
                        </div>

                        <div class="col-lg-6 col-md-5 col-sm-5 col-xs-5 compdiv pad">
                            <select class="select2 " id="company" name="company[]" multiple autofocus  aria-required="true" style="width: 100%">
                                <?php
                                $gsales1 = mysqli_query($conn, "SELECT `code`, `compname` FROM $zroot.`company` ORDER BY compname") or die(mysqli_error($conn));

                                while ($sales1 = mysqli_fetch_array($gsales1)) {
                                    Echo "<option selected  value='$sales1[code]'>$sales1[compname]</option>";
                                }
                                ?>
                            </select>
                        </div>
                    </div>-->
                    <div class='row'>
                        <div class="col-lg-3 col-md-4 col-sm-3 col-xs-3 text-right">
                            <label class='label-control tmarg'></label>
                        </div>
                        <div class="col-lg-9 col-md-8 col-sm-8 col-xs-8">
                            <p style="color: red; font-size: 14px;">Note: (Press Enter to Select Multiple Customers)</p>
                        </div> 
                    </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">Customer</label>
                        </div>
                        <div class="col-lg-6 col-md-5 col-sm-5 col-xs-5 pad">
                            <select name="customer" class="form-control select2">
                                <option value=""></option>
                                <?php
                                $gcust = mysqli_query($conn, "SELECT `accode`,`name` FROM `accmast` WHERE `grpcode`='010' order by name")or die(mysqli_error($conn));
                                while ($cust = mysqli_fetch_array($gcust)) {
                                    Echo "<option value='$cust[accode]'>$cust[name]</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">Salesman</label>
                        </div>
                        <div class="col-lg-6 col-md-5 col-sm-5 col-xs-5 pad">
                            <select name="salesman" class="form-control select2">
                                <option value=""></option>
                                <?php
//                                $gcust2 = mysqli_query($conn, "SELECT salesman FROM `$maindb` WHERE `grpcode`='010' group by salesman order by salesman")or die(mysqli_error($conn));
//                                while ($cust2 = mysqli_fetch_array($gcust2)) {
//                                    Echo "<option value='$cust2[salesman]'>$cust2[salesman]</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">Volume Type</label>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad">
                            <select name="partytype" class="form-control ">
                                <option value=""></option>
                                <option value="R">Retailer</option>
                                <option value="W">Wholesaler</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">Date</label>
                        </div>
                        <div class="col-lg-6 col-md-5 col-sm-5 col-xs-5 pad">
                            <input type="date" id="invdt" name="tdate" class="form-control" value="<?php echo date("Y-m-d"); ?>" />
                        </div>
                    </div>
                </div>
                <div class="panel-footer">
                    <div style="overflow: auto; ">
                        <table class="table-condensed" style="margin: 0 auto;">
                            <tr>
                                <td class=" buttonform tooltip-bottom" id="sexcel" style="display: <? Echo $savedisabled ?>" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Excel">
                                    <button id='excel' type='submit' name='excel' class="btn btn-pad btn-square" style="background-color:#34a853; ">
                                        <i class="fa fa-file-excel-o" style="color:#ffffff; font-size: 19px;" title="Excel"></i>
                                    </button>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>                       
        </div>
    </div>

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