<?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 = "Order Query";
$action = "ordquery_fr.php";
mysqli_select_db($conn, $zdb);
?>

<!DOCTYPE HTML>
<html lang="en-US">

    <head>
        <meta charset="UTF-8">
        <title><?= $formname ?></title>
        <meta name="msapplication-TileColor" content="#5bc0de"/>
        <meta name="msapplication-TileImage" content="assets/img/metis-tile.png"/>

        <link rel="stylesheet" href="assets/lib/bootstrap/css/bootstrap.css">
        <link rel="stylesheet" href="assets/css/main.css"/>
        <link rel="stylesheet" href="assets/lib/Font-Awesome/css/font-awesome.css"/>

        <link rel="stylesheet" href="assets/css/theme.css">


        <link rel="stylesheet" href="assets/lib/uniform/themes/default/css/uniform.default.css">
        <link rel="stylesheet" href="assets/lib/inputlimiter/jquery.inputlimiter.1.0.css">
        <link rel="stylesheet" href="assets/lib/chosen/chosen.min.css">
        <link rel="stylesheet" href="assets/lib/colorpicker/css/colorpicker.css">
        <link rel="stylesheet" href="assets/lib/tagsinput/jquery.tagsinput.css">
        <link rel="stylesheet" href="assets/lib/daterangepicker/daterangepicker-bs3.css">
        <link rel="stylesheet" href="assets/lib/datepicker/css/datepicker.css">
        <link rel="stylesheet" href="assets/lib/timepicker/css/bootstrap-timepicker.min.css">
        <link rel="stylesheet" href="assets/lib/switch/static/stylesheets/bootstrap-switch.css">
        <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/flick/jquery-ui.css">


        <script>
            (function(i, s, o, g, r, a, m) {
                i['GoogleAnalyticsObject'] = r;
                i[r] = i[r] || function() {
                    (i[r].q = i[r].q || []).push(arguments)
                }, i[r].l = 1 * new Date();
                a = s.createElement(o),
                        m = s.getElementsByTagName(o)[0];
                a.async = 1;
                a.src = g;
                m.parentNode.insertBefore(a, m)
            })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

            ga('create', 'UA-1669764-16', 'onokumus.com');
            ga('send', 'pageview');

        </script>
        <script type="text/javascript" src="js/jquery.js"></script>
        <script type="text/javascript">
            $(document).keydown(function(event) {
                //19 for Mac Command+S
                if (!(String.fromCharCode(event.which).toLowerCase() == 'v' && event.ctrlKey) && !(event.which == 19))
                    return true;
                $("#view").click();
                event.preventDefault();
                return false;
            });

        </script>        

        <script src="assets/lib/modernizr-build.min.js"></script>
        <script type="text/javascript" src="../js/jquery.js"></script>
        <style type="text/css">
                 table { page-break-inside:auto }
                 tr    { page-break-inside:avoid; page-break-after:auto }
                 thead { display:table-header-group }
                 tfoot { display:table-footer-group }
            </style>

            <style>
                .break { page-break-before: always; }
            </style>
    <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 id="submit" type='submit' name='view' value='View' class="btn btn-primary">
                                </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">Company</label>
                            <div class="col-lg-5">
                                <div class="input-group">
                                    <select class='form-control' name='company' style="width:297px;height:33px;">
                                        <option value=""></option>
                                        <?php
                                        $mown3 = mysqli_query($conn, "SELECT compname FROM `branch` ORDER BY `compname`") or die(mysqli_error($conn));
                                        while ($trow3 = mysqli_fetch_array($mown3)) {
                                            echo "<option value='$trow3[cono]'>$trow3[compname]</option>";
                                        }
                                        ?>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-lg-3">Party</label>
                            <div class="col-lg-5">
                                <div class="input-group">
                                    <select class='form-control' name='name' style="width:297px;height:33px;">
                                        <option value=""></option>
                                        <?php
                                        $mown = mysqli_query($conn, "SELECT accode, `name` 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>
                        <div class="form-group">
                            <label class="control-label col-lg-3">Item</label>
                            <div class="col-lg-5">
                                <div class="input-group">
                                    <input type="text" size="40" name="item" class="form-control" style="height:33px;" />                      
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-lg-3">Quantity</label>
                            <div class="col-lg-5">
                                <div class="input-group">
                                    <input type="text" size="40" name="qty" class="form-control" value="0" style="width:100px;text-align: right;" />                      
                                </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="frmdt" 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="todt" name="todt" class="form-control" value="<?php echo $mtodate; ?>" />  
                                </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:180px;">
                                        <option value="1">Summary</option>
                                        <option value="2">Detail</option>
                                    </select>
                                </div>
                            </div>
                        </div>-->
                    </div>
                </div>
            </div>
        </div>
    </form>
</html> 
    