summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcookie <cookie@29ba0400-6e00-0410-a75a-ca02368028f8>2006-04-19 18:44:12 +0000
committercookie <cookie@29ba0400-6e00-0410-a75a-ca02368028f8>2006-04-19 18:44:12 +0000
commit1b5e823923b4ce081e966ed7c4f6e978a93d6aec (patch)
tree5e0fbb4434960712ac8d6301853b054ec9496adb
parentc34780cd804df22bde3471f64d472f0a000d6164 (diff)
add logging
git-svn-id: svn://svn.cccv.de/engel-system@125 29ba0400-6e00-0410-a75a-ca02368028f8
-rwxr-xr-xwww-ssl/admin/EngelType.php44
1 files changed, 35 insertions, 9 deletions
diff --git a/www-ssl/admin/EngelType.php b/www-ssl/admin/EngelType.php
index 5e9d9974..4df21cbf 100755
--- a/www-ssl/admin/EngelType.php
+++ b/www-ssl/admin/EngelType.php
@@ -9,11 +9,14 @@ function runSQL( $SQL)
include( "./inc/db.php");
// hier muesste das SQL ausgefuehrt werden...
$Erg = mysql_query($SQL, $con);
- if ($Erg == 1) {
+ if ($Erg)
+ {
echo "&Auml;nderung wurde gesichert...<br>";
echo "[$SQL]<br>";
return 1;
- } else {
+ }
+ else
+ {
echo "Fehler beim speichern... bitte noch ein mal probieren :)";
echo "<br><br>".mysql_error( $con ). "<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 "&Auml;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";
$Erg = mysql_query($Sql, $con);
@@ -87,7 +111,8 @@ case 'newsave':
$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();
@@ -95,9 +120,9 @@ case 'newsave':
$ERG = mysql_query($SQL2, $con);
if( mysql_num_rows($ERG) == 1)
- runSQL( "ALTER TABLE `Room` ADD `DEFAULT_EID_".
- mysql_result( $ERG, 0, 0).
- "` INT DEFAULT '0' NOT NULL;");
+ runSQL_log( "ALTER TABLE `Room` ADD `DEFAULT_EID_". mysql_result( $ERG, 0, 0).
+ "` INT DEFAULT '0' NOT NULL;",
+ "add new EngelType in Romm Table");
}
break;
@@ -145,15 +170,16 @@ case 'changesave':
$keys = substr($key,1);
$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();
break;
case 'delete':
if (IsSet($_GET["TID"]))
{
- runSQL( "DELETE FROM `EngelType` WHERE `TID`='". $_GET["TID"]. "'");
- runSQL( "ALTER TABLE `Room` DROP `DEFAULT_EID_". $_GET["TID"]. "`;");
+ runSQL_log( "DELETE FROM `EngelType` WHERE `TID`='". $_GET["TID"]. "'", "delate EngelType");
+ runSQL_log( "ALTER TABLE `Room` DROP `DEFAULT_EID_". $_GET["TID"]. "`;", "delate EngelType in Room Table");
} else {
echo "Fehlerhafter Aufruf";
}