From c31e620d2c12855255719cbbbd658af57c3a2070 Mon Sep 17 00:00:00 2001 From: cookie Date: Wed, 6 Dec 2006 18:00:20 +0000 Subject: [PATCH] fehler abgefangen git-svn-id: svn://svn.cccv.de/engel-system@202 29ba0400-6e00-0410-a75a-ca02368028f8 --- www-ssl/admin/room.php | 111 +++++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 53 deletions(-) diff --git a/www-ssl/admin/room.php b/www-ssl/admin/room.php index b35b3916..426bc1ff 100755 --- a/www-ssl/admin/room.php +++ b/www-ssl/admin/room.php @@ -98,67 +98,71 @@ case 'newsave': break; case 'change': - if (! IsSet($_GET["RID"])) { + if (! IsSet($_GET["RID"])) echo "Fehlerhafter Aufruf!"; - } else { - - 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 "
\n"; - echo "\n"; - - $SQL2 = "SELECT * FROM `Room` WHERE `RID`='". $_GET["RID"]. "'"; - $ERG = mysql_query($SQL2, $con); - - for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++) + else { - if( (mysql_field_name($ERG, $Uj) == "show") || (mysql_field_name($ERG, $Uj) == "FromPentabarf") ) + $SQL2 = "SELECT * FROM `Room` WHERE `RID`='". $_GET["RID"]. "'"; + $ERG = mysql_query($SQL2, $con); + + if( mysql_num_rows( $ERG)>0) { - echo "". - "\n"; + 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 "\n"; + echo "
show". - "Yes". - "No". - "
\n"; + + for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++) + { + if( (mysql_field_name($ERG, $Uj) == "show") || (mysql_field_name($ERG, $Uj) == "FromPentabarf") ) + { + echo "". + "\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 "". + "\n"; + } + } + echo "
show". + "Yes". + "No". + "
$FeldName". + "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "
"; } 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 "$FeldName". - "". - "\n"; - } - } - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "
\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "
"; + echo "FEHLER: Room ID ". $_GET["RID"]. " nicht gefunden"; } break; case 'changesave': $sql=""; - $vars = $HTTP_GET_VARS; - $count = count($vars) - 2; - $vars = array_splice($vars, 0, $count); - foreach($vars as $key => $value){ - $keys = substr($key,1); - $sql .= ", `".$keys."`='".$value."' "; - - } + $vars = $HTTP_GET_VARS; + $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; @@ -181,9 +185,10 @@ if (IsSet($SQL)){ // echo $SQL; // hier muesste das SQL ausgefuehrt werden... $Erg = mysql_query($SQL, $con); - if ($Erg == 1) { + if ($Erg == 1) echo "Änderung wurde gesichert...
"; - } else { + else + { echo "Fehler beim speichern... bitte noch ein mal probieren :)"; echo "

".mysql_error( $con ). "
($SQL)
"; }