jsp的技术教程
源代码在线查看: order1.jsp
if(session.getAttribute("username")==null||session.getAttribute("username")=="")
{
response.sendRedirect("../member/login.jsp?url="+request.getRequestURI());
}
%>
public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("GBK");
String temp=new String(temp_t,"ISO8859_1");
return temp;
}
catch(Exception e)
{
}
return "null";
}
%>
[详细资料]
请您详细填写以下资料,然后单击“发出订单”按钮
姓名:
住址:
电话:
您的购物车中包含以下货物:
购买数量
书名
单价
总价格
//价格
double g_price,total_price;
g_price=0;
total_price=0;
//********
String sqlList="select * from orders where user_name='"+session.getAttribute("username")+"' and status=0";
ResultSet RSList=workM.executeQuery(sqlList);
try
{
while(RSList.next())
{
int b_num;
b_num=RSList.getInt("book_number");
%>
String sqlBook="select book.* from book where id="+RSList.getInt("book_id");
ResultSet RSBook=workM.executeQuery(sqlBook);
while(RSBook.next())
{
%>
double price;
price=RSBook.getDouble("price");
%>
¥
¥
g_price=g_price+(double)price*b_num;
}%>
}
}
catch(Exception e)
{
}
%>
货物价格
¥
运输费用
¥5.00
总费用
¥