-
Notifications
You must be signed in to change notification settings - Fork 0
/
stats_monsters.php
240 lines (219 loc) · 8.96 KB
/
stats_monsters.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<?php
//include the db
require_once('Connections/dbDescent.php');
//initialize the session
if (!isset($_SESSION)) {
session_start();
}
//include functions
include 'includes/function_logout.php';
include 'includes/function_createProgressBar.php';
include 'includes/function_getSQLValueString.php';
include 'includes/function_getCampaignLabel.php';
//select the database
mysql_select_db($database_dbDescent, $dbDescent);
// Get Games - FIX ME: Do I need this here?
$query_rsAllGames = sprintf("SELECT * FROM tbgames ORDER BY game_id ASC");
$rsAllGames = mysql_query($query_rsAllGames, $dbDescent) or die(mysql_error());
$row_rsAllGames = mysql_fetch_assoc($rsAllGames);
$totalRows_rsAllGames = mysql_num_rows($rsAllGames);
$totalGames = 0;
do {
$totalGames++;
} while ($row_rsAllGames = mysql_fetch_assoc($rsAllGames));
include 'stats_monsters_data.php';
?>
<html>
<head><?php
$pagetitle = "Monster Statistics and Information";
include 'head.php'; ?>
</head>
<body><?php
include 'navbar.php';
include 'banner.php'; ?>
<div class="container grey">
<h1>Monster Statistics and Info</h1>
<p class="top-lead lead text-muted">Statistics showing the most popular monsters and information about monster traits, size, conditions, ...</p>
<div class="row">
<div id="" class="col-md-6">
<div class="row">
<div class="col-md-12"> </div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">Most popular monsters</h2>
</div>
<div class="panel-body"><?php
foreach ($MonstersUsedCounted as $key => $muc){
foreach($allMonsters as $am){
if ($am['id'] == $key && $am['size'] != "lieutenant"){ ?>
<div class="row stats-row">
<div class="col-xs-12">
<div class="row">
<div class="col-md-6">
<p><strong><?php echo $am['name']; ?></strong></p>
</div>
<div class="col-md-6 text-right"><?php
getCampaignLabel($am['expansion'], "normal"); ?>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?php echo round($MonsterUsedPercentage[$key]);?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo round($MonsterUsedPercentage[$key]);?>%;">
<span class="sr-only"><?php echo round($MonsterUsedPercentage[$key]);?>%</span>
<?php echo round($MonsterUsedPercentage[$key]);?>% of Encounters
</div>
</div>
</div>
</div>
<p></p>
</div>
</div><?php
}
}
} ?>
</div>
</div>
</div>
</div>
</div>
<div id="" class="col-md-6">
<div class="row">
<div class="col-md-12"> </div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">Monster Traits</h2>
</div>
<div class="panel-body"><?php
foreach($traits as $t){ ?>
<div class="row stats-row">
<div class="col-xs-12">
<div class="row">
<div class="col-md-6">
<p><strong><?php echo ucwords($t); ?></strong></p>
</div>
<div class="col-md-6 text-right">
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="row"><?php
foreach ($allMonsters as $am){
if (in_array($t, $am['traits'])){
echo '<div class="col-sm-4 col-xs-6">';
getCampaignLabel($am['expansion'], "mini");
echo " " . $am['name'];
echo '</div>';
}
} ?>
</div>
</div>
</div>
<p></p>
</div>
</div><?php
} ?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12"> </div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">Monster Size</h2>
</div>
<div class="panel-body"><?php
foreach($size as $s){ ?>
<div class="row stats-row">
<div class="col-xs-12">
<div class="row">
<div class="col-md-6">
<p><strong><?php echo ucwords($s); ?></strong></p>
</div>
<div class="col-md-6 text-right">
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="row"><?php
foreach ($allMonsters as $am){
if ($s == $am['size']){
echo '<div class="col-sm-4 col-xs-6">';
getCampaignLabel($am['expansion'], "mini");
echo " " . $am['name'];
echo '</div>';
}
} ?>
</div>
</div>
</div>
<p></p>
</div>
</div><?php
} ?>
<div class="row stats-row">
<div class="col-xs-12">
<p><strong>Important: </strong>All Medium, Huge and Massive monsters are considered Large monsters.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12"> </div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">Conditions inflictable by monsters</h2>
</div>
<div class="panel-body"><?php
foreach($conditions as $c){ ?>
<div class="row stats-row">
<div class="col-xs-12">
<div class="row">
<div class="col-md-6">
<p><strong><?php echo ucwords($c); ?></strong></p>
</div>
<div class="col-md-6 text-right">
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="row"><?php
foreach ($allMonsters as $am){
if (in_array($c, $am['conditions'])){
echo '<div class="col-sm-4 col-xs-6">';
getCampaignLabel($am['expansion'], "mini");
echo " " . $am['name'];
echo '</div>';
}
} ?>
</div>
</div>
</div>
<p></p>
</div>
</div><?php
} ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>