summaryrefslogtreecommitdiffstats
path: root/include/output.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2009-02-12 22:12:23 -0800
committerArun Persaud <arun@nubati.net>2009-02-12 22:12:23 -0800
commit5edd63b115fe7712c6e220fc6a0b78dbace4f3cd (patch)
treedf5d9584d2c6f2821a49b8db90602f23df31e641 /include/output.php
parent65322d53842f9ee7e166970e5250f76c36fc3e6a (diff)
downloade-DoKo-5edd63b115fe7712c6e220fc6a0b78dbace4f3cd.tar.gz
e-DoKo-5edd63b115fe7712c6e220fc6a0b78dbace4f3cd.tar.bz2
e-DoKo-5edd63b115fe7712c6e220fc6a0b78dbace4f3cd.zip
NEW FEATURE + CLEANUP: added some table sorting to the statistics page via jquery
using jquery to add table sorting, might also use it for other things later. Also optimized some DB-queries and cleaned up some code.
Diffstat (limited to 'include/output.php')
-rw-r--r--include/output.php28
1 files changed, 19 insertions, 9 deletions
diff --git a/include/output.php b/include/output.php
index 6823b4d..231f8f6 100644
--- a/include/output.php
+++ b/include/output.php
@@ -114,12 +114,17 @@ function output_form_for_new_game($names)
<?php
}
-function output_table($data,$caption="",$class="")
+function output_table($data,$caption="",$class="",$id="")
{
+
+ $HTML = "\n<table";
+
if($class!="")
- $HTML = "\n<table class=\"$class\">\n";
- else
- $HTML = "\n<table>\n";
+ $HTML.= " class=\"$class\"";
+ if($id!="")
+ $HTML.= " id=\"$id\"";
+
+ $HTML.=">\n";
$i=0;
@@ -133,10 +138,7 @@ function output_table($data,$caption="",$class="")
else
{
if($i==1) $HTML .= " <tbody>\n";
- if($i % 2)
- $HTML .= " <tr class=\"odd\"> ";
- else
- $HTML .= " <tr class=\"even\"> ";
+ $HTML .= " <tr> ";
}
foreach($record as $point)
{
@@ -298,8 +300,16 @@ 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/standard018.css" />
+ <link rel="stylesheet" type="text/css" href="css/standard019.css" />
<script type="text/javascript" src="include/game.js"> </script>
+ <script type="text/javascript" src="include/jquery.js"> </script>
+ <script type="text/javascript" src="include/jquery.tablesorter.js"></script>
+ <script type="text/javascript">
+ $(document).ready(function()
+ {
+ $("#ScoreTable").tablesorter({ widgets: ['zebra']});
+ });
+ </script>
</head>
<body onload="high_last();">
<div class="header">