<%@ LANGUAGE="VBScript" %>
<!--#include file="Inc/Conn.asp" -->
<!--#include file="Lock.asp"-->
<!--#include file="Inc/Util.asp" -->
<%
Set rsid = Server.CreateObject("ADODB.recordset")
sql="Select ID From [Product]"
rsid.open sql,conn,1,1
Do until rsid.Eof
If Request.Form("C_"&rsid("ID"))<>false Then 
Session("C_"&rsid("ID")) = Request.Form("C_"&rsid("ID"))
Else
Session("C_"&rsid("ID"))=""
End if
rsid.MoveNext
Loop
rsid.Close
Set rsid=Noting

user=Session("MyUserName")
set Rs = Server.CreateObject("ADODB.recordset")
sql="Select * From [User] Where [UserName]='"&user&"'"
rs.open sql,conn,1,1
%>
<script language="JavaScript">
<!--
function chk(theForm){
        if (theForm.Comane.value == ""){
                alert("请输入公司名称!");
                theForm.Comane.focus();
                return (false);
        }
        
        if (theForm.Somane.value == ""){
                alert("请输入收货人名称!");
                theForm.Somane.focus();
                return (false);
        }  
		 
		if (theForm.Add.value == ""){
                alert("请输入收货地址!");
                theForm.Add.focus();
                return (false);
        }  
		
		 if (theForm.Zip.value == ""){
                alert("请输入邮政编码!");
                theForm.Zip.focus();
                return (false);
        } 
        var checkOK = "0123456789";
        var checkStr = theForm.Zip.value;
        var allValidp = true;
        for (i = 0;i < checkStr.length;i++){
                ch = checkStr.charAt(i);
                for (j = 0;j < checkOK.length;j++)
                if (ch == checkOK.charAt(j))
                        break;
                if (j == checkOK.length){
                        allValidp = false;
                        break;
                }
        }
        if (!allValidp){
                alert("邮政编码只能是数字!");
                theForm.Zip.focus();
                return (false);
        }

      if (theForm.Phone.value == ""){
                alert("请输入你的联系电话!");
                theForm.Phone.focus();
                return (false);
        } 
        var checkOK = "0123456789";
        var checkStr = theForm.Phone.value;
        var allValidp = true;
        for (i = 0;i < checkStr.length;i++){
                ch = checkStr.charAt(i);
                for (j = 0;j < checkOK.length;j++)
                if (ch == checkOK.charAt(j))
                        break;
                if (j == checkOK.length){
                        allValidp = false;
                        break;
                }
        }
        if (!allValidp){
                alert("联系电话只能是数字!");
                theForm.Phone.focus();
                return (false);
        }
		
		if (theForm.email.value == ""){
                alert("请输入你的E-mail!");
                theForm.email.focus();
                return (false);
        }

        var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_@.";
        var checkStr = theForm.email.value;
        var allValid = true;
        for (i = 0;i < checkStr.length;i++){
                ch = checkStr.charAt(i);
                for (j = 0;j < checkOK.length;j++)
                if (ch == checkOK.charAt(j))
                        break;
                if (j == checkOK.length){
                        allValid = false;
                        break;
                }
        }
        if (theForm.email.value.length < 8){
                allValid = false;
        }
        if (!allValid){
                alert("您输入的电子邮件地址无效!");
                theForm.email.focus();
                return (false);
        }
        address=theForm.email.value;
        if(address.length>0){
                i=address.indexOf("@");
                if(i==-1){
                        window.alert("对不起！您输入的电子邮件地址是错误的！")
                        theForm.email.focus();
                        return (false);
                }
                 ii=address.indexOf(".")
                if(ii==-1){
                        window.alert("对不起！您输入的电子邮件地址是错误的！")
                        theForm.email.focus();
                        return (false);
                }

         if (checktext(theForm.email.value)){
                alert("请您输入有效的email");
                theForm.email.select();
                theForm.email.focus();
                return (false);
        }   
}
}
//-->
</script>
<HTML><HEAD>
<TITLE>商品结算</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="ziyan/Style.css" type=text/css rel=stylesheet>
</HEAD>
<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<br>
<DIV align=center>
<FORM name="form1" onSubmit="return chk(this)" action="ShopCheck2.asp" method=post>
<INPUT type=hidden value=<%=rs("username")%> name="username">
    <TABLE width=98% align="center" cellPadding=4 cellSpacing=1 bgColor=#CCCCCC>
      <TBODY>
        <TR vAlign=top bgColor=#eeeeee> 
          <TD height="25"  colSpan=2> 
            <p align="center">购物结算--(第一步)收货人信息</p></TD>
        </TR>
        <TR> 
          <TD  width=331 bgColor=#FFFFFF height=3 align="right"> <p align="center">会员名：</p></TD>
          <TD  width=637 height=3 bgcolor="#FFFFFF"> 
            <p> <%=rs("username")%> </p></TD>
        </TR>
        <TR> 
          <TD bgColor=#FFFFFF height=3 align="right">
