fehler abgefangen
git-svn-id: svn://svn.cccv.de/engel-system@202 29ba0400-6e00-0410-a75a-ca02368028f8
This commit is contained in:
parent
de2c8c72d1
commit
c31e620d2c
|
@ -98,28 +98,30 @@ case 'newsave':
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'change':
|
case 'change':
|
||||||
if (! IsSet($_GET["RID"])) {
|
if (! IsSet($_GET["RID"]))
|
||||||
echo "Fehlerhafter Aufruf!";
|
echo "Fehlerhafter Aufruf!";
|
||||||
} else {
|
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 "<form action=\"./room.php\" method=\"GET\">\n";
|
|
||||||
echo "<table>\n";
|
|
||||||
|
|
||||||
$SQL2 = "SELECT * FROM `Room` WHERE `RID`='". $_GET["RID"]. "'";
|
$SQL2 = "SELECT * FROM `Room` WHERE `RID`='". $_GET["RID"]. "'";
|
||||||
$ERG = mysql_query($SQL2, $con);
|
$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++)
|
for ($Uj = 1; $Uj < mysql_num_fields($ERG); $Uj++)
|
||||||
{
|
{
|
||||||
if( (mysql_field_name($ERG, $Uj) == "show") || (mysql_field_name($ERG, $Uj) == "FromPentabarf") )
|
if( (mysql_field_name($ERG, $Uj) == "show") || (mysql_field_name($ERG, $Uj) == "FromPentabarf") )
|
||||||
{
|
{
|
||||||
echo "<tr><td>show</td>".
|
echo "<tr><td>show</td>".
|
||||||
"<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).
|
||||||
"<input type=\"radio\" name=\"e". mysql_field_name($ERG, $Uj). "\" value=\"N\"". (mysql_result($ERG, 0, $Uj)=='N'? " checked":""). ">No".
|
"\" 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";
|
"</td></tr>\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -129,7 +131,6 @@ case 'change':
|
||||||
$FeldName = "Anzahl ". $EngelTypeID[substr( mysql_field_name($ERG, $Uj), 12)];
|
$FeldName = "Anzahl ". $EngelTypeID[substr( mysql_field_name($ERG, $Uj), 12)];
|
||||||
else
|
else
|
||||||
$FeldName = mysql_field_name($ERG, $Uj);
|
$FeldName = mysql_field_name($ERG, $Uj);
|
||||||
|
|
||||||
echo "<tr><td>$FeldName</td>".
|
echo "<tr><td>$FeldName</td>".
|
||||||
"<td><input type=\"text\" size=\"40\" name=\"e".mysql_field_name($ERG, $Uj)."\" ".
|
"<td><input type=\"text\" size=\"40\" name=\"e".mysql_field_name($ERG, $Uj)."\" ".
|
||||||
"value=\"".mysql_result($ERG, 0, $Uj)."\">".
|
"value=\"".mysql_result($ERG, 0, $Uj)."\">".
|
||||||
|
@ -147,6 +148,9 @@ case 'change':
|
||||||
echo "<input type=\"submit\" value=\"Löschen...\">";
|
echo "<input type=\"submit\" value=\"Löschen...\">";
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
echo "FEHLER: Room ID ". $_GET["RID"]. " nicht gefunden";
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'changesave':
|
case 'changesave':
|
||||||
|
@ -154,10 +158,10 @@ case 'changesave':
|
||||||
$vars = $HTTP_GET_VARS;
|
$vars = $HTTP_GET_VARS;
|
||||||
$count = count($vars) - 2;
|
$count = count($vars) - 2;
|
||||||
$vars = array_splice($vars, 0, $count);
|
$vars = array_splice($vars, 0, $count);
|
||||||
foreach($vars as $key => $value){
|
foreach($vars as $key => $value)
|
||||||
|
{
|
||||||
$keys = substr($key,1);
|
$keys = substr($key,1);
|
||||||
$sql .= ", `".$keys."`='".$value."' ";
|
$sql .= ", `".$keys."`='".$value."' ";
|
||||||
|
|
||||||
}
|
}
|
||||||
$SQL = "UPDATE `Room` SET ". substr($sql, 2). " WHERE `RID`='". $_GET["eRID"]. "'";
|
$SQL = "UPDATE `Room` SET ". substr($sql, 2). " WHERE `RID`='". $_GET["eRID"]. "'";
|
||||||
SetHeaderGo2Back();
|
SetHeaderGo2Back();
|
||||||
|
@ -181,9 +185,10 @@ if (IsSet($SQL)){
|
||||||
// echo $SQL;
|
// echo $SQL;
|
||||||
// hier muesste das SQL ausgefuehrt werden...
|
// hier muesste das SQL ausgefuehrt werden...
|
||||||
$Erg = mysql_query($SQL, $con);
|
$Erg = mysql_query($SQL, $con);
|
||||||
if ($Erg == 1) {
|
if ($Erg == 1)
|
||||||
echo "Änderung wurde gesichert...<br>";
|
echo "Änderung wurde gesichert...<br>";
|
||||||
} else {
|
else
|
||||||
|
{
|
||||||
echo "Fehler beim speichern... bitte noch ein mal probieren :)";
|
echo "Fehler beim speichern... bitte noch ein mal probieren :)";
|
||||||
echo "<br><br>".mysql_error( $con ). "<br>($SQL)<br>";
|
echo "<br><br>".mysql_error( $con ). "<br>($SQL)<br>";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue