-
Notifications
You must be signed in to change notification settings - Fork 1
/
leaderboard.html
86 lines (80 loc) · 3.05 KB
/
leaderboard.html
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
<!DOCTYPE html>
<!--
Capture The Flag hosted by Anwesha IITP 2017.
-->
<html>
<head>
<title>CAPTURE THE FLAG</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/leaderboard.css">
<link rel="stylesheet" href="css/font-awesome.css">
<link rel="stylesheet" href="css/bootstrap.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<div class="Site-top">
<div class="container">
<h2>Capture the Flag</h2>
</div>
<!-- adding welcome for person -->
</div>
<div class="list">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<ul class="nav navbar-nav">
<a href="index.php" style="text-decoration: none"><li ><b>Home </b></li></a>
<a href="rules.html" style="text-decoration: none"><li><b>Rules</b></li></a>
<a href="leaderboard.html" style="text-decoration: none"><li><b>Leaderboard</b></li></a>
<a href="https://www.facebook.com/events/343174736081160/" target="_blank" style="text-decoration: none"><li><b>DiscussionForum</b></li></a>
</ul>
</div>
</nav>
</div>
<center id='notice' style='color:black;background-color:white'>Leaderboard has frozen!</center><br>
<script type="text/javascript">
setTimeout(function(){
$('#notice').hide('slow');
},5000);
</script>
<div class="body-area" id="table">
<table class="data-table">
<thead id='board'>
<th>Sl. No.</th>
<th>Username</th>
<th>Score</th>
<th></th>
</thead>
<script language="javascript" type="text/javascript">
console.log("Attempt");
$.ajax({
type: 'get',
url: 'leaderboard.php',
success: function (data) {
data=jQuery.parseJSON(data);
console.log(data);
for (var i = 0; i < data.length; i++) {
console.log(data[i]);
var str="<tr><td>" + (i+1) + "</td>";
str+="<td>" + data[i][1] + "</td>";
str+="<td>" + data[i][0] + "</td>";
str+="<td>";
if(data[i][3]) {
str+="<span style='font-size:0.7em'>Attempt to Share Flag</span>";
}
str+="</td>";
$("#board").append(str);
};
if(data.length==0) {
$("#board").append("<tr><td>-</td><td>-</td><td>-</td></tr>");
}
}
});
</script>
</table>
</div>
<div class='footer'>
<p>@Anwesha 2017</p>
</div>
</body>
</html>