aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/index.php')
-rw-r--r--bootstrap/index.php83
1 files changed, 41 insertions, 42 deletions
diff --git a/bootstrap/index.php b/bootstrap/index.php
index fbe4d8d..32b4a97 100644
--- a/bootstrap/index.php
+++ b/bootstrap/index.php
@@ -1,8 +1,12 @@
<?php
-require_once( dirname(__FILE__) . '/bootstrap.php');
ob_start();
+# if we kann redirect user mit the ?goto variable
+$redirect = true;
+
+require_once( dirname(__FILE__) . '/bootstrap.php');
+
$db = new db();
$user = new jg();
?>
@@ -10,9 +14,11 @@ $user = new jg();
<html>
<head>
<meta charset="utf-8">
+ <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
+ <link rel ="stylesheet" href="/static/style.css">
+ <style>.dl-horizontal dt{white-space: normal;} .btn-info{background-color:#3083D6;}</style>
<title>Junge Gemeinde Adlershof</title>
<link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'>
- <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<noscript><style>.navbar{margin-bottom:0;}</style></noscript>
</head>
@@ -23,50 +29,43 @@ require_once 'static/header.php';
<div class="text-center">
<div class="row">
<?php
-if ( ! $user->isLoggedIn() ){
-?>
-<form class="form-horizontal">
-<fieldset>
-<!-- Form Name -->
-<legend><h1>Junge Gemeinde Adlershof</h1></legend>
+ if($_GET["page"] == "" || $_GET["page"] == "index")
+ print_index();
+ else{
+ switch($_GET["page"]){
+ case("login"):
+ print_login();
+ break;
+ case("liste"):
+ print_list();
+ break;
-<!-- Text input-->
-<div class="form-group">
- <label class="col-md-4 control-label" for="name">Username:</label>
- <div class="col-md-5">
- <input id="name" name="name" placeholder="Put your username here." class="form-control input-md" required="" type="text">
- <span class="help-block">Required for login.</span>
- </div>
-</div>
+ case("update"):
+ print_update_list($_GET['id']);
+ break;
+ case("add"):
+ print_add_entry_to_list();
+ break;
+ case("404"):
+ print_404();
+ break;
+ case("action"):
+ require_once 'action.php';
+ break;
+ default:
+ print_index();
+ }
+ }
-<!-- Password input-->
-<div class="form-group">
- <label class="col-md-4 control-label" for="password">Password:</label>
- <div class="col-md-5">
- <input id="password" name="password" placeholder="Put your password here." class="form-control input-md" required="" type="password">
- <span class="help-block">Required for login.</span>
- </div>
+/*
+if ( isset($_GET['goto']) && $_GET['goto'] != "" && $redirect ){
+ header($_SERVER['SERVER_PROTOCOL'] . ' 302 Moved');
+ header('Location: /?page='.$_GET['goto']);
+}
+*/
+?>
</div>
-
-<!-- Button -->
-<div class="form-group">
- <label class="col-md-4 control-label" for="submit"></label>
- <div class="col-md-4">
- <button id="submit" name="submit" class="btn btn-info">Log In</button>
- </div>
</div>
-
-</fieldset>
-</form>
-<?php
-} else {
-?>
- <h1>Junge Gemeinde Adlershof</h1>
- </div>
- <div class="row">
- <p>Welcome!</p>
- </div>
<?php
require_once 'static/footer.php';
-}