From 890cb61094aa6e0dbf1570786bb05697b22e7880 Mon Sep 17 00:00:00 2001 From: Tim Repke <repketim@informatik.hu-berlin.de> Date: Tue, 26 Aug 2014 23:23:53 +0200 Subject: [PATCH] initial exportoptioncommit + some edit on cost --- registration-system/admin/index.php | 3 + registration-system/admin/pages.php | 3 + registration-system/admin/pages_cost.php | 86 +++++++++++++----- registration-system/admin/pages_export.php | 19 ++++ registration-system/view/admin_style.css | 12 ++- registration-system/view/graphics/outlonk.png | Bin 0 -> 143 bytes 6 files changed, 100 insertions(+), 23 deletions(-) create mode 100644 registration-system/admin/pages_export.php create mode 100644 registration-system/view/graphics/outlonk.png diff --git a/registration-system/admin/index.php b/registration-system/admin/index.php index 4c36f46..f91df20 100644 --- a/registration-system/admin/index.php +++ b/registration-system/admin/index.php @@ -37,6 +37,7 @@ if (isLoggedIn()) "Kosten" => "cost", "Rundmail" => "mail", "Notizen" => "notes", + "Listenexport" => "export", "Deadlink" => "dead" ); @@ -64,6 +65,8 @@ if (isLoggedIn()) page_mail(); break; case "notes": page_notes(); break; + case "export": + page_export(); break; default: page_404($page); } diff --git a/registration-system/admin/pages.php b/registration-system/admin/pages.php index 3d57dd6..6aaf132 100644 --- a/registration-system/admin/pages.php +++ b/registration-system/admin/pages.php @@ -111,6 +111,9 @@ function page_mail(){ function page_cost(){ require_page("pages_cost.php"); } +function page_export(){ + require_page("pages_export.php"); +} function require_page($page){ if(!@file_exists($page) ) { diff --git a/registration-system/admin/pages_cost.php b/registration-system/admin/pages_cost.php index c3acf35..a4e15fe 100644 --- a/registration-system/admin/pages_cost.php +++ b/registration-system/admin/pages_cost.php @@ -8,45 +8,87 @@ global $config_studitypen, $config_reisearten, $config_essen, $admin_db, $config_current_fahrt_id, $config_admin_verbose_level, $config_verbose_level, $text, $headers, $ajax; -$text .= "<h2>Unterkunft</h2>"; -$h = array("Position", "Anzahl", "Satz", "Summe"); -$s[3] = array(1,2); -$t[2] = " €"; -$t[3] = " €"; - $text .= "<h3>Kalkulation</h3>"; -$d = array(array("Übernachtung", 2, 10.50), - array("Zwiebel", 300, 5), - array("Brötchen", 200, 0.2)); +$h1 = array("Position", "Anzahl (normal)", "Satz", "Summe"); +$s1[3] = array(1,2); +$t1[2] = " €"; +$t1[3] = " €"; +$d1 = array(array("Reisekosten", 2, 1.9), + array("Übernachtung (HP)", 2, 17.8), + array("Bettwäsche", 1, 4), + array("Grillen", 1, 0.3), + array("Kurzreisezuschlag", 1, 2)); +$text .= html_table($h1, $d1, $s1, $t1); +$text .= "<h2>Einkaufen</h2>"; +$h2 = array("Position", "Anzahl", "Satz", "Summe"); +$s2[3] = array(1,2); +$t2[2] = " €"; +$t2[3] = " €"; +$d2 = array(array("Club Mate", 120, 0.69), + array("Chips", 15,0.5), + array("Flips", 15, 0.5), + array("Fanta", 24, 0.39), + array("Wasser", 42, 0.3)); +$text .= html_table($h2, $d2, $s2, $t2); -$text .= html_table($h, $d, $s, $t); $text .= "<h3>Rechnung</h3>"; -$text .= html_table($h, $d, $s, $t); - -$text .= "<h2>Einkaufen</h2>"; -$text .= html_table($h, $d, $s, $t); +$h3 = array("Position", "Menge", "Anzahl", "Satz", "Summe"); +$s3[4] = array(1,2,3); +$t3[3] = " €"; +$t3[4] = " €"; +$d3 = array( + array("Übernachtung", 2, 69, 10.5), + array("Bettwäsche", 1, 75, 4), + array("Grillnutzung", 1, 69, 0.3), + array("Kurzreisezuschlag", 1, 69, 2), + array("Halbpension", 2, 69, 7.3)); +$text .= html_table($h3, $d3, $s3, $t3); $text .= "<h2>Money In/Out</h2>"; -$text .= html_table($h, $d, $s, $t); +$text .= '<div style="float:left">'; +$h4 = array("Position", "Summe"); +$s4 = array(); +$t4[1] = " €"; +$d4_out = array( + array("Frauensee", 2815.1), + array("Einkauf", 590.13), + array("Busfahrt", 216), + array("Bäcker", 22.4), + array("Kaution", 100) +); +$d4_in = array( + array("Pfand1", 82.17), + array("Pfand2", 10), + array("Pfand3", 15), + array("Fachschaft (Reste)", 76), + array("Kollekte", 4620), + array("Förderung", 2200), + array("Kaution", 100) +); +$text .= html_table($h4, $d4_out, $s4, $t4); +$text .= '</div><div style="float:left">'; +$text .= html_table($h4, $d4_in, $s4, $t4); +$text .= '</div><div style="clear:both"></div>'; + /** - * $headers + * $headers * is an array of the headers * $data * is an array with the data to output - * $sum - * is an array declaring which cols should be summed up and put below the table, + * $sum + * is an array declaring which cols should be summed up and put below the table, * second dimension declares which cols need to be multiplied (if no second dimension, just sum at the end) - * $type + * $type * is an array declaring type of data to put behind the value (i.e. €), not all cols need to be declared * * return value: variable containing the html code for echo */ function html_table($header, $data, $sum = array(), $type = array()){ $summy = array(); - + $ret = "<table class=\"cost-table\"> <thead> <tr>\n"; @@ -74,7 +116,7 @@ function html_table($header, $data, $sum = array(), $type = array()){ $tmp = (is_null($tmp)) ? $row[$s] : $tmp*$row[$s]; } $ret .= prepval($tmp,(isset($type[$i]) ? $type[$i] : "")); - + if(!isset($summy[$i])) $summy[$i] = $tmp; else @@ -102,7 +144,7 @@ function html_table($header, $data, $sum = array(), $type = array()){ </tfoot>\n"; } $ret.= "</table>"; - + return $ret; } diff --git a/registration-system/admin/pages_export.php b/registration-system/admin/pages_export.php new file mode 100644 index 0000000..79e217e --- /dev/null +++ b/registration-system/admin/pages_export.php @@ -0,0 +1,19 @@ +<?php +/** + * Created by PhpStorm. + * User: tim + * Date: 8/26/14 + * Time: 10:05 PM + */ + +global $config_studitypen, $config_reisearten, $config_essen, $admin_db, $config_current_fahrt_id, $config_admin_verbose_level, $config_verbose_level, $text, $headers, $ajax; + +$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="http://www.refrat.de/docs/finanzen/FormularFSErstattung_sepa_form_2.pdf">Erstattungsformular</a></li> +</ul> +'; \ No newline at end of file diff --git a/registration-system/view/admin_style.css b/registration-system/view/admin_style.css index b3c9076..409da2d 100644 --- a/registration-system/view/admin_style.css +++ b/registration-system/view/admin_style.css @@ -19,6 +19,12 @@ a:active, a:hover { color:#ff6000; text-decoration:none; } +a[href ^= "http"]:after { + content: " " url("graphics/outlonk.png"); +} +table { + border-collapse: collapse; +} #linkbar{ border-bottom: 1px dashed coral; width: 100%; @@ -51,7 +57,7 @@ form table tr td{ } .cost-table{ - + padding: 5px; } .cost-table td{ padding-left: 12px; @@ -70,3 +76,7 @@ form table tr td{ .cost-table-invisible{ border: 0; } +.cost-table tfoot td{ + border-bottom: 1px solid #0c0c0c; + border-top: 1px dashed #0c0c0c; +} \ No newline at end of file diff --git a/registration-system/view/graphics/outlonk.png b/registration-system/view/graphics/outlonk.png new file mode 100644 index 0000000000000000000000000000000000000000..acf260fcd9c744bf3479f8e15c66b458b22df568 GIT binary patch literal 143 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4g?YL-hE&AWo^Rx2FywF!EPv(q z?up+`&GIP@ADGl@xZXNvOpFPge3N}H<L})5#2lOEma7l?rg*Q2%y@9Nt?^H%oW!e- raZ-)H9@w&eSGyD-xl4YA;sfTN2eiEHR5*?TZD8<p^>bP0l+XkKp#3xN literal 0 HcmV?d00001 -- GitLab