/[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

Annotation of /trunk/admin/info_structure.phtml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 42 - (hide annotations)
Thu Mar 4 22:43:50 2004 UTC (20 years, 1 month ago) by dpavlin
File size: 3172 byte(s)
rename all mysql_ functions to xx_ so that wrapper can be used

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

  ViewVC Help
Powered by ViewVC 1.1.26