📄 yonghuxinxichaxun.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@include file="sql2005_book.jsp"%>
<!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>
<style type="text/css">
<!--
.STYLE1 {
font-family: "方正胖头鱼简体";
font-size: 36px;
color: #0099FF;
}
.STYLE2 {
font-family: "微软雅黑";
font-size: 24px;
color: #99CC00;
}
.STYLE3 {
font-size: 14px;
font-family: "微软雅黑";
}
.STYLE4 {font-size: 18px; font-family: "微软雅黑"; color: #66CC99; }
.STYLE5 {
font-family: "微软雅黑";
color: #99CC00;
}
-->
</style>
</head>
<body>
<div align="center">
<%
request.setCharacterEncoding("GBK");
String userid = request.getParameter("userid").trim();
String sql = "{call getUserInfo(?)}";
cstmt=conn.prepareCall(sql);
cstmt.setString(1,userid);
rs = cstmt.executeQuery();
if(!rs.next())
out.println("<p align=center>该用户不存在!</p>");
else{
%>
<span class="STYLE1">查询结果如下:</span></div>
<table width="800" height="600" border="1" align="center">
<tr>
<th align="center" valign="top" bgcolor="#FFFFCC" scope="col"><span class="STYLE3">用户注册名:</span>
<label>
<input type="text" name="textfield" value=<%= new String(rs.getString(1))%> >
</label>
<p><span class="STYLE3">用户真实姓名:</span>
<label>
<input type="text" name="textfield2" value=<%= new String(rs.getString(2))%> >
</label>
</p>
<p><span class="STYLE3">用户邮政编码:</span>
<label>
<input type="text" name="textfield3" value=<%= new String(rs.getString(3))%> >
</label>
</p>
<p><span class="STYLE3">用户性别:</span>
<label>
<input type="text" name="textfield4" value=<%= new String(rs.getString(4))%> >
</label>
</p>
<p><span class="STYLE3">用户电子邮件:</span>
<label>
<input type="text" name="textfield5" value=<%= new String(rs.getString(5))%> >
</label>
</p>
<p><span class="STYLE3">用户电话号码:</span>
<label>
<input type="text" name="textfield6" value=<%= new String(rs.getString(6))%> >
</label>
</p>
<p><span class="STYLE3">用户出生日期:</span>
<label>
<input type="text" name="textfield7" value=<%= new String(rs.getString(7))%> >
</label>
</p>
<p><span class="STYLE3">用户备注: </span>
<label>
<input type="text" name="textfield8" value=<%= new String(rs.getString(8))%> >
</label>
</p>
<p class="STYLE2">用户所借书籍如下:</p>
<table width="613" height="41" border="1">
<tr>
<th width="88" class="STYLE4" scope="col">书籍编号</th>
<th width="166" class="STYLE4" scope="col">书名</th>
<th width="152" class="STYLE4" scope="col">借阅日期</th>
<th width="179" class="STYLE4" scope="col">应还日期</th>
</tr>
<%
String bookid=null,bookname=null,bookborrowtime=null,bookreturntime=null;
if(rs.getString(9 )!= null)
{
bookid = rs.getString(9);
bookname = rs.getString(10);
bookborrowtime = rs.getString(11);
bookreturntime = rs.getString(12);
out.println("<tr>");
out.println("<td>"+bookid+"</td>");
out.println("<td>"+bookname+"</td>");
out.println("<td>"+bookborrowtime+"</td>");
out.println("<td>"+bookreturntime+"</td>");
out.println("</tr>");
while(rs.next())
{
bookid = rs.getString(9);
bookname = rs.getString(10).trim();
bookborrowtime = rs.getString(11);
bookreturntime = rs.getString(12);
out.println("<tr>");
out.println("<td>"+bookid+"</td>");
out.println("<td>"+bookname+"</td>");
out.println("<td>"+bookborrowtime+"</td>");
out.println("<td>"+bookreturntime+"</td>");
out.println("</tr>");
}
}
else
{%>
<script language="javascript">
alert("该用户目前还没有借书记录!");
</script>
<%}
}
rs.close();
cstmt.close();
conn.close();
%>
</table>
<p class="STYLE2"> </p></th>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -