www.gusucode.com > 仿51.com的php源码 1.1 > admin/admin_user.php
<?php include("ck_login.php"); include("../include/dbclass.php"); include("../include/page.php"); $dbc=new DbConn(); $maxline = 25; $key=$_GET["key"];$page=(int)$_GET["page"]; $deferentparameter="&key=".$key; $action=$_GET["action"]; if($action=="up") { $id=$_GET["id"]; $i=$_GET["i"]; $sql="update userdata set Show_Default='$i' where id='$id'"; $dbc->Execute($sql); header("Location:admin_user.php?page=$page"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <link rel="stylesheet" href="admin_style.css"> <style type="text/css"> <!-- .STYLE1 { color: #000000; font-weight: bold; } --> </style> <script language="JavaScript"> function setopen(v) { location.href="LeaveWordToOther.php?action=setopen&value="+v; } function selectItem(obj,s){ if(s){ obj.parentElement.bgColor="#ffcc00"; } else{ obj.parentElement.bgColor="#efefef"; } } function selectAll() { var acb_status = document.all("acb").checked; var cbs=document.all("cb"); if(!cbs) return; if(cbs.length) { for(var i=0;i<cbs.length;i++) { cbs.item(i).checked = acb_status; } } else document.all("cb").checked = acb_status; } function joinValue() { var cbs=document.all("cb"); if(!cbs) return; document.all("arg").value=""; //alert(cbs.length); if(cbs.length) { for(var i=0;i<cbs.length;i++) if(cbs.item(i).checked) { document.all("arg").value+=(cbs.item(i).value+","); } document.all("arg").value=document.all("arg").value.substring(0,document.all("arg").value.length-1); } else { if(cbs.checked) { document.all("arg").value=cbs.value; } } } function init() { var cbs=document.all("cb"); if(!cbs) return; if(!cbs.length && document.all("acb")) { document.all("acb").disabled=true; } } function delList() { if(document.all("acb").disabled==true) return; joinValue(); if(document.all("arg").value) { if(confirm("确认删除所选的用户么?删除后将删除所有信息与资料!")) { window.self.location="?action=delComment&id=" + document.all("arg").value + "&page=<?php echo $page; ?>"; } } else { alert('选择不能为空!'); } return false; } </script><script src="../js/global.js" language="javascript"></script> </head> <body> <table cellpadding="2" cellspacing="1" border="0" width="100%" class="border" align=center> <tr align="center"> <td height=25 colspan=2 class="topbg"><span class="STYLE1"> 会员管理</span></tr> <tr><td> </td> </tr> </table> <br> <table cellspacing="1" border="0" class="border" align=center width="100%" id="table1" height="25"><tr align=center><td class="tdbg"><form> 用户名: <input name="key" type="text" class="input" value=""/> <input name="Submit" type="submit" class="btn" value="搜 索" /> </form></td></table> <br> <form name="form1" method="post" action="?action=dellist&page="> <input type="Hidden" name="arg"> </form> <table cellspacing="1" border="0" class="border" align=center width="100%" id="table1" height="25"> <tr align=center> <td class="topbg" height="28" width="10%"> <input type='Checkbox' name='acb' onclick='selectAll()' id="selectall" /> <label for="selectall">全选</label> <a href="###" onclick='delList()'>删除所选用户</a></td> <td class="topbg" height="28" width="10%"><b>会员名</b></td> <td class="topbg" height="28" width="20%"><b>是否VIP</b></td> <td class="topbg" height="28" width="20%"><b>注册时间</b></td> <td class="topbg" height="28" width="15%"><b>推荐</b></td> <td class="topbg" height="28" width="15%"><b>修改</b></td> <td class="topbg" height="28" width="15%"><b>删除</b></td> </tr> <?php $page=(int)$_GET["page"]; if($key=="") { $sql="select User_Account,id,RegTime,huiyuan,Show_Default from userdata order by Show_Default desc, huiyuan desc,RegTime desc"; } else { $sql="select User_Account,id,RegTime,huiyuan,Show_Default from userdata where User_Account like '$key' order by Show_Default desc, huiyuan desc,RegTime desc"; } $news = $dbc->getGopageRs($sql,$maxline); //echo "$sql"; $gopage = new GoPage($dbc->tpages,$dbc->total);//建立翻页程序 $backurl = "admin_user.php?".$dbc->getParameter(); for($i=0;$i<$dbc->num_rows;$i++) {?> <tr align=center> <td class="tdbg"><input type="checkbox" onclick='selectItem(this.parentElement,this.checked)' name='cb' value='<?php echo $news[$i]["id"]; ?>' /></td> <td class="tdbg" height=25 width="10%"><a href="/home.php?user=<?php echo $news[$i]["User_Account"]; ?>" target="_blank" ><?php echo $news[$i]["User_Account"]; ?></a></td> <td class="tdbg" height=25 width="20%"><?php if((int)$news[$i]["huiyuan"]>0){?><font color=red>VIP会员</font><?php }else{?>普通会员<?php }?></td> <td class="tdbg" height=25 width="20%"><?php echo date("Y-m-d",strtotime($news[$i]["RegTime"]));?></td> <td class="tdbg" height=25 width="15%"><?php if((int)$news[$i]["Show_Default"]>0){?><a href="?action=up&i=0&id=<?php echo $news[$i]["id"]; ?>"><font color="#FF0000">推荐</font></a><?php }else{?> <a href="?action=up&i=1&id=<?php echo $news[$i]["id"]; ?>">未推荐</a><?php }?></td> <td class="tdbg" height=25 width="15%">修改</td> <td class="tdbg" height=25 width="15%">删除</td> </tr> <?php }?> </table> <br> <table cellspacing="1" border="0" class="border" align=center width="100%" id="table1" height="25"><tr align=center><td class="tdbg"><?=$gopage->style(2)?></td></table> </body> </html>