<?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 "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['other'] == '') {
            $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";
        if ($guser['product'] == '') {
            $src = "";
        } else {
            $src = "product.php?mode=last";
        }
        break;

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

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

    case "area";
        if ($guser['area'] == '') {
            $src = "";
        } else {
            $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['tiinward'] == '') {
            $src = "";
        } else {
            $src = "inward.php?mode=last";
        }
        break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    case "exinvoice";
        if ($guser['exinvoice'] == '') {
            $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 "saledeem";
        $src = "sale_de.php?mode=last";
        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 "purchord";
        if ($guser['purchord'] == '') {
            $src = "";
        } else {
            $src = "purchord.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['ledger'] == '') {
            $src = "";
        } else {
            $src = "ledger.php";
        }
        break;

    case "inougst";
        $src = "inougst.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 "jvbook";
        //        if ($guser[rpcashbook] == '') {
        //            $src = "";
        //        } else {
        $src = "jvbook.php?para=C";
        //        }
        break;

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

    case "bpaychq";
        if ($guser['bpaychq'] == '') {
            $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['tisalereg'] == '') {
            $src = "";
        } else {
            $src = "tisalereg.php";
        }
        break;

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

    case "tiitemgrpwise";
        if ($guser['tiitemgrpwise'] == '') {
            $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['tisalitemwise'] == '') {
            $src = "";
        } else {
            $src = "salitemwisereg.php";
        }
        break;

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

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

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

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

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

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

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

    case "titranreg";
        if ($guser['titranreg'] == '') {
            $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_b2b";
        $src = "gstr1_b2b.php";
        break;

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

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

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

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

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

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

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

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

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

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


    case "gstsum";
        $src = "gstsum.php";
        break;
    ////////////////////////GSTR2_PURCHASE////////////////////////////////////////
    case "gstr2_b2b";
        $src = "gstr2_b2b.php";
        break;

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

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

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

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

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

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

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

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

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

    case "gstr2_docs";
        $src = "gstr2_docs.php";
        break;
    /////////////////////////////GST SUMMARY/////////////////////////////
    case "gstsum";
        $src = "gstsum.php";
        break;

    case "gstr3B";
        $src = "gstr3B.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");
?>
<!--<script>
    $("li").click(function() {
  $("li").removeClass("active");
  $(this).addClass("active");
}); 
</script>-->
<style>

    mark{
        padding:10px ;
        border-radius: 5px ;
    }

    a:hover {

        background-color: black; 
        /*padding: 5px;*/ 
        border-radius: 10px
    }
    ul>li>a{
        padding: 10px; 

    }
</style>
</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">
                    
        
                    <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 -->
    <link rel="stylesheet" href="navbar_techandall.css"> <!-- Navigation CSS -->
    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- Page container -->
    <div class="container-fluid">
        <div>
            <label class="mobile_menu" for="mobile_menu">
                <span>Menu</span>
            </label>
            <input id="mobile_menu" type="checkbox">
            <ul class="nav">
                <li style="font-size: 20px;border:1px solid black"><a href="menu.php"><b><?php echo $project_title ?></b></a></li>


                <!----- Full Drop Down Name ----> 
                <li <?= $master; ?> style="font-size: 17px"  class=""><a href="#"><i class="fa fa-graduation-cap"></i><b>Masters</b></a>     
                    <!----- Full Drop Down Name Ends Here ---->     

                    <!----- Full Drop Down Contents  of Masters Starts Here---->     

                    <div class="fulldrop">              
                        <div class="column">
                            <label><h3><mark>Masters</mark></h3></label>
                            <ul>
                                <li <?= $customer; ?>><a class="effect2"  style=" padding: 10px;"  href="?action=customer">Customer</a></li>
                                <li <?= $supplier; ?>><a class="effect2" style=" padding: 10px;" href="?action=supplier">Supplier</a></li>
                                <li <?= $gsttype ?>><a class="effect2" style=" padding: 10px;" href="?action=gsttype">GST Type</a></li>
                                <li <?= $state; ?>><a class="effect2" style=" padding: 10px;" href="?action=state">State</a></li>
                                <li <?= $area; ?>><a class="effect2" style=" padding: 10px;" href="?action=area">Area</a></li>
                            </ul>
                        </div>



                        <div class="column">
                            <h3></h3>
                            <ul>
                                <li <?= $chcustdtl; ?>><a class="effect2" href="?action=chcustdtl">Change of Customer Details</a></li>
                                <li <?= $openbal; ?>><a class="effect2" href="?action=openbal">Opening Balance</a></li>
                                <li <?= $transport; ?>><a class="effect2" href="?action=transport">Transporter</a></li>
                                <li <?= $courier; ?>><a class="effect2" href="?action=courier">Courier</a></li>
                                <li <?= $staff; ?>><a class="effect2" href="?action=staff">Staff</a></li>
                            </ul>
                        </div>


                        <div class="column">
                            <h3></h3>
                            <ul>
                                <li <?= $narration; ?>><a class="effect2" href="?action=narration">Narration</a></li>
                                <li <?= $unit; ?>><a class="effect2" href="?action=unit">Unit</a></li>
                                <li <?= $godown; ?>><a class="effect2" href="?action=godown">Godown</a></li>
                                <li <?= $prevoutstand; ?>><a class="effect2" href="?action=prevoutstand">Previous Outstanding</a></li>
                            </ul>
                        </div>                       
                    </div>
                </li>
                <!----- Full Drop Down Contents  for Masters Ends  Here---->   


                <!----- Full Drop Down Name ----> 
                <li class="" style="font-size: 17px"><a class="effect2" href="#"><b>Trading Inventory</b></a>     
                    <!----- Full Drop Down Name Ends Here ---->     

                    <!----- Full Drop Down Contents  Starts Here---->     

                    <div class="fulldrop" >              
                        <div class="column" style="border-right:1px solid white">
                            <h3><mark>Masters</mark></h3>
                            <ul>
                                <li <?= $colour; ?>><a class="effect2" style=" padding: 10px;" href="?action=colour">Colour</a></li>
                                <li <?= $prodgrp; ?>><a class="effect2" href="?action=prodgrp">Product Group</a></li>
                                <li <?= $product; ?>><a class="effect2" href="?action=product">Product</a></li>
                                <li <?= $changeofrates; ?>><a class="effect2" href="?action=changeofrates">Change of Rate</a></li>
                                <li <?= $openstock; ?>><a class="effect2" href="?action=openstock">Opening Stock</a></li>
                            </ul>
                        </div>

                        <div class="column">
                            <h3><mark>Transaction</mark></h3>
                            <ul>
                                <li <?= $tisale; ?>><a class="effect2" href="?action=tisale">Sale</a></li>
                                <li <?= $deemsale ?>><a class="effect2" href="?action=deemsale">Deemed Sale</a></li>
                                <li <?= $saleoth ?>><a class="effect2" href="?action=saleoth">Sale Other</a></li>
                                <li <?= $ticrednote; ?>><a class="effect2" href="?action=ticrednote">Credit Note Goods Return</a></li>
                                <li <?= $ticredoth; ?>><a class="effect2" href="?action=ticredoth">Credit Note Others</a></li>
                                <li <?= $tiinward; ?>><a class="effect2" href="?action=tiinward">Inward</a></li>
                            </ul>
                        </div>

                        <div class="column">
                            <h3></h3>
                            <ul>
                                <li <?= $tiinward; ?>><a class="effect2" href="?action=deeminward">Deemed Inward</a></li>
                                <li <?= $tidamage; ?>><a class="effect2" href="?action=tidamage">Damage</a></li>
                                <li <?= $transfer; ?>><a class="effect2" href="?action=transfer">Transfer</a></li>
                                <li <?= $dismantle; ?>><a class="effect2" href="?action=dismantle">Dismantle</a></li>
                                <li <?= $multinvoice; ?>><a class="effect2" href="?action=multiinvoice">Multi Invoice</a></li>
                                <li <?= $multinvoice; ?>><a class="effect2" href="?action=multiinvoice">Multi Invoice</a></li>
                            </ul>
                        </div>

                        <div class="column" style="border-left:1px solid white;padding-left:15px">
                            <h3><mark>Register</mark></h3>
                            <ul>
                                <li <?= $tisalereg; ?>><a class="effect2" href="?action=tisalereg">Normal</a></li>
                                <li <?= $tiitemwise ?>><a class="effect2" href="?action=tiitemwise">Itemwise</a></li>
                                <li <?= $tiitemgrpwise ?>><a class="effect2" href="?action=tiitemgrpwise">Item Groupwise</a></li>
                                <li <?= $tipitemreg ?>><a class="effect2" href="?action=tipitemreg">Party + Itemwise</a></li>
                                <li <?= $tiipartyreg ?>><a class="effect2" href="?action=tiipartyreg">Itemwise + Party </a></li>
                            </ul>
                        </div>


                        <div class="column">
                            <h3></h3>
                            <ul>
                                <li <?= $tisalitemwise ?>><a class="effect2" href="?action=tisalitemwise">Sale Value Itemwise</a></li>
                                <li <?= $tiinwdreg; ?>><a class="effect2" href="?action=tiinwdreg">Inward Register</a></li>
                                <li <?= $ticredreg; ?>><a class="effect2" href="?action=ticredreg">Credit Note<i></i></a></li>
                                <li <? ?>><a class="effect2" href="?action=deemslreg">Deemed Register</a></li>
                                <li <? ?>><a class="effect2" href="?action=deeminwdreg">Deemed Inward Register</a></li>
                            </ul>
                        </div>

                        <div class="column">
                            <h3></h3>
                            <ul>
                                <li <?= $tidamreg; ?>><a class="effect2" href="?action=tidamreg">Damage Register</a></li>
                                <li <?= $titranreg; ?>><a class="effect2" href="?action=titranreg">Transfer Register</a></li>
                                <li <?= $tidisreg; ?>><a class="effect2" href="?action=tidisreg">Dismantle Register</a></li>
                            </ul>
                        </div>

                    </div>
                </li>
                <!----- Full Drop Down Contents  Ends  Here---->   



                <!----- Regular Menu Button ---->   
                <li class="" style="font-size: 17px"><a class="effect2" href="#"><b>Exports</b></a>     
                    <!----- Full Drop Down Name Ends Here ---->     

                    <!----- Full Drop Down Contents  Starts Here---->     

                    <div class="fulldrop">              
                        <div class="column" style="border-right:1px solid white">
                            <h3><mark>Transaction</mark></h3>
                            <ul>
                                <li <?= $exinvoice; ?>><a class="effect2" href="?action=exinvoice">Invoice / Sale</a></li>
                                <li <?= $expinward; ?>><a class="effect2" href="?action=inwardexp">Inward</a></li>
                                <li <?= $certoforg; ?>><a class="effect2" href="?action=certoforg">Certificate Of Origin</a></li>
                                <li <?= $gsp; ?>><a class="effect2" style="color:rosybrown;" href="?action=gsp">GSP</a></li>
                                <li <?= $excourier; ?>><a class="effect2" href="?action=excourier">Courier</a></li>
                            </ul>
                        </div>

                        <div class="column">
                            <h3><mark>Registers</mark></h3>
                            <ul>
                                <li <?= $exinvoicereg; ?>><a class="effect2" href="?action=exinvoicereg">Invoice Register</a></li>
                                <li <?= $exgsp; ?>><a class="effect2" href="?action=exgsp">GSP Register</a></li>
                                <li <?= $excourreg; ?>><a class="effect2" href="?action=excourreg">Courier Register</a></li>
                            </ul>
                        </div>
                    </div>
                </li>
                <!----- Regular Menu Button Ends---->  


                <!----- Regular Menu Button ---->  
                <li class=""  style="font-size: 17px"><a class="effect2" href="#"><b>Manufacturing Inventory</b></a>     
                    <!----- Full Drop Down Name Ends Here ---->     

                    <!----- Full Drop Down Contents  Starts Here---->     

                    <div class="fulldrop">              
                        <div class="column" style="border-right:1px solid white">
                            <h3><mark>Masters</mark></h3>
                            <ul>
                                <li <?= $item; ?>><a class="effect2" href="?action=item">Raw Material</a></li>
                                <li <?= $openstock_item; ?>><a class="effect2" href="?action=openstock_item">Opening Stock Raw.</a></li>
                                <li <?= $packing; ?>><a class="effect2" href="?action=packing">Packing Material</a></li>
                                <li <?= $openpack; ?>><a class="effect2" href="?action=openpack">Opening Stock Packing</a></li>
                                <li <?= $finprod; ?>><a class="effect2" href="?action=finprod">Finished Product</a></li>
                                <li <?= $changerate_item; ?>><a class="effect2" href="?action=changerate_item">Change of Rates</a></li>
                            </ul>
                        </div>

                        <div class="column">
                            <h3><mark>Transaction</mark></h3>
                            <ul>
                                <li <?= $purchaser_mi; ?>><a href="?action=purchaser_mi">Raw Material</a></li>
                                <li <?= $purchasep_mi; ?>><a href="?action=purchasep_mi">Packing Material</a></li>
                                <li <?= $purchasep_mi; ?>><a href="?action=inward_mi">Inward</a></li>
                                <li <? ?>><a href="?action=purcoth_mi">Other</a></li>
                                <li <?= $debnoter_mi; ?>><a href="?action=debnoter_mi">Raw Material</a></li>
                            </ul>
                        </div>
                        <div class="column" >
                            <h3></h3>
                            <ul>
                                <li <?= $debnotep_mi; ?>><a href="?action=debnotep_mi">Packing Material</a></li>    
                                <li <?= $production; ?>><a href="?action=production">Production / BMR.</a></li>
                                <li <?= $damrawmat; ?>><a href="?action=damrawmat">Damage Raw Material</a></li>
                                <li <?= $midelv; ?>><a href="?action=midelv">Delivery / Dispatch</a></li>
                            </ul>
                        </div>
                        <div class="column" style="border-left:1px solid white;padding:15px">
                            <h3><mark>Regiters</mark></h3>
                            <ul>
                                <li <?= $purordreg; ?>><a href="?action=purordreg">Purchase Order</a></li>
                                <li <?= $purrawreg; ?>><a href="?action=purrawreg">Purchase</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>
                            </ul>
                        </div>
                        <div class="column">
                            <h3></h3>
                            <ul>
                                <li <?= $midamreg; ?>><a href="?action=midamreg">Damage Register</a></li>
                                <li <?= $midelvreg; ?>><a href="?action=midelvreg">Delivery Register</a></li>
                            </ul>
                        </div>
                    </div>
                </li>
                <!----- Regular Menu Button Ends---->  


                <!----- Regular Menu Button ---->  
                <li class=""  style="font-size: 17px"><a href="#"><b>Accounts</b></a>     
                    <!----- Full Drop Down Name Ends Here ---->     

                    <!----- Full Drop Down Contents  Starts Here---->     

                    <div class="fulldrop">              
                        <div class="column" style="border-right:1px solid white">
                            <h3><mark>Masters</mark></h3>
                            <ul>
                                <li <?= $group; ?>><a href="?action=group">Group </a></li>
                                <li <?= $other; ?>><a href="?action=other">Other A/C </a></li>
                                <li <?= $bank; ?>><a href="?action=bank">Bank </a></li>
                                <li <?= $cash; ?>><a href="?action=cash">Cash </a></li>
                                <li <?= $expense; ?>><a href="?action=expense">Expense </a></li>
                                <li <?= $drawbank; ?>><a href="?action=drawbank">Drawee Bank</a></li>
                            </ul>
                        </div>

                        <div class="column">
                            <h3><mark>Transaction</mark></h3>
                            <ul>
                                <li <?= $bankrecp; ?>><a href="?action=bankrecp">Receipt</a></li>
                                <li <?= $bankpay; ?>><a href="?action=bankpay">Payment</a></li>
                                <li <?= $cashrecp; ?>><a href="?action=cashrecp">Receipt</a></li>
                                <li <?= $cashpay; ?>><a href="?action=cashpay">Payment</a></li>
                                <li <?= $journal; ?>><a href="?action=journal">JV</a></li>

                            </ul>
                        </div>
                        <div class="column" >
                            <h3></h3>
                            <ul>
                                <li <?= $contra; ?>><a href="?action=contra">Contra</a></li>
                                <li <? ?> ><a href="?action=bankrecp">Receivable</a></li>
                                <li <? ?> ><a href="?action=bankpay">Payable</a></li>
                            </ul>
                        </div>                        
                    </div>
                </li>
                <!----- Regular Menu Button Ends---->  

                <!----- Regular Menu Button ---->  
                <li><a href="#"> Contact</a></li>
                <!----- Regular Menu Button Ends---->  



                <!----- Search Form Starts---->        
                <!--                <li class="search"><form action="Search.php">
                                        <i class="icon-search icon-large"></i><input type="text">
                                    </form>
                                </li>              -->
                <!----- Search Form Ends ---->    


            </ul> 
        </div>
    </div>
    <div class="content-wrapper">
        <iframe src="<?php echo $src; ?>" name="frame1" class="frame1" style="width: 100%; height:5000px;" frameBorder="0" scrolling="no"></iframe>
    </div>
    <!-- /page container -->
</body>
<script>
    $(document).ready(function () {

        $("#1").children("a").removeClass();
        $("#1").children("a").addClass("active");
    });
</script>

</html>