<?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="https://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>-->
        <script src="myjs/jquery-latest.min.js" type="text/javascript"></script>
        <script src="menu/script.js"></script>
        <title>LOMINO</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="myjs/jquery_js.css" rel="stylesheet" type="text/css">
        <!--<link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">-->
        <!--<link type="text/css" rel="stylesheet" href="loading.css" />-->
        <link type="text/css" rel="stylesheet" href="https://loading.io/css/" />
        <!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>-->
        <script src="myjs/jquery_min_js.js"></script>
        <script type="text/javascript" src="loading.js"></script>
        <script type="text/javascript">
            function ExampleView() {
                Loading(true);
                setTimeout(function () {
                    Loading(false);
                }, 3000);
            }

            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' : 'https://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: #5f2b54; 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>
                    <!--<img src="images/deenmenu.png" alt="deeniyat" style="height: 40px;width: 161px; float: right; padding-right: 10%; padding-bottom: 16px;"/>-->
                </div>
            </div>
        </div>
        <div id='cssmenu'>
            <ul>
                <!--<a href='menu.php' style="float: left;"><img src="images/deen.png" alt="deeniyat" style="height: 30px;"/></a>&nbsp;&nbsp;-->
                <li class=''><a href='#'><span><b >Masters &nbsp;&nbsp;&nbsp;| </b></span></a> 
                    <ul>
<!--                        <li class='has-sub'><a href='#'><span>Product 1</span></a>
                                                    <ul>
                                                        <li><a href='#'><span>Sub Product</span></a></li>
                                                        <li class='last'><a href='#'><span>Sub Product</span></a></li>
                                                    </ul>
                        </li>-->
                        <li><a href="?action=customer"><b>Customer</b></a></li>
                        <li><a href="?action=supplier"><b>Supplier</b></a></li>
                        <li><a href="?action=karigar"><b>Karigar</b></a></li>
                        <li><a href="?action=staff"><b>Staff</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=godown"><b>Godown</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=openstock"><b>Item Opening Stock</b></a></li>

                        <!--                        <li style="border-top: 1px solid black;"><a href="?action=rawmatgrp"><b>Raw Material Group</b></a></li>
                                                <li><a href="?action=rawmat"><b>Raw Material</b></a></li>
                                                <li><a href="?action=openrawmat"><b>Raw Material Opening Stock</b></a></li>
                                                <li><a href="?action=openbal"><b>Opening Balance</b></a></li>-->
                        <li><a href="?action=changecust"><b>Change of Customer Detail </b></a></li>


                        <li><a href="?action=bank"><b>Bank</b></a></li>
                        <li><a href="?action=cash"><b>Cash</b></a></li>
                        <li><a href="?action=expense"><b>Expense</b></a></li>

                        <!--                        <li><a href="?action=zimm">Zimmedar Type</a></li>
                                                <li><a href="?action=qabil">Qabiliyat Type</a></li>-->
                    </ul>
                </li>
                <li class=''><a href='#'><span><b >Transaction&nbsp;&nbsp;&nbsp;| </b></span></a>
                    <ul>
                        <li><a href="?action=purchase"><b>Purchase</b></a></li>
                        <li><a href="?action=debnote"><b>Purchase Return</b></a></li>
                        <li><a href="?action=sale"><b>Sale</b></a></li>
                        <li><a href="?action=crednote"><b>Sale Return</b></a></li>
                        <li><a href="?action=damaged"><b>Damage</b></a></li>
                        <li><a href="?action=excess"><b>Excess</b></a></li>

                        <!--                        <li style="border-top: 1px solid black;"><a href="?action=purraw"><b>Purchase Raw Materials</b></a></li>
                                                <li><a href="?action=purrawret"><b>Purchase Return - Raw Material</b></a></li>
                                                <li><a href="?action=outraw"><b>Given to Karigar</b></a></li>
                                                <li><a href="?action=salerawret"><b>Return from Karigar - Raw Material</b></a></li>-->
                        <!--<li><a href="?action=inwraw"><b>Return from Karigar - Finished Goods</b></a></li>-->
                        <li><a href="?action=bankrecp"><b>Bank Receipt</b></a></li>
                        <li><a href="?action=bankpay"><b>Bank Payment</b></a></li>
                        <li><a href="?action=cashrecp"><b>Cash Receipt</b></a></li>
                        <li><a href="?action=cashpay"><b>Cash Payment</b></a></li>
                        <li><a href="?action=contra"><b>Contra / Transfer</b></a></li>

                        <li><a href="?action=salevat"><b>Tax Invoice</b></a></li>
                        <li><a href="?action=bankreco"><b>Bank Reconciliation</b></a></li>
                    </ul>
                </li>                
                <li class=''><a href='#'><span><b >Reports &nbsp;&nbsp;&nbsp;| </b></span></a>
                    <ul>
                        <li><a href="#" onclick="window.open('stock.php', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Stock (Item)</b></a></li>
                        <!--<li><a href="#" onclick="window.open('stockrw.php', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Stock (Raw Materials)</b></a></li>-->
                        <li><a href="#" onclick="window.open('ledger.php', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Ledger</b></a></li>
                        <li><a href="#" onclick="window.open('itemwise_sale.php', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Itemwise Sale</b></a></li>
                        <li><a href="#" onclick="window.open('itemgrp_sale.php', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Item Groupwise Sale</b></a></li>
                        <li><a href="#" onclick="window.open('partgrp_sale.php', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Partywise Item Group Sale</b></a></li>
                        <li><a href="#" onclick="window.open('dailyreport.php', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Daily Reports</b></a></li>
                        <li><a href="#" onclick="window.open('pricelist.php', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Price list </b></a></li>
                        <li><a href="#" onclick="window.open('labels.php?para=1', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Labels-Customer</b></a></li>
                        <li><a href="#" onclick="window.open('labels.php?para=2', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Labels-Supplier</b></a></li>
                        <li><a href="#" onclick="window.open('bankbook.php?para=B', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Bank Book </b></a></li>
                        <li><a href="#" onclick="window.open('bankbook.php?para=C', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Cash Book </b></a></li>
                        <li><a href="#" onclick="window.open('subj.php', 'popUpWindow', 'height=600,width=1200, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Bank Reconciliation </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('purreg.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>Purchase </b></a></li>
                        <li><a href="#" onclick="window.open('debreg.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>Purchase Return</b></a></li>                                
                        <li><a href="#" onclick="window.open('salreg.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>Sale</b></a></li>
                        <li><a href="#" onclick="window.open('credreg.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>Sale Return</b></a></li>
                        <li><a href="#" onclick="window.open('damreg.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>Damage</b></a></li>
                        <li><a href="#" onclick="window.open('excessreg.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>Excess</b></a></li>
                        <li><a href="#" onclick="window.open('salvatreg.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>Tax Invoice</b></a></li><hr>
                        <!--                        <li><a href="#" onclick="window.open('purrawreg.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>Purchase Raw Material</b></a></li>
                                                <li><a href="#" onclick="window.open('purrawretreg.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>Purchase Return Raw-Material</b></a></li>
                                                <li><a href="#" onclick="window.open('outrawreg.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>Given To Karigar</b></a></li>
                                                <li><a href="#" onclick="window.open('outrawretreg.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>Return From Karigar</b></a></li>
                                                <li><a href="#" onclick="window.open('outrawfinreg.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>Karigar Finshed Goods</b></a></li>-->
                    </ul>
                </li>                
