Hi,
so hab ich das bei mir gelöst:
Forcedbanner
PHP-Code:
$fstats_gesamt = mysql_fetch_array(db_query("SELECT COUNT(tan) AS ganzahl, SUM(verdienst) AS gverdienst, SUM(aufendhalt) AS gaufenthalt FROM ".$db_prefix."_gebuchte_werbung WHERE werbeart = 'forcedbanner' AND menge > 0 AND status = 1 AND verdienst > 0 AND sponsor != '".$_SESSION['uid']."'")) OR die(mysql_error());
$fstats_uebrig = mysql_fetch_array(db_query("SELECT COUNT(t1.tan) AS uanzahl, SUM(t1.verdienst) AS uverdienst FROM ".$db_prefix."_gebuchte_werbung AS t1 LEFT OUTER JOIN ".$db_prefix."_reloads AS t2 ON (t2.tan = t1.tan AND (t2.uid = ".$_SESSION['uid']." OR t2.ip = '".$ip."') AND t2.bis >= '".time()."') WHERE t2.tan IS NULL AND t1.werbeart = 'forcedbanner' AND t1.menge > 0 AND t1.status = 1 AND t1.verdienst > 0 AND t1.sponsor != '".$_SESSION['uid']."'")) OR die(mysql_error());
echo '
<center>
<table cellspacing="4" cellpadding="0">
<tr>
<td align="center">Forcedbanner gesamt: '.$fstats_gesamt['ganzahl'].'</td>
<td> </td>
<td align="center">Forcedbanner uebrig: '.$fstats_uebrig['uanzahl'].'</td>
</tr>
<tr>
<td align="center">Ø Aufenthalt: '.number_format($fstats_gesamt['gaufenthalt']/$fstats_gesamt['ganzahl'],2,',','.').' Sekunden</td>
<td> </td>
<td align="center">Ø Vergütung: '.number_format($fstats_gesamt['gverdienst']/$fstats_gesamt['ganzahl'],2,',','.').' '.$waehrung.'</td>
</tr>
<tr>
<td align="center">Gesamtwert: '.$fstats_gesamt['gverdienst'].' '.$waehrung.'</td>
<td> </td>
<td align="center">Offen: '.$fstats_uebrig['uverdienst'].' '.$waehrung.'</td>
</tr>
</table>
</center>
<hr>';
High-Forcedbanner
PHP-Code:
$fstats_gesamt = mysql_fetch_array(db_query("SELECT COUNT(tan) AS ganzahl, SUM(verdienst) AS gverdienst, SUM(aufendhalt) AS gaufenthalt FROM ".$db_prefix."_gebuchte_werbung WHERE werbeart = 'highforced' AND menge > 0 AND status = 1 AND verdienst > 0 AND sponsor != '".$_SESSION['uid']."'")) OR die(mysql_error());
$fstats_uebrig = mysql_fetch_array(db_query("SELECT COUNT(t1.tan) AS uanzahl, SUM(t1.verdienst) AS uverdienst FROM ".$db_prefix."_gebuchte_werbung AS t1 LEFT OUTER JOIN ".$db_prefix."_reloads AS t2 ON (t2.tan = t1.tan AND (t2.uid = ".$_SESSION['uid']." OR t2.ip = '".$ip."') AND t2.bis >= '".time()."') WHERE t2.tan IS NULL AND t1.werbeart = 'highforced' AND t1.menge > 0 AND t1.status = 1 AND t1.verdienst > 0 AND t1.sponsor != '".$_SESSION['uid']."'")) OR die(mysql_error());
echo '
<center>
<table cellspacing="4" cellpadding="0">
<tr>
<td align="center">HighForcedbanner gesamt: '.$fstats_gesamt['ganzahl'].'</td>
<td> </td>
<td align="center">HighForcedbanner uebrig: '.$fstats_uebrig['uanzahl'].'</td>
</tr>
<tr>
<td align="center">Ø Aufenthalt: '.number_format($fstats_gesamt['gaufenthalt']/$fstats_gesamt['ganzahl'],2,',','.').' Sekunden</td>
<td> </td>
<td align="center">Ø Vergütung: '.number_format($fstats_gesamt['gverdienst']/$fstats_gesamt['ganzahl'],2,',','.').' '.$waehrung.'</td>
</tr>
<tr>
<td align="center">Gesamtwert: '.$fstats_gesamt['gverdienst'].' '.$waehrung.'</td>
<td> </td>
<td align="center">Offen: '.$fstats_uebrig['uverdienst'].' '.$waehrung.'</td>
</tr>
</table>
</center>
<hr>';
Paidlinks:
PHP-Code:
$fstats_gesamt = mysql_fetch_array(db_query("SELECT COUNT(tan) AS ganzahl, SUM(verdienst) AS gverdienst, SUM(aufendhalt) AS gaufenthalt FROM ".$db_prefix."_gebuchte_werbung WHERE werbeart = 'paidlinks' AND menge > 0 AND status = 1 AND verdienst > 0 AND sponsor != '".$_SESSION['uid']."'")) OR die(mysql_error());
$fstats_uebrig = mysql_fetch_array(db_query("SELECT COUNT(t1.tan) AS uanzahl, SUM(t1.verdienst) AS uverdienst FROM ".$db_prefix."_gebuchte_werbung AS t1 LEFT OUTER JOIN ".$db_prefix."_reloads AS t2 ON (t2.tan = t1.tan AND (t2.uid = ".$_SESSION['uid']." OR t2.ip = '".$ip."') AND t2.bis >= '".time()."') WHERE t2.tan IS NULL AND t1.werbeart = 'paidlinks' AND t1.menge > 0 AND t1.status = 1 AND t1.verdienst > 0 AND t1.sponsor != '".$_SESSION['uid']."'")) OR die(mysql_error());
echo '
<center>
<table cellspacing="4" cellpadding="0">
<tr>
<td align="center">Paidlinks gesamt: '.$fstats_gesamt['ganzahl'].'</td>
<td> </td>
<td align="center">Paidlinks uebrig: '.$fstats_uebrig['uanzahl'].'</td>
</tr>
<tr>
<td align="center">Ø Aufenthalt: '.number_format($fstats_gesamt['gaufenthalt']/$fstats_gesamt['ganzahl'],2,',','.').' Sekunden</td>
<td> </td>
<td align="center">Ø Vergütung: '.number_format($fstats_gesamt['gverdienst']/$fstats_gesamt['ganzahl'],2,',','.').' '.$waehrung.'</td>
</tr>
<tr>
<td align="center">Gesamtwert: '.$fstats_gesamt['gverdienst'].' '.$waehrung.'</td>
<td> </td>
<td align="center">Offen: '.$fstats_uebrig['uverdienst'].' '.$waehrung.'</td>
</tr>
</table>
</center>
<hr>';
Gruß
Marco