Files
HotLunches/expiring-schools.php
T
2026-10-19 15:22:52 -07:00

148 lines
4.1 KiB
PHP

<?php
$ValidAccess = 2010;
require_once("include/globals.php");
$schoolsList = true;
$action = "schools-list";
// Start the template and output buffering
// startTemplate();
// $noTitle = 'Y';
$cutoff = date("Y-m-d",time() - 60 * 60 * 24 * 1200);
$today = date("Y-m-d",time());
$query = "SELECT * FROM schools " .
"WHERE status IN ('Active','Inactive','Deleted') " .
"AND expiry_date BETWEEN '$cutoff' AND '$today' " .
"ORDER by expiry_date DESC,school_name";
$schools = db_query($query);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hot Lunches - Schools List</title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="css/master.css" media="all">
<link rel="stylesheet" type="text/css" href="css/buttons.css" media="all">
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css" media="all">
<link rel="stylesheet" type="text/css" href="css/jquery-ui.structure.css" media="all">
<link rel="stylesheet" type="text/css" href="css/jquery-ui.theme.css" media="all">
<link rel="stylesheet" type="text/css" href="css/jquery-ui-timepicker-addon.css" media="all">
<link rel="stylesheet" type="text/css" href="css/custom.css" media="all">
<script language="JavaScript" type="text/javascript" src="include/javascript.js"></script>
<script language="JavaScript" type="text/javascript" src="include/jquery-1.11.1.js"></script>
<script language="JavaScript" type="text/javascript" src="include/jquery-ui-1.11.0.custom/jquery-ui.js"></script>
<script language="JavaScript" type="text/javascript" src="include/jquery.tablednd.js"></script>
<script language="JavaScript" type="text/javascript" src="include/jquery-ui-timepicker-addon.js"></script>
<script language="JavaScript" type="text/javascript">
var today = '2016-02-28';
</script>
<style>
body {
font: 12px Arial, Helvetica, sans-serif;
padding: 0;
}
p {
padding: 0 0 0 15px;
}
h3 {
font: 14px Arial, Helvetica, sans-serif;
font-weight: bold;
}
.country, .country a {
color: #ffffff;
background: #000000;
text-decoration: none;
}
.province, .province a {
color: #000000;
background: #cccccc;
text-decoration: none;
}
a {
color: #000000;
text-decoration: none;
}
.small {
font: 10px Arial, Helvetica, sans-serif;
}
.warning {
background-color: #ffdd33;
}
.error {
background-color: #ff0000;
}
</style>
</head>
<body>
<?php
$displayButtons = 'No';
include "schools.options.php";
echo("<center>");
echo("<p><a href='#' id='school-search' class='btn btn--primary btn--xsmall'>Search</a></p>");
echo("</center>");
echo("<br><br><table width='100%'><tr><td align='left'>\n");
echo("<div id='school-list' style='width: 900px; height: 550px; overflow-y: scroll;'>");
echo("<br>");
$count = 0;
while ($row = db_fetch_assoc($schools)) {
extract($row);
$school_num = $record_num;
$span = "<span class='show-school-info' snum='$school_num'>";
echo("<b>$expiry_date - $span$school_name</span></b> ($start_date - $status)<br>\n");
$numSchedules = db_getVal("SELECT count(*) FROM hotlunch_schedules WHERE school_num = $school_num");
echo("Schedules: $numSchedules<br>");
$query = "SELECT * FROM school_contact_list WHERE school_num = $school_num ORDER BY sequence,record_num";
$contacts = db_query($query);
while ($row = db_fetch_assoc($contacts)) {
extract($row);
echo("&nbsp;&nbsp;&nbsp;&nbsp;Name: $contact_name<br>");
echo("&nbsp;&nbsp;&nbsp;&nbsp;Phone: $contact_phone<br>");
if (strlen($contact_email)) echo("&nbsp;&nbsp;&nbsp;&nbsp;Email: <a href='mailto:$contact_email'>$contact_email</a><br>\n");
echo("<br>\n");
}
echo("<br>\n");
echo("<br>\n");
$count++;
}
echo("<br>");
echo("<br>");
echo("</div>");
echo("</td></tr></table>\n");
echo("<br>Listed Schools: $count<br><br>\n");
$schoolsList = true;
include "include/jquery.hl.php";
include "include/jquery.dialogs.php";
// endTemplate();
?>
</body>
</html>