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.10
Committed: Sun Feb 25 14:48:44 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.9: +5 -32 lines
Log Message:
Preparations for the new browsing structure.  Each day's directory will
contain the list of reports and machines for that day.  The user may
select which day to browse first.

File Contents

# User Rev Content
1 pjm2 1.1 <?php
2    
3 pjm2 1.10 // Navigation for the i-scream reports.
4 pjm2 1.1 // 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     ?>
33    
34 pjm2 1.10 <? include("title.inc"); ?>
35 pjm2 1.6
36     <form method="GET" action="">
37     <select size="1" name="machine_name">
38 pjm2 1.8 <option selected value="">[select machine]</option>
39 pjm2 1.10 <? #include("machine_name.inc"); ?>
40 pjm2 1.6 </select>
41    
42     <select size="1" name="report">
43 pjm2 1.8 <option selected value="">[select report]</option>
44 pjm2 1.10 <? #include("report.inc"); ?>
45 pjm2 1.6 </select>
46 pjm2 1.1
47 pjm2 1.8 <input type="submit" name="submit" value="Show">
48 pjm2 1.6 </form>
49 pjm2 1.1
50 pjm2 1.6 </p>
51 pjm2 1.1
52 pjm2 1.2
53     <?
54 pjm2 1.8 if ($submit == "Show" && $machine_name && $report) {
55 pjm2 1.2 $url = escapeshellcmd("$day/$machine_name/$report/chart.gif");
56     if (file_exists($url)) {
57 pjm2 1.7 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>";
58 pjm2 1.2 }
59     else {
60     echo "<p>The report could not be found.</p>";
61     }
62     }
63    
64     ?>
65 pjm2 1.1
66     <hr>
67    
68     <?
69    
70 pjm2 1.9 $file_array = getdirArray('/home/cut/pjm2/webpages/reports','rsort');
71 pjm2 1.7 print "<ul>";
72 pjm2 1.1 foreach($file_array as $file_name) {
73     if (is_dir($file_name)) {
74 pjm2 1.7 print "<li><a href=\"$file_name\">$file_name</a>";
75 pjm2 1.1 }
76     }
77 pjm2 1.7 print "</ul>";
78 pjm2 1.1
79     ?>
80 pjm2 1.6
81 pjm2 1.10 <? include("bottom.inc"); ?>