Location: PHPKode > projects > OpenBnet > OpenBnet_1.0_final/includes/admin.php
<?
// +----------------------------------------------------------------------+
// | OpenBnet  (B├╝rgernetz)                                               |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004 Joachim Seitz                                     |
// +----------------------------------------------------------------------+
// | Distributed under Artistic License                                   |
// +----------------------------------------------------------------------+

if ($logged_in==0){
header('Location: index.php');
exit;
}

$queri = "SELECT * FROM $adminrechte_table WHERE werbn='$bn'";
$resuli = mysql_query($queri);
if(mysql_num_rows($resuli)) $adminstatus=1;
else{
   $adminstatus=0;
   header('Location: profil.php?page=adminerror');
   exit;
}

$result = mysql_query("SELECT * FROM $adminrechte_table WHERE werbn='$bn'");
while ($row = mysql_fetch_array($result)){
   $o_buerger_status=$row['buerger'];
   $o_firmen_status=$row['firmen'];
   $o_parteien_status=$row['parteien'];
   $o_vereine_status=$row['vereine'];
   $o_rechtevergeben_status=$row['rechtevergeben'];
   $o_einstellungen_status=$row['einstellungen'];
}
//template starten...
$tmpl = new vlibTemplate('templates/main.html');
//decide which menus are available
if ($o_vereine_status==1) $tmpl->setVar('show_vereine', 1);
if ($o_parteien_status==1) $tmpl->setVar('show_parteien', 1);
if ($o_buerger_status==1) $tmpl->setVar('show_buerger', 1);
if ($o_firmen_status==1) $tmpl->setVar('show_unternehmen', 1);
if ($o_einstellungen_status==1) $tmpl->setVar('show_einstellungen', 1);
if ($o_rechtevergeben_status==1) $tmpl->setVar('show_rechte', 1);

if ($o_vereine_status==1 OR $o_parteien_status==1 OR $o_buerger_status==1) $tmpl->setVar('show_allforinnen', 1);
if ($o_firmen_status==1) $tmpl->setVar('show_allforwirtschaft', 1);
if ($o_einstellungen_status==1) $tmpl->setVar('show_allwebmaster', 1);
if ($o_rechtevergeben_status==1) $tmpl->setVar('show_allpraesi', 1);

//menu user
if ($_GET['menu_close']){
   if ($_GET['menu_close']=="menu_innenminister") $_SESSION['menu_innenminister']=0;
   if ($_GET['menu_close']=="menu_wirtschaftsminister") $_SESSION['menu_wirtschaftsminister']=0;
   if ($_GET['menu_close']=="menu_unionspraesident") $_SESSION['menu_unionspraesident']=0;
   if ($_GET['menu_close']=="menu_webmaster") $_SESSION['menu_webmaster']=0;
}
elseif ($_GET['menu_open']){
   if ($_GET['menu_open']=="menu_innenminister") $_SESSION['menu_innenminister']=1;
   if ($_GET['menu_open']=="menu_wirtschaftsminister") $_SESSION['menu_wirtschaftsminister']=1;
   if ($_GET['menu_open']=="menu_unionspraesident") $_SESSION['menu_unionspraesident']=1;
   if ($_GET['menu_open']=="menu_webmaster") $_SESSION['menu_webmaster']=1;
}

if (!$_SESSION['menu_innenminister']){
   if ($_GET['menu_close']=="menu_innenminister") $_SESSION['menu_innenminister']=0;
}
if (!$_SESSION['menu_wirtschaftsminister']){
   if ($_GET['menu_close']=="menu_wirtschaftsminister") $_SESSION['menu_wirtschaftsminister']=0;
}
if (!$_SESSION['menu_unionspraesident']){
   if ($_GET['menu_close']=="menu_unionspraesident") $_SESSION['menu_unionspraesident']=0;
}
if (!$_SESSION['menu_webmaster']){
   if ($_GET['menu_close']=="menu_webmaster") $_SESSION['menu_webmaster']=0;
}
//menuser end

if ($_SESSION['menu_wirtschaftsminister']==1) $tmpl->setVar('show_wirtschaftsminister', 1);
if ($_SESSION['menu_unionspraesident']==1) $tmpl->setVar('show_unionspraesident', 1);
if ($_SESSION['menu_innenminister']==1) $tmpl->setVar('show_innenminister', 1);
if ($_SESSION['menu_webmaster']==1) $tmpl->setVar('show_webmaster', 1);


$tmpl->setVar('nav', 'nav_admin');
?>
Return current item: OpenBnet