<!--                <li class=''><a href='#'><span><b >Create User &nbsp;&nbsp;&nbsp;| </b></span></a>
                    <ul>
                        <li><a href="#" onclick="window.open('admin.php?mode=last', 'popUpWindow', 'height=600,width=970,left=20,top=20, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Create Admin User</b></a></li>
                        <li><a href="#" onclick="window.open('normal.php?mode=last', 'popupwindow', 'height=600,width=970,left=20,top=20, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Create Normal User</b></a></li>                                
                        <li><a href="#" onclick="window.open('niguser.php?mode=last', 'popupwindow', 'height=600,width=970,left=20,top=20, resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');"><b>Create Nigran User</b></a></li>                                

                    </ul>
                </li>                -->
                <li class=''><a href='#'><span><b >Tools </b></span></a>
                    <ul>
                        <!--<li><a href="?action=user"><b>Password Maintenance</b></a></li>-->
                        <li><a href="http://apps2ai.com/lomino/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=company"><b>Year Creation</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 "supplier";
                            $head = "";
                            $src = "supplier.php?mode=last";
                            break;
                        case "karigar";
                            $head = "";
                            $src = "karigar.php?mode=last";
                            break;
                        case "itemgroup";
                            $head = "";
                            $src = "itemgrp.php?mode=last";
                            break;
                        case "item";
                            $head = "";
                            $src = "item.php?mode=last";
                            break;
                        case "rawmatgrp";
                            $head = "";
                            $src = "rawmatgrp.php?mode=last";
                            break;
                        case "rawmat";
                            $head = "";
                            $src = "rawmat.php?mode=last";
                            break;
                        case "openrawmat";
                            $head = "";
                            $src = "openrawmat.php?mode=last";
                            break;
                        case "staff";
                            $head = "";
                            $src = "staff.php?mode=last";
                            break;
                        case "unit";
                            $head = "";
                            $src = "unit.php?mode=last";
                            break;
                        case "transport";
                            $head = "";
                            $src = "transporter.php?mode=last";
                            break;
                        case "changecust";
                            $head = "";
                            $src = "changecust.php?mode=last";
                            break;
                        case "openstock";
                            $head = "";
                            $src = "openstock.php?mode=last";
                            break;
                        case "godown";
                            $head = "";
                            $src = "godown.php?mode=last";
                            break;
                        case "openbal";
                            $head = "";
                            $src = "openbal.php?mode=last";
                            break;
                        case "expense";
                            $head = "";
                            $src = "expense.php?mode=last";
                            break;
                        case "cash";
                            $head = "";
                            $src = "cash.php?mode=last";
                            break;
                        case "bank";
                            $head = "";
                            $src = "bank.php?mode=last";
                            break;

                        /* Masters Case End */


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

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

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

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

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

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

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

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

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

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

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

                        case "outraw";
                            $head = "";
                            $src = "outraw.php?mode=last";
                            break;
                        /* Transaction Case End */

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

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

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

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

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

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

                        case "bankreco";
                            $head = "";
                            $src = "bankreco.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>
