From cc963f2131c19c24ac6fff43c125769fa8f7b356 Mon Sep 17 00:00:00 2001
From: Tim Repke <repketim@informatik.hu-berlin.de>
Date: Sat, 16 Aug 2014 18:18:16 +0200
Subject: [PATCH] =?UTF-8?q?Statusseite=20erledigt,=20noch=20sch=C3=B6n=20m?=
 =?UTF-8?q?achen!?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 registration-system/index.php              |  3 +
 registration-system/status.php             | 88 ++++++++++++++++++++++
 registration-system/view/default_index.php |  2 +-
 3 files changed, 92 insertions(+), 1 deletion(-)
 create mode 100644 registration-system/status.php

diff --git a/registration-system/index.php b/registration-system/index.php
index 154e431..cb52e52 100644
--- a/registration-system/index.php
+++ b/registration-system/index.php
@@ -63,6 +63,9 @@ function index_show_content(){
     }
 
 }
+function show_content(){
+    index_show_content();
+}
 
 /**
  * puts the dataarray into DB
diff --git a/registration-system/status.php b/registration-system/status.php
new file mode 100644
index 0000000..a64d74a
--- /dev/null
+++ b/registration-system/status.php
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: tim
+ * Date: 8/16/14
+ * Time: 5:41 PM
+ */
+
+
+require 'config.inc.php';
+require 'frameworks/medoo.php';
+require 'frameworks/commons.php';
+require 'lang.php';
+
+$config_verbose_level = 0;
+
+$status_db = new medoo(array(
+    'database_type' => $config_db["type"],
+    'database_name' => $config_db["name"],
+    'server'        => $config_db["host"],
+    'username'      => $config_db["user"],
+    'password'      => $config_db["pass"]
+));
+
+require 'view/default_index.php';
+
+
+function show_content(){
+    global $status_db, $config_current_fahrt_id, $config_mailtag;
+    if(!isset($_REQUEST['hash']))
+        die("Kein Hash angegeben!");
+
+    $data = $status_db->get("bachelor", "*", array("bachelor_id"=>substr($_REQUEST['hash'],0,15)));
+    if(!$data)
+        die("Kein gültiger Hash gegeben!");
+
+    echo '
+    <table>
+        <tr>
+            <td>Melde-ID</td>
+            <td>'.$data["bachelor_id"].'</td>
+        </tr>
+        <tr>
+            <td>Name</td>
+            <td>'.$data["forname"].' '.$data["sirname"].' ('.$data["pseudo"].')</td>
+        </tr>
+        <tr>
+            <td>E-Mail-Adresse</td>
+            <td>'.$data["mehl"].'</td>
+        </tr>
+        <tr>
+            <td>Anreisetag + Art</td>
+            <td>'.$data["anday"].' ('.$data["antyp"].')</td>
+        </tr>
+        <tr>
+            <td>Abreisetag + Art</td>
+            <td>'.$data["abday"].' ('.$data["abtyp"].')</td>
+        </tr>
+        <tr>
+            <td>Essenswunsch</td>
+            <td>'.$data["essen"].'</td>
+        </tr>
+        <tr>
+            <td>Zahlung erhalten</td>
+            <td>'.((is_null($data["paid"])) ? "nein" : date('d.m.Y',$data["paid"])).'</td>
+        </tr>
+        <tr>
+            <td>Rückzahlung gesendet</td>
+            <td>'.((is_null($data["repaid"])) ? "nein" : date('d.m.Y',$data["repaid"])).'</td>
+        </tr>
+        <!--tr>
+            <td>Zurückgetreten</td>
+            <td>'.(($data["backstepped"]==1) ? "ja" : "nein").'</td>
+        </tr-->
+        <tr>
+            <td>Kommentar</td>
+            <td>'.$data["comment"].'</td>
+        </tr>
+    </table>';
+
+    $mailto = $status_db->get("fahrten", "kontakt", array("fahrt_id"=>$config_current_fahrt_id));
+    $subject= $config_mailtag.'Änderung zu '.$data["forname"].' '.$data["sirname"].' ('.$data["pseudo"].')';
+
+    echo '<a style="float:none" href="mailto:'.$mailto.'?subject='.str_replace(" ", "%20",$subject).'">Änderung melden</a>';
+
+}
+
+?>
\ No newline at end of file
diff --git a/registration-system/view/default_index.php b/registration-system/view/default_index.php
index 86792b0..3c40f4c 100644
--- a/registration-system/view/default_index.php
+++ b/registration-system/view/default_index.php
@@ -16,7 +16,7 @@
 <div id="menubox">
 
     <?php
-        index_show_content();
+        show_content();
     ?>
 
 
-- 
GitLab