<%@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("mod")){if(request.getParameter("phone").length()==11){try{DBSql = "update admin set user='"+ StrTrans.toGBK(request.getParameter("user")) +"',roleid='"+ request.getParameter("roleid") +"' where id="+request.getParameter("id");DBStmt = DBCon.createStatement();DBStmt.executeUpdate(DBSql);MesStr = "修改成功！";}catch(Exception ie){MesStr = "修改失败！";if(isShowErr!=0){MesStr += "\\r\\nErrInfo:"+ie;}}finally{if(DBRs!=null)DBRs.close();if(DBStmt!=null)DBStmt.close();}}else{MesStr = "联系电话错误！";}}else{MesStr = "操作错误！";}out.print("<script language=\"javascript\">alert(\""+MesStr+"\");history.back(-2);</script>");}else{String name="",user="";int id=0,roleid=0;if(StrFormat.isNum(request.getParameter("id"))){DBSql = "select id,name,user,roleid from admin where id="+request.getParameter("id");try{DBStmt = DBCon.createStatement();DBRs = DBStmt.executeQuery(DBSql);if(DBRs.next()){id=DBRs.getInt("id");name=StrFormat.isNull(DBRs.getString("name"),"");user=StrFormat.isNull(DBRs.getString("user"),"");roleid=DBRs.getInt("roleid");}}finally{if(DBRs!=null)DBRs.close();if(DBStmt!=null)DBStmt.close();}}else{out.print("<script language=\"javascript\">alert(\"操作错误！\");history.back();</script>");}%><html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK" /><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 doCheck(){if(isNull($GenID('user').value)){alert('姓名不能为空！');		$GenID('user').focus();return false;}	return true;}</script></head><body><form action="?act=mod" method="post" name="form" id="form" onSubmit="return doCheck();"><table cellpadding="0" cellspacing="1" class="table_list"><caption>修改管理员资料</caption><tr><th width="20%"><strong>昵 称</strong></th><td>&nbsp;<span class="red"><%=name%></span></td></tr><tr><th><span class="red">*</span> <strong>姓 名</strong></th><td>&nbsp;<input type="text" name="user" id="user" value="<%=user%>" size="16" /></td></tr><tr><th><strong>分配角色</strong></th><td>&nbsp;<select name="roleid" id="roleid" size="1">	<%DBSql="select id,name from role order by id asc";try{DBStmt = DBCon.createStatement();DBRs = DBStmt.executeQuery(DBSql);while(DBRs.next()){if(roleid==DBRs.getInt("id")){out.println("<option value=\""+DBRs.getInt("id")+"\" selected>"+StrFormat.isNull(DBRs.getString("name"),"")+"</option>");}else{out.println("<option value=\""+DBRs.getInt("id")+"\" >"+StrFormat.isNull(DBRs.getString("name"),"")+"</option>");}}}finally{if(DBRs!=null)DBRs.close();if(DBStmt!=null)DBStmt.close();}%>	</select></td></tr></table><div id="button"><input name="id" type="hidden" id="id" value="<%=id%>"><input type="submit" name="dosubmit" class="button_style" value="确 定" />&nbsp;<input type="reset" name="reset" class="button_style" value="清 除" />&nbsp;<input type="button" name="button" class="button_style" value="返 回" onClick="history.back();"></div></form></body></html><%}%><%@include file="../../include/DBConClose.jsp"%>