Example #1
0
<?php

require_once "../include/header.php";
gethead(1, "", "比赛成绩");
$p = new DataAccess();
$r = new DataAccess();
$sql = "select comptime.starttime,comptime.endtime,compbase.contains,comptime.showscore from compbase,comptime where comptime.cbid=compbase.cbid and comptime.ctid={$_GET[ctid]}";
$cnt = $p->dosql($sql);
if (!$cnt) {
    异常("未查询到记录!");
}
$d = $p->rtnrlt(0);
if (!$d['showscore'] && !有此权限('查看比赛')) {
    异常("成绩还未公布!");
}
if (time() < $d['starttime'] && !有此权限('查看比赛')) {
    异常("比赛尚未开始,不能查看关于题目的任何信息!");
}
$end = time() > $d['endtime'];
$q = new DataAccess();
$pbs = explode(":", $d['contains']);
?>
<div class='row-fluid'>
<table id="contest_report" class='table table-striped table-condensed table-bordered fiexd'>
<thead>
  <tr>
    <th style="min-width: 5ex;">名次</th>
    <th>用户</th>
<?php 
$cnt_prob = 0;
foreach ($pbs as $k => $v) {
Example #2
0
<?php

require_once "../include/header.php";
gethead(0, "查看比赛", "");
chdir($SET['dir_competition']);
$ctid = (int) $_GET['ctid'];
$dir = "COGS_{$ctid}";
$src = "tmp.zip";
exec("rm {$src}");
exec("rm -R {$dir}");
$md = "mkdir {$dir}";
exec($md);
$p = new DataAccess();
$sql = "select compscore.uid,userinfo.realname,userinfo.nickname,problem.filename from compscore,userinfo,problem where userinfo.uid=compscore.uid and compscore.pid=problem.pid and compscore.ctid={$_GET[ctid]} order by uid asc";
$cnt = $p->dosql($sql);
$tu = 0;
for ($i = 0; $i < $cnt; $i++) {
    $d = $p->rtnrlt($i);
    //if($d[uid]==$tu) continue;
    $tu = $d[uid];
    exec("mkdir -p {$dir}/{$tu}.{$d['realname']}_/");
    $mv = "cp {$ctid}/{$tu}/{$d['filename']}.* {$dir}/{$tu}.{$d['realname']}_/";
    exec($mv);
}
exec("rm {$src}");
$zip = "zip -r {$src} {$dir}";
exec($zip);
header("Content-type: application/zip");
header("Content-Disposition: attachment; filename=\"{$dir}.zip\"");
if (file_exists($dir)) {
    exec("rm -R {$dir}");
Example #3
0
<?php

require_once "../include/header.php";
gethead(1, "sess", "评测");
if (!$_POST['pid']) {
    异常("你来错地方了!");
}
$LIB->hlighter();
$LIB->func_socket();
$p = new DataAccess();
$sql = "select * from problem where pid={$_POST['pid']}";
$p->dosql($sql);
$d = $p->rtnrlt(0);
if (!$d['submitable'] && !有此权限('查看题目')) {
    异常("不可提交!", 取路径("problem/index.php"));
}
$lang = langstrtonum($_POST['lang']);
$info = array();
$info['pid'] = $_POST['pid'];
$info['sid'] = $_POST['sid'];
$info['uid'] = $_SESSION['ID'];
$info['language'] = $lang;
$info['pname'] = $d['filename'];
$info['datacnt'] = $d['datacnt'];
$info['timelimit'] = $d['timelimit'];
$ptitle = $d['probname'];
$info['memorylimit'] = $d['memorylimit'];
$info['plugin'] = $d['plugin'];
$info['compiledir'] = $SET['dir_source'];
$info['mode'] = "normal";
if ($_POST['testmode'] == '1' && 有此权限('测试题目')) {
Example #4
0
<?php

require_once "../include/header.php";
gethead(8, "修改比赛", "");
if ($_REQUEST[action] == 'add') {
    $p = new DataAccess();
    @($cons = implode(":", $_POST[cons]));
    $sql = "insert into compbase(cname,contains,ouid) values('{$_POST[cname]}','{$cons}',{$_SESSION[ID]})";
    $p->dosql($sql);
    提示("添加比赛 {$_POST[cname]} 成功!", 取路径("contest/compbase.php"));
}
if ($_REQUEST[action] == 'edit') {
    $p = new DataAccess();
    @($cons = implode(":", $_POST[cons]));
    $sql = "update compbase set cname='{$_POST[cname]}',contains='{$cons}' where cbid={$_REQUEST[cbid]}";
    $p->dosql($sql);
    提示("修改比赛 {$_POST[cname]} 成功!", 取路径("contest/compbase.php"));
}
Example #5
0
<?php

require_once "../include/header.php";
gethead(1, "超级用户", "备份与恢复");
?>
<div class="page">

<form method="post" action="dobackup.php" class='form-inline'>
<input name="backtype" type="hidden" value="showback" />
<button type="submit" class='btn btn-success'>查看已备份的数据</button>
</form>

<hr />

<form method="post" action="dobackup.php" class='form-inline'>
<h4>数据库 (database)</h4>
<input name="backtype" type="hidden" value="database" />
<div class="input-prepend input-append">
<span class="add-on"><?php 
echo $SET['dir_databackup'] . "database/";
?>
</span>
<input type="text" name="filename" value="<?php 
echo date('Ymd', time());
?>
" />
<span class="add-on">_&lt;时间&gt;.sql.gz</span>
</div>
<button type="submit" class='btn btn-primary pull-right'>备份数据库</button>
</form>
Example #6
0
<?php

require_once "../include/header.php";
gethead(8, "sess", "");
过滤();
$p = new DataAccess();
if (!$_POST['pid']) {
    异常("没有选择题目!", 取路径("problem/index.php"));
}
if (!$_POST['title']) {
    异常("没有填写题解名称!", 取路径("problem/problem.php?pid={$_POST['pid']}"));
}
$sql = "select * from solution where `link`='' limit 1";
$cnt = $p->dosql($sql);
if (!$cnt) {
    $sql1 = "insert into category(cname,memo) values('{$_POST['cname']}','{$_POST['memo']}')";
    $p->dosql($sql1);
} else {
    提示("添加题目 {$_POST['pid']} 分类 “{$e['caid']}. {$_POST['cname']}” 成功,虽然它之前就已经存在了!", 取路径("problem/problem.php?pid={$_POST['pid']}"));
}
Example #7
0
<?php

require_once "../include/header.php";
gethead(8, "admin", "");
过滤();
$p = new DataAccess();
$sql = "update settings set value='{$_POST[value]}' where ssid={$_REQUEST[ssid]}";
$p->dosql($sql);
提示("修改参数<code>{$_REQUEST[ssid]}</code>成功!", 取路径("admin/settings.php?settings=settings"));
Example #8
0
<?php

require_once "../include/header.php";
gethead(1, "查看比赛", "比赛场次评测");
$p = new DataAccess();
$q = new DataAccess();
$sql = "select comptime.*,compbase.cname,groups.* from comptime,compbase,groups where comptime.cbid=compbase.cbid and comptime.ctid={$_GET[ctid]} and groups.gid=comptime.group";
$cnt = $p->dosql($sql);
if (!$cnt) {
    异常("未查询到记录!");
}
$d = $p->rtnrlt(0);
?>
<div class='row-fluid'>
<table class='table table-striped table-condensed table-bordered fiexd'>
  <tr>
    <td width="90px">CTID</td>
    <td><?php 
echo $d[ctid];
?>
</td>
    <td width="90px">关联比赛</td>
    <td><?php 
echo $d[cname];
?>
</td>
  </tr>
  <tr>
    <td>开始时间</td>
    <td><?php 
echo date('Y-m-d H:i:s', $d[starttime]);
Example #9
0
function wq_lurupic($cretime)
{
    include '../moni/xiaobai.php';
    $xiaobai = getmessage($token, $cookie, $cookies);
    //将用户消息转换成变
    $i = 0;
    for (; $i <= 19; $i++) {
        if ($xiaobai[$i]["date_time"] == $cretime && $xiaobai[$i]["type"] == '2') {
            break;
        }
    }
    $type = $xiaobai[$i]["type"];
    if ($i == 20) {
        return 1;
    } else {
        if ($type == 2) {
            $fakeid = $xiaobai[$i]["fakeid"];
            $nick_name = $xiaobai[$i]["nick_name"];
            $messageid = $xiaobai[$i]["id"];
            $content = $xiaobai[$i]["content"];
            //以下获取用户性别
            $details = sixi($token, $fakeid, $cookie, $cookies);
            parse_str($details);
            $sex = $gender;
            /*获取结束*/
            $img = gethead($token, $fakeid, $cookie);
            $imgurl = makeimg($img, $fakeid . '_' . $messageid);
            /*以下为获取图片*/
            $img = getimages($token, $messageid, $cookie);
            $picurl = makeimg($img, $messageid);
            //以下为写入wall
            $sql = "INSERT INTO `weixin_wall` (`id`,`messageid`,`fakeid`,`num`,`content`,`nickname`,`avatar`,`ret`,`image`,`datetime`) VALUES (NULL,'0','{$fakeid} ','-1','此消息为图片','{$nick_name}','{$imgurl}','0','{$picurl}','0')";
            mysql_query($sql);
        } else {
            return 2;
        }
    }
}
Example #10
0
<?php

require_once "../include/header.php";
gethead(8, "普通用户", "");
if (!有此权限("查看比赛") && time() > $_POST['endtime']) {
    异常("比赛已经结束,不可再提交!", 取路径("contest/problem.php?pid={$_POST['pid']}&ctid={$_POST['ctid']}"));
}
if ($_FILES['file']['size'] > 1024 * 100 || $_FILES['file']['size'] <= 0) {
    异常("源代码上传失败。请检查文件大小。", 取路径("contest/problem.php?pid={$_POST['pid']}&ctid={$_POST['ctid']}"));
}
$fname = $_POST[filename];
switch ($_POST[lang]) {
    case 'pas':
        $fname .= ".pas";
        $nlang = 0;
        break;
    case 'c':
        $fname .= ".c";
        $nlang = 1;
        break;
    case 'cpp':
        $fname .= ".cpp";
        $nlang = 2;
        break;
    case 'zip':
        $fname .= ".zip";
        $nlang = 3;
        break;
}
chdir($SET['dir_competition']);
if (!file_exists($_POST[ctid])) {
Example #11
0
<?php

require_once "../include/header.php";
$pid = (int) $_GET['pid'];
$uid = (int) $_GET['uid'];
$aid = (int) $_GET['aid'];
$ctid = (int) $_GET['ctid'];
if ($uid) {
    gethead(1, "", "题目评论", $uid);
} else {
    gethead(1, "", "题目评论");
}
$LIB->hlighter();
$LIB->mathjax();
$p = new DataAccess();
$q = new DataAccess();
?>
<div class='row-fluid'>
<form method="get" action="" class='form-search'>
<?php 
if ($_SESSION['ID']) {
    if ($pid) {
        ?>
<a class='btn btn-danger' href="comment.php?pid=<?php 
        echo $pid;
        ?>
">发表评论</a>
<?php 
    } else {
        if ($aid) {
            ?>
Example #12
0
<?php

require_once "../include/header.php";
gethead(1, "", "比赛列表");
$p = new DataAccess();
$q = new DataAccess();
?>
<div class='row-fluid'>
<?php 
if (有此权限('修改比赛')) {
    ?>
<a href="editcompbase.php?action=add" class="btn btn-info pull-left">添加新比赛</a>
<a href="compbase.php?action=add" class="btn btn-info pull-left">比赛场次管理</a>
<?php 
}
?>
<a href="recent.php" class='btn btn-success'><i class="icon-list-alt icon-white"></i>最近在线竞赛</a>
<?php 
$sql = "select comptime.*,compbase.*,userinfo.realname,userinfo.nickname,groups.* from comptime,compbase,userinfo,groups where comptime.readforce<={$_SESSION['readforce']} and comptime.cbid=compbase.cbid and userinfo.uid=compbase.ouid and comptime.group=groups.gid order by starttime desc";
$cnt = $p->dosql($sql);
$st = 检测页面($cnt, $_GET['page']);
?>
<div id="nowtime" class='alert alert-success pull-right'>
现在时间:<?php 
echo date('Y-m-d H:i:s', time());
?>
</div>
<table id="contestlist" class='table table-striped table-condensed table-bordered fiexd'>
<thead><tr>
    <th style="width: 10em;">比赛</th>
    <th>场次介绍</th>
Example #13
0
<?php

require_once "../include/header.php";
gethead(1, "分组管理", "修改分组");
$p = new DataAccess();
$q = new DataAccess();
$d['adminuid'] = $_SESSION['ID'];
$d['parent'] = 1;
if ($_GET[action] == 'edit') {
    $sql = "select * from groups where gid={$_GET[gid]}";
    $cnt = $p->dosql($sql);
    $d = $p->rtnrlt(0);
}
?>
<div class='container'>
<form method="post" action="doeditgroup.php?action=<?php 
echo $_GET[action];
?>
&gid=<?php 
echo $_GET[gid];
?>
" class='form-horizontal'>
<div class='control-group'>
<label class='control-label' for='gid'>GID</label>
<div class='controls'>
<span id='gid' class='uneditable-input' ><?php 
echo $d['gid'] ? $d['gid'] : "新建";
?>
</span>
</div>
</div>
Example #14
0
<?php

require_once "../include/header.php";
gethead(1, "修改比赛", "修改比赛");
?>
<div class='row-fluid'>
<script type="text/JavaScript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>
<a href="editcompbase.php?action=add" class="btn btn-info pull-left">添加新比赛</a>
<?php 
$p = new DataAccess();
$q = new DataAccess();
$sql = "select compbase.*,userinfo.nickname,userinfo.realname,userinfo.email from compbase,userinfo where userinfo.uid=compbase.ouid order by compbase.cbid desc";
$cnt = $p->dosql($sql);
$st = 检测页面($cnt, $_GET['page']);
?>
<table class='table table-striped table-condensed table-bordered fiexd'>
  <tr>
    <th width="80px">CBID</th>
    <th width="140px">比赛名</th>
    <th>包含题目</th>
    <th>关联场次</th>
    <th width="80px">组织者</th>
    <th width="60px">操作</th>
  </tr>
<?php 
for ($i = $st; $i < $cnt && $i < $st + $SET['style_pagesize']; $i++) {
Example #15
0
<?php

require_once "../include/header.php";
gethead(1, "", "帮助");
?>
<div class='row-fluid'>
<div class='span3'>
<div class='page'>
<?php 
echo 输出文本($SET['global_about']);
?>
</div>
<div class='page'>
<a href="map.php" class="btn btn-block btn-primary"><span class='icon-map-marker icon-white'></span>站点地图</a>
</div>
<table class='table table-striped table-condensed'>
<?php 
$s = "APWTMECRD";
for ($i = 0; $i < strlen($s); $i++) {
    ?>
<tr><td><?php 
    echo 评测结果($s[$i]);
    ?>
</td>
<td><?php 
    echo 评测信息($s[$i]);
    ?>
</td></tr>
<?php 
}
?>
Example #16
0
<?php

require_once "../include/header.php";
$uid = (int) $_SESSION['ID'];
if ($pid = (int) $_GET['pid']) {
    gethead(7, "sess", "修改题目");
} else {
    gethead(7, "sess", "新建题目");
}
$p = new DataAccess();
$q = new DataAccess();
if ($pid) {
    $sql = "select * from problem where pid={$pid}";
    $cnt = $p->dosql($sql);
    if ($cnt) {
        $d = $p->rtnrlt(0);
        if (!有此权限("查看题目") && $uid != $d['addid']) {
            异常("没有阅读权限!", 取路径("problem/index.php"));
        }
    } else {
        异常("无此题目!!", 取路径("problem/index.php"));
    }
}
$LIB->editor("detail");
$LIB->htmldom();
?>
<script>
function checkprobname(){
var probname = $("#probname").val();
$.get("checkprobname.php",{name: probname},function(txt){
if(txt == 0){$("#msg1").html("<span style='color:blue;'>OK</span>");}
Example #17
0
<?php

require_once "../include/header.php";
gethead(1, "sess", "登录日志", $_GET['uid']);
$p = new DataAccess();
if ($_GET['uid'] != $_SESSION['ID'] && !有此权限("查看用户")) {
    异常("不是本人并且没有权限查看!", 取路径("user/detail.php?uid={$_GET['uid']}"));
}
?>

<form action="" method="get" class='form-inline center'>
检索: 用户UID
<input name="uid" type="number" value="<?php 
echo $_GET['uid'];
?>
" class='span1' />
<button type="submit" class='btn btn-primary'>检索</button>
</form>
<?php 
$sql = "select login.*,userinfo.email,userinfo.realname from login,userinfo where login.uid=userinfo.uid";
if ($_GET['uid']) {
    $sql .= " and login.uid={$_GET['uid']}";
}
$sql .= " order by ltime desc";
$cnt = $p->dosql($sql);
$st = 检测页面($cnt, $_GET['page']);
?>
<div class='row-fluid'>
<table class='table table-striped table-condensed table-bordered fiexd'>
<thead><tr>
<th width=40px>编号</th>
Example #18
0
<?php

require_once "../include/header.php";
gethead(8, "", "");
过滤();
$_POST['usr'] = htmlspecialchars($_POST['usr']);
$_POST['nickname'] = htmlspecialchars($_POST['nickname']);
$_POST['realname'] = htmlspecialchars($_POST['realname']);
$_POST['email'] = htmlspecialchars($_POST['email']);
$_POST['user_style'] = htmlspecialchars($_POST['user_style']);
$_POST['memo'] = htmlspecialchars($_POST['memo']);
$regpage = 取路径("user/register.php?accept=1");
if ($_POST['VerifyCode'] != $_SESSION["IMGCODE"]) {
    异常("验证码错误,请一律小写!", $regpage);
}
if (!preg_match('/([_a-z0-9]{1,24})/', $_POST['usr'])) {
    异常("用户名长度必须在[1,24]中且只能使用英文字母、数字以及_。", $regpage);
}
$p = new DataAccess();
$LIB->cls_reg();
$rc = new RegisterCheck();
$sql = "select * from userinfo where usr='******'usr'] . "'";
$cnt = $p->dosql($sql);
if ($cnt == 0) {
    if (!preg_match('/(.{0,24})/', $_POST['pwd'])) {
        异常("密码长度必须在[0,24]中。", $regpage);
    }
    if ($_POST['pwd'] != $_POST['repwd']) {
        异常("重复输入密码必须和密码相同。", $regpage);
    }
    if (!preg_match('/(\\S{1,20})/', $_POST['nickname'])) {
Example #19
0
        } else {
            if ($d[lang] == 2) {
                $ext = "cpp";
            }
        }
    }
    $fp = fopen("{$SET['dir_competition']}{$d[ctid]}/{$d[uid]}/{$d[filename]}.{$ext}", "r");
    if (is_resource($fp)) {
        $code = rfile($fp);
    }
    fclose($fp);
    $code = mb_convert_encoding($code, "utf-8", "gbk");
} else {
    异常("提交记录不存在");
}
gethead(1, "sess", "比赛代码", $d['uid']);
$LIB->hlighter();
?>
<div class='row-fluid'>
<table class='table table-striped table-condensed table-bordered fiexd'>
<tr>
    <th width="60px">比赛</th>
    <td><b><?php 
echo $d['cname'];
?>
</b></td>
    <th width="60px">评测结果</th>
    <td class='wrap'><?php 
评测结果($d['result'], 100);
?>
</td>
Example #20
0
<?php

require_once "../include/header.php";
gethead(1, "修改页面", "修改页面");
$LIB->editor("detail");
?>

<script type = "text/javascript">
function checkprobname(){
var probname = $("#probname").val();
$.get("checkprobname.php",{name: probname},function(txt){
if(txt == 0){$("#msg1").html("<span style='color:blue;'>OK</span>");}
else {$("#msg1").html("<b><span style='color:red;'>NO</span></b>");}
});
}
function checkfilename(){
var filename = $("#filename").val();
$.get("checkfilename.php",{name: filename},function(txt){
if(txt == 0){$("#msg2").html("<span style='color:blue;'>OK</span>");}
else {$("#msg2").html("<b><span style='color:red;'>NO</span></b>");}
});
}
</script>
<?php 
if ($_GET[action] == 'del') {
    echo "确认要删除该题目及与该题目相关所有内容吗(无法恢复)?<p><a href='doeditpage.php?action=del&aid={$_GET[aid]}'>确认删除</a>";
    exit;
}
$p = new DataAccess();
$q = new DataAccess();
if ($_GET[action] == 'edit') {
Example #21
0
<?php

require_once "../include/header.php";
gethead(1, "", "权限列表");
$p = new DataAccess();
$uid = (int) ($_POST['uid'] ? $_POST['uid'] : $_GET['uid']);
$priv = (int) ($_POST['pri'] ? $_POST['pri'] : $_GET['pri']);
$way = $_POST['way'] ? $_POST['way'] : $_GET['way'];
?>
<div class='row-fluid'>
<form method=post>
	<b>为用户添加权限</b>
	用户编号:<input type='number' size=10 name="uid" value="<?php 
echo $uid;
?>
" />
    <input type=hidden name=way value="ins" />
	用户权限:<select name="pri">
<?php 
while (list($key, $val) = each($pri)) {
    if (isset($priv) && $priv == $val) {
        echo '<option value="' . $val . '" selected>' . $key . '</option>';
    } else {
        echo '<option value="' . $val . '">' . $key . '</option>';
    }
}
?>
</select>
<input type='hidden' name='do' value='do' />
<button type=submit class='btn btn-primary' >添加权限</button>
</form>
Example #22
0
<?php

require_once "../include/header.php";
gethead(0, "", "");
chdir($cfg['testdata']);
$file = $_POST['filename'];
$io = $_POST['io'];
if (!$io) {
    $io = "in";
}
$point = (int) $_POST['point'];
$src = "{$file}/{$file}{$point}.{$io}";
header("Content-type: text/plain; charset=utf-8");
header("Content-Disposition: attachment; filename={$file}{$point}.{$io}");
//header("Content-Disposition: inline; filename=$file$point.$io");
@readfile($src);
?>

Example #23
0
<?php

require_once "../include/header.php";
gethead(1, "", "找回密码");
$p = new DataAccess();
if (empty($_POST[User]) && empty($_POST[ans])) {
    ?>
<form method="post" action="lost.php" class='form-inline center'>
<p>第一步</p>
<p>请输入您的用户名
<input name="User" type="text" id="User" />
</p>
<p>
<button type="submit" class='btn'>下一步</button>
</p>
</form>
<?php 
} else {
    if (empty($_POST[ans])) {
        ?>
<form method="post" action="lost.php" class='form-inline center'>
<p>第二步</p>
<p>密码提示问题:<span class='label'>
<?php 
        $sql = "select pwdtipques from userinfo where usr='******'User'] . "'";
        $cnt = $p->dosql($sql);
        if ($cnt == 0) {
            异常("用户不存在!", 取路径("user/lost.php"));
        } else {
            $d = $p->rtnrlt(0);
            echo "{$d[pwdtipques]}?";
Example #24
0
<?php

require_once "../include/header.php";
gethead(1, "", "记录列表", $_GET['uid']);
$p = new DataAccess();
$q = new DataAccess();
?>
<div class='row-fluid'>
<a class="btn btn-success pull-left" href="graderlist.php">评测机列表</a>
<form id="search_submit" method="get" class='form-search center'>
<span>
用户UID
<input name="uid" type="number" value="<?php 
echo $_GET['uid'];
?>
" class='span1' />
题目PID
<input name="pid" type="number" value="<?php 
echo $_GET['pid'];
?>
" class='span1' />
<input name="show" type="hidden" value="<?php 
echo $_GET['show'];
?>
" />
<input name="display" type="hidden" value="<?php 
echo $_GET['display'];
?>
" />
<button type="submit" class='btn btn-primary'>检索</button>
</span>
Example #25
0
<?php

require_once "../include/header.php";
gethead(0, "sess", "");
$LIB->cls_compile();
$LIB->func_socket();
Example #26
0
$Province = $province;
$Sex = $gender;
$Username = $user_name;
$ReMarkName = $remark_name;
$u_m = substr($bb, strpos($bb, "&groups=") + 4);
$u_m = preg_replace('/[groups groups]+/i', '', $u_m);
$u_m = str_replace("==", "", $u_m);
$u_m = str_replace("&cnt=", "^", $u_m);
$u_m = str_replace("&name", "", $u_m);
$u_m = str_replace("id=", "id", $u_m);
$u_m = '?' . $u_m;
parse_str($u_m);
$fenzhu = 'id' . $group_id;
$fengzhu = ${$fenzhu};
$FakeId = $fakeid;
$img = gethead($token, $fakeid, $cookie);
//注意从此行开始以下代码无需更改
$filename = "{$fakeid}.jpg";
//要生成的图片名字
$jpg = $img;
//得到post过来的二进制原始数据
$file = fopen("img/" . $filename, "w");
//打开文件准备写入
fwrite($file, $jpg);
//写入
fclose($file);
//关闭
$imgurl = $siurl . "/img/" . $filename;
$voice = getvoice($token, $messageid, $cookie);
//var_dump($voice);
$sname = "{$messageid}.mp3";
Example #27
0
<?php

require_once "../include/header.php";
gethead(1, "sess", "邮件列表");
$uid = $_SESSION['ID'];
$p = new DataAccess();
$q = new DataAccess();
if ($_GET['toid']) {
    $_POST['title'] = "给" . $_GET['toid'] . "的邮件";
}
?>
<div class='center'>
<a class='btn btn-success' href="#sendmail" data-toggle='modal'><i class='icon-envelope icon-white'></i>发送信件</a>
</div>
<div id='sendmail' class='modal hide fade in'>
<form method="post" action="send.php" class='form-horizontal'>
<fieldset>
<div class='modal-header'>
<button class='close' data-dismiss='modal'>×</button>
<h3>发送信件</h3>
</div>
<div class='modal-body'>
<input name="fromid" type="hidden" value="<?php 
echo $uid;
?>
" />
<div class='control-group'>
<label class='control-label' for='title'>邮件主题</label>
<div class='controls'><input type='text' id='title' name="title" value="<?php 
echo $_POST['title'];
?>
Example #28
0
<?php

require_once "../include/header.php";
gethead(1, "修改比赛", "修改比赛场次");
?>
<div class='container'>
<?php 
$q = new DataAccess();
if ($_GET[action] == 'edit') {
    $p = new DataAccess();
    $sql = "select comptime.*,compbase.cname from comptime,compbase where comptime.cbid=compbase.cbid and comptime.ctid={$_GET[ctid]}";
    $cnt = $p->dosql($sql);
    $d = $p->rtnrlt(0);
} else {
    $now = time();
    $d[starttime] = mktime(19, 0, 0, date('m', $now), date('d', $now), date('Y', $now));
    $d[endtime] = mktime(22, 0, 0, date('m', $now), date('d', $now), date('Y', $now));
    $d[cbid] = $_GET[cbid];
    $d['group'] = 0;
    $d[showscore] = 1;
}
?>
<form method="post" action="doeditcomptime.php?action=<?php 
echo $_GET[action];
?>
&ctid=<?php 
echo $_GET[ctid];
?>
">
<table class='table table-striped table-condensed table-bordered fiexd'>
  <tr>
Example #29
0
<?php

require_once "../include/header.php";
$uid = (int) $_SESSION['ID'];
$pid = (int) $_GET['pid'];
$p = new DataAccess();
$sql = "select problem.*,groups.* from problem,groups where pid=" . (int) $_GET[pid] . " and groups.gid=problem.group limit 1";
$cnt = $p->dosql($sql);
$d = $p->rtnrlt(0);
$title = $d['probname'];
gethead(1, "", $pid . ". " . $title);
$LIB->hlighter();
$LIB->mathjax();
$q = new DataAccess();
$r = new DataAccess();
if ($cnt) {
    if ($d[readforce] > $_SESSION[readforce]) {
        异常("没有阅读权限!", 取路径("problem/index.php"));
    }
    if (!$d[submitable] && !有此权限('查看题目') && $d['addid'] != $uid) {
        异常("该题目不可提交!", 取路径("problem/index.php"));
    }
    $subgroup = $LIB->getsubgroup($q, $d['gid']);
    $subgroup[0] = $d['gid'];
    $promise = false;
    if ($uid == $d['addid']) {
        $promise = true;
    }
    foreach ($subgroup as $value) {
        if ($value == (int) $_SESSION['group']) {
            $promise = true;
Example #30
0
<?php

require_once "../include/header.php";
gethead(1, "查看比赛", "比赛评测");
?>
<div class='container'>
<?php 
if ($_POST['do'] == "评测选定") {
    echo "<h2>评测选定</h2>";
    $list = $_POST['doit'];
} else {
    if ($_POST['do'] == "评测全部") {
        echo "<h2>评测全部</h2>";
        $list = $_POST['doall'];
    }
}
if (!is_array($list)) {
    $list = array();
}
sort($list);
?>

<script language="javascript">
var HTTP;
var list = new Array(<?php 
$cnt = 0;
foreach ($list as $k => $v) {
    echo "{$v},";
    $cnt++;
}
echo 0;