| 1 |  | <?php | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 3 | < | // Navigation for the i-scream reports. | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 4 | < | // pjm2@ukc.ac.uk | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 3 | > | # Navigation for the i-scream reports. | 
 
 
 
 
 | 4 | > | # pjm2@ukc.ac.uk | 
 
 
 
 
 | 5 | > | # | 
 
 
 
 
 | 6 | > | # CONFIGURABLE CONSTANTS | 
 
 
 
 
 | 7 | > | # | 
 
 
 
 
 
 
 
 
 
 
 | 8 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 9 | < | # CONSTANTS | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 9 | > | # The report directory, and the number of days to display. | 
 
 
 
 
 | 10 | > | $reportDirectory = "/home/cut/pjm2/webpages/reports"; | 
 
 
 
 
 | 11 | > | $maxDaysShown = 7; | 
 
 
 
 
 
 
 
 
 
 
 | 12 |  |  | 
 
 
 
 
 
 
 
 | 13 | + | # Page appearance. | 
 
 
 
 
 
 
 
 | 14 | + | $scaleImage = "24hour.gif"; | 
 
 
 
 
 
 
 
 | 15 | + | $lineColor = "#9999ff"; | 
 
 
 
 
 
 
 
 | 16 | + |  | 
 
 
 
 
 
 
 
 | 17 | + | # Files to include | 
 
 
 
 
 
 
 
 | 18 | + | $titleHTML = "title.inc"; | 
 
 
 
 
 
 
 
 | 19 | + | $bottomHTML = "bottom.inc"; | 
 
 
 
 
 
 
 
 | 20 | + | $machineNameHTML = "machine_name.inc"; | 
 
 
 
 
 
 
 
 | 21 | + | $reportHTML = "report.inc"; | 
 
 
 
 
 
 
 
 | 22 | + |  | 
 
 
 
 
 
 
 
 | 23 | + | # What are the names of the report files? | 
 
 
 
 
 
 
 
 | 24 | + | $reportLimitsFile = "i-maxmin.txt"; | 
 
 
 
 
 
 
 
 | 25 | + | $reportChartFile = "i-chart.gif"; | 
 
 
 
 
 
 
 
 | 26 | + | $reportChartDataFile = "i-data.txt"; | 
 
 
 
 
 
 
 
 | 27 | + |  | 
 
 
 
 
 
 
 
 | 28 | + | # Submission details. | 
 
 
 
 
 
 
 
 | 29 | + | $formMethod = "GET"; | 
 
 
 
 
 
 
 
 | 30 | + | $thisPage = "browser.php"; | 
 
 
 
 
 
 
 
 | 31 | + |  | 
 
 
 
 
 
 
 
 | 32 | + | # Leave this alone unless you know what you're doing ;) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 33 |  | $minFileSize = 33; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 34 |  |  | 
 
 
 
 
 
 
 
 | 35 | + | # | 
 
 
 
 
 
 
 
 | 36 | + | # END CONFIGURATION | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 37 |  |  | 
 
 
 
 
 
 
 
 | 38 | + |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 39 |  | function isReportEmpty($filename) { | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 40 |  | if (filesize($filename) < minFileSize) { | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 41 |  | return TRUE; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 85 |  | $i++; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 86 |  | print "<option value=\"$file_name\">$file_name</option>"; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 87 |  | } | 
 
 
 
 
 
 
 
 
 
 
 | 88 | < | if ($i >= 20) { | 
 
 
 
 
 
 
 
 
 | 88 | > | if ($i >= $maxDaysShown) { | 
 
 
 
 
 
 
 
 
 
 
 | 89 |  | break; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 90 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 91 |  | } |