📄 dispproinfo.jsp
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="store.ProInfo" %>
<%@ page import="store.Param" %>
<%@ page import="store.CommentInfo" %>
<HTML>
<head>
<title>查看商品具体信息</title>
<LINK href="include/style.css" type=text/css rel="stylesheet">
</head>
<BODY>
<CENTER>
<%@include file="include/global.jsp"%>
<BR>
<table borderColor="white" cellSpacing="0" width="76%" borderColorLight="darkblue" border="0">
<TR bgcolor=#8BB7FF>
<TD colSpan=2 height=25>序号</TD>
</TR>
<%
ProInfo PI=(ProInfo)session.getAttribute("detail");
%>
<TR><TD width=230 rowspan="6">
<img src='pimage/<%=PI.getImage()%>' width='200' height='210'/></TD>
<TD height=28>【名称】<%=PI.getPname()%></TD></TR>
<TR><TD height=28>【厂商】<%=PI.getProvider()%></TD></TR>
<TR><TD height=28>【价格】<%=PI.getPrice()%></TD></TR>
<TR><TD height=28>【存货】<%=PI.getStock()%></TD></TR>
<TR><TD height=28>【已售】<%=PI.getSold()%></TD></TR>
<TR><TD height=50>【简介】<%=PI.getSinfo()%></TD></TR>
<TR bgcolor=#8BB7FF>
<TD height=28>
【商品具体信息】</TD>
<TD><P align=left><FORM action='Buy.do' name=form1>
<INPUT type=hidden name=pid value='<%=PI.getId()%>'/>
<INPUT type=hidden size=2 name=quantity value='1'/>
<img onClick=form1.submit() src='image/buy.jpg'/>
</FORM></P>
</TD></TR>
<TR>
<TD colSpan=2><%=PI.getInfo()%></TD>
</TR>
</TABLE>
<Table borderColor="white" cellSpacing="0" width="76%" borderColorLight="darkblue" border="0">
<TR bgcolor=#8BB7FF>
<TD colSpan=3 height=25>【客户评价】</TD>
</TR>
<%
Vector VC=(Vector)session.getAttribute("commentary");
String inte=request.getParameter("page");
int pages=0;
if(inte==null){
pages=1;
}
else{
pages=Integer.parseInt(inte);
}
int lastrow=VC.size();
int pagesize=Param.COMM_PAGE_SIZE;
int pagecount=(lastrow%pagesize==0)?(lastrow/pagesize):(lastrow/pagesize+1);
//当前的社始页数
if (pages>=pagecount){
pages=pagecount;
}
int posion=(pages-1)*pagesize;
int end=posion+pagesize;
if(end>lastrow)
end=lastrow;
for(int i=posion;i<end;i++)
{
CommentInfo CI=(CommentInfo)VC.get(i);
%>
<TR bgcolor=#8BBF0F>
<TD height=25>客户:<%=CI.getCustomer()%></TD>
<TD height=25>IP:<%=CI.getIp()%></TD>
<TD height=25>时间:<%=CI.getCtime()%></TD>
</TR>
<TR>
<TD colSpan=3 height=25>评价内容:<%=CI.getContent()%></TD>
</TR>
<%
}
out.print("<TR bgcolor=#8BBF0F>");
out.print("<TD colSpan=3 height=25>");
out.print("[共"+pagecount+"页]>>>");
for(int j=1;j<=pagecount;j++)
{
if(j==pages){
out.print("[");}
out.print("<A href=DispProInfo.do?page="+j+">");
out.print(""+j);
out.print("</A>");
if(j==pages){
out.print("]");
}
}
out.print(" </TD></TR>");
%>
</TABLE>
<table borderColor="white" cellSpacing="0" width="76%" borderColorLight="darkblue" border="0">
<TR bgcolor=#8BB7FF>
<TD height=25>【客户发表评论】</TD>
</TR>
<FORM action='Comment.do' method=post>
<TR><TD height=25>名称
<%
String name="";
if(session.getAttribute("customer")!=null)
name=(String)session.getAttribute("customer");
%>
<INPUT type=text name='customer' value='<%=name%>'>
</TD></TR>
<TR><TD>
<TEXTAREA name="content" cols=56 rows=5 id="content"></TEXTAREA>
</TD></TR>
<TR><TD>
<INPUT type=hidden name='pid' value='<%=PI.getId()%>'>
<input type="submit" value="submit">
<input type="reset" value="Reset">
</TD></TR>
<TR bgcolor=#8BB7FF>
<TD height=25></TD>
</TR>
</FORM>
</TABLE>
</CENTER>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -