forked from 51isoft/bnuoj-web-v1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete_vcontest.php
33 lines (31 loc) · 884 Bytes
/
delete_vcontest.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
<?php
/*
* Created on 2009-3-31
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
include("header.php");
echo '<center>';
$cid =$_GET['cid'];
$que="select isvirtual,owner,UNIX_TIMESTAMP(start_time) from contest where cid=$cid";
$row=mysql_fetch_array(mysql_query($que));
$nt=time();
if (db_user_match($nowuser,$nowpass)&&$row[0]==1&&$row[1]==$nowuser&&$row[2]>$nt) {
$que="delete from contest where cid=$cid";
$row=mysql_query($que);
if (!$row) {
echo "<span class=warn>Failed.</span>";
}
$que="delete from contest_problem where cid=$cid";
$row=mysql_query($que);
if (!$row) {
echo "<span class=warn>Failed.</span>";
}
}
else {
echo "<span class=warn>You cannot delete this contest unless you are the owner and the contest has not started.</span>";
}
echo '</center>';
include("footer.php");
?>