<?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['submissionent'] == '') {
        $submissionent = $none;
    }
    if ($guser['release'] == '') {
        $release = $none;
    }
    if ($guser['stampdateupd'] == '') {
        $stampdateupd = $none;
    }
    if ($guser['mofaent'] == '') {
        $mofaent = $none;
    }
    if ($guser['pastatus'] == '') {
        $pastatus = $none;
    }
    if ($guser['crm'] == '') {
        $crm = $none;
    }
    if ($guser['agent'] == '') {
        $agent = $none;
    }
    if ($guser['cash'] == '') {
        $cash = $none;
    }
    if ($guser['bank'] == '') {
        $bank = $none;
    }
    if ($guser['cashrecp'] == '') {
        $cashrecp = $none;
    }
    if ($guser['bankrecp'] == '') {
        $bankrecp = $none;
    }
    if ($guser['movefile'] == '') {
        $movefile = $none;
    }
    if ($guser['entinvoice'] == '') {
        $entinvoice = $none;
    }
    if ($guser['courin'] == '') {
        $courin = $none;
    }
    if ($guser['courout'] == '') {
        $courout = $none;
    }

    if (
        $guser['addnewvisa'] == '' && $guser['submissionent'] == '' && $guser['release'] == '' &&
         $guser['stampdateupd'] == '' && $guser['mofaent'] == '' && $guser['pastatus'] == '' && $guser['crm'] == '' && $guser['agent'] == ''
          && $guser['movefile'] == '' && $guser['cash'] == '' && $guser['cashrecp'] == '' && $guser['bank'] == '' && $guser['bankrecp'] == '' && 
          $guser['entinvoice'] == '' && $guser['courin'] == '' && $guser['courout'] == ''
    ) {
        $entries = $none;
        $hr = $none;
    }


###################### Reports ######################

if ($guser['visareg'] == '') {
        $visareg = $none;
    }
    if ($guser['agentreg'] == '') {
        $agentreg = $none;
    }
    if ($guser['submission'] == '') {
        $submission = $none;
    }
    if ($guser['mofalist'] == '') {
        $mofalist = $none;
    }
    if ($guser['nonsubmission'] == '') {
        $nonsubmission = $none;
    }
    if ($guser['blamt'] == '') {
        $blamt = $none;
    }
    if ($guser['ledger'] == '') {
        $ledger = $none;
    }
    if ($guser['mofanb'] == '') {
        $mofanb = $none;
    }
    if ($guser['courinreg'] == '') {
        $courinreg = $none;
    }
    if ($guser['couroutreg'] == '') {
        $couroutreg = $none;
    }
    
    if (
        $guser['visareg'] == '' && $guser['agentreg'] == '' && $guser['submission'] == '' && $guser['mofalist'] == '' &&
        $guser['nonsubmission'] == '' && $guser['blamt'] == '' && $guser['ledger'] == '' && $guser['mofanb'] == '' && $guser['courinreg'] == '' && $guser['couroutreg'] == '' 
         ) {
        $reports = $none;
    }
    
    ###################### Search Visa ######################
   
    if ($guser['searchvisa'] == '') {
        $searchvisa = $none;
    }

}
