1.0.1 - Bugfix Update

Changed from
"Header Location…"
to a javascript redirect due to complications with IE8. :(
This commit is contained in:
Gehirnfussel 2013-11-14 16:49:59 +01:00
parent b2f05f978a
commit 99fa678533
1 changed files with 42 additions and 44 deletions

View File

@ -1,51 +1,49 @@
<!doctype html>
<?php
#¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
# version......: 1.0.1
# last.change..: 2013-11-14
# created.by...: Jan Jastrow
# contact......: jan@schwerkraftlabor.de
# license......: MIT license
# soure........: https://github.com/Gehirnfussel/Firma2-Essensplan
#_________________
# Kalenderwoche ermitteln
$kw = (int)date('W');
# Wenn Kalenderwoche <= 9 dann füge eine 0 vorne dran.
if ($kw <= 9)
$kw = "0".$kw;
# GET-Parameter auslesen
if(isset($_GET['wann']))
$wann = $_GET['wann'];
else
$wann = 0; # Standard: Aktuelle Woche (+0)
# Diese Woche + $wann
$kw = $kw + $wann;
# Standort auslesen
if(isset($_GET['wo']))
$wo = $_GET['wo'];
else
$wo = "RD"; # Standard: RD
# Pfad und Dateiname zum PDF
$speiseplan = "file://rdbs124/Tausch/Info/Speisepläne/KKH-".$wo."/Personalspeiseplan/".$kw."-KW.pdf";
# Direkte Weiterleitung zum entsprechenden Speiseplan
echo '<!doctype html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
<title>Speiseplan</title>
</head>
<body>
<?php
#¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
# created.by...: Jan Jastrow
# version......: 1.0
# last.change..: 2013-10-30
# license......: MIT
# soure........: https://github.com/Gehirnfussel/Firma2-Essensplan
#_______________
# Kalenderwoche ermitteln
$kw = (int)date('W');
# Wenn Kalenderwoche <= 9 dann füge eine 0 vorne dran.
if ($kw <= 9)
$kw = "0".$kw;
# GET-Parameter auslesen
if(isset($_GET['wann']))
$wann = $_GET['wann'];
else
$wann = 0;
# Diese Woche + $wann
$kw = $kw + $wann;
# Standort auslesen
if(isset($_GET['wo']))
$wo = $_GET['wo'];
else
$wo = "RD"; # Standard: RD
# Pfad und Dateiname zum PDF
$speiseplan = "//Server/Path1-".$wo."/Path2/".$kw."-KW.pdf";
# Direkte Weiterleitung zum entsprechenden Speiseplan
echo ' <p>Weiterleitung zum aktuellen Speiseplan. Falls ein Fehler auftritt, bitte <a href="file:$speiseplan">hier</a> klicken.</p>
<p>Ansonsten wenden Sie sich bitte per Mail an Jan Jastrow (<strong>jan@schwerkraftlabor.de</strong>)</p>';
header("Location: file:$speiseplan"); # Direkte Umleitung
exit;
?>
<script type="text/javascript">window.location = "'.$speiseplan.'"</script>
<p>Es erfolgt eine automatische Weiterleitung zum aktuellen Speiseplan.<br />
Falls ein Fehler auftritt, bitte <a href="'.$speiseplan.'">hier</a> klicken.</p>
</body>
</html>
</html>';
?>