<div align="center">公司名称：</div></TD>
          <TD  width=637 height=3 bgcolor="#FFFFFF"> 
            <INPUT maxLength=16 value="<%=rs("Compname")%>" name="Comane"></TD>
        </TR>
        <tr> 
          <TD  width=331 bgColor=#FFFFFF height=7 align="right"> 
            <p align="center">收货人：</p></TD>
          <TD  width=637 height=7 bgcolor="#FFFFFF"> 
            <p> 
              <INPUT maxLength=16 name="Somane">
            </p></TD>
        </tr>
        <tr> 
          <TD  width=331 bgColor=#FFFFFF height=7 align="right"> 
            <p align="center">收货地址：</p></TD>
          <TD  width=637 height=7 bgcolor="#FFFFFF"> 
            <p> 
              <INPUT name="Add" id="Add" size="32" maxLength=16>
            </p></TD>
        </tr>
        <tr> 
          <TD  width=331 bgColor=#FFFFFF height=7 align="right"> 
            <p align="center">邮政编码：</p></TD>
          <TD  width=637 height=7 bgcolor="#FFFFFF"> 
            <p> 
              <INPUT maxLength=16 value="<%=rs("Zip")%>" name="Zip">
            </p></TD>
        </tr>
        <tr> 
          <TD  width=331 bgColor=#FFFFFF height=3 align="right"> 
            <p align="center">联系电话：</p></TD>
          <TD  width=637 height=3 bgcolor="#FFFFFF"> 
            <p> 
              <INPUT maxLength=16 value="<%=rs("Phone")%>" name="Phone">
            </p></TD>
        </tr>
        <tr> 
          <TD align="right" bgColor=#FFFFFF> 
            <div align="center">联系传真：</div></TD>
          <TD  width=637 bgcolor="#FFFFFF"> 
            <INPUT maxLength=16 value="<%=rs("Fox")%>" name="Fox"></TD>
        </tr>
        <tr> 
          <TD align="right" bgColor=#FFFFFF>
            <div align="center">联系E-mail：</div></TD>
          <TD  width=637 bgcolor="#FFFFFF">
           <INPUT maxLength=16 value="<%=rs("Email")%>" name="email">
          </TD>
        </tr>
        <TR vAlign=top bgColor=#FFFFFF> 
          <TD  colSpan=2 > 
            <p align="center">您可以修改以上内容</TD>
        </TR>
        <TR bgColor=#eeeeee> 
          <TD height="25"  colSpan=2> 
            <DIV align=center> 
              <p align="center"> 
                <input type="button" value="上一步" name="B4" onclick="javascript:window.history.go(-1)">
                &nbsp;&nbsp; 
                <INPUT type=submit size=3 value=下一步 name=Submit2>
            </DIV></TD>
        </TR>
      </TBODY>
    </TABLE>
</FORM>
</DIV>
</BODY></HTML>
<%
rs.close
conn.close
%>