source:
trunk/NEMOGCM/TRUST/web/read_trusting.php
@
9151
Last change on this file since 9151 was 6222, checked in by timgraham, 9 years ago | |
---|---|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[6222] | 1 | |
2 | <?php | |
3 | ||
4 | $num=1; | |
5 | ||
6 | function read_trusting ($file) { | |
7 | ||
8 | global $num; | |
9 | $row = 1; | |
10 | ||
11 | if (($handle = fopen($file, "r")) !== FALSE) { | |
12 | ||
13 | while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { | |
14 | ||
15 | switch ($row) { | |
16 | case 1: | |
17 | $num1 = count($data); | |
18 | print("<thead>\n\n"); print("<tr class=\"title\">\n"); | |
19 | break; | |
20 | default: | |
21 | if ( $row % 2 == 1 ) { print("<tr class=\"odd\">\n") ; } | |
22 | else { print("<tr class=\"even\">\n"); } | |
23 | } | |
24 | ||
25 | $num = count($data); | |
26 | #echo "<p> $num champs ligne $row: <br /></p>\n"; | |
27 | ||
28 | for ($c=0; $c<$num1; $c++) { | |
29 | #echo $data[$c] . "<br />\n"; | |
30 | if ($c > $num ) { $var=""; } else { $var=trim($data[$c]); } | |
31 | ||
32 | switch ($var) { | |
33 | case "FAILED" : print("<td bgcolor=\"#FF6666\">".$var."</td>\n"); break; | |
34 | case "Different": print("<td bgcolor=\"#FFFF99\">".$var."</td>\n"); break; | |
35 | case "OK" : print("<td bgcolor=\"#92CA89\">".$var."</td>\n"); break; | |
36 | default : print("<td>".$var."</td>\n") ; | |
37 | } | |
38 | ||
39 | } | |
40 | ||
41 | print("</tr>\n\n"); | |
42 | if ( $row == 1 ) { print("</thead>\n\n"); print("<tbody>\n\n"); } | |
43 | $row++; | |
44 | } | |
45 | ||
46 | fclose($handle); | |
47 | } | |
48 | ||
49 | print("</tbody>\n"); | |
50 | } | |
51 | ||
52 | ?> |
Note: See TracBrowser
for help on using the repository browser.