<?php
include_once 'classes/TestProjektSmarty.class.php';
require_once("config.inc.php");
#$template = "standard";
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
$smarty = new Smarty();
require_once "language/german.inc.php";

$db = dbconnect();

#Hat User ein Adminrecht

$result_admin = $db->query("SELECT count(*) Anz FROM dep_rollen_user_zuord WHERE imtuid = '$uid' AND roid='1'");
#echo "SELECT count(*) Anz FROM dep_rollen_user_zuord WHERE imtuid = '$uid' AND roid='1'<br>";
$row_admin = $result_admin->fetch_array();

if($row_admin[Anz] > 0){
  $smarty->assign('titel_admin', "1");
}


$result_ausschuss = $db->query("SELECT count(*) Anz FROM dep_rollen_user_zuord WHERE imtuid = '$uid' AND roid in (4,5)");
$row_ausschuss = $result_ausschuss->fetch_array();

if($row_ausschuss[Anz] > 0){
  $smarty->assign('titel_ausschuss', "1");
}


$result_beteiligte = $db->query("SELECT count(*) Anz FROM dep_rollen_user_zuord WHERE imtuid = '$uid' AND roid='3'");
$row_beteiligte = $result_beteiligte->fetch_array();

if($row_beteiligte[Anz] > 0){
  $smarty->assign('titel_beteiligte', "1");
}


$result_gutachter = $db->query("SELECT count(*) Anz FROM dep_rollen_user_zuord WHERE imtuid = '$uid' AND roid='2'");
$row_gutachter = $result_gutachter->fetch_array();

if($row_gutachter[Anz] > 0){
  $smarty->assign('titel_gutachter', "1");
}


$smarty->display("$template/$templatename");
?>