-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDisplaySingleGame.php
130 lines (119 loc) · 5.57 KB
/
DisplaySingleGame.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php
$gameId=$_GET["gameid"];
if( is_null($gameId)) {
die("Parameter gameid erwartet.");
}
$xstatsGraphOutputType=$_GET["outputtype"];
if( is_null($xstatsGraphOutputType)) {
$xstatsGraphOutputType = 'IMAGE';
}
if( !$xstatsGraphOutputType == 'IMAGE' && !$xstatsGraphOutputType == 'FLASH' ) {
die( "outputtype muss eines von IMAGE, FLASH sein.");
}
//contains also the player color
include (dirname(__FILE__).'/../../inc.conf.php');
include (dirname(__FILE__).'/../../inhalt/inc.hilfsfunktionen.php');
open_db();
include ('xstatsUtil.php');
include ('DisplaySingleGameUtil.php');
include ('xstatsVersion.php');
$gameSize = xstats_getGameSize($gameId);
?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
<head>
<title>Skrupel XStats - Allgemein</title>
<meta name="language" content="de" />
<meta http-equiv="Content-Language" content="de_DE" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<link type="text/css" rel="stylesheet" href="xstats.css" media="screen" />
</head>
<body>
<div id="logo">
<?php echo( xstats_getVersionStr() ); ?>
<img src="images/skrupel_logo.png" alt="xstats"/>
</div>
<div id="Tabs">
<ul>
<li class="active"><a href="#"><span>Allgemeine Übersicht</span></a></li>
<?php echo('<li><a href="DisplaySingleGameShips.php?gameid='.$gameId.'&outputtype='.$xstatsGraphOutputType.'"><span>Übersicht Schiffe</span></a></li>'); ?>
<?php echo('<li><a href="DisplaySingleGameShipVSShip.php?gameid='.$gameId.'&outputtype='.$xstatsGraphOutputType.'"><span>Übersicht Raumkämpfe</span></a></li>'); ?>
</ul>
</div>
<br class="clear" />
<div class="borderedBoxWrap">
<div class="borderedBox">
<div class="borderedBoxInner">
<?php
//find out the name of the game
echo( '<H2>Allgemeine Übersicht</H2>');
echo( "<H2>Spiel: ".xstats_getGameName($gameId).' ('.$gameSize.'x'.$gameSize.')</H2>');
echo( "Ziel: ".xstats_getGameType($gameId).'<br>');
echo( "Start: ".xstats_getGameStart($gameId).'<br>');
echo( "Ende: ".xstats_getGameEnd($gameId).'<br>');
echo( "Dauer: ".xstats_getGameDuration($gameId).'<br>');
echo( "Runden: ".xstats_getMaxTurn($gameId).'<br>');
xstats_displayMovieGif( $gameId );
if( xstats_gameIsFinished($gameId)) {
echo( "<br><br>");
xstats_displayRanking($gameId);
echo( "<br><br>");
xstats_displayMaxValueListMisc($gameId);
}
?>
</div>
</div>
</div><!-- /end .borderedBoxWrap -->
<div id="top" class="borderedBoxWrap thumbs">
<div class="borderedBox">
<div class="borderedBoxInner">
<?php
if( xstats_gameIsFinished($gameId)) {
$width = 252;
$height = 188;
$displayLegend = "FALSE";
$statsPerRow = 3;
$isThumb = "TRUE";
$graphArray = array( "rank",
"coloniestakencount", "planetcount",
"planetcountpercent", "colonistcount", "stationcount", "stationcountstd",
"stationcountrep","stationcountdef","stationcountstdextra","lemincount",
"min1count", "min2count", "min3count", "cantoxcount", "factorycount",
"boxcount", "minescount",
);
xstats_displayGraphsAsImage($gameId,$graphArray,$width,$height,$displayLegend,$statsPerRow,$isThumb);
echo( "<br>");
xstats_displayTurnList( $gameId );
}else {
echo( "Spiel ist noch nicht beendet, XStats nicht verfügbar.");
}
?>
</div>
</div>
</div>
<?php
if( xstats_gameIsFinished($gameId)) {
$width = 800;
$height = 600;
$displayLegend = "TRUE";
$statsPerRow = 1;
$isThumb = "FALSE";
$graphArray = array( "rank",
"coloniestakencount", "planetcount",
"planetcountpercent", "colonistcount", "stationcount", "stationcountstd",
"stationcountrep","stationcountdef","stationcountstdextra","lemincount",
"min1count", "min2count", "min3count", "cantoxcount", "factorycount",
"boxcount", "minescount",
);
if( $xstatsGraphOutputType == 'IMAGE') {
xstats_displayGraphsAsImage($gameId,$graphArray,$width,$height,$displayLegend,$statsPerRow,$isThumb);
}else {
xstats_displayGraphsAsFlash($gameId,$graphArray,$width,$height,$displayLegend,$statsPerRow,$isThumb);
}
}else {
echo( "Spiel ist noch nicht beendet, XStats nicht verfügbar.");
}
?>
</body>
</html>