?? basket.jsp
字號:
<%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*" %>
<%@ page errorPage="error.html"%>
<%@ page import="/bookshop/bean.DataBase"%>
<html>
<head>
<link href=css.css rel=STYLESHEET type=text/css>
<%--<jsp:useBean id="mdb" class="ckstudio.db.mysqlconn" scope="page"/>--%>
<title>
<%
int Cint(String cint)
{
try {
int n;
n= Integer.parseInt(cint);
return n;
}
catch (NumberFormatException e) {
return 0;
}
}
%>
<%
String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e)
{
e.printStackTrace();
return null;
}
}
%>
<%
String user_name=(String)session.getValue("user_name");
if(user_name!=null)
{
%>
<%=user_name%>的購物車
<%
}else
{
//out.print("購物車");
}%>
</title></head>
<body><font color="#000000"><b>
<%
String b_cashs,basket_count,sql,b_name;
int b_cash,jiage,count,totalcash=0;
if(user_name==null)
{
// out.print( "1.你尚未登錄!請登錄后再訂購本站書籍!");
%>
<a href=# onClick="javascript:window.close();">關閉窗口</a>
<%
}
else
{//having login check
int b_id;
String b_ids=request.getParameter("b_id");
if(b_ids==null)
{
// out.print("沒有此貨物");
}
else
{//hw_id exists or not--------------------------------------------------------------
DataBase db=new DataBase();
b_ids.trim();
ResultSet rs;
int daili;
b_id=Cint(b_ids);
sql="select * from b_book where b_id="+b_id;
rs=db.executeQuery(sql);
if(rs.next())
{
//result showing begin ------------------------------------------
b_cash=rs.getInt("b_cash");
b_price=rs.getFloat("b_price");
b_name=rs.getString("b_name");
%>
<br>
<table border="0" width="400" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#989DA5"><font color="#000000"><b>
<img border="0" src="img/promo_list_top.gif" width="100%" height="4"></td></tr>
<tr>
<td height="18" align="center" bgcolor="#989DA5">所選購的商品信息</td></tr><tr>
<td height="16"> <form method="POST" action="buy.jsp?action=buy&b_id=<%=b_id%>&b_name=<%=b_name%>&b_cash=<%
out.print(daili);%>">
<table border="0" width="100%" cellspacing="0" height="34" cellpadding="0">
<tr bgcolor="#FFFFFF">
<td width="398" bgcolor="#ECECEC">
<div align="center">
<center>
<table width="90%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
<tr background="img/pics/tile_bg.gif">
<td width="155" height="25"> <div align="center">商品名稱</div></td>
<td width="60" height="25"> <div align="center">商品單價</div></td>
<td width="60" height="25"> <div align="center">訂購數量</div></td>
<td width="80" height="25"> <div align="center">確認購買</div></td>
</tr>
<tr>
<td width="155" height="30"> <div align="center"><%=b_name%></div></td>
<td width="60" height="30"> <div align="center">
<%=b_price%>
元</div></td>
<td width="60" height="30"> <div align="center">
<select size="1" name="count">
<%for(int i=1;i<=10;i++){
%>
<option><%=i%></option>
<%}
%>
</select>
</div></td>
<td width="80" height="30"> <div align="center">
<input name=B1 type=image id="B1"
src="img/pics/ok.gif" alt=投訴
align=absMiddle width="45" height="20" cache tppabs="">
</div></td>
</tr>
</table>
</center>
</div></tr>
</table>
</form></td>
</tr>
<tr>
<td height="30" valign="top" bgcolor="#ECECEC"><table width="83%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="33%"><a href="buy.jsp"><img src="img/pics/lookbcar.gif" width="100" height="20" border="0"></a></td>
<td width="33%"><a href="clear.jsp"><img src="img/pics/relbcar.gif" width="100" height="20" border="0"></a></td>
<td width="33%"><a href="cash.jsp"><img src="img/pics/gobuy.gif" width="100" height="20" border="0"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center">
<img border="0" src="img/promo_list_top.gif" width="100%" height="4"></td>
</tr>
<tr>
<td height="18" align="center" bgcolor="#989DA5">你已選購的商品如下</td>
</tr>
<!----------------------------things bought------------------------------------>
<%@ include file="bought.jsp"%>
<!----------------------------things bought end ------------------------------------>
</table>
<% }//result showing end ------------------------------------------
rs.close();
mdb.Close();
}//hw_id exist check end------------------------------------------------------------
}//login or not check end
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -