33 lines
898 B
PHP
33 lines
898 B
PHP
<?php
|
|
include "db.php";
|
|
|
|
$school_year = "2011/2012";
|
|
|
|
$query = "SELECT * FROM schools WHERE status = 'Active' ORDER BY school_name";
|
|
$schools = db_query($query);
|
|
|
|
while ($row = db_fetch_array($schools)) {
|
|
extract($row);
|
|
$school_num = $record_num;
|
|
$school_status = $status;
|
|
|
|
$currInvoice = "";
|
|
$total = 0;
|
|
$results = db_query("SELECT * FROM invoice_header WHERE school_num = $school_num AND school_year = '$school_year'");
|
|
|
|
if (db_num_rows($results)) {
|
|
$row = db_fetch_array($results);
|
|
extract($row);
|
|
|
|
if ($status == 'Paid') {
|
|
db_query("UPDATE schools SET expiry_date = '2012-07-31' where record_num = $school_num");
|
|
}
|
|
}
|
|
|
|
$notice = "";
|
|
if ($system_configuration == 'Full' && $total == 300.00) $notice = "**";
|
|
printf("%-50s %-10s %-10s %6.2f %-7s %s\n",$school_name,$school_status,$system_configuration,$total,$status,$notice);
|
|
}
|
|
|
|
?>
|