diff options
author | Moritz helios Rudert <helios@planetcyborg.de> | 2011-06-01 12:13:39 +0200 |
---|---|---|
committer | Moritz helios Rudert <helios@planetcyborg.de> | 2011-06-01 12:13:39 +0200 |
commit | 75448045cfe70054c8f4bae1bcfaf9bb0f70d330 (patch) | |
tree | 6a4d3d35019cdf933c1816e8522dc5d2557f5238 /www-ssl/admin/room.php | |
parent | 12e0b0d809c29d435a247798d7318cc9835980ea (diff) |
fixes
Diffstat (limited to 'www-ssl/admin/room.php')
-rw-r--r--[-rwxr-xr-x] | www-ssl/admin/room.php | 320 |
1 files changed, 160 insertions, 160 deletions
diff --git a/www-ssl/admin/room.php b/www-ssl/admin/room.php index ebbe1e36..09006675 100755..100644 --- a/www-ssl/admin/room.php +++ b/www-ssl/admin/room.php @@ -9,36 +9,36 @@ $Erg = mysql_query($Sql, $con); if( !IsSet($_GET["action"]) ) { - echo "Hallo ".$_SESSION['Nick']. - ",<br>\nhier hast du die Möglichkeit, neue Räume für die Schichtpläne einzutragen ". - "oder vorhandene abzuändern:<br><br>\n"; - - echo "<a href=\"./room.php?action=new\">- Neuen Raum/Ort eintragen</a><br>\n"; - - echo "<table width=\"100%\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n"; - echo "<tr class=\"contenttopic\">\n"; - - for( $i = 1; $i < mysql_num_fields($Erg); $i++ ) - { - if( substr( mysql_field_name($Erg, $i), 0, 12) == "DEFAULT_EID_") - echo "\t<td> Anzahl ". $EngelTypeID[substr( mysql_field_name($Erg, $i), 12)]. "</td>"; - else - echo "\t<td>". mysql_field_name($Erg, $i)."</td>"; - } - echo "\t<td>Ändern</td>"; - echo "</tr>"; - - for( $t = 0; $t < mysql_num_rows($Erg); $t++ ) - { - echo "\t<tr class=\"content\">\n"; - for ($j = 1; $j < mysql_num_fields($Erg); $j++) - { - echo "\t\t<td>".mysql_result($Erg, $t, $j)."</td>\n"; - } - echo "\t\t<td><a href=\"./room.php?action=change&RID=".mysql_result($Erg, $t, "RID")."\">###</a></td>\n"; - echo "\t</tr>\n"; - } // ende Auflistung Raeume - echo "</table>"; + echo "Hallo ".$_SESSION['Nick']. + ",<br />\nhier hast du die Möglichkeit, neue Räume für die Schichtpläne einzutragen ". + "oder vorhandene abzuändern:<br /><br />\n"; + + echo "<a href=\"./room.php?action=new\">- Neuen Raum/Ort eintragen</a><br />\n"; + + echo "<table width=\"100%\" class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n"; + echo "<tr class=\"contenttopic\">\n"; + + for( $i = 1; $i < mysql_num_fields($Erg); $i++ ) + { + if( substr( mysql_field_name($Erg, $i), 0, 12) == "DEFAULT_EID_") + echo "\t<td> Anzahl ". $EngelTypeID[substr( mysql_field_name($Erg, $i), 12)]. "</td>"; + else + echo "\t<td>". mysql_field_name($Erg, $i)."</td>"; + } + echo "\t<td>Ändern</td>"; + echo "</tr>"; + + for( $t = 0; $t < mysql_num_rows($Erg); $t++ ) + { + echo "\t<tr class=\"content\">\n"; + for ($j = 1; $j < mysql_num_fields($Erg); $j++) + { + echo "\t\t<td>".mysql_result($Erg, $t, $j)."</td>\n"; + } + echo "\t\t<td><a href=\"./room.php?action=change&RID=".mysql_result($Erg, $t, "RID")."\">###</a></td>\n"; + echo "\t</tr>\n"; + } // ende Auflistung Raeume + echo "</table>"; } else { @@ -48,132 +48,132 @@ UnSet($SQL); switch ($_GET["action"]) { case 'new': - echo "Neuen Raum einrichten: <br>"; - echo "<form action=\"./room.php\" method=\"GET\">\n"; - echo "<table>\n"; - - for( $Uj = 1; $Uj < mysql_num_fields($Erg); $Uj++ ) - { - if( (mysql_field_name($Erg, $Uj) == "show") || (mysql_field_name($Erg, $Uj) == "FromPentabarf") ) - { - echo "<tr><td>". mysql_field_name($Erg, $Uj). "</td>". - "<td>". - "<input type=\"radio\" name=\"". mysql_field_name($Erg, $Uj). "\" value=\"Y\">Yes". - "<input type=\"radio\" name=\"". mysql_field_name($Erg, $Uj). "\" value=\"N\">No". - "</td></tr>\n"; - } - else - { - //sonderfall fuer Default Engel - if( substr( mysql_field_name($Erg, $Uj), 0, 12) == "DEFAULT_EID_") - $FeldName = "Anzahl ". $EngelTypeID[substr( mysql_field_name($Erg, $Uj), 12)]; - else - $FeldName = mysql_field_name($Erg, $Uj); - - echo "<td>$FeldName</td>". - "<td><input type=\"text\" size=\"40\" name=\"".mysql_field_name($Erg, $Uj)."\">"; - echo "</td></tr>\n"; - } - } - echo "</table>\n"; - echo "<input type=\"hidden\" name=\"action\" value=\"newsave\">\n"; - echo "<input type=\"submit\" value=\"sichern...\">\n"; - echo "</form>"; - break; + echo "Neuen Raum einrichten: <br />"; + echo "<form action=\"./room.php\" method=\"GET\">\n"; + echo "<table>\n"; + + for( $Uj = 1; $Uj < mysql_num_fields($Erg); $Uj++ ) + { + if( (mysql_field_name($Erg, $Uj) == "show") || (mysql_field_name($Erg, $Uj) == "FromPentabarf") ) + { + echo "<tr><td>". mysql_field_name($Erg, $Uj). "</td>". + "<td>". + "<input type=\"radio\" name=\"". mysql_field_name($Erg, $Uj). "\" value=\"Y\">Yes". + "<input type=\"radio\" name=\"". mysql_field_name($Erg, $Uj). "\" value=\"N\">No". + "</td></tr>\n"; + } + else + { + //sonderfall fuer Default Engel + if( substr( mysql_field_name($Erg, $Uj), 0, 12) == "DEFAULT_EID_") + $FeldName = "Anzahl ". $EngelTypeID[substr( mysql_field_name($Erg, $Uj), 12)]; + else + $FeldName = mysql_field_name($Erg, $Uj); + + echo "<td>$FeldName</td>". + "<td><input type=\"text\" size=\"40\" name=\"".mysql_field_name($Erg, $Uj)."\">"; + echo "</td></tr>\n"; + } + } + echo "</table>\n"; + echo "<input type=\"hidden\" name=\"action\" value=\"newsave\">\n"; + echo "<input type=\"submit\" value=\"sichern...\">\n"; + echo "</form>"; + break; case 'newsave': - $vars = $_GET; - $count = count($vars) - 1; - $vars = array_splice($vars, 0, $count); - $Keys = ""; - $Values = ""; - foreach($vars as $key => $value) - { - $Keys .= ", `$key`"; - $Values .= ", '$value'"; - } - $SQL = "INSERT INTO `Room` (". substr( $Keys, 2). ") VALUES (". substr( $Values, 2). ")"; - SetHeaderGo2Back(); - break; + $vars = $_GET; + $count = count($vars) - 1; + $vars = array_splice($vars, 0, $count); + $Keys = ""; + $Values = ""; + foreach($vars as $key => $value) + { + $Keys .= ", `$key`"; + $Values .= ", '$value'"; + } + $SQL = "INSERT INTO `Room` (". substr( $Keys, 2). ") VALUES (". substr( $Values, 2). ")"; + SetHeaderGo2Back(); + break; case 'change': - if (! IsSet($_GET["RID"])) - echo "Fehlerhafter Aufruf!"; - else - { - $SQL2 = "SELECT * FROM `Room` WHERE `RID`='". $_GET["RID"]. "'"; - $ERG = mysql_query($SQL2, $con); - - if( mysql_num_rows( $ERG)>0) - { - echo "Raum abändern:\n"; - echo "Hier kannst du eintragen, welche und wieviele Engel für den Raum zur Verf?gung stehen müssen."; - echo "<form action=\"./room.php\" method=\"GET\">\n"; - echo "<table>\n"; - - for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++) - { - if( (mysql_field_name($ERG, $Uj) == "show") || (mysql_field_name($ERG, $Uj) == "FromPentabarf") ) - { - echo "<tr><td>". mysql_field_name($Erg, $Uj). "</td>". - "<td>". - "<input type=\"radio\" name=\"e". mysql_field_name($ERG, $Uj). - "\" value=\"Y\"". (mysql_result($ERG, 0, $Uj)=='Y'? " checked":""). ">Yes". - "<input type=\"radio\" name=\"e". mysql_field_name($ERG, $Uj). - "\" value=\"N\"". (mysql_result($ERG, 0, $Uj)=='N'? " checked":""). ">No". - "</td></tr>\n"; - } - else - { - if( substr( mysql_field_name($ERG, $Uj), 0, 12) == "DEFAULT_EID_") - //sonderfall fuer Default Engel - $FeldName = "Anzahl ". $EngelTypeID[substr( mysql_field_name($ERG, $Uj), 12)]; - else - $FeldName = mysql_field_name($ERG, $Uj); - echo "<tr><td>$FeldName</td>". - "<td><input type=\"text\" size=\"40\" name=\"e".mysql_field_name($ERG, $Uj)."\" ". - "value=\"".mysql_result($ERG, 0, $Uj)."\">". - "</td></tr>\n"; - } - } - echo "</table>\n"; - echo "<input type=\"hidden\" name=\"eRID\" value=\"". $_GET["RID"]. "\">\n"; - echo "<input type=\"hidden\" name=\"action\" value=\"changesave\">\n"; - echo "<input type=\"submit\" value=\"sichern...\">\n"; - echo "</form>"; - echo "<form action=\"./room.php\" method=\"GET\">\n"; - echo "<input type=\"hidden\" name=\"RID\" value=\"". $_GET["RID"]. "\">\n"; - echo "<input type=\"hidden\" name=\"action\" value=\"delete\">\n"; - echo "<input type=\"submit\" value=\"Löschen...\">"; - echo "</form>"; - } - else - echo "FEHLER: Room ID ". $_GET["RID"]. " nicht gefunden"; - } - break; - + if (! IsSet($_GET["RID"])) + echo "Fehlerhafter Aufruf!"; + else + { + $SQL2 = "SELECT * FROM `Room` WHERE `RID`='". $_GET["RID"]. "'"; + $ERG = mysql_query($SQL2, $con); + + if( mysql_num_rows( $ERG)>0) + { + echo "Raum abändern:\n"; + echo "Hier kannst du eintragen, welche und wieviele Engel für den Raum zur Verf?gung stehen müssen."; + echo "<form action=\"./room.php\" method=\"GET\">\n"; + echo "<table>\n"; + + for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++) + { + if( (mysql_field_name($ERG, $Uj) == "show") || (mysql_field_name($ERG, $Uj) == "FromPentabarf") ) + { + echo "<tr><td>". mysql_field_name($Erg, $Uj). "</td>". + "<td>". + "<input type=\"radio\" name=\"e". mysql_field_name($ERG, $Uj). + "\" value=\"Y\"". (mysql_result($ERG, 0, $Uj)=='Y'? " checked":""). ">Yes". + "<input type=\"radio\" name=\"e". mysql_field_name($ERG, $Uj). + "\" value=\"N\"". (mysql_result($ERG, 0, $Uj)=='N'? " checked":""). ">No". + "</td></tr>\n"; + } + else + { + if( substr( mysql_field_name($ERG, $Uj), 0, 12) == "DEFAULT_EID_") + //sonderfall fuer Default Engel + $FeldName = "Anzahl ". $EngelTypeID[substr( mysql_field_name($ERG, $Uj), 12)]; + else + $FeldName = mysql_field_name($ERG, $Uj); + echo "<tr><td>$FeldName</td>". + "<td><input type=\"text\" size=\"40\" name=\"e".mysql_field_name($ERG, $Uj)."\" ". + "value=\"".mysql_result($ERG, 0, $Uj)."\">". + "</td></tr>\n"; + } + } + echo "</table>\n"; + echo "<input type=\"hidden\" name=\"eRID\" value=\"". $_GET["RID"]. "\">\n"; + echo "<input type=\"hidden\" name=\"action\" value=\"changesave\">\n"; + echo "<input type=\"submit\" value=\"sichern...\">\n"; + echo "</form>"; + echo "<form action=\"./room.php\" method=\"GET\">\n"; + echo "<input type=\"hidden\" name=\"RID\" value=\"". $_GET["RID"]. "\">\n"; + echo "<input type=\"hidden\" name=\"action\" value=\"delete\">\n"; + echo "<input type=\"submit\" value=\"Löschen...\">"; + echo "</form>"; + } + else + echo "FEHLER: Room ID ". $_GET["RID"]. " nicht gefunden"; + } + break; + case 'changesave': - $sql=""; - $vars = $_GET; - $count = count($vars) - 2; - $vars = array_splice($vars, 0, $count); - foreach($vars as $key => $value) - { - $keys = substr($key,1); - $sql .= ", `".$keys."`='".$value."' "; - } - $SQL = "UPDATE `Room` SET ". substr($sql, 2). " WHERE `RID`='". $_GET["eRID"]. "'"; - SetHeaderGo2Back(); - break; + $sql=""; + $vars = $_GET; + $count = count($vars) - 2; + $vars = array_splice($vars, 0, $count); + foreach($vars as $key => $value) + { + $keys = substr($key,1); + $sql .= ", `".$keys."`='".$value."' "; + } + $SQL = "UPDATE `Room` SET ". substr($sql, 2). " WHERE `RID`='". $_GET["eRID"]. "'"; + SetHeaderGo2Back(); + break; case 'delete': - if (IsSet($_GET["RID"])) { - $SQL="DELETE FROM `Room` WHERE `RID`='". $_GET["RID"]. "'"; - } else { - echo "Fehlerhafter Aufruf"; - } - SetHeaderGo2Back(); - break; + if (IsSet($_GET["RID"])) { + $SQL="DELETE FROM `Room` WHERE `RID`='". $_GET["RID"]. "'"; + } else { + echo "Fehlerhafter Aufruf"; + } + SetHeaderGo2Back(); + break; } //switch @@ -181,17 +181,17 @@ case 'delete': // Update ??? if (IsSet($SQL)){ -// echo $SQL; - // hier muesste das SQL ausgefuehrt werden... - $Erg = db_query($SQL, "exec SQL"); - if ($Erg == 1) - echo "Änderung wurde gesichert...<br>"; - else - { - echo "Fehler beim speichern... bitte noch ein mal probieren :)"; - echo "<br><br>".mysql_error( $con ). "<br>($SQL)<br>"; - } -} // Ende Update +// echo $SQL; + // hier muesste das SQL ausgefuehrt werden... + $Erg = db_query($SQL, "exec SQL"); + if ($Erg == 1) + echo "Änderung wurde gesichert...<br />"; + else + { + echo "Fehler beim speichern... bitte noch ein mal probieren :)"; + echo "<br /><br />".mysql_error( $con ). "<br />($SQL)<br />"; + } +} // Ende Update } //IF IsSet($action) |