<?php

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

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

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

    if ($guser['addnewvisa'] == '') {
        $addnewvisa = $none;
    }
    if ($guser['searchvisa'] == '') {
        $searchvisa = $none;
    }
    if ($guser['medical'] == '') {
        $medical = $none;
    }
    if ($guser['customer'] == '') {
        $customer = $none;
    }
    if ($guser['crm'] == '') {
        $crm = $none;
    }
    if ($guser['bank'] == '') {
        $bank = $none;
    }
    if ($guser['cash'] == '') {
        $cash = $none;
    }
    if ($guser['bankrecp'] == '') {
        $bankrecp = $none;
    }
    if ($guser['cashrecp'] == '') {
        $cashrecp = $none;
    }
    if ($guser['visareg'] == '') {
        $visareg = $none;
    }
    if ($guser['agentreg'] == '') {
        $agentreg = $none;
    }
    if ($guser['ledger'] == '') {
        $ledger = $none;
    }
    if ($guser['pastatus'] == '') {
        $pastatus = $none;
    }
    if ($guser['submission'] == '') {
        $submission = $none;
    }
    if ($guser['immigration'] == '') {
        $immigration = $none;
    }
    
    if ($guser['mofalist'] == '') {
        $mofalist = $none;
    }
    
    if (
        $guser['addnewvisa'] == '' && $guser['searchvisa'] == '' && $guser['medical'] == '' && $guser['customer'] == '' && $guser['crm'] == '' && $guser['bank'] == '' && $guser['bankrecp'] == '' && $guser['cashrecp'] == '' && $guser['visareg'] == '' && $guser['agentreg'] == '' && $guser['ledger'] == '' && $guser['pastatus'] == '' && $guser['submission'] == '' && $guser['immigration'] == '' && $guser['mofalist'] == ''
    ) {
        $entries = $none;
        $hr = $none;
    }

}
