<?php if(file_exists('../../../'.$_REQUEST['tenant'].'/config.php')){require_once('../../../'.$_REQUEST['tenant'].'/config.php');}
if(file_exists('/config.php')){require_once('/config.php');}

$type=$_SESSION['usertype'];
$id=$_SESSION['userid'];
switch($type){
default:break;

case "admins":
$stmt = $GLOBALS['con']->prepare("SELECT `status` FROM `admins` WHERE `id`='".$id."' ")or die(mysqli_error($GLOBALS['con']));
$stmt->execute();$iv=$stmt->get_result();$stmt->close();
$d=mysqli_fetch_array($iv);
if($d['status']=="active"){echo "a";}
else{echo "s";}
exit();
break;

case "agents":
$stmt = $GLOBALS['con']->prepare("SELECT `access` FROM `agents` WHERE `agent_number`='".$id."' ")or die(mysqli_error($GLOBALS['con']));
$stmt->execute();$iv=$stmt->get_result();$stmt->close();
$d=mysqli_fetch_array($iv);
if($d['access']==0){echo "s";}
else{echo "a";}
exit();
break;

case "surveyor":
$stmt = $GLOBALS['con']->prepare("SELECT `access` FROM `surveyor` WHERE `id`='".$id."' ")or die(mysqli_error($GLOBALS['con']));
$stmt->execute();$iv=$stmt->get_result();$stmt->close();
$d=mysqli_fetch_array($iv);
if($d['access']==0){echo "s";}
else{echo "a";}
exit();
break;
}