Skip to content
Snippets Groups Projects
Commit 1be994ab authored by Tim Repke's avatar Tim Repke
Browse files

export of refrat-liste is finished

parent 2682dc55
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
* Time: 4:19 PM
*/
error_reporting(E_ALL | E_STRICT);
ini_set("display_errors",1);
session_start();
......
......@@ -35,10 +35,35 @@ if(isset($_REQUEST['ex'])){
}
function genRefRa(){
global $text, $header, $footer;
printTable(["col 1", "vol2"], [["a","b"],["c","d"]]);
$header = "Testhead";
$footer = "Testfoot";
global $header, $footer, $admin_db, $config_current_fahrt_id;
$people = $admin_db->select('bachelor',["forname", "sirname"], ["fahrt_id"=>$config_current_fahrt_id]);
$tabdata = [];
foreach($people as $p){
array_push($tabdata, [$p['forname']." ".$p['sirname'],"",""]);
}
// leerfelder (just in case)
for($run = 0; $run < 8; $run++){
array_push($tabdata, ["&nbsp;","&nbsp;","&nbsp;"]);
}
$tabconf = ["colwidth" => ["20%", "55%", "25%"],
"cellheight" => "35pt"];
printTable(["Name", "Anschrift", "Unterschrift"], $tabdata, $tabconf);
$data = getFahrtInfo();
$header = "
<h1>TeilnehmerInnenliste und Einverständniserklärung</h1>
<h2>Fachschaftsfahrt</h2>
Fachschaft: <u>Informatik</u><br />
Ziel: <u>".$data['ziel']."</u><br />
Datum der Fahrt: <u>".comm_from_mysqlDate($data['von'])." - ".comm_from_mysqlDate($data['bis'])."</u><br />
Hiermit erklären wir uns mit unserer Unterschrift damit einverstanden, dass das von uns
ausgelegten Geld für die Fachschaftsfahrt auf das Konto des/der Finanzverantwortlichen/r,
<u>".$data['leiter']."</u>, überwiesen wird.";
$footer = "Einverstädniserklärung - ".$data['titel'];
}
function genTreff(){
......@@ -53,11 +78,11 @@ function genUnter(){
}
function printTable($headers, $data){
function printTable($headers, $data, $tabconf = []){
global $text;
$text.="
<table>
<table class='dattable'>
<thead>
<tr>";
foreach($headers as $h)
......@@ -65,14 +90,35 @@ function printTable($headers, $data){
$text.="
</tr>
</thead>
<tbody>";for($i=0; $i<300; $i++){
<tbody>";for($i=0; $i<10; $i++){ // FIXME entfernen! nur zu Testzwecken...
foreach($data as $dr){
$text .= "<tr>";
foreach($dr as $dc)
$text .= "<td>".$dc."</td>";
$cell = 0;
foreach($dr as $dc){
$text .= "<td".cellStyle($tabconf,$cell).">".$dc."</td>";
$cell++;
}
$text .= "</tr>";
}}
$text .="
</tbody>
</table>";
}
function cellStyle($tabconf, $cell){
$ret = "";
if(isset($tabconf['cellheight']) || isset($tabconf['colwidth'])){
$ret .= " style='";
if(isset($tabconf['cellheight']))
$ret .= "height:".$tabconf['cellheight'].";";
if(isset($tabconf['colwidth']) && isset($tabconf['colwidth'][$cell]))
$ret .= "width:".$tabconf['colwidth'][$cell].";";
$ret .= "'";
}
return $ret;
}
function getFahrtInfo(){
global $config_current_fahrt_id, $admin_db;
return $admin_db->get("fahrten", ["beschreibung", "titel", "von", "bis", "ziel", "map_pin", "leiter", "kontakt", "regopen", "max_bachelor"], array("fahrt_id"=>$config_current_fahrt_id));
}
\ No newline at end of file
......@@ -4,51 +4,63 @@
<title>{title}</title>
{headers}
<style type="text/css">
@media print {
html, body{
margin: 0;
padding: 0;
border: 0;
}
div.footer {
position: fixed;
bottom: 0;
display: block;
margin-top: 1em;
}
html, body{
margin: 0;
padding: 0;
border: 0;
font-family:Verdana,Helvetica,sans-serif;
font-size:12pt;
}
div.header {
position: fixed;
top: 0;
display: block;
margin-bottom: 2em;
@media print, screen {
h1{
font-size: 14pt;
}
h2{
font-size: 13pt;
}
th.header{
width: 100%;
border-bottom: 1px dashed black;
text-decoration: none;
font-weight: normal;
text-align: left;
}
thead{
display: table-header-group;
}
#footer {
display: block;
position: fixed;
bottom: 0;
border-top: 1px dashed #000000;
}
#footer:after {
counter-increment: page;
content: "Seite" counter(page);
right: 0;
top: 0pt;
position: absolute;
}
table {
border-collapse: collapse;
}
.dattable table, .dattable th, .dattable td {
border: 1px solid black;
vertical-align: top;
}
}
/* not supported in FF yet :( */
/*
@page :first, :left, :right{
margin: 0;
padding: 0;
@page {
margin: 3em;
}
*/
</style>
</head>
......@@ -72,7 +84,7 @@
</tfoot>
<tbody>
<tr>
<td width="100%">
<td width="100%" style="padding-top: 10pt">
{text}
</td>
......
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