Komplett sieht das bei mir so aus:
Datei: adminforce/content/usersystem/userbearbeiten.php
Code:
<?
if ($_POST['uid']) $_GET['uid'] = $_POST['uid'];
// Daten updaten
if ($_POST['updaten']) {
foreach ($_POST as $name => $value) {
if (strlen(strstr($name, '|')) > 1) {
$exp = explode ('|', $name);
if ($exp[0] && $exp[1] && $exp[0] != 'buchung') {
db_query ("UPDATE ".$db_prefix."_".$exp[0]." SET `".$exp[1]."` = '".$value."' WHERE uid = ".$_POST['uid']);
}
}
}
if ($_POST['werberdaten|werber'] != $_POST['alt_werber'] and $_POST['werberdaten|werber'] != $_POST['uid']) {
db_query("UPDATE ".$db_prefix."_werberdaten SET werber='".$_POST['werberdaten|werber']."', umsatz='0', zuordnungszeit='0', reset='0', resetzeit='0', gesamt='0', refback='0', aktivzeit='0' WHERE uid='".$_POST['uid']."'");
}
if ($_POST['buchungssumme'] > 0 && $_POST['buchungssumme']) {
$_POST['buchungssumme'] = trim ($_POST['buchungssumme']);
$buchungs_id = create_code(14);
buchungsliste ($buchungs_id, $_POST['buchungsart'].''.$_POST['buchungssumme'], $_POST['buchungstext'].' (Admin)', $_POST['uid']);
db_query ("UPDATE ".$db_prefix."_kontodaten SET kontostand = kontostand ".$_POST['buchungsart']." ".$_POST['buchungssumme']." WHERE uid = '".$_POST['uid']."'");
}
}
if ($_POST['deluser'] && $_POST['deluser'] > 0) {
if ($_POST['deluser'] == '2') {
$sperrzeit = time()+(86400*365);
db_query("INSERT INTO ".$db_prefix."_userblacklist (uid,zeit) VALUES ('".$_POST['uid']."','".$sperrzeit."')");
}
db_query("DELETE FROM ".$db_prefix."_kontodaten WHERE uid=".$_GET['uid']."");
db_query("DELETE FROM ".$db_prefix."_emaildaten WHERE uid=".$_GET['uid']."");
db_query("DELETE FROM ".$db_prefix."_userdaten WHERE uid=".$_GET['uid']."");
db_query("DELETE FROM ".$db_prefix."_werberdaten WHERE uid=".$_GET['uid']."");
db_query("UPDATE ".$db_prefix."_werberdaten SET werber = 0 WHERE werber=".$_GET['uid']."");
echo '<meta http-equiv="refresh" content="0; URL=\'?content=/usersystem/liste\'">';
}
// Daten einlesen
$userdaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userdaten WHERE uid='".$_GET['uid']."' LIMIT 1"));
$emaildaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_emaildaten WHERE uid='".$_GET['uid']."' LIMIT 1"));
$kontodaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_kontodaten WHERE uid='".$_GET['uid']."' LIMIT 1"));
$werberdaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_werberdaten WHERE uid='".$_GET['uid']."' LIMIT 1"));
?>