ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/php/historical/browser.php
Revision: 1.8
Committed: Sun Feb 4 14:49:36 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.7: +4 -4 lines
Log Message:
Error message is not shown if the user fails to select a report to
view.  The bung button is now called a somewhat more appropriate "Show".

File Contents

# Content
1 <?php
2
3 // A test navigation thingy.
4 // pjm2@ukc.ac.uk
5
6
7 function getdirArray($dir='./',$sort='asort') {
8 global $dir_file_count;
9 if ( is_dir($dir) ) {
10 $fd = @opendir($dir);
11 while ( ($part = @readdir($fd)) == TRUE ) {
12 clearstatcache();
13 if ($part != "." && $part != "..") {
14 $dir_array[] = $part;
15 }
16 }
17 if($fd == TRUE) {
18 closedir($fd);
19 }
20 if (is_array($dir_array)) {
21 $sort($dir_array);
22 $dir_file_count = count($dir_array);
23 Return $dir_array;
24 } else {
25 Return FALSE;
26 }
27 } else {
28 Return FALSE;
29 }
30 }
31
32 include("day.inc");
33
34 ?>
35
36 <html>
37 <body bgcolor="#ffffff">
38
39 <table border="0" align="center" cellpadding="2" cellspacing="5">
40 <tr>
41 <td valign="top">
42 <? include("left.inc"); ?>
43 </td>
44 <td>
45 <? include("title.inc"); ?>
46
47
48 <font face="arial, sans-serif" size="2">
49 <b>View reports for <? echo "$day" ?></b>
50 </font>
51
52 <p>
53
54 <form method="GET" action="">
55 <select size="1" name="machine_name">
56 <option selected value="">[select machine]</option>
57 <? include("machine_name.inc"); ?>
58 </select>
59
60 <select size="1" name="report">
61 <option selected value="">[select report]</option>
62 <? include("report.inc"); ?>
63 </select>
64
65 <input type="submit" name="submit" value="Show">
66 </form>
67
68 </p>
69
70
71 <?
72 if ($submit == "Show" && $machine_name && $report) {
73 $url = escapeshellcmd("$day/$machine_name/$report/chart.gif");
74 if (file_exists($url)) {
75 echo "<p><b>[$machine_name] - $report</b><br><img src=\"$url\" width=\"500\" height=\"250\"><br><img src=\"24hour.gif\" width=\"500\" height=\"39\"></p>";
76 }
77 else {
78 echo "<p>The report could not be found.</p>";
79 }
80 }
81
82 ?>
83
84 <hr>
85
86 <p>
87 <font face="arial, sans-serif" size="2">
88 <b>Or browse all dates</b>
89 </font>
90 </p>
91
92 <?
93
94 $file_array = getdirArray('/home/cut/pjm2/webpages/reports','asort');
95 print "<ul>";
96 foreach($file_array as $file_name) {
97 if (is_dir($file_name)) {
98 print "<li><a href=\"$file_name\">$file_name</a>";
99 }
100 }
101 print "</ul>";
102
103 ?>
104
105 <? include("bottom.inc"); ?>
106
107 </body>
108 </html>