<!--#include file="../admin/conn.asp" -->
<%

ProductList = Session("ProductList")
if productlist<>"" then
sql="select * from shop where ProdId in ("&productlist&") order by ProdId"
Set rs = conn.Execute( sql )
else
response.redirect "../error.asp?error=007"
response.end
end if
%> 
<html>
<head>
<title>填写订单详细信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Robots" content="index,follow">
<link rel="stylesheet" href="../shop.css" type="text/css">
<script language="JavaScript">
function CheckForm()
{
	if (document.payment.post.value.length == 0) {
		alert("请选择预付方式");
		document.payment.post.focus();
		return false;
	}

	if (document.payment.Recname.value.length <2 || document.payment.Recname.value.length>20 ) {
		alert("请检查您输入的收货人姓名");
		document.payment.Recname.focus();
		return false;
	}

	if (document.payment.RecPhone.value.length < 6 || document.payment.RecPhone.value.length > 15) {
		alert("请检查您输入的联系电话");
		document.payment.RecPhone.focus();
		return false;
	}



	if (document.payment.Recmail.value.length <8 || document.payment.Recmail.value.length >=50) {
		alert("请检查您输入的电子信箱");
		document.payment.Recmail.focus();
		return false;
	}
	if (document.payment.Recmail.value.length > 0 && !document.payment.Recmail.value.match( /^.+@.+$/ ) ) {
	    alert("请检查您输入的电子信箱");
	    document.payment.Recmail.focus();
		return false;
	}

 
	
	if (document.payment.gettime.value.length < 3) {
		alert("请您输入您要入住的时间");
		document.payment.gettime.focus();
		return false;
	}


	return true;
}

</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
 <br>

<%
userkou=userkk
   Sum = 0
   While Not rs.EOF
     Quatity = CInt( Request( "Q_" & rs("ProdId")) )
     If Quatity <= 0 Then 
        Quatity = CInt( Session(rs("ProdId")) )
        If Quatity <= 0 Then Quatity = 1
     End If
     Session(rs("shop_Name")) = Quatity
     Sum = Sum + csng(rs("shop_jg")) * Quatity

                         
rs.MoveNext
Wend
rs.close
set rs=nothing

Sum=FormatNumber(Sum,2) 
session("sum")=sum

%> 

<table border="0" cellspacing="0" cellpadding="0" align="center" width="520" height="68">
  <tr bgcolor="#FFFFFF"> 
    <td height=29><font color="#FF3333"><b><%=session("estore_userid")%> 您选购的商品总价为：￥ <%=Sum%> 元</font></b>  
    </td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td align=center  height=39> <font color="#FF3333">请认真填写以下表格，带 * 号的必须填写</font></td>                        
  </tr>
  
</table>

<table border="0" cellspacing="1" cellpadding="2" align="center" width="520" bgcolor="#cccccc">
  <form name="payment" action="previeworder.asp" method="POST"  onSubmit="return CheckForm();">
<%
sql="select * from User1 where user_id='"&session("user_id")&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
Zipcode=rs("user_yb")
HomePhone=rs("user_dh")
address=rs("user_dz")
email=rs("User_eMail")
name=rs("User_Name")
rs.close
set rs=nothing

'读取配送方式和费用
info="select * from shopsetup"
set rrrs=server.createobject("adodb.recordset")
rrrs.open info,conn,1,1
fei1=rrrs("fei1")
fei2=rrrs("fei2")
fei3=rrrs("fei3")
fei4=rrrs("fei4")
pei1=rrrs("pei1")
pei2=rrrs("pei2")
pei3=rrrs("pei3")
pei4=rrrs("pei4")

mianyoufei=cint(rrrs("mianyoufei"))				'购物满XXX元免邮费
mianyoufei_msg=rrrs("mianyoufei_msg")				'免邮费的提示

if cint(session("sum"))<mianyoufei then	
pei1=rrrs("pei1")
if pei2<>"" then pei2=pei2 
if pei3<>"" then pei3=pei3
if pei4<>"" then pei4=pei4 
end if

rrrs.close
set rrrs=nothing
%>

    <tr bgcolor="#FFFFFF">     
      <td width="20%" align=center>预付方式</td>
      <td>

<select size="1" name="post">
          <option selected value="">请选择预付方式</option>
          <option value="1"><%=pei1%></option>
<%
if pei2<>"" then
%>
          <option value="2"><%=pei2%></option>
<%
if pei3<>"" then
%>
          <option value="3"><%=pei3%></option>
<%
if pei4<>"" then
%>
          <option value="4"><%=pei4%></option>
<%
end if
end if
end if
%>
        </select><b><font color="#FF3333">  *</font></b> 

<%
if cint(session("sum"))>=mianyoufei then
response.write mianyoufei_msg
end if
%>

</td></tr>  

    <tr bgcolor="#FFFFFF"> 
      <td  align=center>联系人姓名</td>
      <td><input type="text" name="Recname" class="form" size="25" value=<%=name%>><b><font color="#FF3333"> *</font></b> 请输入真实的中文姓名</td> </tr>

    <tr bgcolor="#FFFFFF"> 
    <td  align=center>联系人电话</td>
    <td><input type="text" name="RecPhone" class="form" size="25" value=<%=HomePhone%>><b><font color="#FF3333"> *</font></b> </td></tr>                   

    <tr bgcolor="#FFFFFF"> 
    <td align=center>联系人邮箱</td>
    <td><input type="text" name="Recmail"  size="25" value=<%=email%>> <b><font color="#FF3333"> *</font></b></td></tr>                 
      
	<tr bgcolor="#FFFFFF">
	  <td align=center>接送备注</td>
	  <td>	  <b><font color="#FF3333"> 
	  <select name="address" id="address">
	    <option value="不需要接" selected>不需要接</option>
	    <option value="到火车站接">到火车站接</option>
	    <option value="到飞机场接">到飞机场接</option>
	    </select>
	  *</font></b></td>		                  
    </tr>
      
	<tr bgcolor="#FFFFFF">
	  <td align=center>指定入住时间</td>
	  <td><input name="gettime" size=34 value='<%=gettime%>'>
      <b><font color="#FF3333">*<br>
      </font></b><font color="#FF3333">如：我一行三人于2005年12月17日下午入住</font></td>		                 
    </tr>
		<tr bgcolor="#FFFFFF"><td align=center >备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</td><td><textarea name="Notes" cols="44" rows="3"></textarea><br><font color="#FF3333">例如可以写上您的QQ，以及其它要说明的内容。</font>
       </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="35" colspan="2" align="center"> 
      <input type=hidden name="Sum" value="<%=Sum%>">

        <input type="submit" name="nextstep" value="确认订单">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
	<input type="button" name="Submit21" onclick="javascript:history.go(-1)" value="返回修改">
        


      </td>
    </tr>
  </form> 
</table>
</body>
</html>

<%
set conn=nothing
%>