From ce7a0bd4674a3975a167535626cbc67845ed5ca1 Mon Sep 17 00:00:00 2001 From: Tim Repke <timmothey@gmx.de> Date: Fri, 30 Oct 2015 19:41:10 +0100 Subject: [PATCH] added no header option for list exports --- registration-system/admin/pages_export.php | 6 +- registration-system/view/print_style.css | 112 ++++++++++++++++ registration-system/view/print_template.html | 122 +----------------- .../view/print_template_noheaders.html | 11 ++ 4 files changed, 131 insertions(+), 120 deletions(-) create mode 100644 registration-system/view/print_style.css create mode 100644 registration-system/view/print_template_noheaders.html diff --git a/registration-system/admin/pages_export.php b/registration-system/admin/pages_export.php index 6bbafbb..382a63c 100644 --- a/registration-system/admin/pages_export.php +++ b/registration-system/admin/pages_export.php @@ -22,18 +22,20 @@ NOTE: No Chrome support! Webkit/Blink haven\'t implemented support for @media pr if(isset($_REQUEST['ex'])){ global $template; - $template = file_get_contents("../view/print_template.html"); $text = ""; + $noheader = ""; switch($_REQUEST['ex']){ case "refra": genRefRa(); break; case "treff": genTreff(); break; case "konto": genKonto(); break; - case "mord": genMord(); break; + case "mord": genMord(); $noheader = '_noheaders'; break; case "unter": genUnter(); break; default: break; } + + $template = file_get_contents("../view/print_template$noheader.html"); } function genRefRa(){ diff --git a/registration-system/view/print_style.css b/registration-system/view/print_style.css new file mode 100644 index 0000000..aa6b76e --- /dev/null +++ b/registration-system/view/print_style.css @@ -0,0 +1,112 @@ +html, body{ + margin: 0; + padding: 0; + border: 0; + font-family:Verdana,Helvetica,sans-serif; + font-size:12pt; +} + +@media print, screen { + *{float: none} + 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; + border-spacing: 0; + width: 100%; + margin: 0; + } + + .dattable table, .dattable th, .dattable td { + border: 1px solid black; + vertical-align: top; + } + + .graycell{ + background-color: transparent; + overflow: hidden; + z-index: 1; + border-right: 0; + border-bottom: 0; + } + .graycell:before{ + content: ""; + padding: 0; + height: 1px; + line-height: 1px; + width: 1px; + margin: -4px -994px -996px -6px; + display: block; + border: 0; + z-index: -1; + position:relative; + top: -500px; + border-top: 999px solid #d3d3d3; + border-left: 999px solid #d3d3d3;; + } + +} +@media print { + .page-break { display: block; page-break-before: always; } +} +@page { + margin: 3em; +} + +.killbox { + border: 1px solid black; + height: 230px; + width: 45%; + float: left; + padding: 8px; + margin: 20px 20px 0 0; + page-break-inside: avoid; +} +.killbox:nth-child(odd) { + margin: 20px 0 0 0; +} +.killbox [role="killer"], .killbox [role="victim"] { + border-bottom: 1px dashed black; + display: block; + margin-bottom: 5px; +} +.killbox [role="killer"]:before { + content: 'Mörder: '; + font-weight: bold; +} +.killbox [role="victim"]:before { + content: 'Opfer: '; + font-weight: bold; +} diff --git a/registration-system/view/print_template.html b/registration-system/view/print_template.html index 98935df..04d1cb2 100644 --- a/registration-system/view/print_template.html +++ b/registration-system/view/print_template.html @@ -3,130 +3,16 @@ <head> <title>{title}</title> {headers} - <style type="text/css"> - html, body{ - margin: 0; - padding: 0; - border: 0; - font-family:Verdana,Helvetica,sans-serif; - font-size:12pt; - } - - @media print, screen { - *{float: none} - 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; - border-spacing: 0; - width: 100%; - margin: 0; - } - - .dattable table, .dattable th, .dattable td { - border: 1px solid black; - vertical-align: top; - } - - .graycell{ - background-color: transparent; - overflow: hidden; - z-index: 1; - border-right: 0; - border-bottom: 0; - } - .graycell:before{ - content: ""; - padding: 0; - height: 1px; - line-height: 1px; - width: 1px; - margin: -4px -994px -996px -6px; - display: block; - border: 0; - z-index: -1; - position:relative; - top: -500px; - border-top: 999px solid #d3d3d3; - border-left: 999px solid #d3d3d3;; - } - - } - @media print { - .page-break { display: block; page-break-before: always; height: 80pt} - } - @page { - margin: 3em; - } - - .killbox { - border: 1px solid black; - height: 230px; - width: 45%; - float: left; - padding: 8px; - margin: 20px 20px 0 0; - page-break-inside: avoid; - } - .killbox:nth-child(odd) { - margin: 20px 0 0 0; - } - .killbox [role="killer"], .killbox [role="victim"] { - border-bottom: 1px dashed black; - display: block; - margin-bottom: 5px; - } - .killbox [role="killer"]:before { - content: 'Mörder: '; - font-weight: bold; - } - .killbox [role="victim"]:before { - content: 'Opfer: '; - font-weight: bold; - } - - </style> + <link href="../view/print_style.css" rel="stylesheet" /> </head> <body> <!-- Jaaaa... Tabellenfoo! Aber anders geht es einfach nicht! --> <table width="100%"> <thead> - <tr> - <th class="header">{header}</th> - </tr> + <tr> + <th class="header">{header}</th> + </tr> </thead> <tfoot> <tr> diff --git a/registration-system/view/print_template_noheaders.html b/registration-system/view/print_template_noheaders.html new file mode 100644 index 0000000..63d587c --- /dev/null +++ b/registration-system/view/print_template_noheaders.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html moznomarginboxes mozdisallowselectionprint> +<head> + <title>{title}</title> + {headers} + <link href="../view/print_style.css" rel="stylesheet" /> +</head> +<body> + {text} +</body> +</html> \ No newline at end of file -- GitLab