<?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['vessel'] == '') {
        $vessel = $none;
    }
    if ($guser['port'] == '') {
        $port = $none;
    }
    if ($guser['launch'] == '') {
        $launch = $none;
    }
    if ($guser['orderby'] == '') {
        $orderby = $none;
    }
    
    if ( $guser['customer'] == '' && $guser['vessel'] == '' && $guser['port'] == '' && $guser['launch'] == '' ) {
        $master = $none;
    }

    ######################transactions######################
    if ($guser['invoice'] == '') {
        $invoice = $none;
    }
     if ($guser['challan'] == '') {
        $challan = $none;
    }

    if ($guser['invoice'] == '' && $guser['challan'] == '' ) {
        $transactions = $none;
    }
    ######################REPORTS######################

    if ($guser['chalreg'] == '') {
        $chalreg = $none;
    }
    if ($guser['invreg'] == '') {
        $invreg = $none;
    }
    if ($guser['pendbill'] == '') {
        $pendbill = $none;
    }
      
    if ($guser['chalreg'] == '' && $guser['invreg'] == '' && $guser['pendbill'] == '') {
        $reports = $none;
    } 
    
}
