";
switch ($_GET["action"])
{
case "change":
if (IsSet($_POST["enterUID"]))
{
if ($_POST["Type"] == "Normal")
{
$SQL = "UPDATE `User` SET ";
$SQL.= " `Nick` = '". $_POST["eNick"]. "', `Name` = '". $_POST["eName"]. "', ".
"`Vorname` = '". $_POST["eVorname"]. "', ".
"`Telefon` = '". $_POST["eTelefon"]. "', ".
"`Handy` = '". $_POST["eHandy"]. "', ".
"`DECT` = '". $_POST["eDECT"]. "', ".
"`email` = '". $_POST["eemail"]. "', ".
"`Size` = '". $_POST["eSize"]. "', ".
"`Gekommen`= '". $_POST["eGekommen"]. "', ".
"`Aktiv`= '". $_POST["eAktiv"]. "', ".
"`Tshirt` = '". $_POST["eTshirt"]. "', ".
"`Hometown` = '". $_POST["Hometown"]. "', ".
"`Menu` = '". $_POST["eMenu"]. "' ".
"WHERE `UID` = '". $_POST["enterUID"].
"' LIMIT 1;";
echo "User-";
$Erg = db_query($SQL, "change user details");
if ($Erg == 1) {
echo "Änderung wurde gesichert...\n";
} else {
echo "Fehler beim speichern...\n(". mysql_error($con). ")";
}
}
if ($_POST["Type"] == "Secure")
{
$SQL2 = "UPDATE `UserCVS` SET ";
$SQL_CVS = "SELECT * FROM `UserCVS` WHERE UID=". $_POST["enterUID"];
$Erg_CVS = mysql_query($SQL_CVS, $con);
$CVS_Data = mysql_fetch_array($Erg_CVS);
$CVS_Data_i = 1;
foreach ($CVS_Data as $CVS_Data_Name => $CVS_Data_Value)
{
if( ($CVS_Data_i+1)%2 && $CVS_Data_Name!="UID")
$SQL2.= "`$CVS_Data_Name` = '". $_POST[$CVS_Data_i]."', ";
$CVS_Data_i++;
}
$SQL2 = substr( $SQL2, 0, strlen($SQL2)-2 );
$SQL2.= " WHERE `UID` = '". $_POST["enterUID"]. "' LIMIT 1;";
echo "
Secure-";
$Erg = db_query($SQL2, "change user CVS");
if ($Erg == 1) {
echo "Änderung wurde gesichert...\n";
} else {
echo "Fehler beim speichern...\n(". mysql_error($con). ")";
}
}
}
break;
case "delete":
if (IsSet($_POST["enterUID"]))
{
echo "delate User...";
$SQL="DELETE FROM `User` WHERE `UID` = '". $_POST["enterUID"]. "' LIMIT 1;";
$Erg = db_query($SQL, "User delete");
if ($Erg == 1) {
echo "Änderung wurde gesichert...\n";
} else {
echo "Fehler beim speichern...\n(". mysql_error($con). ")";
}
echo "
\ndelate UserCVS...";
$SQL2="DELETE FROM `UserCVS` WHERE `UID` = '". $_POST["enterUID"]. "' LIMIT 1;";
$Erg = db_query($SQL2, "User CVS delete");
if ($Erg == 1) {
echo "Änderung wurde gesichert...\n";
} else {
echo "Fehler beim speichern...\n(". mysql_error($con). ")";
}
echo "
\ndelate UserEntry...";
$SQL3="UPDATE `ShiftEntry` SET `UID` = '0', `Comment` = NULL ".
"WHERE `UID` = '". $_POST["enterUID"]. "' LIMIT 1;";
$Erg = db_query($SQL3, "delate UserEntry");
if ($Erg == 1) {
echo "Änderung wurde gesichert...\n";
} else {
echo "Fehler beim speichern...\n(". mysql_error($con). ")";
}
}
break;
case "newpw":
echo "Bitte neues Kennwort für ";
// Get Nick
$USQL = "SELECT * FROM User WHERE UID=". $_GET["eUID"];
$Erg = mysql_query($USQL, $con);
echo mysql_result($Erg, 0, "Nick");
echo " eingeben:
";
echo "