jsp的技术教程
源代码在线查看: search_order2.jsp
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";
}
%>
[详细资料]
订单信息
姓名:
String address,tel;
String sql="select * from orders where user_name='"+request.getParameter("username")+"'";
// out.println(sql);
ResultSet rs=workM.executeQuery(sql);
if(rs.next())
{
address=getStr(rs.getString("user_address"));
tel=getStr(rs.getString("user_tel"));
%>
住址:
电话:
您的购物车中包含以下货物:
购买数量
书名
单价
总价格
//价格
double g_price,total_price;
g_price=0;
total_price=0;
//********
String sqlList="select * from orders where user_name='"+request.getParameter("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
总费用
¥
关闭窗口|打印该页