2005-09-10 19:25:43 +02:00
|
|
|
|
<?php
|
|
|
|
|
$title = "Schichtplan";
|
|
|
|
|
$header = "Neue Schichten erfassen";
|
|
|
|
|
$submenus = 1;
|
2008-09-10 20:30:16 +02:00
|
|
|
|
include ("../../includes/header.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2005-11-15 22:18:06 +01:00
|
|
|
|
function executeSQL( $SQL)
|
|
|
|
|
{
|
|
|
|
|
global $DEBUG, $con;
|
|
|
|
|
|
|
|
|
|
$Erg = mysql_query($SQL, $con);
|
|
|
|
|
if( $DEBUG )
|
|
|
|
|
echo "DEBUG SQL: $SQL<br>\n";
|
|
|
|
|
if ($Erg == 1)
|
|
|
|
|
{
|
|
|
|
|
echo "SQL war erfolgreich";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo "SQL Fehler (". mysql_error($con).")" ;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
|
if (!IsSet($_GET["action"])) {
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "Hallo ".$_SESSION['Nick'].",<br>\n";
|
|
|
|
|
echo "hier kannst du Schichten anlegen, ändern oder löschen.<br><br>";
|
|
|
|
|
echo "<a href=\"./shiftadd.php\">Neue Schicht einplanen</a><br><br>\n\n";
|
|
|
|
|
|
2005-11-15 22:18:06 +01:00
|
|
|
|
echo "<form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"GET\" >\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
?>
|
|
|
|
|
<table width="100%" class="border" cellpadding="2" cellspacing="1">
|
|
|
|
|
<tr class="contenttopic">
|
2005-11-15 22:18:06 +01:00
|
|
|
|
<td></td>
|
2005-09-10 19:25:43 +02:00
|
|
|
|
<td>Datum</td>
|
|
|
|
|
<td>Raum</td>
|
|
|
|
|
<td>Dauer</td>
|
|
|
|
|
<td>Ändern</td>
|
|
|
|
|
</tr>
|
2005-11-30 23:13:38 +01:00
|
|
|
|
<?PHP
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
$sql = "SELECT `SID`, `DateS`, `RID`, `Len` FROM `Shifts` ".
|
2006-12-11 08:47:43 +01:00
|
|
|
|
"ORDER BY `RID`, `DateS` ";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg = mysql_query($sql, $con);
|
|
|
|
|
$rowcount = mysql_num_rows($Erg);
|
|
|
|
|
for( $i = 0; $i < $rowcount; $i++)
|
|
|
|
|
{
|
|
|
|
|
echo "\t<tr class=\"content\">\n";
|
2005-11-15 22:18:06 +01:00
|
|
|
|
echo "\t\t<td><input type=\"checkbox\" name=\"SID". mysql_result($Erg, $i, "SID"). "\" ".
|
|
|
|
|
"value=\"". mysql_result($Erg, $i, "SID"). "\"></td>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "\t\t<td>".mysql_result($Erg, $i, "DateS")."</td>\n";
|
|
|
|
|
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$sql2= "SELECT `Name` FROM `Room` WHERE `RID`='".mysql_result($Erg, $i, "RID")."'";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg2 = mysql_query($sql2, $con);
|
2005-11-06 17:33:22 +01:00
|
|
|
|
if( mysql_num_rows($Erg2) > 0)
|
|
|
|
|
echo "\t\t<td>".mysql_result($Erg2, 0, "Name")."</td>\n";
|
|
|
|
|
else
|
|
|
|
|
echo "\t\t<td>Unbenkannt (RID=". mysql_result($Erg, $i, "RID"). ")</td>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "\t\t<td>".mysql_result($Erg, $i, "Len")." Std. </td>\n";
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo "\t\t<td><a href=\"./schichtplan.php?action=change&SID=".
|
|
|
|
|
mysql_result($Erg, $i, "SID")."\">####</a></td>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "\t</tr>\n";
|
|
|
|
|
}
|
2005-11-15 22:18:06 +01:00
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
|
|
|
|
echo "<input type=\"hidden\" name=\"action\" value=\"deleteShifs\">\n";
|
|
|
|
|
echo "<input type=\"submit\" value=\"Löschen...\">\n";
|
|
|
|
|
echo "</form>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
// aus sicherheitzgr<67>nden wegen sp<73>terer genuzung
|
|
|
|
|
UnSet($chSQL);
|
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
|
switch ($_GET["action"]){
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
case 'change':
|
2005-11-15 22:18:06 +01:00
|
|
|
|
if ( !IsSet($_GET["SID"]) )
|
|
|
|
|
{
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "Fehlerhafter Aufruf!\n";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$sql = "SELECT * FROM `Shifts` WHERE (`SID` = '". $_GET["SID"]. "' )";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg = mysql_query($sql, $con);
|
|
|
|
|
|
|
|
|
|
echo "Schicht abändern: <br>\n";
|
|
|
|
|
|
|
|
|
|
// Anzeige Allgemeiner schaischt daten
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo "<form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"GET\" >";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "<table>\n";
|
|
|
|
|
echo " <tr><td>Schichtbeginn</td>".
|
|
|
|
|
"<td><input value=\"". mysql_result($Erg, 0, "DateS").
|
|
|
|
|
"\" type=\"text\" size=\"40\" name=\"eDate\"></td></tr>\n";
|
|
|
|
|
echo " <tr><td>Raum</td><td>\n<select name=\"eRID\">\n";
|
|
|
|
|
|
2010-12-27 20:55:57 +01:00
|
|
|
|
$sql2 = "SELECT `RID`, `Name`, `FromPentabarf` FROM `Room`";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg2 = mysql_query($sql2, $con);
|
|
|
|
|
$rowcount = mysql_num_rows($Erg2);
|
2010-12-27 20:55:57 +01:00
|
|
|
|
$FromPentabarf = "N";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
for( $i = 0; $i < $rowcount; $i++ )
|
|
|
|
|
{
|
|
|
|
|
$RID=mysql_result($Erg2, $i, "RID");
|
|
|
|
|
echo " <option value=\"".$RID."\"";
|
|
|
|
|
if( $RID == mysql_result($Erg, 0, "RID") )
|
2010-12-27 20:55:57 +01:00
|
|
|
|
{
|
|
|
|
|
echo " selected";
|
|
|
|
|
$FromPentabarf = mysql_result($Erg2, $i, "FromPentabarf");
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo ">".mysql_result($Erg2, $i, "Name")."</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </select>\n</td></tr>\n";
|
|
|
|
|
|
|
|
|
|
echo " <tr><td>Dauer in h</td>".
|
|
|
|
|
"<td><input value=\"". mysql_result($Erg, 0, "Len").
|
|
|
|
|
"\" type=\"text\" size=\"40\" name=\"eDauer\"></td></tr>\n";
|
|
|
|
|
echo " <tr><td>Beschreibung</td>".
|
|
|
|
|
"<td><input value=\"". mysql_result($Erg, 0, "Man").
|
|
|
|
|
"\" type=\"text\" size=\"40\" name=\"eName\"></td></tr>\n";
|
2005-11-15 22:18:06 +01:00
|
|
|
|
echo " <tr><td>URL</td>".
|
|
|
|
|
"<td><input value=\"". mysql_result($Erg, 0, "URL").
|
|
|
|
|
"\" type=\"text\" size=\"40\" name=\"eURL\"></td></tr>\n";
|
2010-12-27 20:55:57 +01:00
|
|
|
|
if( $FromPentabarf == "Y")
|
|
|
|
|
{
|
|
|
|
|
echo " <tr><td></td>".
|
|
|
|
|
"<td><h1>!!! Imported from Pentabarf !!!</h1></td></tr>\n";
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo "<input type=\"hidden\" name=\"SID\" value=\"". $_GET["SID"]. "\">\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "<input type=\"hidden\" name=\"action\" value=\"changesave\">\n";
|
|
|
|
|
echo "<input type=\"submit\" value=\"sichern...\">\n";
|
|
|
|
|
echo "</form>\n\n";
|
|
|
|
|
|
|
|
|
|
// L<>schen
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo "<form action=\"". $_SERVER['SCRIPT_NAME']. "\" method=\"GET\" >\n";
|
|
|
|
|
echo "<input type=\"hidden\" name=\"SID\" value=\"". $_GET["SID"]. "\">\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "<input type=\"hidden\" name=\"action\" value=\"delete\">\n";
|
|
|
|
|
echo "<input type=\"submit\" value=\"Löschen...\">\n";
|
|
|
|
|
echo "</form>\n\n";
|
|
|
|
|
|
|
|
|
|
echo "<b>ACHTUNG:</b><br>\n";
|
|
|
|
|
echo "Beim Löschen werden die bisher eingetragenen Engel für diese Schicht mitgelöscht.<br>\n";
|
|
|
|
|
|
|
|
|
|
echo "<br><hr>\n\n\n\n";
|
|
|
|
|
|
|
|
|
|
//Freie Engelschichten
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$sql3 = "SELECT `TID` FROM `ShiftEntry` WHERE `SID`='". $_GET["SID"]. "' AND `UID`='0'";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg3 = mysql_query($sql3, $con);
|
|
|
|
|
$rowcount = mysql_num_rows($Erg3);
|
|
|
|
|
|
|
|
|
|
echo "Folgende Engelschichten sind noch nicht vergeben.\n";
|
|
|
|
|
echo "Und koenen, wenn diese nSchicht nicht benoetigt wird geloet werden:<br>\n";
|
|
|
|
|
for ($j=0; $j < $rowcount; $j++)
|
|
|
|
|
{
|
|
|
|
|
$TID = mysql_result($Erg3, $j, 0);
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo "<a href=\"./schichtplan.php?action=engelshiftdel&SID=". $_GET["SID"]. "&TID=$TID\">".
|
2005-09-10 19:25:43 +02:00
|
|
|
|
"freie ". TID2Type($TID). Get_Text("inc_schicht_Engel"). "schicht loeschen</a><br>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "<br><hr>\n\n\n\n";
|
|
|
|
|
|
|
|
|
|
//Ausgabe eingetragener schischten
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$sql3 = "SELECT * FROM `ShiftEntry` WHERE `SID`='". $_GET["SID"]. "' AND NOT `UID`='0'";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$Erg3 = mysql_query($sql3, $con);
|
|
|
|
|
$rowcount = mysql_num_rows($Erg3);
|
|
|
|
|
|
|
|
|
|
echo "Folgende Engel Sind fuer die Schicht eingetargen.\n";
|
|
|
|
|
echo "Und koennen, wenn diese nicht zu Schicht erschienen sind ausgetragen werden:<br>\n";
|
2010-12-25 20:19:33 +01:00
|
|
|
|
echo "<table border=\"1\">\n".
|
|
|
|
|
"<tr class=\"contenttopic\">".
|
|
|
|
|
"<th>nick</th>".
|
|
|
|
|
"<th>type</th>".
|
|
|
|
|
"<th>normal</th>".
|
|
|
|
|
"<th>freeloader :-(</th>".
|
|
|
|
|
"</tr>";
|
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
for ($j=0; $j < $rowcount; $j++)
|
|
|
|
|
{
|
|
|
|
|
$userUID=mysql_result($Erg3, $j, "UID");
|
2010-12-25 20:19:33 +01:00
|
|
|
|
echo "\t<tr>\n";
|
|
|
|
|
echo "\t\t<td>". UID2Nick($userUID). "</td>\n";
|
|
|
|
|
echo "\t\t<td>". TID2Type(mysql_result($Erg3, $j, "TID")). Get_Text("inc_schicht_Engel"). "</td>\n";
|
|
|
|
|
echo "\t\t<td><a href=\"./schichtplan.php?action=engeldel&SID=". $_GET["SID"]. "&UIDs=$userUID&freeloader=0\">###-austragen-###</a></td>\n";
|
2010-12-27 20:55:57 +01:00
|
|
|
|
echo "\t\t<td><a href=\"./schichtplan.php?action=engeldel&SID=". $_GET["SID"]. "&UIDs=$userUID&freeloader=1\">###-austragen-freeloader-###</a></td>\n";
|
2010-12-25 20:19:33 +01:00
|
|
|
|
echo "\t</tr>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
} // FOR
|
|
|
|
|
|
2010-12-25 20:19:33 +01:00
|
|
|
|
echo "</table><br><hr>\n\n\n\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
|
|
|
|
//Nachtragen von Engeln
|
|
|
|
|
echo "Hat ein anderer Engel die Schicht übernommen, trage ihn bitte ein:";
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo "<form action=\"".$_SERVER['SCRIPT_NAME']."\" method=\"GET\" >\n";
|
|
|
|
|
echo "<input type=\"hidden\" name=\"SID\" value=\"". $_GET["SID"]. "\">\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "<input type=\"hidden\" name=\"action\" value=\"engeladd\">\n";
|
|
|
|
|
|
|
|
|
|
// Listet alle Nicks auf
|
|
|
|
|
echo "<select name=\"UIDs\">\n";
|
2010-12-27 20:55:57 +01:00
|
|
|
|
if( $FromPentabarf != "Y")
|
|
|
|
|
{
|
|
|
|
|
echo "\t<option value=\"0\">--neu--</option>\n";
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$usql="SELECT * FROM `User` ORDER BY `Nick`";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$uErg = mysql_query($usql, $con);
|
|
|
|
|
$urowcount = mysql_num_rows($uErg);
|
|
|
|
|
for ($k=0; $k<$urowcount; $k++)
|
|
|
|
|
{
|
|
|
|
|
echo "\t<option value=\"".mysql_result($uErg, $k, "UID")."\">".
|
|
|
|
|
mysql_result($uErg, $k, "Nick").
|
|
|
|
|
"</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</select>\n";
|
|
|
|
|
|
|
|
|
|
echo " als \n";
|
|
|
|
|
|
|
|
|
|
// holt eine liste der ben<65>tigten Engel zu dieser Schischt
|
|
|
|
|
$sql3 = "SELECT Count(`TID`) AS `CTID`, `TID` FROM `ShiftEntry` ";
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$sql3.= "WHERE (`SID`='". $_GET["SID"]. "' AND `UID`='0') ";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$sql3.= "GROUP BY `SID`, `TID`, `UID` ";
|
|
|
|
|
$Erg3 = mysql_query($sql3, $con);
|
|
|
|
|
$i=-1;
|
|
|
|
|
while( ++$i < mysql_num_rows($Erg3))
|
|
|
|
|
{
|
|
|
|
|
$EngelNeed[mysql_result($Erg3, $i, "TID")] = mysql_result($Erg3, $i, "CTID");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Gibt dei m<>glich Engeltypen aus und zeigt w<>efiel noch be<62>tigt werden
|
|
|
|
|
echo "<select name=\"TID\">\n";
|
|
|
|
|
$SQL2 = "SELECT `TID`, `Name` FROM `EngelType` ORDER BY `Name`";
|
|
|
|
|
$Erg2 = mysql_query($SQL2, $con);
|
|
|
|
|
for ($l = 0; $l < mysql_num_rows($Erg2); $l++)
|
|
|
|
|
{
|
|
|
|
|
$EngelTID = mysql_result($Erg2, $l, "TID");
|
|
|
|
|
echo "<option value=\"$EngelTID\">";
|
|
|
|
|
echo mysql_result($Erg2, $l, "Name"). Get_Text("inc_schicht_engel");
|
2005-11-06 17:33:22 +01:00
|
|
|
|
if( !isset($EngelNeed[$EngelTID]) )
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo " (0)";
|
|
|
|
|
else
|
|
|
|
|
echo " (".$EngelNeed[$EngelTID].")";
|
|
|
|
|
echo "</option>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</select>\n";
|
|
|
|
|
|
|
|
|
|
echo "<input type=\"submit\" value=\"eintragen...\">\n";
|
2005-11-22 20:48:41 +01:00
|
|
|
|
|
|
|
|
|
echo "<br>\n<input value=\"1\" type=\"text\" size=\"5\" name=\"eAnzahlNew\"> Anzahl New\n";
|
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "</form>";
|
|
|
|
|
|
|
|
|
|
} // IF ISSET(
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'engeladd':
|
2005-11-06 17:33:22 +01:00
|
|
|
|
if( $_GET["UIDs"]>0)
|
2005-09-10 19:25:43 +02:00
|
|
|
|
{
|
2005-11-22 20:48:41 +01:00
|
|
|
|
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$SQL = "SELECT * FROM `ShiftEntry` ".
|
|
|
|
|
"WHERE (`SID`='". $_GET["SID"]. "' AND `TID`='". $_GET["TID"]. "' AND `UID`='0')";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$ERG = mysql_query($SQL, $con);
|
|
|
|
|
if( mysql_num_rows($ERG) != 0 )
|
|
|
|
|
{
|
|
|
|
|
$chSQL = "UPDATE `ShiftEntry` SET ".
|
2006-12-04 20:54:51 +01:00
|
|
|
|
"`UID`='". $_GET["UIDs"]. "', `Comment`='shift added by ".$_SESSION['Nick']."' ".
|
|
|
|
|
"WHERE (`SID`='". $_GET["SID"]. "' AND ".
|
2005-11-06 17:33:22 +01:00
|
|
|
|
"`TID`='". $_GET["TID"]. "' AND `UID`='0' ) LIMIT 1";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$chSQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`, `UID`, `Comment`) VALUES (".
|
|
|
|
|
"'". $_GET["SID"]. "', '". $_GET["TID"]. "', ".
|
|
|
|
|
"'". $_GET["UIDs"]. "', 'shift added by ".$_SESSION['Nick']."')";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
echo "Es wird folgende Schicht zusätzlich eingetragen:<br>\n";
|
2005-11-06 17:33:22 +01:00
|
|
|
|
echo "Engel: ".UID2Nick($_GET["UIDs"])."<br>\n";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
echo "Bemerkung: Schicht eingetragen durch Erzengel ".$_SESSION['Nick']."<br>\n<br>\n";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-11-22 20:48:41 +01:00
|
|
|
|
echo "Es wird folgende Schicht wurde ". $_GET["eAnzahlNew"]. "x zusätzlich eingetragen:<br>\n";
|
|
|
|
|
for( $i=0; $i<$_GET["eAnzahlNew"]; $i++)
|
|
|
|
|
{
|
|
|
|
|
echo "$i. <br>\n";
|
|
|
|
|
$SQL = "INSERT INTO `ShiftEntry` (`SID`, `TID`, `UID`, `Comment`) VALUES (";
|
|
|
|
|
$SQL .= "'". $_GET["SID"]. "', '". $_GET["TID"]. "', '0', NULL)";
|
|
|
|
|
$ERG = mysql_query($SQL, $con);
|
|
|
|
|
if( $DEBUG )
|
|
|
|
|
echo "DEBUG SQL: $SQL<br>\n";
|
|
|
|
|
if ($ERG == 1)
|
|
|
|
|
{
|
|
|
|
|
echo "Änderung wurde gesichert...<br>";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo "Fehler beim speichern... bitte noch ein mal probieren :)<br>";
|
|
|
|
|
echo mysql_error($con);
|
|
|
|
|
}
|
|
|
|
|
echo "Es wird eine weitere Schicht eingetragen:<br><br>\n";
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'engeldel':
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$chSQL = "UPDATE `ShiftEntry` SET `UID`='0', `Comment`= 'NULL' WHERE (`SID`='". $_GET["SID"].
|
|
|
|
|
"' AND `UID`='". $_GET["UIDs"]. "') LIMIT 1";
|
2010-12-25 20:19:33 +01:00
|
|
|
|
if( isset($_GET["freeloader"]) && $_GET["freeloader"]==1)
|
|
|
|
|
{
|
|
|
|
|
$sql = "SELECT * FROM `Shifts` WHERE (`SID` = '". $_GET["SID"]. "' )";
|
|
|
|
|
$Erg = mysql_query($sql, $con);
|
|
|
|
|
if( mysql_num_rows( $Erg) == 1)
|
|
|
|
|
{
|
|
|
|
|
$UID = $_GET["UIDs"];
|
|
|
|
|
$Length = mysql_result($Erg, 0, "Len");
|
|
|
|
|
$Comment = "Start: ". mysql_result($Erg, 0, "DateS"). "; ".
|
|
|
|
|
"Beschreibung: ". mysql_result($Erg, 0, "Man"). "; ".
|
|
|
|
|
"Removed by ". $_SESSION['Nick'];
|
|
|
|
|
$ch2SQL =
|
|
|
|
|
"INSERT INTO `ShiftFreeloader` (`Remove_Time`, `UID`, `Length`, `Comment`) ".
|
|
|
|
|
"VALUES ( CURRENT_TIMESTAMP, '$UID', '$Length', '$Comment');";
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-09-10 19:25:43 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'engelshiftdel':
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$chSQL = "DELETE FROM `ShiftEntry` WHERE `SID`='". $_GET["SID"]. "' AND `TID`='".
|
|
|
|
|
$_GET["TID"]. "' AND `UID`='0' LIMIT 1";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'changesave':
|
2005-11-06 17:33:22 +01:00
|
|
|
|
$query = mysql_query("SELECT DATE_ADD('". $_GET["eDate"]. "', INTERVAL '+0 ". $_GET["eDauer"]. "' DAY_HOUR)", $con);
|
2005-09-10 19:25:43 +02:00
|
|
|
|
$enddate = mysql_fetch_row($query);
|
|
|
|
|
|
2005-11-15 22:18:06 +01:00
|
|
|
|
$chSQL = "UPDATE `Shifts` SET ".
|
|
|
|
|
"`DateS`='". $_GET["eDate"]. "', ".
|
|
|
|
|
"`DateE`='".$enddate[0]. "', ".
|
|
|
|
|
"`RID`='". $_GET["eRID"]. "', ".
|
|
|
|
|
"`Len`='". $_GET["eDauer"]. "', ".
|
|
|
|
|
"`Man`='". $_GET["eName"]. "', ".
|
|
|
|
|
"`URL`='". $_GET["eURL"]. "' ".
|
2006-12-11 08:47:43 +01:00
|
|
|
|
"WHERE `SID`='". $_GET["SID"]. "'";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'delete':
|
2006-12-04 20:54:51 +01:00
|
|
|
|
$chSQL = "DELETE FROM `Shifts` WHERE `SID`='". $_GET["SID"]. "' LIMIT 1";
|
|
|
|
|
$ch2SQL = "DELETE FROM `ShiftEntry` WHERE `SID`='". $_GET["SID"]. "'";
|
2005-09-10 19:25:43 +02:00
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
|
break;
|
|
|
|
|
|
2005-11-15 22:18:06 +01:00
|
|
|
|
case 'deleteShifs':
|
|
|
|
|
foreach ($_GET as $k => $v)
|
|
|
|
|
if( strpos( " ".$k, "SID") == 1)
|
|
|
|
|
{
|
|
|
|
|
echo "Shifts $v wird gel<65>scht...";
|
2006-12-11 08:47:43 +01:00
|
|
|
|
executeSQL( "DELETE FROM `Shifts` WHERE `SID`='$v' LIMIT 1");
|
2005-11-15 22:18:06 +01:00
|
|
|
|
echo "<br>\n";
|
|
|
|
|
echo "ShiftEntry $v wird gel<65>scht...";
|
2006-12-11 08:47:43 +01:00
|
|
|
|
executeSQL( "DELETE FROM `ShiftEntry` WHERE `SID`='$v'");
|
2005-11-15 22:18:06 +01:00
|
|
|
|
echo "<br><br>\n";
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2005-09-10 19:25:43 +02:00
|
|
|
|
} // end switch
|
|
|
|
|
|
|
|
|
|
if (IsSet($chSQL)){
|
|
|
|
|
// echo $chSQL;
|
|
|
|
|
// hier muesste das SQL ausgefuehrt werden...
|
|
|
|
|
$Erg = mysql_query($chSQL, $con);
|
|
|
|
|
if( $DEBUG )
|
|
|
|
|
echo "DEBUG SQL: $chSQL<br>\n";
|
|
|
|
|
if ($Erg == 1)
|
|
|
|
|
{
|
|
|
|
|
echo "Änderung wurde gesichert...<br>";
|
|
|
|
|
if( $DEBUG )
|
|
|
|
|
echo "DEBUG: ergebniss". $Erg. "<br>\n";
|
|
|
|
|
if (IsSet($ch2SQL))
|
|
|
|
|
{
|
|
|
|
|
$Erg = mysql_query($ch2SQL, $con);
|
|
|
|
|
if( $DEBUG )
|
|
|
|
|
echo "DEBUG SQL: $ch2SQL<br>\n";
|
|
|
|
|
if( $DEBUG ) echo "DEBUG: ergebniss". $Erg. "<br>\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo "Fehler beim speichern... bitte noch ein mal probieren :)<br>";
|
|
|
|
|
echo mysql_error($con);
|
|
|
|
|
}
|
|
|
|
|
} // Ende Update
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-09-10 20:30:16 +02:00
|
|
|
|
include ("../../includes/footer.php");
|
2005-09-10 19:25:43 +02:00
|
|
|
|
?>
|