<?php
session_start();
require_once("config/datenbankanbindung.php");     // f&uuml;gt die Datenbankanbindung ein: Sys:\php\includes\kurs\datenbankanbindung.php


# Domäne wird simuliert in der Programmierumgebung
#$_SESSION["global_domain"] = "hsnet";
#$_SESSION["global_uid"] = "1";
#$_SESSION["global_username"] = "SCHWARAL";

require_once("class_idee.php");

#---------------------------------------------------------------------------------------------------------------------------------------
# Ermittlung der Globalen Einstellungen
  $db = dbconnect();
  $result_ansprech_global = $db->query("SELECT wert1, wert2 FROM imt_parameter WHERE pid='1'");
  $row_ansprech_global = $result_ansprech_global->fetch_array();
  
  $result_ansprech_global1 = $db->query("SELECT wert1 FROM imt_parameter WHERE pid='3'");
  $row_ansprech_global1 = $result_ansprech_global1->fetch_array();
  
  $result_ansprech_uid = $db->query("SELECT imtuid FROM imt_user WHERE mail IN (SELECT wert2 FROM imt_parameter WHERE pid='1')");
  $row_ansprech_uid = $result_ansprech_uid->fetch_array();
  
  $global_service_admin = "$row_ansprech_global[wert1]";
  $global_service_mail = "$row_ansprech_global[wert2]";
  $global_service_admin_uid = "$row_ansprech_global1[wert1]";
  $global_service_uid = "$row_ansprech_uid[imtuid]";
#---------------------------------------------------------------------------------------------------------------------------------------


$username = $_SESSION["global_username"];
$uid = $_SESSION["global_uid"];

$login_dateiname = basename($_SERVER['PHP_SELF']);

if($uid == "" and $login_dateiname !='register.php'){
  header("Location:index.php"); 
}

#         echo "<hr>";
#         echo nl2br(print_r($_SESSION,true));
#         echo "<hr>";

#---------------------------------------------------------------------------------------------------------------------------------------
# Ermittlung des Templates
#  $db = dbconnect();
#  $result = $db->query("SELECT template FROM profil WHERE user='$user_admin'");
#  $row = $result->fetch_array();
#---------------------------------------------------------------------------------------------------------------------------------------

#$global_admin = 'Alexander Schwarz';
#$global_adminmail ='netblack@gmx.de';
#$template = $row[template];
$template = "modern";
#$template = "#standard";

#---------------------------------------------------------------------------------------------------------------------------------------
?>