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

include("includes/menu_rights.php");

$project_title = "KHOJATI HERBAL";
$admin = $_SESSION["admin_" . $dbname];
$usertype = $_SESSION["usertype"];
$src = "";
$action = isset($_GET["action"]) ? $_GET["action"] : "";
$dispyear = right(($_SESSION["zdbyear_" . $dbname]), 4);

switch ($action) {
    ####################### PROFILES ##########################

    case "profile";
        $head = "Create User";
        $src = '';
        if ($guser[usertype] == 1) {
            $src = "user.php?mode=last";
        } else {
            $src = "user2.php?mode=last";
        }
        break;

    ####################### MASTERS ##########################
    case "customer";
        if ($guser[customer] == '') {
            $src = "";
        } else {
            $src = "customer.php?mode=last";
        }
        break;

    case "supplier";
        if ($guser[supplier] == '') {
            $src = "";
        } else {
            $src = "supplier.php?mode=last";
        }
        break;

    case "state";
//        if ($guser[state] == '') {
//            $src = "";
//        } else {
        $src = "state.php?mode=last";
//        }
        break;

    case "itemgrp";
        if ($guser[itemgrp] == '') {
            $src = "";
        } else {
            $src = "itemgrp.php?mode=last";
        }
        break;

    case "item";
        if ($guser[item] == '') {
            $src = "";
        } else {
            $src = "item.php?mode=last";
        }
        break;

    case "chcustdtl";
        if ($guser[item] == '') {
            $src = "";
        } else {
            $src = "chcustdtls.php?mode=last";
        }
        break;

    case "otherac";

        $src = "otherac.php?mode=last";

        break;

    case "staff";
        if ($guser[staff] == '') {
            $src = "";
        } else {
            $src = "staff.php?mode=last";
        }
        break;

    case "drawbank";
        if ($guser[staff] == '') {
            $src = "";
        } else {
            $src = "drawbank.php?mode=last";
        }
        break;

    case "godown";

        $src = "godown.php?mode=last";

        break;

    case "openbal";
        if ($guser[openbal] == '') {
            $src = "";
        } else {
            $src = "openbal.php?mode=last&form=openbal";
        }
        break;

    case "openrate";
        if ($guser[openrate] == '') {
            $src = "";
        } else {
            $src = "openrate.php?mode=last&form=openstock";
        }
        break;


    case "bank";
        if ($guser[bank] == '') {
            $src = "";
        } else {
            $src = "bank.php?mode=last";
        }
        break;

    case "cash";
        if ($guser[cash] == '') {
            $src = "";
        } else {
            $src = "cash.php?mode=last";
        }
        break;

    case "expense";
        if ($guser[expense] == '') {
            $src = "";
        } else {
            $src = "expense.php?mode=last";
        }
        break;

    case "other";
        if ($guser[otherac] == '') {
            $src = "";
        } else {
            $src = "otherac.php?mode=last";
        }
        break;

    case "group";
        if ($guser[group] == '') {
            $src = "";
        } else {
            $src = "group.php?mode=last";
        }
        break;

    case "colour";
        if ($guser[group] == '') {
            $src = "";
        } else {
            $src = "colour.php?mode=last";
        }
        break;

    case "narration";
        if ($guser[group] == '') {
            $src = "";
        } else {
            $src = "narration.php?mode=last";
        }
        break;

    case "gsttype";
        if ($guser[gsttype] == '') {
            $src = "";
        } else {
            $src = "gsttype.php?mode=last&para=gsttype";
        }
        break;

    case "transport";
        if ($guser[transport] == '') {
            $src = "";
        } else {
            $src = "transport.php?mode=last";
        }
        break;

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

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

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

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


    case "courier";
        if ($guser[courier] == '') {
            $src = "";
        } else {
            $src = "courier.php?mode=last";
        }
        break;


    case "unit";
        if ($guser[unit] == '') {
            $src = "";
        } else {
            $src = "unit.php?mode=last";
        }
        break;

    case "changeofrates";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "changeRate.php";
//        }
        break;

    ####################### TRADING INVENTARY ##########################

    case "tiinward";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "inward.php?mode=last";
//        }
        break;

    case "openstock";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "openstk_prod.php?mode=last";
//        }
        break;

    case "tidamage";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "damaged.php?mode=last";
//        }
        break;

    case "tisale";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "sale_ti.php?mode=last";
//        }
        break;

    case "ticrednote";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "crednote.php?mode=last&credtype=G";
//        }
        break;

    case "ticredoth";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "credoth.php?mode=last&credtype=O";
//        }
        break;

    case "transfer";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "transfer.php?mode=last";
//        }
        break;

    case "dismantle";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "dismantle.php?mode=last";
//        }
        break;

    ####################### MANUFACTURING INVENTARY ##########################

    case "production";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "production.php?mode=last";
//        }
        break;

    case "damrawmat";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "damaged_mi.php?mode=last";
//        }
        break;

    case "purchaser_mi";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "purchase_mi.php?mode=last&type=R";
//        }
        break;

    case "purchasep_mi";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "purchase_mi.php?mode=last&type=P";
//        }
        break;

    case "changerate_item";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "changeRate_item.php?mode=last";
//        }
        break;

    case "openstock_item";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "openstk_item.php?mode=last";
//        }
        break;

    case "openpack";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "openstk_pack.php?mode=last";
//        }
        break;

    case "packgrp";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "packgrp.php?mode=last";
//        }
        break;

    case "packing";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "packing.php?mode=last";
//        }
        break;

    case "finprod";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "finprod.php?mode=last";
//        }
        break;

    case "debnote_mi";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "debnote_mi.php?mode=last&credtype=G";
//        }
        break;

    case "deboth_mi";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "deboth_mi.php?mode=last";
//        }
        break;

    case "exinward";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "inwardexp.php?mode=last";
//        }
        break;

    case "purrawreg";
        if ($guser[purrawreg] == '') {
            $src = "";
        } else {
            $src = "purrawreg.php?mode=last";
        }
        break;

    case "purretreg";
//        if ($guser[purretreg] == '') {
//            $src = "";
//        } else {
            $src = "purretreg.php?mode=last";
//        }
        break;

    case "prodreg";
//        if ($guser[purretreg] == '') {
//            $src = "";
//        } else {
            $src = "prodreg.php?mode=last";
//        }
        break;

    ####################### EXPORT INVENTARY ##########################

    case "exsale";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "sale_ex.php?mode=last";
//        }
        break;

    case "exinward";
//        if ($guser[changeofrates] == '') {
//            $src = "";
//        } else {
        $src = "inwardexp.php?mode=last";
//        }
        break;
    case "proforma";
//        if ($guser[performa] == '') {
//            $src = "";
//        } else {
        $src = "proforma.php?mode=last&form=6";
        //}
        break;
    case "exinvoice";
//        if ($guser[performa] == '') {
//            $src = "";
//        } else {
        $src = "invoexp.php?mode=last&form=6";
        //}
        break;

    ####################### TRANSACTIONS ##########################

    case "salea";
        if ($guser[salea] == '') {
            $src = "";
        } else {
            $src = "sale.php?mode=last&form=6";
        }
        break;


    case "saleb";
        if ($guser[saleb] == '') {
            $src = "";
        } else {
            $src = "sale.php?mode=last&form=13.5";
        }
        break;

    case "spare5";
        if ($guser[salespa] == '') {
            $src = "";
        } else {
            $src = "salespare.php?mode=last&form=6";
        }
        break;

    case "spare12";
        if ($guser[salespb] == '') {
            $src = "";
        } else {
            $src = "salespare.php?mode=last&form=13.5";
        }
        break;

    case "midelv";
        if ($guser[midelv] == '') {
            $src = "";
        } else {
            $src = "midelv.php?mode=last";
        }
        break;

    case "salegst";
        if ($guser[salegst] == '') {
            $src = "";
        } else {
            $src = "salegst.php?mode=last&form=6";
        }
        break;

    case "salegstdtl";
        if ($guser[salegst] == '') {
            $src = "";
        } else {
            $src = "salegst_dtl.php?mode=last";
        }
        break;


    case "purchase";
        if ($guser[purchase] == '') {
            $src = "";
        } else {
            $src = "purchase.php?mode=last";
        }
        break;

    case "purchasegst";
        if ($guser[purchase] == '') {
            $src = "";
        } else {
            $src = "purchasegst.php?mode=last";
        }
        break;

    case "inward";
        if ($guser[inward] == '') {
            $src = "";
        } else {
            $src = "inward.php?mode=last";
        }
        break;

    case "outward";
        if ($guser[outward] == '') {
            $src = "";
        } else {
            $src = "outward.php?mode=last";
        }
        break;

    case "damage";
        if ($guser[damage] == '') {
            $src = "";
        } else {
            $src = "damaged.php?mode=last";
        }
        break;

    case "order";
        if ($guser[ordform] == '') {
            $src = "";
        } else {
            $src = "ordform.php?mode=last";
        }
        break;

    case "debnotegr";
        if ($guser[debnotegr] == '') {
            $src = "";
        } else {
            $src = "debnote.php?mode=last&form=debnote&type=G";
        }
        break;

    case "debnoteoth";
        if ($guser[debnoteoth] == '') {
            $src = "";
        } else {
            $src = "debnote.php?mode=last&form=debnote&type=O";
        }
        break;

    case "crednotegr";
        if ($guser[crednotegr] == '') {
            $src = "";
        } else {
            $src = "crednote.php?mode=last&form=crednote&type=G";
        }
        break;

    case "crednoteoth";
        if ($guser[crednoteoth] == '') {
            $src = "";
        } else {
            $src = "crednote.php?mode=last&form=crednote&type=O";
        }
        break;

    case "creditnote";
        if ($guser[creditnote] == '') {
            $src = "";
        } else {
            $src = "creditnote.php?mode=last&form=creditnote&type=G";
        }
        break;

    case "credoth";
        if ($guser[credoth] == '') {
            $src = "";
        } else {
            $src = "creditnote.php?mode=last&form=creditnote&type=O";
        }
        break;

    case "bankrecp";
        if ($guser[bankrecp] == '') {
            $src = "";
        } else {
            $src = "bankrecp.php?mode=last";
        }
        break;

    case "cashrecp";
        if ($guser[cashrecp] == '') {
            $src = "";
        } else {
            $src = "cashrecp.php?mode=last";
        }
        break;


    case "bankpay";
        if ($guser[bankpay] == '') {
            $src = "";
        } else {
            $src = "bankpay.php?mode=last";
        }
        break;


    case "cashpay";
        if ($guser[cashpay] == '') {
            $src = "";
        } else {
            $src = "cashpay.php?mode=last";
        }
        break;

    case "contra";
        if ($guser[contra] == '') {
            $src = "";
        } else {
            $src = "contra.php?mode=last";
        }
        break;

    case "journal";
        if ($guser[journal] == '') {
            $src = "";
        } else {
            $src = "jv.php?mode=last";
        }
        break;

    case "discrecd";
        if ($guser[discrecev] == '') {
            $src = "";
        } else {
            $src = "discrecd.php?mode=last";
        }
        break;

    case "discgiven";
        if ($guser[discrecev] == '') {
            $src = "";
        } else {
            $src = "discgiven.php?mode=last";
        }
        break;

    case "prevbill";
        if ($guser[prevbill] == '') {
            $src = "";
        } else {
            $src = "prevbill.php?mode=last";
        }
        break;

    ####################### REPORTS ##########################

    case "withmrp";
        if ($guser[bpmrp] == '') {
            $src = "";
        } else {
            $src = "barcodelbl.php?report=withmrp";
        }
        break;

    case "purchsumm";
        if ($guser[purchsumm] == '') {
            $src = "";
        } else {
            $src = "purchsumm.php";
        }
        break;


    case "salesumm";
        if ($guser[salesumm] == '') {
            $src = "";
        } else {
            $src = "salesumm.php";
        }
        break;


    case "dailysalsumm";
        if ($guser[dailysalsumm] == '') {
            $src = "";
        } else {
            $src = "dailysalsumm.php";
        }
        break;

    case "itemsalereg";
        if ($guser[itemsalereg] == '') {
            $src = "";
        } else {
            $src = "itemsalereg.php?mode=last";
        }
        break;

    case "partywisesale";
        if ($guser[partywisesale] == '') {
            $src = "";
        } else {
            $src = "partywisesale.php?mode=last";
        }
        break;

    case "withoutmrp";
        if ($guser[bpwmrp] == '') {
            $src = "";
        } else {
            $src = "barcodelbl.php?report=withoutmrp";
        }
        break;

    case "lwithmrp";
        if ($guser[lpmrp] == '') {
            $src = "";
        } else {
            $src = "barcodelbl.php?report=lwithmrp";
        }
        break;

    case "lwithoutmrp";
        if ($guser[lpwmrp] == '') {
            $src = "";
        } else {
            $src = "barcodelbl.php?report=lwithoutmrp";
        }
        break;

    case "withmrp";
        if ($guser[bpmrp] == '') {
            $src = "";
        } else {
            $src = "barcodelbl.php?report=withmrp";
        }
        break;

    case "withoutmrp";
        if ($guser[bpwmrp] == '') {
            $src = "";
        } else {
            $src = "barcodelbl.php?report=withoutmrp";
        }
        break;

    case "lwithmrp";
        if ($guser[lpmrp] == '') {
            $src = "";
        } else {
            $src = "barcodelbl.php?report=lwithmrp";
        }
        break;

    case "lwithoutmrp";
        if ($guser[lpwmrp] == '') {
            $src = "";
        } else {
            $src = "barcodelbl.php?report=lwithoutmrp";
        }
        break;


    case "inwout";
        if ($guser[rpitemhist] == '') {
            $src = "";
        } else {
            $src = "inwoutrep.php";
        }
        break;

    case "stock";
        if ($guser[rpstock] == '') {
            $src = "";
        } else {
            $src = "stock.php";
        }
        break;

    case "vatrep";
        if ($guser[rpvat] == '') {
            $src = "";
        } else {
            $src = "vatrep.php";
        }
        break;

    case "income";
        if ($guser[incometaxrp] == '') {
            $src = "";
        } else {
            $src = "taxreg.php?report=income";
        }
        break;

    case "sales";
        if ($guser[salestaxrp] == '') {
            $src = "";
        } else {
            $src = "taxreg.php?report=sales";
        }
        break;

    case "osrec";
        if ($guser[outsrecevrp] == '') {
            $src = "";
        } else {
            $src = "osbill.php?para=R";
        }
        break;

    case "ospay";
        if ($guser[outspayrp] == '') {
            $src = "";
        } else {
            $src = "osbill.php?para=P";
        }
        break;

    case "ledger";
//        if ($guser[rpledger] == '') {
//            $src = "";
//        } else {
        $src = "ledger.php";
//        }
        break;

    case "stock";
        if ($guser[stockrp] == '') {
            $src = "";
        } else {
            $src = "stock.php";
        }
        break;

    case "stkrawmat";
        if ($guser[stkrawmat] == '') {
            $src = "";
        } else {
            $src = "stkrawmat.php?";
        }
        break;

    case "stkprod";
        if ($guser[stkprod] == '') {
            $src = "";
        } else {
            $src = "stkprod.php?";
        }
        break;

    case "stkpack";
        if ($guser[stkpack] == '') {
            $src = "";
        } else {
            $src = "stkpack.php?";
        }
        break;

    case "bankbook";
//        if ($guser[rpbankbook] == '') {
//            browse('1');
//            $src = "";
//        } else {
//            browse('2');
        $src = "bankbook.php?para=B";
//        }
        break;

    case "cashbook";
//        if ($guser[rpcashbook] == '') {
//            $src = "";
//        } else {
        $src = "bankbook.php?para=C";
//        }
        break;

    case "bpaychq";
        if ($guser[bankpaydaterp] == '') {
            $src = "";
        } else {
            $src = "bkpy_chq.php";
        }
        break;

    case "discreg";
        if ($guser[discrecevrp] == '') {
            $src = "";
        } else {
            $src = "discreg.php";
        }
        break;

    case "dailyrep";
        if ($guser[dailyreprp] == '') {
            $src = "";
        } else {
            $src = "dailyrep.php";
        }
        break;

    case "chqrep";
        if ($guser[rpchqnoqry] == '') {
            $src = "";
        } else {
            $src = "chqrep.php";
        }
        break;

    case "amtrep";
        if ($guser[rpamountqry] == '') {
            $src = "";
        } else {
            $src = "amtrep.php";
        }
        break;

    case "itemwise";
        if ($guser[rpitemwise] == '') {
            $src = "";
        } else {
            $src = "itemwise.php";
        }
        break;

    case "itemwisesale";
        if ($guser[rpitemwisesale] == '') {
            $src = "";
        } else {
            $src = "itemwise_sale.php";
        }
        break;
    case "itemgrpwisesale";
        if ($guser[rpitemgrpwisesale] == '') {
            $src = "";
        } else {
            $src = "saleitemgrp.php";
        }
        break;
    case "partygrpwisesale";
        if ($guser[rppartygrpwisesale] == '') {
            $src = "";
        } else {
            $src = "partgrp_sale.php";
        }
        break;
    ####################### REGISTERS ##########################

    case "tisalereg";
//        if ($guser[tisalerg] == '') {
//            $src = "";
//        } else {
        $src = "tisalereg.php";
//        }
        break;

    case "tiitemwise";
//        if ($guser[tiitemwise] == '') {
//            $src = "";
//        } else {
        $src = "itemwisereg.php";
//        }
        break;

    case "tiitemgrpwise";
//        if ($guser[tiitemwise] == '') {
//            $src = "";
//        } else {
        $src = "itemgrpwisereg.php";
//        }
        break;

    case "tipitemreg";
//        if ($guser[tipitemreg] == '') {
//            $src = "";
//        } else {
        $src = "tipitemreg.php";
//        }
        break;

    case "tiipartyreg";
//        if ($guser[tiipartyreg] == '') {
//            $src = "";
//        } else {
        $src = "tiipartyreg.php";
//        }
        break;

    case "tisalitemwise";
//        if ($guser[tiitemwise] == '') {
//            $src = "";
//        } else {
        $src = "salitemwisereg.php";
//        }
        break;

    case "midelvreg";
//        if ($guser[tisalerg] == '') {
//            $src = "";
//        } else {
        $src = "midelvreg.php";
//        }
        break;

    case "tidisreg";
        if ($guser[tidisreg] == '') {
            $src = "";
        } else {
            $src = "tidisreg.php";
        }
        break;

    case "exsalereg";
//        if ($guser[tisalerg] == '') {
//            $src = "";
//        } else {
        $src = "exsalereg.php";
//        }
        break;

    case "tiinwdreg";
//        if ($guser[slgstreg] == '') {
//            $src = "";
//        } else {
        $src = "tiinwdreg.php";
//        }
        break;

    case "exinwdreg";
//        if ($guser[slgstreg] == '') {
//            $src = "";
//        } else {
        $src = "exinwdreg.php";
//        }
        break;
    case "exinvoicereg";
        if ($guser[exinvoicereg] == '') {
            $src = "";
        } else {
            $src = "exinvoicereg.php";
        }
        break;
    case "ticredreg";
//        if ($guser[slgstreg] == '') {
//            $src = "";
//        } else {
        $src = "ticredreg.php";
//        }
        break;

    case "ticredothreg";
//        if ($guser[slgstreg] == '') {
//            $src = "";
//        } else {
        $src = "ticredothreg.php";
//        }
        break;

    case "tidamreg";
//        if ($guser[slgstreg] == '') {
//            $src = "";
//        } else {
        $src = "tidamreg.php";
//        }
        break;

    case "titranreg";
//        if ($guser[slgstreg] == '') {
//            $src = "";
//        } else {
        $src = "titranreg.php";
//        }
        break;

    case "saletinreg";
        if ($guser[saletinrg] == '') {
            $src = "";
        } else {
            $src = "saletinreg.php";
        }
        break;

    case "purreg";
        if ($guser[purchaserg] == '') {
            $src = "";
        } else {
            $src = "purreg.php";
        }
        break;

    case "purgstreg";
        if ($guser[purchasegstrg] == '') {
            $src = "";
        } else {
            $src = "purgstreg.php";
        }
        break;

    case "orderreg";
        if ($guser[ordformrg] == '') {
            $src = "";
        } else {
            $src = "orderreg.php";
        }
        break;

    case "inwardreg";
        if ($guser[inwardrg] == '') {
            $src = "";
        } else {
            $src = "inwardreg.php";
        }
        break;

    case "outwardreg";
        if ($guser[outwardrg] == '') {
            $src = "";
        } else {
            $src = "outwardreg.php";
        }
        break;

    case "debreg";
        if ($guser[debnoterg] == '') {
            $src = "";
        } else {
            $src = "debreg.php";
        }
        break;

    case "credreg";
        if ($guser[crednoterg] == '') {
            $src = "";
        } else {
            $src = "credreg.php";
        }
        break;

    ####################### SUMMARY ##########################

    case "pursalessum";
        if ($guser[pursalessum] == '') {
            $src = "";
        } else {
            $src = "purs.php?mode=last";
        }
        break;

    case "purgrpsum";
        if ($guser[purgrpsum] == '') {
            $src = "";
        } else {
            $src = "purg.php?mode=last";
        }
        break;

    case "salegrpsum";
        if ($guser[salegrpsum] == '') {
            $src = "";
        } else {
            $src = "sale.php?mode=last";
        }
        break;
    ####################### FINALIZATION ##########################

    case "trbal";
        if ($guser[fntrialbal] == '') {
            $src = "";
        } else {
            $src = "trbal.php?mode=last";
        }
        break;

    case "profit";
        if ($guser[fnprofit] == '') {
            $src = "";
        } else {
            $src = "profit.php?mode=last";
        }
        break;

    case "profshar";
        if ($guser[fnprofshar] == '') {
            $src = "";
        } else {
            $src = "profshar.php?mode=last";
        }
        break;

    case "balsheet";
        if ($guser[fnbalsheet] == '') {
            $src = "";
        } else {
            $src = "balsheet.php?mode=last";
        }
        break;


    ########################## GST REPORTS   ########################
    case "gstr1_1";
        $src = "gstr1_1.php";
        break;

    case "gstr1_2";
        $src = "gstr1_2.php";
        break;

    case "gstr1_3";
        $src = "gstr1_3.php";
        break;

    case "gstr1_4";
        $src = "gstr1_4.php";
        break;

    case "gstr1_5";
        $src = "gstr1_5.php";
        break;

    case "gstr1_6";
        $src = "gstr1_6.php";
        break;

    case "gstr1_7";
        $src = "gstr1_7.php";
        break;

    case "gstr1_8";
        $src = "gstr1_8.php";
        break;

    case "gstr1_9";
        $src = "gstr1_9.php";
        break;

    case "gstr1_10";
        $src = "gstr1_10.php";
        break;

    case "gstr1_11";
        $src = "gstr1_11.php";
        break;

    ####################### TOOLS ##########################

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

    case "company";
//        if ($guser[tlcompany] == '') {
//            $src = "";
//        } else {
        $src = "company.php?mode=last";
//        }
        break;

    case "yearselection";
        if ($guser[yearselection] == '') {
            $src = "";
        } else {
            $src = "yea.php?mode=last";
        }
        break;

    case "backup";
        if ($guser[tlbackup] == '') {
            $src = "";
        } else {
            $src = "backup.php";
        }
        break;

    default : {
            $src = 'default.php';
            break;
        }
}
$mcred = "";
if ($guser[creditnote] != "1" && $guser[creditoth] != "1") {
    $mcred = "style='display: none'";
}
$mbank = "";
if ($guser[bankpay] != "1" && $guser[bankrecp] != "1") {
    $mbank = "style='display: none'";
}
$mcash = "";
if ($guser[cashpay] != "1" && $guser[cashrecp] != "1") {
    $mcash = "style='display: none'";
}

