<?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['submissionent'] == '') {
        $submissionent = $none;
    }
    if ($guser['visareg'] == '') {
        $visareg = $none;
    }
    if ($guser['agentreg'] == '') {
        $agentreg = $none;
    }
    if ($guser['pastatus'] == '') {
        $pastatus = $none;
    }
    if ($guser['movefile'] == '') {
        $movefile = $none;
    }
    if ($guser['blamt'] == '') {
        $blamt = $none;
    }
    if ($guser['stampdateupd'] == '') {
        $stampdateupd = $none;
    }
    if ($guser['crm'] == '') {
        $crm = $none;
    }
    if ($guser['cash'] == '') {
        $cash = $none;
    }
    if ($guser['cashrecp'] == '') {
        $cashrecp = $none;
    }
    if ($guser['bank'] == '') {
        $bank = $none;
    }
    if ($guser['bankrecp'] == '') {
        $bankrecp = $none;
    }
    if ($guser['mofalist'] == '') {
        $mofalist = $none;
    }
    if ($guser['submission'] == '') {
        $submission = $none;
    }
   
    if ($guser['osbill'] == '') {
        $osbill = $none;
    }
   
    
    if (
        $guser['addnewvisa'] == '' && $guser['searchvisa'] == '' && $guser['submissionent'] == '' && $guser['visareg'] == '' && $guser['osbill'] == '' &&
         $guser['agentreg'] == '' && $guser['pastatus'] == '' && $guser['movefile'] == '' && $guser['blamt'] == '' && $guser['stampdateupd'] == ''
          && $guser['crm'] == '' && $guser['cash'] == '' && $guser['cashrecp'] == '' && $guser['bank'] == '' && $guser['bankrecp'] == '' && 
          $guser['mofalist'] == '' && $guser['submission'] == ''
    ) {
        $entries = $none;
        $hr = $none;
    }

}
