大部分使用模板的PHP里都有解决这种问题的现成代码,拷贝来用用就好。
解决方案 »
- 求助各位大侠啊,帮帮忙,请尽量说的详细点,本人新手
- power builder代码 那位大大帮忙转成php的 谢谢了
- .htaccess 疑问
- 数组取值,求解
- 大虾们!大虾们!PHP菜鸟入门问题
- 类似于&#xxxx 的是什么编码方式?如何转化为gbk或者gb2312就是汉字格式?
- mysql 线程问题,请教大侠们,顶者有分!
- require_once怎么没反应呢?
- 哈哈,工作之余,大家开心一下,看看这个字符自动生成程序^_^
- 连接oracle817时提示找不到OCILogon(),还要怎么配置?
- Javascript如何操作Cookie?
- 【200分】问个我这种有限分类的显示树的方法和找到某一层的方法
require_once("../inc/define.inc.php");
require_once("../inc/checklogin.inc.php");
require_once("../inc/page.inc.php");
require_once "fasttemplate/class.FastTemplate.php3";
$oper = $_GET["oper"];
if($oper == "delete")
{
$Users = $_POST["users"];
DeleteUsers($Users);
header("location:regmessage.php?status=12");
}
$type = $_GET["type"];
if($type == "confirm")
{
$id = $_GET["id"];
ConfirmMember($id);
echo "<script language='javascript'>alert(\"批准成功!\");window.location='user_list.php';</script>";
exit();
}
//check oper
$tpl=new FastTemplate("./tpl");
$tpl->define(array(main => "user_list.tpl"));
$tpl->define_dynamic("row2","main");
/************* show page*********************************************************************/
set_time_limit(0);
$pagesize=20;
$Page = $_GET["pagecount"];
if(!isset($Page))
{
$Page = 1;
}
$show_start = ($Page -1 )*$pagesize;
$p=new show_page;
$p->pvar="pagecount";
$where = "";
GetUserInfo(&$Userinfo,&$totle_num, $pagesize, $Page);
if($totle_num == 0)
{
header("location:regmessage.php?status=5");
exit();
}
$p->set($pagesize,$totle_num);
for($i=0;$i< $pagesize;$i++)
{
if($show_start < $totle_num)
{
$sub = $Userinfo[$i][Subsibe] == 1 ? "是" : "否";
$id = $Userinfo[$i][User_id];
if($Userinfo[$i][User_status] == 1)
{
$sub = "<a href='user_list.php?id=$id&type=confirm'>批准</a>";
}
$tpl->assign(USER_ID, $Userinfo[$i][User_id]);
$tpl->assign(USER_NAME, $Userinfo[$i][User_name]);
$tpl->assign(USER_TYPE, $UserType[$Userinfo[$i][User_type]]);
$tpl->assign(SUBSIBE, $sub);
$tpl->assign(USER_EMAIL, $Userinfo[$i][User_email]);
$tpl->assign(LAST_LOGIN_TIME, $Userinfo[$i][Last_login_time]);
$show_start++;
$tpl->parse(ROW2,".row2");
}
}
$showpage=$p->output(1);
$tpl->assign(SHOWPAGE,$showpage);
$tpl->parse(BODY,"main");
$tpl->FastPrint("BODY");
?>
<table class="showframe" width="750">
<tr>
<td width="140" class="showhd" align="center">用户名</td>
<td width="100" class="showhd" align="center">用户类型</td>
<td width="100" class="showhd" align="center">付费会员</td>
<td width="120" class="showhd" align="center">用户EMAIL</td>
<td width="180" class="showhd" align="center">上次登录时间</td>
<td width="100" class="showhd" align="center">详细信息</td>
</tr>
</table>
<div id="divAll">
<table class="showdata" width="750">
<!-- BEGIN DYNAMIC BLOCK: row2 -->
<tr>
<td width="5" class="showtd"> <input type="checkbox" name="users[]" value="{USER_ID}"></td>
<td width="135" class="showtd" align="center">{USER_NAME}</td>
<td width="140" class="showtd" align="center">{USER_TYPE}</td>
<td width="120" class="showtd" align="center">{SUBSIBE}</td>
<td width="120" class="showtd" align="center">{USER_EMAIL}</td>
<td width="180" class="showtd" align="center">{LAST_LOGIN_TIME}</td>
<td width="100" class="showtd" align="center"><a href="user_add.php?type=edit&User_id={USER_ID}">详细信息</a></td>
</tr>
<!-- END DYNAMIC BLOCK: row2 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../css/main1.css">
<title>网址列表</title>
<script language="javascript" src="../js/function.js"></script>
<script language="javascript" >
function User_add(myform)
{
myform.action = "user_add.php?oper=add";
myform.submit();
}
function User_delete(myform)
{
var length = divAll.all.length;
var checkedcount=0;
for(i=0;i<length;i++)
{
if(divAll.all(i).type == "checkbox")
{
if(divAll.all(i).checked == true)
{
checkedcount += 1;
}
}
}
if(checkedcount == 0)
{
alert("请选择一个要删除的用户!");
return;
}
if(confirm("确定要删除用户吗?"))
{
myform.action = "user_list.php?oper=delete";
myform.submit();
}
}
</script>
</head>
<body bgcolor="99ccff">
<form name="myform" action="" method="post"><table border="0" width="750" >
<tr>
<td colspan="2" height="30">
<font class="showtitle">系统管理>>用户管理</font>
</td>
<tr>
</table>
<table>
<tr>
<td width="10">
</td>
<td >
<table class="showframe" width="750">
<tr>
<td width="140" class="showhd" align="center">用户名</td>
<td width="100" class="showhd" align="center">用户类型</td>
<td width="100" class="showhd" align="center">付费会员</td>
<td width="120" class="showhd" align="center">用户EMAIL</td>
<td width="180" class="showhd" align="center">上次登录时间</td>
<td width="100" class="showhd" align="center">详细信息</td>
</tr>
</table>
<div id="divAll">
<table class="showdata" width="750">
<!-- BEGIN DYNAMIC BLOCK: row2 -->
<tr>
<td width="5" class="showtd"> <input type="checkbox" name="users[]" value="{USER_ID}"></td>
<td width="135" class="showtd" align="center">{USER_NAME}</td>
<td width="140" class="showtd" align="center">{USER_TYPE}</td>
<td width="120" class="showtd" align="center">{SUBSIBE}</td>
<td width="120" class="showtd" align="center">{USER_EMAIL}</td>
<td width="180" class="showtd" align="center">{LAST_LOGIN_TIME}</td>
<td width="100" class="showtd" align="center"><a href="user_add.php?type=edit&User_id={USER_ID}">详细信息</a></td>
</tr>
<!-- END DYNAMIC BLOCK: row2 -->
</table>
</div>
</td>
</tr>
</table>
<table>
<tr>
<td width="580" align="center">
<font class="normal">{SHOWPAGE}</font></form>
</td>
</tr>
</table>
<br>
<table>
<tr>
<td width="580" align="center">
<!--input type="submit" class="showbuttons" value="添加用户" onclick="User_add(myform)"-->
<input type="submit" class="showbuttons" value="删除用户" onclick="User_delete(myform)">
</td>
</tr>
</table>
</form>
</body>
</html>
晕,没有发完!
{secion name=i loop=$value}
<tr>
<td>{$value[i]['name']}</td><td>{$value[i]['id']}</td><td>{$value[i]['info']}</td>
</tr>
{/section}