diff --git a/registration-system/admin/index.php b/registration-system/admin/index.php index 97b364e12f29d41d4559637c56e6a56b304446d6..836ae980935c356f61db8e2c5fc52512221417bc 100644 --- a/registration-system/admin/index.php +++ b/registration-system/admin/index.php @@ -16,6 +16,7 @@ require_once("../config.inc.php"); require_once("../frameworks/medoo.php"); $template = file_get_contents("../view/admin_template.html"); +$title = "FSFahrt - Admin Panel"; $navigation = ""; $headers = ""; $text = ""; @@ -79,5 +80,10 @@ else if(isset($_REQUEST['ajax'])) echo $ajax; -else - echo str_replace("{headers}", $headers, str_replace("{text}", $text, str_replace("{navigation}", $navigation, $template))); +else{ + $rep = ["{headers}" => $headers, + "{text}" => $text, + "{navigation}" => $navigation, + "{title}" => $title]; + echo str_replace(array_keys($rep), array_values($rep), $template); +} \ No newline at end of file diff --git a/registration-system/admin/pages_export.php b/registration-system/admin/pages_export.php index 79e217ee163dd78f4ee339cd1df9e9e19dde650a..5a80677a0abc902f8220cc491aee3b6b642d503a 100644 --- a/registration-system/admin/pages_export.php +++ b/registration-system/admin/pages_export.php @@ -10,10 +10,70 @@ global $config_studitypen, $config_reisearten, $config_essen, $admin_db, $config $text .= ' <ul> - <li><a href="?page=export&ex=refra">RefRat-Liste</a> (<a href="http://www.refrat.hu-berlin.de/finanzen/TeilnehmerInnenlisteMitEinverstaendniserklaerung.pdf">orig</a>)</li> - <li><a href="?page=export&ex=treff">Treffpunktanwesenheitsliste</a></li> - <li><a href="?page=export&ex=konto">Kontodatenliste</a></li> - <li><a href="?page=export&ex=unter">Anwesenheitsunterschriftsliste für Unterkunft</a></li> + <li><a href="?page=export&ex=refra" target="_blank">RefRat-Liste</a> (<a href="http://www.refrat.hu-berlin.de/finanzen/TeilnehmerInnenlisteMitEinverstaendniserklaerung.pdf">orig</a>)</li> + <li><a href="?page=export&ex=treff" target="_blank">Treffpunktanwesenheitsliste</a></li> + <li><a href="?page=export&ex=konto" target="_blank">Kontodatenliste</a></li> + <li><a href="?page=export&ex=unter" target="_blank">Anwesenheitsunterschriftsliste für Unterkunft</a></li> <li><a href="http://www.refrat.de/docs/finanzen/FormularFSErstattung_sepa_form_2.pdf">Erstattungsformular</a></li> </ul> -'; \ No newline at end of file +NOTE: No Chrome support! Webkit/Blink haven\'t implemented support for @media print... This feature is developed to support Firefox. +'; + +if(isset($_REQUEST['ex'])){ + global $template; + $template = file_get_contents("../view/print_template.html"); + $text = ""; + + switch($_REQUEST['ex']){ + case "refra": genRefRa(); break; + case "treff": genTreff(); break; + case "konto": genKonto(); break; + case "unter": genUnter(); break; + default: + break; + } +} + +function genRefRa(){ + global $text; + printTable(["col 1", "vol2"], [["a","b"],["c","d"]]); + $text .= " + <div class='footer'>TESTFOOT</div> + <div class='header'>TESTHEAD</div>"; +} + +function genTreff(){ + +} + +function genKonto(){ + +} + +function genUnter(){ + +} + +function printTable($headers, $data){ + global $text; + + $text.=" + <table> + <thead> + <tr>"; + foreach($headers as $h) + $text.="<th>".$h."</th>"; + $text.=" + </tr> + </thead> + <tbody>";for($i=0; $i<300; $i++){ + foreach($data as $dr){ + $text .= "<tr>"; + foreach($dr as $dc) + $text .= "<td>".$dc."</td>"; + $text .= "</tr>"; + }} + $text .=" + </tbody> + </table>"; +} \ No newline at end of file diff --git a/registration-system/status.php b/registration-system/status.php index 35425ff0cec97af74f9ec7ea882f77e4a65f5fab..042cabe181a54aae7a1780fe76c146f27126185a 100644 --- a/registration-system/status.php +++ b/registration-system/status.php @@ -39,8 +39,8 @@ function show_content(){ 'Anmeldetag' => date('d.m.Y', $data['anm_time']), 'Vor-/Nachname' => $data['forname'].' '.$data['sirname'].(strlen($data['pseudo']) > 0 ? ' ('.$data['pseudo'].')' : ""), 'eMail-Adresse' => $data['mehl'], - 'Anreisetag & Art' => date('d.m.Y', $data["anday"]).' ('.$data["antyp"].')', - 'Abreisetag & Art' => date('d.m.Y', $data["abday"]).' ('.$data["abtyp"].')', + 'Anreisetag & Art' => comm_from_mysqlDate($data["anday"]).' ('.$data["antyp"].')', + 'Abreisetag & Art' => comm_from_mysqlDate($data["abday"]).' ('.$data["abtyp"].')', 'Essenswunsch' => $data["essen"], '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"])), diff --git a/registration-system/view/admin_template.html b/registration-system/view/admin_template.html index 393e5546832a068696162fd349693ea250a24041..6121841779d22f4c19680f650c8f4504eef66997 100644 --- a/registration-system/view/admin_template.html +++ b/registration-system/view/admin_template.html @@ -2,7 +2,7 @@ <html> <head> - <title>FSFahrt - Admin Panel</title> + <title>{title}</title> <meta charset="UTF-8" /> <link rel="stylesheet" href="../view/admin_style.css" /> {headers} diff --git a/registration-system/view/print_template.html b/registration-system/view/print_template.html new file mode 100644 index 0000000000000000000000000000000000000000..c4e1443fd3c2ff65e12534255ade1c7fda760e12 --- /dev/null +++ b/registration-system/view/print_template.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> +<head> + <title>{title}</title> + {headers} + <style type="text/css"> + @media print { + div.footer { + position: fixed; + bottom: 0; + } + + div.header { + position: fixed; + top: 0; + } + + thead{ + display: table-header-group; + } + + + } + + </style> +</head> +<body> +{text} +</body> +</html> \ No newline at end of file