ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/php/historical/browser.php
(Generate patch)

Comparing projects/cms/source/reports/php/historical/browser.php (file contents):
Revision 1.11 by pjm2, Sun Feb 25 16:21:19 2001 UTC vs.
Revision 1.14 by pjm2, Fri Mar 2 09:13:09 2001 UTC

# Line 4 | Line 4
4   // pjm2@ukc.ac.uk
5  
6  
7 + function isReportEmpty($filename) {
8 +    if (filesize($filename) < 33) {
9 +        return TRUE;
10 +    }
11 +    return FALSE;
12 + }
13 +
14   function getdirArray($dir='./',$sort='asort') {
15      global $dir_file_count;
16      if ( is_dir($dir) ) {
# Line 36 | Line 43 | function getdirArray($dir='./',$sort='asort') {
43   <hr weight="1" color="#9999ff">
44  
45   <b>Most recent reports available</b>
46 < <form method="GET" action="">
46 > <form method="GET" action="browser.php">
47   <?
48  
49      $file_array = getdirArray('/home/cut/pjm2/webpages/reports','rsort');
# Line 62 | Line 69 | function getdirArray($dir='./',$sort='asort') {
69  
70      <b>Available reports for <? echo $day ?></b>
71  
72 <    <form method="GET" action="">
72 >    <form method="GET" action="browser.php">
73       <select size="1" name="machine_name">
74 <      <option selected value="">[select machine]</option>
74 >      <? if ($machine_name) { ?>
75 >        <option selected value="<? echo $machine_name ?>"><? echo $machine_name ?></option>
76 >        <option value="">----------------</option>
77 >      <? } else { ?>
78 >        <option selected value="">[select machine]</option>
79 >      <? } ?>
80        <? include("$day/machine_name.inc"); ?>
81       </select>
82  
83       <select size="1" name="report">
84 <      <option selected value="">[select report]</option>
84 >      <? if ($report) { ?>
85 >        <option selected value="<? echo $report ?>"><? echo $report ?></option>
86 >        <option value="">----------------</option>
87 >      <? } else { ?>
88 >        <option selected value="">[select report]</option>
89 >      <? } ?>
90        <? include("$day/report.inc"); ?>
91       </select>
92  
# Line 89 | Line 106 | function getdirArray($dir='./',$sort='asort') {
106          
107          include("$day/$machine_name/$report/i-maxmin.txt");
108          
109 <        $url = escapeshellcmd("$day/$machine_name/$report/chart.gif");
110 <        if (file_exists($url)) {  ?>
109 >        $url = escapeshellcmd("$day/$machine_name/$report/i-chart.gif");
110 >        if (isReportEmpty("$day/$machine_name/$report/i-data.txt")) {
111 >            echo "Host <b>$machine_name</b> did not send any information about <b>$report</b> on <b>$day</b>.  Please select another report.";
112 >        }
113 >        else if (file_exists($url)) {  ?>
114            
115              <center><b>[<? echo $machine_name; ?>] - <? echo $report; ?></b></center>
116            
# Line 131 | Line 151 | function getdirArray($dir='./',$sort='asort') {
151      
152   ?>
153  
154 < <? include("bottom.inc"); ?>
154 > <? include("bottom.inc"); ?>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines