-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathleaderboard.php
81 lines (74 loc) · 2.58 KB
/
leaderboard.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
<?php ob_start();
include 'global.php'; ?>
<style>
#footer {
position: fixed;
bottom: 0;
width: 100%;
}
#footer {
background: #fff;
line-height: 2;
text-align: right;
color: #042E64;
font-size: 30px;
font-family: sans-serif;
font-weight: bold;
}
</style>
</head>
<body>
<?php include 'nav.php';
include 'php/debug.php';
include 'php/userCheck.php';
include 'TBAdata.php';
include 'error.php';
checkUserAdmin(true); ?>
<br>
<div class="container">
<h1 style="text-align:center;">Scouting Leaderboard</h1>
<?php
include 'php/dbDataConn.php';
include 'php/getScoutInfo.php';
echo "
<div class='container' style='width:90%'><table align='center' class='table'>
<thead>
<tr>
<th>Team</th>
<th>Name</th>
<th>Slack ID</th>
<th>Matches Scouted</th>
</tr>
</thead>
<tbody>";
$result = mysqli_query($dbDataConn, "SELECT * FROM " . $GLOBALS['DB']['TABLE']['USER'] . " ORDER BY matchesScouted DESC");
while($row = mysqli_fetch_array($result)) {
// if you uncomment line 51 it breaks
// $_SESSION[$GLOBALS['APP_INFO']['SHORT_NAME']]['userArray']['uid']=$row['id'];
// echo "\r\nname";
// echo $row['name'];
// echo "\r\nslack name";
// echo $_SESSION[$GLOBALS['APP_INFO']['SHORT_NAME']]['userArray']['name'];
// echo "\r\nif statement";
// echo $row['name'] == $_SESSION[$GLOBALS['APP_INFO']['SHORT_NAME']]['userArray']['name'];
if($row['name'] == $_SESSION[$GLOBALS['APP_INFO']['SHORT_NAME']]['userArray']['name']){
echo '<tr class="bg-danger">';
echo "<td>" . $row['team'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['slackId'] . "</td>";
echo "<td>" . $row['matchesScouted'] . "</td>";
echo "</tr>";
}
else{
echo "<tr>";
echo "<td>" . $row['team'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['slackId'] . "</td>";
echo "<td>" . $row['matchesScouted'] . "</td>";
echo "</tr>";
}
}
echo "</tbody></table></div>";
$dbDataConn->close();
?>
</div>