2005-09-10 19:25:43 +02:00
|
|
|
|
<?php
|
|
|
|
|
$title = "Himmel";
|
|
|
|
|
$header = "Schichtpläne";
|
2010-11-10 21:03:28 +01:00
|
|
|
|
include ("../../../27c3/includes/header.php");
|
|
|
|
|
include ("../../../27c3/includes/funktion_schichtplan.php");
|
|
|
|
|
include ("../../../27c3/includes/funktion_schichtplan_aray.php");
|
|
|
|
|
include ("../../../27c3/includes/funktionen.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2005-11-06 01:44:48 +01:00
|
|
|
|
if (isset($_POST["newtext"]) && isset($_POST["SID"]) && isset($_POST["TID"])) {
|
2005-09-10 19:25:43 +02:00
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
|
|
|
|
|
|
// datum der einzutragenden schicht heraussuhen...
|
2005-11-06 01:44:48 +01:00
|
|
|
|
$ShiftSQL = "SELECT `DateS`, `DateE` FROM `Shifts` WHERE `SID`='". $_POST["SID"]. ".'";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$ShiftErg = mysql_query ($ShiftSQL, $con);
|
|
|
|
|
$beginSchicht = mysql_result($ShiftErg, 0, "DateS");
|
|
|
|
|
$endSchicht = mysql_result($ShiftErg, 0, "DateE");
|
|
|
|
|
|
2007-12-29 18:35:39 +01:00
|
|
|
|
//wenn keien rechte definiert sind
|
|
|
|
|
if( !isset($_SESSION['CVS'][ $TID2Name[$_POST["TID"]] ]))
|
|
|
|
|
$_SESSION['CVS'][ $TID2Name[$_POST["TID"]] ] = "Y";
|
|
|
|
|
|
|
|
|
|
if( $_SESSION['CVS'][ $TID2Name[$_POST["TID"]] ] == "Y")
|
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
// Ueberpruefung, ob der Engel bereits f<>r eine Schicht zu dieser Zeit eingetragen ist
|
|
|
|
|
$SSQL="SELECT * FROM `Shifts`".
|
|
|
|
|
" INNER JOIN `ShiftEntry` ON `ShiftEntry`.`SID` = `Shifts`.`SID`".
|
|
|
|
|
" WHERE ((".
|
|
|
|
|
" ((`Shifts`.`DateS` >= '$beginSchicht') and ".
|
|
|
|
|
" (`Shifts`.`DateS` < '$endSchicht'))".
|
|
|
|
|
" OR ".
|
|
|
|
|
" ((`Shifts`.`DateE` > '$beginSchicht') and ".
|
|
|
|
|
" (`Shifts`.`DateE` <= '$endSchicht')) ".
|
|
|
|
|
") and ".
|
|
|
|
|
"(`ShiftEntry`.`UID` = '". $_SESSION['UID']. "'));";
|
|
|
|
|
$bErg = mysql_query($SSQL, $con);
|
|
|
|
|
|
|
|
|
|
if( mysql_num_rows($bErg) != 0 )
|
|
|
|
|
echo Get_Text("pub_schichtplan_add_AllreadyinShift");
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//ermitteln der noch gesuchten
|
|
|
|
|
$SQL3 = "SELECT * FROM `ShiftEntry`".
|
2006-12-04 20:54:51 +01:00
|
|
|
|
" WHERE ((`SID` = '". $_POST["SID"]. "') AND (`TID` = '". $_POST["TID"]. "') AND (`UID` = '0'));";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg3 = mysql_query($SQL3, $con);
|
|
|
|
|
|
|
|
|
|
if( mysql_num_rows($Erg3) <= 0 )
|
|
|
|
|
echo Get_Text("pub_schichtplan_add_ToManyYousers");
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//write shift
|
|
|
|
|
$SQL = "UPDATE `ShiftEntry` SET ".
|
|
|
|
|
"`UID` = '". $_SESSION['UID']. "', ".
|
2005-11-06 01:44:48 +01:00
|
|
|
|
"`Comment` = '". $_POST["newtext"]. "' ".
|
|
|
|
|
"WHERE ( (`SID` = '". $_POST["SID"]. "') and ".
|
|
|
|
|
"(`TID` = '". $_POST["TID"]. "') and ".
|
|
|
|
|
"(`UID` = '0')) LIMIT 1;";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
|
|
|
|
|
if ($Erg != 1)
|
|
|
|
|
echo Get_Text("pub_schichtplan_add_Error");
|
|
|
|
|
else
|
|
|
|
|
echo Get_Text("pub_schichtplan_add_WriteOK");
|
|
|
|
|
|
|
|
|
|
}//TO Many USERS
|
|
|
|
|
}//Allready in Shift
|
2007-12-29 18:35:39 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo "<h1>:-(</h1>";
|
|
|
|
|
array_push($error_messages, "Hack atteck\n");
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
2007-12-29 18:35:39 +01:00
|
|
|
|
elseif (isset($_GET["SID"]) && isset($_GET["TID"]))
|
|
|
|
|
{
|
|
|
|
|
//wenn keien rechte definiert sind
|
|
|
|
|
if( !isset($_SESSION['CVS'][ $TID2Name[$_GET["TID"]] ]))
|
|
|
|
|
$_SESSION['CVS'][ $TID2Name[$_GET["TID"]] ] = "Y";
|
|
|
|
|
|
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2007-12-29 18:35:39 +01:00
|
|
|
|
if( $_SESSION['CVS'][ $TID2Name[$_GET["TID"]] ] == "Y")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
echo Get_Text("pub_schichtplan_add_Text1"). "<br><br>\n\n".
|
|
|
|
|
"<form action=\"./schichtplan_add.php\" method=\"post\">\n".
|
|
|
|
|
"<table border=\"0\">\n";
|
|
|
|
|
|
|
|
|
|
$SQL = "SELECT * FROM `Shifts` WHERE ";
|
|
|
|
|
$SQL .="(`SID` = '". $_GET["SID"]. "')";
|
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2007-12-29 18:35:39 +01:00
|
|
|
|
echo "<tr><td>". Get_Text("pub_schichtplan_add_Date"). ":</td> <td>".
|
|
|
|
|
mysql_result($Erg, 0, "DateS"). "</td></tr>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2007-12-29 18:35:39 +01:00
|
|
|
|
echo "<tr><td>". Get_Text("pub_schichtplan_add_Place"). ":</td> <td>".
|
|
|
|
|
$RoomID[ mysql_result($Erg, 0, "RID") ]. "</td></tr>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2007-12-29 18:35:39 +01:00
|
|
|
|
echo "<tr><td>". Get_Text("pub_schichtplan_add_Job"). ":</td> <td>".
|
|
|
|
|
$EngelTypeID[$_GET["TID"]]. "</td></tr>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2007-12-29 18:35:39 +01:00
|
|
|
|
echo "<tr><td>". Get_Text("pub_schichtplan_add_Len"). ":</td> <td>".
|
|
|
|
|
mysql_result($Erg, 0, "Len"). "h</td></tr>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2007-12-29 18:35:39 +01:00
|
|
|
|
echo "<tr><td>". Get_Text("pub_schichtplan_add_TextFor"). ":</td> <td>".
|
|
|
|
|
mysql_result($Erg, 0, "Man"). "</td></tr>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2007-12-29 18:35:39 +01:00
|
|
|
|
echo "<tr><td valign='top'>". Get_Text("pub_schichtplan_add_Comment"). ":</td>\n <td>".
|
|
|
|
|
"<textarea name='newtext' cols='50' rows='10'></textarea> </td></tr>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2007-12-29 18:35:39 +01:00
|
|
|
|
echo "<tr><td> </td>\n".
|
|
|
|
|
"<td><input type=\"submit\" value=\"". Get_Text("pub_schichtplan_add_submit"). "\"> </td></tr>\n".
|
|
|
|
|
"</table>\n".
|
|
|
|
|
"<input type=\"hidden\" name=\"SID\" value=\"". $_GET["SID"]. "\">\n".
|
|
|
|
|
"<input type=\"hidden\" name=\"TID\" value=\"". $_GET["TID"]. "\">\n".
|
|
|
|
|
"</form>";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo "<h1>:-(</h1>";
|
|
|
|
|
array_push($error_messages, "Hack atteck\n");
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-10 21:03:28 +01:00
|
|
|
|
include ("../../../27c3/includes/footer.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
?>
|