Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • fsini-informatik/fsfahrttool
  • kleemeis/fsfahrttool
2 results
Show changes
Showing
with 1271 additions and 636 deletions
/* CSS Document */
body{ margin:0px; color:#333; font: 13px Helvetica; background:#eee;}
a{ color: #333; }
a:hover{ color: #999; }
img{border:0px;}
#logo{width:100%;height:80px;background:url('img/top.gif') repeat-x #666;}
#content{ height: 100%;padding:20px; }
#footer{background: url('img/bottom.gif') repeat-x;color:#ccff00; padding:15px; text-align:center;}
#footer a{color:#ccff00;}
.layout{background:#fff;border: 1px solid #ccc; padding:20px;margin-bottom:30px;}
code{ display:block;font:12px monospace; background: #e9ffe9;padding: 15px; border: solid 1px #ccddcc; margin-bottom:10px;}
tt{ display:block; font:12px monospace; background: #f6fdfd; padding: 15px; border: solid 1px #ccdddd; margin-bottom:0 0 10px 0; }
.color1{background:#eeeeff;}
.color2{background:#ddddee;}
\ No newline at end of file
<div class="output">This is test.html</div>
\ No newline at end of file
......@@ -19,10 +19,9 @@ class soft_protect
{
array_push($elems, "'".addslashes($protectkey)."'");
}
array_push($lines, "soft_protect([".implode(",", $elems)."], ".$element[1].");");
array_push($lines, "FAPI.attachSoftProtector([".implode(",", $elems)."], ".$element[1].");");
}
array_push($lines, "</script>");
return implode("\r\n", $lines);
}
}
?>
}
\ No newline at end of file
<?php
class template {
private $template_base = "template/default.php";
private $default_page = "error";
private $pages_base = "template/pages/";
private $state, $skey, $page;
private $content = "";
private function getSlug( $page ) {
$page = strip_tags( $page );
preg_match_all( "/([a-z0-9A-Z-_]+)/", $page, $matches );
$matches = array_map( "ucfirst", $matches[0] );
$slug = implode( "-", $matches );
return $slug;
}
public function set_page($pg){
$this->page = $pg;
}
public function set_content($cont){
$this->content = $cont;
}
public function show(){
$contentfile = (!isset($_REQUEST['page'])) ? $this->page : getSlug($_REQUEST['page']);
if($this->content == ""){
$content = @file_get_contents($this->pages_base."/".$contentfile.".txt");
if(!$content)
$content = @file_get_contents($this->pages_base."/".$this->default_page.".txt");
$this->content = $content;
}
require($this->template_base);
}
private function displayMainContent(){
echo $this->content;
}
private function display_status(){
}
}
<?php
session_start();
// error_reporting(E_ALL | E_STRICT);
require_once __DIR__ . '/frameworks/Environment.php';
require_once __DIR__ . '/view/default_index.php';
require_once __DIR__ . '/view/signups/index.php';
require 'config.inc.php';
require 'frameworks/medoo.php';
require 'frameworks/commons.php';
require 'lang.php';
require 'frameworks/soft_protect.php';
class IndexPage extends DefaultIndex {
protected $signupMethodDetails;
public function __construct() {
parent::__construct();
$this->signupMethodDetails = SignupMethods::getInstance()->getSignupMethodsBaseInfo();
}
$index_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';
// ================================================================
// functions
/**
* main function
* gets called within the template
*/
function index_show_content(){
global $index_db;
// Zeige Details einer FS Fahrt
if(isset($_REQUEST['fid'])){
$fid = $_REQUEST['fid'];
// =====================================================================================================================
// HEADERS
private function index_get_css_includes() {
$basefolder = 'view/';
// wenn die fahrt-id falsch, liste alle fahrten
if(!$index_db->has('fahrten',array('fahrt_id'=>$fid))){
comm_verbose(1,"FID nicht vorhanden!");
goto allefahrten;
}
$base_styles = ['style.css'];
$additional_styles = $this->index_get_dependencies_helper('getCSSDependencies');
// --- Fahrtinfos
index_show_fahrtHeader($fid);
$styles = array_merge($base_styles, $additional_styles);
// --- Formular
// storySubmit wg JQuery .submit() auf forms geht sonst nicht
if(isset($_REQUEST['success'])) {
echo '<div style="text-align:center; font-size: 20pt; font-weight: bold">Die Anmeldung war erfolgreich.</div>';
} elseif(isset($_REQUEST['full'])) {
echo '<div style="text-align:center; font-size: 20pt; font-weight: bold">Anmeldung leider fehlgeschlagen.</div>';
echo '<div style="text-align:center; font-size: 16pt; font-weight: bold">Die Anmeldegrenze wurde leider erreicht.</div>';
echo '<div style="text-align:center; font-size: 16pt; font-weight: bold">Bitte ein Auge offen halten, falls Plätze frei werden.</div>';
} elseif(isset($_REQUEST['submit']) || isset($_REQUEST['storySubmit'])){ // Formular auswerten
comm_verbose(1,"Formular bekommen");
$data = index_check_form();
if(!is_null($data))
{
if (index_form_to_db($data))
header("Location: ?fid=".$fid."&success");
else
header("Location: ?fid=".$fid."&full");
die();
}
} /*elseif(isset($_REQUEST['bid'])){ // Änderungsformular anzeigen, Anmeldung noch offen?
index_show_formular($fid, $_REQUEST['bid']);
} */ else { // leeres Formular anzeigen
if (comm_isopen_fid($index_db, $fid))
index_show_formular($fid);
else
{
echo '<div style="text-align:center; font-size: 20pt; font-weight: bold">Die Anmeldung wurde geschlossen.</div>';
echo '<div style="text-align:center; font-size: 16pt; font-weight: bold">Falls die Fahrt noch bevor steht:</div>';
echo '<div style="text-align:center; font-size: 16pt; font-weight: bold">Ein Auge offen halten, falls Plätze frei werden.</div>';
}
$ret = '';
foreach ($styles as $style) {
$ret .= "<link rel=\"stylesheet\" href=\"" . $basefolder . $style . "\" />\n";
}
// --- Liste der Anmeldungen
index_show_signupTable($fid);
index_show_fahrtHeader_js($fid);
}
// Zeige Übersicht aller Fahrten
else {
allefahrten:
index_show_alleFahrten();
return $ret;
}
}
function show_content(){
index_show_content();
}
/**
* puts the dataarray into DB
* adds version = 1 and generates a unique hash for entry
* @param $data
*/
function index_form_to_db($data){
global $index_db, $config_baseurl, $lang_regmail;
// === prepare data to insert ===
$data['version'] = 1;
$data['bachelor_id'] = comm_generate_key($index_db, "bachelor", "bachelor_id", array('fahrt_id'=>$data['fahrt_id']));
$data['anm_time'] = time();
$data['anday'] = date('Y-m-d', DateTime::createFromFormat('d.m.Y',$data['anday'])->getTimestamp());
$data['abday'] = date('Y-m-d', DateTime::createFromFormat('d.m.Y',$data['abday'])->getTimestamp());
// === check regstration full ===
$res = $index_db->get("fahrten", ["regopen", "max_bachelor"], ["fahrt_id" => $data['fahrt_id']]);
if (!$res || $res['regopen'] != "1")
return false;
$index_db->exec("LOCK TABLES fahrten, bachelor WRITE"); // count should not be calculated in two scripts at once
$insertOk = comm_isopen_fid($index_db, $data['fahrt_id']);
/*if ($cnt+1 >= $res['max_bachelor']) // registration is full already or after the following insert
$index_db->update("fahrten", ["regopen" => 0], ["fahrt_id" => $config_current_fahrt_id]); */
if ($insertOk)
$index_db->insert("bachelor", $data);
$index_db->exec("UNLOCK TABLES"); // insert is done now, count may be recalculated in other threads
if (!$insertOk)
return false; // full
// === notify success ===
$from = $index_db->get("fahrten", array("kontakt","leiter"), array("fahrt_id"=>$data['fahrt_id']));
$mail = comm_get_lang("lang_regmail", array( "{{url}}" => $config_baseurl."status.php?hash=".$data['bachelor_id'],
"{{organisator}}" => $from['leiter']));
comm_send_mail($index_db, $data['mehl'], $mail, $from['kontakt']);
return true;
}
/**
* validates the sent form
* on failure: repost form with prefilled data and errors
* on success: put data into DB and post success messagage
*
*/
function index_check_form(){
global $config_studitypen, $config_essen, $config_reisearten, $index_db, $invalidCharsRegEx;
$errors = array();
$data = array();
$fid = $_REQUEST['fid'];
$data['fahrt_id'] = $fid;
if(!comm_isopen_fid($index_db, $fid)){
$errors = array("Ungültige Fahrt!");
goto index_check_form_skip;
private function index_get_js_includes() {
$basefolder = 'view/';
$base_js = [
'js/jquery-1.11.1.min.js',
'js/jquery-ui.min.js',
'js/angular.min.js',
'js/elevator.js',
'js/hurrdurr.js',
'js/api.js'
];
$additional_js = $this->index_get_dependencies_helper('getJSDependencies');
$scripts = array_merge($base_js, $additional_js);
$ret = '';
$currPathLength = strlen(realpath(".")) + 1;
$uniq = array();
foreach ($scripts as $script) {
$script = substr(realpath($basefolder . $script), $currPathLength);
if (isset($uniq[$script])) continue;
$uniq[$script] = true;
$ret .= "<script type=\"text/javascript\" src=\"" . $script . "\"></script>\n";
}
return $ret;
}
$possible_dates = comm_get_possible_dates($index_db, $fid);
index_check_field('forname', $invalidCharsRegEx, $data, $errors, "Fehlerhafter oder fehlender Vorname!");
index_check_field('sirname', $invalidCharsRegEx, $data, $errors, "Fehlerhafter oder fehlender Nachname!");
index_check_field('pseudo', $invalidCharsRegEx, $data, $errors, "Fehlerhafter oder fehlender Anzeigename!");
index_check_field('mehl', 'mail', $data, $errors, "Fehlerhafte oder fehlende E-Mail-Adresse!");
index_check_field('anday', array_slice($possible_dates,0, -1), $data, $errors, 'Hilfe beim Ausfüllen: <a href="https://www.hu-berlin.de/studium/bewerbung/imma/exma">hier klicken!</a>');
index_check_field('antyp', $config_reisearten, $data, $errors, 'Trolle hier lang: <a href="https://www.hu-berlin.de/studium/bewerbung/imma/exma">hier klicken!</a>');
index_check_field('abday', array_slice($possible_dates,1), $data, $errors, 'Ruth hat mitgedacht: <a href="https://www.hu-berlin.de/studium/bewerbung/imma/exma">hier klicken!</a>');
index_check_field('abtyp', $config_reisearten, $data, $errors, 'Entwickler Bier geben und: <a href="https://www.hu-berlin.de/studium/bewerbung/imma/exma">hier klicken!</a>');
index_check_field('essen', $config_essen, $data, $errors, 'Hat das wirklich nicht gereicht??'); // ggf trollable machen mit /^[a-zA-Z]{2,50}$/
index_check_field('studityp', $config_studitypen, $data, $errors, 'Neue Chance, diesmal FS-Ini wählen!');
index_check_field('public', "public", $data, $errors, 'Trollololol');
index_check_field('virgin', array("Ja","Nein"), $data, $errors, 'Bitte Altersbereich wählen!');
index_check_field('comment', "comment", $data, $errors, 'Trollololol');
index_check_field('captcha', null, $data, $errors, 'Captcha falsch eingegeben.');
if($data['anday'] == $data['abday'])
array_push($errors, "Anreisetag = Abreisetag -> Bitte prüfen!");
index_check_form_skip:
if(count($errors)>0){
index_show_errors($errors);
index_show_formular($fid, NULL, $data);
return NULL;
} else {
return $data;
}
private function index_get_dependencies_helper($dependency_function_name) {
$methods_basefolder = 'signups/';
}
$signup_method = SignupMethods::getInstance();
/**
* puts out a list of all errors
* @param $errors
*/
function index_show_errors($errors){
echo '<div class="message error"><ul>';
foreach($errors as $e){
echo '<li>'.$e.'</li>';
}
echo'</ul></div>';
}
if ($signup_method->signupMethodExists()) {
$method_folder = $signup_method->getActiveMethodId();
/**
* checks for correctness of a given field ($index) by trying $check.
* pushes $errmess into $errarr, if $check fails
* pushes empty data on fail or correct data on success into $data
*
* check can be regex or array or special (public, mail, comment).
* if array, than check only succeeds if sent data is inside that array
*
* @param $index
* @param $check
* @param $datarr
* @param $errarr
* @param $errmess
*/
function index_check_field($index, $check, &$datarr, &$errarr, $errmess){
$pushdat = "";
comm_verbose(3,"checking ".$index);
if($index == "captcha"){
if(isset($_SESSION['captcha']) && isset($_REQUEST[$index]) && strtolower($_REQUEST[$index]) == strtolower($_SESSION['captcha']))
unset($_SESSION['captcha']);
else
{
array_push($errarr, $errmess);
$datarr[$index] = "";
}
} elseif($check == "public"){
if(isset($_REQUEST[$index])) $datarr[$index] = 0;
else $datarr[$index] = 1;
} elseif(!isset($_REQUEST[$index])){
array_push($errarr, $errmess);
$datarr[$index] = "";
} else {
$tmp = trim($_REQUEST[$index]);
if(is_array($check)){
if(!in_array($tmp,$check)){
array_push($errarr, $errmess);
//$tmp = "";
}
} else {
if($check == "mail"){
if (!filter_var($tmp, FILTER_VALIDATE_EMAIL)) {
array_push($errarr, $errmess);
//$tmp = "";
}
} elseif($check == "comment"){
// do nothing? maybe some graphical joke, is somebody tries to drop DB
} elseif(!(preg_match($check, $tmp)==1)){
array_push($errarr, $errmess);
//$tmp = "";
}
}
if($index == "virgin"){
if($_REQUEST[$index]=="Ja") $datarr[$index] = 0; // NOTE: for consistency: virgin = 0 means > 18
else $datarr[$index] = 1;
} else {
$datarr[$index] = $tmp;
return array_map(function ($d) use ($methods_basefolder, $method_folder) {
return $methods_basefolder . $method_folder . '/' . $d;
}, $signup_method->getActiveMethod()->$dependency_function_name());
}
return [];
}
}
/**
* Generates a registration form for a given event ($fid)
*
* @param $fid
* @param null $bid - if not null: prefill form with data from DB
* @param null $bachelor - if not null: prefill form with these data (take care, keys have to exist!)
*/
function index_show_formular($fid, $bid = NULL, $bachelor = NULL){
global $index_db, $config_studitypen, $config_essen, $config_reisearten, $invalidCharsRegEx;
$withStoryMode = !isset($_GET['noscript']) && !isset($_REQUEST['submit']) && !isset($_REQUEST['storySubmit']);
if ($withStoryMode)
echo '<noscript>';
$possible_dates = comm_get_possible_dates($index_db, $fid);
if(is_null($bachelor))
$bachelor = array('forname' => "", 'sirname' => "", 'anday' => $possible_dates[0], 'abday' => $possible_dates[count($possible_dates)-1], 'antyp' => "", 'abtyp' => "", 'pseudo' => "", 'mehl' => "", 'essen' => "", 'public' => "", 'virgin' => "", 'studityp' => "", 'comment'=>"");
if(!is_null($bid)){
if($index_db->has('bachelor',array('bachelor_id' => $bid))){
$bachelor = $index_db->select('bachelor', array('forname','sirname','anday','abday','antyp','abtyp','pseudo','mehl','essen','public','virgin','studityp','comment'), array('bachelor_id'=>$bid));
$bachelor = $bachelor[0];
private function index_get_additional_headers() {
$signup_method = SignupMethods::getInstance();
if ($signup_method->signupMethodExists()) {
return $signup_method->getActiveMethod()->getAdditionalHeader();
}
return '';
}
$fidd = is_null($bid) ? $fid : $fid."&bid=".$bid;
echo '<div id="stylized" class="myform">
<form id="form" name="form" method="post" action="index.php?fid='.$fidd.'">
<h1>Anmeldeformular</h1>
<p>Bitte hier verbindlich anmelden.</p>';
index_show_formular_helper_input("Vorname", "forname", $bachelor["forname"], "");
index_show_formular_helper_input("Nachname","sirname",$bachelor["sirname"],"");
index_show_formular_helper_input("Anzeigename","pseudo",$bachelor["pseudo"],"");
index_show_formular_helper_input("E-Mail-Adresse","mehl",$bachelor["mehl"],"regelmäßig lesen!");
index_show_formular_helper_sel("Du bist","studityp",$config_studitypen, $bachelor["studityp"],"");
index_show_formular_helper_sel("Alter 18+?","virgin",array("", "Nein", "Ja"), ($bachelor["virgin"]==0) ? "Ja" : "Nein", "Bist du älter als 18 Jahre?");
index_show_formular_helper_sel("Essenswunsch","essen",$config_essen, $bachelor["essen"],"Info für den Koch.");
index_show_formular_helper_sel2("Anreise","anday", array_slice($possible_dates,0, -1), $bachelor["anday"]
,"antyp",$config_reisearten, $bachelor["antyp"],"");
index_show_formular_helper_sel2("Abreise","abday", array_slice($possible_dates,1), $bachelor["abday"]
,"abtyp",$config_reisearten,$bachelor["abtyp"],"");
$soft_prot = new soft_protect();
echo $soft_prot->add(array('forname', 'sirname', 'pseudo'), $invalidCharsRegEx)->write();
echo'
<label>Anmerkung</label>
<textarea id="comment" name ="comment" rows="3" cols="50">'.$bachelor["comment"].'</textarea>
<input type="checkbox" name="public" value="public" style="width:40px"><span style="float:left">Anmeldung verstecken</span><br/>
<div style="clear:both"></div>';
index_show_formular_helper_input("Captcha eingeben","captcha","","");
echo '
<img src="view/captcha.php" /><br/>
<button type="submit" name="submit" id="submit" value="submit">Anmelden!</button>
<div class="spacer"></div>
</form>
</div>';
if ($withStoryMode)
{
function putTypesInObject($obj)
{
$text = '{ ';
$first = true;
foreach($obj as $key => $value)
{
if ($first)
$first = false;
else
$text .= ', ';
$text .= '"'.$key.'":"'.$value.'"';
}
$text .= ' }';
return $text;
}
echo '</noscript>';
echo '<h2>Anmeldeformular</h2>';
echo<<<END
<div id="storyhead"></div>
<div id="storycanvas">
<div id="storybox"></div>
<div id="story_umleitung" style="position:absolute; left:0px; bottom:-70px; background:#f0f; cursor:pointer; background:url(view/graphics/story/umleitung.png); width:120px; height: 70px" onclick="story.next(true)">&nbsp;</div>
<script type="text/javascript">
function comm_get_possible_dates()
{
return [
END;
$dates = comm_get_possible_dates($index_db, $fid);
foreach($dates as &$date)
$date = '"'.$date.'"';
echo implode(', ', $dates);
echo<<<END
];
}
function comm_get_food_types()
{
return [
END;
$dates = comm_get_possible_dates($index_db, $fid);
foreach($dates as &$date)
$date = '"'.$date.'"';
echo implode(', ', $dates);
echo<<<END
];
}
function config_get_travel_types()
{
return
END;
global $config_reisearten_o;
echo putTypesInObject($config_reisearten_o);
echo<<<END
;
}
function config_get_food_types()
{
return
END;
global $config_essen_o;
echo putTypesInObject($config_essen_o);
echo<<<END
;
}
</script>
</div>
<div style="text-align:center;font-weight:bold"><a style="float:none;margin:0 auto;"
END;
echo ' href="'.$_SERVER['REQUEST_URI'].'&noscript">Seite funktioniert nicht / zu bunt?</a></div>';
}
}
/**
* Puts out Label and Selection box
*
* @param $name
* @param $id
* @param $values
* @param $selected
* @param $subtext
*/
function index_show_formular_helper_sel($name, $id, $values, $selected, $subtext){
echo '<label>'.$name.'
<span class="small">'.$subtext.'</span>
</label>
<select name="'.$id.'" id="'.$id.'">';
foreach($values as $val){
echo '<option value="'.$val.'"';
if($val == $selected) echo ' selected';
echo'>'.$val.'</option>';
protected function echoHeaders() {
echo $this->index_get_css_includes();
echo $this->index_get_js_includes();
echo $this->index_get_additional_headers();
}
echo '</select>';
}
/**
* Puts out Label and two selection boxes side by side right below
*
* @param $name
* @param $id
* @param $values
* @param $selected
* @param $id2
* @param $values2
* @param $selected2
* @param $subtext
*/
function index_show_formular_helper_sel2($name, $id, $values, $selected, $id2, $values2, $selected2, $subtext){
echo '<label style="text-align:left">'.$name.'
<span class="small">'.$subtext.'</span>
</label><table><tr><td>
<select name="'.$id.'" id="'.$id.'" style="width:110px; text-align: center">';
foreach($values as $val){
echo '<option value="'.$val.'"';
if($val == $selected) echo ' selected';
echo'>'.$val.'</option>';
}
echo '</select></td><td><select name="'.$id2.'" id="'.$id2.'">';
foreach($values2 as $val){
echo '<option value="'.$val.'"';
if($val == $selected2) echo ' selected';
echo'>'.$val.'</option>';
}
echo '</select></td></tr></table>';
}
function index_show_formular_helper_input($name, $id, $value, $subtext){
echo '<label>'.$name.'
<span class="small">'.$subtext.'</span>
</label>
<input type="text" name="'.$id.'" id="'.$id.'" value="'.$value.'" />';
}
// =====================================================================================================================
// CONTENT
protected function echoContent() {
if (!$this->environment->isSelectedTripIdValid()) {
$this->showAlleFahrten();
$this->makeHurrDurr();
} else {
$fahrt = $this->environment->getTrip();
/**
* show list of all fahrten
*/
function index_show_alleFahrten(){
global $index_db;
comm_verbose(2,"Liste aller Fahrten (Jahr, Ziel, Zeitraum, Anz. Mitfahrer)");
echo '<h2>Anmeldung zur Fachschaftsfahrt</h2>';
$foos = $index_db->select("fahrten",array('fahrt_id','titel','ziel','von','bis','beschreibung','leiter','kontakt', 'max_bachelor'), "ORDER BY fahrt_id DESC");
$fids = [];
foreach($foos as $foo){
index_show_fahrtHeader($foo);
array_push($fids, $foo['fahrt_id']);
// --- Fahrtinfos
$this->showFahrtDetailBlock($fahrt);
$this->showFahrtDetailJS($fahrt);
if ($fahrt->getRegistrationState() != Fahrt::STATUS_IS_COUNTDOWN) {
// --- Anmeldebox
$this->showSignup($fahrt);
// --- Liste der Anmeldungen
$this->showSignupTable($fahrt);
$this->makeHurrDurr();
} else {
$this->showCountdown($fahrt->getOpenTime());
}
}
}
index_show_fahrtHeader_js($fids);
}
/**
* @param $fahrt wenn array, dann Datenbankrow; wenn zahl, dann wird das selektiert
*/
function index_show_fahrtHeader($fahrt){
global $index_db, $config_googleAPI;
if(!is_array($fahrt)){
// select fahrt by ID
$fahrt = $index_db->select('fahrten', array('fahrt_id','titel','ziel', 'von', 'bis', 'leiter', 'kontakt', 'beschreibung', 'max_bachelor'), array('fahrt_id'=> $fahrt));
if(!$fahrt){ index_show_alleFahrten(); return;}
else $fahrt = $fahrt[0];
/**
* @param $fahrt Fahrt
*/
private function showFahrtDetailBlock($fahrt) {
$details = $fahrt->getFahrtDetails();
echo '<div class="fahrt">
<div class="fahrt-left">
<a class="fahrthead" href="index.php?fid=' . $details['fahrt_id'] . '">' . $details['titel'] . '</a>
Ziel: <i>' . $details['ziel'] . '</i><br />
Datum: <i>' . $this->mysql2german($details['von']) . " - " . $this->mysql2german($details['bis']) . '</i><br />
Ansprechpartner: <i>' . $details['leiter'] . ' (' . $this->transformMail($details['kontakt']) . ')</i><br />
Anmeldungen: <i>' . $fahrt->getNumTakenSpots() . ' / ' . $fahrt->getNumMaxSpots() . '</i>
<p>' . $details['beschreibung'] . '</p>
</div>
<div class="map-canvas" id="map-canvas-' . $fahrt->getID() . '"></div>
<div style="clear:both"></div>
</div>';
}
$cnt = $index_db->count("bachelor", ["AND"=>
["backstepped" => NULL,
"fahrt_id" => $fahrt['fahrt_id']]]);
echo '<div class="fahrt">
<a class="fahrthead" href="index.php?fid='.$fahrt['fahrt_id'].'">'.$fahrt['titel'].'</a>';
echo 'Ziel: <i>'.$fahrt['ziel'].'</i><br />';
echo 'Datum: <i>'.comm_from_mysqlDate($fahrt['von'])." - ".comm_from_mysqlDate($fahrt['bis']).'</i><br />';
echo "Ansprechpartner: <i>".$fahrt['leiter']." (".comm_convert_mail($fahrt['kontakt']).")</i><br />";
echo "Anmeldungen: <i>".$cnt." / ".$fahrt['max_bachelor']."</i>";
echo '<p>'.$fahrt['beschreibung'].'</p>
<div class="map-canvas" id="map-canvas-'.$fahrt['fahrt_id'].'"></div>
</div>';
}
function index_show_fahrtHeader_js($fahrten){
global $index_db;
$pins = $index_db->select("fahrten", ["fahrt_id", "map_pin"], ["fahrt_id" => $fahrten]);
/**
* @param $fahrten Fahrt[]|Fahrt
*/
private function showFahrtDetailJS($fahrten) {
global $config_use_openstreetmap;
echo '<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script>';
if (!is_array($fahrten))
$fahrten = [$fahrten];
if ($config_use_openstreetmap) {
echo '<script type="text/javascript" src="https://openlayers.org/api/OpenLayers.js"></script><script type="text/javascript">';
} else {
echo '<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script type="text/javascript">
window.onload = function() {
$("div.fahrt-left i").click(function(){
});
$("div.fahrt-left i").hover(
function(){
$(this).html($(this).html().replace(/·/g, "&#128045;"));
$(this).html($(this).html().replace("Ø", "&#128053;"));
},
function(){
$(this).html($(this).html().replace(/🐭/g, "&middot;"));
$(this).html($(this).html().replace("🐵", "&Oslash;"));
}
);
};';
}
foreach($pins as $p){
echo'
var ziel_'.$p['fahrt_id'].' = new google.maps.LatLng('.str_replace(" ", ", ", $p["map_pin"] ).');
var marker_'.$p['fahrt_id'].';
var map_'.$p['fahrt_id'].';
$fids = [];
foreach ($fahrten as $fahrt) {
$fid = $fahrt->getID();
$pin = $fahrt->getGPS();
array_push($fids, $fid);
if ($config_use_openstreetmap) {
echo '
var ziel_' . $fid . ' = [' . str_replace(" ", ", ", $pin) . '];';
} else {
echo '
var ziel_' . $fid . ' = new google.maps.LatLng(' . str_replace(" ", ", ", $pin) . ');';
}
echo '
var marker_' . $fid . ';
var map_' . $fid . ';';
}
echo '
function initialize_maps() {
';
foreach ($fids as $fid) {
if ($config_use_openstreetmap) {
echo <<<EOF
map_$fid = new OpenLayers.Map("map-canvas-$fid");
map_$fid.addLayer(new OpenLayers.Layer.OSM());
var lonLat = new OpenLayers.LonLat(parseFloat(ziel_${fid}[1]), parseFloat(ziel_${fid}[0]))
.transform(
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
map_$fid.getProjectionObject() // to Spherical Mercator Projection
);
var zoom=10;
var markers = new OpenLayers.Layer.Markers("Markers");
map_$fid.addLayer(markers);
markers.addMarker(new OpenLayers.Marker(lonLat));
map_$fid.setCenter(lonLat, zoom);
EOF;
} else {
echo '
var mapOptions_' . $fid . ' = {
zoom: 8,
center: ziel_' . $fid . ',
panControl: false,
zoomControl: false,
scaleControl: true,
mapTypeControl: false,
streetViewControl: false,
overviewMapControl: false
};
map_' . $fid . ' = new google.maps.Map(document.getElementById(\'map-canvas-' . $fid . '\'), mapOptions_' . $fid . ');
marker_' . $fid . ' = new google.maps.Marker({
map:map_' . $fid . ',
draggable:true,
animation: google.maps.Animation.DROP,
position: ziel_' . $fid . '
});
marker_' . $fid . '.setAnimation(google.maps.Animation.BOUNCE);';
}
}
echo '}';
if ($config_use_openstreetmap) {
echo '$(initialize_maps)';
} else {
echo 'google.maps.event.addDomListener(window, \'load\', initialize_maps);';
}
echo '</script>';
}
echo'
function initialize() {
';
foreach($pins as $p){
echo'
var mapOptions_'.$p['fahrt_id'].' = {
zoom: 8,
center: ziel_'.$p['fahrt_id'].',
panControl: false,
zoomControl: false,
scaleControl: true,
mapTypeControl: false,
streetViewControl: false,
overviewMapControl: false
};
map_'.$p['fahrt_id'].' = new google.maps.Map(document.getElementById(\'map-canvas-'.$p['fahrt_id'].'\'), mapOptions_'.$p['fahrt_id'].');
marker_'.$p['fahrt_id'].' = new google.maps.Marker({
map:map_'.$p['fahrt_id'].',
draggable:true,
animation: google.maps.Animation.DROP,
position: ziel_'.$p['fahrt_id'].'
private function makeHurrDurr() {
echo "<script>
$(function () {
var hurdur = new HurDur();
new Elevator({
element: document.getElementById('nyan'),
mainAudio: 'view/audio/audio.ogg',
endAudio: 'view/audio/end-audio.ogg',
duration: 5000,
startCallback: hurdur.start,
endCallback: hurdur.stop
});
});
marker_'.$p['fahrt_id'].'.setAnimation(google.maps.Animation.BOUNCE);';
</script>";
}
echo'
}
private function showAlleFahrten() {
echo '<h2>Anmeldung zur Fachschaftsfahrt</h2>';
$fahrten = Fahrt::getAlleFahrten();
google.maps.event.addDomListener(window, \'load\', initialize);
</script>';
if (!$fahrten) {
echo 'Keine Fahrten im System gefunden';
} else {
foreach ($fahrten as $fahrt) {
$this->showFahrtDetailBlock($fahrt);
}
$this->showFahrtDetailJS($fahrten);
}
}
}
/**
* @param $fahrt wenn array, dann Datenbankrow; wenn zahl, dann wird das selektiert
*/
function index_show_fahrtHeader_old($fahrt){
global $index_db;
if(!is_array($fahrt)){
// select fahrt by ID
$fahrt = $index_db->select('fahrten', array('fahrt_id','titel','ziel', 'von', 'bis', 'leiter', 'kontakt', 'beschreibung'), array('fahrt_id'=> $fahrt));
if(!$fahrt){ index_show_alleFahrten(); return;}
else $fahrt = $fahrt[0];
private function showErrors($errors) {
echo '<div class="message error"><ul>';
foreach ($errors as $e) {
echo '<li>' . $e . '</li>';
}
echo '</ul></div>';
}
$cnt = $index_db->count("bachelor", ["AND"=>
["backstepped" => NULL,
"fahrt_id" => $fahrt['fahrt_id']]]);
echo '<div class="fahrt"><a class="fahrthead" href="index.php?fid='.$fahrt['fahrt_id'].'">'.$fahrt['titel'].'</a>';
echo 'Ziel: <i>'.$fahrt['ziel'].'</i><br />';
echo 'Datum: <i>'.comm_from_mysqlDate($fahrt['von'])." - ".comm_from_mysqlDate($fahrt['bis']).'</i><br />';
echo "Ansprechpartner: <i>".$fahrt['leiter']." (".comm_convert_mail($fahrt['kontakt']).")</i><br />";
echo "Anmeldungen: <i>".$cnt."</i>";
echo '<p>'.$fahrt['beschreibung'].'</p>
</div>';
}
/**
* show table of public registrations
*/
function index_show_signupTable($fid){
global $index_db, $config_studitypen;
private function showCountdown($opentime) {
echo '<script type="text/javascript" src="view/js/jquery.qrcode.js"></script>';
echo "
<script>
var opentime = " . $opentime . ";
var b = true;
$(function () {
var url = window.location.href;
if(url.indexOf('#showQR')>0) $('#QRcode').qrcode({
render: 'canvas',
ecLevel: 'Q',
size: 150,
fill: '#000',
background: null,
text: url.replace('#showQR',''),
radius: 0.5,
quiet:2,
mode: 2,
label: 'FS Fahrt',
fontname: 'sans',
fontcolor: '#ff9818'
});
var hurdur = new HurDur({
cats: 10,
loopcb: function() {
$('#text, body').stop().animate({color:b?'#ffffff':'#000000'}, 1000);
var now = (Date.now() + ((new Date()).getTimezoneOffset()*60))/1000;
var diff = opentime - now;
var view = '';
if (diff <= 0) {
view = '00:00:00.00';
} else {
view = hurrdurrr(parseInt(diff/60/60/24, 10)) + 'd ' + hurrdurrr(parseInt(diff / 60 / 60 % 24, 10))
+ 'h:' + hurrdurrr(parseInt(diff / 60 % 60, 10)) + 'm.' + hurrdurrr(parseInt(diff%60, 10)) + 's';
}
$('#countdown').html(view);
function hurrdurrr(num) {
return ((num < 10) ? '0' : '') + num;
}
b = !b;
}
});
hurdur.start();
});
</script>";
echo '<div id="text" style="font-weight:bold;text-align:center;font-size:40pt;font-family:Verdana, Geneva, sans-serif">
ANMELDUNG IN KÜRZE<br />
<span id="countdown"></span>
</div>';
echo '<div style="width:100%; margin-top: 20px;">
<div style="margin:0 auto; width:300px">
<iframe width="300" height="300" scrolling="no" frameborder="no"
src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/109529816&amp;auto_play=true&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></iframe>
</div>
</div>';
echo '<canvas id="QRcode" style="position: fixed; bottom: 10px; right: -240px;width:500px;height:250px;"></canvas>';
echo '<div style="position: fixed; right: 10px; bottom:10px;"><a href="#QRcode">QR-Code</a></div>';
}
echo '<h2>Angemeldet</h2>';
/**
* @param $fahrt Fahrt
*/
private function showSignupTable($fahrt) {
echo '<h2>Anmeldungen</h2>';
$data = $index_db->select('bachelor',array("pseudo","antyp","abtyp","anday","abday","comment","studityp"),
array("AND" => array(
'fahrt_id' => (int) $fid,
'public' => 1
)));
$bachelorsData = $fahrt->getBachelors(['public' => true, 'backstepped' => false, 'waiting' => false], ['anm_time'=> 'ASC']);
if(!$data) echo'<div class="signups">Noch keine (sichtbaren) Anmeldungen!</div>';
else {
echo '
<table class="signups">
if (!$bachelorsData) {
echo '<div class="signups">Noch keine (sichtbaren) Anmeldungen!</div>';
} else {
echo '
<table class="signups" cellspacing="0" cellpadding="0">
<thead>
<tr>
<!--th></th-->
<th></th>
<th>Anzeigename</th>
<th>Anreisetag</th>
<th>Anreiseart</th>
......@@ -593,24 +363,133 @@ echo '<h2>Angemeldet</h2>';
<th>Kommentar</th>
</tr>
</thead>';
foreach($data as $d){
echo '<tr>
<!--td>'.$d["studityp"].'</td-->
<td>'.$d["pseudo"].'</td>
<td>'.comm_from_mysqlDate($d["anday"]).'</td>
<td>'.index_show_signupTable_destroyTypes($d["antyp"]).'</td>
<td>'.comm_from_mysqlDate($d["abday"]).'</td>
<td>'.index_show_signupTable_destroyTypes($d["abtyp"]).'</td>
<td>'.$d["comment"].'</td>
</tr>';
foreach ($bachelorsData as $d) {
echo '<tr>
<td style="width: 58px;">'.$this->makeSignupBadge($d['signupstats']).' </td>
<td>' . $d["pseudo"] . '</td>
<td>' . $this->mysql2german($d["anday"]) . '</td>
<td>' . $this->translateTravelType($d["antyp"]) . '</td>
<td>' . $this->mysql2german($d["abday"]) . '</td>
<td>' . $this->translateTravelType($d["abtyp"]) . '</td>
<td style="word-break:break-all;">' . $d["comment"] . '</td>
</tr>';
}
echo '</table>';
}
echo '</table>';
}
}
function index_show_signupTable_destroyTypes($anabtyp){
global $config_reisearten, $config_reisearten_destroyed;
if(array_search($anabtyp, $config_reisearten)>=2)
return $config_reisearten_destroyed[array_rand($config_reisearten_destroyed)];
return $anabtyp;
private function makeSignupBadge($stats) {
$json = (empty($stats)) ? null : json_decode($stats, true);
if (empty($json) or !isset($json['method']) or !isset($json['methodinfo']) or !isset($this->signupMethodDetails[$json['method']]))
return '';
$method = $this->signupMethodDetails[$json['method']];
$logo = 'view/signups/'.$method['id'].'/'.$method['logo'];
$score = $method['score']($json['methodinfo']);
return '<img src="'.$logo.'" style="height: 1.2em;"/>
<span style="font-size:0.7em;float:right;margin-top:0.8em;">'.$score.'%</span>
<div class="progressbar"><span style="width: '.$score.'%"></span></div>';
}
private function translateTravelType($anabtyp) {
if ($anabtyp == 'INDIVIDUELL') {
return $this->environment->config['reiseartenDestroyed'][array_rand($this->environment->config['reiseartenDestroyed'])];
}
if (isset($this->environment->oconfig['reiseartenShort'][$anabtyp]))
return $this->environment->oconfig['reiseartenShort'][$anabtyp];
// well done, hacked the system, gets props for it :)
return $anabtyp;
}
/**
* @param $fahrt Fahrt
*/
private function showSignup($fahrt) {
$signup_method = SignupMethods::getInstance();
$fid = $fahrt->getID();
$status = $fahrt->getRegistrationState();
$waitlist_confirmed = $this->environment->isInWaitlistMode();
echo '<div id="signup-container">';
echo '<h2>Anmeldung</h2>';
// Anmeldung erfolgreich
if (isset($_REQUEST['success'])) {
echo '<div style="text-align:center; font-size: 20pt; font-weight: bold">Die Anmeldung war erfolgreich.</div>';
} // Anmeldung fehlgeschlagen, weil voll oder duplikat
elseif (isset($_REQUEST['saveerror'])) {
echo '<div style="text-align:center; font-size: 20pt; font-weight: bold">Anmeldung fehlgeschlagen.</div>';
echo '<div style="text-align:center; font-size: 16pt; font-weight: bold">';
$error = (int)$_REQUEST['saveerror'];
if ($error == Bachelor::SAVE_ERROR_FULL) {
echo 'Die Anmeldegrenze wurde leider erreicht.</div>';
echo '<div style="text-align:center; font-size: 14pt; ">
Es besteht die Möglichkeit sich auf der Warteliste einzutragen.<br />
Wenn du das möchtest, klicke hier: <a class="normallink" href="?fid=' . $fid . '&waitlist">&#8694; Warteliste</a></div>';
} elseif ($error == Bachelor::SAVE_ERROR_DUPLICATE) {
echo 'Es scheint so, als hättest du dich bereits angemeldet...</div>';
} elseif ($error == Bachelor::SAVE_ERROR_CLOSED) {
echo 'Die Anmeldung ist bereits geschlossen!</div>';
} elseif ($error == Bachelor::SAVE_ERROR_MISSING_RIGHTS) {
echo 'Das System hat beschlossen, dass du dazu nicht berechtigt bist...</div>';
} elseif ($error == Bachelor::SAVE_ERROR_INVALID) {
echo 'Deine Daten sind Murks und das ist erst beim Speichern aufgefallen.</div>';
} else { // $error == Bachelor::SAVE_ERROR_EXCEPTION
echo 'Etwas ist gehörig schiefgelaufen. Nochmal probieren oder Mail schreiben!</div>';
}
} // Formulardaten empfangen -> auswerten!
elseif ($this->environment->formDataReceived()) {
$bachelor = $this->environment->getBachelor(false, false, true);
if ($bachelor->isDataValid()) {
$saveResult = $bachelor->save();
if ($saveResult == Bachelor::SAVE_SUCCESS)
header("Location: ?fid=" . $fid . "&success");
else
header("Location: ?fid=" . $fid . "&saveerror=" . $saveResult);
} else {
if (!isset($_REQUEST['hideErrors'])) {
$this->showErrors($bachelor->getValidationErrors());
}
$signup_method->getFallbackMethod()->showInlineHTML();
}
} // Anmeldung anzeigen
elseif ($signup_method->signupMethodExists() && ($status == Fahrt::STATUS_IS_OPEN_NOT_FULL ||
($waitlist_confirmed && $status == Fahrt::STATUS_IS_OPEN_FULL))
) {
$signup_method->getActiveMethod()->showInlineHTML();
} // Anmeldung geschlossen
elseif ($status == Fahrt::STATUS_IS_CLOSED) {
echo '<div style="text-align:center; font-size: 20pt; font-weight: bold">Die Anmeldung wurde geschlossen.</div>';
}
elseif ($status == Fahrt::STATUS_IS_OPEN_FULL && !$waitlist_confirmed) {
echo '<div style="text-align:center; font-size: 20pt; font-weight: bold">Die Fahrt ist voll voll.</div>
<div style="text-align:center; font-size: 16pt; font-weight: bold">
Ein Auge offen halten, ob Plätze frei werden.
</div><div style="text-align:center; font-size: 14pt;">
Es gibt aber auch eine Warteliste.<br />
Wenn du da rauf möchtest, klicke hier:
<a class="normallink" href="?fid=' . $fid . '&waitlist">&#8694; Warteliste</a>
</div>';
} else {
$methods = $signup_method->getSignupMethodsBaseInfo();
$link = '?fid=' . $fid . ($waitlist_confirmed ? '&waitlist' : '') . '&method=';
echo '<p>Es stehen verschiedene Methoden zur Anmeldung zur Verfügung. Wähle eine davon:';
echo '<ul id="method-list">';
foreach ($methods as $method) {
echo '<li><a href="' . $link . $method['id'] . '#signup-container">' . $method["name"] . '</a> <br />' .
$method['description'] . '</li>';
}
echo '</ul>';
}
echo '</div>'; // close signup-container
}
}
(new IndexPage())->render();
......@@ -2,6 +2,5 @@
<?php
// phpinfo();
// safe key generation:
//$bytes = openssl_random_pseudo_bytes(6);
//$hex = bin2hex($bytes);
echo 'go away! nothing for you to see here!';
<?php
/**
* Created by PhpStorm.
* User: tim
* Date: 8/16/14
* Time: 5:02 PM
*/
$lang_regmail = "
static $lang_regmail = "
Deine Anmeldung zur Fachschaftsfahrt\\\\
Hallo!
Vielen Dank für die Anmeldung bei der Fachschaftsfahrt. Den Status der Anmeldung kannst Du jederzeit auf folgender Seite überprüfen:
......@@ -18,4 +12,85 @@ Viele Grüße,
{{organisator}}!
";
static $lang_waitmail = "
Warteliste zur Fachschaftsfahrt\\\\
Hallo!
Vielen Dank für die Vormerkung für die Fachschaftsfahrt. Den Status der Meldung kannst Du jederzeit auf folgender Seite überprüfen:
{{url}}
Weitere Informationen werden wir an diese E-Mail-Adresse senden, also bitte regelmäßig lesen und bei Fragen einfach fragen :-)
Bitte beachte, dass dies nur eine Anmeldung auf der Warteliste ist. Sofern keine weiteren Infos kommen, kannst du leider NICHT mitfahren.
Viele Grüße,
{{organisator}}!
";
static $lang_waitalumnimail = "
Warteliste zur Fachschaftsfahrt\\\\
Hallo!
Vielen Dank für die Anmeldung bei der Fachschaftsfahrt. Da du dich als Alumni eingetragen hast, bist du vorerst auf der Warteliste, da wir Studierenden den Vorrang gewähren.
Den Status der Meldung kannst Du jederzeit auf folgender Seite überprüfen:
{{url}}
Weitere Informationen werden wir an diese E-Mail-Adresse senden, also bitte regelmäßig lesen und bei Fragen einfach fragen :-)
Bitte beachte, dass dies nur eine Anmeldung auf der Warteliste ist. Sofern keine weiteren Infos kommen, kannst du leider NICHT mitfahren.
Viele Grüße,
{{organisator}}!
";
static $lang_waittoregmail = "
Deine Anmeldung zur Fachschaftsfahrt\\\\
Hallo!
Wir freuen uns mitteilen zu können, dass ein Platz frei geworden ist und du bei der Fahrt mitkommen kannst. Bitte melde dich kurz um zu bestätigen, dass sich bezüglich der Anmeldung nichts geändert hat.
Den Status der Anmeldung kannst Du jederzeit auf folgender Seite überprüfen:
{{url}}
Weitere Informationen werden wir an diese E-Mail-Adresse senden, also bitte regelmäßig lesen und bei Fragen einfach fragen :-)
Viele Grüße,
{{organisator}}!
";
static $lang_payinfomail_winter = "
Zusatzinformationen zur Fachschaftsfahrt und Zahlungsaufforderung\\\\
Hallo,
du solltest bereits eine Anmeldebestätigung erhalten haben. Hier folgen jetzt noch ein paar kurze Infos:
Wie bereits angekündigt sammeln wir zunächst 60,-€ pro Person ein.
Diesen Betrag bitte bis zum {{paydeadline}} an folgendes Konto überweisen:
{{payinfo}}
Den Differenzbetrag bekommst du *nach* der Fahrt zusammen mit der Förderung, sofern vorhanden, wieder zurück. Die effektiven Kosten belaufen sich am Ende auf <25€.
Alle Informationen findest du weiterhin hier:
{{wikilink}}
Bis dann,
{{organisator}}!
";
static $lang_payinfomail_summer = "
Zusatzinformationen zur Fachschaftsfahrt und Zahlungsaufforderung\\\\
Hallo,
du solltest bereits eine Anmeldebestätigung erhalten haben. Hier folgen jetzt noch ein paar kurze Infos:
Wie bereits angekündigt sammeln wir zunächst 60,-€ pro Person ein.
Diesen Betrag bitte bis zum {{paydeadline}} an folgendes Konto überweisen:
{{payinfo}}
Alle Informationen findest du weiterhin hier:
{{wikilink}}
Bis dann,
{{organisator}}!
";
?>
Require all denied
\ No newline at end of file
#!/usr/bin/env bash
set -e
function install {
echo "starting install wizzard"
# sure?
echo "this might destroy your current installation (if existing)"
read -r -p "Are you sure you want to proceed? [y/N] " response
response=${response,,} # tolower
if [[ ! $response =~ ^(yes|y)$ ]] ; then exit 1 ; fi
echo "[1/7] initialising"
# change operation dir
cd "${BASH_SOURCE%/*}"
mkdir -p backups
# create last update file
date +"%Y%m%d" > backups/lastUpdate
# create required files
echo "[2/7] setting up files"
cp ../passwd/users.example.txt ../passwd/users.txt
echo -n "2" > ../config_current_fahrt_id
# adjust chmod
echo "[3/7] setting chmod"
chmod -R 644 ../
chmod 777 ../config_current_fahrt_id
chmod 777 ../passwd/users.txt
# ask config stuff
echo "[4/7] some config params, please..."
read -p "baseurl (i.e. \"https://domain.com/fsfahrt\"): " base
read -p "database name: " dbname
read -p "database user: " dbuser
read -p "database pw: " dbpass
read -p "database host: " dbhost
# adapt config.local.php file
echo "[5/7] writing config file"
sed -i "s/($var = \")[^\"]*/\1$base/" ../config.local.php
sed -i "s/(\"dbname\" => \")[^\"]*/\1$dbname/" ../config.local.php
sed -i "s/(\"dbuser\" => \")[^\"]*/\1$dbuser/" ../config.local.php
sed -i "s/(\"dbpass\" => \")[^\"]*/\1$dbpass/" ../config.local.php
sed -i "s/(\"dbhost\" => \")[^\"]*/\1$dbhost/" ../config.local.php
# get init sql files
inits=()
echo "[6/7] available init files:"
for initsql in sqlDumps/init_*.sql; do
inits=("${inits[@]}" "$initsql")
echo "${#inits[@]}) $initsql"
done
# run db init
echo "[7/7] select init dump or kill script to do it manually"
read -p "which dump do you want (latest recommended): " dump
mysql -h $dbhost -u $dbuser -p $dbpass $dbname < ${inits[$dump]}
exit 0
}
function update {
echo "updating system"
# sure?
echo "this might destroy your current installation (if existing)"
read -r -p "Are you sure you want to proceed? [y/N] " response
response=${response,,} # tolower
if [[ ! $response =~ ^(yes|y)$ ]] ; then exit 1 ; fi
if [[ ! -f backups/lastUpdate ]] ; then
read -r -p "Last update or install? As 'Ymd' (zero padded)" response
echo response > backups/lastUpdate
fi
# change operation dir
cd "${BASH_SOURCE%/*}"
mkdir -p backups
# backup config files
echo "backing up config files"
cp ../config_current_fahrt_id backups/
cp ../passwd/users.txt backups/
cp ../config.local.php backups/
# fetch from github
read -p "git branch to pull from [default: master]: " BRANCH
read -p "git origin to pull from [default: origin]: " ORIGIN
if [[ -z $BRANCH ]] ; then BRANCH=master ; fi
if [[ -z $ORIGIN ]] ; then ORIGIN=origin ; fi
# create backup
echo "creating backup on 'backup' branch"
git checkout -B backup
git add --all
git commit --allow-empty -m "backup from `date +"%d.%m.%Y"`"
# pull from origin
echo "force pulling from $ORIGIN/$BRANCH"
git checkout $BRANCH
git fetch $ORIGIN
git reset --hard $ORIGIN/$BRANCH
# fetch db credentials
echo "fetching db config"
dbname=`cat backups/config.local.php | grep \"name\" | cut -d \" -f 4`
dbuser=`cat backups/config.local.php | grep \"user\" | cut -d \" -f 4`
dbpass=`cat backups/config.local.php | grep \"pass\" | cut -d \" -f 4`
dbhost=`cat backups/config.local.php | grep \"host\" | cut -d \" -f 4`
# get last update date
lastUpdate=`cat backups/lastUpdate`
today=`date +"%Y%m&d"`
# create db backup
echo "backing up database"
mysqldump -h $dbhost -u $dbuser -p $dbpass $dbname > backups/backup_$today.sql
# look for pending SQL updates and execute
echo "updating database"
for update in sqlDumps/update_*.sql; do
if [ $lastUpdate -lt `echo $update | cut -d _ -f 2 | cut -d . -f 1` ] ; then
echo "applying update $update"
mysql -h $dbhost -u $dbuser -p $dbpass $dbname < $update
else
echo "already up to date with $update"
fi
done
echo "finishing up update"
# update last update file
echo $today > backups/lastUpdate
# move config files back
mv backups/config_current_fahrt_id ../
mv backups/config.local.php ../
mv backups/users.txt ../passwd/users.txt
echo "Please check whether the format of config files has changed..."
echo "Now get a coffee and add syntactic sugar~!"
exit 0
}
function printHelp {
echo "Script usage"
echo "-h | --help echo this help"
echo "-u | --update to update the system"
echo "-i | --install to install the system"
}
if [[ $# -eq 0 ]]; then
echo "No param given"
printHelp
else
while [[ $# -gt 0 ]];
do
opt="$1"
shift;
case "$opt" in
"-h" | "--help" )
printHelp
exit 0;;
"-u" | "--update" )
update ;;
"-i" | "--install" )
install ;;
* )
echo "Unexpected option ${opt}"
printHelp
exit 1;;
esac
done
fi
\ No newline at end of file
Require all denied
\ No newline at end of file
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 23, 2015 at 08:02 PM
-- Server version: 5.5.44-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `fsfahrt`
--
-- --------------------------------------------------------
--
-- Table structure for table `bachelor`
--
CREATE TABLE IF NOT EXISTS `bachelor` (
`bachelor_id` varchar(15) NOT NULL,
`fahrt_id` int(11) NOT NULL,
`anm_time` int(11) NOT NULL,
`version` int(11) NOT NULL,
`forname` varchar(50) NOT NULL,
`sirname` varchar(50) NOT NULL,
`anday` date NOT NULL,
`abday` date NOT NULL,
`antyp` varchar(100) NOT NULL,
`abtyp` varchar(100) NOT NULL,
`pseudo` varchar(50) NOT NULL,
`mehl` varchar(100) NOT NULL,
`essen` varchar(50) NOT NULL,
`public` int(11) NOT NULL,
`virgin` int(11) NOT NULL,
`studityp` varchar(11) NOT NULL,
`comment` text NOT NULL,
`paid` int(10) DEFAULT NULL COMMENT 'zahlung erhalten am unix timestamp',
`repaid` int(10) DEFAULT NULL COMMENT 'rückzahlung abgeschickt am unix timestamp',
`backstepped` int(10) DEFAULT NULL COMMENT 'rücktritt als unix timestamp',
PRIMARY KEY (`bachelor_id`,`fahrt_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bachelor`
--
INSERT INTO `bachelor` (`bachelor_id`, `fahrt_id`, `anm_time`, `version`, `forname`, `sirname`, `anday`, `abday`, `antyp`, `abtyp`, `pseudo`, `mehl`, `essen`, `public`, `virgin`, `studityp`, `comment`, `paid`, `repaid`, `backstepped`) VALUES
('5b61b92044983e1', 2, 0, 1, 'asd', 'ad', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'ffas', 'asdasd@asd.de', 'Alles', 1, 0, '0', 'dasd', NULL, NULL, 1411059051),
('f35f12ca7c55462', 2, 0, 1, 'fcacs', 'ads', '2013-10-18', '2013-10-19', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'fas', 'asd@asd.de', 'Alles', 0, 0, '0', 'adasdasda', NULL, NULL, NULL),
('068e4198f255a1e', 2, 0, 1, 'göll', 'asd', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'adsad', 'adskd@asdl.de', 'Alles', 1, 0, '0', 'adasd', 1409779206, NULL, NULL),
('d748d40c0d7e475', 2, 0, 1, 'ad', 'adsd', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'asdadl', 'asdas@asd.de', 'Vegan', 1, 0, '0', 'ad', NULL, NULL, NULL),
('ec2cac23f915bf9', 2, 0, 1, 'gbhg', 'ncvbx', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'cvxcvxsdfs', 'ads@asdl.de', 'Alles', 1, 0, '0', 'ycyxc', NULL, NULL, 1408205076),
('78a322842b66657', 2, 0, 1, 'lkblka', 'kbvnfj', '2013-10-18', '2013-10-20', 'individuell', 'gemeinsam mit Rad', 'kmkm', 'sdkk@ksad.de', 'Vegan', 1, 0, 'MasterErsti', 'asda', NULL, NULL, NULL),
('8d70b435d61c302', 2, 0, 1, 'gm', 'sdlkjflkj', '2013-10-18', '2013-10-20', 'gemeinsam mit Rad', 'individuell', 'skldfmlk', 'sfjdkl@dfjklj.de', 'Grießbrei', 1, 0, 'Hoersti', 'asddsa', NULL, NULL, NULL),
('c8c1d8a327fd88f', 2, 0, 1, 'lkdnl', 'sdkjfhnk', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Rad', 'adhsj', 'fsfahrt@byom.de', 'Frutarisch', 1, 0, 'Hoersti', 'adas', 1408205076, NULL, NULL),
('7f5609769cce5f1', 2, 0, 1, 'lkdnl', 'sdkjfhnk', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Rad', 'adhsj', 'fsfahrt@byom.de', 'Frutarisch', 1, 0, 'Hoersti', 'adas', 1408105076, 1408205076, NULL),
('61fd805b3bbe4b5', 2, 0, 1, 'rcsa', 'adas', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'gdsfa', 'asdas@deda-de.de', 'Extrawurst', 1, 0, 'Wechsli', '', NULL, NULL, 1411251707),
('9593abed7ec0b79', 2, 0, 1, 'bla', 'blubb', '2013-10-18', '2013-10-20', 'mit Kamel', 'mit Kamel', 'ah', 'reichskanzlei@web.dr', 'Vegetarisch', 1, 0, 'Tutor', 'Mit Kamel!', NULL, NULL, NULL),
('4eb203cf14c7a4e', 2, 1409761827, 1, 'dlklödsa', 'adlökl', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Rad', 'dsaoif', 'daskdj@asdkj.de', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('810789efb42264d', 2, 1409763812, 1, 'klalsd', 'ladköl', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'sdkfölk', 'alksd@aslkdj.de', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('09ca2d98ea68524', 2, 1411224273, 1, 'ölmm', 'ölkö', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'lkkldslk', 'aksdllk@asdjk.de', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, 1411251706),
('9de69c5684a4c28', 2, 1411249881, 1, 'random', 'so random', '2013-10-18', '2013-10-20', 'individuell', 'individuell', 'superrandom', 'ran@om.de', 'Alles', 1, 0, 'Ersti', 'randomtest', NULL, NULL, NULL),
('0baff8036ee698b', 2, 1411432206, 1, 'as', 'das', '0000-00-00', '0000-00-00', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'ffas', 'asdsa@asd.de', 'Vegan', 1, 0, 'Hoersti', '', NULL, NULL, NULL),
('54cdf371a2f56b9', 2, 1411432331, 1, 'klau', 'asdk', '0000-00-00', '0000-00-00', 'Kamel/Individuell', 'gemeinsam mit Bus/Bahn', 'mutter', 'back@web.de', 'Vegan', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('a62d6883688789f', 2, 1411682781, 1, 'asd', 'asdd', '0000-00-00', '0000-00-00', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'asdas', 'asdas@sad.de', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('61ed33f03d0de0b', 2, 1411686132, 1, 'adsd', 'adss', '2013-10-19', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'date', 'adslk@asldk.de', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('bb4dc6d782c98c0', 2, 1411767105, 1, 'letzter', 'adkslj', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Rad', 'letzter', 'adslkj@askd.de', 'Vegetarisch', 1, 0, 'Tutor', 'asdads', NULL, NULL, NULL),
('bfdefb03deb3bcb', 2, 1411767151, 1, 'nkjkl', 'kjlk', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'kljlk', 'alkdsj@ads.de', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('6ec42e12e2368c0', 2, 1411767427, 1, 'qwe', 'qwe', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'asd', 'qwe@qw.qw', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('9e450c55e562d0c', 2, 1439849004, 1, 'asdsad', 'asd', '2013-10-25', '2013-10-27', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'ad', 'asd@aasd.de', 'Alles', 1, 0, 'Ersti', 'asdas', NULL, NULL, NULL),
('0856eee9f07a698', 2, 1439849898, 1, 'sd', 'sad', '2013-10-25', '2013-10-27', 'selbst mit Auto', 'gemeinsam mit Bus/Bahn', 'asd', 'asd@asd.de', 'Alles', 1, 0, 'Hoersti', 'asdasd', NULL, NULL, NULL),
('15e27f42693195e', 2, 1442605414, 1, 'asd', 'kjkj', '2013-10-25', '2013-10-27', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'kjklj', 'doch@byom.de', 'Alles', 1, 0, 'Ersti', 'asdd', NULL, NULL, NULL),
('af0dadca8dbd2f2', 2, 1442606515, 1, 'lödasklök', 'ödasklö', '2013-10-25', '2013-10-27', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'asdlkö', 'adskl@adskl.de', 'Alles', 1, 0, 'Ersti', 'adsdas', NULL, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `cost`
--
CREATE TABLE IF NOT EXISTS `cost` (
`fahrt_id` int(11) NOT NULL COMMENT 'trip associated to calculation',
`tab1` text NOT NULL COMMENT 'JSON dump of tab1',
`tab2` text NOT NULL COMMENT 'JSON dump of tab2',
`tab3` text NOT NULL COMMENT 'JSON dump of tab3',
`moneyIO` text NOT NULL COMMENT 'JSON dump of money IO',
`collected` int(11) NOT NULL COMMENT 'amount collected per person before trip'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `cost`
--
INSERT INTO `cost` (`fahrt_id`, `tab1`, `tab2`, `tab3`, `moneyIO`, `collected`) VALUES
(2, '', '', '', '', 60);
-- --------------------------------------------------------
--
-- Table structure for table `fahrten`
--
CREATE TABLE IF NOT EXISTS `fahrten` (
`fahrt_id` int(11) NOT NULL AUTO_INCREMENT,
`titel` varchar(200) NOT NULL,
`ziel` varchar(100) NOT NULL,
`von` date NOT NULL,
`bis` date NOT NULL,
`regopen` int(1) NOT NULL,
`beschreibung` text NOT NULL,
`leiter` varchar(100) NOT NULL,
`kontakt` varchar(100) NOT NULL,
`map_pin` text NOT NULL,
`max_bachelor` int(4) NOT NULL,
`wikilink` varchar(255) NOT NULL DEFAULT 'https://wiki.fachschaft.informatik.hu-berlin.de/wiki/Erstsemesterfahrt',
`paydeadline` date NOT NULL,
`payinfo` text NOT NULL,
`opentime` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`fahrt_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `fahrten`
--
INSERT INTO `fahrten` (`fahrt_id`, `titel`, `ziel`, `von`, `bis`, `regopen`, `beschreibung`, `leiter`, `kontakt`, `map_pin`, `max_bachelor`, `wikilink`, `paydeadline`, `payinfo`, `opentime`) VALUES
(1, 'Fachschaftsfahrt Winter 2012', 'KiEZ Inselparadies am Schwielowsee bei Werder', '2012-10-26', '2012-10-28', 0, 'Alle Informationen zur Fahrt im <a rel="nofollow" target="_blank" href="http://wiki.fachschaft.informatik.hu-berlin.de/wiki/Fachschaftsfahrt_Winter_2012">Wiki</a>', 'Tim Repke', 'nein@nein.de', ' ', 2, 'https://wiki.fachschaft.informatik.hu-berlin.de/wiki/Erstsemesterfahrt', '0000-00-00', '', 0),
(2, 'Fachschaftsfahrt Winter 2013', 'KiEZ Frauensee bei Gräbendorf', '2013-10-25', '2013-10-27', 1, 'Erstsemester und Fachschaftsfahrt im Wintersemester 13/14<br>Alle Informationen im <a rel="nofollow" target="_blank" href="http://wiki.fachschaft.informatik.hu-berlin.de/wiki/Fachschaftsfahrt_Winter_2013">Wiki</a>', 'Tim Repke', 'nein@byom.de', '52.49151043325418 13.453114630310097', 30, 'https://wiki.fachschaft.infdtik.hu-berlin.de/wiki/Erstsemesterfahrt', '2015-09-16', 'sad\r\nasd\r\nasd\r\nadd', 1443024045),
(5, 'Fachschaftsfahrt Winter 2014', ' Jugendherberge Münchehofe', '2014-10-24', '2014-10-26', 1, 'Dies ist die Anmeldung zur Erstsemester-/Fachschaftsfahrt im Wintersemester 2014/15. <br>Weitere Infos sind im <a rel="nofollow" target="_blank" href="http://wiki.fachschaft.informatik.hu-berlin.de/wiki/Fachschaftsfahrt_Winter_2014">Wiki</a>', 'Georg Gentzen', 'gentzeng@informatik.hu-berlin.de', '52.55853564453215 14.14091885241703', 60, 'https://wiki.fachschaft.informatik.hu-berlin.de/wiki/Erstsemesterfahrt', '0000-00-00', '', 0),
(6, 'neu', 'asds', '2015-08-17', '2015-08-17', 1, 'saddaasda &nbsp;asdd ad s', 'asad', 'asds@asdkd.de', '52.43893109993363 13.648079039184609', 30, 'https://wiki.fachschaft.informatik.hu-berlin.de/wiki/Erstsemesterfahrt', '2015-09-24', 'asd\r\nasd\r\n234\r\n14', 1443034837);
-- --------------------------------------------------------
--
-- Table structure for table `notes`
--
CREATE TABLE IF NOT EXISTS `notes` (
`note_id` int(11) NOT NULL AUTO_INCREMENT,
`fahrt_id` int(11) NOT NULL,
`note` text NOT NULL,
PRIMARY KEY (`note_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `notes`
--
INSERT INTO `notes` (`note_id`, `fahrt_id`, `note`) VALUES
(1, 1, 'fahrt1 note'),
(2, 2, '<h1><b>Testnotiz 123<br></b></h1>hier kann man <i>notizen </i>hinterlassen test<br><br><h2><b>Dumme Bemerkung</b></h2>Notiz = no&nbsp;<span class="wysiwyg-color-red">tits!<br></span><b><br><br>aoisdkd<br>asdlji<br><br></b><b><br></b>');
-- --------------------------------------------------------
--
-- Table structure for table `waitlist`
--
CREATE TABLE IF NOT EXISTS `waitlist` (
`waitlist_id` int(11) NOT NULL AUTO_INCREMENT,
`fahrt_id` int(11) NOT NULL,
`anm_time` int(11) NOT NULL,
`forname` varchar(50) NOT NULL,
`sirname` varchar(50) NOT NULL,
`anday` date NOT NULL,
`abday` date NOT NULL,
`antyp` varchar(100) NOT NULL,
`abtyp` varchar(100) NOT NULL,
`pseudo` varchar(50) NOT NULL,
`mehl` varchar(100) NOT NULL,
`essen` varchar(50) NOT NULL,
`public` int(11) NOT NULL,
`virgin` int(11) NOT NULL,
`studityp` varchar(11) NOT NULL,
`comment` text NOT NULL,
`transferred` int(11) NOT NULL,
PRIMARY KEY (`waitlist_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 04, 2015 at 06:43 PM
-- Server version: 5.5.44-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `fsfahrt`
--
-- --------------------------------------------------------
--
-- Table structure for table `bachelor`
--
CREATE TABLE IF NOT EXISTS `bachelor` (
`bachelor_id` varchar(15) NOT NULL,
`fahrt_id` int(11) NOT NULL,
`anm_time` int(11) NOT NULL,
`version` int(11) NOT NULL,
`forname` varchar(50) NOT NULL,
`sirname` varchar(50) NOT NULL,
`anday` date NOT NULL,
`abday` date NOT NULL,
`antyp` varchar(100) NOT NULL,
`abtyp` varchar(100) NOT NULL,
`pseudo` varchar(50) NOT NULL,
`mehl` varchar(100) NOT NULL,
`essen` varchar(50) NOT NULL,
`public` int(11) NOT NULL,
`virgin` int(11) NOT NULL,
`studityp` varchar(11) NOT NULL,
`comment` text NOT NULL,
`paid` int(10) DEFAULT NULL COMMENT 'zahlung erhalten am unix timestamp',
`repaid` int(10) DEFAULT NULL COMMENT 'rückzahlung abgeschickt am unix timestamp',
`backstepped` int(10) DEFAULT NULL COMMENT 'rücktritt als unix timestamp',
PRIMARY KEY (`bachelor_id`,`fahrt_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bachelor`
--
INSERT INTO `bachelor` (`bachelor_id`, `fahrt_id`, `anm_time`, `version`, `forname`, `sirname`, `anday`, `abday`, `antyp`, `abtyp`, `pseudo`, `mehl`, `essen`, `public`, `virgin`, `studityp`, `comment`, `paid`, `repaid`, `backstepped`) VALUES
('5b61b92044983e1', 2, 0, 1, 'asd', 'ad', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'ffas', 'asdasd@asd.de', 'Alles', 1, 0, '0', 'dasd', NULL, NULL, 1411059051),
('f35f12ca7c55462', 2, 0, 1, 'fcacs', 'ads', '2013-10-18', '2013-10-19', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'fas', 'asd@asd.de', 'Alles', 0, 0, '0', 'adasdasda', NULL, NULL, NULL),
('068e4198f255a1e', 2, 0, 1, 'göll', 'asd', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'adsad', 'adskd@asdl.de', 'Alles', 1, 0, '0', 'adasd', 1409779206, NULL, NULL),
('d748d40c0d7e475', 2, 0, 1, 'ad', 'adsd', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'asdadl', 'asdas@asd.de', 'Vegan', 1, 0, '0', 'ad', NULL, NULL, NULL),
('ec2cac23f915bf9', 2, 0, 1, 'gbhg', 'ncvbx', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'cvxcvxsdfs', 'ads@asdl.de', 'Alles', 1, 0, '0', 'ycyxc', NULL, NULL, 1408205076),
('78a322842b66657', 2, 0, 1, 'lkblka', 'kbvnfj', '2013-10-18', '2013-10-20', 'individuell', 'gemeinsam mit Rad', 'kmkm', 'sdkk@ksad.de', 'Vegan', 1, 0, 'MasterErsti', 'asda', NULL, NULL, NULL),
('8d70b435d61c302', 2, 0, 1, 'gm', 'sdlkjflkj', '2013-10-18', '2013-10-20', 'gemeinsam mit Rad', 'individuell', 'skldfmlk', 'sfjdkl@dfjklj.de', 'Grießbrei', 1, 0, 'Hoersti', 'asddsa', NULL, NULL, NULL),
('c8c1d8a327fd88f', 2, 0, 1, 'lkdnl', 'sdkjfhnk', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Rad', 'adhsj', 'fsfahrt@byom.de', 'Frutarisch', 1, 0, 'Hoersti', 'adas', 1408205076, NULL, NULL),
('7f5609769cce5f1', 2, 0, 1, 'lkdnl', 'sdkjfhnk', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Rad', 'adhsj', 'fsfahrt@byom.de', 'Frutarisch', 1, 0, 'Hoersti', 'adas', 1408105076, 1408205076, NULL),
('61fd805b3bbe4b5', 2, 0, 1, 'rcsa', 'adas', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'gdsfa', 'asdas@deda-de.de', 'Extrawurst', 1, 0, 'Wechsli', '', NULL, NULL, 1411251707),
('9593abed7ec0b79', 2, 0, 1, 'bla', 'blubb', '2013-10-18', '2013-10-20', 'mit Kamel', 'mit Kamel', 'ah', 'reichskanzlei@web.dr', 'Vegetarisch', 1, 0, 'Tutor', 'Mit Kamel!', NULL, NULL, NULL),
('4eb203cf14c7a4e', 2, 1409761827, 1, 'dlklödsa', 'adlökl', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Rad', 'dsaoif', 'daskdj@asdkj.de', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('810789efb42264d', 2, 1409763812, 1, 'klalsd', 'ladköl', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'sdkfölk', 'alksd@aslkdj.de', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('09ca2d98ea68524', 2, 1411224273, 1, 'ölmm', 'ölkö', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'lkkldslk', 'aksdllk@asdjk.de', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, 1411251706),
('9de69c5684a4c28', 2, 1411249881, 1, 'random', 'so random', '2013-10-18', '2013-10-20', 'individuell', 'individuell', 'superrandom', 'ran@om.de', 'Alles', 1, 0, 'Ersti', 'randomtest', NULL, NULL, NULL),
('0baff8036ee698b', 2, 1411432206, 1, 'as', 'das', '0000-00-00', '0000-00-00', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'ffas', 'asdsa@asd.de', 'Vegan', 1, 0, 'Hoersti', '', NULL, NULL, NULL),
('54cdf371a2f56b9', 2, 1411432331, 1, 'klau', 'asdk', '0000-00-00', '0000-00-00', 'Kamel/Individuell', 'gemeinsam mit Bus/Bahn', 'mutter', 'back@web.de', 'Vegan', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('a62d6883688789f', 2, 1411682781, 1, 'asd', 'asdd', '0000-00-00', '0000-00-00', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'asdas', 'asdas@sad.de', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('61ed33f03d0de0b', 2, 1411686132, 1, 'adsd', 'adss', '2013-10-19', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'date', 'adslk@asldk.de', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('bb4dc6d782c98c0', 2, 1411767105, 1, 'letzter', 'adkslj', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Rad', 'letzter', 'adslkj@askd.de', 'Vegetarisch', 1, 0, 'Tutor', 'asdads', NULL, NULL, NULL),
('bfdefb03deb3bcb', 2, 1411767151, 1, 'nkjkl', 'kjlk', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'kljlk', 'alkdsj@ads.de', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('6ec42e12e2368c0', 2, 1411767427, 1, 'qwe', 'qwe', '2013-10-18', '2013-10-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'asd', 'qwe@qw.qw', 'Alles', 1, 0, 'Ersti', '', NULL, NULL, NULL),
('9e450c55e562d0c', 2, 1439849004, 1, 'asdsad', 'asd', '2013-10-25', '2013-10-27', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'ad', 'asd@aasd.de', 'Alles', 1, 0, 'Ersti', 'asdas', NULL, NULL, NULL),
('0856eee9f07a698', 2, 1439849898, 1, 'sd', 'sad', '2013-10-25', '2013-10-27', 'selbst mit Auto', 'gemeinsam mit Bus/Bahn', 'asd', 'asd@asd.de', 'Alles', 1, 0, 'Hoersti', 'asdasd', NULL, NULL, NULL),
('15e27f42693195e', 2, 1442605414, 1, 'asd', 'kjkj', '2013-10-25', '2013-10-27', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'kjklj', 'doch@byom.de', 'Alles', 1, 0, 'Ersti', 'asdd', NULL, NULL, NULL),
('af0dadca8dbd2f2', 2, 1442606515, 1, 'lödasklök', 'ödasklö', '2013-10-25', '2013-10-27', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'asdlkö', 'adskl@adskl.de', 'Alles', 1, 0, 'Ersti', 'adsdas', NULL, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `cost`
--
CREATE TABLE IF NOT EXISTS `cost` (
`fahrt_id` int(11) NOT NULL COMMENT 'trip associated to calculation',
`tab1` text NOT NULL COMMENT 'JSON dump of tab1',
`tab2` text NOT NULL COMMENT 'JSON dump of tab2',
`tab3` text NOT NULL COMMENT 'JSON dump of tab3',
`moneyIO` text NOT NULL COMMENT 'JSON dump of money IO',
`collected` int(11) NOT NULL COMMENT 'amount collected per person before trip'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `cost`
--
INSERT INTO `cost` (`fahrt_id`, `tab1`, `tab2`, `tab3`, `moneyIO`, `collected`) VALUES
(2, '', '', '', '', 60);
-- --------------------------------------------------------
--
-- Table structure for table `fahrten`
--
CREATE TABLE IF NOT EXISTS `fahrten` (
`fahrt_id` int(11) NOT NULL AUTO_INCREMENT,
`titel` varchar(200) NOT NULL,
`ziel` varchar(100) NOT NULL,
`von` date NOT NULL,
`bis` date NOT NULL,
`regopen` int(1) NOT NULL,
`beschreibung` text NOT NULL,
`leiter` varchar(100) NOT NULL,
`kontakt` varchar(100) NOT NULL,
`map_pin` text NOT NULL,
`max_bachelor` int(4) NOT NULL,
`wikilink` varchar(255) NOT NULL DEFAULT 'https://wiki.fachschaft.informatik.hu-berlin.de/wiki/Erstsemesterfahrt',
`paydeadline` date NOT NULL,
`payinfo` text NOT NULL,
`opentime` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`fahrt_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `fahrten`
--
INSERT INTO `fahrten` (`fahrt_id`, `titel`, `ziel`, `von`, `bis`, `regopen`, `beschreibung`, `leiter`, `kontakt`, `map_pin`, `max_bachelor`, `wikilink`, `paydeadline`, `payinfo`, `opentime`) VALUES
(1, 'Fachschaftsfahrt Winter 2012', 'KiEZ Inselparadies am Schwielowsee bei Werder', '2012-10-26', '2012-10-28', 0, 'Alle Informationen zur Fahrt im <a rel="nofollow" target="_blank" href="http://wiki.fachschaft.informatik.hu-berlin.de/wiki/Fachschaftsfahrt_Winter_2012">Wiki</a>', 'Tim Repke', 'nein@nein.de', ' ', 2, 'https://wiki.fachschaft.informatik.hu-berlin.de/wiki/Erstsemesterfahrt', '0000-00-00', '', 0),
(2, 'Fachschaftsfahrt Winter 2013', 'KiEZ Frauensee bei Gräbendorf', '2013-10-25', '2013-10-27', 1, 'Erstsemester und Fachschaftsfahrt im Wintersemester 13/14<br>Alle Informationen im <a rel="nofollow" target="_blank" href="http://wiki.fachschaft.informatik.hu-berlin.de/wiki/Fachschaftsfahrt_Winter_2013">Wiki</a>', 'Tim Repke', 'nein@byom.de', '52.49151043325418 13.453114630310097', 30, 'https://wiki.fachschaft.infdtik.hu-berlin.de/wiki/Erstsemesterfahrt', '2015-09-16', 'sad\r\nasd\r\nasd\r\nadd', 1443024045),
(5, 'Fachschaftsfahrt Winter 2014', ' Jugendherberge Münchehofe', '2014-10-24', '2014-10-26', 1, 'Dies ist die Anmeldung zur Erstsemester-/Fachschaftsfahrt im Wintersemester 2014/15. <br>Weitere Infos sind im <a rel="nofollow" target="_blank" href="http://wiki.fachschaft.informatik.hu-berlin.de/wiki/Fachschaftsfahrt_Winter_2014">Wiki</a>', 'Georg Gentzen', 'gentzeng@informatik.hu-berlin.de', '52.55853564453215 14.14091885241703', 60, 'https://wiki.fachschaft.informatik.hu-berlin.de/wiki/Erstsemesterfahrt', '0000-00-00', '', 0),
(6, 'neu', 'asds', '2015-10-23', '2015-10-25', 1, 'saddaasda &nbsp;asdd ad s', 'asad', 'asds@asdkd.de', '52.43893109993363 13.648079039184609', 0, 'https://wiki.fachschaft.informatik.hu-berlin.de/wiki/Erstsemesterfahrt', '2015-09-24', 'asd\r\nasd\r\n234\r\n14', 1443639637);
-- --------------------------------------------------------
--
-- Table structure for table `notes`
--
CREATE TABLE IF NOT EXISTS `notes` (
`note_id` int(11) NOT NULL AUTO_INCREMENT,
`fahrt_id` int(11) NOT NULL,
`note` text NOT NULL,
PRIMARY KEY (`note_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `notes`
--
INSERT INTO `notes` (`note_id`, `fahrt_id`, `note`) VALUES
(1, 1, 'fahrt1 note'),
(2, 2, '<h1><b>Testnotiz 123<br></b></h1>hier kann man <i>notizen </i>hinterlassen test<br><br><h2><b>Dumme Bemerkung</b></h2>Notiz = no&nbsp;<span class="wysiwyg-color-red">tits!<br></span><b><br><br>aoisdkd<br>asdlji<br><br></b><b><br></b>');
-- --------------------------------------------------------
--
-- Table structure for table `waitlist`
--
CREATE TABLE IF NOT EXISTS `waitlist` (
`waitlist_id` int(11) NOT NULL AUTO_INCREMENT,
`fahrt_id` int(11) NOT NULL,
`anm_time` int(11) NOT NULL,
`forname` varchar(50) NOT NULL,
`sirname` varchar(50) NOT NULL,
`anday` date NOT NULL,
`abday` date NOT NULL,
`antyp` varchar(100) NOT NULL,
`abtyp` varchar(100) NOT NULL,
`pseudo` varchar(50) NOT NULL,
`mehl` varchar(100) NOT NULL,
`essen` varchar(50) NOT NULL,
`public` int(11) NOT NULL,
`virgin` int(11) NOT NULL,
`studityp` varchar(11) NOT NULL,
`comment` text NOT NULL,
`transferred` int(11) DEFAULT NULL,
PRIMARY KEY (`waitlist_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `waitlist`
--
INSERT INTO `waitlist` (`waitlist_id`, `fahrt_id`, `anm_time`, `forname`, `sirname`, `anday`, `abday`, `antyp`, `abtyp`, `pseudo`, `mehl`, `essen`, `public`, `virgin`, `studityp`, `comment`, `transferred`) VALUES
(1, 6, 1443975605, 'sddsa', 'asd', '2015-10-23', '2015-10-25', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'asd', 'asd@aasd.de', 'Alles', 1, 0, 'Ersti', '', 0);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: db:3306
-- Generation Time: Oct 20, 2016 at 08:20 PM
-- Server version: 5.5.52-MariaDB-1ubuntu0.14.04.1
-- PHP Version: 5.6.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `fsfahrt`
--
-- --------------------------------------------------------
--
-- Table structure for table `bachelor`
--
CREATE TABLE `bachelor` (
`bachelor_id` varchar(15) NOT NULL,
`fahrt_id` int(11) NOT NULL,
`anm_time` int(11) NOT NULL,
`version` int(11) NOT NULL,
`forname` varchar(50) NOT NULL,
`sirname` varchar(50) NOT NULL,
`anday` date NOT NULL,
`abday` date NOT NULL,
`antyp` varchar(100) NOT NULL,
`abtyp` varchar(100) NOT NULL,
`pseudo` varchar(50) NOT NULL,
`mehl` varchar(100) NOT NULL,
`essen` varchar(50) NOT NULL,
`public` int(11) NOT NULL,
`virgin` int(11) NOT NULL,
`studityp` varchar(11) NOT NULL,
`comment` text NOT NULL,
`paid` int(10) DEFAULT NULL COMMENT 'zahlung erhalten am unix timestamp',
`repaid` int(10) DEFAULT NULL COMMENT 'rückzahlung abgeschickt am unix timestamp',
`backstepped` int(10) DEFAULT NULL COMMENT 'rücktritt als unix timestamp',
`on_waitlist` int(11) NOT NULL DEFAULT '0',
`transferred` int(11) DEFAULT NULL,
`signupstats` text
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bachelor`
--
INSERT INTO `bachelor` (`bachelor_id`, `fahrt_id`, `anm_time`, `version`, `forname`, `sirname`, `anday`, `abday`, `antyp`, `abtyp`, `pseudo`, `mehl`, `essen`, `public`, `virgin`, `studityp`, `comment`, `paid`, `repaid`, `backstepped`, `on_waitlist`, `transferred`, `signupstats`) VALUES
('5b61b92044983e1', 2, 1411767105, 3, 'John', 'Doe', '2013-10-25', '2013-10-27', 'BUSBAHN', 'BUSBAHN', 'Backstepped', 'some@mail.com', 'ALLES', 1, 1, 'ERSTI', 'Test comment', NULL, NULL, 1476889935, 0, NULL, '{"method":"game1", "methodinfo":{"achievedAchievements":[1,2,3,4,5,3,3,3,3,3,3]}}'),
('06030f06b6e9194', 2, 1476889983, 2, 'TestA', 'Test', '2013-10-25', '2013-10-27', 'BUSBAHN', 'BUSBAHN', 'Paid', 'test@test.de', 'ALLES', 1, 0, 'ERSTI', 'huii', 1476890174, NULL, NULL, 0, NULL, '{"method":"game1", "methodinfo":{"achievedAchievements":[1,2,3,4,5,3,3,3,3,3,3]}}'),
('06030f06b6e9195', 2, 1476889983, 2, 'TestA', 'Test', '2013-10-25', '2013-10-27', 'BUSBAHN', 'BUSBAHN', 'RePaid', 'test@test.de', 'ALLES', 1, 0, 'ERSTI', 'huii', NULL, 1476890179, NULL, 0, NULL, '{"method":"game1", "methodinfo":{"achievedAchievements":["first_step", "some_water", "saw_devs1", "spotted_gorilla", "hydrant", "muell","randomwalk", "rettich_pick", "kohl", "mais", "rasenmeh", "moneyboy", "batteries", "bierball", "bild","hu", "holz", "karriereleiter", "wrong_board", "hugo_water", "laptop2", "laptop1", "marathon", "ffa","stolper", "fs_chair", "laser", "speedrun", "woman", "plumber", "princess", "stroh", "blumen", "maske","gentzen", "kacke", "antler", "flowers", "wine", "chair", "started_game", "gameDone", "achievement42"]}}'),
('06030f06b6e9196', 2, 1476889983, 3, 'TestA', 'Test', '2013-10-26', '2013-10-27', 'BUSBAHN', 'BUSBAHN', 'Paid+repaid', 'test@test.de', 'ALLES', 0, 0, 'ERSTI', 'huii', 1476890176, 1476890177, NULL, 0, NULL, NULL),
('06030f06b6e9197', 2, 1476889983, 5, 'TestA', 'Test', '2013-10-25', '2013-10-27', 'BUSBAHN', 'BUSBAHN', 'Paid+backstepped', 'test@test.de', 'ALLES', 1, 0, 'ERSTI', 'huii', 1476890169, NULL, 1476890168, 0, NULL, NULL),
('06030f06b6e9198', 2, 1476889983, 1, 'TestA', 'Test', '2013-10-25', '2013-10-27', 'BUSBAHN', 'BUSBAHN', 'tutti', 'test@test.de', 'ALLES', 0, 0, 'TUTTI', 'huii', NULL, NULL, NULL, 0, NULL, NULL),
('06030f06b6e9193', 2, 1476889983, 1, 'TestA', 'Test', '2013-10-25', '2013-10-27', 'BUSBAHN', 'BUSBAHN', 'hoersti', 'test@test.de', 'ALLES', 1, 0, 'HOERS', 'huii', NULL, NULL, NULL, 0, NULL, '{"method":"game1", "methodinfo":{"achievedAchievements":["first_step", "some_water", "saw_devs1", "spotted_gorilla", "hydrant", "muell","randomwalk", "rettich_pick", "kohl", "mais", "rasenmeh", "moneyboy", "batteries", "bierball", "bild","hu", "holz", "karriereleiter", "wrong_board", "hugo_water", "laptop2", "laptop1", "marathon", "ffa","stolper", "fs_chair", "laser", "speedrun", "woman", "plumber", "princess", "stroh", "blumen", "maske", "achievement42"]}}'),
('06030f06b6e919', 2, 1476889983, 3, 'TestA', 'Test', '2013-10-25', '2013-10-26', 'INDIVIDUELL', 'INDIVIDUELL', 'individuell', 'test@test.de', 'VEGA', 1, 0, 'ERSTI', 'huii', NULL, NULL, NULL, 1, NULL, NULL),
('06030f06b6e929', 2, 1476889983, 3, 'TestA', 'Test', '2013-10-25', '2013-10-27', 'RAD', 'BUSBAHN', 'rad', 'test@test.de', 'VEGE', 1, 0, 'ERSTI', 'huii', NULL, NULL, NULL, 0, NULL, '{"method":"game1", "methodinfo":{"achievedAchievements":["first_step", "some_water", "saw_devs1", "spotted_gorilla", "hydrant", "muell","randomwalk", "rettich_pick", "kohl", "mais", "rasenmeh", "moneyboy", "batteries", "bierball", "bild","hu", "holz", "karriereleiter", "wrong_board", "achievement42"]}}'),
('06030f06b6e939', 2, 1476889983, 3, 'TestA', 'Test', '2013-10-25', '2013-10-27', 'BUSBAHN', 'BUSBAHN', 'wait', 'test@test.de', 'VEGE', 0, 0, 'ERSTI', 'huii', NULL, NULL, NULL, 1, NULL, NULL),
('06030f06b6e949', 2, 1476889983, 3, 'TestA', 'Test', '2013-10-25', '2013-10-27', 'INDIVIDUELL', 'BUSBAHN', 'bla', 'test@test.de', 'ALLES', 1, 0, 'ERSTI', 'huii', NULL, NULL, NULL, 0, NULL, NULL),
('06030f06b6e959', 2, 1476889983, 4, 'TestA', 'Test', '2013-10-26', '2013-10-27', 'BUSBAHN', 'BUSBAHN', 'wait+trans', 'test@test.de', 'ALLES', 1, 0, 'ERSTI', 'huii', NULL, NULL, NULL, 1, 1476890563, NULL),
('dc29d62c30756a3', 2, 1476992412, 2, 'asd', 'asd', '2013-10-26', '2013-10-27', 'BUSBAHN', 'BUSBAHN', 'asd', 'asd@asd.de', 'VEGA', 1, 1, 'ERSTI', '', NULL, NULL, NULL, 1, 1476992435, '{"method":"story","methodinfo":{"achievements":["stein","elch2","park"]}}');
-- --------------------------------------------------------
--
-- Table structure for table `cost`
--
CREATE TABLE `cost` (
`fahrt_id` int(11) NOT NULL COMMENT 'trip associated to calculation',
`tab1` text NOT NULL COMMENT 'JSON dump of tab1',
`tab2` text NOT NULL COMMENT 'JSON dump of tab2',
`tab3` text NOT NULL COMMENT 'JSON dump of tab3',
`moneyIO` text NOT NULL COMMENT 'JSON dump of money IO',
`collected` int(11) NOT NULL COMMENT 'amount collected per person before trip'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `cost`
--
INSERT INTO `cost` (`fahrt_id`, `tab1`, `tab2`, `tab3`, `moneyIO`, `collected`) VALUES
(2, '', '', '[{"pos":"Bettwäsche","cnt":"1","mul":"40","price":"1.43"},{"pos":"Grillnutzung","cnt":"1","mul":"40","price":"0.3"},{"pos":"Halbpension","cnt":"2","mul":"40","price":"12.30"},{"pos":"Klodeckel","cnt":1,"mul":1,"price":"33"},{"pos":"blubb","cnt":1,"mul":1,"price":"03"}]', '', 60);
-- --------------------------------------------------------
--
-- Table structure for table `fahrten`
--
CREATE TABLE `fahrten` (
`fahrt_id` int(11) NOT NULL,
`titel` varchar(200) NOT NULL,
`ziel` varchar(100) NOT NULL,
`von` date NOT NULL,
`bis` date NOT NULL,
`regopen` int(1) NOT NULL,
`beschreibung` text NOT NULL,
`leiter` varchar(100) NOT NULL,
`kontakt` varchar(100) NOT NULL,
`map_pin` text NOT NULL,
`max_bachelor` int(4) NOT NULL,
`wikilink` varchar(255) NOT NULL DEFAULT 'https://wiki.fachschaft.informatik.hu-berlin.de/wiki/Erstsemesterfahrt',
`paydeadline` date NOT NULL,
`payinfo` text NOT NULL,
`opentime` int(11) NOT NULL DEFAULT '0',
`disclaimlink` varchar(255) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `fahrten`
--
INSERT INTO `fahrten` (`fahrt_id`, `titel`, `ziel`, `von`, `bis`, `regopen`, `beschreibung`, `leiter`, `kontakt`, `map_pin`, `max_bachelor`, `wikilink`, `paydeadline`, `payinfo`, `opentime`, `disclaimlink`) VALUES
(2, 'Fachschaftsfahrt Winter 2013', 'KiEZ Frauensee bei Gräbendorf', '2013-10-25', '2013-10-27', 1, 'Erstsemester und Fachschaftsfahrt im Wintersemester 13/14<br>Alle Informationen im <a rel="nofollow" target="_blank" href="http://wiki.fachschaft.informatik.hu-berlin.de/wiki/Fachschaftsfahrt_Winter_2013">Wiki</a>', 'Orga Name', 'organame@mail.com', '52.43893109993363 13.648079039184609', 10, 'https://wiki.fachschaft.informatik.hu-berlin.de/wiki/Erstsemesterfahrt', '2015-09-24', 'Some\r\nPayment\r\nInfo\r\nHere', 1443639637, 'https://fachschaft.informatik.hu-berlin.de/index.php?title=FachschaftsfahrtDisclaimer&oldid=428');
-- --------------------------------------------------------
--
-- Table structure for table `notes`
--
CREATE TABLE `notes` (
`note_id` int(11) NOT NULL,
`fahrt_id` int(11) NOT NULL,
`note` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `notes`
--
INSERT INTO `notes` (`note_id`, `fahrt_id`, `note`) VALUES
(2, 2, '<h1><b>Testnotiz 123<br></b></h1>hier kann man <i>notizen </i>hinterlassen test<br><br><h2><b>Dumme Bemerkung</b></h2>Notiz = no&nbsp;<span class="wysiwyg-color-red">tits!<br></span><b><br><br>aoisdkd<br>asdlji<br><br></b><b><br></b>');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `bachelor`
--
ALTER TABLE `bachelor`
ADD PRIMARY KEY (`bachelor_id`,`fahrt_id`);
--
-- Indexes for table `fahrten`
--
ALTER TABLE `fahrten`
ADD PRIMARY KEY (`fahrt_id`);
--
-- Indexes for table `notes`
--
ALTER TABLE `notes`
ADD PRIMARY KEY (`note_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `fahrten`
--
ALTER TABLE `fahrten`
MODIFY `fahrt_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `notes`
--
ALTER TABLE `notes`
MODIFY `note_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
\ No newline at end of file