2005-09-10 19:25:43 +02:00
|
|
|
|
<?php
|
|
|
|
|
$title = "Schicht Hinzuf<75>gen";
|
|
|
|
|
$header = "Neue Schichten erfassen";
|
|
|
|
|
|
|
|
|
|
include ("./inc/header.php");
|
|
|
|
|
include ("./inc/funktion_user.php");
|
|
|
|
|
|
2005-11-09 23:05:20 +01:00
|
|
|
|
$Time = time()+3600+3600;
|
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "Hallo ".$_SESSION['Nick'].",<br>\n";
|
|
|
|
|
|
|
|
|
|
// erstellt ein Array der Reume
|
|
|
|
|
$sql = "SELECT `RID`, `Name` FROM `Room` ORDER BY `Name`";
|
|
|
|
|
$Erg = mysql_query($sql, $con);
|
|
|
|
|
$rowcount = mysql_num_rows($Erg);
|
|
|
|
|
|
|
|
|
|
for ($i=0; $i<$rowcount; $i++)
|
|
|
|
|
{
|
|
|
|
|
$Room[$i]["RID"] = mysql_result($Erg, $i, "RID");
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$Room[$i]["Name"] = mysql_result($Erg, $i, "Name");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// erstellt ein Aray der Engeltypen
|
|
|
|
|
$sql = "SELECT `TID`, `Name` FROM `EngelType` ORDER BY `Name`";
|
|
|
|
|
$Erg = mysql_query($sql, $con);
|
|
|
|
|
$rowcount = mysql_num_rows($Erg);
|
|
|
|
|
|
|
|
|
|
for ($i=0; $i<$rowcount; $i++)
|
|
|
|
|
{
|
|
|
|
|
$EngelType[$i]["TID"] = mysql_result($Erg, $i, "TID");
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$EngelType[$i]["Name"] = mysql_result($Erg, $i, "Name").Get_Text("inc_schicht_engel");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
2005-11-09 23:05:20 +01:00
|
|
|
|
// sesion mit stanadrt werten bef<65>llen
|
|
|
|
|
if( !isset( $_SESSION['shiftadd.php']['SchichtName']))
|
|
|
|
|
{
|
|
|
|
|
$_SESSION['shiftadd.php']['SchichtName'] = "--???--";
|
|
|
|
|
$_SESSION['shiftadd.php']['RID'] = "";
|
|
|
|
|
$_SESSION['shiftadd.php']['MonthJahr'] = gmdate("Y-m", $Time);
|
|
|
|
|
$_SESSION['shiftadd.php']['SDatum'] = gmdate("d", $Time);
|
|
|
|
|
$_SESSION['shiftadd.php']['STime'] = "10";
|
|
|
|
|
$_SESSION['shiftadd.php']['MoreThenOne'] = "ON";
|
|
|
|
|
$_SESSION['shiftadd.php']['EDatum'] = gmdate("d", $Time);
|
|
|
|
|
$_SESSION['shiftadd.php']['ETime'] = "12";
|
|
|
|
|
$_SESSION['shiftadd.php']['len'] = "2";
|
|
|
|
|
$_SESSION['shiftadd.php']['NachtON'] = "OFF";
|
2006-12-03 22:15:29 +01:00
|
|
|
|
$_SESSION['shiftadd.php']['len_night'] = "00-04-08-10-12-14-16-18-20-22-24";
|
2005-11-09 23:05:20 +01:00
|
|
|
|
}
|
|
|
|
|
// wenn werte <20>bergeben in sesion eintragen
|
|
|
|
|
if( !isset($_GET["NachtON"]))
|
|
|
|
|
$_GET["NachtON"] = "OFF";
|
|
|
|
|
if( !isset($_GET["MoreThenOne"]))
|
|
|
|
|
$_GET["MoreThenOne"] = "OFF";
|
|
|
|
|
if( isset( $_GET["SchichtName"]))
|
|
|
|
|
{
|
|
|
|
|
foreach ($_GET as $k => $v)
|
|
|
|
|
{
|
|
|
|
|
$_SESSION['shiftadd.php'][$k] = $v;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
|
if (!IsSet($_GET["action"]))
|
|
|
|
|
$_GET["action"] = "new";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
|
switch( $_GET["action"])
|
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
case 'new':
|
|
|
|
|
?>
|
|
|
|
|
Hier kannst du neue Schichten eintragen. Dazu musst du den Anfang und das Ende der Schichten eintragen.
|
|
|
|
|
Über die Länge der Schichten errechnet sich dadurch die Anzahl dieser. Dadurch können gleich
|
|
|
|
|
mehrere Schichten auf einmal erfasst werden:
|
|
|
|
|
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<form action="<?PHP echo $_SERVER['SCRIPT_NAME']; ?>" >
|
2005-09-10 19:25:43 +02:00
|
|
|
|
<table>
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="right">Name:</td>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<td><input type="text" name="SchichtName" size="50" value="<?PHP echo $_SESSION["shiftadd.php"]["SchichtName"]; ?>"></td>
|
2005-09-10 19:25:43 +02:00
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="right">Ort:</td>
|
|
|
|
|
<td><select name="RID">
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<?PHP
|
2005-11-09 23:05:20 +01:00
|
|
|
|
foreach ($Room As $RTemp)
|
|
|
|
|
{
|
|
|
|
|
echo "\t<option value=\"". $RTemp["RID"]. "\"";
|
|
|
|
|
if( $RTemp["RID"] == $_SESSION["shiftadd.php"]["RID"])
|
|
|
|
|
echo " SELECTED";
|
|
|
|
|
echo ">". $RTemp["Name"]. "</option>\n";
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
?>
|
|
|
|
|
</select></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr><td><u>Zeit:</u></td></tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="right">Month.Jahr:</td>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<td><input type="ext" name="MonthJahr" size="7" value="<?PHP echo $_SESSION["shiftadd.php"]["MonthJahr"]; ?>"></td>
|
2005-09-10 19:25:43 +02:00
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="right">Beginn:</td>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<td>Date<input type="text" name="SDatum" size="5" value="<?PHP echo $_SESSION["shiftadd.php"]["SDatum"]; ?>">
|
|
|
|
|
Time<input type="text" name="STime" size="5" value="<?PHP echo $_SESSION["shiftadd.php"]["STime"]; ?>"></td>
|
2005-09-10 19:25:43 +02:00
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="right">More then One</td>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<td><input type="checkbox" name="MoreThenOne" value="ON" <?PHP
|
2005-11-09 23:05:20 +01:00
|
|
|
|
if( $_SESSION["shiftadd.php"]["MoreThenOne"]=="ON")
|
|
|
|
|
echo " CHECKED";
|
|
|
|
|
?>></td>
|
2005-09-10 19:25:43 +02:00
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="right">End:</td>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<td>Date<input type="text" name="EDatum" size="5" value="<?PHP echo $_SESSION["shiftadd.php"]["EDatum"]; ?>">
|
|
|
|
|
Time<input type="text" name="ETime" size="5" value="<?PHP echo $_SESSION["shiftadd.php"]["ETime"]; ?>"></td>
|
2005-09-10 19:25:43 +02:00
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="right">Länge in h:</td>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<td><input type="text" name="len" size="5" value="<?PHP echo $_SESSION["shiftadd.php"]["len"]; ?>"></td>
|
2005-09-10 19:25:43 +02:00
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="right">Sonderschichten ein:</td>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<td><input type="checkbox" name="NachtON" value="ON" <?PHP
|
2005-11-09 23:05:20 +01:00
|
|
|
|
if($_SESSION["shiftadd.php"]["NachtON"]=="ON")
|
|
|
|
|
echo " CHECKED";
|
|
|
|
|
?>></td>
|
2005-09-10 19:25:43 +02:00
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td align="right">Sonder in h (Time;Time):</td>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<td><input type="text" name="len_night" size="50" value="<?PHP echo $_SESSION["shiftadd.php"]["len_night"]; ?>"></td>
|
2005-09-10 19:25:43 +02:00
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr><td><u>Anzahl Engel je Type:</u></td></tr>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<?PHP
|
2005-09-10 19:25:43 +02:00
|
|
|
|
foreach ($EngelType As $TTemp)
|
|
|
|
|
{
|
|
|
|
|
echo " <tr><td align=\"right\">". $TTemp["Name"]. ":</td>\n";
|
2005-11-09 23:05:20 +01:00
|
|
|
|
echo " <td><input type=\"text\" name=\"EngelType". $TTemp["TID"]. "\" size=\"5\" value=\"";
|
|
|
|
|
if( isset($_SESSION["shiftadd.php"][ "EngelType". $TTemp["TID"] ]))
|
|
|
|
|
echo $_SESSION["shiftadd.php"][ "EngelType". $TTemp["TID"] ];
|
|
|
|
|
else
|
|
|
|
|
echo "0";
|
|
|
|
|
echo "\"></td>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</table>
|
|
|
|
|
<br>
|
|
|
|
|
<input type="hidden" name="OnlyShow" value="ON">
|
|
|
|
|
<input type="hidden" name="action" value="newsave">
|
|
|
|
|
<input type="submit" value="zeig mal Gabriel!">
|
|
|
|
|
</form>
|
|
|
|
|
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<?PHP
|
2005-09-10 19:25:43 +02:00
|
|
|
|
break; // Ende new
|
|
|
|
|
|
|
|
|
|
case 'newsave':
|
2005-11-06 17:33:22 +01:00
|
|
|
|
if (isset($_GET["SDatum"]) && ($_GET["len"] > 0))
|
|
|
|
|
{
|
|
|
|
|
$lenOrg = $_GET["len"];
|
|
|
|
|
if( $_GET["NachtON"] == "ON" )
|
2005-09-10 19:25:43 +02:00
|
|
|
|
{
|
2006-12-03 22:15:29 +01:00
|
|
|
|
$lenArrayDummy = explode( "-", $_GET["len_night"]);
|
2005-09-10 19:25:43 +02:00
|
|
|
|
foreach ( $lenArrayDummy as $Temp )
|
|
|
|
|
{
|
|
|
|
|
if( isset($Temp2) )
|
|
|
|
|
$lenArray[$Temp2] = $Temp-$Temp2;
|
|
|
|
|
$Temp2 = $Temp;
|
|
|
|
|
|
|
|
|
|
}//foreach
|
|
|
|
|
}//IF( $NachtON == "ON" )
|
|
|
|
|
|
|
|
|
|
echo "<table border=\"1\">\n";
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "\t<td valign=\"top\" align=\"center\">Start</td>\n";
|
|
|
|
|
echo "\t<td valign=\"top\" align=\"center\">End</td>\n";
|
|
|
|
|
echo "\t<td valign=\"top\" align=\"center\">len</td>\n";
|
|
|
|
|
echo "\t<td valign=\"top\" align=\"center\">RID</td>\n";
|
|
|
|
|
echo "\t<td valign=\"top\" align=\"center\">Beschreibung</td>\n";
|
|
|
|
|
echo "\t<td valign=\"top\" align=\"center\">Entry 'Shifts'</td>\n";
|
|
|
|
|
echo "\t<td valign=\"top\" align=\"center\">SID</td>\n";
|
|
|
|
|
echo "\t<td valign=\"top\" align=\"center\">Entrys</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$DateEnd = $_GET["SDatum"];
|
|
|
|
|
$TimeEnd = $_GET["STime"];
|
|
|
|
|
$len=0;
|
|
|
|
|
do
|
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
// define Start time
|
|
|
|
|
$Date = $DateEnd;
|
|
|
|
|
$Time = $TimeEnd;
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$_DateS = $_GET["MonthJahr"]. "-". $Date. " ". $Time. ":00:00";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
// define End time
|
2005-11-06 17:33:22 +01:00
|
|
|
|
if( $_GET["NachtON"] == "ON" )
|
|
|
|
|
$_GET["len"] = $lenArray[$Time];
|
|
|
|
|
$TimeEnd = $Time+ $_GET["len"];
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
//Tages<65>berschreitung
|
|
|
|
|
while( $TimeEnd >= 24 )
|
|
|
|
|
{
|
|
|
|
|
$TimeEnd -= 24;
|
|
|
|
|
$DateEnd += 1;
|
|
|
|
|
}
|
2005-11-06 17:33:22 +01:00
|
|
|
|
//ist schischt zu lang dan verk<72>rzen
|
|
|
|
|
if( $DateEnd > $_GET["EDatum"] || ($DateEnd == $_GET["EDatum"] && $TimeEnd >= $_GET["ETime"]) )
|
2005-09-10 19:25:43 +02:00
|
|
|
|
{
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$_GET["len"] -= ($DateEnd- $_GET["EDatum"])*24;
|
|
|
|
|
$_GET["len"] -= ($TimeEnd- $_GET["ETime"]); // -(-) ->> +
|
|
|
|
|
$DateEnd = $_GET["EDatum"];
|
|
|
|
|
$TimeEnd = $_GET["ETime"];
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$_DateE = $_GET["MonthJahr"]. "-". $DateEnd. " ". $TimeEnd. ":00:00";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
if( $_DateS != $_DateE )
|
|
|
|
|
CreateNewEntry();
|
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
|
if( $_GET["MoreThenOne"]!="ON" ) break;
|
|
|
|
|
if( $DateEnd == $_GET["EDatum"] && $TimeEnd >= $_GET["ETime"] ) break;
|
2005-09-10 19:25:43 +02:00
|
|
|
|
} while( true );
|
|
|
|
|
echo "</table>";
|
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
|
if( $_GET["OnlyShow"]=="ON" )
|
2005-09-10 19:25:43 +02:00
|
|
|
|
{
|
|
|
|
|
echo "<form action=\"". $_SERVER['SCRIPT_NAME']. "\">";
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo "\n\t<Input type=\"hidden\" name=\"SchichtName\" value=\"". $_GET["SchichtName"]. "\">";
|
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"MonthJahr\" value=\"". $_GET["MonthJahr"]. "\">";
|
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"SDatum\" value=\"". $_GET["SDatum"]. "\">";
|
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"STime\" value=\"". $_GET["STime"]. "\">";
|
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"MoreThenOne\" value=\"". $_GET["MoreThenOne"]. "\">";
|
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"EDatum\" value=\"". $_GET["EDatum"]. "\">";
|
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"ETime\" value=\"". $_GET["ETime"]. "\">";
|
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"len\" value=\"". $lenOrg. "\">";
|
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"RID\" value=\"". $_GET["RID"]. "\">";
|
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"NachtON\" value=\"". $_GET["NachtON"]. "\">";
|
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"len_night\" value=\"". $_GET["len_night"]. "\">";
|
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"OnlyShow\" value=\"OFF\">";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
foreach ($EngelType As $TTemp)
|
|
|
|
|
{
|
|
|
|
|
$Temp = "EngelType".$TTemp["TID"];
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"". $Temp. "\" value=\"". $_GET[$Temp]. "\">";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
echo "\n\t<input type=\"hidden\" name=\"action\" value=\"newsave\">";
|
|
|
|
|
echo "\n\t<input type=\"submit\" value=\"mach mal Gabriel!\">";
|
|
|
|
|
echo "\n</form>";
|
|
|
|
|
} //if
|
|
|
|
|
} //IF
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'engeldel':
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
} // end switch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function CreateNewEntry()
|
|
|
|
|
{
|
2005-11-06 17:33:22 +01:00
|
|
|
|
global $con, $_DateS, $_DateE, $EngelType, $DEBUG;
|
2005-09-10 19:25:43 +02:00
|
|
|
|
foreach ($EngelType As $TTemp)
|
|
|
|
|
{
|
|
|
|
|
$Temp = "EngelType".$TTemp["TID"];
|
|
|
|
|
global $$Temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "\t<td>$_DateS</td>\n";
|
|
|
|
|
echo "\t<td>$_DateE</td>\n";
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo "\t<td>". $_GET["len"]. "</td>\n";
|
|
|
|
|
echo "\t<td>". $_GET["RID"]. "</td>\n";
|
|
|
|
|
echo "\t<td>". $_GET["SchichtName"]. "</td>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Ist eintarg schon vorhanden?
|
|
|
|
|
$SQL = "SELECT SID FROM `Shifts` ";
|
|
|
|
|
$SQL .= "WHERE (".
|
|
|
|
|
"`DateS` = '". $_DateS. "' AND ".
|
|
|
|
|
"`DateE` = '". $_DateE. "' AND ".
|
2005-11-06 17:33:22 +01:00
|
|
|
|
"`RID` = '". $_GET["RID"]. "');";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
|
|
|
|
|
if( mysql_num_rows($Erg) != 0 )
|
|
|
|
|
echo "\t<td>exists</td>";
|
2005-11-06 17:33:22 +01:00
|
|
|
|
elseif( $_GET["OnlyShow"] == "OFF" )
|
2005-09-10 19:25:43 +02:00
|
|
|
|
{
|
|
|
|
|
// erstellt Eintrag in Shifts f<>r die algemeine schicht
|
2005-11-16 00:19:38 +01:00
|
|
|
|
$SQL = "INSERT INTO `Shifts` ( `DateS`, `DateE`, `Len`, `RID`, `Man`) VALUES ( ";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$SQL .= "'". $_DateS. "', '". $_DateE. "', ";
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$SQL .= "'". $_GET["len"]. "', '". $_GET["RID"]. "', ";
|
|
|
|
|
$SQL .= "'". $_GET["SchichtName"]. "');";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
|
|
|
|
|
$SQLFail = "\n\t<br>[".$SQL. "]";
|
|
|
|
|
|
|
|
|
|
if ($Erg == 1) echo "\t<td>pass</td>\n";
|
|
|
|
|
else echo "\t<td>fail <br>\n<u>". mysql_error($con). "</u>$SQLFail</td>\n";
|
|
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
echo "\t<td>only show</td>\n";
|
|
|
|
|
|
|
|
|
|
// sucht SID von eingetragennen schiten
|
|
|
|
|
$SQL = "SELECT SID FROM `Shifts` ";
|
|
|
|
|
$SQL .= "WHERE (".
|
|
|
|
|
"`DateS` = '". $_DateS. "' AND ".
|
|
|
|
|
"`DateE` = '". $_DateE. "' AND ".
|
2005-11-06 17:33:22 +01:00
|
|
|
|
"`Len` = '". $_GET["len"]. "' AND ".
|
|
|
|
|
"`RID` = '". $_GET["RID"]. "');";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
if( mysql_num_rows($Erg) == 0 )
|
|
|
|
|
echo "\t<td>?</td>";
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$SID = mysql_result($Erg, 0, "SID");
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo "\t<td>". $SID. "</td>";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// erstellt f<>r jeden Engeltypen die eintrage in 'ShiftEntry'
|
|
|
|
|
echo "\t<td>";
|
|
|
|
|
foreach ($EngelType As $TTemp)
|
|
|
|
|
{
|
|
|
|
|
$Temp = "EngelType".$TTemp["TID"];
|
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
|
if( $_GET[$Temp] > 0 )
|
2005-09-10 19:25:43 +02:00
|
|
|
|
{
|
|
|
|
|
$i = 0;
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo $_GET[$Temp]. " ".$TTemp["Name"]. "<br>\t";
|
|
|
|
|
while( $i++ < $_GET[$Temp] )
|
2005-09-10 19:25:43 +02:00
|
|
|
|
{
|
2005-11-06 17:33:22 +01:00
|
|
|
|
if( $_GET["OnlyShow"] == "OFF" )
|
2005-09-10 19:25:43 +02:00
|
|
|
|
{
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$SQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`) VALUES (";
|
|
|
|
|
$SQL .= "'". $SID. "', ";
|
|
|
|
|
$SQL .= "'". $TTemp["TID"]. "');";
|
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
|
|
|
|
|
if( $DEBUG ) $SQLFail = "\n\t<br>[".$SQL. "]";
|
|
|
|
|
|
|
|
|
|
if ($Erg == 1) echo "'pass' ";
|
|
|
|
|
else echo "'fail' <u>". mysql_error($con). "</u>$SQLFail</td>\n";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo "+";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
echo "<br>";
|
|
|
|
|
} // IF $$TEMP
|
|
|
|
|
} // FOREACH
|
|
|
|
|
echo "</td>";
|
|
|
|
|
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
include ("./inc/footer.php");
|
|
|
|
|
?>
|