--- branches/paul/page_print.phtml 2004/01/27 20:49:26 20
+++ branches/paul/page_print.phtml 2004/03/18 19:24:54 67
@@ -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);
}
@@ -32,8 +32,8 @@
// Debugging
// printf("sql was: %s
", $sql);
- $rs = mysql_query($sql, $con);
- $row = mysql_fetch_array ($rs);
+ $rs = mysql_tryquery($sql);
+ $row = mysql_fetch_array ($rs, MYSQL_ASSOC);
// Fetch data
$pagetype_id = $row["pagetype_id"];
@@ -94,8 +94,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");
@@ -125,7 +125,7 @@
** Display Table of Contents **
******************************/
if ($display_toc == 1) {
- displayTOC($con, $page_id, $wrap_toc);
+ displayTOC($page_id, $wrap_toc);
}
@@ -144,6 +144,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
@@ -151,9 +152,9 @@
WHERE page_id = " . $page_id
. " ORDER BY e.element_order";
- $rs = mysql_query($sql, $con);
+ $rs = mysql_tryquery($sql);
- while ($row = mysql_fetch_array ($rs)) {
+ while ($row = mysql_fetch_array ($rs, MYSQL_ASSOC)) {
// General element information
$element_id = $row["element_id"];
@@ -173,6 +174,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"];
@@ -344,12 +351,20 @@
printf ("%s", $item_display);
// If a span class is being used, close it now
- if ($element_size > 0) printf ("\n");
-
+ if ($element_size > 0) printf ("\n");
// Display URL if toggled and available
if (strlen($printable_url) > 0 && $display_urls == 1) printf("
%s\n", $printable_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);
@@ -389,8 +404,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");