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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (hide annotations)
Fri Dec 5 18:34:18 2003 UTC (20 years, 5 months ago) by dpavlin
File size: 3141 byte(s)
Initial revision

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>Master Information Type Drilldown</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     // Fetch the information type descr. field
45     $masterinfotype = lookupField($con, "masterinfotype", "masterinfotype_id", $masterinfotype_id, "masterinfotype");
46    
47     printf("<center>\n");
48     printf("<h3>Master Information Type '%s' (#%d) contains the the following specific Information Types:</h3>", $masterinfotype, $masterinfotype_id);
49    
50    
51     // RQS Usage Drilldowns
52     printf("<table width = \"75%%\" border=\"1\"><tr>\n");
53     printf("<td width=\"80%%\" class=\"cellPlain\">Information Type</td>\n");
54     printf("<td width=\"20%%\" class=\"cellPlain\">Drilldown</td>\n");
55     printf("</tr>\n");
56    
57     // Build the query
58     $sql = "SELECT DISTINCT
59     i.infotype,
60     i.infotype_id
61    
62     FROM
63     infotype i
64    
65     WHERE i.masterinfotype_id = "
66     . $masterinfotype_id
67     . " ORDER BY i.infotype";
68    
69     // Debugging
70     // printf("sql was: %s<BR>\n", $sql);
71    
72     $rs = mysql_query($sql, $con);
73    
74     // Initialize counter
75     $rowcount = 0;
76    
77     // Cycle through the result set
78     while ( $row = mysql_fetch_array ( $rs ) ) {
79     $infotype_id = Trim($row["infotype_id"]);
80     $infotype = Trim($row["infotype"]);
81    
82     // New row
83     if ($rowcount % 2 == 0) $color = " class=\"backLight\" ";
84     else $color ="";
85    
86     printf("<tr>\n");
87     printf("<td %s>%s</td>\n", $color, $infotype);
88     printf("<td %s><a href=\"infotype_drill.phtml?infotype_id=%d\">Drilldown</a></td>\n", $color, $infotype_id);
89     printf("</tr>\n");
90    
91     // Increment counter
92     $rowcount++;
93    
94     }
95    
96     // Summary of RQS page uses
97     printf("<tr><td align=\"right\" class=\"backLight\">Total mapped Information Types:</td>\n");
98     if (mysql_num_rows($rs) == 0) printf("<td class=\"backLight\">(None)</td>\n");
99     else printf("<td class=\"backLight\">%d</td>\n", mysql_num_rows($rs));
100     printf("</tr>\n");
101    
102     // Close table
103     printf("</table><br><br>\n");
104    
105     // Link to return to admin console
106     adminReturn($sess_access_level);
107    
108     } // logged in
109    
110     // No access page
111     else require_once ($GLOBAL_NO_ACCESS);
112    
113    
114     // Page footer
115     require_once ($GLOBAL_ADMIN_FOOTER);
116     ?>
117    
118     </body>
119     </html>
120    

  ViewVC Help
Powered by ViewVC 1.1.26