/[libdata]/branches/paul/subject.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 /branches/paul/subject.phtml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations)
Fri Dec 5 18:40:01 2003 UTC (20 years, 3 months ago) by dpavlin
File size: 2760 byte(s)
initial import of libdata version 1.04

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 header
12 printf("<html>\n");
13 printf("<head>\n");
14 printf("<title>Research QuickStart+: Subject Page</title>\n");
15 printf("</head>\n");
16
17
18 // Page header
19 require_once ("header.phtml");
20
21 /**********************************
22 ** Display user's subject choice **
23 **********************************/
24
25 $sql = "SELECT subject, description FROM subject WHERE subject_id = "
26 . $subject_id;
27 $rs = mysql_query($sql, $con);
28 $row = mysql_fetch_array ($rs);
29 $subject = $row["subject"];
30 $description = $row["description"];
31
32 printf("<h2>Research QuickStart+ Subject Resources: %s</h2>", $subject);
33 printf("<b>Subject Description:</b> %s<br><br>", $description);
34
35
36 /***************************
37 ** Generate the resources **
38 ***************************/
39
40 printf("<center>\n");
41 printf("<table width =\"80%%\">\n");
42 printf("<tr><td>\n");
43 printf("<font face = \"Arial\">\n");
44
45
46 $sql = "SELECT
47 rsi.description,
48 m.masterinfotype,
49 i.infotype,
50 r.resource_id,
51 r.title,
52 r.author,
53 r.annotation,
54 r.url,
55 r.cat_num
56 FROM res_sub_infotype_d rsi,
57 infotype i, masterinfotype m, resource r
58 WHERE
59 rsi.subject_id = "
60 . $subject_id
61 . " AND rsi.masterinfotype_id = m.masterinfotype_id AND
62 rsi.infotype_id = i.infotype_id AND
63 rsi.masterinfotype_id = m.masterinfotype_id AND
64 rsi.resource_id = r.resource_id
65 ORDER BY m.masterinfotype, i.infotype, r.title";
66
67 $rs = mysql_query($sql, $con);
68
69 // printf("sql was: %s<BR><BR>", $sql);
70
71 while ($row = mysql_fetch_array ($rs)) {
72
73 // Fetch information types for this subject
74 $masterinfotype = $row["masterinfotype"];
75 $infotype = $row["infotype"];
76 $title = $row["title"];
77 $author = $row["author"];
78 $annotation = $row["annotation"];
79 $resource_id = $row["resource_id"];
80 $url = $row["url"];
81 $cat_num = $row["cat_num"];
82
83
84 // Header info
85 if ($last_m != $masterinfotype) printf("<h3>%s</h3>", $masterinfotype);
86 if ($last_i != $infotype) printf("<b>%s</b><br><br>", $infotype);
87
88 // Display
89 printf("Title: %s<br>", $title);
90 if (strlen($url) > 0 ) printf ("URL: <a href=\"%s\">%s</a><BR>", $url, $url);
91 printf("Description: ");
92 if (strlen($description) > 0) printf("<i>%s</i> ", $description);
93 else printf("<i>%s</i> ", $annotation);
94
95 // Link to ALEPH
96 if (strlen($cat_num) > 0)
97 printf("<BR><a href=\"yourlibrarycatalog.here.edu\">Check Catalog</a>", $cat_num);
98
99 printf("<BR><a href = \"resource.phtml?subject_id=%s&resource_id=%s\">[Detail]</a><BR><BR>", $subject_id, $resource_id);
100
101
102 $last_m = $masterinfotype;
103 $last_i = $infotype;
104 }
105
106 printf("</td></tr></table></center>\n");
107
108
109 // Page footer
110 require_once ("footer.phtml");
111 ?>
112 </center>
113 </body>
114 </html>

  ViewVC Help
Powered by ViewVC 1.1.26