/[libdata]/trunk/rqs.phtml
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/rqs.phtml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 71 by dpavlin, Thu Mar 4 22:43:50 2004 UTC revision 72 by dpavlin, Thu Mar 18 20:33:37 2004 UTC
# Line 37  if ($core < 1) $core = 0; Line 37  if ($core < 1) $core = 0;
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  /***********************************  /***********************************
# Line 48  if ($subject_id > 1 && $exists == 1) sub Line 48  if ($subject_id > 1 && $exists == 1) sub
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
# Line 77  if ($pf != 1) { Line 77  if ($pf != 1) {
77          }          }
78    
79          $sql .= " ORDER BY mi.masterinfotype, i.infotype";          $sql .= " ORDER BY mi.masterinfotype, i.infotype";
80          $rs = xx_query($sql, $con);          $rs = xx_tryquery($sql);
81          $rows = xx_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 = xx_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"];
# Line 93  if ($pf != 1) { Line 93  if ($pf != 1) {
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;
# Line 123  if ($pf != 1) { Line 123  if ($pf != 1) {
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 = xx_query($sql, $con);  $rs = xx_tryquery($sql);
127  $row = xx_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    
# Line 178  $sql = "SELECT Line 178  $sql = "SELECT
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
# Line 194  $sql = "SELECT Line 200  $sql = "SELECT
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 = xx_query($sql, $con);  $rs = xx_tryquery($sql);
204    
205  while ($row = xx_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"];
# Line 212  while ($row = xx_fetch_array ($rs)) { Line 218  while ($row = xx_fetch_array ($rs)) {
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    
# Line 221  while ($row = xx_fetch_array ($rs)) { Line 233  while ($row = xx_fetch_array ($rs)) {
233    
234          printf("<table><tr><td width=\"20\">&nbsp;</td>\n");          printf("<table><tr><td width=\"20\">&nbsp;</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 ) {
# Line 238  while ($row = xx_fetch_array ($rs)) { Line 250  while ($row = xx_fetch_array ($rs)) {
250                  . $resource_id                  . $resource_id
251                  . " AND rf.feature_id = f.feature_id";                  . " AND rf.feature_id = f.feature_id";
252    
253          $f_rs = xx_query($f_sql, $con);                  $f_rs = xx_tryquery($f_sql);            
254    
255    
256          while ($f_row = xx_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\">&nbsp;", $image_path, $image_alt);                  printf("<img src=\"%s\" alt=\"%s\">&nbsp;", $image_path, $image_alt);
# Line 252  while ($row = xx_fetch_array ($rs)) { Line 264  while ($row = xx_fetch_array ($rs)) {
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>&nbsp;&nbsp;&nbsp;&nbsp;<i>%s</i>", $coverage);          if (strlen($coverage) > 0) printf("<br>&nbsp;&nbsp;&nbsp;&nbsp;<i>%s</i>", $coverage);
279          if (strlen($annotation) > 0) printf("<br>%s", $annotation);          if (strlen($annotation) > 0) printf("<br>%s", $annotation);
# Line 259  while ($row = xx_fetch_array ($rs)) { Line 281  while ($row = xx_fetch_array ($rs)) {
281    
282          // Link to library holdings if something was supplied for catalog number          // Link to library holdings if something was supplied for catalog number
283          if (strlen($cat_num) > 0)          if (strlen($cat_num) > 0)
284          printf("<BR><a href=\"libdata.knjiznice.ffzg.hr\">Check Catalog</a>", $cat_num);          printf("<BR><a href=\"yourlibrarycatalog.here.edu\">Check Catalog</a>", $cat_num);
285    
286          // Swap variables          // Swap variables
287          $last_m = $masterinfotype;          $last_m = $masterinfotype;
# Line 282  $sql = "SELECT * Line 304  $sql = "SELECT *
304          subject.sublocation_id = location.location_id";          subject.sublocation_id = location.location_id";
305    
306  // Fetch the values  // Fetch the values
307  $rs = xx_query($sql, $con);  $rs = xx_tryquery($sql);
308  $row = xx_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"];
# Line 331  $sql = "SELECT * Line 353  $sql = "SELECT *
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 = xx_query($sql, $con);  $rs = xx_tryquery($sql);
357    
358  // Initialize  // Initialize
359  $rowcount = 0;  $rowcount = 0;
360    
361  while ($row = xx_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"];
# Line 387  if ($other_ps || $other_rqs) printf("<a Line 409  if ($other_ps || $other_rqs) printf("<a
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    
# Line 399  if ($othersubs > 0) { Line 421  if ($othersubs > 0) {
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    

Legend:
Removed from v.71  
changed lines
  Added in v.72

  ViewVC Help
Powered by ViewVC 1.1.26