-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.php
80 lines (69 loc) · 1.98 KB
/
start.php
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/***********************************************
Zurich Water Game: internet version
Author: Nigel Gilbert and the FIRMA project
--------------------------------------------
start.php
Displays a menu of player roles for the user to choose one.
Version 1.0 6 August 2001
Version 1.1 1 September 2001
Version 2.0 10 November 2001
**********************************************/
$player = $_COOKIE['player'];
if ($player) {
header("Location: main.php");
}
include("constants.php");
include("common.php");
include("query.php");
include("objects.php");
db_open($database);
$zurich = db_retrieve("Zurich", "objects");
?>
<html>
<head>
<title>Welcome to the Game!</title>
<LINK REL=stylesheet HREF="zwg.css" type="text/css">
</head>
<body BGCOLOR="#FFFFFF">
<p><center><b>Click on the icon to choose a stakeholder and start playing the game:</b>
<table border=0 cellspacing=10 cellpadding=0>
<?php
foreach ($zurich->players as $p) {
$id = $p->id;
switch ($id) {
case 'water_utility':
$icon="images/wu-icon.gif";
break;
case 'waste_water_utility':
$icon="images/wwu-icon.gif";
break;
case 'housing_assoc_1':
$icon="images/ha-icon.gif";
break;
case 'housing_assoc_2':
$icon="images/ha-icon.gif";
break;
case 'manufacturer_1':
$icon="images/man-icon.gif";
break;
case 'manufacturer_2':
$icon="images/man-icon.gif";
break;
case 'politician':
$icon="images/pol-icon.gif";
break;
default:
continue 2; // next iteration of foreach
}
echo "<tr><td><A href=\"main.php?newplayer=$id\" target=\"_top\"><IMG SRC=\"$icon\"
WIDTH=55 HEIGHT=61 ALIGN=MIDDLE BORDER=0>
</a></td>
<td>$p->name</td>";
if ($zurich->players[$id]->loggedin) {
echo "<td><img src=\"images/tick.gif\" width=16 height=16 border=0>Already logged in</td>";
}
echo "</tr>\n";
}
echo "</table></center>";
html_footer();