<?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'";
    ######################MASTERS######################
    
    if ($guser['customer'] == '')        { $customer = $none; }
    if ($guser['agent'] == '')           { $agent = $none; }
    if ($guser['cash'] == '')            { $cash = $none; }
    if ($guser['expense'] == '')         { $expense = $none; }
    if ($guser['carrierfees'] == '')     { $carrierfees = $none; }
    if ($guser['invoiceent'] == '')      { $invoiceent = $none; }
    if ($guser['companyinoutrep'] == '') { $companyinoutrep = $none; }
    if ($guser['invoicestatus'] == '') { $invoicestatus = $none; }
    if ($guser['contexp'] == '') { $contexp = $none; }

//    if ( $guser['customer'] == '' && $guser['agent'] == '' && $guser['cash'] == '' &&  $guser['expense'] == '' ) 
//        { $master = $none; }

    ###################### TRANSACTIONS ######################
    
//    if ($guser['payin'] == '')       { $payin = $none; }
//    if ($guser['payout'] == '')      { $payout = $none; }
//    if ($guser['agentin'] == '')     { $agentin = $none; }
//    if ($guser['agentout'] == '')    { $agentout = $none; }
//
//    if ($guser['payin'] == '' && $guser['payout'] == '' && $guser['agentin'] == '' && $guser['agentout'] == '' && $guser['carrierfees'] == '' ) 
//        { $transactions = $none; }

    ###################### REPORTS ######################
    
//    if ($guser['partyinout'] == '')      { $partyinout = $none; }
//    if ($guser['agentinrep'] == '')      { $agentinrep = $none; }
//    if ($guser['agentoutrep'] == '')     { $agentoutrep = $none; }
//    if ($guser['cashinoutrep'] == '')    { $cashinoutrep = $none; }
//    if ($guser['containerrep'] == '')    { $containerrep = $none; }
//    
//    if ( $guser['partyinout'] == '' && $guser['agentinrep'] == '' && $guser['agentoutrep'] == '' && $guser['companyinoutrep'] == '' && $guser['cashinoutrep'] == '' && $guser['containerrep']  == '' ){ 
//        $reports = $none; 
//    }

    ################### FINALIZATION ###################
    if ($guser['closestk'] == '') {
        $closestk = $none;
    }
    if ($guser['trbal'] == '') {
        $trbal = $none;
    }
    if ($guser['profloss'] == '') {
        $profloss = $none;
    }
    if ($guser['profshar'] == '') {
        $profshar = $none;
    }
    if ($guser['balsheet'] == '') {
        $balsheet = $none;
    }
    if (
            $guser['closestk'] == '' && $guser['trbal'] == '' && $guser['profloss'] == '' && $guser['profshar'] == '' && $guser['balsheet'] == ''
    ) {
        $finalization = $none;
    }
}
