3 Star 9 Fork 2

BLumia / BLumiaOJ

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
problem.php 1.00 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
BLumia 提交于 2017-02-14 00:17 . Misc code clean up
<?php
session_start();
//Vars
require_once('./include/setting_oj.inc.php');
require_once('./include/user_check_functions.php');
$isProblemManager = havePrivilege("PROBLEM_EDITOR");
//Prepares
$pid=isset($_GET['pid']) ? intval($_GET['pid']) : 0;
$curTime=strftime("%Y-%m-%d %H:%M",time());
if ($pid==0) {
exit("404 No such problem");
}
$any_running_contest = "
SELECT `problem_id` FROM `contest_problem` WHERE `contest_id` IN (
SELECT `contest_id` FROM `contest` WHERE
(`end_time`>'{$curTime}') AND `defunct`='N'
)";
if (!havePrivilege("PROBLEM_EDITOR")) {
$sql=$pdo->prepare("SELECT * FROM problem WHERE `defunct`='N' AND problem_id = ? AND `problem_id` NOT IN({$any_running_contest})");
} else {
$sql=$pdo->prepare("SELECT * FROM problem WHERE problem_id = ?");// limit $front,$PAGE_ITEMS
}
$sql->execute(array($pid));
$problemItem=$sql->fetch(PDO::FETCH_ASSOC);
if ($problemItem == false) exit("403 No such problem.");
//Page Includes
require("./pages/problem.php");
?>
PHP
1
https://gitee.com/blumia/BLumiaOJ.git
git@gitee.com:blumia/BLumiaOJ.git
blumia
BLumiaOJ
BLumiaOJ
master

搜索帮助

14c37bed 8189591 565d56ea 8189591