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

adjusted print template, now header and footer support

parent 0e99e463
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,8 @@ $template = file_get_contents("../view/admin_template.html"); ...@@ -19,6 +19,8 @@ $template = file_get_contents("../view/admin_template.html");
$title = "FSFahrt - Admin Panel"; $title = "FSFahrt - Admin Panel";
$navigation = ""; $navigation = "";
$headers = ""; $headers = "";
$header = "";
$footer = "";
$text = ""; $text = "";
$ajax = ""; $ajax = "";
...@@ -84,6 +86,8 @@ else{ ...@@ -84,6 +86,8 @@ else{
$rep = ["{headers}" => $headers, $rep = ["{headers}" => $headers,
"{text}" => $text, "{text}" => $text,
"{navigation}" => $navigation, "{navigation}" => $navigation,
"{title}" => $title]; "{title}" => $title,
"{header}" => $header,
"{footer}" => $footer];
echo str_replace(array_keys($rep), array_values($rep), $template); echo str_replace(array_keys($rep), array_values($rep), $template);
} }
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Time: 10:05 PM * 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; global $config_studitypen, $config_reisearten, $config_essen, $admin_db, $config_current_fahrt_id, $config_admin_verbose_level, $config_verbose_level, $text, $headers, $ajax, $header, $footer;
$text .= ' $text .= '
<ul> <ul>
...@@ -35,11 +35,10 @@ if(isset($_REQUEST['ex'])){ ...@@ -35,11 +35,10 @@ if(isset($_REQUEST['ex'])){
} }
function genRefRa(){ function genRefRa(){
global $text; global $text, $header, $footer;
printTable(["col 1", "vol2"], [["a","b"],["c","d"]]); printTable(["col 1", "vol2"], [["a","b"],["c","d"]]);
$text .= " $header = "Testhead";
<div class='footer'>TESTFOOT</div> $footer = "Testfoot";
<div class='header'>TESTHEAD</div>";
} }
function genTreff(){ function genTreff(){
......
...@@ -53,6 +53,7 @@ if(file_exists($config_userfile)) ...@@ -53,6 +53,7 @@ if(file_exists($config_userfile))
$usas = file_get_contents($config_userfile); $usas = file_get_contents($config_userfile);
$text .= '<h2>Nutzer bearbeiten</h2> $text .= '<h2>Nutzer bearbeiten</h2>
ACHTUNG: Tippfehler können Systemfunktionalität beeinträchtigen! <i>Format: {N|S}⎵USERNAME⎵PASSWORD⎵RANDOMSTUFF</i><br /> ACHTUNG: Tippfehler können Systemfunktionalität beeinträchtigen! <i>Format: {N|S}⎵USERNAME⎵PASSWORD⎵RANDOMSTUFF</i><br />
Captain Obvious: "Nutzername darf kein Leerzeichen enthalten!"<br />
<a href="../passwd/index.html">Passwort-gen tool</a> (an Organisator weiterleiten, der schickt dann Passwort hash zurück)<br /> <a href="../passwd/index.html">Passwort-gen tool</a> (an Organisator weiterleiten, der schickt dann Passwort hash zurück)<br />
<form method="POST"> <form method="POST">
<textarea rows="8" cols="130" name="users" id="users">'.$usas.'</textarea><br /> <textarea rows="8" cols="130" name="users" id="users">'.$usas.'</textarea><br />
......
<!DOCTYPE html> <!DOCTYPE html>
<html> <html moznomarginboxes mozdisallowselectionprint>
<head> <head>
<title>{title}</title> <title>{title}</title>
{headers} {headers}
<style type="text/css"> <style type="text/css">
@media print { @media print {
html, body{
margin: 0;
padding: 0;
border: 0;
}
div.footer { div.footer {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
display: block;
margin-top: 1em;
} }
div.header { div.header {
position: fixed; position: fixed;
top: 0; top: 0;
display: block;
margin-bottom: 2em;
}
th.header{
width: 100%;
border-bottom: 1px dashed black;
} }
thead{ thead{
display: table-header-group; display: table-header-group;
} }
#footer {
display: block;
position: fixed;
bottom: 0;
border-top: 1px dashed #000000;
}
} }
/* not supported in FF yet :( */
/*
@page :first, :left, :right{
margin: 0;
padding: 0;
}
*/
</style> </style>
</head> </head>
<body> <body>
{text}
<!-- Jaaaa... Tabellenfoo! Aber anders geht es einfach nicht! -->
<table width="100%">
<thead>
<tr>
<th class="header">{header}</th>
</tr>
</thead>
<tfoot>
<tr>
<td width="100%">
<table width="100%">
<tr>
<td><br>&nbsp;</td>
</tr>
</table>
</tfoot>
<tbody>
<tr>
<td width="100%">
{text}
</td>
</tr>
</tbody>
</table>
<table id="footer" width="100%">
<tr>
<td width="100%">
{footer}
</td>
</tr>
</table>
</body> </body>
</html> </html>
\ No newline at end of file
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