\n");
$error_message = getLanguageText('ERRORMSG-ACCESS-DENIED');
include "form.messages.php";
return;
}
?>
| School Revenue |
|
',school_name,'') as name,record_num " .
"from schools " .
"where status in ('Pending','Trial','Active') " .
"order by school_name";
$schools = db_query($query);
$results = array();
// Setup date range for schedules and orders
$this_month = date("m",time());
$this_year = date("Y",time());
$last_year = $this_year - 1;
$next_year = $this_year + 1;
if ($this_month >= '09') {
$start_date = "{$this_year}-09-01";
$end_date = "{$next_year}-08-31";
}
else {
$start_date = "{$last_year}-09-01";
$end_date = "{$this_year}-08-31";
}
$count = 0;
while ($row = db_fetch_array($schools)) {
$results[$count][0] = $row['name'];
$snum = $row['record_num'];
$results[$count][1] = db_getVal("select count(*) from users where school_num = $snum");
$results[$count][2] = db_getVal("select count(*) from people where school_num = $snum and people_type = 'Student'");
$results[$count][3] = db_getVal("select count(*) from hotlunch_schedules where school_num = $snum and status in ('Pending','Active') and schedule_start_date between '$start_date' and '$end_date'");
$results[$count][4] = db_getVal("select count(hld.record_num) from hotlunch_menu_dates as hld,hotlunch_schedules as hls " .
"where hls.school_num = $snum " .
"and hld.school_num = $snum " .
"and hls.status in ('Pending','Active') " .
"and hls.record_num = hld.schedule_num " .
"and schedule_start_date between '$start_date' and '$end_date'");
$count++;
}
listDataCustom($results,$columnHeaders,'',array(),'N',$columnAlign);
echo(" \n"); include "schools.options.php"; ?> |