-
Notifications
You must be signed in to change notification settings - Fork 2
/
DisplaySingleGameShipVSShip.php
132 lines (120 loc) · 5.18 KB
/
DisplaySingleGameShipVSShip.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
131
132
<?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 - Raumkämpfe</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="" />
</div>
<div id="Tabs">
<ul>
<?php echo('<li><a href="DisplaySingleGame.php?gameid='.$gameId.'&outputtype='.$xstatsGraphOutputType.'"><span>Allgemeine Übersicht</span></a></li>'); ?>
<?php echo('<li><a href="DisplaySingleGameShips.php?gameid='.$gameId.'&outputtype='.$xstatsGraphOutputType.'"><span>Übersicht Schiffe</span></a></li>'); ?>
<li class="active"><a href="#"><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>Übersicht über die Raumkämpfe</H2>');
echo( "<H2>Spiel: ".xstats_getGameName($gameId).' ('.$gameSize.'x'.$gameSize.')</H2>');
echo( "Spielziel: ".xstats_getGameType($gameId).'<br>');
if( xstats_gameIsFinished($gameId)) {
echo( "Spielende: ".xstats_getGameEnd($gameId).'<br>');
echo( "Anzahl der Runden: ".xstats_getMaxTurn($gameId).'<br>');
$width = 252;
$height = 188;
$displayLegend = "FALSE";
$statsPerRow = 3;
$isThumb = "TRUE";
$graphArray = array(
"battlewoncount", "battlelostcount",
);
xstats_displayGraphsAsImage($gameId,$graphArray,$width,$height,$displayLegend,$statsPerRow,$isThumb);
echo( "<br><br>");
xstats_displayMaxValueShipVSShip($gameId);
}else {
echo( "Spiel ist noch nicht beendet, XStats nicht verfügbar.");
}
?>
</div>
</div>
</div><!-- /end .borderedBoxWrap -->
<div class="borderedBoxWrap">
<div class="borderedBox">
<div class="borderedBoxInner">
<?php
if( xstats_gameIsFinished($gameId)) {
xstats_displayShipFightsByShip( $gameId, 10 );
}else {
echo( "Spiel ist noch nicht beendet, XStats nicht verfügbar.");
}
?>
</div>
</div>
</div><!-- /end .borderedBoxWrap -->
<div class="borderedBoxWrap">
<div class="borderedBox">
<div class="borderedBoxInner">
<?php
if( xstats_gameIsFinished($gameId)) {
xstats_displayAllFights( $gameId );
}else {
echo( "Spiel ist noch nicht beendet, XStats nicht verfügbar.");
}
?>
</div>
</div>
</div><!-- /end .borderedBoxWrap -->
<?php
if( xstats_gameIsFinished($gameId)) {
$width = 800;
$height = 600;
$displayLegend = "TRUE";
$statsPerRow = 1;
$isThumb = "FALSE";
$graphArray = array(
"battlewoncount", "battlelostcount",
);
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>