From 71fffc65fd438adb36eca677fa5a5ad9fa242a1f Mon Sep 17 00:00:00 2001 From: cookie Date: Fri, 11 Nov 2005 23:51:00 +0000 Subject: [PATCH] add function: new entry & del entry git-svn-id: svn://svn.cccv.de/engel-system@49 29ba0400-6e00-0410-a75a-ca02368028f8 --- www-ssl/admin/userDefaultSetting.php | 68 ++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 15 deletions(-) diff --git a/www-ssl/admin/userDefaultSetting.php b/www-ssl/admin/userDefaultSetting.php index 995b3842..7dddde96 100755 --- a/www-ssl/admin/userDefaultSetting.php +++ b/www-ssl/admin/userDefaultSetting.php @@ -9,17 +9,41 @@ echo "Hallo ".$_SESSION['Nick']. ",
\nhier hast du die Möglichkeit, die Defaulteinstellungen für neue User einzustellen:

\n"; -if( isset( $_GET["Field"]) && isset( $_GET["Default"])) +if( isset( $_GET["Field"]) && isset( $_GET["Default"]) && isset( $_GET["Send"])) { - $SQL = "ALTER TABLE `UserCVS` CHANGE `". $_GET["Field"]. "` ". - "`". $_GET["Field"]. "` CHAR( 1 ) NOT NULL DEFAULT '". $_GET["Default"]. "'"; - $erg = mysql_query( $SQL, $con); - if( $erg == 1) - echo "

Write ".$_GET["Field"]. " = ". $_GET["Default"]. " succesfull

\n"; - else - echo "

Write ".$_GET["Field"]. " = ". $_GET["Default"]. " error...

\n". - "[". mysql_error(). "]

"; -} + switch( $_GET["Send"]) + { + case "New": + $SQL = "ALTER TABLE `UserCVS` ADD `". $_GET["Field"]. "` ". + "CHAR( 1 ) DEFAULT '". $_GET["Default"]. "' NOT NULL"; + $erg = mysql_query( $SQL, $con); + if( $erg == 1) + echo "

Create ".$_GET["Field"]. " = ". $_GET["Default"]. " succesfull

\n"; + else + echo "

Create ".$_GET["Field"]. " = ". $_GET["Default"]. " error...

\n". + "[". mysql_error(). "]

"; + break; + case "Del": + $SQL = "ALTER TABLE `UserCVS` DROP `". $_GET["Field"]. "` "; + $erg = mysql_query( $SQL, $con); + if( $erg == 1) + echo "

Delete ".$_GET["Field"]. " succesfull

\n"; + else + echo "

Delete ".$_GET["Field"]. " error...

\n". + "[". mysql_error(). "]

"; + break; + case "Save": + $SQL = "ALTER TABLE `UserCVS` CHANGE `". $_GET["Field"]. "` ". + "`". $_GET["Field"]. "` CHAR( 1 ) NOT NULL DEFAULT '". $_GET["Default"]. "'"; + $erg = mysql_query( $SQL, $con); + if( $erg == 1) + echo "

Write ".$_GET["Field"]. " = ". $_GET["Default"]. " succesfull

\n"; + else + echo "

Write ".$_GET["Field"]. " = ". $_GET["Default"]. " error...

\n". + "[". mysql_error(). "]

"; + break; + } //SWITCH +} //IF( $erg = mysql_query("SHOW COLUMNS FROM `UserCVS`"); echo mysql_error(); @@ -36,16 +60,30 @@ for( $i=1; $i". mysql_result( $erg, $i, "Field"). "\n"; echo "\t\t\t"; if( mysql_result( $erg, $i, "Default") == "Y") - echo "Y\t". - "\t\t\t\tN"; + echo "Y\n". + "\t\t\t N"; else - echo "Y\t". - "\t\t\t\tN"; + echo "Y\n". + "\t\t\t N"; echo "\n"; - echo "\t\t\t\n"; + echo "\t\t\t\n"; + echo "\t\t\t \n"; echo "\t\t\n"; echo "\t\n"; } + +echo "\t\n"; +echo "\t\t
\n"; +echo "\t\t\t\n"; +echo "\t\t\t\n"; +echo "\t\t\tY\t". + "\t\t\t\tN\n"; +echo "\t\t\t\n"; +echo "\t\t
\n"; +echo "\t\n"; + + + echo "\n"; include ("./inc/footer.php");