diff options
author | cookie <cookie@29ba0400-6e00-0410-a75a-ca02368028f8> | 2005-11-06 17:14:25 +0000 |
---|---|---|
committer | cookie <cookie@29ba0400-6e00-0410-a75a-ca02368028f8> | 2005-11-06 17:14:25 +0000 |
commit | 866c47ec603595e8fe67da5f0e5d162a70b1f7b4 (patch) | |
tree | ef2b85462576150f017ba6bd53ace13dc60dc510 /www-ssl/nonpublic/schichtplan_add.php | |
parent | fbc8e11b91b0565ae5d23472fc4e5bfc7d879939 (diff) |
move files
git-svn-id: svn://svn.cccv.de/engel-system@20 29ba0400-6e00-0410-a75a-ca02368028f8
Diffstat (limited to 'www-ssl/nonpublic/schichtplan_add.php')
-rwxr-xr-x | www-ssl/nonpublic/schichtplan_add.php | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/www-ssl/nonpublic/schichtplan_add.php b/www-ssl/nonpublic/schichtplan_add.php new file mode 100755 index 00000000..21a0b508 --- /dev/null +++ b/www-ssl/nonpublic/schichtplan_add.php @@ -0,0 +1,98 @@ +<?php +$title = "Himmel"; +$header = "Schichtpläne"; +include ("./inc/header.php"); +include ("./inc/funktion_user.php"); +include ("./inc/funktion_schichtplan.php"); +include ("./inc/funktionen.php"); + +if (isset($_POST["newtext"]) && isset($_POST["SID"]) && isset($_POST["TID"])) { + SetHeaderGo2Back(); + + // datum der einzutragenden schicht heraussuhen... + $ShiftSQL = "SELECT `DateS`, `DateE` FROM `Shifts` WHERE `SID`='". $_POST["SID"]. ".'"; + $ShiftErg = mysql_query ($ShiftSQL, $con); + $beginSchicht = mysql_result($ShiftErg, 0, "DateS"); + $endSchicht = mysql_result($ShiftErg, 0, "DateE"); + + // 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`". + " WHERE ((`SID` = '". $_POST["SID"]. "') and (`TID` = '". $_POST["TID"]. "') and (`UID` = '0'));"; + $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']. "', ". + "`Comment` = '". $_POST["newtext"]. "' ". + "WHERE ( (`SID` = '". $_POST["SID"]. "') and ". + "(`TID` = '". $_POST["TID"]. "') and ". + "(`UID` = '0')) LIMIT 1;"; + $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 +} +elseif (isset($_GET["SID"]) && isset($_GET["TID"])) { + 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); + + echo "<tr><td>". Get_Text("pub_schichtplan_add_Date"). ":</td> <td>". + mysql_result($Erg, 0, "DateS"). "</td></tr>\n"; + + echo "<tr><td>". Get_Text("pub_schichtplan_add_Place"). ":</td> <td>". + $RoomID[ mysql_result($Erg, 0, "RID") ]. "</td></tr>\n"; + + echo "<tr><td>". Get_Text("pub_schichtplan_add_Job"). ":</td> <td>". + $EngelTypeID[$_GET["TID"]]. "</td></tr>\n"; + + echo "<tr><td>". Get_Text("pub_schichtplan_add_Len"). ":</td> <td>". + mysql_result($Erg, 0, "Len"). "h</td></tr>\n"; + + echo "<tr><td>". Get_Text("pub_schichtplan_add_TextFor"). ":</td> <td>". + mysql_result($Erg, 0, "Man"). "</td></tr>\n"; + + 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"; + + 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>"; + +} + +include ("./inc/footer.php"); +?> |