nachfrage beim loeschen, Setzen fuer alle user

git-svn-id: svn://svn.cccv.de/engel-system@176 29ba0400-6e00-0410-a75a-ca02368028f8
main
cookie 18 years ago
parent 7842bc18a5
commit 6590196f7b

@ -8,6 +8,10 @@ include ("./inc/funktion_db_list.php");
echo "Hallo ".$_SESSION['Nick'].
",<br>\nhier hast du die M&ouml;glichkeit, die Defaulteinstellungen f&uuml;r neue User einzustellen:<br><br>\n";
echo "<table border=\"0\" class=\"border\">\n";
echo "\t<tr class=\"contenttopic\">\n";
echo "\t\t<th>Page</th>\n\t\t<th>Show</th>\n\t\t<th></th>\n";
echo "\t</tr>\n";
if( isset( $_GET["Field"]) && isset( $_GET["Default"]) && isset( $_GET["Send"]))
{
@ -16,27 +20,44 @@ if( isset( $_GET["Field"]) && isset( $_GET["Default"]) && isset( $_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)
$Erg = mysql_query( $SQL, $con);
if( $Erg == 1)
echo "<H2>Create ".$_GET["Field"]. " = ". $_GET["Default"]. " succesfull</h2>\n";
else
echo "<H2>Create ".$_GET["Field"]. " = ". $_GET["Default"]. " error...</h2>\n".
"[". mysql_error(). "]<br><br>";
break;
case "Del":
echo "\t<tr class=\"content\">\n";
echo "\t\t<form action=\"userDefaultSetting.php\">\n";
echo "\t\t\t<td><input name=\"Field\" type=\"text\" value=\"". $_GET["Field"]. "\" readonly></td>\n";
echo "\t\t\t<td><input name=\"Default\" type=\"text\" value=\"". $_GET["Default"]. "\" readonly></td>\n";
echo "\t\t\t<td><input type=\"submit\" name=\"Send\" value=\"Del sure\"></td>\n";
echo "\t\t</form>\n";
echo "\t</tr>\n";
break;
case "Del sure":
$SQL = "ALTER TABLE `UserCVS` DROP `". $_GET["Field"]. "` ";
$erg = mysql_query( $SQL, $con);
if( $erg == 1)
$Erg = mysql_query( $SQL, $con);
if( $Erg == 1)
echo "<H2>Delete ".$_GET["Field"]. " succesfull</h2>\n";
else
echo "<H2>Delete ".$_GET["Field"]. " error...</h2>\n".
"[". mysql_error(). "]<br><br>";
break;
case "SetForAllUser":
$SQL = "UPDATE `UserCVS` SET `". $_GET["Field"]. "` = '". $_GET["Default"]. "'";
$Erg = mysql_query( $SQL, $con);
if( $Erg == 1)
echo "<H2>UPDATE ".$_GET["Field"]. " = ". $_GET["Default"]. " for all Users succesfull</h2>\n";
else
echo "<H2>UPDATE ".$_GET["Field"]. " = ". $_GET["Default"]. " for all Users error...</h2>\n".
"[". mysql_error(). "]<br><br>";
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)
$Erg = mysql_query( $SQL, $con);
if( $Erg == 1)
echo "<H2>Write ".$_GET["Field"]. " = ". $_GET["Default"]. " succesfull</h2>\n";
else
echo "<H2>Write ".$_GET["Field"]. " = ". $_GET["Default"]. " error...</h2>\n".
@ -45,13 +66,10 @@ if( isset( $_GET["Field"]) && isset( $_GET["Default"]) && isset( $_GET["Send"]))
} //SWITCH
} //IF(
$erg = mysql_query("SHOW COLUMNS FROM `UserCVS`");
echo mysql_error();
echo "<table border=\"0\" class=\"border\">\n";
echo "\t<tr class=\"contenttopic\">\n";
echo "\t\t<th>Page</th>\n\t\t<th>Show</th>\n\t\t<th></th>\n";
echo "\t</tr>\n";
for( $i=1; $i<mysql_num_rows($erg); $i++)
{
echo "\t<tr class=\"content\">\n";
@ -67,7 +85,8 @@ for( $i=1; $i<mysql_num_rows($erg); $i++)
"\t\t\t <input type=\"radio\" name=\"Default\" value=\"N\" checked>N";
echo "</td>\n";
echo "\t\t\t<td><input type=\"submit\" name=\"Send\" value=\"Save\">\n";
echo "\t\t\t <input type=\"submit\" name=\"Send\" value=\"Del\"></td>\n";
echo "\t\t\t <input type=\"submit\" name=\"Send\" value=\"Del\">\n";
echo "\t\t\t <input type=\"submit\" name=\"Send\" value=\"SetForAllUser\"></td>\n";
echo "\t\t</form>\n";
echo "\t</tr>\n";
}

Loading…
Cancel
Save