• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP gethead函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中gethead函数的典型用法代码示例。如果您正苦于以下问题:PHP gethead函数的具体用法?PHP gethead怎么用?PHP gethead使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了gethead函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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) {
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:report.php


示例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}");
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:export.php


示例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' && 有此权限('测试题目')) {
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:judge.php


示例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"));
}
开发者ID:Zhi2014,项目名称:cogs,代码行数:18,代码来源:doeditcompbase.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">_&lt;时间&gt;.sql.gz</span>
</div>
<button type="submit" class='btn btn-primary pull-right'>备份数据库</button>
</form>
开发者ID:Zhi2014,项目名称:cogs,代码行数:30,代码来源:backup.php


示例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']}"));
}
开发者ID:Zhi2014,项目名称:cogs,代码行数:20,代码来源:addsol.php


示例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"));
开发者ID:Zhi2014,项目名称:cogs,代码行数:9,代码来源:doeditkey.php


示例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]);
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:comptime.php


示例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;
        }
    }
}
开发者ID:robot0516,项目名称:wxsq,代码行数:38,代码来源:function.php


示例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])) {
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:submit.php


示例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) {
            ?>
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:comments.php


示例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>
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:index.php


示例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>
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:editgroup.php


示例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++) {
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:compbase.php


示例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>");}
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:editprob.php


示例16: gethead

<?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>
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:loginlog.php


示例17: gethead

<?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='" . $_POST['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'])) {
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:doreg.php


示例18: fopen

        } 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>
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:code.php


示例19: gethead

<?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') {
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:editpage.php


示例20: gethead

<?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>
开发者ID:Zhi2014,项目名称:cogs,代码行数:31,代码来源:privilege.php



注:本文中的gethead函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP gethook函数代码示例发布时间:2022-05-15
下一篇:
PHP getgroupname函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap