?? user_detail.jsp
字號:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.util.*" errorPage="" %>
<%@ page session="true" %>
<%
if (session.getAttribute("username")==null || session.getAttribute("passwd")==""){
//response.sendRedirect("error.htm");
} %>
<%@ page import="bookshop.book.*" %>
<jsp:useBean id="user" scope="page" class="bookshop.run.op_user" />
<%
long userid=0;
String mesg = "";
if (request.getParameter("userid")!=null && !request.getParameter("userid").equals("")) {
try {
userid = Long.parseLong(request.getParameter("userid"));
if (!user.getUserinfo(userid)) {
mesg = "要查詢的用戶信息不存在";
}
} catch(Exception e) {
mesg = "該用戶號不存在!";
}
}
if (request.getParameter("action")!=null && request.getParameter("action").equals("del")){
try{
long id = Long.parseLong(request.getParameter("userid"));
if (user.delete(id)) {
mesg = "刪除操作成功";
} else {
mesg = "刪除操作出錯";
}
} catch (Exception e) {
mesg = "你要刪除的用戶號錯誤";
}
}
%>
<html>
<head>
<title>查看用戶詳細資料</title>
<link rel="stylesheet" href="books.css" type="text/css">
</head>
<body background="image/bizhi.jpg" onload="javascript:window.focus();">
<div align="center">
<p>查看用戶詳細情況:</p>
<% if (!mesg.equals("")){
out.println("<font color=red>"+ mesg +"</font><br><br>");
} else {
user userinfo = (user)user.getUserlist().elementAt(0);
%>
<table width="95%" border="1" cellspacing="1" cellpadding="1">
<tr><td align=right width=100>用戶名</td><td><%= userinfo.getUserName() %></td></tr>
<tr><td align=right width=100>用戶真名</td><td><%= userinfo.getNames() %></td></tr>
<tr><td align=right width=100>性別</td><td><%= userinfo.getSex() %></td></tr>
<tr><td align=right width=100>聯系地址</td><td><%= userinfo.getAddress() %></td></tr>
<tr><td align=right width=100>聯系電話</td><td><%= userinfo.getPhone() %></td></tr>
<tr><td align=right width=100>郵編</td><td><%= userinfo.getPost() %></td></tr>
<tr><td align=right width=100>電子郵件</td><td><%= userinfo.getEmail() %></td></tr>
<tr><td align=right width=100>注冊來源</td><td><%= userinfo.getRegIpAddress() %></td></tr>
<tr><td align=right width=100>注冊時間</td><td><%= userinfo.getRegTime() %></td></tr>
</table>
<br>
<a href="user_modify.jsp?userid=<%= userinfo.getId()%>">修改</a>
<%}%>
<br><p><a href="javascript:window.close()">關閉窗口</a></p>
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -