2005-09-10 19:25:43 +02:00
|
|
|
|
<?php
|
|
|
|
|
$title = "Himmel";
|
|
|
|
|
$header = "Schichtpläne";
|
|
|
|
|
$submenus = 2;
|
2005-11-06 01:44:48 +01:00
|
|
|
|
|
|
|
|
|
if( isset($_GET["ausdatum"]))
|
|
|
|
|
$ausdatum = $_GET["ausdatum"];
|
|
|
|
|
if( isset($_GET["raum"]))
|
2009-12-27 23:27:32 +01:00
|
|
|
|
{
|
2005-11-06 01:44:48 +01:00
|
|
|
|
$raum = $_GET["raum"];
|
2009-12-27 23:27:32 +01:00
|
|
|
|
if( $raum==-1 && isset($_GET["show"]))
|
|
|
|
|
{
|
|
|
|
|
$raum = "";
|
|
|
|
|
foreach ($_GET as $k => $v)
|
|
|
|
|
{
|
|
|
|
|
if( substr($k, 0, 5) == "raum_")
|
|
|
|
|
{
|
|
|
|
|
$raum = $raum. ";". $v;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-11-06 01:44:48 +01:00
|
|
|
|
|
2008-09-10 17:56:20 +02:00
|
|
|
|
include ("../../includes/header.php");
|
2008-09-27 21:39:45 +02:00
|
|
|
|
include ("../../includes/funktionen.php");
|
2008-09-10 17:56:20 +02:00
|
|
|
|
include ("../../includes/funktion_schichtplan.php");
|
2011-06-01 12:41:37 +02:00
|
|
|
|
include ("../../includes/funktion_schichtplan_array.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
?>
|
|
|
|
|
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<?PHP echo Get_Text("Hello").$_SESSION['Nick'].",<br>".
|
|
|
|
|
Get_Text("pub_schicht_beschreibung"). "<br><br>";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2005-10-25 23:27:19 +02:00
|
|
|
|
function ShowSwitchDay()
|
|
|
|
|
{
|
|
|
|
|
GLOBAL $VeranstaltungsTage, $VeranstaltungsTageMax, $ausdatum, $raum;
|
|
|
|
|
|
|
|
|
|
echo "\n\n<table border=\"0\" width=\"100%\"><tr>\n";
|
|
|
|
|
|
2006-11-27 23:16:13 +01:00
|
|
|
|
if( isset($VeranstaltungsTage))
|
|
|
|
|
foreach( $VeranstaltungsTage as $k => $v)
|
2005-10-25 23:27:19 +02:00
|
|
|
|
if( $ausdatum == $v)
|
|
|
|
|
{
|
|
|
|
|
if( $k > 0)
|
|
|
|
|
echo "\t\t\t<td align=\"left\">".
|
|
|
|
|
"<a href='./schichtplan.php?ausdatum=". $VeranstaltungsTage[$k-1].
|
|
|
|
|
"&raum=$raum'>". $VeranstaltungsTage[$k-1]. "</a></td>\n";
|
|
|
|
|
if( $k < $VeranstaltungsTageMax)
|
|
|
|
|
echo "\t\t\t<td align=\"right\">".
|
|
|
|
|
"<a href='./schichtplan.php?ausdatum=". $VeranstaltungsTage[$k+1].
|
|
|
|
|
"&raum=$raum'>". $VeranstaltungsTage[$k+1]. "</a></td>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "\n\n</table>";
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
// wenn kein Datum gesetzt ist (die Seite zum ersten mal aufgerufen wird),
|
|
|
|
|
// das Datum auf den ersten Tag setzen...
|
|
|
|
|
if( !isset($ausdatum) )
|
|
|
|
|
{
|
2007-08-09 18:33:38 +02:00
|
|
|
|
$sql = "SELECT `DateS` FROM `Shifts` WHERE `DateS` like '". gmdate("Y-m-d", time()+$gmdateOffset). "%' ORDER BY `DateS`";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
// $sql = "SELECT `DateS` FROM `Shifts` WHERE `DateS` like '2004-12-29%' ORDER BY `DateS`";
|
|
|
|
|
$Erg = mysql_query($sql, $con);
|
|
|
|
|
if( mysql_num_rows( $Erg ) == 0 )
|
|
|
|
|
{
|
|
|
|
|
$sql = "SELECT `DateS` FROM `Shifts` ORDER BY `DateS` ASC LIMIT 0, 1";
|
|
|
|
|
$Erg = mysql_query($sql, $con);
|
|
|
|
|
}
|
2006-11-10 20:37:59 +01:00
|
|
|
|
if( mysql_num_rows( $Erg ) > 0 )
|
|
|
|
|
$ausdatum = substr(mysql_result($Erg,0,"DateS"),0,10);
|
|
|
|
|
else
|
2007-08-09 18:33:38 +02:00
|
|
|
|
$ausdatum = gmdate("Y-m-d", time()+$gmdateOffset);
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( !isset($raum) )
|
|
|
|
|
{
|
2011-06-01 12:41:37 +02:00
|
|
|
|
// Ausgabe wenn kein Raum Ausgew<65>hlt:
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo Get_Text("pub_schicht_auswahl_raeume"). "<br><br>\n";
|
2009-12-27 23:27:32 +01:00
|
|
|
|
|
|
|
|
|
if( isset($Room))
|
|
|
|
|
{
|
|
|
|
|
echo "<form action=\"./schichtplan.php\" method=\"GET\">\n";
|
2006-11-10 20:37:59 +01:00
|
|
|
|
foreach( $Room as $RoomEntry )
|
2009-12-27 23:27:32 +01:00
|
|
|
|
{
|
|
|
|
|
echo "\t<li><input type=\"checkbox\" name=\"raum_". $RoomEntry["RID"]. "\" value=\"". $RoomEntry["RID"]." \">";
|
|
|
|
|
echo "<a href='./schichtplan.php?ausdatum=$ausdatum&raum=". $RoomEntry["RID"]. "'>". $RoomEntry["Name"]. "</a>";
|
|
|
|
|
echo "</input></li>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "<input type=\"hidden\" name=\"ausdatum\" value=\"$ausdatum\">";
|
|
|
|
|
echo "<input type=\"hidden\" name=\"raum\" value=\"-1\">";
|
|
|
|
|
echo "<input type=\"submit\" name=\"show\" value=\"show\">\n";
|
|
|
|
|
echo "</form>\n";
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
echo "<br><br>";
|
2005-11-23 22:37:23 +01:00
|
|
|
|
echo Get_Text("pub_schicht_alles_1"). "<a href='./schichtplan.php?ausdatum=$ausdatum&raum=-1'> <u>".
|
|
|
|
|
Get_Text("pub_schicht_alles_2"). "</u> </a>".Get_Text("pub_schicht_alles_3");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "\n<br><br>\n\n";
|
|
|
|
|
echo "<hr>\n\n";
|
|
|
|
|
echo Get_Text("pub_schicht_EmptyShifts"). "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// zeit die naesten freien schichten
|
2007-11-04 16:51:33 +01:00
|
|
|
|
showEmptyShifts();
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
2011-06-01 12:41:37 +02:00
|
|
|
|
{ // Wenn einraum Ausgew<65>hlt ist:
|
2005-09-10 19:25:43 +02:00
|
|
|
|
if( $raum == -1 )
|
|
|
|
|
echo Get_Text("pub_schicht_Anzeige_1").$ausdatum.":<br><br>";
|
2009-12-27 23:27:32 +01:00
|
|
|
|
elseif( substr( $raum, 0, 1) == ";" )
|
|
|
|
|
echo Get_Text("pub_schicht_Anzeige_1").$ausdatum.":<br><br>";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
else
|
|
|
|
|
echo Get_Text("pub_schicht_Anzeige_1"). $ausdatum.
|
|
|
|
|
Get_Text("pub_schicht_Anzeige_2"). $RoomID[$raum]. "<br><br>";
|
2006-12-29 21:32:32 +01:00
|
|
|
|
|
2005-10-25 23:27:19 +02:00
|
|
|
|
ShowSwitchDay();
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
echo "\n\n<table border=\"0\" width=\"100%\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n";
|
|
|
|
|
echo "\t<tr class=\"contenttopic\">\n";
|
|
|
|
|
echo "\t\t<td>start</td>\n";
|
|
|
|
|
|
2011-06-01 12:41:37 +02:00
|
|
|
|
//Ausgabe Spalten <20>berschrift
|
2005-09-10 19:25:43 +02:00
|
|
|
|
if( $raum == -1 )
|
|
|
|
|
{
|
2006-11-27 23:20:13 +01:00
|
|
|
|
if( isset($Room))
|
|
|
|
|
foreach( $Room as $RoomEntry )
|
2005-09-10 19:25:43 +02:00
|
|
|
|
if (SummRoomShifts($RoomEntry["RID"]) > 0)
|
|
|
|
|
echo "\t\t<th>". $RoomEntry["Name"]. "</th>\n";
|
|
|
|
|
}
|
2009-12-27 23:27:32 +01:00
|
|
|
|
elseif( substr( $raum, 0, 1) == ";" )
|
|
|
|
|
{
|
|
|
|
|
$words = preg_split("/;/", $raum);
|
|
|
|
|
foreach ($words as $word)
|
|
|
|
|
{
|
|
|
|
|
if( strlen(trim($word)) > 0)
|
|
|
|
|
echo "\t\t<th>". $RoomID[trim($word)]. "</th>\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
else
|
|
|
|
|
echo "\t\t<th>". $RoomID[$raum]. "</th>\n";
|
|
|
|
|
echo "\t</tr>\n";
|
|
|
|
|
|
|
|
|
|
//Zeit Ausgeben
|
|
|
|
|
for( $i = 0; $i < 24; $i++ )
|
|
|
|
|
for( $j = 0; $j < $GlobalZeileProStunde; $j++)
|
|
|
|
|
{
|
|
|
|
|
$Spalten[$i * $GlobalZeileProStunde + $j] =
|
|
|
|
|
"\t<tr class=\"content\">\n\t\t";
|
2006-11-29 21:16:03 +01:00
|
|
|
|
|
|
|
|
|
//Stunde:
|
|
|
|
|
$SpaltenTemp="";
|
|
|
|
|
$SpaltenTemp.= ($i<10)? "0$i:": "$i:";
|
|
|
|
|
|
|
|
|
|
//Minute
|
|
|
|
|
$TempMinuten = (($j*60) / $GlobalZeileProStunde);
|
|
|
|
|
$SpaltenTemp.= ($TempMinuten<10)? "0$TempMinuten": "$TempMinuten";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2006-11-29 21:16:03 +01:00
|
|
|
|
//aktuelle stunde markieren
|
2007-08-09 18:33:38 +02:00
|
|
|
|
if( ($j==0) && ($i == gmdate("H", time()+$gmdateOffset)) && (gmdate("Y-m-d", time()+ $gmdateOffset) == $ausdatum) )
|
2006-11-29 21:16:03 +01:00
|
|
|
|
$SpaltenTemp = "<h1>$SpaltenTemp</h1>";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2006-11-29 21:16:03 +01:00
|
|
|
|
$SpaltenTemp = "<td>$SpaltenTemp</td>\n";
|
|
|
|
|
$Spalten[$i * $GlobalZeileProStunde + $j].= $SpaltenTemp;
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( $raum == -1 )
|
|
|
|
|
{
|
2006-11-27 23:20:13 +01:00
|
|
|
|
if( isset($Room))
|
|
|
|
|
foreach( $Room as $RoomEntry )
|
2005-09-10 19:25:43 +02:00
|
|
|
|
if (SummRoomShifts($RoomEntry["RID"]) > 0)
|
|
|
|
|
CreateRoomShifts( $RoomEntry["RID"] );
|
|
|
|
|
}
|
2009-12-27 23:27:32 +01:00
|
|
|
|
elseif( substr( $raum, 0, 1) == ";" )
|
|
|
|
|
{
|
|
|
|
|
if( isset($Room))
|
|
|
|
|
{
|
|
|
|
|
$words = preg_split("/;/", $raum);
|
|
|
|
|
foreach ($words as $word)
|
|
|
|
|
{
|
|
|
|
|
if( strlen(trim($word)) > 0)
|
|
|
|
|
if (SummRoomShifts($word) > 0)
|
|
|
|
|
CreateRoomShifts( $word );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
else
|
|
|
|
|
CreateRoomShifts( $raum );
|
2006-12-29 21:32:32 +01:00
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
//Ausageb Zeilen
|
|
|
|
|
for ($i = 0; $i < (24 * $GlobalZeileProStunde); $i++)
|
2006-11-29 21:16:03 +01:00
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo $Spalten[$i]."\t</tr>\n";
|
2006-11-29 21:16:03 +01:00
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
echo "</table>\n";
|
2005-10-25 23:27:19 +02:00
|
|
|
|
|
|
|
|
|
ShowSwitchDay();
|
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}//if (isset($raum))
|
|
|
|
|
|
2007-12-28 13:28:07 +01:00
|
|
|
|
echo "<a href=\"". $_SESSION["newurl"]. "&Icon=0\">@</a>";
|
2006-12-29 21:32:32 +01:00
|
|
|
|
|
2008-09-10 17:56:20 +02:00
|
|
|
|
include ("../../includes/footer.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
?>
|