📄 tjfk.jsp.bak
字号:
<%@ page language="java" contentType="text/html;charset=gb2312" %>
<%@ page import="java.lang.*,java.sql.*,java.util.*" %>
<html>
<title>小小的太阳</title>
<body style="color: #000">
<div align="center">
<table border="3" borderColor="#ffffff" borderColorDark="#ffffff" borderColorLight="#ffffff" cellSpacing="0" height="1008" style="BORDER-BOTTOM-COLOR: #ffffff; BORDER-BOTTOM-STYLE: solid; BORDER-LEFT-COLOR: #ffffff; BORDER-LEFT-STYLE: solid; BORDER-RIGHT-COLOR: #ffffff; BORDER-RIGHT-STYLE: solid; BORDER-TOP-COLOR: #ffffff; BORDER-TOP-STYLE: solid" width="892">
<tbody>
<tr>
<td align="middle" bgColor="#ccccff" height="1" width="80%">
<%@ include file="head.html" %>
</td>
</tr>
<tr>
<td align="center" bgcolor="#fccccc" height="1" width="80%" colspan="2">
<jsp:include page="head.jsp" />
</jsp:include>
</td>
</tr>
<tr>
<td align="middle" bgColor="#ccffff" height="557" width="884">
<jsp:useBean id="DbLink" scope="page" class="MyBook.DbLink" />
<%
DbLink.DbLink("sa","123456","MyDataBase");
String SaveYHM =(String) session.getAttribute("SaveYHM");
String SavePassword =(String) session.getAttribute("SavePassword");
if ((SaveYHM != null)&&(SavePassword != null))
{
//out.println("Select count(*) as Counter from Login where YHM='"+SaveYHM+"' and MM='"+SavePassword+"'");
ResultSet RsCount = DbLink.DbQuery("Select count(*) as Counter from Login where YHM='"+SaveYHM+"' and MM='"+SavePassword+"'");
RsCount.next();
int Counter = RsCount.getInt("Counter");
if (Counter == 0)
{
response.sendRedirect("Regist.jsp?Param=Lost");
}
}
else
{
response.sendRedirect("Regist.jsp?Param=Lost");
}
%>
<table border="1" width="90%" height="1" bordercolorlight="#f308080" style="border-style: solid" bordercolordark="#f308080" bordercolor="#f308080" cellspacing="1" cellpadding="0" >
<tr>
<td align="left" height="1" width="15%"><b><font color="#FFCC00">书名代号</font></b></td>
<td align="left" height="1" width="20%"><b><font color="#FFCC00">书 名</font></b></td>
<td align="left" height="1" width="20%"><b><font color="#FFCC00">作 者</font></b></td>
<td align="left" height="1" width="15%"><b><font color="#FFCC00">价 格(元)</font></b></td>
<td align="left" height="1" width="15%"><b><font color="#FFCC00">买入数量</font></b></td>
<td align="left" height="1" width="15%"><b><font color="#FFCC00">总价钱(元)</font></b></td>
</tr>
<%
ResultSet rs = DbLink.DbQuery("Select ZBDH,SM,JG from Book");
int i=0;
while(rs.next())
{
String ZBDH = rs.getString("ZBDH");
String SL =(String) request.getParameter(ZBDH);
//out.println(SL);
if (SL != null)
{
int GMSL = Integer.parseInt(SL);
if (GMSL != 0)
{
i++;
}
}
}
float JQH[]=new float[i];
int ZSL[]=new int[i];
ResultSet rst = DbLink.DbQuery("Select ZBDH,SM,ZZ,JG from Book");
int k=0;
int j=0;
while(rst.next())
{
String ZBDH = rst.getString("ZBDH");
String SM = rst.getString("SM");
String ZZ = rst.getString("ZZ");
String StrSL =(String) request.getParameter(ZBDH);
float JG = rst.getFloat("JG");
if (StrSL != null)
{
int GMSL = Integer.parseInt(StrSL);
ZSL[k] = GMSL;
k++;
if (GMSL != 0)
{
JQH[j]=GMSL * JG;
String StrSQL = "insert into UserBook (YHM,ZBDH,SL,GMSJ) values ('"
+SaveYHM
+"','"
+ZBDH
+"',"
+GMSL
+",getDate())";
DbLink.DbExcute(StrSQL);
String StrUpDate = "update Book set SL=SL-"+GMSL+" where ZBDH='"+ZBDH+"'";
DbLink.DbExcute(StrUpDate);
//out.println(StrUpDate);
out.println("<tr><td align=\"left\" height=\"1\" width=\"15%\"><b><font color=\"#FFCC00\">"
+ZBDH
+"</font></b></td><td align=\"left\" height=\"1\" width=\"20%\"><b><font color=\"#FFCC00\">"
+SM
+"</font></b></td><td align=\"left\" height=\"1\" width=\"20%\"><b><font color=\"#FFCC00\">"
+ZZ
+"</font></b></td><td align=\"left\" height=\"1\" width=\"15%\"><b><font color=\"#FFCC00\">"
+JG
+"</font></b></td><td align=\"left\" height=\"1\" width=\"15%\"><b><font color=\"#FFCC00\">"
+GMSL
+"</font></b></td><td align=\"left\" height=\"1\" width=\"15%\"><b><font color=\"#FFCC00\">"
+JQH[j]
+"</font></b></td></tr>");
j++;
}
}
}
rs.close();
rst.close();
int GMZSL=0;
float ZJQ = 0;
for(int l=0;l<i;l++)
{
ZJQ = ZJQ+JQH[l];
}
for(int a=0;a<k;a++)
{
GMZSL = GMZSL+ZSL[a];
}
out.println("<tr><td align=\"left\" height=\"1\" width=\"15%\" colspan=\"5\"><b><font color=\"#aaCC00\">"
+"总价钱和"
+"</font></b></td><td align=\"left\" height=\"1\" width=\"15%\"><b><font color=\"#aaCC00\">"
+ZJQ
+"</font></b></td></tr>");
String AddInfoSQL = "insert into Info (YHM,GMSJ,ZSL,ZJQ) values ('"+SaveYHM+"',getDate(),"+GMZSL+",'"+ZJQ+"')";
DbLink.DbExcute(AddInfoSQL);
%>
</table>
<br>
<br>
<%
String YHM = request.getParameter("YHM");
String GLCS = request.getParameter("GLCS");
%>
<p align="center"><font color="#FF00FF" size="5"><b>感谢您的光临!!!!!</b></font></p>
<p><font size="4" color="#0066FF">您已经成功购买!我们已从您的帐户上消除了共为</font><b><font size="4" color="#FF3300"><%= ZJQ %></font></b><font size="4" color="#0066FF">元人民币!我们将在15天内为您寄出所有的书!</font></p>
<p><font color="#0066ff" size="4">现在您决定是 </font><a href="BWSD.jsp?YHM=<%= YHM %>&GLCS=<%= GLCS %>"><font size="4" color="#FF6699">继续购买</font></a><font color="#0066ff" size="4">还是</font><a href="Main.jsp"><font size="4" color="#FF6699">返回主页</font></a></p>
</td>
</tr>
<tr>
<td align="middle" bgColor="#ccccff" height="1" width="80%">
<%@ include file = "botton.html" %>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -