-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrecent-contest.php
More file actions
35 lines (31 loc) · 1.25 KB
/
recent-contest.php
File metadata and controls
35 lines (31 loc) · 1.25 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
<?php
require_once("oj-header.php");
require_once("./include/db_info.inc.php");
echo "<title>Recent Contests from Naikai-contest-spider</title>";
?>
<div align="center">
<?php
$json = @file_get_contents('http://algcontest.rainng.com/contests.json');
$rows = json_decode($json, true);
$odd=true;
?>
<h2></h2>
<table width=80% align=center>
<thead class=toprow>
<tr>
<th class="column-1">OJ</th><th class="column-2">Name</th><th class="column-3">Start Time</th><th class="column-4">Week</th><th class="column-5">Access</th>
</tr>
</thead>
<tbody class="row-hover">
<? foreach ($rows as $row) :
$odd=!$odd;
?>
<tr class="<?php echo $odd?"oddrow":"evenrow" ?>">
<td class="column-1"><?=$row['oj']?></td><td class="column-2"><a id="name_<?=$row['id']?>" href="<?=$row['link']?>" target="_blank"><?=$row['name']?></a></td><td class="column-3"><?=$row['start_time']?></td><td class="column-4"><?=$row['week']?></td><td class="column-5"><?=$row['access']?></td>
</tr>
<? endforeach; ?>
</tbody>
</table>
</div>
<div align=center>DataSource:http://algcontest.rainng.com/contests.json Spider Author:<a href="https://github.com/Azure99/AlgContestInfo" >Azure99</a></div>
<?php require('oj-footer.php');?>