<tr id="headerTitle"><td colspan="10">管理员列表</td></tr>
</table>
<table>
<tr id="headTitle"><td>编号</td><td>姓名</td><td>密码</td><td>性别</td><td>手机号码</td><td>邮箱</td><td>地址</td><td>消费</td><td>操作</td></tr>
<c:choose>
<c:when test="${empty table}">暂时没有</c:when>
<c:otherwise>
<c:forEach items="${table}" var="en">
<tr id="content"><td>${en.id }</td><td>${en.name }</td><td>${en.pwd }</td><td>${en.sex }</td><td>${en.tel }</td><td>${en.email }</td><td>${en.address }</td><td>${en.moneyes }</td><td id="add"><a href="admin/use/addAdminUse.jsp">新增</a>|<a href="admin/use/updateAdminUse.jsp?id=${en.id }">修改</a>|<a href="admin/use/deleteAdminUse.jsp?id=${en.id }">删除</a></td></tr>
</c:forEach>
</c:otherwise>
</c:choose>
<tr id="headerfooer"><td colspan="10">
第${currentPage }页/共${totalPage }页
<a href="UseAdminServlet?pageIndex=1">首页</a>
<c:choose>
<c:when test="${currentPage>1}">
<a href="UseAdminServlet?pageIndex=${currentPage-1 }">上一页</a>
</c:when>
<c:otherwise>
上一页
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${currentPage<totalPage}">
<a href="UseAdminServlet?pageIndex=${currentPage+1 }">下一页</a>
</c:when>
<c:otherwise>
下一页
</c:otherwise>
</c:choose>
<a href="UseAdminServlet?pageIndex=${totalPage }">尾页</a>
</td></tr>
</table>
----------------------------------------------------------------
<form action="admin/use/updateAction.jsp" method="post">
<input type="hidden" name="id" value="<%=id %>">
<div id="frame1">
<table>
<tr><td colspan="2">管理员修改信息</td></tr>
</table>
</div>
<div id="frame2">
<table >
<tr ><td>用户名: </td><td><input id="frameColor" name="name" value="<%=en.getName() %>" /></td></tr>
<tr id="frametable"><td></td></tr>
<tr><td>密码: </td><td><input id="frameColor" name="pwd" value="<%=en.getPwd() %>"/></td></tr>
<tr id="frametable"><td></td></tr>
<tr><td>性别: </td><td><input id="frameColor" name="sex" value="<%=en.getSex() %>"/></td></tr>
<tr id="frametable" ><td></td></tr>
<tr><td>手机号码: </td><td><input id="frameColor" name="tel" value="<%=en.getTel()%>"/></td></tr>
<tr id="frametable"><td></td></tr>
<tr><td>邮箱: </td><td><input id="frameColor" name="email" value="<%=en.getEmail() %>"/></td></tr>
<tr id="frametable"><td></td></tr>
<tr><td>地址: </td><td><input id="frameColor" name="address" value="<%=en.getAddress() %>"/></td></tr>
<tr id="frametable"><td></td></tr>
<tr><td colspan="2" ><input type="submit" value="修改"/></td></tr>
</table>
</div>
</form>
--------------------------------------------------
request.setCharacterEncoding("UTF-8");
response.setContentType("tex/html;charset=UTF-8");
String sid=request.getParameter("id");
int id=Integer.parseInt(sid);
String name=request.getParameter("name");
String pwd=request.getParameter("pwd");
String sex=request.getParameter("sex");
String tel=request.getParameter("tel");
String email=request.getParameter("email");
String address=request.getParameter("address");
UseAdminDAO im=new UseAdminDAOImple();
int result=im.UpdateByID(id,name,pwd,sex,tel,email,address);
if(result>0)
{
response.sendRedirect("UseAdminServlet");
}
else
{
response.sendRedirect("error.jsp");
}