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

$admin = $_SESSION["admin_" . $dbname];
$dispyear = right(($_SESSION["zdbyear_" . $dbname]), 4);

//$zyear = right($zdb, 4);

$zStartDate = getzdates($dispyear, 'S');
$zEndDate = getzdates($dispyear, 'E');
//browse($zStartDate);
//browse($zEndDate);
?>
<!doctype html>
<html lang=''>
    <head>
        <meta charset='utf-8'>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="menu/styles.css">
        <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
        <script src="menu/script.js"></script>
        <title>SISWEB</title>
        <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>
        <link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
        <link type="text/css" rel="stylesheet" href="loading.css" />
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
        <script type="text/javascript" src="loading.js"></script>
        <script type="text/javascript">
            function ExampleView() {
                Loading(true);
                setTimeout(function () {
                    Loading(false);
                }, 4000);
            }

            function ExampleView2() {
                Loading("testLayer");
            }
        </script>
        <script type="text/javascript">

            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-36251023-1']);
            _gaq.push(['_setDomainName', 'jqueryscript.net']);
            _gaq.push(['_trackPageview']);

            (function () {
                var ga = document.createElement('script');
                ga.type = 'text/javascript';
                ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0];
                s.parentNode.insertBefore(ga, s);
            })();

        </script>

    </head>
    <body>
        <div class="row" style="background-color: #B76E79; color: #FFFFFF">
            <br><div class="col-md-8"><b style="font-size: 20px; padding-left: 20px; color: whitesmoke; padding-bottom: 15px; font-family: cipher-regular, helvetica ;">STOCK INVENTORY SYSTEM</b></div>
            <div class="row">
                <div class="col-md-4 ">
                    <font style="float: right; padding-right: 16px;"><?php echo $_SESSION["username_" . $dbname]; ?> | <a href="index.php" style="color: whitesmoke;">logout</a></font>
                </div>
            </div>
        </div>
        <div id='cssmenu'>
            <ul>
                <li class=''><a href='#'><span><b >Masters &nbsp;&nbsp;&nbsp;| </b></span></a> 
                    <ul>
                        <li><a href="?action=customer"><b>Customer</b></a></li>
                        <li><a href="?action=unit"><b>Unit</b></a></li>
                        <!--<li><a href="?action=transport"><b>Transporter</b></a></li>-->
                        <li><a href="?action=itemgroup"><b>Item Group</b></a></li>
                        <li><a href="?action=item"><b>Item</b></a></li>
                        <li><a href="?action=changecust"><b>Change of Customer Detail </b></a></li>
                    </ul>
                </li>
                <li class=''><a href='#'><span><b >Transaction&nbsp;&nbsp;&nbsp;| </b></span></a>
                    <ul>
                        <li><a href="?action=sale"><b>Invoice</b></a></li>
                        <li><a href="?action=crednote"><b>Invoice Return</b></a></li>

                    </ul>
                </li>                
                
                <li class=''><a href='#'><span><b >Registers &nbsp;&nbsp;&nbsp;| </b></span></a>
                    <ul>
                        <li><a href="#" onclick="window.open('slgstreg.php', 'popupwindow', 'height=600,width=970,left=20,top=20, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Invoice</b></a></li>
                        <li><a href="#" onclick="window.open('cdgstreg.php', 'popupwindow', 'height=600,width=970,left=20,top=20, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Invoice Return</b></a></li>
                        
                    </ul>
                </li>                

                <li class=''><a href='#'><span><b >Tools </b></span></a>
                    <ul>
                        <li><a href="http://kaameasy.com/sisweb/year.php"><b><i class="fa fa-calendar" aria-hidden="true"></i> Year Selection</b></a></li>
                        <li><a href="?action=backup"><b>Backup</b></a></li>  
                        <li><a href="?action=company"><b>Company</b></a></li>  
                        <li><a href="?action=user"><b>Create User</b></a></li>
                        <!--<li><a href="?action=yearend"><b>Year End</b></a></li>-->

                    </ul>
                </li>
                <li class="" style="float:right;"><a href='#'><span><b ><?php echo 'Financial Year :-' . $dispyear ?></b></span></a></li>

            </ul>

        </div>
        <div id="content" >
            <div class="outer"  style='width:100%;height: 3993px;'>
                <div class="inner" style='width:100%;height: 3993px;'>
                    <?php
                    $src = "";
                    $action = isset($_GET["action"]) ? $_GET["action"] : "";
                    switch ($action) {
                        case "customer";
                            $head = "";
                            $src = "customer.php?mode=last";
                            break;
                        case "itemgroup";
                            $head = "";
                            $src = "itemgrp.php?mode=last";
                            break;
                        case "item";
                            $head = "";
                            $src = "item.php?mode=last";
                            break;
                        case "unit";
                            $head = "";
                            $src = "unit.php?mode=last";
                            break;
                        case "changecust";
                            $head = "";
                            $src = "changecust.php?mode=last";
                            break;
                        
                        /* Masters Case End */

                        /* Transactions Case */
                        
                        case "sale";
                            $head = "";
                            $src = "salegst.php?mode=last";
                            break;

                        case "crednote";
                            $head = "";
                            $src = "credgst.php?mode=last";
                            break;

                        /* Transaction Case End */

                        
                        case "changepass";
                            $head = "";
                            $src = "changepass.php?mode=last";
                            break;

                        case "backup";
                            $head = "";
                            $src = "bck.php?mode=last";
                            break;

                        case "company";
                            $head = "";
                            $src = "company.php?vouchno=1";
                            break;

                        case "user";
                            $head = "";
                            $src = "user.php?mode=last";
                            break;

                        case "yearend";
                            $head = "";
                            $src = "yearend.php?mode=last";
                            break;

                        default :
                            $head = "";
                            $src = "default.php";
                    }
                    ?>
                    <h4><?php echo $head; ?></h4>
                        <!--<iframe src="<?php /* echo $src; */ ?>" width="1300" height="900" frameBorder="0"></iframe>-->
                    <iframe src="<?php echo $src; ?>"  style="width: 100%; height:100%;overflow-y: scroll"  frameBorder="0" scrolling="yes" frameBorder="0">
                    
                    </iframe>
                    
                </div>
                <!-- end .inner -->
            </div>
            <!-- end .outer -->
        </div>
        <!-- end #content -->



    </div>
    <!-- /#wrap -->

    <?php
    include 'includes/footer.php';
    ?>
</body>
</html>
