jsp的图书购物系统
源代码在线查看: submit_order.jsp
if(session.getAttribute("username")==null)
{
response.sendRedirect("login.html");
}
%>
String tel = request.getParameter("address");
tel = new String(tel.getBytes("ISO8859-1"));
String address = request.getParameter("tel");
address = new String(address.getBytes("ISO8859-1"));
String sqlinsert="update 订单 set user_address='"+address+"',user_tel='"+tel+"' where user_name='"+session.getAttribute("username")+"'";
workM.executeQuery(sqlinsert);
%>
[详细资料]
订单确认
订单信息
姓名:
住址:
电话:
您选购了以下书籍:
购买数量
书名
单价(元)
总价格(元)
//价格
double g_price,total_price;
g_price=0;
total_price=0;
//********
String sqlList="select * from 订单 where user_name='"+session.getAttribute("username")+"'";
ResultSet RSList=workM.executeQuery(sqlList);
try
{
while(RSList.next())
{
int b_num;
b_num=RSList.getInt("book_number");
%>
String sqlBook="select * from 书籍信息 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
总费用
¥
继续购书 |打印该页