⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gathering.asp

📁 一个不错的个人商务网站的源码
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%Response.Expires = -100%>
<!--#include file="db_conn.asp"-->
<!--#include file="comm/my_request.asp"-->
<!--#include file="comm/nosql.asp" -->
<!--#include file="comm/co.asp" -->
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href=<%="style/"&r(22)%>.css rel=stylesheet type=text/css>
<SCRIPT language="javascript">
<!--
function checkinput()
{
 if (document.form1.yqj_realname.value == "")        
  {        
    window.alert("真实姓名不能为空!");        
    document.form1.yqj_realname.focus();        
    return (false);}
 if (document.form1.yqj_address.value == "")        
  {        
    window.alert("联系地址不能为空!");        
    document.form1.yqj_address.focus();        
    return (false);} 
 if (document.form1.yqj_postal.value == "")        
  {        
    window.alert("邮政编码不能为空!");        
    document.form1.yqj_postal.focus();        
    return (false);} 
  if (document.form1.yqj_postal.value.length!=6)
  {window.alert('邮政编码输入有错误');
  document.form1.yqj_postal.focus();
  return false;}
  if (havenonumber(document.form1.yqj_postal.value))
    {window.alert('您的邮政编码输入有误,请使用阿拉伯数字');
    document.form1.yqj_postal.focus();
    return false;}
 if (document.form1.yqj_phone.value == "")        
  {        
    window.alert("联系电话不能为空!");        
    document.form1.yqj_phone.focus();        
    return (false);} 
 if (document.form1.yqj_email.value == "")        
  {        
    window.alert("电子信箱不能为空!");        
    document.form1.yqj_email.focus();        
    return (false);} 
if (!IsEmail(document.form1.yqj_email.value))
  {window.alert('您的电子邮箱地址填写有误!');
  document.form1.yqj_email.focus();
  return false;}
 if (document.form1.paymode.value == "")        
  {        
    window.alert("请选择支付方式!");        
    document.form1.paymode.focus();        
    return (false);} 
 if (document.form1.songid.value == "")        
  {        
    window.alert("请选择送货方式!");        
    document.form1.songid.focus();        
    return (false);} 
    
    if (document.form1.content.value.length>255)
  {window.alert('您的备注太长,只允许255字以内');
  document.form1.content.focus();
  return false;}
  }
function ischinese(sstring)
{for (i=0;i<sstring.length;i++)
  {if (sstring.charCodeAt(i)<10000)
    {return false;}
  }
return true;
}

function havenonumber(number)
{text="1234567890";
for(i=0;i<=number.length-1;i++)
  {char1=number.charAt(i);
  index=text.indexOf(char1);
  if(index==-1)
    {return true;}
  }
return false;
}

function IsEmail(argValue)
{var emailStr=argValue.toLowerCase();
var checkTLD=1;
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var emailPat=/^(.+)@(.+)$/;
var matchArray=emailStr.match(emailPat);
if (matchArray==null)
  {return false;}
var user=matchArray[1];
var domain=matchArray[2];
for (i=0; i<user.length; i++)
  {if (user.charCodeAt(i)>127)
    {return false;}
  }
for (i=0; i<domain.length; i++)
  {if (domain.charCodeAt(i)>127)
    {return false;}
  }
if (user.match(userPat)==null)
  {return false;}
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null)
  {for (var i=1;i<=4;i++)
    {if (IPArray[i]>255)
      {return false;}
    }
    return true;
  }
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++)
  {if (domArr[i].search(atomPat)==-1)
    {return false;}
  }
if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1)
  {return false;}
if (len<2)
  {return false;}
return true;
}
  //--></SCRIPT>
  <script language=javascript>
function showlist(dd){
if(dd=="a"){
doorder.style.display="";
login.style.display="none";
}else{
doorder.style.display="none";
login.style.display="";
}
}
</script>
<title>商品信息及个人资料</title>
</head>

<body>
<%
ProductList = Session("ProductList")
If Len(ProductList) = 0 Then
response.write "<script language=javascript>alert('对不起,您的购物车为空!');location.href=""index.asp"";</script>"
response.End
end if
%>
<div align="center">
	<table border="0" width="100%" cellpadding="0" cellspacing="0" class="li_table">
		<tr>
			<td valign="top">
			<table border="0" width="100%" id="table2" cellspacing="0" cellpadding="0">
				<tr>
					<td height="20" colspan="4" class="maincolor">
					<p align="center">
					商品列表及个人资料</td>
				</tr>
				<tr>
					<td height="18" bgcolor="#EBEBEB" width="189">商品名称</td>
					<td height="18" bgcolor="#EBEBEB" width="189">单价</td>
					<td height="18" bgcolor="#EBEBEB" width="190">数量</td>
					<td height="18" bgcolor="#EBEBEB" width="190">金额</td>
				</tr>
				<%
set rs2=server.createobject("adodb.recordset")
sql2 = "Select * From yqj_product"
sql2 = sql2 & " Where id In (" & ProductList & ")"
rs2.open sql2,conn,3,3

   Sum = 0
     While Not rs2.EOF
if session("level")="" or isnull(session("level")) or session("level")=0 then
RMB=rs2("p_mmoney")
else
RMB=rs2("vip_mmoney")
end if 
	 Quatity = CInt( Request( "Q_" & rs2("p_name")) )
     If Quatity <= 0 Then 
        Quatity = CInt( Session(rs2("p_name")) )
        If Quatity <= 0 Then Quatity = 1
     End If
     Session(rs2("p_name")) = Quatity
     Sum = Sum + ccur(rmb) * Quatity
     %>
				<tr>
					<td height="18" width="189"><%=rs2("p_name")%></td>
					<td height="18" width="189">¥<%=FormatNumber(rmb,2,-1)%>元</td>
					<td height="18" width="190"><%=Quatity%></td>
					<td height="18" width="190">¥<%=FormatNumber((ccur(rmb)*Quatity),2,-1)%>元</td>
				</tr>
				<%
   rs2.MoveNext
   Wend
   rs2.close
   set rs2=nothing
   %>
				<tr>
					<td height="18" colspan="4">
					<p align="right">商品合计价格:¥<%=FormatNumber(sum,2,-1)%>元</td>
				</tr>
				<tr>
					<td colspan="4" valign="top">                 
<%
userid=session("chk_id")
sql="select * from user_info_list where id="&userid
set rs=conn.execute (sql)
if rs.eof then
else
txt_email=rs("txt_email")
txt_realname=rs("txt_realname")
txt_address=rs("txt_address")
txt_postal=rs("txt_postal")
txt_phone=rs("txt_phone")
txt_mobile=rs("txt_mobile")
rs.close
set rs=nothing
end if
if session("chk_flag")="" then
style="display:none"
%>
<table border="0" width="100%" cellspacing="1" class="li_table">
<tr>
		<td width="353" align="right" height="20" bgcolor="#F3F3F3">您还没有登录,是否登录购买:</td>
		<td width="626" height="20" bgcolor="#F3F3F3">
		<input type="radio" value="0" name="flag" checked onClick='showlist("b");'>登录购买 
		<input type="radio" value="1" name="flag" onClick='showlist("a");' <%if r(24)=1 then response.write "disabled"%>>直接下单</td>
	</tr>
	
	</table>
<br>
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="li_table" id=login>
<form action="usercenter/cartlogin.asp" method="post" name=form2 onsubmit="return chsubmit();">
	<tr>
		<td class="maincolor" width="980" colspan="2">
		<p align="center">会员登录</td>
	</tr>
	<tr>
		<td width="382" align="right">用户名:</td>
		<td width="593"><input type="text" name="login_name" size="25"></td>
	</tr>
	<tr>
		<td width="382" align="right">密码:</td>
		<td width="593"><input type="password" name="login_pass" size="27"></td>
	</tr>
	<tr>
		<td width="382" align="right">验证码:</td>
		<td width="593"><input type="text" name="codeid" size="25"><font size="3"><img src="comm/checkcode.asp"></font></td>
	</tr>
	<tr>
		<td width="980" colspan="2">
		<p align="center"><input type="button" value="忘记密码?" name="B2" onclick="window.location='usercenter/forgetpass.asp'" onFocus="this.blur()">
		<input type="submit" value="确定登录" name="B1"></td>
	</tr>
	</form>