$mbpmrp = "";
if ($guser[bpmrp] != "1" && $guser[bpwmrp] != "1") {
    $mbpmrp = "style='display: none'";
}
$mlpmrp = "";
if ($guser[lpmrp] != "1" && $guser[lpwmrp] != "1") {
    $mlpmrp = "style='display: none'";
}
$rpquery = "";
if ($guser[rpchqnoqry] != "1" && $guser[rpamountqry] != "1") {
    $rpquery = "style='display: none'";
}

$rpoutstanding = "";
if ($guser[outsrecevrp] != "1" && $guser[outspayrp] != "1") {
    $rpoutstanding = "style='display: none'";
}

include("includes/linkshead.php");
?>
</head>
<body class="navbar-top  pace-done sidebar-xs">

    <!-- Main navbar -->
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="navbar-header">
            <!--<a class="navbar-brand" href="index.html"><img src="assets/images/logo_light.png" alt=""></a>-->
            <a class="navbar-brand" href="menu.php"><b>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $project_title ?></b></a>
            <ul class="nav navbar-nav visible-xs-block">
                <li><a data-toggle="collapse" data-target="#navbar-mobile"><i class="icon-tree5"></i></a></li>
                <li><a class="sidebar-mobile-main-toggle"><i class="icon-paragraph-justify3"></i></a></li>
            </ul>
        </div>

        <div class="navbar-collapse collapse" id="navbar-mobile">
            <ul class="nav navbar-nav">
                <li><a class="sidebar-control sidebar-main-toggle hidden-xs"><i class="icon-paragraph-justify3"></i></a></li>

                <li class="dropdown">
                    <!--                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                            <i class="icon-git-compare"></i>
                                            <span class="visible-xs-inline-block position-right">Git updates</span>
                                            <span class="badge bg-warning-400">9</span>
                                        </a>-->

                    <div class="dropdown-menu dropdown-content">
                        <div class="dropdown-content-heading">
                            Git updates
                            <ul class="icons-list">
                                <li><a href="#"><i class="icon-sync"></i></a></li>
                            </ul>
                        </div>

                        <ul class="media-list dropdown-content-body width-350">
                            <li class="media">
                                <div class="media-left">
                                    <a href="#" class="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i class="icon-git-pull-request"></i></a>
                                </div>

                                <div class="media-body">
                                    Drop the IE <a href="#">specific hacks</a> for temporal inputs
                                    <div class="media-annotation">4 minutes ago</div>
                                </div>
                            </li>

                            <li class="media">
                                <div class="media-left">
                                    <a href="#" class="btn border-warning text-warning btn-flat btn-rounded btn-icon btn-sm"><i class="icon-git-commit"></i></a>
                                </div>

                                <div class="media-body">
                                    Add full font overrides for popovers and tooltips
                                    <div class="media-annotation">36 minutes ago</div>
                                </div>
                            </li>

                            <li class="media">
                                <div class="media-left">
                                    <a href="#" class="btn border-info text-info btn-flat btn-rounded btn-icon btn-sm"><i class="icon-git-branch"></i></a>
                                </div>

                                <div class="media-body">
                                    <a href="#">Chris Arney</a> created a new <span class="text-semibold">Design</span> branch
                                    <div class="media-annotation">2 hours ago</div>
                                </div>
                            </li>

                            <li class="media">
                                <div class="media-left">
                                    <a href="#" class="btn border-success text-success btn-flat btn-rounded btn-icon btn-sm"><i class="icon-git-merge"></i></a>
                                </div>

                                <div class="media-body">
                                    <a href="#">Eugene Kopyov</a> merged <span class="text-semibold">Master</span> and <span class="text-semibold">Dev</span> branches
                                    <div class="media-annotation">Dec 18, 18:36</div>
                                </div>
                            </li>

                            <li class="media">
                                <div class="media-left">
                                    <a href="#" class="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i class="icon-git-pull-request"></i></a>
                                </div>

                                <div class="media-body">
                                    Have Carousel ignore keyboard events
                                    <div class="media-annotation">Dec 12, 05:46</div>
                                </div>
                            </li>
                        </ul>

                        <div class="dropdown-content-footer">
                            <a href="#" data-popup="tooltip" title="All activity"><i class="icon-menu display-block"></i></a>
                        </div>
                    </div>
                </li>
            </ul>

            <p class="navbar-text"><span class="label bg-success-400" style="background-color: black;color:white">Trial Version</span></p>
            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown settings">
                    <a class="dropdown-toggle" href="year.php">
                        <label class="label-control" style="font-size: 13px"><i class="fa fa-calendar" aria-hidden="true"></i> <?php echo 'Financial Year : ' . $dispyear; ?></label>
                    </a>
                </li>
                <li class="dropdown dropdown-user">
                    <a class="dropdown-toggle" data-toggle="dropdown">
                        <!--<img src="assets/images/demo/users/face11.jpg" alt="">-->
                        <span><?php echo $_SESSION["username_" . $dbname]; ?></span>
                        <i class="caret"></i>
                    </a>

                    <ul class="dropdown-menu dropdown-menu-right">
                        <!--<li ><a href="?action=compseries"><i class="fa fa-building-o"></i> Company Address</a></li>-->
                        <li <? $tlcompany; ?>><a href="?action=company"><i class="fa fa-building-o"></i> Company SetUp</a></li>
                        <? if ($_SESSION["usertype"] == "1") { ?>
                            <li <? $tlbackup; ?>><a href="?action=backup"><i class="fa fa-cloud-download"></i> Backup</a></li>
                        <? } ?>
                        <li <? $tlprofile; ?>><a href="?action=profile"><i class="fa fa-user"></i> Profile</a></li>
                        <li><a href="logout.php"><i class="fa fa-power-off"></i> Logout</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <!-- /main navbar -->


    <!-- Page container -->
    <div class="page-container">

        <!-- Page content -->
        <div class="page-content">

            <!-- Main sidebar -->
            <div class="sidebar sidebar-main">
                <div class="sidebar-content">
                    <!-- Main navigation -->
                    <div class="sidebar-category sidebar-category-visible">
                        <div class="category-content no-padding">
                            <ul class="navigation navigation-main navigation-accordion">
                                <!-- Main -->
                                <li>
                                    <a href="#"><i class="fa fa-graduation-cap"></i> <span>Masters</span></a>
                                    <ul class="nav-sub">
                                        <li <?= $customer; ?>><a href="?action=customer">Customer</a></li>
                                        <li <?= $supplier; ?>><a href="?action=supplier">Supplier</a></li>
                                        <li <?= $gsttype ?>><a href="?action=gsttype">GST Type</a></li>
                                        <li <?= $state; ?>><a href="?action=state">State</a></li>
                                        <li <?= $area; ?>><a href="?action=area">Area</a></li>
                                        <li <?= $chcustdtl; ?>><a href="?action=chcustdtl">Change of Customer Details</a></li>
                                        <li <?= $openbal; ?>><a href="?action=openbal">Opening Balance</a></li>
                                        <li <?= $transport; ?>><a href="?action=transport">Transporter</a></li>
                                        <li <?= $courier; ?>><a href="?action=courier">Courier</a></li>
                                        <li <?= $staff; ?>><a href="?action=staff">Staff</a></li>
                                        <li <?= $narration; ?>><a href="?action=narration">Narration</a></li>
                                        <li <?= $unit; ?>><a href="?action=unit">Unit</a></li>
                                        <li <?= $godown; ?>><a href="?action=godown">Godown</a></li>
                                        <li <?= $prevoutstand; ?>><a href="?action=prevoutstand">Previous Outstanding</a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#"><i class="fa fa-globe"></i> <span>Trading Inventory</span></a>
                                    <ul class="nav-sub">
                                        <li>
                                            <a href="#" class="has-ul"><i class="fa fa-graduation-cap"></i>Master</a>
                                            <ul class="hidden-ul" style="display: none;">
                                                <li <?= $colour; ?>><a href="?action=colour">Colour</a></li>
                                                <li <? $prodgrp; ?>><a href="?action=prodgrp">Product Group</a></li>
                                                <li <?= $product; ?>><a href="?action=product">Product</a></li>
                                                <li <?= $changeofrates; ?>><a href="?action=changeofrates">Change of Rate</a></li>
                                                <li <?= $openstock; ?>><a href="?action=openstock">Opening Stock</a></li>
                                            </ul>
                                        </li>
                                        <hr>
                                        <li <? ?>><a href="?action=tisale">Sale</a></li>
                                        <li <?= $mbank; ?>>
                                            <a href="#">Credit Note</a>
                                            <ul class="nav-sub">
                                                <li <?= $ticrednote; ?> ><a href="?action=ticrednote">Goods Return</a></li>
                                                <li <?= $ticredoth; ?> ><a href="?action=ticredoth">Others</a></li>
                                            </ul>
                                        </li>
                                        <li <?= $tiinward; ?>><a href="?action=tiinward">Inward</a></li>
                                        <li <?= $tidamage; ?>><a href="?action=tidamage">Damage</a></li>
                                        <li <?= $transfer; ?>><a href="?action=transfer">Transfer</a></li>
                                        <li <?= $dismantle; ?>><a href="?action=dismantle">Dismantle</a></li>
                                        <hr>
                                        <li>
                                            <a href="#" class="has-ul"><i class="fa fa-book"></i>Register</a>
                                            <ul class="hidden-ul" style="display: none;">
                                                <li <?= $mbank; ?> class="nav-dropdown">
                                                    <a href="#">Sale Register<i></i></a>
                                                    <ul class="nav-sub">
                                                        <li <?= $tisalereg; ?> ><a href="?action=tisalereg">Normal</a></li>
                                                        <li <? ?> ><a href="?action=tiitemwise">Itemwise</a></li>
                                                        <li <? ?> ><a href="?action=tiitemgrpwise">Item Groupwise</a></li>
                                                        <li <? ?> ><a href="?action=tipitemreg">Party + Itemwise</a></li>
                                                        <li <? ?> ><a href="?action=tiipartyreg">Itemwise + Party </a></li>
                                                        <li <? ?> ><a href="?action=tisalitemwise">Sale Value Itemwise</a></li>
                                                    </ul>
                                                </li>
                                                <!--<li <?= $gsttype ?>><a href="?action=tidebitreg">Debit Register</a></li>-->
                                                <li <?= $mbank; ?> class="nav-dropdown">
                                                    <a href="#">Credit Note<i></i></a>
                                                    <ul class="nav-sub">
                                                        <li <?= $ticredreg; ?> ><a href="?action=ticredreg">Goods Return</a></li>
                                                        <li <?= $ticredothreg ?> ><a href="?action=ticredothreg">Others</a></li>
                                                    </ul>
                                                </li>
                                                <!--<li <?= $ticreditreg; ?>><a href="?action=ticreditreg">Credit Register</a></li>-->
                                                <li <?= $tiinwdreg; ?>><a href="?action=tiinwdreg">Inward Register</a></li>
                                                <li <?= $tidamreg; ?>><a href="?action=tidamreg">Damage Register</a></li>
                                                <li <?= $titranreg; ?>><a href="?action=titranreg">Transfer Register</a></li>
                                                <li <?= $tidisreg; ?>><a href="?action=tidisreg">Dismantle Register</a></li>
                                            </ul>
                                        </li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#"><i class="fa fa-exchange"></i><span>Export</span></a>
                                    <ul class="nav-sub">
