summaryrefslogtreecommitdiffstats
path: root/include/welcome.php
blob: 34709d35cb6a8f5b3a11cad3dad072e4ac24d096 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
/* make sure that we are not called from outside the scripts, 
 * use a variable defined in config.php to check this
 */
if(!isset($HOST))
  exit;

/* this outputs the default home page with some extra statistics on it */

$pre[0]=0;$game[0]=0;$done[0]=0;
$r=DB_query("SELECT COUNT(id) FROM Game GROUP BY status");
if($r) {
  $pre  = DB_fetch_array($r);
  $game = DB_fetch_array($r);
  $done = DB_fetch_array($r);
 }

$r=DB_query("SELECT AVG(datediff(mod_date,create_date)) FROM Game where status='gameover' ");
if($r)
  $avgage= DB_fetch_array($r);
 else
   $avgage[0]=0;

output_home_page($pre[0],$game[0],$done[0],$avgage[0]);

?>