📄 alpay.asp
字号:
<!--#include file="comm/my_request.asp"-->
<!--#include file="db_conn.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 checksubmit()
{
if (document.form1.s2.value == "")
{
window.alert("收货人姓名不能为空!");
document.form1.s2.focus();
return (false);}
if (document.form1.s3.value=="")
{window.alert('请填写送货地址!');
document.form1.s3.focus();
return false;}
if (document.form1.s4.value=="")
{window.alert('请输入邮政编码');
document.form1.s4.focus();
return false;}
if (havenonumber(document.form1.s4.value))
{window.alert('您的邮政编码输入有误,请使用阿拉伯数字');
document.form1.s4.focus();
return false;}
if (document.form1.s5.value=="")
{window.alert('请填写电话号码!');
document.form1.s5.focus();
return false;}
if (document.form1.s6.value=="")
{window.alert('请填写手机号码!');
document.form1.s6.focus();
return false;}
if (document.form1.s7.value=="")
{window.alert('请输入电子邮件地址');
document.form1.s7.focus();
return false;}
if (!IsEmail(document.form1.s7.value))
{window.alert('您的电子邮箱地址填写有误!');
document.form1.s7.focus();
return false;}
if (document.form1.s8.value=="")
{window.alert('请选择送货方式');
document.form1.s8.focus();
return false;}
if (document.form1.s9.value.length>255)
{window.alert('您的备注太长,只允许255字以内');
document.form1.s9.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>
<%
dim id,action,rs,p_name,p_mmoney
id=my_request("id",1)
action=my_request("action",0)
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
set rs=conn.execute ("select p_name,p_mmoney,p_nums,vip_mmoney from yqj_product where id="&id)
p_name=rs("p_name")
p_mmoney=rs("p_mmoney")
vip_mmoney=rs("vip_mmoney")
p_nums=rs("p_nums")
rs.close
set rs=nothing
if p_nums<=0 then
response.write "<script language=javascript>alert('对不起,您选择的商品已经缺货!');window.close();</script>"
response.End
elseif p_nums=>20 then
p_nums=20
else
p_nums=p_nums
end if
if action="save" then
call save()
response.end
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
if session("level")="" or isnull(session("level")) or session("level")=0 then
yqj_money=p_mmoney
else
yqj_money=vip_mmoney
end if
%>
<table border="0" width="100%" cellspacing="1" class="li_table" style='<%=style%>' id=doorder>
<form action=alpay.asp method=post name=form1 onsubmit="return checksubmit();">
<tr>
<td width="982" colspan="2" height="20" class="maincolor">
<p align="center">商品订单-<font color="#FF6600">支付宝支付</font></td>
</tr>
<tr>
<td width="353" align="right" height="20">产品名称:</td>
<td width="626" height="20"><%=p_name%></td>
</tr>
<tr>
<td width="353" align="right" height="20">商品单价:</td>
<td width="626" height="20"><%=FormatNumber(yqj_money,2,-1)%>元</td>
</tr>
<tr>
<td width="353" align="right" height="20">购买数量:</td>
<td width="626" height="20">
<select size="1" name="s1">
<%for i=1 to p_nums%>
<option value=<%=i%>><%=i%></option>
<%next%>
</select> *</td>
</tr>
<tr>
<td width="353" align="right" height="20">您的姓名(收货人):</td>
<td width="626" height="20">
<input type="text" name="s2" size="20" maxlength="15" value="<%=txt_realname%>"> *<input type="hidden" name="action" value="save"><input type="hidden" name="id" value="<%=id%>"></td>
</tr>
<tr>
<td width="353" align="right" height="20">地址:</td>
<td width="626" height="20">
<input type="text" name="s3" size="42" maxlength="200" value="<%=txt_address%>"> *</td>
</tr>
<tr>
<td width="353" align="right" height="20">邮政编码:</td>
<td width="626" height="20">
<input type="text" name="s4" size="20" maxlength="6" value="<%=txt_postal%>"> *</td>
</tr>
<tr>
<td width="353" align="right" height="20">电话:</td>
<td width="626" height="20">
<input type="text" name="s5" size="32" maxlength="20" value="<%=txt_phone%>"> *</td>
</tr>
<tr>
<td width="353" align="right" height="20">手机号码:</td>
<td width="626" height="20">
<input type="text" name="s6" size="37" maxlength="20" value="<%=txt_mobile%>"> *</td>
</tr>
<tr>
<td width="353" align="right" height="20">电子邮件地址:</td>
<td width="626" height="20">
<input type="text" name="s7" size="37" maxlength="50" value="<%=txt_email%>"> *</td>
</tr>
<tr>
<td width="353" align="right" height="20">支付宝支持的送货方式:</td>
<td width="626" height="20">
<%
response.write "<select size=1 name=s8>"
response.write "<option value="""" selected>选择送货方式</option>"
sql="select id,deliver_name,price,flagp from deliver order by id"
set rs=conn.execute (sql)
do while not rs.eof
response.write "<option value="&rs("flagp")&"‖"&rs("price")&"‖"&rs("deliver_name")&">"&rs("deliver_name")&"(¥附加"&FormatNumber(rs("price"),2,-1)&"元)</option>"
rs.movenext
loop
rs.close
set rs=nothing
response.write "</select>"
%> *</td>
</tr>
<tr>
<td width="353" align="right" height="20">备注:</td>
<td width="626" height="20"><textarea rows="7" name="s9" cols="34"></textarea></td>
</tr>
<tr>
<td width="982" colspan="2" height="20"><input type=hidden name=yqj_money value=<%=yqj_money%>>
<p align="center"><input type="submit" value="下一步" name="B1">
<input type="button" value="关闭" name="B2" onclick="window.close()"></td>
</tr></form>
</table>
<%
sub save()
dim q(9),i,rs,price,allmoney
for i=1 to 9
q(i)=my_request("s"&i,0)
next
yqj_money=my_request("yqj_money",1)
t=split(q(8),"‖")
'set rs=conn.execute ("select deliver_name,price from deliver where id="&cint(t(0)))
'deliver_name=rs("deliver_name")
'price=rs("price")
'rs.close
'set rs=nothing
allmoney=(yqj_money*q(1)+t(1))
%>
<table border="0" width="100%" cellspacing="1" class="li_table">
<form action=alpayok.asp method=post target=_blank>
<tr>
<td width="982" colspan="2" height="20" class="maincolor">
<p align="center">商品订单-<font color="#FF6600">支付宝支付-</font><font color="#FF0000">确认</font></td>
</tr>
<tr>
<td width="353" align="right" height="20">产品名称:</td>
<td width="626" height="20"><%=p_name%><input type=hidden name=allmoney value=<%=allmoney%>></td>
</tr>
<tr>
<td width="353" align="right" height="20">商品单价:</td>
<td width="626" height="20"><%=FormatNumber(yqj_money,2,-1)%>元</td>
</tr>
<tr>
<td width="353" align="right" height="20">购买数量:</td>
<td width="626" height="20">
<%=q(1)%><input type=hidden name=q1 value=<%=q(1)%>> </td>
</tr>
<tr>
<td width="353" align="right" height="20">您的姓名(收货人):</td>
<td width="626" height="20"><%=q(2)%><input type="hidden" name="q2" value=<%=q(2)%>> </td>
</tr>
<tr>
<td width="353" align="right" height="20">地址:</td>
<td width="626" height="20"><%=q(3)%><input type="hidden" name="q3" value="<%=q(3)%>"> </td>
</tr>
<tr>
<td width="353" align="right" height="20">邮政编码:</td>
<td width="626" height="20"><%=q(4)%><input type="hidden" name="q4" value="<%=q(4)%>"> </td>
</tr>
<tr>
<td width="353" align="right" height="20">电话:</td>
<td width="626" height="20"><%=q(5)%><input type="hidden" name="q5" value="<%=q(5)%>"> </td>
</tr>
<tr>
<td width="353" align="right" height="20">手机号码:</td>
<td width="626" height="20"><%=q(6)%><input type="hidden" name="q6" value="<%=q(6)%>"> </td>
</tr>
<tr>
<td width="353" align="right" height="20">电子邮件地址:</td>
<td width="626" height="20"><%=q(7)%><input type="hidden" name="q7" value="<%=q(7)%>"> </td>
</tr>
<tr>
<td width="353" align="right" height="20">支付宝支持的送货方式:</td>
<td width="626" height="20"><%=t(2)%>(费用:<%=FormatNumber(t(1),2,-1)%>)<input type=hidden name=q8 value=<%=t(0)%>>
<input type=hidden name=q10 value=<%=t(1)%>>
<input type=hidden name=q11 value=<%=t(2)%>></td>
</tr>
<tr>
<td width="353" align="right" height="20" bgcolor="#DDE8FF">
<font color="#FF0000">商品总计:</font></td>
<td width="626" height="20" bgcolor="#DDE8FF"><font color="#FF0000">
¥<%=FormatNumber(allmoney,2,-1)%>元(包括送货费用)</font></td>
</tr>
<tr>
<td width="353" align="right" height="20">备注:</td>
<td width="626" height="20"><%=q(9)%><input type=hidden name=q9 value=<%=q(9)%>><input type=hidden name=pid value=<%=id%>></td>
</tr>
<tr>
<td width="982" colspan="2" height="20">
<p align="center">
<input type="submit" value="马上用支付宝支付" name="B1" style="color: #000080"></td>
</tr></form>
</table>
<%end sub%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -