Code:
<? userstatus();
head("Unsere Refebenen");?>
<center>
<?
echo '
1. Ebene '.number_format($pageconfig['re1'],2,",",".").' % | 2. Ebene '.number_format($pageconfig['re2'],2,",",".").' % | 3. Ebene '.number_format($pageconfig['re3'],2,",",".").' %
';
?>
<?foot();
$ebene_1 = false;
$ebene_2 = false;
$ebene_3 = false;
$ebene1 = db_query("SELECT t1.uid, t1.aktivzeit, t1.umsatz, t1.gesamt, t1.refback, t1.werber, t2.nickname FROM ".$db_prefix."_werberdaten AS t1 LEFT JOIN ".$db_prefix."_userdaten AS t2 ON t2.uid = t1.uid WHERE werber='".$_SESSION['uid']."' ORDER BY uid ASC");
if (mysql_num_rows($ebene1)){
while ($user1 = mysql_fetch_assoc($ebene1)){
$ebene_1 = true;
$count++;
if ($count % 2 == 0){$row = 0;}else{$row = 1;}
if ($user1['aktivzeit'] >= (time()-(86400*7))) $refstatus = '<img src="./images/gruen.gif" width="15" height="15" border="0" alt="zuletzt aktiv am '.date("d.m.y - H:i",$user1['aktivzeit']).'">';
if ($user1['aktivzeit'] < (time()-(86400*7))) $refstatus = '<img src="./images/gelb.gif" width="15" height="15" border="0" alt="zuletzt aktiv am '.date("d.m.y - H:i",$user1['aktivzeit']).'">';
if ($user1['aktivzeit'] <= (time()-(86400*30))) $refstatus = '<img src="./images/rot.gif" width="15" height="15" border="0" alt="zuletzt aktiv am '.date("d.m.y - H:i",$user1['aktivzeit']).'">';
$anz .= '
<tr class="tr_row'.$row.'">
<td align="center"><a href="http://www.klamm.de/?nickpage='.$user1['uid'].'" target="_blank">'.$user1['uid'].'</a></td>
<td align="center"><a href="'.$domain.'/?content=/nickpage&id='.$user1['uid'].'">'.$user1['nickname'].'</a></td>
<td align="center">'.number_format($user1['umsatz']/100*$pageconfig['re1'],2,",",".").'</td>
<td align="center">'.number_format($user1['gesamt'],2,",",".").'</td>
<td align="center">'.$user1['refback'].' %</td>
<td align="center"><a href="?content=/konto/refdetails&ruid='.$user1['uid'].'" target="_self">'.$refstatus.'</a></td>
</tr>
';
$ebene2 = db_query("SELECT t1.uid, t1.aktivzeit, t1.umsatz, t1.gesamt, t1.werber, t2.nickname FROM ".$db_prefix."_werberdaten AS t1 LEFT JOIN ".$db_prefix."_userdaten AS t2 ON t2.uid = t1.uid WHERE werber=".$user1['uid']." ORDER BY uid ASC");
while ($user2 = mysql_fetch_assoc($ebene2)){
$ebene_2 = true;
$count++;
if ($count % 2 == 0){$row = 0;}else{$row = 1;}
if ($user2['aktivzeit'] >= (time()-(86400*7))) $refstatus = '<img src="./images/gruen.gif" width="15" height="15" border="0" alt="zuletzt aktiv am '.date("d.m.y - H:i",$user2['aktivzeit']).'">';
if ($user2['aktivzeit'] < (time()-(86400*7))) $refstatus = '<img src="./images/gelb.gif" width="15" height="15" border="0" alt="zuletzt aktiv am '.date("d.m.y - H:i",$user2['aktivzeit']).'">';
if ($user2['aktivzeit'] <= (time()-(86400*30))) $refstatus = '<img src="./images/rot.gif" width="15" height="15" border="0" alt="zuletzt aktiv am '.date("d.m.y - H:i",$user2['aktivzeit']).'">';
$anz2 .= '
<tr class="tr_row'.$row.'">
<td align="center"><a href="http://www.klamm.de/?nickpage='.$user2['uid'].'" target="_blank">'.$user2['uid'].'</a></td>
<td align="center"><a href="'.$domain.'/?content=/nickpage&id='.$user2['uid'].'">'.$user2['nickname'].'</a></td>
<td align="center">'.$user2['werber'].'</td>
<td align="center">'.number_format($user2['umsatz']/100*$pageconfig['re2'],2,",",".").'</td>
<td align="center">'.number_format($user2['gesamt'],2,",",".").'</td>
<td align="center">'.$refstatus.'</td>
</tr>
';
$ebene3 = db_query("SELECT t1.uid, t1.aktivzeit, t1.umsatz, t1.gesamt, t1.werber, t2.nickname FROM ".$db_prefix."_werberdaten AS t1 LEFT JOIN ".$db_prefix."_userdaten AS t2 ON t2.uid = t1.uid WHERE werber=".$user2['uid']." ORDER BY uid ASC");
while ($user3 = mysql_fetch_assoc($ebene3)){
$ebene_3 = true;
$count++;
if ($count % 2 == 0){$row = 0;}else{$row = 1;}
if ($user3['aktivzeit'] >= (time()-(86400*7))) $refstatus = '<img src="./images/gruen.gif" width="15" height="15" border="0" alt="zuletzt aktiv am '.date("d.m.y - H:i",$user3['aktivzeit']).'">';
if ($user3['aktivzeit'] < (time()-(86400*7))) $refstatus = '<img src="./images/gelb.gif" width="15" height="15" border="0" alt="zuletzt aktiv am '.date("d.m.y - H:i",$user3['aktivzeit']).'">';
if ($user3['aktivzeit'] <= (time()-(86400*30))) $refstatus = '<img src="./images/rot.gif" width="15" height="15" border="0" alt="zuletzt aktiv am '.date("d.m.y - H:i",$user3['aktivzeit']).'">';
$anz3 .= '
<tr class="tr_row'.$row.'">
<td align="center"><a href="http://www.klamm.de/?nickpage='.$user3['uid'].'" target="_blank">'.$user3['uid'].'</a></td>
<td align="center"><a href="'.$domain.'/?content=/nickpage&id='.$user3['uid'].'">'.$user3['nickname'].'</a></td>
<td align="center">'.$user3['werber'].'</td>
<td align="center">'.number_format($user3['umsatz']/100*$pageconfig['re3'],2,",",".").'</td>
<td align="center">'.number_format($user3['gesamt'],2,",",".").'</td>
<td align="center">'.$refstatus.'</td>
</tr>
';
}
}
}
}
?>
<?
if($ebene_1 == true){
head("Refübersicht (Ebene 1)");?>
<table width="100%" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr class="tr_head">
<td align="center" width="20%"><b>Klamm ID</b></td>
<td align="center" width="20%"><b>Nickname</b></td>
<td align="center" width="20%"><b>Aktuell</b></td>
<td align="center" width="20%"><b>Gesamt</b></td>
<td align="center" width="10%"><b>Refback</b></td>
<td align="center" width="10%"><b>Status</b></td>
</tr>
<?=$anz;?>
</table>
<?foot();
}else{
head("Keine Refs");
echo "<center><b>Keine Refs in Ebene 1</b></center>";
foot();
}
?>
<?
if ($ebene_2 == true){
head("Refübersicht (Ebene 2)");?>
<table width="100%" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr class="tr_head">
<td align="center" width="15%"><b>Klamm ID</b></td>
<td align="center" width="20%"><b>Nickname</b></td>
<td align="center" width="20%"><b>Werber</b></td>
<td align="center" width="20%"><b>Aktuell</b></td>
<td align="center" width="15%"><b>Gesamt</b></td>
<td align="center" width="10%"><b>Status</b></td>
</tr>
<?=$anz2;?>
</table>
<?foot();
}else{
head("Keine Refs");
echo "<center><b>Keine Refs in Ebene 2</b></center>";
foot();
}
?>
<?
if ($ebene_3 == true){
head("Refübersicht (Ebene 3)");?>
<table width="100%" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr class="tr_head">
<td align="center" width="15%"><b>Klamm ID</b></td>
<td align="center" width="20%"><b>Nickname</b></td>
<td align="center" width="20%"><b>Werber</b></td>
<td align="center" width="20%"><b>Aktuell</b></td>
<td align="center" width="15%"><b>Gesamt</b></td>
<td align="center" width="10%"><b>Status</b></td>
</tr>
<?=$anz3;?>
</table>
<?foot();
}else{
head("Keine Refs");
echo "<center><b>Keine Refs in Ebene 3</b></center>";
foot();
}
?>