<?php

if (isset($_SESSION["username_" . $dbname])) {
    $user = $_SESSION["username_" . $dbname];

    $getuser = mysqli_query($conn, "SELECT * FROM `passmain` WHERE `user`='$user'") or die(mysqli_error($conn));
    $guser = mysqli_fetch_array($getuser);
    $line = '';

    $none = "style='display:none'";


    if ($guser['usertype'] == 'K' || $guser['usertype'] == 'W') {
        $master = $none;
        $transaction = $none;
        $report = $none;
    }
    ######################MASTERS######################
    if ($guser['customer'] == '') {
        $customer = $none;
    }
    if ($guser['itemgrp'] == '') {
        $itemgrp = $none;
    }
    if ($guser['item'] == '') {
        $item = $none;
    }
    if ($guser['delvcomp'] == '') {
        $delvcomp = $none;
    }
    if ($guser['paytype'] == '') {
        $paytype = $none;
    }
    if ($guser['tablemast'] == '') {
        $tablemast = $none;
    }

    ###################### TRANSACTIONS ######################
    if ($guser['kotent'] == '') {
        $kotent = $none;
    }
    if ($guser['kotpent'] == '') {
        $kotpent = $none;
    }
    if ($guser['bill'] == '') {
        $bill = $none;
    }
    if ($guser['tabletrans'] == '') {
        $tabletrans = $none;
    }

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

    if ($guser['salereg'] == '') {
        $salereg = $none;
    }

    if ($guser['dailyrep'] == '') {
        $dailyrep = $none;
    }
    if ($guser['online'] == '') {
        $online = $none;
    }
    if ($guser['bestofd'] == '') {
        $bestofd = $none;
    }
    if ($guser['saleitem'] == '') {
        $saleitem = $none;
    }
    if ($guser['saletable'] == '') {
        $saletable = $none;
    }
    if ($guser['promocode'] == '') {
        $promocode = $none;
    }

    if ($guser['salegrp'] == '') {
        $salegrp = $none;
    }

    if ($guser['cardsum'] == '') {
        $cardsum = $none;
    }

    if ($guser['discsale'] == '') {
        $discsale = $none;
    }
}
