From e8b56a58ef9b5dabf77273f540d1ec678e604615 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Mon, 26 May 2008 11:08:51 -0700 Subject: [PATCH] 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 --- css/{standard003.css => standard004.css} | 19 +++++++++- include/db.php | 11 ++++++ include/output.php | 44 +++++++++++++++++++++++- 3 files changed, 72 insertions(+), 2 deletions(-) rename css/{standard003.css => standard004.css} (94%) diff --git a/css/standard003.css b/css/standard004.css similarity index 94% rename from css/standard003.css rename to css/standard004.css index 7ad7cd1..e3692af 100644 --- a/css/standard003.css +++ b/css/standard004.css @@ -458,4 +458,21 @@ table.score { .bigger { font-size:larger; -} \ No newline at end of file +} + +table { margin: 0.5em 1em; + border: solid 0.2em #aeaeae; + -moz-border-radius: 0.5em ; +} +tr.odd { background-color:#aeaeae; } +tr.even { background-color:#eaeaea; } +td,th { + margin-left: 0.2em; + margin-right: 0.2em; + padding-left: 0.2em; + padding-right: 0.2em; + border-right: solid 0.1em black; +} +tr td:last-child, tr th:last-child { border-right: solid 0 black; } + +th { border-bottom: solid 0.2em black } \ No newline at end of file diff --git a/include/db.php b/include/db.php index c8750b4..9b691ec 100644 --- a/include/db.php +++ b/include/db.php @@ -85,6 +85,17 @@ function DB_query_array($query) return $return; } +function DB_query_array_all($query) +{ + $result = array(); + + $queryresult = DB_query($query); + while($row = DB_fetch_array($queryresult)) + $result[] = $row; + + return $result; +} + function DB_get_passwd_by_name($name) { $r = DB_query_array("SELECT password FROM User WHERE fullname=".DB_quote_smart($name).""); 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) \n"; + else + $HTML = "\n\n"; + + $i=0; + + foreach($data as $record) + { + if(!$i) + $HTML .= " \n \n"; + else + { + if($i==1) $HTML .= " \n"; + if($i % 2) + $HTML .= " "; + else + $HTML .= " "; + } + foreach($record as $point) + { + if($i) + $HTML .= " "; + else + $HTML .= " "; + } + + if(!$i) + $HTML .= " \n \n"; + else + { + $HTML .= " \n"; + } + $i++; + } + $HTML .= " \n
$point$point
\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() e-Doko - +