BUGFIX: added email-list name to invitation emails
[e-DoKo.git] / include / welcome.php
1 <?php
2 /* make sure that we are not called from outside the scripts, 
3  * use a variable defined in config.php to check this
4  */
5 if(!isset($HOST))
6   exit;
7
8 /* this outputs the default home page with some extra statistics on it */
9
10 $pre[0]=0;$game[0]=0;$done[0]=0;
11
12 $r=DB_query("SELECT COUNT(id) FROM Game GROUP BY status");
13 if($r) {
14   $pre  = DB_fetch_array($r);
15   $game = DB_fetch_array($r);
16   $done = DB_fetch_array($r);
17  }
18
19 $r=DB_query("SELECT AVG(datediff(mod_date,create_date)) FROM Game where status='gameover' ");
20 if($r)
21   $avgage= DB_fetch_array($r);
22  else
23    $avgage[0]=0;
24
25 $pre    = $pre[0];
26 $game   = $game[0];
27 $done   = $done[0];
28 $avgage = $avgage[0];
29
30 echo "<div class=\"login\">\n";
31
32 echo "<p> If you want to play a game of Doppelkopf, you found the right place ;)</p>".
33 "<p> For more information please visit our <a href=\"$WIKI\">wiki</a>. </p>".
34 "<h4>Some statistics:</h4>";
35
36
37 if($pre == 0)
38   echo "<p> At the moment there are no games that are being started ";
39  else if($pre==1)
40    echo "<p> At the moment there is one games that is being started ";
41  else
42    echo "<p> At the moment there are $pre games that are being started ";
43
44 echo "and ";
45
46 if($game==0)
47   echo "zero games that are ongoing. ";
48  else if($game==1)
49    echo "one game that is ongoing. ";
50  else
51    echo "$game games that are ongoing. ";
52
53 echo "<br />\n";
54
55 if($done==0)
56   echo "No game has been completed on this server. </p>";
57  else if($done==1)
58    echo "One game has been completed on this server. </p>";
59  else
60    echo "$done games have been completed on this server. Average time of a game: $avgage days</p>";
61 ?>
62
63   <h4> Login/Register:</h4>
64   <p> 
65   Please <a href="index.php?action=register">register</a>, in case you have not done that yet  <br />
66   or login with you email-address or name and password here:
67   </p>
68
69   <form action="index.php?action=login" method="post">
70   <fieldset>
71   <table>
72   <tr>
73     <td><label for="email">Email:</label></td>
74     <td><input type="text" class="submitbutton" id="email" name="email" size="20" maxlength="30" /> </td>
75   </tr>
76   <tr>
77     <td><label for="password">Password:</label></td>
78     <td><input type="password" class="submitbutton" id="password" name="password" size="20" maxlength="30" /></td>
79   </tr>
80   <tr class="center">
81     <td> <input type="submit" class="submitbutton" name="login" value="login" /></td>
82     <td> <input type="submit" class="submitbutton" name="forgot" value="Forgot your password?" /></td>
83   </tr>
84   </table>
85   </fieldset>
86   </form>
87   
88 </div>