</table>
<%
end if
%>
<table border="0" width="100%" cellspacing="0" style='<%=style%>' id=doorder>
						<form name=form1 action=paynext.asp method=post onsubmit="return checkinput();">
						<tr>
							<td colspan="3" height="25" class="maincolor">
							<p align="center">个人资料填写</td>
						</tr>
						<tr>
							<td height="18" width="183" align="right">
							<p align="right">真实姓名:</td>
							<td height="18" width="265">
							<input type="text" name="yqj_realname" size="28" maxlength="10" value="<%=txt_realname%>"></td>
							<td height="18" width="526"><font color="#808080">* 
							必须填写,将是收货人姓名</font></td>
						</tr>
						<tr>
							<td height="18" width="183" align="right">
							<p align="right">联系地址:</td>
							<td height="18" width="265">
							<input type="text" name="yqj_address" size="36" maxlength="100" value="<%=txt_address%>">
							<input type=hidden name=ishy value=1></td>
							<td height="18" width="526"><font color="#808080">* 
							将是送货地址</font></td>
						</tr>
						<tr>
							<td height="18" width="183" align="right">
							<p align="right">邮政编码:</td>
							<td height="18" width="265">
							<input type="text" name="yqj_postal" size="20" maxlength="6" value="<%=txt_postal%>"></td>
							<td height="18" width="526"><font color="#808080">* 
							将是送货邮政编码</font></td>
						</tr>
						<tr>
							<td height="18" width="183" align="right">
							<p align="right">联系电话:</td>
							<td height="18" width="265">
							<input type="text" name="yqj_phone" size="20" maxlength="18" value="<%=txt_phone%>"></td>
							<td height="18" width="526"><font color="#808080">* 
							请如实填写,便与我们与您联系</font></td>
						</tr>
						<tr>
							<td height="18" width="183" align="right">
							手机号码:</td>
							<td height="18" width="265">
							<input type="text" name="yqj_mobile" size="20" maxlength="18" value="<%=txt_mobile%>"></td>
							<td height="18" width="526"></td>
						</tr>
						<tr>
							<td height="18" width="183" align="right">
							<p align="right">电子信箱:</td>
							<td height="18" width="265">
							<input type="text" name="yqj_email" size="20" maxlength="20" value="<%=txt_email%>"></td>
							<td height="18" width="526"><font color="#808080">* 
							请如实填写,便与我们与您联系</font></td>
						</tr>
						<tr>
							<td height="18" width="183" align="right">
							<p align="right">支付方式选择:</td>
							<td height="18" width="265">
							<select size=1 name=paymode>
                            <option value="" selected>选择支付方式</option>
                            <option value=银行汇款>银行汇款</option>
                            <option value=邮局汇款>邮局汇款</option>
                            <option value=上门取款>上门取款</option>
                            <option value=在线支付>在线支付</option>
                            </select></td>
							<td height="18" width="526"><font color="#808080">* 
							请选择</font></td>
						</tr>
						<tr>
							<td height="18" width="183" align="right">
							<p align="right">送货方式选择:</td>
							<td height="18" width="265">
							<%
response.write "<select size=1 name=songid>"
response.write "<option value="""" selected>选择送货方式</option>"
sql="select id,deliver_name,price from deliver"
set rs=conn.execute (sql)
do while not rs.eof
response.write "<option value="&rs("id")&">"&rs("deliver_name")&"(¥附加"&FormatNumber(rs("price"),2,-1)&"元)</option>"
rs.movenext
loop
rs.close
set rs=nothing
response.write "</select>"
%></td>
							<td height="18" width="526"><font color="#808080">* 
							不同的送货方式其费用不一样</font></td>
						</tr>
						<tr>
							<td height="18" width="183" align="right">
							<p align="right">备&nbsp;&nbsp;&nbsp; 注:</td>
							<td height="18" width="265">
							<textarea rows="4" name="content" cols="35"></textarea></td>
							<td height="18" width="526"><font color="#808080">* 
							您的特殊需求</font></td>
						</tr>
						<tr>
							<td colspan="3" height="18">
							<p align="center">
							<input type=submit value="下一步" name="B1" >&nbsp;
							<input type=button value="返回修改" name="B2" onclick="window.location='Mycart.asp'" onFocus="this.blur()"></td>
						</tr>
						<tr>
							<td colspan="3" height="25"><font color="#FF0000">
							注意:以上信息,请认真如实填写,我们将以此给您发货。否则由此而造成的损失我们概不负责。</font></td>
						</tr></form>
					</table>
					</td>
				</tr>
			</table>
			</td>
		</tr>
	</table>
</div>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -