?? saveto.jsp
字號:
<%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*" errorPage="" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>購物成功!</title>
<link href=css.css rel=STYLESHEET type=text/css>
<jsp:useBean id="mdb" class="ckstudio.db.faq" scope="page"/>
<%!
private 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";
}
%>
</head>
<body topmargin="0">
<%
if(session.getAttribute("user_name")==null){
%>
<br>1.你尚未登錄!請登錄后再訂購本站商品!<br>2.第一次來本站,請先注冊會員(免費)!<br><br>
<%
}else{
String count="";
String hw_id="";
if(request.getParameter("action")=="buy"){
if(request.getParameter("count")==""){
int intcount=1;
count=Integer.toString(intcount);
}
else
count=request.getParameter("count");
if(request.getParameter("hw_id")=="")
out.print("沒有此貨物!");
else{
hw_id=request.getParameter("hw_id");
String sql="select * from basket where hw_id='"+hw_id+"' and user_name='"+(String)session.getValue("user_name")+"' and basket_check=false";
ResultSet rs;
rs=mdb.executeQuery(sql);
if(!rs.next()){
String sql1="insert into basket(hw_id,user_name,basket_count,hw_name,hw_cash,user_type) values('"+hw_id+"','"+session.getValue("user_name")+"','"+count+"','"+request.getParameter("hw_name")+"','"+request.getParameter("hw_cash")+"','"+request.getParameter("user_type")+"') where hw_id='"+hw_id+"' and user_name='"+session.getValue("user_name")+"' and basket_check=false";
mdb.executeInsert(sql1);
}
else{
//rs("basket_count")=int(rs("basket_count"))+int(count)
rs.next();
int basket_count=Integer.parseInt(rs.getString("basket_count"));
basket_count=basket_count+Integer.parseInt(count);
String basket_count2=Integer.toString(basket_count);
String sql2="update basket set basket_count='"+basket_count+"'";
mdb.executeUpdate(sql2);
}
}
}
%>
<br>
<tr>
<td valign="top">
<tr>
<td valign="top" height="120">
<table border="0" width="400" cellspacing="0" cellpadding="0" height="5" align="center">
<tr>
<td width="380" height="18">
<div align="center">
<TABLE cellSpacing=0 cellPadding=0 width=416
align=center border=0>
<TBODY>
<TR>
<TD align=middle bgcolor="#DBC2B0" height="18"><%
if(request.getParameter("sub_number")=="")
out.print("沒有此訂單信息");
else{
String sub_to=getStr(request.getParameter("sub_to"));
String sub_adds=getStr(request.getParameter("sub_adds"));
String sub_mail=getStr(request.getParameter("sub_mail"));
String sub_tel=getStr(request.getParameter("sub_tel"));
String sub_post=getStr(request.getParameter("sub_post"));
String sub_number=getStr(request.getParameter("sub_number"));
String qian=getStr(request.getParameter("qian"));
String other=getStr(request.getParameter("other"));
String sql="update sub set sub_to='"+sub_to+"',sub_tel='"+sub_tel+"',sub_post='"+sub_post+"',sub_mail='"+sub_mail+"',sub_adds='"+sub_adds+"',qian='"+qian+"',other='"+other+"' where sub_number='"+sub_number+"'";
mdb.executeUpdate(sql);
%><b>購物成功! 您的訂單號是:<%=sub_number%></b>
</TD>
</TR>
</TBODY>
</TABLE>
</div>
</td>
</tr>
<tr>
<td width="100%"><table width="100%" height="34" border="0" cellpadding="0" cellspacing="0">
<td width="398" height="120" valign="bottom" bgcolor="#F5EFE7" ><br>
請記牢本訂單號,你可以使用本訂單號對成交情況進行查詢和投訴<br> <br>
<div align="center">
<center>
<table width="80%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="26%" height="25">
<div align="right">收貨人 :</div>
</td>
<td width="74%" height="25">
<div align="center"><%=sub_to%> </div>
</td>
</tr>
<tr>
<td width="26%" height="25">
<div align="right">地址 :</div>
</td>
<td width="74%" height="25">
<div align="center"><%=sub_adds%> </div>
</td>
</tr>
<tr>
<td width="26%" height="25">
<div align="right">郵編:</div>
</td>
<td width="74%" height="25">
<div align="center"><%=sub_post%> </div>
</td>
</tr>
<tr>
<td width="26%" height="25">
<div align="right">電話:</div>
</td>
<td width="74%" height="25">
<div align="center"><%=sub_tel%> </div>
</td>
</tr>
<tr>
<td width="26%" height="25">
<div align="right">E-mail:</div>
</td>
<td width="74%" height="25">
<div align="center"><%=sub_mail%> </div>
</td>
</tr>
<tr>
<td width="26%" height="12">
<div align="right">付款方式:</div>
</td>
<td width="74%" height="25">
<div align="center"><%=qian%> </div>
</td>
</tr>
<tr>
<td width="26%" height="12">
<div align="right">備注:</div>
</td>
<td width="74%" height="25">
<div align="center"><%=other%></div>
</td>
</tr>
<tr>
<td colspan="2" height="21">
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<p style="word-spacing: 2; line-height: 150%; margin-top: 4; margin-bottom: 6">
<font color="#FF9900"> 1.謝謝您在本站購物,如果您選擇送貨上門服務(wù),請您放心,我們的工作人員會很快將商品送到府上。<br>
2.如果您選擇銀行轉(zhuǎn)帳方式,請您盡快轉(zhuǎn)帳,并在轉(zhuǎn)帳成功后馬上給我們打電話或來Email確認,最快只要1小時就給您發(fā)貨!</font></td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
<div align="center"><a href="javascript:history.go(-1)"><<返回修改收貨人信息</a><br>
</div>
<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle"><div align="center"><img src="img/pics/seperator.gif" width="359" height="1"></div></td>
</tr>
</table></td>
</tr>
</table> </td>
<%}
}
mdb.Close();%>
</tr>
</table>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -