本文整理汇总了PHP中gethead函数的典型用法代码示例。如果您正苦于以下问题:PHP gethead函数的具体用法?PHP gethead怎么用?PHP gethead使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gethead函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gethead
<?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) {
示例2: gethead
<?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}");
示例3: gethead
<?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' && 有此权限('测试题目')) {
示例4: gethead
<?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"));
}
示例5: gethead
<?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">_<时间>.sql.gz</span>
</div>
<button type="submit" class='btn btn-primary pull-right'>备份数据库</button>
</form>
示例6: gethead
<?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']}"));
}
示例7: gethead
<?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"));
示例8: gethead
<?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]);
示例9: wq_lurupic
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;
}
}
}
示例10: gethead
<?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])) {
示例11: gethead
<?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) {
?>
示例12: gethead
<?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>
示例13: gethead
<?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>
示例14: gethead
<?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++) {
示例15: gethead
<?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>");}