<?php
$today = date('j');
$thismonth = date('m');
$thisyear = date('Y');
$result = mysql_query("select my_tc_templates.username from my_tc_templates where substring(my_tc_templates.template, $today, 1) = 'F' and year = $thisyear and month = $thismonth") or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$toons = $row[username];
if($toons)$i++;
}
echo "<table bgcolor=#00FF00>";
echo "<tr>";
echo "<td>$i Gtg!</td>";
echo "</tr>";
echo "</table>";
echo "<hr/>";
$result2 = mysql_query("select count(*),my_tc_user_group.groupname from my_tc_user_group,my_tc_templates where substring(my_tc_templates.template, $today, 1) = 'F' and year = $thisyear and month = $thismonth and my_tc_templates.username = my_tc_user_group.username group by groupname") or die(mysql_error());
while ($row = mysql_fetch_assoc($result2)) {
echo "{$row['groupname']}: {$row['count(*)']}<br/>";
}
echo "<hr />";
$result3 = mysql_query("select my_tc_templates.username, my_tc_user_group.groupname from my_tc_user_group,my_tc_templates where substring(my_tc_templates.template, $today, 1) = 'F' and year = $thisyear and month = $thismonth and my_tc_templates.username = my_tc_user_group.username group by username order by groupname, username asc
") or die(mysql_error());
$previous = '';
while ($row = mysql_fetch_assoc($result3)) {
if($previous != $row['groupname']) {echo "<b>{$row['groupname']}</b><br/>";
}
echo "- {$row['username']} <br/>";
$previous = $row['groupname'];
}
$result4 = mysql_query("select my_tc_templates.username from my_tc_templates where substring(my_tc_templates.template, $today, 1) = 'D' and year = $thisyear and month = $thismonth") or die(mysql_error());
echo "<br/>The following signed up as Maybe:";
while ($row = mysql_fetch_array($result4)) {
$maybe = $row[username];
echo " {$maybe}, ";
}
?>