Add sf.net/ directory to maintain (for now, at least) the ibm-acpi.sf.net pages.
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / sf.net / htdocs / ibm-acpi_lib.php
blob282e0be2eb0b97dc8c91402d85095e6361fe37ec
1 <?php
2 // PHP Library for ibm-acpi.sf.net
3 // (c) Arno Willig
4 // 2004-10-20 12:30:00
6 function show_compatibilities() {
7 $handle = fopen ("compatibility.csv","r");
8 if ($handle) {
9 echo "<table border=1>\n";
10 $row=0; $cols=0;
11 while ( ($data = fgetcsv ($handle, 1000, ",")) !== FALSE ) {
12 if (substr($data[0],0,1)<>"#") {
13 echo "<tr align=center>";
14 for ($c=0; $c<count($data); $c++) {
15 if (count($data)>$cols) $cols=count($data);
16 if ($row==0) {
17 if (substr($data[$c],0,1)=="!")
18 echo "<th><font color=red>".htmlentities(substr($data[$c],1))."</font></th>";
19 else
20 echo "<th>".htmlentities($data[$c])."</th>";
22 else {
23 if ($data[$c]=="+") $entry="<img src=\"images/working.png\" alt=\"Working\" border=0 width=\"42\" height=\"15\">";
24 else if ($data[$c]=="=") $entry="<img src=\"images/working_partially.png\" alt=\"Partially working\" border=0 width=\"42\" height=\"15\">";
25 else if ($data[$c]=="-") $entry="<img src=\"images/not_working.png\" alt=\"Not working\" border=0 width=\"42\" height=\"15\">";
26 else if ($data[$c]=="x") $entry="<img src=\"images/not_supported.png\" alt=\"Not supported\" border=0 width=\"16\" height=\"16\">";
27 else if ($data[$c]=="?") $entry="<img src=\"images/not_tested.png\" alt=\"Not tested\" border=0 width=\"16\" height=\"16\">";
28 else $entry=htmlentities($data[$c]);
29 echo "<td>".$entry."</td>";
33 echo "</tr>\n";
34 $row++;
37 echo "<tr><td colspan=\"".$cols."\"><b>Legend:</b> ";
38 echo "<img src=\"images/working.png\" alt=\"Working\" border=0 width=\"42\" height=\"15\"> Working &nbsp;&nbsp;";
39 echo "<img src=\"images/working_partially.png\" alt=\"Partially working\" border=0 width=\"42\" height=\"15\"> Partially working &nbsp;&nbsp;";
40 echo "<img src=\"images/not_working.png\" alt=\"Not working\" border=0 width=\"42\" height=\"15\"> Not working &nbsp;&nbsp;";
41 echo "<img src=\"images/not_supported.png\" alt=\"Not supported\" border=0 width=\"16\" height=\"16\"> Not supported &nbsp;&nbsp;";
42 echo "<img src=\"images/not_tested.png\" alt=\"Not tested\" border=0 width=\"16\" height=\"16\"> Not tested &nbsp;&nbsp;";
43 echo "</td></tr>\n";
45 echo "</table>";
46 fclose ($handle);
49 ?>