adenroll.php如下:
代码如下:
<?php
require_once(dirname(__FILE__).'/config.php');//后台配置文件 检查登陆 配置信息
require_once(DEDEINC."/datalistcp.class.php");//包含分页类
if($_GET['action']&&$_GET['id']){
if($_GET['action']=='pass'){//各种操作
$db->ExecuteNoneQuery("update cms_enroll set `tag`=1 where id='$_GET[id]'");
ShowMsg('录取成功','adenroll.php');
}
if($_GET['action']=='nopass'){
$db->ExecuteNoneQuery("update cms_enroll set `tag`=0 where id='$_GET[id]'");
ShowMsg('取消录取','adenroll.php');
}
if($_GET['action']=='delete'){
$db->ExecuteNoneQuery("delete from cms_enroll where id='$_GET[id]'");
ShowMsg('删除成功','adenroll.php');
}
}else{
$dl = new DataListCP();
$dl->pageSize = 10;//每页显示10条
$dl->SetTemplate('./templets/adenroll.htm');//载入模板
$sql="select * from cms_enroll";
$dl->SetSource($sql);//执行sql 不能与$dl->SetTemplate 颠倒
$dl->Display();//显示页面
}
?>
require_once(dirname(__FILE__).'/config.php');//后台配置文件 检查登陆 配置信息
require_once(DEDEINC."/datalistcp.class.php");//包含分页类
if($_GET['action']&&$_GET['id']){
if($_GET['action']=='pass'){//各种操作
$db->ExecuteNoneQuery("update cms_enroll set `tag`=1 where id='$_GET[id]'");
ShowMsg('录取成功','adenroll.php');
}
if($_GET['action']=='nopass'){
$db->ExecuteNoneQuery("update cms_enroll set `tag`=0 where id='$_GET[id]'");
ShowMsg('取消录取','adenroll.php');
}
if($_GET['action']=='delete'){
$db->ExecuteNoneQuery("delete from cms_enroll where id='$_GET[id]'");
ShowMsg('删除成功','adenroll.php');
}
}else{
$dl = new DataListCP();
$dl->pageSize = 10;//每页显示10条
$dl->SetTemplate('./templets/adenroll.htm');//载入模板
$sql="select * from cms_enroll";
$dl->SetSource($sql);//执行sql 不能与$dl->SetTemplate 颠倒
$dl->Display();//显示页面
}
?>
adenroll.html文件如下:
代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""<a >http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>">
<head>
<title>在线报名管理</title>
<link rel='stylesheet' type='text/css' />
<style type="text/css">
th,td{
text-align:center;
border:1px #D1DDAA solid;
font-size:15px;
}
th{
background:#E6F8B7;
}
table{
margin-top:20px;
}
</style>
</head>
<body>
<table width="90%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<th>姓名</th>
<th>E-mail</th>
<th>状态</th>
<th>操作</th>
</tr>
<!-- 循环得到结果 -->
{dede:datalist}
<tr>
<td>{dede:field.name /}</td>
<td>{dede:field.mail /}</td>
<td>
{dede:if field.tag==0}
未录取
{else}
<font color="red">已录取</font>
{/dede:if}
</td>
<td> <a >[录取]</a>
|
<a >[不通过]</a>
|
<a >[删除]</a>
</td>
</tr>
{/dede:datalist}
</table>
<!-- 分页标签 -->
<p style="text-align:center;font-size:15px;">{dede:pagelist listitem="info,index,end,pre,next,pageno" listsize="5"/}</p>
</body>
</html>
<head>
<title>在线报名管理</title>
<link rel='stylesheet' type='text/css' />
<style type="text/css">
th,td{
text-align:center;
border:1px #D1DDAA solid;
font-size:15px;
}
th{
background:#E6F8B7;
}
table{
margin-top:20px;
}
</style>
</head>
<body>
<table width="90%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<th>姓名</th>
<th>E-mail</th>
<th>状态</th>
<th>操作</th>
</tr>
<!-- 循环得到结果 -->
{dede:datalist}
<tr>
<td>{dede:field.name /}</td>
<td>{dede:field.mail /}</td>
<td>
{dede:if field.tag==0}
未录取
{else}
<font color="red">已录取</font>
{/dede:if}
</td>
<td> <a >[录取]</a>
|
<a >[不通过]</a>
|
<a >[删除]</a>
</td>
</tr>
{/dede:datalist}
</table>
<!-- 分页标签 -->
<p style="text-align:center;font-size:15px;">{dede:pagelist listitem="info,index,end,pre,next,pageno" listsize="5"/}</p>
</body>
</html>
希望本文所述对大家的dedecms二次开发有所帮助。
标签:织梦DedeCMS
相关阅读 >>
dedecms5.7后台发布文章提示“标题不能为空”的解决方法
解决更换php5.4以上版本后dedecms后台登录空白问题的方法
更多相关阅读请进入《织梦DedeCMS》频道 >>
相关推荐
评论
管理员已关闭评论功能...
- 欢迎访问木庄网络博客
- 可复制:代码框内的文字。
- 方法:Ctrl+C。