
It makes a really basic table looking like this for all the days youve been accepting signups (this forum wont let me print tables)
Day Date .............# Signups
Thu 26 Feb 2004......4 [] [] [] []
Fri 27 Feb 2004.......3 [] [] []
put this in admin.php and link to it from the main admin page using <a href=\"index.php?do=stats\">Daily Signups</a>
- Code: Select all
if ($do == 'stats') {//by www.hm/yourname.com, displaysdaily signup stats
$main="<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"450\" align=\"center\">
<tr>
<td><b>Your Statistics</b></td>
</tr>
<tr>
<td>
<table cellspacing=\"0\" cellpadding=\"2\" border=\"1\" width=\"400\" align=\"center\">
<tr>
<td><b>Day</b></td><td><b>Date</b></td><td><b>#</b></td><td><b>Signups</b></td>
</tr>
<tr>
<td>
";
$listusers=mysql_query("SELECT * FROM $redir_table ORDER BY time ASC");// LIMIT 0,5");
$users=mysql_num_rows($listusers);
$count = 1;
if ($users < 1) {
$main.="An error has occurred<br>";
} else {
while($rowusers=mysql_fetch_array($listusers)) {
//$host=$rowusers[host];
$date=$rowusers[time];
$dateday = date('d', $date);
$datedaytext = date('D', $date);
$datedisp = date("d M Y", $date);
if ($dateday == $lastday)
{$count = $count +1;}
else
{
$main.="$datedaytext</td><td> $datedisp</td><td>$count </td><td>";
while($count > 0){$main.=" []" ; $count =$count-1;}
$main.="</td></tr><tr><td>";
$count = 1;}
$lastday = $dateday;
}
}
$main.="</td></tr></table>
<p align=\"center\"><b><a href=\"index.php\">Back to the main page</a></b></p>
</td>
</tr>
</table>";
$template = new MyredTemplate("../template/template.php");
$template->assign("TITLE", $pagetitle);
$template->assign("MENU", $menu);
$template->assign("MAIN", $main);
$template->myred_print() or die($template->error);
exit;
}