forked from BNUACM/bnuoj-web-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfetch_contest.php
More file actions
17 lines (17 loc) · 859 Bytes
/
fetch_contest.php
File metadata and controls
17 lines (17 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
include_once("conn.php");
$cid = convert_str($_GET['cid']);
if (db_user_match($nowuser,$nowpass)&&db_user_isroot($nowuser)&&db_contest_type($cid)!=99) {
$query="select cid,title,description,isprivate,start_time,end_time,lock_board_time,hide_others,report,type,has_cha,challenge_start_time,challenge_end_time from contest where cid='$cid'";
$result = mysql_query($query);
if (mysql_num_rows($result)==0) echo "Error!";
else {
$res=array();
list($res[cid],$res[title],$res[description],$res[isprivate],$res[start_time],$res[end_time],$res[lock_board_time],$res[hide_others],$res[report],$res[ctype],$res[has_cha],$res[challenge_start_time],$res[challenge_end_time])=mysql_fetch_row($result);
echo json_encode($res);
}
}
else {
echo "Error!";
}
?>