<?
    require("util.php3");
    DoTitle("ACME Party Balloons - Display Numbers of Registrations");
    $sql = new MySQL_class;
    $sql->Create("churchil_demo");
?>

<center>
<h1>Conference Registrations</h1>
</center>

<center>
<table border=1 cellpadding=5>
<tr><th bgcolor="#ffaaaa">Location</th>
    <th bgcolor="#ffaaaa">Date</th>
    <th bgcolor="#ffaaaa" colspan=2>&nbsp;</th>
    <th bgcolor="#ffaaaa">Gross $</th>
</tr>
<?
    $sql->Query("select ACME_Locations.City, ACME_Locations.State, ACME_Seminars.Time, ACME_Seminars.ID, ACME_Seminars.MaxAttend, ACME_Seminars.Attendance, ACME_Seminars.Fee from ACME_Locations, ACME_Seminars where ACME_Seminars.Location = ACME_Locations.ID order by ACME_Seminars.Time");
    for ($i = 0; $i < $sql->rows; $i++) {
        $sql->Fetch($i);
        $city = $sql->data[0];
        $state = $sql->data[1];
        $date = date("M d",MkUnixTime($sql->data[2]));
        $id = $sql->data[3];
        $max = $sql->data[4];
        $curr = $sql->data[5];
        $open = $max - $curr;
        $fee = $sql->data[6];

        echo("<tr><td><a href=\"attend2.php3?ID=$id\">$city, $state</a></td>\n");
        echo("    <td>$date</td>\n");
        if ($curr > 0) {
            echo("    <td>");
            for ($j = 0; $j < $curr; $j++) {
                echo("<img src=\"images/block.gif\" height=15 width=15 alt=\"*\">");
            }
            echo("</td>\n");
        } else {
            echo("    <td>&nbsp;</td>\n");
        }

        if (($max - $curr) <= 0) {
            echo("    <td><b>Full</b> ($curr)</td>\n");
        } else {
            echo("    <td>$curr</td>\n");
        }

        $money = $curr * $fee;
        echo("<td align=right>\$$money</td></tr>\n");
    }
?>
</table>
</center>

<p>Click on the Seminar's City/State for a full listing of who has
registered for that particular seminar.  This detailed report includes
names, addresses and payment status.

<?
    include("footer.php3");
?>
