mirror of
https://github.com/tim-krehan/shopping-list.git
synced 2024-12-17 22:19:37 +01:00
81 lines
1.9 KiB
PHP
81 lines
1.9 KiB
PHP
|
<?php
|
||
|
session_start();
|
||
|
|
||
|
if (!($_SESSION["docroot"]))
|
||
|
{
|
||
|
$_SESSION["docroot"] = __DIR__;
|
||
|
}
|
||
|
include $_SESSION["docroot"].'/config/config.php';
|
||
|
if (($CONFIG["installed"]==false)&&($_GET["site"]!="error")) {
|
||
|
header("Location: /install/install.php");
|
||
|
exit;
|
||
|
}
|
||
|
if($_GET["site"]!="error"){
|
||
|
include $_SESSION["docroot"].'/php/auth.php';
|
||
|
}
|
||
|
?>
|
||
|
<html lang="de" dir="ltr">
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<meta name="theme-color" content="#4CAF50" />
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<link rel="apple-touch-icon" href="/pic/fav.ico">
|
||
|
<link rel="shortcut icon" type="image/png" href="/pic/fav.ico"/>
|
||
|
<link rel="stylesheet" href="/style/master.css">
|
||
|
<script src="/bin/jquery.js"></script>
|
||
|
<title>Einkaufsliste</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<?php
|
||
|
echo '<div id="content">';
|
||
|
if(in_array("site", array_keys($_GET)))
|
||
|
{
|
||
|
$site = $_GET["site"];
|
||
|
}
|
||
|
else{
|
||
|
$site = "-1";
|
||
|
}
|
||
|
switch ($site) {
|
||
|
case "login":
|
||
|
include $_SESSION["docroot"].'/cont/login.php';
|
||
|
break;
|
||
|
|
||
|
case "list":
|
||
|
include $_SESSION["docroot"].'/cont/list.php';
|
||
|
break;
|
||
|
|
||
|
case "recipes":
|
||
|
include $_SESSION["docroot"].'/cont/recipes.php';
|
||
|
break;
|
||
|
|
||
|
case "recipe":
|
||
|
include $_SESSION["docroot"].'/cont/recipe.php';
|
||
|
break;
|
||
|
|
||
|
case "new-recipe":
|
||
|
include $_SESSION["docroot"].'/cont/manageRecipe.php';
|
||
|
break;
|
||
|
|
||
|
case "edit-recipe":
|
||
|
include $_SESSION["docroot"].'/cont/manageRecipe.php';
|
||
|
break;
|
||
|
|
||
|
case "new-user":
|
||
|
include $_SESSION["docroot"].'/cont/adduser.php';
|
||
|
break;
|
||
|
|
||
|
case "error":
|
||
|
include $_SESSION["docroot"].'/cont/error.php';
|
||
|
break;
|
||
|
|
||
|
default:
|
||
|
include $_SESSION["docroot"].'/cont/list.php';
|
||
|
$site = "list";
|
||
|
break;
|
||
|
}
|
||
|
echo "</div>";
|
||
|
if($site && ($site!="login")){include $_SESSION["docroot"].'/cont/nav.php';}
|
||
|
?>
|
||
|
</body>
|
||
|
</html>
|