diff options
author | Arun Persaud <arun@nubati.net> | 2008-05-26 11:08:51 -0700 |
---|---|---|
committer | Arun Persaud <arun@nubati.net> | 2008-05-26 11:08:51 -0700 |
commit | e8b56a58ef9b5dabf77273f540d1ec678e604615 (patch) | |
tree | c6ef2a571b167d838b095f4e42c21a1b2b4b8d9b /include/output.php | |
parent | 1132ca2ccda76df5ed2b1bea6b64015d4dc86880 (diff) | |
download | e-DoKo-e8b56a58ef9b5dabf77273f540d1ec678e604615.tar.gz e-DoKo-e8b56a58ef9b5dabf77273f540d1ec678e604615.tar.bz2 e-DoKo-e8b56a58ef9b5dabf77273f540d1ec678e604615.zip |
LAYOUT: added a unified table layout for statistics, etc
a table that can be styled via CSS is created from an array.
Signed-off-by: Arun Persaud <arun@nubati.net>
Diffstat (limited to 'include/output.php')
-rw-r--r-- | include/output.php | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/include/output.php b/include/output.php index 28489a0..3eb8130 100644 --- a/include/output.php +++ b/include/output.php @@ -96,6 +96,48 @@ function output_form_for_new_game($names) <?php } +function output_table($data,$class="") +{ + if($class!="") + $HTML = "\n<table class=\"$class\">\n"; + else + $HTML = "\n<table>\n"; + + $i=0; + + foreach($data as $record) + { + if(!$i) + $HTML .= " <thead>\n <tr>\n"; + else + { + if($i==1) $HTML .= " <tbody>\n"; + if($i % 2) + $HTML .= " <tr class=\"odd\"> "; + else + $HTML .= " <tr class=\"even\"> "; + } + foreach($record as $point) + { + if($i) + $HTML .= " <td>$point</td> "; + else + $HTML .= " <th>$point</th> "; + } + + if(!$i) + $HTML .= " </tr>\n </thead>\n"; + else + { + $HTML .= " </tr>\n"; + } + $i++; + } + $HTML .= " </tbody>\n</table>\n"; + + return $HTML; +} + function display_card($card,$dir="english") { /* cards are only availabl for the odd values, e.g. 1.png, 3.png, ... @@ -228,7 +270,7 @@ function output_header() <title>e-Doko</title> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <link rel="shortcut icon" type="image/x-icon" href="pics/edoko-favicon.png" /> - <link rel="stylesheet" type="text/css" href="css/standard003.css" /> + <link rel="stylesheet" type="text/css" href="css/standard004.css" /> <script type="text/javascript"> var current=0; function hl(num) { |