Skip to content
Snippets Groups Projects
Commit 279ae0a9 authored by Manuel Herrmann's avatar Manuel Herrmann
Browse files

Merge branch 'master' of 0xbit:fsfahrttoolteam/registration-system

parents a8abefb0 15379dd5
No related branches found
No related tags found
No related merge requests found
...@@ -9,83 +9,8 @@ function page_stuff() ...@@ -9,83 +9,8 @@ function page_stuff()
$text .= "Übersichtsseite"; $text .= "Übersichtsseite";
} }
function page_list() function page_list(){
{ require_page("pages_list.php");
global $text, $headers, $admin_db;
$headers =<<<END
<link rel="stylesheet" type="text/css" href="../view/css/DataTables/css/jquery.dataTables.min.css" />
<script type="text/javascript" src="../view/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../view/js/jquery.dataTables.min.js"></script>
END;
$text .= "Meldeliste";
$columns = array(
"bachelor_id",
"fahrt_id",
"forname",
"sirname",
"mehl",
"pseudo",
"antyp",
"abtyp",
"anday",
"abday",
"comment",
"studityp",
"paid",
"repaid",
"backstepped"
);
$columnFunctions = array(
"Anmelde-ID" => function($person) { return $person["bachelor_id"]; },
"FahrtID" => function($person) { return $person["fahrt_id"]; },
"Name" => function($person) { return "<a href='mailto:".$person["mehl"]."?subject=FS-Fahrt'>".$person["forname"]." ".$person["sirname"]." (".$person["pseudo"].")</a>"; },
"Anreisetyp" => function($person) { return $person["antyp"]; },
"Abreisetyp" => function($person) { return $person["abtyp"]; },
"Anreisetag" => function($person) { return $person["anday"]; },
"Abreisetag" => function($person) { return $person["abday"]; },
"Kommentar" => function($person) { return $person["comment"]; },
"StudiTyp" => function($person) { return $person["studityp"]; },
"PaidReBack" => function($person) { return ($person["paid"] ? "1" : "0") . ($person["repaid"] ? "1" : "0") . ($person["backstepped"] ? "1" : "0"); }
);
$text .=<<<END
<table id="mlist">
<thead>
<tr>
END;
foreach($columnFunctions as $key => $value)
{
$text .= "<th>".$key."</th>";
}
$text .=<<<END
</tr>
</thead>
<tbody>
END;
// TODO: generate table content
$people = $admin_db->select('bachelor',$columns);
foreach($people as $person) {
$text .= "<tr>";
foreach($columnFunctions as $key => $value)
{
$text .= "<td>".$value($person)."</td>";
}
$text .= "</tr>";
}
$text .=<<<END
</tbody>
</table>
<script type='text/javascript'>
$(document).ready(function(){
$('#mlist').dataTable({});
});
</script>
END;
} }
function page_404($pag) function page_404($pag)
......
<?php
/**
* Created by PhpStorm.
* User: tim
* Date: 9/3/14
* Time: 7:09 PM
*/
global $text, $headers, $admin_db, $config_current_fahrt_id;
$headers =<<<END
<link rel="stylesheet" type="text/css" href="../view/css/DataTables/css/jquery.dataTables.min.css" />
<script type="text/javascript" src="../view/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../view/js/jquery.dataTables.min.js"></script>
END;
$text .= "Meldeliste";
$columns = array(
"bachelor_id",
"fahrt_id",
"anm_time",
"forname",
"sirname",
"mehl",
"pseudo",
"antyp",
"abtyp",
"anday",
"abday",
"comment",
"studityp",
"paid",
"repaid",
"backstepped"
);
$columnFunctions = array(
"Anmelde-ID" => function($person) { return $person["bachelor_id"]; }
//,"FahrtID" => function($person) { return $person["fahrt_id"]; }
,"Anmeldung" => function($person) { return date("m.d.Y", $person['anm_time']); },
"Name" => function($person) { return "<a href='mailto:".$person["mehl"]."?subject=FS-Fahrt'>".$person["forname"]." ".$person["sirname"]." (".$person["pseudo"].")</a>"; },
"Anreisetyp" => function($person) { return $person["antyp"]; },
"Abreisetyp" => function($person) { return $person["abtyp"]; },
"Anreisetag" => function($person) { return date("m.d.Y", $person["anday"]); },
"Abreisetag" => function($person) { return date("m.d.Y", $person["abday"]); },
"Kommentar" => function($person) { return $person["comment"]; },
"StudiTyp" => function($person) { return $person["studityp"]; },
"PaidReBack" => function($person) { return ($person["paid"] ? "1" : "0") . ($person["repaid"] ? "1" : "0") . ($person["backstepped"] ? "1" : "0"); }
);
$text .=<<<END
<table id="mlist">
<thead>
<tr>
END;
foreach($columnFunctions as $key => $value)
{
$text .= "<th>".$key."</th>";
}
$text .=<<<END
</tr>
</thead>
<tbody>
END;
$people = $admin_db->select('bachelor',$columns, array("fahrt_id"=>$config_current_fahrt_id));
foreach($people as $person) {
$text .= "<tr>";
foreach($columnFunctions as $key => $value)
{
$text .= "<td class='".$key."'>".$value($person)."</td>";
}
$text .= "</tr>";
}
$text .=<<<END
</tbody>
</table>
<script type='text/javascript'>
$(document).ready(function(){
$('#mlist').dataTable({});
$('.PaidReBack').each(function(){
$(this).text(function(){
var btns = "";
for(var i = 0, txt = $(this).text(); i < txt.length; i++){
btns += txt[i]+",";
}
return btns;
});
});
});
</script>
END;
...@@ -26,7 +26,7 @@ function comm_format_date($date){ ...@@ -26,7 +26,7 @@ function comm_format_date($date){
} }
function comm_get_possible_dates($fid){ function comm_get_possible_dates($fid){
return array("12.03.2014","13.03.2014","14.03.2014"); return array("12.03.2014","13.03.2014","14.03.2014"); // FIXME dynamisch machen!
} }
function comm_isopen_fid($db_handle, $fid){ function comm_isopen_fid($db_handle, $fid){
......
...@@ -77,6 +77,9 @@ function index_form_to_db($data){ ...@@ -77,6 +77,9 @@ function index_form_to_db($data){
global $index_db, $config_baseurl, $lang_regmail, $config_current_fahrt_id; global $index_db, $config_baseurl, $lang_regmail, $config_current_fahrt_id;
$data['version'] = 1; $data['version'] = 1;
$data['bachelor_id'] = comm_generate_key($index_db, "bachelor", "bachelor_id", array('fahrt_id'=>$data['fahrt_id'])); $data['bachelor_id'] = comm_generate_key($index_db, "bachelor", "bachelor_id", array('fahrt_id'=>$data['fahrt_id']));
$data['anm_time'] = time();
$data['anday'] = DateTime::createFromFormat('d.m.Y',$data['anday'])->getTimestamp();
$data['abday'] = DateTime::createFromFormat('d.m.Y',$data['abday'])->getTimestamp();
$index_db->insert("bachelor", $data); $index_db->insert("bachelor", $data);
$from = $index_db->get("fahrten", array("kontakt","leiter"), array("fahrt_id"=>$config_current_fahrt_id)); $from = $index_db->get("fahrten", array("kontakt","leiter"), array("fahrt_id"=>$config_current_fahrt_id));
$mail = comm_get_lang("lang_regmail", array( "{{url}}" => $config_baseurl."status.php?hash=".$data['bachelor_id'], $mail = comm_get_lang("lang_regmail", array( "{{url}}" => $config_baseurl."status.php?hash=".$data['bachelor_id'],
...@@ -351,7 +354,7 @@ function index_show_signupTable($fid){ ...@@ -351,7 +354,7 @@ function index_show_signupTable($fid){
<table class="signups"> <table class="signups">
<thead> <thead>
<tr> <tr>
<th></th> <!--th></th-->
<th>Anzeigename</th> <th>Anzeigename</th>
<th>Anreisetag</th> <th>Anreisetag</th>
<th>Anreiseart</th> <th>Anreiseart</th>
...@@ -362,11 +365,11 @@ function index_show_signupTable($fid){ ...@@ -362,11 +365,11 @@ function index_show_signupTable($fid){
</thead>'; </thead>';
foreach($data as $d){ foreach($data as $d){
echo '<tr> echo '<tr>
<td>'.$d["studityp"].'</td> <!--td>'.$d["studityp"].'</td-->
<td>'.$d["pseudo"].'</td> <td>'.$d["pseudo"].'</td>
<td>'.$d["anday"].'</td> <td>'.date('d.m.Y', $d["anday"]).'</td>
<td>'.$d["antyp"].'</td> <td>'.$d["antyp"].'</td>
<td>'.$d["abday"].'</td> <td>'.date('d.m.Y', $d["abday"]).'</td>
<td>'.$d["abtyp"].'</td> <td>'.$d["abtyp"].'</td>
<td>'.$d["comment"].'</td> <td>'.$d["comment"].'</td>
</tr>'; </tr>';
......
...@@ -36,10 +36,11 @@ function show_content(){ ...@@ -36,10 +36,11 @@ function show_content(){
$infolist = Array( $infolist = Array(
'Anmelde ID' => $data['bachelor_id'], 'Anmelde ID' => $data['bachelor_id'],
'Anmeldetag' => date('d.m.Y', $data['anm_time']),
'Vor-/Nachname' => $data['forname'].' '.$data['sirname'].(strlen($data['pseudo']) > 0 ? ' ('.$data['pseudo'].')' : ""), 'Vor-/Nachname' => $data['forname'].' '.$data['sirname'].(strlen($data['pseudo']) > 0 ? ' ('.$data['pseudo'].')' : ""),
'eMail-Adresse' => $data['mehl'], 'eMail-Adresse' => $data['mehl'],
'Anreisetag &amp; Art' => $data["anday"].' ('.$data["antyp"].')', 'Anreisetag &amp; Art' => date('d.m.Y', $data["anday"]).' ('.$data["antyp"].')',
'Abreisetag &amp; Art' => $data["abday"].' ('.$data["abtyp"].')', 'Abreisetag &amp; Art' => date('d.m.Y', $data["abday"]).' ('.$data["abtyp"].')',
'Essenswunsch' => $data["essen"], 'Essenswunsch' => $data["essen"],
'Zahlung erhalten' => ((is_null($data["paid"])) ? "nein" : date('d.m.Y',$data["paid"])), 'Zahlung erhalten' => ((is_null($data["paid"])) ? "nein" : date('d.m.Y',$data["paid"])),
'Rückzahlung gesendet' => ((is_null($data["repaid"])) ? "nein" : date('d.m.Y',$data["repaid"])), 'Rückzahlung gesendet' => ((is_null($data["repaid"])) ? "nein" : date('d.m.Y',$data["repaid"])),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment