37 |
// Initialize |
// Initialize |
38 |
$subject_id = (int) $subject_id; |
$subject_id = (int) $subject_id; |
39 |
$exists = 0; |
$exists = 0; |
40 |
$exists = existsRow($con, "subject", "subject_id", $subject_id); |
$exists = existsRow("subject", "subject_id", $subject_id); |
41 |
|
|
42 |
// If this subject is valid, increment stats |
// If this subject is valid, increment stats |
43 |
if ($subject_id > 1 && $exists == 1) subLoadStats($con, $subject_id); |
if ($subject_id > 1 && $exists == 1) subLoadStats($subject_id); |
44 |
|
|
45 |
|
|
46 |
/*********************************** |
/*********************************** |
48 |
***********************************/ |
***********************************/ |
49 |
|
|
50 |
// Determine if there are related PageScribe or RQS pages |
// Determine if there are related PageScribe or RQS pages |
51 |
$other_ps = existsRow($con, "sub_page", "subject_id", $subject_id); |
$other_ps = existsRow("sub_page", "subject_id", $subject_id); |
52 |
$other_rqs = existsRow($con, "sub_othersub", "subject_id", $subject_id); |
$other_rqs = existsRow("sub_othersub", "subject_id", $subject_id); |
53 |
|
|
54 |
|
|
55 |
// if printer friendly version don't print the TOC |
// if printer friendly version don't print the TOC |
77 |
} |
} |
78 |
|
|
79 |
$sql .= " ORDER BY mi.masterinfotype, i.infotype"; |
$sql .= " ORDER BY mi.masterinfotype, i.infotype"; |
80 |
$rs = mysql_query($sql, $con); |
$rs = xx_tryquery($sql); |
81 |
$rows = mysql_num_rows($rs); |
$rows = xx_num_rows($rs); |
82 |
|
|
83 |
// initialize |
// initialize |
84 |
$last_masterinfotype_id = 0; |
$last_masterinfotype_id = 0; |
85 |
$rowcount = 0; |
$rowcount = 0; |
86 |
|
|
87 |
while ($row = mysql_fetch_array ($rs)) { |
while ($row = xx_fetch_array ($rs, xx_ASSOC)) { |
88 |
|
|
89 |
// Fetch information types for this subject |
// Fetch information types for this subject |
90 |
$infotype_id = $row["infotype_id"]; |
$infotype_id = $row["infotype_id"]; |
93 |
$masterinfotype = $row["masterinfotype"]; |
$masterinfotype = $row["masterinfotype"]; |
94 |
|
|
95 |
if ($last_masterinfotype_id == 0 || ($last_masterinfotype_id != $masterinfotype_id)) { |
if ($last_masterinfotype_id == 0 || ($last_masterinfotype_id != $masterinfotype_id)) { |
96 |
printf("</ul><span class=\"small\"><b><a href=\"rqs.phtml?subject_id=%d#m%d\">%s</a></b></span><br>\n", $subject_id, $masterinfotype_id, $masterinfotype); |
printf("</ul><b><span class=\"small\"><a href=\"rqs.phtml?subject_id=%d#m%d\">%s</a></b></span><br>\n", $subject_id, $masterinfotype_id, $masterinfotype); |
97 |
printf("<ul>\n"); |
printf("<ul>\n"); |
98 |
} |
} |
99 |
|
|
100 |
printf("<li><b class=\"small\"><a href=\"#i%d\">%s</a></b></li>\n", $infotype_id, $infotype); |
printf("<li><span class=\"small\"><b><a href=\"#i%d\">%s</a></b></span></li>\n", $infotype_id, $infotype); |
101 |
|
|
102 |
// Swap & increment |
// Swap & increment |
103 |
$last_masterinfotype_id = $masterinfotype_id; |
$last_masterinfotype_id = $masterinfotype_id; |
123 |
$sql = "SELECT subject, subject_descr FROM subject WHERE subject_id = " |
$sql = "SELECT subject, subject_descr FROM subject WHERE subject_id = " |
124 |
. $subject_id; |
. $subject_id; |
125 |
|
|
126 |
$rs = mysql_query($sql, $con); |
$rs = xx_tryquery($sql); |
127 |
$row = mysql_fetch_array ($rs); |
$row = xx_fetch_array ($rs, xx_ASSOC); |
128 |
$subject = $row["subject"]; |
$subject = $row["subject"]; |
129 |
$subject_descr = $row["subject_descr"]; |
$subject_descr = $row["subject_descr"]; |
130 |
|
|
178 |
r.url, |
r.url, |
179 |
r.call_no, |
r.call_no, |
180 |
r.coverage_detail, |
r.coverage_detail, |
181 |
r.cat_num |
r.cat_num, |
182 |
|
r.guide_url, |
183 |
|
r.resource_status, |
184 |
|
r.resource_message, |
185 |
|
v.vendor_status, |
186 |
|
v.vendor_message |
187 |
FROM res_sub_infotype rsi, |
FROM res_sub_infotype rsi, |
188 |
infotype i, masterinfotype m, resource r |
infotype i, masterinfotype m, resource r |
189 |
|
LEFT JOIN vendor v on r.vendor_id = v.vendor_id |
190 |
WHERE |
WHERE |
191 |
rsi.subject_id = " |
rsi.subject_id = " |
192 |
. $subject_id |
. $subject_id |
200 |
rsi.resource_id = r.resource_id |
rsi.resource_id = r.resource_id |
201 |
ORDER BY m.masterinfotype, i.infotype, r.title"; |
ORDER BY m.masterinfotype, i.infotype, r.title"; |
202 |
|
|
203 |
$rs = mysql_query($sql, $con); |
$rs = xx_tryquery($sql); |
204 |
|
|
205 |
while ($row = mysql_fetch_array ($rs)) { |
while ($row = xx_fetch_array ($rs, xx_ASSOC)) { |
206 |
|
|
207 |
// Fetch information types for this subject |
// Fetch information types for this subject |
208 |
$masterinfotype = $row["masterinfotype"]; |
$masterinfotype = $row["masterinfotype"]; |
218 |
$call_no = $row["call_no"]; |
$call_no = $row["call_no"]; |
219 |
$coverage = $row["coverage_detail"]; |
$coverage = $row["coverage_detail"]; |
220 |
$description = $row["description"]; |
$description = $row["description"]; |
221 |
|
|
222 |
|
$guide_url = $row["guide_url"]; |
223 |
|
$resource_message = $row["resource_message"]; |
224 |
|
$resource_status = $row["resource_status"]; |
225 |
|
$vendor_message = $row["vendor_message"]; |
226 |
|
$vendor_status = $row["vendor_status"]; |
227 |
|
|
228 |
if (strlen($description) > 0) $annotation = $description; |
if (strlen($description) > 0) $annotation = $description; |
229 |
|
|
233 |
|
|
234 |
printf("<table><tr><td width=\"20\"> </td>\n"); |
printf("<table><tr><td width=\"20\"> </td>\n"); |
235 |
printf("<td valign=\"top\"><img src=\"images/bullet.gif\" alt=\"\"></td>\n"); |
printf("<td valign=\"top\"><img src=\"images/bullet.gif\" alt=\"\"></td>\n"); |
236 |
printf("<td class=\"small\">\n"); |
printf("<td>\n"); |
237 |
|
|
238 |
// Display the resource |
// Display the resource |
239 |
if (strlen($url) > 0 ) { |
if (strlen($url) > 0 ) { |
250 |
. $resource_id |
. $resource_id |
251 |
. " AND rf.feature_id = f.feature_id"; |
. " AND rf.feature_id = f.feature_id"; |
252 |
|
|
253 |
$f_rs = mysql_query($f_sql, $con); |
$f_rs = xx_tryquery($f_sql); |
254 |
|
|
255 |
|
|
256 |
while ($f_row = mysql_fetch_array ($f_rs)) { |
while ($f_row = xx_fetch_array ($f_rs, xx_ASSOC)) { |
257 |
$image_path = $f_row["image_path"]; |
$image_path = $f_row["image_path"]; |
258 |
$image_alt = $f_row["image_alt"]; |
$image_alt = $f_row["image_alt"]; |
259 |
printf("<img src=\"%s\" alt=\"%s\"> ", $image_path, $image_alt); |
printf("<img src=\"%s\" alt=\"%s\"> ", $image_path, $image_alt); |
264 |
printf("<br>%s\n", $url); |
printf("<br>%s\n", $url); |
265 |
} |
} |
266 |
|
|
267 |
|
// Handle down/alert messages |
268 |
|
if ($vendor_status > 0 || $resource_status > 0) { |
269 |
|
|
270 |
|
printf("<br><img src =\"images/chain.jpg\" alt=\"Resource Temporarily Unavailable\">\n"); |
271 |
|
printf("<span class=\"error\">\n"); |
272 |
|
if (strlen($vendor_message) > 1) printf("%s<br>\n", $vendor_message); |
273 |
|
else if (strlen($resource_message) > 1) printf("%s<br>\n", $resource_message); |
274 |
|
printf("</span>\n"); |
275 |
|
} |
276 |
|
|
277 |
// Display other items |
// Display other items |
278 |
if (strlen($coverage) > 0) printf("<br> <i>%s</i>", $coverage); |
if (strlen($coverage) > 0) printf("<br> <i>%s</i>", $coverage); |
279 |
if (strlen($annotation) > 0) printf("<br>%s", $annotation); |
if (strlen($annotation) > 0) printf("<br>%s", $annotation); |
304 |
subject.sublocation_id = location.location_id"; |
subject.sublocation_id = location.location_id"; |
305 |
|
|
306 |
// Fetch the values |
// Fetch the values |
307 |
$rs = mysql_query($sql, $con); |
$rs = xx_tryquery($sql); |
308 |
$row = mysql_fetch_array ($rs); |
$row = xx_fetch_array ($rs, xx_ASSOC); |
309 |
$location_id = $row["location_id"]; |
$location_id = $row["location_id"]; |
310 |
$location = $row["location"]; |
$location = $row["location"]; |
311 |
$location_descr = $row["location_descr"]; |
$location_descr = $row["location_descr"]; |
353 |
sub_loc.location_id = location.location_id"; |
sub_loc.location_id = location.location_id"; |
354 |
|
|
355 |
// Fetch the values |
// Fetch the values |
356 |
$rs = mysql_query($sql, $con); |
$rs = xx_tryquery($sql); |
357 |
|
|
358 |
// Initialize |
// Initialize |
359 |
$rowcount = 0; |
$rowcount = 0; |
360 |
|
|
361 |
while ($row = mysql_fetch_array ($rs)) { |
while ($row = xx_fetch_array ($rs, xx_ASSOC)) { |
362 |
|
|
363 |
$location_id = $row["location_id"]; |
$location_id = $row["location_id"]; |
364 |
$location = $row["location"]; |
$location = $row["location"]; |
409 |
/**************************************************************** |
/**************************************************************** |
410 |
** Hunt for related subject pages & display them if they exist ** |
** Hunt for related subject pages & display them if they exist ** |
411 |
****************************************************************/ |
****************************************************************/ |
412 |
$othersubs = existsRow($con, "sub_othersub", "subject_id", $subject_id); |
$othersubs = existsRow("sub_othersub", "subject_id", $subject_id); |
413 |
|
|
414 |
if ($othersubs > 0) { |
if ($othersubs > 0) { |
415 |
printf("<table cellpadding=\"10\"><tr><td bgcolor=\"#dcdcdc\" class=\"small\"><h4>Related RQS Pages</h4>\n"); |
printf("<table cellpadding=\"10\"><tr><td bgcolor=\"#dcdcdc\" class=\"small\"><h4>Related RQS Pages</h4>\n"); |
416 |
displayRelatedSubjects($con, $subject_id); |
displayRelatedSubjects($subject_id); |
417 |
print "</td></tr></table><br>\n"; |
print "</td></tr></table><br>\n"; |
418 |
} |
} |
419 |
|
|
421 |
/******************************************************************* |
/******************************************************************* |
422 |
** Hunt for related PageScribe pages & display them if they exist ** |
** Hunt for related PageScribe pages & display them if they exist ** |
423 |
*******************************************************************/ |
*******************************************************************/ |
424 |
$pages = existsRow($con, "sub_page", "subject_id", $subject_id); |
$pages = existsRow("sub_page", "subject_id", $subject_id); |
425 |
|
|
426 |
if ($pages > 0) { |
if ($pages > 0) { |
427 |
printf("<table cellpadding=\"10\"><tr><td bgcolor=\"#dcdcdc\" class=\"small\"><h4>Related PageScribe Pages</h4>\n"); |
printf("<table cellpadding=\"10\"><tr><td bgcolor=\"#dcdcdc\" class=\"small\"><h4>Related PageScribe Pages</h4>\n"); |
428 |
displayRelatedPages($con, $subject_id); |
displayRelatedPages($subject_id); |
429 |
print "</td></tr></table>\n"; |
print "</td></tr></table>\n"; |
430 |
} |
} |
431 |
|
|