function stats($what, $totalTitle, $avgTitle)
{
global $phpAds_db, $date_format, $phpAds_url_prefix,$pageid,$fncpageid;
$result = db_query("
SELECT
*,
count(*) as qnt,
DATE_FORMAT(t_stamp, '$date_format') as t_stamp_f
FROM
$what
WHERE
bannerID = $GLOBALS[bannerID]
GROUP BY
t_stamp_f
ORDER BY
t_stamp DESC
LIMIT 7
") or mysql_die();
$max = 0;
$total = 0;
while ($row = mysql_fetch_array($result))
{
if ($row["qnt"] > $max)
$max = $row["qnt"];
$total += $row["qnt"];
}
@mysql_data_seek($result, 0);
$i = 0;
while ($row = mysql_fetch_array($result))
{
$bgcolor="#F7F7F7";
$i % 2 ? 0: $bgcolor= "#ECECFF";
$i++;
?>
|
|
" height="11"> " height="11">
|
|
&bannerID=">
|
}
?>
|
|
|
|
|
printf("%.2f", $total/7);?>
|
}
?>
echo "| $strViews: | ";
stats("$phpAds_tbl_adviews", $strTotalViews7Days, $strAvgViews7Days);
echo "| $strClicks: | ";
stats("$phpAds_tbl_adclicks", $strTotalClicks7Days, $strAvgClicks7Days);
?>
|