-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatch.php
More file actions
executable file
·54 lines (49 loc) · 1.49 KB
/
match.php
File metadata and controls
executable file
·54 lines (49 loc) · 1.49 KB
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
<?php
$pagename = "game details";
include("includes/hopmod.php");
function no_id() {
?>
<h1>Please provide a correct game ID</h1>
<?php stopbench(); ?>
</body>
</html>
<?php
exit;
}
$_GET['id'] = intval($_GET['id']);
if (isset($_GET['id']) and $_GET['id'] != "") {
$_SESSION['id'] = $_GET['id'];
} elseif (isset($_SESSION['id']) and $_SESSION['id'] != "") {
} else { no_id(); }
$sql = $dbh->prepare("
select name,
country AS PlayerCountry,
sum(score) as TotalScored,
sum(teamkills) as TotalTeamkills,
sum(suicides) as TotalSuicides,
max(frags) as MostFrags,
sum(frags) as TotalFrags,
sum(deaths) as TotalDeaths,
count(name) as TotalGames,
round((0.0+sum(hits))/(sum(hits)+sum(misses))*100) as Accuracy,
round((0.0+sum(frags))/sum(deaths),2) as Kpd
from players
inner join games on players.game_id=games.id
where game_id = :id group by name order by ".$_SESSION['orderby']." desc");
$pager_query = $dbh->prepare("SELECT FOUND_ROWS()")
?>
<?php match_table($_SESSION['id']); //Build stats table data ?>
<div style="clear:both">
<h2 style="margin-left:2em">Players</h2>
<?php
$sql->execute(array(':id' => $_SESSION['id']));
$pager_query->execute();
build_pager($_GET['page'], $pager_query, $rows_per_page); //Generate Pager Bar
?>
</div>
<?php
stats_table($sql); //Build stats table data
?>
<?php stopbench(); //Stop and display benchmark.?>
</body>
</html>