76 lines
2.1 KiB
PHP
76 lines
2.1 KiB
PHP
|
<?php
|
||
|
|
||
|
error_reporting(E_ALL); //Debuging
|
||
|
require_once 'include/DBConnection.inc.php';
|
||
|
function autoloader($classname)
|
||
|
{
|
||
|
include 'class/' . $classname . '.php';
|
||
|
}
|
||
|
spl_autoload_register('autoloader');
|
||
|
|
||
|
$session = new Session();
|
||
|
$db = new Datenbank($dbname, $username, $password, $servername);
|
||
|
|
||
|
/*===============================*/
|
||
|
|
||
|
if (isset($_SESSION["login"]) && $session->get("login") == 1) {
|
||
|
if (isset($_SESSION["reload"]) && $session->get("reload") == 1) {
|
||
|
$session->destroy();
|
||
|
$session->start();
|
||
|
$session->set("finished", 1);
|
||
|
$url = "index.php";
|
||
|
header("Location: $url");
|
||
|
echo '<script type="text/javascript">';
|
||
|
echo 'window.location.href="'.$url.'";';
|
||
|
echo '</script>';
|
||
|
echo '<noscript>';
|
||
|
echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
|
||
|
echo '</noscript>'; exit;
|
||
|
} else {
|
||
|
$session->set("reload", 1);
|
||
|
}
|
||
|
if (isset($_SESSION["status"]) && $session->get("status") == "ok") {
|
||
|
$message = $session->get("message");
|
||
|
}
|
||
|
} else {
|
||
|
$session->set("status", "error");
|
||
|
$session->set("message", "Nicht eingeloggt");
|
||
|
$url = "index.php";
|
||
|
header("Location: $url");
|
||
|
echo '<script type="text/javascript">';
|
||
|
echo 'window.location.href="'.$url.'";';
|
||
|
echo '</script>';
|
||
|
echo '<noscript>';
|
||
|
echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
|
||
|
echo '</noscript>'; exit;
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<title>Sportwahlen | Check</title>
|
||
|
<link rel="stylesheet" href="assets/css/main.css">
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<?php if (isset($message) && $message != ""): ?>
|
||
|
<div class="modal">
|
||
|
<div class="message sucsses">
|
||
|
<!-- Ausgabe einer eventuellen Statusmeldung -->
|
||
|
<p><?php echo $message; ?></p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<?php endif;?>
|
||
|
<noscript>
|
||
|
<p>
|
||
|
Bitte einmal Neuladen (F5-Taste)
|
||
|
</p>
|
||
|
</noscript>
|
||
|
<script src="assets/js/main.js"></script>
|
||
|
</body>
|
||
|
|
||
|
</html>
|