<?php

if(isset($_SESSION["username_" . $dbname])){
        $user    = $_SESSION["username_" . $dbname];
        $spec    = $_SESSION["spltype_" . $dbname];
        
        $getuser = mysqli_query($conn, "SELECT * FROM `passmain` WHERE `user`='$user' and `spltype`='$spec'")or die(mysqli_error($conn));
        $guser   = mysqli_fetch_object($getuser);
        $line = '';
        
    $none             = "style='display:none'";
    
    ################## MASTERS ##################
    if($guser[customer]         == ''){ $customer   = $none; }
    if($guser[supplier]         == ''){ $supplier   = $none; }
    if($guser[openbal]          == ''){ $openbal    = $none; }
    if($guser[chcustdtl]        == ''){ $chcustdtl  = $none; }
    if($guser[driver]           == ''){ $driver     = $none; }
    if($guser[transport]        == ''){ $transport  = $none; }
    if($guser[unit]             == ''){ $unit       = $none; }
    if($guser[openstk]          == ''){ $openstk    = $none; }
    if($guser[staff]            == ''){ $staff      = $none; }
    if($guser[bank]             == ''){ $bank       = $none; }
    if($guser[cash]             == ''){ $cash       = $none; }
    if($guser[expense]          == ''){ $expense    = $none; }
    if($guser[itemgrp]          == ''){ $itemgrp    = $none; }
    if($guser[itemsubgrp]       == ''){ $itemsubgrp = $none; }
    if($guser[item]             == ''){ $item       = $none; }
    if($guser[group]            == ''){ $group      = $none; }
    if($guser[otherac]          == ''){ $otherac    = $none; }
    if($guser[saletype]         == ''){ $saletype   = $none; }
   

    ################## TRANSACTION ##################
    if($guser[purchase]         == ''){ $purchase = $none; }
    if($guser[sale]             == ''){ $sale = $none; }
    if($guser[salegst]          == ''){ $salegst = $none; }
    if($guser[debnote]          == ''){ $debnote = $none; }
    if($guser[deboth]           == ''){ $deboth = $none; }
    if($guser[crednote]         == ''){ $crednote = $none; }
    if($guser[credoth]          == ''){ $credoth = $none; }
    if($guser[inward]           == ''){ $inward = $none; }
    if($guser[outward]          == ''){ $outward = $none; }
    if($guser[damaged]          == ''){ $damaged = $none; }
    if($guser[excess]           == ''){ $excess = $none; }
    if($guser[bankrecp]         == ''){ $bankrecp = $none; }
    if($guser[bankpay]          == ''){ $bankpay = $none; }
    if($guser[cashrecp]         == ''){ $cashrecp = $none; }
    if($guser[cashpay]          == ''){ $cashpay = $none; }
    if($guser[contra]           == ''){ $contra = $none; }
    if($guser[journal]          == ''){ $journal = $none; }
    if($guser[discgiven]        == ''){ $discgiven = $none; }
    if($guser[discrecv]         == ''){ $discrecv = $none; }
    if($guser[taxinv]           == ''){ $taxinv = $none; }
    if($guser[transfer]         == ''){ $transfer = $none; }
    
    
    ################## REPORTS ##################
    if($guser[stock]            == ''){ $rpstock = $none; }
    if($guser[inwout]           == ''){ $rphist = $none; }
    if($guser[vatrep]           == ''){ $rpvat = $none; }
    if($guser[ledger]           == ''){ $rpledger = $none; }
    if($guser[labels]           == ''){ $rplabels = $none; }
    if($guser[chqrep]           == ''){ $rpchqnoqry = $none; }
    if($guser[amtrep]           == ''){ $rpamountqry = $none; }
    if($guser[itemwise]         == ''){ $rpitemwise = $none; }
    if($guser[itemwisesale]     == ''){ $rpitemwisesale = $none; }
    if($guser[itemgrpwisesale]  == ''){ $rpitemgrpwisesale = $none; }
    if($guser[partygrpwisesale] == ''){ $rppartygrpwisesale = $none; }
    if($guser[leadparty]        == ''){ $rpleadparty = $none; }
    if($guser[dailyreport]      == ''){ $rpdailyreport = $none; }
    if($guser[dailysalereport]  == ''){ $rpdailysalereport = $none; }
    if($guser[bankbook]         == ''){ $rpbankbook = $none; }
    if($guser[cashbook]         == ''){ $rpcashbook = $none; }
    if($guser[jvrep]            == ''){ $rpjvrep = $none; }
    if($guser[exprep]           == ''){ $rpexpense = $none; }
    if($guser[payablerep]       == ''){ $rppayable = $none; }
    if($guser[receivable]       == ''){ $rpreceivable = $none; }
    

    ################## REGISTERS ##################
    if($guser[purreg]         == ''){ $rgpurch = $none; }
    if($guser[salereg]          == ''){ $rgsale = $none; }
    if($guser[debnotreg]        == ''){ $rgdebnote = $none; }
    if($guser[debothreg]        == ''){ $rgdeboth = $none; }
    if($guser[crednotreg]       == ''){ $rgcrednote = $none; }
    if($guser[credothreg]       == ''){ $rgcredoth = $none; }
    if($guser[inwreg]           == ''){ $rginward = $none; }
    if($guser[outreg]           == ''){ $rgoutward = $none; }
    if($guser[damreg]           == ''){ $rgdamaged = $none; }
    if($guser[excreg]           == ''){ $rgexcess = $none; }
    if($guser[driverreg]        == ''){ $rgdriver = $none; }
    if($guser[taxinvreg]        == ''){ $rgtaxinv = $none; }
    if($guser[balreg]           == ''){ $rgbalance = $none; }
    
    ################## TOOLS & DASHBOARD ##################
    if($guser[trbal]           == ''){ $fnbalance = $none; }
    if($guser[profit]           == ''){ $fnprofit = $none; }
    if($guser[profshar]         == ''){ $fnprofshar = $none; }
    if($guser[balsheet]         == ''){ $fnbalsheet = $none; }
    
    
    ################## TOOLS & DASHBOARD ##################
    if($guser[compsetup]        == ''){ $tlcompany = $none; }
    if($guser[backup]           == ''){ $tlbackup = $none; }
    if($guser[profile]          == ''){ $tlprofile = $none; }
    if($guser[dstock]           == ''){ $dstock = $none; }
    }

?>