From a515546b5a2b782144afc0f613aa54e5f7f87eae Mon Sep 17 00:00:00 2001 From: cookie Date: Tue, 15 Nov 2005 21:18:06 +0000 Subject: [PATCH] gruppen loeschen eingebaut git-svn-id: svn://svn.cccv.de/engel-system@54 29ba0400-6e00-0410-a75a-ca02368028f8 --- www-ssl/admin/schichtplan.php | 61 ++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 5 deletions(-) diff --git a/www-ssl/admin/schichtplan.php b/www-ssl/admin/schichtplan.php index 9e7ec81b..4bdbb73f 100755 --- a/www-ssl/admin/schichtplan.php +++ b/www-ssl/admin/schichtplan.php @@ -5,14 +5,33 @@ $submenus = 1; include ("./inc/header.php"); include ("./inc/funktion_user.php"); +function executeSQL( $SQL) +{ + global $DEBUG, $con; + + $Erg = mysql_query($SQL, $con); + if( $DEBUG ) + echo "DEBUG SQL: $SQL
\n"; + if ($Erg == 1) + { + echo "SQL war erfolgreich"; + } + else + { + echo "SQL Fehler (". mysql_error($con).")" ; + } +} + if (!IsSet($_GET["action"])) { echo "Hallo ".$_SESSION['Nick'].",
\n"; echo "hier kannst du Schichten anlegen, ändern oder löschen.

"; echo "Neue Schicht einplanen

\n\n"; +echo "
\n"; ?> + @@ -27,6 +46,8 @@ $rowcount = mysql_num_rows($Erg); for( $i = 0; $i < $rowcount; $i++) { echo "\t\n"; + echo "\t\t\n"; echo "\t\t\n"; $sql2= "SELECT `Name` FROM `Room` WHERE `RID`=\"".mysql_result($Erg, $i, "RID")."\""; @@ -40,7 +61,11 @@ for( $i = 0; $i < $rowcount; $i++) mysql_result($Erg, $i, "SID")."\">####\n"; echo "\t\n"; } -echo "
Datum Raum Dauer
".mysql_result($Erg, $i, "DateS")."
"; +echo "\n"; + +echo "\n"; +echo "\n"; +echo "
\n"; } else { @@ -51,7 +76,8 @@ UnSet($chSQL); switch ($_GET["action"]){ case 'change': - if ( !IsSet($_GET["SID"]) ){ + if ( !IsSet($_GET["SID"]) ) + { echo "Fehlerhafter Aufruf!\n"; } else @@ -89,6 +115,12 @@ case 'change': echo " Beschreibung". "\n"; + echo " FromPentabarf". + "\n"; + echo " URL". + "\n"; echo "\n"; echo "\n"; @@ -244,9 +276,15 @@ case 'changesave': $query = mysql_query("SELECT DATE_ADD('". $_GET["eDate"]. "', INTERVAL '+0 ". $_GET["eDauer"]. "' DAY_HOUR)", $con); $enddate = mysql_fetch_row($query); - $chSQL = "UPDATE `Shifts` SET `DateS`='". $_GET["eDate"]. "', `DateE`='".$enddate[0]. - "', `RID`='". $_GET["eRID"]. "', `Len`='". $_GET["eDauer"]. "', ". - "`Man`='". $_GET["eName"]. "' WHERE `SID`=". $_GET["SID"]; + $chSQL = "UPDATE `Shifts` SET ". + "`DateS`='". $_GET["eDate"]. "', ". + "`DateE`='".$enddate[0]. "', ". + "`RID`='". $_GET["eRID"]. "', ". + "`Len`='". $_GET["eDauer"]. "', ". + "`Man`='". $_GET["eName"]. "', ". + "`FromPentabarf`='". $_GET["eFromPentabarf"]. "', ". + "`URL`='". $_GET["eURL"]. "' ". + "WHERE `SID`=". $_GET["SID"]; SetHeaderGo2Back(); break; @@ -256,6 +294,19 @@ case 'delete': SetHeaderGo2Back(); break; +case 'deleteShifs': + foreach ($_GET as $k => $v) + if( strpos( " ".$k, "SID") == 1) + { + echo "Shifts $v wird gelöscht..."; + executeSQL( "DELETE FROM `Shifts` WHERE `SID`=$v LIMIT 1"); + echo "
\n"; + echo "ShiftEntry $v wird gelöscht..."; + executeSQL( "DELETE FROM `ShiftEntry` WHERE `SID`= $v"); + echo "

\n"; + } + break; + } // end switch if (IsSet($chSQL)){