<%
rs=stmt.executeQuery(\ if(i_currentpage>i_totalpage) i_currentpage=i_totalpage;
int i_position=(i_currentpage-1)*pagenum; if(i_position==0) rs.beforeFirst(); else
rs.absolute(i_position); for(int i=0;i s_createid=(rs.getString(\s_subject=(rs.getString(\s_datel=(rs.getString(\):\ s_context=(rs.getString(\s_employeeid=(rs.getString(\:\ s_date2=(rs.getString(\):\ s_advice=(rs.getString(\请等待工作人员处理]\ <%=s_datel%> <%=s_createid%> <%=s_subject%> <%=s_context%> <%=s_date2%> <%=s_advice%>
<% }//if }//for %> <% if(s_userid!=null){%>
<%}else{%>
图4-6 读者留言
7.
管理员身份验证功能模块设计
a.管理员身份验证bookshop/admin/index.jsp代码:
<%@ page contentType=\<%@ page import=\<%
request.setCharacterEncoding(\ Class.forName(\ Connection
conn=DriverManager.getConnection(\ Statement stmt=conn.createStatement
(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs=null;
String op=request.getParameter(\ if(op!=null&&op.equals(\
String s_employeeid=request.getParameter(\ String s_password=request.getaparameter(\ rs=stmt.executeQuery(\
employee
where
employeeid='\ if(rs.next()){
session.setAttribute(\ reponse.sendRedirect(\
else{response.sendRedirect(\用户名或密码不正确!\;}}
%>%
| 密码 | name=\ type=\ onClick=\ CheckSubmit();\登陆\》
|
图4-7 管理员身份验证
8.
订单处理功能模块设计
a.订单处理orderdit.jsp代码:
<%@ page contenttype=\<%@ page import=\<%
Class.forName(\ Connection conn=DriverManager.
getConnection(\Statement
stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_
READ_ONLY); ResultSet rs=null;
String s_admin=(String)session.getAttribute(\
if(s_admin==null)( response.sendRedirect(\ String s_currentpage-request.getParameter(\ String s_orderid-request.getParameter(\ String s_state=request.getParameter(\
stmt.executeUpdate(\orderform set state=\where orderid=\ rs=stmt.executeQuery(\orderid='\ while(rs.next()){
String s_bookid=rs.getString(\ int i_ordernum-rs.getInt(\ Statement stmt2=conn.createStatement
(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); stmt2.executeUpdate(\book
set *
from
orderdetail
where
quantity=quantity-\ response.sendRedirect(\op=show¤tpage=\%>