<%@page contentType="text/html; charset=GBK"%><%@include file="../../include/Admin.jsp"%><%@include file="../../include/DBCon.jsp"%><%if(!StrFormat.isNull(request.getParameter("act"))){if(StrFormat.isNum(request.getParameter("id")) && request.getParameter("act").equals("del")){if(!request.getParameter("id").equals("1")){try{DBSql="delete from admin where id="+request.getParameter("id").trim();DBStmt = DBCon.createStatement();DBStmt.executeUpdate(DBSql);MesStr = "删除成功！";}catch(Exception ie){MesStr = "修改失败！";if(isShowErr!=0){MesStr += "\\r\\nErrInfo:"+ie;}}finally{if(DBStmt!=null)DBStmt.close();}}else{MesStr = "删除失败！";}}else{MesStr = "操作错误！";}out.print("<script language=\"javascript\">alert(\""+MesStr+"\");history.back();</script>");}else{%><html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK" /><meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache,must-revalidate"> <meta http-equiv="expires" content="mon,23 jan 1978 12:52:30 gmt"><meta name="keywords" content="向继根,Xiang Jigen,QQ,190582560"><meta name="description" content="Programmer:向继根 QQ:190582560 Email:190582560@qq.com"><meta name="author" content="向继根,Xiang Jigen" /><title><%=TitleStr%>管理员管理</title><link rel="stylesheet" type="text/css" href="../images/Style.css"/><script type="text/javascript" src="../../js/min.js"></script><script type="text/javascript" src="../../js/common.js"></script><script type="text/javascript" src="../../js/css.js"></script><script type="text/javascript">function doDel(id){	confirmurl('AdminList.jsp?act=del&id='+id,'确认要 删除 此管理员吗？');	return false;}</script></head><body><table cellpadding="0" cellspacing="1" class="table_list"><caption>管理员管理</caption><tr><td><a href="AddAdmin.jsp"><span class="red">添加管理员</span></a>&nbsp;<span class="black">|</span>&nbsp;<a href="AdminList.jsp?do=list">全部显示</a><%DBSql="select id,name from role order by id asc";try{DBStmt = DBCon.createStatement();DBRs = DBStmt.executeQuery(DBSql);while(DBRs.next()){out.print("&nbsp;<span class=\"black\">|</span>&nbsp;<a href=\"AdminList.jsp?do=list&roleid="+DBRs.getInt("id")+"\">"+StrFormat.isNull(DBRs.getString("name"),"")+"</a>");}}finally{if(DBRs!=null)DBRs.close();if(DBStmt!=null)DBStmt.close();}%></td></tr></table><table cellpadding="0" cellspacing="1" class="table_list"><caption>管理员列表</caption><tr><th width="5%" class="align_c"><strong>序号</strong></th><th width="20%" class="align_c"><strong>姓名</strong></th><th width="25%" class="align_c"><strong>管理角色</strong></th><th width="20%" class="align_c"><strong>最后登录 Time</strong></th><th width="20%" class="align_c"><strong>最后登录 IP</strong></th><th width="10%" class="align_c"><strong>管理操作</strong></th></tr><%String NowPage="",FileName="",Footer="",WhereStr="";NowPage = request.getParameter("page");	FileName="AdminList.jsp?do=list";if(StrFormat.isNull(NowPage)||!StrFormat.isNum(NowPage)){NowPage="1";} if(!StrFormat.isNull(request.getParameter("roleid")) && StrFormat.isNum(request.getParameter("roleid")) && !request.getParameter("roleid").equals("0")){		WhereStr+=" and a.roleid="+request.getParameter("roleid").trim();		FileName+="&roleid="+request.getParameter("roleid").trim();}DBSql="select r.name AS RName,a.id,a.name AS AName,a.`user`,a.roleid,a.lasttime,a.lastip"		+" from admin AS a Left Join role AS r ON a.roleid = r.id where a.id!=0"		+WhereStr+" order by a.id desc";GenPages pages=new GenPages(DBCon);pages.setPageSize(PageSize);pages.setNowPage(Integer.parseInt(NowPage));pages.setFileName(FileName);try{	pages.setQuery(DBSql); 	Footer=pages.getFooter();if(pages.getCountPage()>0){ 		DBRs=pages.getResult();	int i=pages.StartRows();		while(DBRs.next()){i++;%><tr><td class="align_c">&nbsp;<%=i%></td><td class="align_c">&nbsp;<a href="AdmInfo.jsp?id=<%=DBRs.getInt("id")%>"><%=StrFormat.isNull(DBRs.getString("user"),"")%></a><span class="gray">(<%=StrFormat.isNull(DBRs.getString("AName"),"")%>)</span></td><td>&nbsp;<%=StrFormat.isNull(DBRs.getString("RName"),"")%></td><td class="align_c"><span class="black"><%=StrFormat.isNull(DBRs.getString("lasttime"),"")%></span></td><td class="align_c"><span class="black"><%=StrFormat.isNull(DBRs.getString("lastip"),"")%></span></td><td class="align_c"><%if(DBRs.getInt("id")==1){out.print("<span class=\"gray\">修改</span>&nbsp;<span class=\"black\">|</span>&nbsp;<span class=\"gray\">删除</span>");}else{out.print("<a href=\"AdmModInfo.jsp?id="+DBRs.getInt("id")+"\">修改</a>&nbsp;<span class=\"black\">|</span>&nbsp;<a href=\"javascript:void(0);\" onClick=\"doDel('"+DBRs.getInt("id")+"');return false;\">删除</a>");}%></td></tr><%	 	}	}else{		out.print("<tr><td colspan=\"6\" class=\"align_c\" valign=\"middle\">暂时没有内容</td></tr>");}}finally{if(DBRs!=null)DBRs.close();if(DBStmt!=null)DBStmt.close();}%></table><div id="pages"><%=Footer%></div></body></html><%}%><%@include file="../../include/DBConClose.jsp"%>