userbearbeiten.php
PHP-Code:
<?
// Variabeln
if (!isset($_POST['updaten'])) $_POST['updaten'] = '';
if (!isset($_POST['uid'])) $_POST['uid'] = '';
if (!isset($_POST['buchungssumme'])) $_POST['buchungssumme'] = '';
// Daten updaten
if ($_POST['updaten'] == 'Updaten !') {
if ($_POST['status'] != 'loeschen') {
db_query("UPDATE ".$db_prefix."_kontodaten SET status='".$_POST['status']."', klicken = '".$_POST['klicken']."', hinweis ='".$_POST['hinweis']."', ks_ausgeschlossen = '".$_POST['ks_ausgeschlossen']."' WHERE uid='".$_POST['uid']."'");
db_query("UPDATE ".$db_prefix."_kontodaten SET status='".$_POST['status']."', hinweis ='".$_POST['hinweis']."',ks_ausgeschlossen = '".$_POST['ks_ausgeschlossen']."' WHERE uid='".$_POST['uid']."'");
db_query("UPDATE ".$db_prefix."_userdaten SET nickname='".$_POST['nickname']."',vorname='".$_POST['vorname']."', nachname='".$_POST['nachname']."',pnsperre='".$_POST['pnsperre']."', geschlecht='".$_POST['geschlecht']."' WHERE uid='".$_POST['uid']."'");
db_query("UPDATE ".$db_prefix."_emaildaten SET emailadresse='".$_POST['emailadresse']."', freigabe_fuer='".$_POST['freigabe_fuer']."' WHERE uid='".$_POST['uid']."'");
db_query("UPDATE ".$db_prefix."_userdaten SET a_free='".$_POST['a_free']."' WHERE uid='".$_POST['uid']."'");
if ($_POST['werber'] != $_POST['alt_werber'] and $_POST['werber'] != $_POST['uid']) db_query("UPDATE ".$db_prefix."_werberdaten SET werber='".$_POST['werber']."', umsatz='0', zuordnungszeit='".time()."', reset='0', resetzeit='0', gesamt='0', refback='0', aktivzeit='0' WHERE uid='".$_POST['uid']."'");
if ($_POST['buchungssumme'] >0 and $_POST['buchungssumme']) {
$buchungs_id = create_code(14);
buchungsliste ($buchungs_id,$_POST['buchungsart'].''.$_POST['buchungssumme'],$_POST['buchungstext'].' (Admin)',$_POST['uid']);
kontobuchung ($_POST['buchungsart'],$_POST['buchungssumme'],$_POST['uid']);
}
} else {
$sperrzeit = time()+(86400*365);
$werber = mysql_fetch_array (db_query ("SELECT werber FROM ".$db_prefix."_werberdaten WHERE uid = '".$_POST['uid']."' LIMIT 1"));
mysql_query("UPDATE ".$db_prefix."_werberdaten SET werber = '".$werber['werber']."' WHERE werber = '".$_POST['uid']."'") or die(mysql_error());
db_query("INSERT INTO ".$db_prefix."_userblacklist (uid,zeit,nickname) VALUES ('".$_POST['uid']."','".$sperrzeit."','".$_POST['nickname']."')");
db_query("DELETE FROM ".$db_prefix."_kontodaten WHERE uid=".$_POST['uid']."");
db_query("DELETE FROM ".$db_prefix."_emaildaten WHERE uid=".$_POST['uid']."");
db_query("DELETE FROM ".$db_prefix."_userdaten WHERE uid=".$_POST['uid']."");
db_query("DELETE FROM ".$db_prefix."_werberdaten WHERE uid=".$_POST['uid']."");
db_query("UPDATE ".$db_prefix."_werberdaten SET werber = 0 WHERE werber=".$_POST['uid']."");
echo '<meta http-equiv="refresh" content="0; URL=http://'.$_SERVER['HTTP_HOST'].'/adminforce/?content=/usersystem/liste">';
}
}
// Daten einlesen
$kontodaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_kontodaten WHERE uid='".$_GET['uid']."' LIMIT 1"));
$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"));
$werberdaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_werberdaten WHERE uid='".$_GET['uid']."' LIMIT 1"));
?>
<? head("Bearbeiten des Users ".$_GET['uid']); ?>
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<form action="" method="post">
<tr>
<td width="55%" align="right"><b>Userstatus</b></td>
<td align="left">
<select name="status" size="1">
<option value="0" <?if ($kontodaten['status'] == 0) echo'SELECTED';?>>Wartend</option>
<option value="1" <?if ($kontodaten['status'] == 1) echo'SELECTED';?>>Freigeschaltet</option>
<option value="2" <?if ($kontodaten['status'] == 2) echo'SELECTED';?>>Gesperrt</option>
<option value="loeschen">User löschen</option>
</select> </td>
</tr>
<tr>
<td align="right"><b>User-Id / Kontonummer</b></td>
<td align="left">
<?=$kontodaten['uid'];?>
</td>
</tr>
<tr>
<td align="right" width="55%"><b>Pn-sperre</b></td>
<td align="left">
<select name="pnsperre" size="1">
<option value="0" <?if ($userdaten['pnsperre'] == 0) echo'SELECTED';?>>Nein</option>
<option value="1" <?if ($userdaten['pnsperre'] == 1) echo'SELECTED';?>>Gesperrt</option>
</select>
</td>
</tr>
<tr>
<td align="right"><b>Werber</b></td>
<td align="left">
<input type="Text" name="werber" value="<?=$werberdaten['werber'];?>"></td>
</tr>
<tr>
<td align="right"><b>Nickname</b></td>
<td align="left">
<input type="Text" name="nickname" value="<?=$userdaten['nickname'];?>"></td>
</tr>
<tr>
<td align="right"><b>Vorname</b></td>
<td align="left">
<input type="Text" name="vorname" value="<?=$userdaten['vorname'];?>"></td>
</tr>
<tr>
<td align="right"><b>Nachname</b></td>
<td align="left">
<input type="Text" name="nachname" value="<?=$userdaten['nachname'];?>"></td>
</tr>
<tr>
<td align="right"><b>Emailadresse</b></td>
<td align="left">
<input type="Text" name="emailadresse" value="<?=$emaildaten['emailadresse'];?>"></td>
</tr>
<tr>
<td align="right"><b>Kontostand</b></td>
<td align="left">
<?=number_format($kontodaten['kontostand'],2,",",".");?>
<?=$waehrung;?>
</td>
</tr>
<tr>
<td align="right"><b>Geschlecht</b></td>
<td align="left">
<select name="geschlecht" size="1">
<option value="0" <?if ($userdaten['geschlecht'] == 0) echo'SELECTED';?>>N/A</option>
<option value="1" <?if ($userdaten['geschlecht'] == 1) echo'SELECTED';?>>Männlich</option>
<option value="2" <?if ($userdaten['geschlecht'] == 2) echo'SELECTED';?>>Weiblich</option>
</select> </td>
</tr>
<tr>
<td align="right"><b>Email Empfangsstatus</b></td>
<td align="left">
<select name="freigabe_fuer" size="1">
<option value="0" <?if ($emaildaten['freigabe_fuer'] == 0) echo'SELECTED';?>>Kein
Empfang</option>
<option value="1" <?if ($emaildaten['freigabe_fuer'] == 1) echo'SELECTED';?>>Nur
Newsletter</option>
<option value="2" <?if ($emaildaten['freigabe_fuer'] == 2) echo'SELECTED';?>>Nur
Paidmails</option>
<option value="3" <?if ($emaildaten['freigabe_fuer'] == 3) echo'SELECTED';?>>Newsletter
/ Paidmails</option>
</select> </td>
</tr>
<tr>
<td align="right"><b>Auzahlungs Status</b></td>
<td align="left">
<?
$a_free= mysql_fetch_array(db_query("SELECT a_free AS free FROM ".$db_prefix."_userdaten WHERE uid=".$_GET['uid']));?>
<select name="a_free" size="1">
<option value="0" <?if ($a_free['free'] == 0) echo'SELECTED';?>>Gesperrt</option>
<option value="1" <?if ($a_free['free'] == 1) echo'SELECTED';?>>Freigegeben</option>
</select> </td>
</tr>
<tr>
<td align="right" width="55%"><b>Forcedfakeschutz:</b></td>
<td align="left">
<select name="ks_ausgeschlossen" size="1">
<option value="0" <?if ($kontodaten['ks_ausgeschlossen'] == 0) echo'SELECTED';?>>nimmt teil</option>
<option value="1" <?if ($kontodaten['ks_ausgeschlossen'] == 1) echo'SELECTED';?>>nimmt nicht teil</option>
</select>
</td>
</tr>
<tr>
<td align="right"><b>Klicken erlauben</b></td>
<td align="left">
<select name="klicken" size="1">
<option value="1" <?if ($kontodaten['klicken'] == 1) echo'SELECTED';?>>Gesperrt</option>
<option value="0" <?if ($kontodaten['klicken'] == 0) echo'SELECTED';?>>Freigegeben</option>
</select> </td>
</tr>
<tr>
<td align="right" valign="top"><b>Sperrtext</b></td>
<td align="left">
<textarea name="hinweis" style="width:250px; height:100px;"><?=$kontodaten['hinweis'];?></textarea>
</td>
</tr>
<tr>
<td width="55%" align="right"><b>Buchungsart</b></td>
<td align="left">
<select name="buchungsart" size="1">
<option value="+" SELECTED>Gutschreiben</option>
<option value="-">Abziehen</option>
</select> </td>
</tr>
<tr>
<td align="right"><b>Buchungssumme</b></td>
<td align="left">
<input type="Text" name="buchungssumme" value="">
ohne Vorzeichen!</td>
</tr>
<tr>
<td height="27" align="right"><b>Buchungstext</b></td>
<td align="left">
<input type="Text" name="buchungstext" value="" maxlength="30">
max. 30 Zeichen!</tr>
</td>
<?
$mail = mysql_fetch_array(db_query("SELECT COUNT(uid) AS mail FROM ".$db_prefix."_paidmails_empfaenger where status='0' and uid=".$_GET['uid'].""));
?>
<tr>
<td align="right"><b>Mails heute bekommen:</b></td>
<td align="left""><?=number_format($userdaten['mail_heute'],0,",",".");?></td>
</tr>
<tr>
<td align="right"><b>Paidmails im Postkorb:</b></td>
<td align="left""><?=number_format($mail['mail'],0,",",".");?></td>
</tr>
<td><?
$mail = mysql_fetch_array(db_query("SELECT COUNT(uid) AS mails FROM ".$db_prefix."_paidmails_empfaenger where uid=".$_GET['uid'].""));
$maila = mysql_fetch_array(db_query("SELECT COUNT(uid) AS maila FROM ".$db_prefix."_paidmails_empfaenger where status='0' and uid=".$_GET['uid'].""));
$mailb = mysql_fetch_array(db_query("SELECT COUNT(uid) AS mail FROM ".$db_prefix."_paidmails_empfaenger where status='1' and uid=".$_GET['uid'].""));
$paidmail = $mail['mails'] - $mailb['mail'];
@$prozentbest=$mailb['mail']/$mail['mails']*100;
$prozentunbest=100-$prozentbest;
$prozentunbest=round($prozentunbest,2);
$prozentbest=round($prozentbest,2);
?>
<tr>
<br><td align="right"><b>Paidmails unbestätigt:</b></td>
<td align="left""><?=number_format($maila['maila'],0,",",".");?> (<?=$prozentunbest;?> %)</td>
</tr>
<tr>
<td align="right"><b>Paidmails bestätigt:</b></td>
<td align="left""><?=number_format($mailb['mail'],0,",",".");?> (<?=$prozentbest;?> %)</td>
</tr>
<tr>
<td align="right"><b>Paidmails gesamt:</b></td>
<td align="left""><?=number_format($mail['mails'],0,",",".");?></td>
</tr> </td>
</tr>
<tr>
<td align="right"> </td>
<td align="left"> </td>
</tr>
<tr>
<td align="right"><strong>Startseiten aufrufe</strong></td>
<td align="left">
<?=$kontodaten['s_aufrufe'];?>
||| <strong>Verdienst</strong>:
<?=$kontodaten['s_verdienst'];?>
</td>
</tr>
<tr>
<td align="right"><strong>Angebettelt</strong></td>
<td align="left">
<?=$kontodaten['angebettelt'];?>
||| <strong>Verdienst</strong>:
<?=$kontodaten['bv'];?>
</td>
</tr>
<tr>
<td align="right"><strong>Forced klicks</strong></td>
<td align="left">
<?=$kontodaten['klicks'];?>
||| <strong>Verdienst</strong>:
<?=$kontodaten['kv'];?>
</td>
</tr>
<tr>
<td align="right"><strong>Paid links</strong></td>
<td align="left">
<?=$kontodaten['textlinks'];?>
||| <strong>Verdienst</strong>:
<?=$kontodaten['tlv'];?>
</td>
</tr>
<tr>
<td align="right"> </td>
<td align="left"> </td>
</tr>
<tr>
<td align="right"><strong>Login IP</strong>:</td>
<td align="left">
<?=$kontodaten['login_ip'];?>
</td>
</tr>
<tr>
<td align="right"> </td>
<td align="left"> </td>
</tr>
<tr>
<tr>
<td align="center" colspan="2">
<a href="?content=/usersystem/buchungen&uid=<?=$_GET['uid'];?>" target="_self">Kontobuchungen</a><br>
<a href="?content=/usersystem/buchungen1&uid=<?=$_GET['uid'];?>" target="_self">Mailbuchungen</a><br>
<a href="?content=/usersystem/buchungen_spiele&uid=<?=$_GET['uid'];?>" target="_self">Spielbuchungen</a><br>
<a href="?content=/usersystem/buchungen_extern&uid=<?=$_GET['uid'];?>" target="_self">Transferbuchungen</a><br>
<br>
<input type="Submit" name="updaten" value="Updaten !"> </td>
</tr>
<input type="Hidden" name="uid" value="<?=$kontodaten['uid'];?>">
<input type="Hidden" name="alt_werber" value="<?=$werberdaten['werber'];?>">
</form>
</table>
<? foot(); ?>
nachrichtensenden.php
PHP-Code:
<?
// Variabeln definieren
if (!isset($_POST['sendto'])) $_POST['sendto'] = "";
if (!isset($_POST['an'])) $_GET['an'] = "";
$uidnick = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userdaten WHERE nickname = '$empfaenger' LIMIT 1"));
$mailaddy = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_emaildaten WHERE uid = ".$uidnick['uid']." LIMIT 1"));
if($_POST['sendto'] == "Nachricht senden"){
if(!$_POST['betreff'] ) $fehler .= 'Sie haben den Betreff nicht angegeben <br>';
if(!$_POST['empfaenger'] ) $fehler .= 'Es fehlt die angabe des Empängers <br>';
if ($fehler)
{
$messages= $fehler;
}
else{
$time=time();
$sql="INSERT INTO ".$db_prefix."_nachrichten (absender,empfaenger,betreff,text,time,gelesen) VALUES ('$nickname','$empfaenger','$betreff','$text','$time','0')";
$result=db_query($sql);
$messages= 'Nachricht erfolgreich gesendet ';
$messagesPN= '
Hallo '.$empfaenger.'
Sie haben eine Nachricht voM '.$nickname.' bekommen.
Loggen sie sich bitte in Ihrem Account ein:
'.$domain.'
Mit freundlichen Grüßen
Das '.$seitenname.' Team';
@mail($mailaddy['emailadresse'], 'Sie haben eine neue Pn bei '.$seitenname ,$messagesPN , 'FROM: '.$seitenname.' <'.$betreibermail.'>') or die('Versandfehler');
}
}
?>
<?head ("");
?>
<center> <table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='500' id='AutoNumber1' height='129'>
<form action="" method="post">
<tr>
<td width='100%' colspan='5' height='20'><center><font color="green"><?= $messages;?></font></center></td>
<tr>
<tr>
<td width='100%' colspan='5' height='20'>
<p align='center'><font face='Arial' style='font-size: 9pt'><b>Nachricht
schreiben</b></font></td>
</tr>
<tr>
<td width='20%' height='20'> </td>
<td width='20%' height='20'> </td>
<td width='20%' height='20'> </td>
<td width='20%' height='20'> </td>
<td width='20%' height='20'> </td>
</tr>
<tr>
<td width='20%' height='20'><font face='Arial' style='font-size: 9pt'>Von:</font></td>
<td width='80%' colspan='4' height='20'>
<font color'green' face='Arial' style='font-size: 9pt'><input type='text' name='nickname' size='20'readonly value='Admin'></font></td>
</tr>
</tr>
<tr>
<td width='20%' height='20'><font face='Arial' style='font-size: 9pt'>An:</font></td>
<td width='80%' colspan='4' height='20'>
<font face='Arial' style='font-size: 9pt'>
<input type='text' name='empfaenger' size='20' value='<?= $an;?>'></font></td>
</tr>
<tr>
<td width='20%' height='20'><font face='Arial' style='font-size: 9pt'>
Betreff:</font></td>
<td width='80%' colspan='4' height='20'>
<font face='Arial' style='font-size: 9pt'>
<input type='text' name='betreff' size='51' value='<?= $betreff;?>'></font></td>
</tr>
<tr>
<td width='20%' height='20'> </td>
<td width='20%' height='20'> </td>
<td width='20%' height='20'> </td>
<td width='20%' height='20'> </td>
<td width='20%' height='20'> </td>
</tr>
<tr>
<td width='20%' height='20'><font face='Arial' style='font-size: 9pt'>
Text:</font></td>
<td width='80%' colspan='4' height='20'> </td>
</tr>
<tr>
<td width='100%' height='20' colspan='5'>
<font face='Arial' style='font-size: 9pt'>
<textarea rows='8' name='text' cols='60'></textarea></font></td>
</tr>
<tr>
<td width='100%' height='20' colspan='5'> </td>
</tr>
<tr>
<td width='100%' height='20' colspan='5'>
<p align='center'><font face='Arial'><span style='font-size: 9pt'>
<input type='reset' value='Nachricht verwerfen' name='B2'>
<input type='submit' value='Nachricht senden' name='sendto'></span></font></td>
</tr>
</form>
</table>
<br>
<?
foot();
?>
support.php
PHP-Code:
<?
if(isset($_REQUEST['antworten']) == 1) {
db_query("INSERT INTO ".$db_prefix."_support (uid,subid,betreff,text,zeit) VALUES ('".$_GET['uid']."','".$_REQUEST['id']."','".$_POST['betreff']."','".$_POST['antwort']."','".time()."')");
db_query("UPDATE ".$db_prefix."_support SET status=1 WHERE id='".$_REQUEST['id']."'");
}
if(isset($_REQUEST['act']) == "show") {
$sql = db_query("SELECT * FROM ".$db_prefix."_support WHERE uid='".$_GET['uid']."' AND subid=0 AND id='".$_REQUEST['id']."'");
if(mysql_num_rows($sql) > 0) {
$res = mysql_fetch_array($sql);
head("Anfrage von ".$res['uid']);
?>
<table width="100%" cellpadding="5" cellspacing="1" border="0">
<tr bgcolor="#467DA3" style="color: #ffffff;">
<td width="100%"><b><? echo $res['betreff']; ?><b></td>
</tr>
<tr bgcolor="#FAE5C4">
<td><font face="Courier New" size="2"><? echo nl2br($res['text']); ?><hr size="1" color="#000000" width="95%"><div align="right"><font size=1><? echo date("d.m.Y H:i", $res['zeit']); ?></font></div></font></td>
</tr>
</table>
<?
foot();
head("Antworten");
$repsql = db_query("SELECT * FROM ".$db_prefix."_support WHERE uid='".$_GET['uid']."' AND subid=".$_REQUEST['id']." ORDER BY zeit ASC");
while($reply = mysql_fetch_array($repsql)) {
?>
<table width="100%" cellpadding="5" cellspacing="1" border="0">
<tr bgcolor="#467DA3" style="color: #ffffff;">
<td width="100%"><b><? echo $reply['betreff']; ?><b></td>
</tr>
<tr bgcolor="#FAE5C4">
<td><font face="Courier New" size="2"><? echo nl2br($reply['text']); ?><hr size="1" color="#000000" width="95%"><div align="right"><font size=1><? echo date("d.m.Y H:i", $reply['zeit']); ?></font></div></font></td>
</tr>
</table>
<br />
<?
}
if(mysql_num_rows($repsql) == 0) { ?><center><font class="hinweis"><b>Noch keine Antworten vorhanden!</b></font></center><? }
foot();
if($res['status'] != 2) {
head("Eine Antwort schreiben");
?><div align="center">
<table border="0" cellpadding="4" cellspacing="0" align="center">
<form action="?content=/usersystem/support&uid=<? echo $_GET['uid']; ?>&id=<? echo $_REQUEST['id']; ?>&antworten=1" method="POST">
<tr>
<td width="30%">
Betreff: <br />
<input type="text" name="betreff" size="60" maxlength="255" value="RE: <? echo $res['betreff']; ?>"></td>
</tr>
<tr>
<td>
Antwort: <br />
<textarea name="antwort" cols="60" rows="8"></textarea>
</td>
</tr>
</table>
<p align="center">
<input type="submit" class="button" value="Antworten">
<input type="reset" class="button" value="Zurücksetzen">
</form>
</p></div>
<?
foot();
} else {
head("Hinweis!");
?><center><font class="hinweis"><b>Thema geschlossen. Keine Antwort mehr möglich !</b></font></center><?
foot();
}
} else {
head("Fehler!");
?><center><font class="hinweis"><b>Falsche Ticket-ID übergeben!</b></font></center><?
foot();
} }
if(!isset($_REQUEST['act'])) {
$sql = db_query("SELECT * FROM ".$db_prefix."_support WHERE subid=0 AND status=0");
head("Bisherige Supportanfragen");
?>
<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr bgcolor="#467DA3" style="color: #ffffff;">
<td align="center" width="5%"><b>ID<b></td>
<td align="center" width="60%"><b>Betreff<b></td>
<td align="center" width="20%"><b>Status<b></td>
<td align="center" width="15%"><b>Datum<b></td>
</tr>
<?
if(mysql_num_rows($sql) > 0) {
while($ticket = mysql_fetch_array($sql)) {
if($ticket['status'] == 0) { $status = "Unbeantwortet"; }
if($ticket['status'] == 1) { $status = "Beantwortet"; }
if($ticket['status'] == 2) { $status = "Geschlossen"; }
?>
<tr bgcolor="#FAE5C4">
<td align="center"><? echo $ticket['id']; ?></td>
<td><a href="?content=/usersystem/support&act=show&uid=<? echo $ticket['uid']; ?>&id=<? echo $ticket['id']; ?>"><? echo $ticket['betreff']; ?></a></td>
<td align="center"><? echo $status; ?></td>
<td align="center"><? echo date("d.m.Y H:i", $ticket['zeit']); ?></td>
</tr>
<?
} } else {
?>
<tr bgcolor="#FAE5C4">
<td align="center" colspan="4"><font class="hinweis"><b>Keine unbeantworteten Supportanfragen vorhanden !</b></font><br /></td>
</tr>
<? } ?>
</table>
<?
foot();
}
?>