First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
header('Content-type: text/html; charset=utf8');
|
||||
|
||||
include "db.php";
|
||||
|
||||
$query = "SELECT * FROM schools WHERE status = 'Special' ORDER BY school_name";
|
||||
$schools = db_query($query);
|
||||
|
||||
$cutoff = date("Y-m-d", time() - 60 * 60 * 24 * 50);
|
||||
|
||||
$pattern = "%-60s %10s %10s %10s\n";
|
||||
printf($pattern, "School", "Parents", "Students", "Orders");
|
||||
|
||||
|
||||
while ($row = db_fetch_assoc($schools)) {
|
||||
extract($row);
|
||||
|
||||
$students = db_getVal("SELECT count(*) FROM people WHERE school_num = $record_num AND people_type = 'Student'");
|
||||
$parents = db_getVal("SELECT count(*) FROM users WHERE school_num = $record_num AND type = 'Parent'");
|
||||
$orders = db_getVal("SELECT count(*) FROM hotlunch_order_header WHERE school_num = $record_num AND added_date > '$cutoff'");
|
||||
|
||||
printf($pattern, $school_name, $parents, $students, $orders);
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user