/[libdata]/trunk/admin/info_structure.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/admin/info_structure.phtml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 72 - (show annotations)
Thu Mar 18 20:33:37 2004 UTC (20 years, 1 month ago) by dpavlin
File size: 3365 byte(s)
changes made in version 2.00

1 <?php
2 // Load globals
3 require_once ("global_vars.php");
4
5 // Includes
6 require_once ($GLOBAL_ADMIN_INC."sessionClass.php");
7 require_once ($GLOBAL_ADMIN_INC."accessClass.php");
8 require_once ($GLOBAL_ADMIN_INC."db_connect.php");
9 require_once ($GLOBAL_ADMIN_INC."app_controls.php");
10
11
12 // HTML header
13 printf("<HTML>\n");
14 printf("<HEAD>\n");
15 printf("<title>Information Structure Summary</title>\n");
16 printf("<link rel=\"stylesheet\" href=\"%s\" type=\"text/css\">\n", $GLOBAL_ADMIN_CSS);
17 printf("</HEAD>\n");
18
19
20 // Default access settings
21 $sess_time_human = "";
22 $sess_staff_account = "";
23 $sess_staff_id = 0;
24 $sess_access_level = 0;
25 $sess_access = "";
26 $sess_last_name = "";
27 $sess_first_name = "";
28
29
30 // Page header
31 require_once ($GLOBAL_ADMIN_HEADER);
32
33
34 // Collect access information
35 if(isset($libsession)) {
36
37 // Fetch session information
38 $sessionClass = new sessionClass("", $libsession, "", "");
39 $accessClass = new accessClass($sessionClass);
40
41 // Load user session variables
42 $sess_time_human = $sessionClass->time_human;
43 $sess_staff_account = $sessionClass->staff_account;
44 $sess_access_level = $accessClass->access_level;
45 $sess_access = $accessClass->access;
46 $sess_last_name = $accessClass->last_name;
47 $sess_first_name = $accessClass->first_name;
48
49 }
50
51 // If the cookie is set and access level is appropriate
52 if(isset($libsession) && $sess_access_level >= 20) {
53
54
55 printf("<center>\n");
56 printf("<h3>Information Structure Summary</h3>");
57
58 printf("<table width = \"75%%\" border=\"1\"><tr>\n");
59 printf("<td width=\"30%%\" class=\"cellPlain\">Master Subject</td>\n");
60 printf("<td width=\"70%%\" class=\"cellPlain\">Master -> Base Information Type</td>\n");
61 printf("</tr>\n");
62
63 // Build the query
64 $sql = "SELECT
65 mastersubject_id,
66 mastersubject
67 FROM mastersubject
68 ORDER BY mastersubject";
69 $rs = xx_tryquery($sql);
70
71 // Initialize counter
72 $rowcount = 0;
73
74 // Cycle through the result set
75 while ( $row = xx_fetch_array ($rs, xx_ASSOC)) {
76 $mastersubject_id = Trim($row["mastersubject_id"]);
77 $mastersubject = Trim($row["mastersubject"]);
78
79 // New row
80 printf("<tr>\n");
81
82 // Mastersubject
83 printf("<td valign=\"top\" class =\"backLight\">%s</td>\n", $mastersubject);
84 printf("<td>\n");
85
86 // Emulate a subselect
87 $sub_sql = "SELECT
88 i.infotype_id,
89 i.infotype,
90 m.masterinfotype_id,
91 m.masterinfotype
92 FROM
93 infotype i,
94 masterinfotype m
95 WHERE
96 i.masterinfotype_id = m.masterinfotype_id AND
97 i.mastersubject_id = "
98 . $mastersubject_id
99 . " ORDER BY m.masterinfotype, i.infotype";
100
101 $sub_rs = xx_tryquery($sub_sql);
102 $sub_rowcount = 0;
103
104 // Cycle through the result set
105 while ( $sub_row = xx_fetch_array ($sub_rs, xx_ASSOC)) {
106 $masterinfotype = Trim($sub_row["masterinfotype"]);
107 $infotype = Trim($sub_row["infotype"]);
108
109 // Masterinfotype
110 printf("%s -> ", $masterinfotype);
111
112 // Infotype
113 printf("%s<br>", $infotype);
114
115 $sub_rowcount++;
116
117 }
118
119 // None found message
120 if ($sub_rowcount < 1) printf("(No unique assignments for this master subject.)");
121
122 // Close cell and row
123 printf("</td></tr>\n");
124 }
125
126
127 // Close table
128 printf("</table><br><br>\n");
129
130
131 // Link to return to admin console
132 adminReturn($sess_access_level);
133
134 } // logged in
135
136 // No access page
137 else require_once ($GLOBAL_NO_ACCESS);
138
139
140 // Page footer
141 require_once ($GLOBAL_ADMIN_FOOTER);
142 ?>
143
144 </body>
145 </html>
146

  ViewVC Help
Powered by ViewVC 1.1.26