--- trunk/page.phtml 2004/01/27 20:49:23 19
+++ branches/paul_xx/page.phtml 2004/03/18 20:01:09 69
@@ -19,7 +19,7 @@
// If stats are enabled, add a hit to the page load statistics
if ($libstats == 1) {
- pageLoadStats($con, $page_id);
+ pageLoadStats($page_id);
}
@@ -31,8 +31,8 @@
// printf("sql was: %s
", $sql);
- $rs = mysql_query($sql, $con);
- $row = mysql_fetch_array ($rs);
+ $rs = xx_tryquery($sql);
+ $row = xx_fetch_array ($rs, xx_ASSOC);
// Fetch data
$pagetype_id = $row["pagetype_id"];
@@ -98,8 +98,8 @@
**********************************************/
if ($pagetype_id == 3) {
- displayCourseHeader($con, $page_id, $pagetitle_style);
- displayCoursePers($con, $page_id);
+ displayCourseHeader($page_id, $pagetitle_style);
+ displayCoursePers($page_id);
// Display HR
printf("
\n");
@@ -130,7 +130,7 @@
** Display Table of Contents **
******************************/
if ($display_toc == 1) {
- displayTOC($con, $page_id, $wrap_toc);
+ displayTOC($page_id, $wrap_toc);
}
@@ -149,6 +149,7 @@
$sql = "SELECT * FROM element e
LEFT JOIN resource r using (resource_id)
+ LEFT JOIN vendor d on r.vendor_id = d.vendor_id
LEFT JOIN service v on e.service_id = v.service_id
LEFT JOIN location l on e.location_id = l.location_id
LEFT JOIN staff s on e.staff_id = s.staff_id
@@ -156,9 +157,9 @@
WHERE page_id = " . $page_id
. " ORDER BY e.element_order";
- $rs = mysql_query($sql, $con);
+ $rs = xx_tryquery($sql);
- while ($row = mysql_fetch_array ($rs)) {
+ while ($row = xx_fetch_array ($rs, xx_ASSOC)) {
// General element information
$element_id = $row["element_id"];
@@ -178,6 +179,12 @@
$title = $row["title"];
$call_no = $row["call_no"];
+ $guide_url = $row["guide_url"];
+ $resource_message = $row["resource_message"];
+ $resource_status = $row["resource_status"];
+ $vendor_message = $row["vendor_message"];
+ $vendor_status = $row["vendor_status"];
+
// If a location
$location_id = $row["location_id"];
$location = $row["location"];
@@ -349,11 +356,19 @@
// If a span class is being used, close it now
if ($element_size > 0) printf ("\n");
-
// Display URL if toggled and available
if (strlen($item_url) > 0 && $display_urls == 1) printf("
%s
\n", $item_url);
-
+ // Handle down/alert messages
+ if ($vendor_status > 0 || $resource_status > 0) {
+
+ printf("
\n");
+ printf("\n");
+ if (strlen($vendor_message) > 1) printf("%s\n", $vendor_message);
+ else if (strlen($resource_message) > 1) printf("%s\n", $resource_message);
+ printf("\n");
+ }
+
// Display description
if (strlen($item_descr) > 0) printf("
%s\n", $item_descr);
@@ -391,8 +406,8 @@
// Display page coordinator
if ($staff_coordinator > 0) {
- $display_page_coord = lookupStaff($con, $staff_coordinator);
- $staff_email = lookupField($con, "staff", "staff_id", $staff_coordinator, "staff_email");
+ $display_page_coord = lookupStaff($staff_coordinator);
+ $staff_email = lookupField("staff", "staff_id", $staff_coordinator, "staff_email");
if (strlen($display_page_coord) > 0 && strlen($staff_email) > 0) {
printf("\n");