|
|
@ -9,11 +9,14 @@ function runSQL( $SQL)
|
|
|
|
include( "./inc/db.php");
|
|
|
|
include( "./inc/db.php");
|
|
|
|
// 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)
|
|
|
|
|
|
|
|
{
|
|
|
|
echo "Änderung wurde gesichert...<br>";
|
|
|
|
echo "Änderung wurde gesichert...<br>";
|
|
|
|
echo "[$SQL]<br>";
|
|
|
|
echo "[$SQL]<br>";
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
} 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>";
|
|
|
|
echo "<br><br>".mysql_error( $con ). "<br>";
|
|
|
|
echo "[$SQL]<br>";
|
|
|
|
echo "[$SQL]<br>";
|
|
|
@ -21,6 +24,27 @@ function runSQL( $SQL)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function runSQL_log( $SQL, $commed)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
include( "./inc/db.php");
|
|
|
|
|
|
|
|
// hier muesste das SQL ausgefuehrt werden...
|
|
|
|
|
|
|
|
$Erg = db_query($SQL, $commed);
|
|
|
|
|
|
|
|
if ($Erg)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
echo "Änderung wurde gesichert...<br>";
|
|
|
|
|
|
|
|
echo "[$SQL]<br>";
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
echo "Fehler beim speichern... bitte noch ein mal probieren :)";
|
|
|
|
|
|
|
|
echo "<br><br>".mysql_error( $con ). "<br>";
|
|
|
|
|
|
|
|
echo "[$SQL]<br>";
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$Sql = "SELECT * FROM `EngelType` ORDER BY NAME";
|
|
|
|
$Sql = "SELECT * FROM `EngelType` ORDER BY NAME";
|
|
|
|
$Erg = mysql_query($Sql, $con);
|
|
|
|
$Erg = mysql_query($Sql, $con);
|
|
|
@ -87,7 +111,8 @@ case 'newsave':
|
|
|
|
$Values .= ", '$value'";
|
|
|
|
$Values .= ", '$value'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if( runSQL( "INSERT INTO `EngelType` (". substr($Keys, 2). ") VALUES (". substr($Values, 2). ")") )
|
|
|
|
if( runSQL_log( "INSERT INTO `EngelType` (". substr($Keys, 2). ") VALUES (". substr($Values, 2). ")",
|
|
|
|
|
|
|
|
"save new EngelType") )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
|
|
|
|
|
|
|
@ -95,9 +120,9 @@ case 'newsave':
|
|
|
|
$ERG = mysql_query($SQL2, $con);
|
|
|
|
$ERG = mysql_query($SQL2, $con);
|
|
|
|
|
|
|
|
|
|
|
|
if( mysql_num_rows($ERG) == 1)
|
|
|
|
if( mysql_num_rows($ERG) == 1)
|
|
|
|
runSQL( "ALTER TABLE `Room` ADD `DEFAULT_EID_".
|
|
|
|
runSQL_log( "ALTER TABLE `Room` ADD `DEFAULT_EID_". mysql_result( $ERG, 0, 0).
|
|
|
|
mysql_result( $ERG, 0, 0).
|
|
|
|
"` INT DEFAULT '0' NOT NULL;",
|
|
|
|
"` INT DEFAULT '0' NOT NULL;");
|
|
|
|
"add new EngelType in Romm Table");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
@ -145,15 +170,16 @@ case 'changesave':
|
|
|
|
$keys = substr($key,1);
|
|
|
|
$keys = substr($key,1);
|
|
|
|
$sql .= ", `".$keys."`='".$value."'";
|
|
|
|
$sql .= ", `".$keys."`='".$value."'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
runSQL( "UPDATE `EngelType` SET ". substr($sql, 2). " WHERE `TID`='". $_GET["eTID"]. "'");
|
|
|
|
runSQL_log( "UPDATE `EngelType` SET ". substr($sql, 2). " WHERE `TID`='". $_GET["eTID"]. "'",
|
|
|
|
|
|
|
|
"Save Change EngelType");
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
SetHeaderGo2Back();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case 'delete':
|
|
|
|
case 'delete':
|
|
|
|
if (IsSet($_GET["TID"]))
|
|
|
|
if (IsSet($_GET["TID"]))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
runSQL( "DELETE FROM `EngelType` WHERE `TID`='". $_GET["TID"]. "'");
|
|
|
|
runSQL_log( "DELETE FROM `EngelType` WHERE `TID`='". $_GET["TID"]. "'", "delate EngelType");
|
|
|
|
runSQL( "ALTER TABLE `Room` DROP `DEFAULT_EID_". $_GET["TID"]. "`;");
|
|
|
|
runSQL_log( "ALTER TABLE `Room` DROP `DEFAULT_EID_". $_GET["TID"]. "`;", "delate EngelType in Room Table");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
echo "Fehlerhafter Aufruf";
|
|
|
|
echo "Fehlerhafter Aufruf";
|
|
|
|
}
|
|
|
|
}
|
|
|
|