本文整理汇总了PHP中Problem::getInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Problem::getInfo方法的具体用法?PHP Problem::getInfo怎么用?PHP Problem::getInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Problem
的用法示例。
在下文中一共展示了Problem::getInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Problem
if (isset($mo_request[1]) && is_numeric($mo_request[1])) {
$problem = new Problem($mo_request[1]);
$problem->load();
if (!$problem->getPID()) {
require_once $mo_theme_floder . '404.php';
}
if (isset($_POST['lang']) && isset($_POST['code']) && $user->getUID()) {
// 提交solution
if (!b_check_code()) {
echo '提交错误!请检查格式以及是否已经登录!';
} else {
$new_sid = mo_add_new_solution($mo_request[1], $_POST['lang'], $_POST['code']);
echo '提交成功!<a href="/?r=solution/' . $new_sid . '">点此</a>查看详情!';
}
}
echo '<h2>' . $problem->getInfo('title') . '</h2>';
echo '<em>标签:' . $problem->getInfo('tag') . '<br>';
echo '时间限制:' . $problem->getInfo('time_limit') . 'MS 内存限制:' . $problem->getInfo('memory_limit') . 'MB</em>';
echo '<h3>问题描述</h3>';
echo $problem->getInfo('description');
echo '<br>提交人数:' . $problem->getInfo('try') . ' AC人数:' . $problem->getInfo('solved') . '<br>';
echo '<h3>提交代码</h3>';
echo '<form name="form1" method="post" action="">
语言:
<p>
<label>
<input name="lang" type="radio" required id="lang-1" value="1" checked>
C/C++</label>
</p>
<p>代码:</p>
<p>
示例2: die
if (!$app->user->isLogin()) {
die('<center><a href=\'admin/status.php?action=login&url=../index.php\'>Please login or register first!</a></center>');
}
if ($app->user->getPower() != 0) {
die('<center><a href=\'admin/status.php?action=login&url=../index.php\'>Please login or register first!</a></center>');
}
if (isset($_GET['action'])) {
if ($_GET['action'] == "delete") {
$db = new MySQL();
$db->from("Problem")->where("`id`='" . intval($_GET['id']) . "'")->delete();
}
}
if (isset($_POST['submit'])) {
require_once "classes/Problem.php";
$pro = new Problem($_POST['pid'], $_POST['oj']);
$pro_info = $pro->getInfo();
$db = new MySQL();
$num = $db->from("Problem")->select("max(cast(id as signed))")->fetch_one();
//Just a hack for PHP <= 5.3
$db->value(array('id' => intval($num['max(cast(id as signed))']) + 1, 'pid' => $_POST['pid'], 'title' => get_magic_quotes_gpc() ? $pro_info['title'] : addslashes($pro_info['title']), 'oj' => $_POST['oj']))->insert("Problem");
$alert = "Problem " . $pro_info['title'] . " added !";
}
if (isset($_POST['time'])) {
$app->setting->set("startTime", strtotime($_POST['stime']));
$app->setting->set("endTime", strtotime($_POST['etime']));
$alert = "Start at " . $_POST['stime'] . " and end at " . $_POST['etime'];
}
if (isset($_POST['clean'])) {
$db = new MySQL();
$db->from("Problem")->delete();
$db->from("Record")->delete();