Beispiel #1
0
			</div>
		</div>
		<?php 
if (!$ava_client_count) {
    echo '<div class="alert alert-danger">当前没有评测端在线!请检查Socket服务端是否开启,以及评测端是否正常。</div>';
}
?>
		<div class="row">
			<div class="col-md-6">
				<img src="inc/icon/problem.png" align="left" class="img-rounded img-responsive signimg">
				<h3 class="text-left">
					题库
				</h3>
				<p class="text-left">
					题库当前线上题目数:<?php 
echo mo_get_problem_count();
?>
<br>
				</p>
				<a href="edit_problem.php?action=add" class="btn btn-primary btn-default" role="button">添加题目</a>
				<a href="problem.php" class="btn btn-default btn-default" role="button">管理题目</a>
			</div>
			<div class="col-md-6">
				<img src="inc/icon/data.png" align="left" class="img-rounded img-responsive signimg">
				<h3 class="text-left">
					数据
				</h3>
				<p class="text-left">
					用户提交数:<?php 
echo mo_get_solution_count();
?>
Beispiel #2
0
        $msg = '成功' . ($_GET['action'] == 'lock' ? '锁定' : '解锁') . '题目#' . $pid . '。';
    } elseif ($_GET['action'] == 'del') {
        $pid = $_GET['pid'];
        $sql = 'DELETE FROM `mo_judge_problem` WHERE `id` = ?';
        $db->prepare($sql);
        $db->bind('i', $pid);
        $db->execute();
        $msg = '成功删除题目#' . $pid . '。';
    }
}
$start = isset($_GET['loc']) ? (int) $_GET['loc'] : 0;
$piece = isset($_GET['piece']) ? (int) $_GET['piece'] : 20;
$sql = "SELECT `id`, `title`, `tag`, `ver`, `post_time`, `time_limit`, `memory_limit`, `state`, `ac`, `submit`," . " `solved`, `try`, `test_turn` FROM `mo_judge_problem` ORDER BY `id` DESC LIMIT {$start},{$piece}";
$db->prepare($sql);
$result = $db->execute();
$problem_count = mo_get_problem_count();
$page = ceil($problem_count / $piece);
?>
<div class="container">
    <ul class="nav nav-tabs">
    <li class="active"><a href="problem.php">管理题目</a></li>
    <li><a href="edit_problem.php?action=add">添加题目</a></li>
    </ul>
    <?php 
if (!$result) {
    echo '<div class="alert alert-warning">题库暂时为空!请先添加题目。</div>';
}
?>
    <?php 
if (isset($_GET['result'])) {
    if ($_GET['result'] == 0) {