<?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['airline'] == '') {
        $airline = $none;
    }

    if ($guser['sector'] == '') {
        $sector = $none;
    }

    if ($guser['city'] == '') {
        $city = $none;
    }

    if ($guser['tour'] == '') {
        $tour = $none;
    }

    if ($guser['hotelcatg'] == '') {
        $hotelcatg = $none;
    }

    if ($guser['hotels'] == '') {
        $hotels = $none;
    }

    if ($guser['roomcatg'] == '') {
        $roomcatg = $none;
    }

    if ($guser['roomview'] == '') {
        $roomview = $none;
    }

    if ($guser['rooms'] == '') {
        $rooms = $none;
    }

    if ($guser['customer'] == '') {
        $customer    = $none;
    }

    if ($guser['supplier'] == '') {
        $supplier = $none;
    }

    if ($guser['class'] == '') {
        $class = $none;
    }

    if ($guser['vehicle'] == '') {
        $vehicle = $none;
    }

    if ($guser['bank'] == '') {
        $bank = $none;
    }

    if ($guser['cash'] == '') {
        $cash = $none;
    }

    if ($guser['expense'] == '') {
        $expense = $none;
    }

    if ($guser['agent'] == '') {
        $agent = $none;
    }

    if ($guser['addbook'] == '') {
        $addbook = $none;
    }

    if ($guser['visa'] == '') {
        $visa = $none;
    }

    if ($guser['envprint'] == '') {
        $envprint = $none;
    }

    if ($guser['mealtype'] == '') {
        $mealtype = $none;
    }


    if (
        $guser['airline'] == '' && $guser['sector'] == '' && $guser['city'] == '' && $guser['tour'] == '' && $guser['hotelcatg'] == ''
        && $guser['hotels'] == '' && $guser['roomcatg'] == '' && $guser['roomview'] == '' && $guser['rooms'] == '' && $guser['customer'] == ''
        && $guser['supplier'] == '' && $guser['class'] == '' && $guser['vehicle'] == '' && $guser['bank'] == '' && $guser['cash'] == ''
        && $guser['expense'] == '' && $guser['agent'] == ''   && $guser['addbook'] == '' && $guser['visa'] == '' &&  $guser['envprint'] == '' &&  $guser['mealtype'] == '') {

        $masters = $none;
    }

    ###################### FIT ######################

    if ($guser['fit_ent'] == '') {
        $fit_ent = $none;
    }

    if ($guser['hotelpurch'] == '') {
        $hotelpurch = $none;
    }

    if ($guser['osbill'] == '') {
        $osbill = $none;
    }

    if ($guser['summary'] == '') {
        $summary = $none;
    }

    if ($guser['tiktpurchreg'] == '') {
        $tiktpurchreg = $none;
    }

    if ($guser['hotelpurchreg'] == '') {
        $hotelpurchreg = $none;
    }

    if ($guser['laundrypurchreg'] == '') {
        $laundrypurchreg = $none;
    }

    if ($guser['transpurchreg'] == '') {
        $transpurchreg = $none;
    }

    if ($guser['visapurchreg'] == '') {
        $visapurchreg = $none;
    }

    if ($guser['visanew'] == '') {
        $visanew = $none;
    }

    if ($guser['tiktnew'] == '') {
        $tiktnew = $none;
    }

    if ($guser['recdbook'] == '') {
        $recdbook = $none;
    }

    if ($guser['hotelarrdtl'] == '') {
        $hotelarrdtl = $none;
    }

    if ($guser['foodarrdtl'] == '') {
        $foodarrdtl = $none;
    }

    if ($guser['laundarrdtl'] == '') {
        $laundarrdtl = $none;
    }

    if ($guser['transarrdtl'] == '') {
        $transarrdtl = $none;
    }

    if ($guser['foodpurchreg'] == '') {
        $foodpurchreg = $none;
    }

    if ($guser['tiktsalereg'] == '') {
        $tiktsalereg = $none;
    }

    if ($guser['hotelsalereg'] == '') {
        $hotelsalereg = $none;
    }

    if ($guser['foodsalereg'] == '') {
        $foodsalereg = $none;
    }

    if ($guser['laundrysalereg'] == '') {
        $laundrysalereg = $none;
    }

    if ($guser['transpsalereg'] == '') {
        $transpsalereg = $none;
    }

    if ($guser['visasalereg'] == '') {
        $visasalereg = $none;
    }

    if ($guser['hotelsl'] == '') {
        $visasalereg = $none;
    }

    if (
        $guser['tiktsalereg'] == '' && $guser['hotelsalereg'] == '' && $guser['foodsalereg'] == '' &&
        $guser['laundrysalereg'] == '' && $guser['transpsalereg'] == '' && $guser['visasalereg'] == ''
    ) {
        $sale = $none;
    }

    if (
        $guser['tiktpurchreg'] == '' && $guser['hotelpurchreg'] == '' && $guser['laundrypurchreg'] == ''
        && $guser['transpurchreg'] == '' && $guser['visapurchreg'] == ''
    ) {
        $purchase = $none;
    }

    if (
        $guser['fit_ent'] == '' && $guser['hotelpurch'] == '' && $guser['osbill'] == '' && $guser['summary'] == '' &&
        $guser['tiktpurchreg'] == '' && $guser['hotelpurchreg'] == '' && $guser['laundrypurchreg'] == ''  && $guser['transpurchreg'] == '' && 
        $guser['visapurchreg'] == '' && $guser['visanew'] == ''  && $guser['tiktnew'] == '' &&$guser['recdbook'] == '' &&
        $guser['hotelarrdtl'] == '' && $guser['foodarrdtl'] == '' && $guser['laundarrdtl'] == '' && $guser['transarrdtl'] == '' && 
        $guser['tiktsalereg'] == '' && $guser['hotelsalereg'] == '' && $guser['foodsalereg'] == '' &&
        $guser['laundrysalereg'] == '' && $guser['transpsalereg'] == '' && $guser['visasalereg'] == '' && $guser['hotelsl'] == ''
    ) {
        $fit = $none;
    }

    ###################### Haj Umrah ######################

    if ($guser['bookform'] == '') {
        $bookform = $none;
    }

    if ($guser['paxform'] == '') {
        $paxform = $none;
    }

    if ($guser['updform'] == '') {
        $updform = $none;
    }

    if ($guser['classrep'] == '') {
        $classrep = $none;
    }

    if ($guser['monclass'] == '') {
        $monclass = $none;
    }

    if ($guser['agentclass'] == '') {
        $agentclass = $none;
    }

    if ($guser['mainsum'] == '') {
        $mainsum = $none;
    }

    if ($guser['maindt'] == '') {
        $maindt = $none;
    }

    if ($guser['namerep'] == '') {
        $namerep = $none;
    }

    if ($guser['airrep'] == '') {
        $airrep = $none;
    }

    if ($guser['visarep'] == '') {
        $visarep = $none;
    }

    if ($guser['passexprep'] == '') {
        $passexprep = $none;
    }

    if ($guser['qurrep'] == '') {
        $qurrep = $none;
    }

    if ($guser['datarep'] == '') {
        $datarep = $none;
    }

    if ($guser['ostt'] == '') {
        $ostt = $none;
    }

    if ($guser['revreg'] == '') {
        $revreg = $none;
    }

    if ($guser['payrecdreg'] == '') {
        $payrecdreg = $none;
    }

    if ($guser['recpbook'] == '') {
        $recpbook = $none;
    }

    if ($guser['paybook'] == '') {
        $paybook = $none;
    }

    if ($guser['agewise'] == '') {
        $agewise = $none;
    }

    if ($guser['orientreg'] == '') {
        $orientreg = $none;
    }

    if ($guser['opdbook'] == '') {
        $opdbook = $none;
    }

    if ($guser['paxmaindtl'] == '') {
        $paxmaindtl = $none;
    }
    if ($guser['paxdocverify'] == '') {
        $paxdocverify = $none;
    }
    if ($guser['medicalrep'] == '') {
        $medicalrep = $none;
    }

    if (
        $guser['bookform'] == '' && $guser['paxform'] == '' && $guser['updform'] == '' && $guser['classrep'] == ''
        && $guser['monclass'] == '' && $guser['agentclass'] == '' && $guser['mainsum'] == '' && $guser['maindt'] == ''
        && $guser['namerep'] == '' && $guser['airrep'] == '' && $guser['visarep'] == '' && $guser['passexprep'] == ''
        && $guser['qurrep'] == '' && $guser['datarep'] == '' && $guser['ostt'] == '' && $guser['revreg'] == ''
        && $guser['payrecdreg'] == '' && $guser['recpbook'] == '' && $guser['paybook'] == '' && $guser['agewise'] == ''
        && $guser['orientreg'] == '' && $guser['opdbook'] == '' && $guser['paxmaindtl'] == ''  && $guser['paxdocverify'] == ''
        && $guser['medicalrep'] == ''
    ) {

        $hajumrah = $none;
    }

    ################### Expenses / Accounts ###################

    if ($guser['bankrecp'] == '') {
        $bankrecp = $none;
    }

    if ($guser['cashrecp'] == '') {
        $cashrecp = $none;
    }

    if ($guser['bankpay'] == '') {
        $bankpay = $none;
    }

    if ($guser['cashpay'] == '') {
        $cashpay = $none;
    }

    if ($guser['ledger'] == '') {
        $ledger = $none;
    }

    if ($guser['bankpayexp'] == '') {
        $bankpayexp = $none;
    }

    if ($guser['bankbook'] == '') {
        $bankbook = $none;
    }

    if ($guser['cashpayexp'] == '') {
        $cashpayexp = $none;
    }

    if ($guser['expreg'] == '') {
        $expreg = $none;
    }

    if ($guser['payreg'] == '') {
        $payreg = $none;
    }

    if (

        $guser['bankrecp'] == '' && $guser['cashrecp'] == '' && $guser['bankpay'] == ''  && $guser['cashpay'] == '' &&
        $guser['ledger'] == '' && $guser['bankpayexp'] == '' && $guser['bankbook'] == '' && $guser['cashpayexp'] == '' &&
        $guser['expreg'] == '' && $guser['payreg'] == '' 

    ) {
        $expenses = $none;
    }


    ################### Dashboard ###################

    if ($guser['compsetup'] == '') {
        $tlcompany = $none;
    }

    if ($guser['tourname'] == '') {
        $tltour = $none;
    }

    if ($guser['hotelstat'] == '') {
        $hotelstat = $none;
    }

    if ($guser['checkinout'] == '') {
        $checkinout = $none;
    }
    if ($guser['inquiry'] == '') {
        $inquiry = $none;
    }
}
