forked from BNUACM/bnuoj-web-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
recent_contest.php
65 lines (56 loc) · 1.84 KB
/
recent_contest.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
<?php
include_once("header.php");
include_once("functions/sidebars.php");
?>
<div class="span9">
<table class="table table-striped table-hover basetable" id="contestlist">
<thead>
<tr>
<th width="15%">OJ</th>
<th width="40%">Title</th>
<th width="25%">Start time</th>
<th width="10%">DOW</th>
<th width="10%">Type</th>
</th>
</thead>
<tbody></tbody>
</table>
</div>
<div class="span3">
<?=sidebar_common()?>
</div>
<script>
$(document).ready(function(){
$("#more").addClass("active");
$("#contestlist").dataTable({
"bProcessing": true,
"sDom": '<"row-fluid"p>rt<"row-fluid"i>',
"sPaginationType": "full_numbers" ,
"oLanguage": {
"sEmptyTable": "Loading...",
"sZeroRecords": "No contests found.",
"sInfoEmpty": "No entries to show"
},
"aaSorting": [ [2,'asc'] ],
"iDisplayLength":<?=$config["limits"]["contests_per_page"]?>
});
$.get("external/contests.json",function(data) {
data=eval(data);
//var target=$("#contestlist tbody");
for (var i=0;i<data.length;i++) {
$("#contestlist").dataTable().fnAddData( [
data[i].oj,
"<a href='"+data[i].link+"' target='_blank'>"+data[i].name+"</a>",
data[i].start_time,
data[i].week,
(data[i].access==""?"Public":data[i].access) ]
);
//$(target).append("<tr>"+"<td>"+data[i].oj+"</td>"+"<td><a href='"+data[i].url+"' target='_blank'>"+data[i].name+"</a></td>"+"<td>"+data[i].start_time+"</td>"+"<td>"+data[i].week+"</td>"+"<td>"+(data[i].access==""?"Public":data[i].access)+"</td>"+"</tr>")
}
$("#contestlist_processing").hide();
});
});
</script>
<?php
include_once("footer.php");
?>