Das zweite habe ich schon hinbekommen.
Hat Jemand ne Idee zum ersten Problem?
refübersicht.php
Ich denke aber das Problem ist, das keine aktivzeit in der DB steht.
PHP-Code:
<? userstatus();
$ebene_1 = false;
$ebene_2 = false;
$ebene_3 = false;
$ebene1 = db_query("SELECT * FROM ".$db_prefix."_werberdaten 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="'.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="'.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="'.date("d.m.y - H:i",$user1['aktivzeit']).'">';
$anz .= '
<tr class="tr_row'.$row.'">
<td align="center"><a href="?content=/nickpage&uid='.$user1['uid'].'">'.$user1['uid'].'</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 * FROM ".$db_prefix."_werberdaten 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="'.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="'.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="'.date("d.m.y - H:i",$user2['aktivzeit']).'">';
$anz2 .= '
<tr class="tr_row'.$row.'">
<td align="center"><a href="?content=/nickpage&uid='.$user2['uid'].'">'.$user2['uid'].'</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 * FROM ".$db_prefix."_werberdaten 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="'.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="'.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="'.date("d.m.y - H:i",$user3['aktivzeit']).'">';
$anz3 .= '
<tr class="tr_row'.$row.'">
<td align="center"><a href="?content=/nickpage&uid='.$user3['uid'].'">'.$user3['uid'].'</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>User</b></td>
<td align="center" width="25%"><b>Aktuell</b></td>
<td align="center" width="25%"><b>Gesamt</b></td>
<td align="center" width="20%"><b>Refback</b></td>
<td align="center" width="10%"><b>Status</b></td>
</tr>
<?=$anz;?>
</table>
<?foot();
}else{
head("Keine Refs");
echo "Keine Refs in Ebene 1";
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="20%"><b>User</b></td>
<td align="center" width="20%"><b>Werber</b></td>
<td align="center" width="25%"><b>Aktuell</b></td>
<td align="center" width="25%"><b>Gesamt</b></td>
<td align="center" width="10%"><b>Status</b></td>
</tr>
<?=$anz2;?>
</table>
<?foot();
}else{
head("Keine Refs");
echo "Keine Refs in Ebene 2";
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="20%"><b>User</b></td>
<td align="center" width="20%"><b>Werber</b></td>
<td align="center" width="25%"><b>Aktuell</b></td>
<td align="center" width="25%"><b>Gesamt</b></td>
<td align="center" width="10%"><b>Status</b></td>
</tr>
<?$anz3;?>
</table>
<?foot();
}else{
head("Keine Refs");
echo "Keine Refs in Ebene 3";
foot();
}
?>