<!--                                        <li <?= $exsale; ?>><a href="?action=exsale">Sale</a></li>
                                        <li <?= $exinward; ?>><a href="?action=exinward">Inward</a></li>-->
                                        <!--<li <?= $proforma; ?>><a href="?action=proforma">Proforma Invoice</a></li>-->
                                        <li <?= $exinvoice; ?>><a href="?action=exinvoice">Invoice</a></li>
                                        <!--<li <?= $expacklist; ?>><a href="?action=expacklist">Packing List</a></li>-->
                                        <li <?= $certoforg; ?>><a href="?action=certoforg">Certificate Of Origin</a></li>
                                        <li <?= $gsp; ?>><a style="color:rosybrown;" href="?action=gsp">GSP</a></li>

                                        <li <?= $excourier; ?>><a href="?action=excourier">Courier</a></li>
                                        <hr>
                                        <li>
                                            <a href="#" class="has-ul"><i class="fa fa-book"></i>Register</a>
                                            <ul class="hidden-ul" style="display: none;">
                                                <li <? ?>><a href="?action=exinvoicereg">Invoice Register</a></li>
                                                <li <?= $exgsp; ?>><a href="?action=exgsp">GSP Register</a></li>
                                                <li <?= $excourreg; ?>><a href="?action=excourreg">Courier Register</a></li>
                                            </ul>
                                        </li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#"><i class="fa fa-building"></i><span>Manufacturing Inventory</span></a>
                                    <ul class="nav-sub">
                                        <li>
                                            <a href="#" class="has-ul"><i class="fa fa-graduation-cap"></i>Master</a>

                                            <ul class="hidden-ul" style="display: none;">
                                                <li <?= $item; ?>><a href="?action=item">Raw Material Master</a></li>
                                                <li <?= $openstock_item; ?>><a href="?action=openstock_item">Opening Stock Raw.</a></li>
                                                <li <?= $packing; ?>><a href="?action=packing">Packing Material</a></li>
                                                <li <?= $openpack; ?>><a href="?action=openpack">Opening Stock Packing</a></li>
                                                <li <?= $finprod; ?>><a href="?action=finprod">Finished Product</a></li>
                                                <li <?= $changerate_item; ?>><a href="?action=changerate_item">Change of Rates</a></li>
                                            </ul>
                                        </li>
                                        <hr>
                                        <li <?= $purchase_mi; ?>><a href="?action=purchaser_mi">Purchase Raw  Material</a></li>
                                        <li <?= $purchase_mi; ?>><a href="?action=purchasep_mi">Purchase Packing Material</a></li>
                                        <!--<li <? ?>><a href="?action=rawmatos">Raw material/Outstanding</a></li>-->
                                        <li <?= $debnote_mi; ?>><a href="?action=debnote_mi">Purchase Return</a></li>
                                        <li <?= $miproduction; ?>><a href="?action=production">Production / BMR.</a></li>
                                        <hr>
                                        <li <?= $damrawmat; ?>><a href="?action=damrawmat">Damage Raw Material</a></li>
                                        <li <?= $midelv; ?>><a href="?action=midelv">Delivery / Dispatch</a></li>
                                        <hr>
                                        <li>
                                            <a href="#" class="has-ul"><i class="fa fa-book"></i>Register</a>
                                            <ul class="hidden-ul" style="display: none;">
                                                <li <?= $purrawreg; ?>><a href="?action=purrawreg">Purchase (Raw Material)</a></li>
                                                <li <?= $mirawmat; ?>><a href="?action=mirawmat">Raw Material O/S</a></li>
                                                <li <?= $purretreg ?>><a href="?action=purretreg">Purchase Return / Debit Note</a></li>
                                                <li <?= $prodreg; ?>><a href="?action=prodreg">Production Register</a></li>
                                                <li <?= $midamreg; ?>><a href="?action=midamreg">Damage Register</a></li>
                                                <li <?= $midelvreg; ?>><a href="?action=midelvreg">Delivery Register</a></li>
                                            </ul>
                                        </li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#"><i class="fa fa-money"></i> <span>Accounts</span></a>
                                    <ul class="nav-sub">
                                        <li>
                                            <a href="#" class="has-ul"><i class="fa fa-graduation-cap"></i>Master</a>
                                            <ul class="hidden-ul" style="display: none;">
                                                <li <?= $group; ?>><a href="?action=group">Group Master</a></li>
                                                <li <?= $other; ?>><a href="?action=other">Other A/C Master</a></li>
                                                <li <?= $bank; ?>><a href="?action=bank">Bank Master</a></li>
                                                <li <?= $cash; ?>><a href="?action=cash">Cash Master</a></li>
                                                <li <?= $expense; ?>><a href="?action=expense">Expense Master</a></li>
                                                <li <?= $drawbank; ?>><a href="?action=drawbank">Drawee Bank</a></li>

                                            </ul>
                                        </li>
                                        <hr>
                                        <li <?= $mbank; ?> class="nav-dropdown">
                                            <a href="#">Bank</a>
                                            <ul class="nav-sub">
                                                <li <?= $bankrecp; ?> ><a href="?action=bankrecp">Receipt</a></li>
                                                <li <?= $bankpay; ?> ><a href="?action=bankpay">Payment</a></li>
                                            </ul>
                                        </li>
                                        <li <?= $mcash; ?> class="nav-dropdown">
                                            <a href="#">Cash</a>
                                            <ul class="nav-sub">
                                                <li <?= $cashrecp; ?> ><a href="?action=cashrecp">Receipt</a></li>
                                                <li <?= $cashpay; ?> ><a href="?action=cashpay">Payment</a></li>
                                            </ul>
                                        </li>
                                        <li <? $journal; ?>><a href="?action=journal">JV</a></li>
                                        <li <? $contra; ?>><a href="?action=contra">Contra</a></li>
                                        <hr>
                                        <li <?= $mbank; ?> class="nav-dropdown">
                                            <a href="#">Outstanding</a>
                                            <ul class="nav-sub">
                                                <li <?= $bankrecp; ?> ><a href="?action=bankrecp">Receivable</a></li>
                                                <li <?= $bankpay; ?> ><a href="?action=bankpay">Payable</a></li>
                                            </ul>
                                        </li>

                                    </ul>
                                </li>
                                <li>
                                    <a href="#"><i class="fa fa-file"></i><span>MIS Reports</span></a>
                                    <ul class="nav-sub">
                                        <li <? ?>><a href="?action=purchsumm">Purchase Summary</a></li>
                                        <li <? ?>><a href="?action=salesumm">Sale Summary</a></li>
                                        <li <? ?>><a href="?action=dailysalsumm">Daily Sale Summary</a></li>
                                        <li <?= $itemsalereg; ?>><a href="?action=itemsalereg">Itemwise Sale</a></li>
                                        <li <?= $partywisesale; ?>><a href="?action=partywisesale">Party + Itemwise</a></li>
                                        <li <?= $stkrawmat; ?>><a href="?action=stkrawmat">Raw Material Stock</a></li>
                                        <li <?= $stkprod; ?>><a href="?action=stkprod">Product Stock</a></li>
                                        <li <?= $stkpck; ?>><a href="?action=stkpack">Packing Stock</a></li>
                                        <li <?= $stkfingood; ?>><a href="?action=ledger">Stock (Finished Goods)</a></li>
                                        <li <?= $ledger; ?>><a href="?action=ledger">Ledger</a></li>
                                        <li <?= $bankbook; ?>><a href="?action=bankbook">Bank Book</a></li>
                                        <li <?= $cashbook; ?>><a href="?action=cashbook">Cash Book</a></li>
                                        <li <?= $jvbook; ?> ><a href="?action=jvbook">JV Book</a></li>
                                        <li <?= $contreg; ?> ><a href="?action=contreg">Contra Register</a></li>
                                        <li <?= $jvbook; ?> ><a href="?action=contreg">Daily Sale Summary</a></li>
                                    </ul>
                                </li>
                                <li class="">
                                    <a href="#" class="has-ul"><i class="fa fa-line-chart"></i> <span>GST Returns</span></a>
                                    <ul class="hidden-ul" style="display: none;">
                                        <li<?= $gstr1_1; ?>><a href="?action=gstr1_1">B2B</a></li>
                                        <li<?= $gstr1_2; ?>><a href="?action=gstr1_2">B2B Large</a></li>
                                        <li<?= $gstr1_3; ?>><a href="?action=gstr1_3">B2B Small</a></li>
                                        <li<?= $gstr1_4; ?>><a href="?action=gstr1_4">Credit Debit Note</a></li>
                                        <li<?= $gstr1_5; ?>><a href="?action=gstr1_5">Credit Debit Note for URD</a></li>
                                        <li<?= $gstr1_6; ?>><a href="?action=gstr1_6">Export</a></li>
                                        <li<?= $gstr1_6; ?>><a href="?action=gstr1_6">Nil / Exempted / Non GST</a></li>
                                        <li<?= $gstr1_10; ?>><a href="?action=gstr1_10">HSN Summary</a></li>
                                        <li<?= $gstr1_11; ?>><a href="?action=gstr1_11">Document Summary</a></li>
                                        <hr>
                                        <li<? ?>><a href="#">GSTR - B</a></li>
                                    </ul>
                                </li>
                                <li class="nav-dropdown">
                                    <a href='#' class="has-ul"><i class="icon-tree5"></i><span>Finalization</span></a>
                                    <ul class='nav-sub'>
                                        <li <?= $trbal; ?>><a href="?action=trbal">Trial Balance</a></li>
                                        <li <?= $profit; ?>><a href="?action=profit">Profit / Loss</a></li>
                                        <li <?= $profshar; ?>><a href="?action=profshar">Profit Sharing</a></li>
                                        <li <?= $balsheet; ?>><a href="?action=balsheet">Balance Sheet</a></li>
                                    </ul>
                                </li>
                                <!-- /main -->
                            </ul>
                        </div>
                    </div>
                    <!-- /main navigation -->
                </div>
            </div>
            <!-- /main sidebar -->
            <!-- Main content -->
            <div class="content-wrapper">
                <iframe src="<?php echo $src; ?>" name="frame1" class="frame1" style="width: 100%; height:2500px;"  frameBorder="0" scrolling="no"></iframe>
            </div>
            <!-- /main content -->
        </div>
        <!-- /page content -->
    </div>
    <!-- /page container -->
</body>
</html>
