<?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 = "History Of Engine";
mysqli_select_db($conn, $zdb);

//$para = $_GET["para"];
//if ($para == "F") {
//    $action = 'datawisestk_fr.php';
//}else{
//    $action = 'datawisestk_fr.php';
//}

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

?>
<!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="../../library/assets/lib/bootstrap/css/bootstrap.css">
        <link rel="stylesheet" href="../../library/assets/css/main.css"/>
        <link rel="stylesheet" href="../../library/assets/lib/Font-Awesome/css/font-awesome.css"/>

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


        <link rel="stylesheet" href="../../library/assets/lib/uniform/themes/default/css/uniform.default.css">
        <link rel="stylesheet" href="../../library/assets/lib/inputlimiter/jquery.inputlimiter.1.0.css">
        <link rel="stylesheet" href="../../library/assets/lib/chosen/chosen.min.css">
        <link rel="stylesheet" href="../../library/assets/lib/colorpicker/css/colorpicker.css">
        <link rel="stylesheet" href="../../library/assets/lib/tagsinput/jquery.tagsinput.css">
        <link rel="stylesheet" href="../../library/assets/lib/daterangepicker/daterangepicker-bs3.css">
        <link rel="stylesheet" href="../../library/assets/lib/datepicker/css/datepicker.css">
        <link rel="stylesheet" href="../../library/assets/lib/timepicker/css/bootstrap-timepicker.min.css">
        <link rel="stylesheet" href="../../library/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="../../library/assets/lib/modernizr-build.min.js"></script>
        <script type="text/javascript" src="../js/jquery.js"></script>

    <form class="form-horizontal" action='histengine_fr.php' 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">Barcode</label>
                            <div class="col-lg-5">
                                <div class="input-group">
                                    <input type="text" size="40" name="barcode" class="form-control" />                      
                                </div>
                            </div>
                        </div>  -->
                        <div class="form-group">
                            <label class="control-label col-lg-3">Engine</label>
                            <div class="col-lg-5">
                                <div class="input-group">
                                    <select class='form-control' name='engine' style="width:297px;height:33px;">
                                        <option value=""></option>
                                        <?php
                                        $mown = mysqli_query($conn, "SELECT code, `name` FROM `engine` ORDER BY `name`") or die(mysqli_error($conn));
                                        while ($trow = mysqli_fetch_array($mown)) {
                                            echo "<option value='$trow[code]'>$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 date("Y-m-d"); ?>" />  
                          </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 date("Y-m-d"); ?>" />  
                          </div>
                        </div>
                      </div>
                        <?php

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