• [织梦吧]唯一域名:www.dedecms8.com,织梦DedeCMS学习平台.

当前位置: > DedeCMS教程 > Dedecms二次开发 >

织梦dedecms插件之在线报名开发实例解析,插件开发教程(3)

来源: www.dedecms8.com 编辑:织梦吧 时间:2013-03-06点击:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<head> 

<title>{dede:global.cfg_webname/}-在线报名</title> 

<link href="{dede:global.cfg_templeturl/}/style/dedecms.css" rel="stylesheet" media="screen" type="text/css" /> 

</script> 

</head> 

<body> 

{dede:include filename="../default/head.htm"/}<!-- 包含头部 --> 

<blockquote style="margin:50px auto" > 

<form method="post" action=""> 

姓 名:<input type="text" size=30 name="name" /><br /><br /> 

邮 箱:<input type="text" size=30 name="mail" /><br /><br /> 

<!--vdimgck.php 是验证码--> 

验证码:<input type="text" name="validation" /><img src="../../include/vdimgck.php" /><br /><br /> 

<input name="encoll" type="submit" value="报名" /><br /> 

</form> 

</blockquote> 

{dede:include filename="../default/footer.htm"/}<!-- 包含尾部 --> 

</body> 

</html>

 

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();//显示页面 

}


?>

 

About D8

  • ©2014 织梦吧(d8) DedeCMS学习交流平台
  • 唯一网址 www.DedeCMS8.com 网站地图
  • 联系我们 1978130638@qq.com ,  QQ