ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/php/logins/logins.php
Revision: 1.1
Committed: Wed May 30 18:12:06 2001 UTC (23 years, 3 months ago) by pjm2
Branch: MAIN
Log Message:
The main page for viewing the login timeline graph thingies.  Similar in
layout to the historical reports and makes use of files stored within the
historical reports directories.  Any login that has appeared within the
reporting period will appear on this page.  The user must select the date
to view, followed by the machine name.  All logins are currently shown on
the same page.  Perhaps more wizzo things may happen in the future.  The
are subtle differences in the 9-5 lines so that strange people may compare
people's login times with the typical office hours.

File Contents

# User Rev Content
1 pjm2 1.1 <?php
2    
3     # Navigation for the i-scream login timeline reports.
4     # pjm2@ukc.ac.uk
5     #
6     # CONFIGURABLE CONSTANTS: -
7    
8     include("logins_config.inc.php");
9    
10     #
11     # END CONFIGURATION
12    
13    
14    
15    
16     include("iutils.inc.php");
17    
18     ?>
19    
20     <? include($titleHTML); ?>
21    
22    
23     <hr weight="1" color="<? echo $lineColor ?>">
24    
25     <b>Most recent login timelines available</b>
26     <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
27     <?
28    
29     $file_array = getdirArray($reportDirectory,'rsort');
30     print "<select size=\"1\" name=\"date\">";
31     if ($date) { ?>
32     <option selected value="<? echo $date ?>"><? echo $date ?></option>
33     <option value="">----------------</option>
34     <? }
35     foreach($file_array as $file_name) {
36     #if (is_dir($file_name)) {
37     if (preg_match("/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/", $file_name)) {
38     $i++;
39     print "<option value=\"$file_name\">$file_name</option>";
40     }
41     }
42     print "</select>";
43    
44     ?>
45     <input type="submit" name="submit" value="Go">
46     </form>
47    
48     <hr weight="1" color="<? echo $lineColor ?>">
49    
50     <? if ($date) { ?>
51    
52     <b>Available timelines for <? echo $date ?></b>
53    
54     <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
55     <select size="1" name="machine">
56     <? if ($machine) { ?>
57     <option selected value="<? echo $machine ?>"><? echo $machine ?></option>
58     <option value="">----------------</option>
59     <? } else { ?>
60     <option selected value="">[select machine]</option>
61     <? } ?>
62     <? include("$reportDirectory/$date/$machineNameHTML"); ?>
63     </select>
64    
65     <input type="hidden" name="date" value="<? echo $date ?>">
66     <input type="submit" name="submit" value="Show">
67     </form>
68    
69     <hr weight="1" color="<? echo $lineColor ?>">
70    
71     <? } ?>
72    
73     </p>
74    
75     <? if ($date && $machine) { ?>
76    
77     <table border="0" cellpadding="0" cellspacing="0">
78     <tr>
79     <td>&nbsp;</td>
80     <td><img src="<?echo $scaleImage;?>" width="800" height="17" border="0"></td>
81     <td>&nbsp;</td>
82     </tr>
83    
84     <?
85    
86     $flip = 0;
87     $file_array = getdirArray("$reportDirectory/$date/$machine/login24",'asort');
88     if ($file_array == FALSE) {
89     print<<<EOT
90    
91     <tr>
92     <td>&nbsp;</td>
93     <td align="center" background="$backImage"><p>&nbsp;</p><p><b>No users were logged in during this period</b></p><p>&nbsp;</p></td>
94     <td>&nbsp;</td>
95     </tr>
96    
97     EOT;
98     }
99     else {
100     foreach($file_array as $file_name) {
101     if (preg_match("/\.gif$/", $file_name)) {
102     preg_match("/^(.*)\.gif$/", $file_name, $matches);
103     $login = $matches[1];
104    
105     if ($flip == 1) {
106     $flip = 0;
107     $bg = " background=\"$backImage\"";
108     }
109     else {
110     $flip = 1;
111     $bg = " background=\"$backImage2\"";
112     }
113    
114     print<<<EOT
115    
116     <tr>
117     <td><font size="2">$login</font></td>
118     <td$bg><img src="$webRoot/$date/$machine/login24/$file_name" border="0" width="800" height="5"></td>
119     <td><font size="2">$login</font></td>
120     </tr>
121    
122     EOT;
123     }
124     }
125     }
126    
127    
128     ?>
129    
130     <tr>
131     <td>&nbsp;</td>
132     <td><img src="<?echo $scaleImage;?>" width="800" height="17" border="0"></td>
133     <td>&nbsp;</td>
134     </tr>
135     </table>
136    
137     <hr weight="1" color="<? echo $lineColor ?>">
138    
139     <? } ?>
140    
141     <? include($bottomHTML); ?>