/[libdata]/trunk/resource.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

Contents of /trunk/resource.phtml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations)
Fri Dec 5 18:34:18 2003 UTC (17 years, 9 months ago) by dpavlin
File size: 2219 byte(s)
Initial revision

1 <?php
2 // Load globals
3 require_once ("global_vars.php");
4
5
6 // Includes
7 require_once ("db_connect.php");
8 require_once ("public_controls.php");
9 ?>
10
11 <html>
12 <head>
13 <title>Resource QuickStart+: Resource Detail</title>
14 </head>
15
16
17 <center>
18
19
20 <?php
21
22 // Use library public interface header -- not LibHouse staff-side header
23 require_once ("header.phtml");
24
25 // Build the resource detail-level SQL
26 $sql = "SELECT * FROM
27 resource r,
28 res_sub_infotype rsi,
29 subject s
30 WHERE r.resource_id = " . $resource_id . " AND
31 rsi.subject_id = " . $subject_id . " AND
32 r.resource_id = rsi.resource_id";
33
34
35 $rs = mysql_query($sql, $con);
36 $row = mysql_fetch_array ($rs);
37
38 // Fetch rows
39 $title = $row["title"];
40 $author = $row["author"];
41 $publisher = $row["publisher"];
42 $pub_date = $row["pub_date"];
43 $call_no = $row["call_no"];
44 $cat_num = $row["cat_num"];
45 $description = $row["description"];
46 $annotation = $row["annotation"];
47 $url = $row["url"];
48
49 printf("<center>\n");
50 printf("<h2>%s</h2>\n", $title);
51
52 printf("<table bgcolor = \"#ffffff\" width=\"75%%\">\n");
53
54 if (strlen($url) > 0) printf("<tr><td><b>URL:</b></td><td><a href=\"%s\">%s</a></td></tr>\n", $url, $url);
55
56 // Fetch locations for this resource
57 $locations = locationList($con, $resource_id);
58 if (strlen($locations) > 0) printf("<tr><td><b>Location:</b></td><td>%s</td></tr>\n", $locations);
59
60 if (strlen($author) > 0) printf("<tr><td><b>Author:</b></td><td>%s</td></tr>\n", $author);
61 if (strlen($publisher) > 0 ) printf("<tr><td><b>Publisher:</b></td><td>%s</td></tr>\n", $publisher);
62 if (strlen($pub_date) > 0)printf("<tr><td><b>Pub Date:</b></td><td>%s</td></tr>\n", $pub_date);
63
64 // Use default annotation if no description supplied
65 if (strlen($description) > 0 || strlen($annotation) > 0) {
66 printf("<tr><td valign=\"top\"><b>Description:</b></td><td>\n");
67 if (strlen($description) > 0) printf ("%s", $description);
68 else printf("%s", $annotation);
69 printf("</td></tr>\n");
70 }
71
72 if (strlen($call_no) > 0) printf("<tr><td><b>Call Number:</b></td><td>%s</td></tr>\n", $call_no);
73 if (strlen($cat_num) > 0) printf("<tr><td><b>Catalog Number:</b></td><td>%s</td></tr>\n", $cat_num);
74
75 printf("</table></center>\n");
76
77
78 // Page footer
79 require_once ("footer.phtml");
80 ?>
81
82 </body>
83 </html>

  ViewVC Help
Powered by ViewVC 1.1.26