fehler abgefangen

git-svn-id: svn://svn.cccv.de/engel-system@202 29ba0400-6e00-0410-a75a-ca02368028f8
main
cookie 18 years ago
parent de2c8c72d1
commit c31e620d2c

@ -98,28 +98,30 @@ case 'newsave':
break;
case 'change':
if (! IsSet($_GET["RID"])) {
if (! IsSet($_GET["RID"]))
echo "Fehlerhafter Aufruf!";
} else {
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";
$SQL2 = "SELECT * FROM `Room` WHERE `RID`='". $_GET["RID"]. "'";
$ERG = mysql_query($SQL2, $con);
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>show</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".
"<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
@ -129,7 +131,6 @@ case 'change':
$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)."\">".
@ -147,6 +148,9 @@ case 'change':
echo "<input type=\"submit\" value=\"L&ouml;schen...\">";
echo "</form>";
}
else
echo "FEHLER: Room ID ". $_GET["RID"]. " nicht gefunden";
}
break;
case 'changesave':
@ -154,10 +158,10 @@ case 'changesave':
$vars = $HTTP_GET_VARS;
$count = count($vars) - 2;
$vars = array_splice($vars, 0, $count);
foreach($vars as $key => $value){
foreach($vars as $key => $value)
{
$keys = substr($key,1);
$sql .= ", `".$keys."`='".$value."' ";
}
$SQL = "UPDATE `Room` SET ". substr($sql, 2). " WHERE `RID`='". $_GET["eRID"]. "'";
SetHeaderGo2Back();
@ -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 "&Auml;nderung wurde gesichert...<br>";
} else {
else
{
echo "Fehler beim speichern... bitte noch ein mal probieren :)";
echo "<br><br>".mysql_error( $con ). "<br>($SQL)<br>";
}

Loading…
Cancel
Save