-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathranked_stats.php
78 lines (73 loc) · 2.13 KB
/
ranked_stats.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
<div class="container">
<?php
$server = $_GET['server'];
if (in_array($server, $supported_league_servers)) {
$showTable = True;
echo "<h1 class='text-uppercase'>$server ranked stats</h1>";
}
else {
$showTable = False;
include('404.php');
}
if ($showTable == True) {
?>
<table class="rankedstats table table-bordered table-striped table-hover">
<thead>
<tr>
<th>#</th>
<th>Summoner</th>
<th>Win %</th>
<th>Wins</th>
<th>Losses</th>
<th>KDA</th>
<th>Kills</th>
<th>Deaths</th>
<th>Assists</th>
<th>DMG Dealt</th>
<th>DMG Taken</th>
<th>Penta Kills</th>
</tr>
</thead>
<?php
$sth = $pdo->prepare("
SELECT
id,
summonerName,
totalSessionsPlayed,
totalSessionsLost,
totalSessionsWon,
totalChampionKills,
totalAssists,
totalDeathsPerSession,
totalDamageDealt, totalDamageTaken,
totalMinionKills,
totalPentaKills,
ROUND((totalChampionKills + totalAssists) / totalDeathsPerSession, 2) as 'kda',
ROUND(100 * totalSessionsWon / totalSessionsPlayed) as 'winPercentage'
FROM
{$server}_ranked_stats
order by
winPercentage DESC");
$sth->execute();
while($row = $sth->fetch()) {
?>
<tr>
<td></td>
<td><a href="http://<?php echo $server ?>.op.gg/summoner/userName=<?php echo $row['summonerName']; ?>"><?php echo $row['summonerName']; ?></a></td>
<td><div class="progress"><div class="progress-bar progress-bar-info win_percentage" style="width: <?php echo $row['winPercentage'] ?>%"><?php echo $row['winPercentage'] ?>%</div></div></td>
<td class="win"><?php echo $row['totalSessionsWon']; ?></td>
<td class="loss"><?php echo $row['totalSessionsLost']; ?></td>
<td class="kda"><strong><?php echo $row['kda']; ?></strong></td>
<td><?php echo $row['totalChampionKills']; ?></td>
<td><?php echo $row['totalDeathsPerSession']; ?></td>
<td><?php echo $row['totalAssists']; ?></td>
<td><?php echo $row['totalDamageDealt']; ?></td>
<td><?php echo $row['totalDamageTaken']; ?></td>
<td><?php echo $row['totalPentaKills'] ?></td>
</tr>
<?php
}
}
?>
</table>
</div>