📄 confirm.asp
字号:
<!-- #include file="../inc/conn.asp" -->
<!-- #include file="../inc/function.asp" -->
<%
if session("username") = "" then
response.Redirect("index.asp")
end if
if session("buylist") = "" then
response.Redirect("index.asp")
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>意科在线定单系统</title>
<style>
.w-1 {
font-family: "宋体";
font-size: 12px;
color: #FFFFFF;
background-position: bottom;
}
.w-2 {
font-family: "宋体";
font-size: 12px;
color: #cccccc;
background-position: bottom;
}
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- #include file="../inc/qhead.asp" -->
<table width="737" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="666666">
<tr>
<td height="20" colspan="3"> </td>
</tr>
<tr>
<td width="170" height="20" valign="top" bgcolor="606060"><!-- #include file="../inc/left.inc" --></td>
<td width="8"> </td>
<td width="559" valign="top">
<table width="100%" border="0">
<tr>
<td class="w-1"><b>商品信息:</b></td>
</tr>
</table>
<hr>
<%
suan = mid(session("buylist"),1,len(session("buylist"))-2)
sstr = split(suan,"*@")
for i=0 to ubound(sstr)
sinp = split(sstr(i),"#")
total = total+sinp(2)*sinp(3)
%>
<table width="100%" border="0" class="w-1">
<tr>
<td width="17%" height="25"><div align="right">产品编号:</div></td>
<td width="33%" height="25"><%=sinp(0)%></td>
<td width="19%" height="25"><div align="right">产品名称:</div></td>
<td width="31%" height="25"><%=sinp(1)%></td>
</tr>
<tr>
<td height="25"><div align="right">产品单价:</div></td>
<td height="25"><%=sinp(2)%></td>
<td height="25"><div align="right">所购数量:</div></td>
<td height="25"><%=sinp(3)%></td>
</tr>
<tr>
<td height="25"><div align="right">小 计:</div></td>
<td height="25"><%=sinp(2)*sinp(3)%></td>
<td height="25"><div align="right"></div></td>
<td height="25"> </td>
</tr>
</table>
<hr>
<%
next
%>
<table width="100%" border="0">
<tr>
<td width="69%" class="w-1"><div align="right"><b>总价格:</b></div></td>
<td width="31%" class="w-1"><b><%=total%></b></td>
</tr>
</table>
<table width="100%" border="0" class="w-1">
<tr>
<td height="30"><b>用户信息:</b></td>
</tr>
</table>
<%
sql = "SELECT uid,username, uname, phone, email, postalcode, address FROM people WHERE (username = '"&session("username")&"')"
rs.open sql,conn
if not rs.eof then
uname = rs("uname")
phone = rs("phone")
email = rs("email")
postalcode = rs("postalcode")
address = rs("address")
uid = rs("uid")
end if
rs.close
%>
<form name="conform" method="post" action="confirmOK.asp">
<input type="hidden" name="uid" value="<%=uid%>">
<input type="hidden" name="total" value="<%=total%>">
<table width="100%" border="0" class="w-1">
<tr>
<td width="15%" height="25"><div align="right">联系人:</div></td>
<td width="40%" height="25"><label>
<input type="text" name="uname" value="<%=uname%>">
</label></td>
<td width="13%" height="25"><div align="right">联系电话:</div></td>
<td width="32%" height="25"><label>
<input name="phone" type="text" size="15" value="<%=phone%>">
</label></td>
</tr>
<tr>
<td height="25"><div align="right">E-mail:</div></td>
<td height="25"><label>
<input name="email" type="text" size="30" value="<%=email%>">
</label></td>
<td height="25"><div align="right">邮编:</div></td>
<td height="25"><label>
<input name="postalcode" type="text" size="15" value="<%=postalcode%>">
</label></td>
</tr>
<tr>
<td height="25"><div align="right">地 址:</div></td>
<td height="25" colspan="3"><label>
<input name="address" type="text" size="47" value="<%=address%>">
</label></td>
</tr>
<tr>
<td height="22" colspan="4" valign="bottom"> 客人附加要求:</td>
</tr>
<tr>
<td height="25" colspan="4"> <textarea name="remark" cols="63" rows="7"></textarea></td>
</tr>
<tr>
<td colspan="4"><label></label></td>
</tr>
<tr>
<td colspan="4">
<div align="right">
<br>
<input type="button" onClick="check()" name="Submit2" value="提交订单"> </div></td>
</tr>
</table><br><br><br>
</form>
</td>
</tr>
</table>
<!-- #include file="../inc/bottom.asp" -->
<script language="javascript">
function isMadeOf(val,str){
var jj;
var chr;
for (jj=0;jj<val.length;++jj){
chr=val.charAt(jj);
if (str.indexOf(chr,0)==-1)
return false;
}
return true;
}
function forPhone(obj){
var phoneStr= "()-#0123456789";
if (!isMadeOf(obj.value,phoneStr)){
flag = 1;
return false;
}
return true;
}
function forPostalcode(obj){
var postalcode= "0123456789";
if (!isMadeOf(obj.value,postalcode)){
flag = 1;
return false;
}
return true;
}
function verifyUsername(strUsername){
var myReg = /^[_a-zA-Z0-9_-_@_._.]+\w$/;
if(myReg.test(strUsername))
return true;
else
return false;
}
function isEmail(s){
if (s.length > 100)
return false;
var regu="^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[_.0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|NET|com|COM|gov|GOV|mil|MIL|org|ORG|edu|EDU|int|INT)$";
var re = new RegExp(regu);
if (s.search(re) != -1)
return true;
else
return false;
}
function check(){
if(document.conform.uname.value.replace(/(^\s*)|(\s*$)/g, "")==""){
alert("用户姓名不能为空!");
document.conform.uname.focus();
return false;
}
if(document.conform.email.value.replace(/(^\s*)|(\s*$)/g, "")==""){
alert("Email不能为空!");
document.conform.email.focus();
return false;
}
if(document.conform.email.value.replace(/(^\s*)|(\s*$)/g, "")!=""){
if(!isEmail(document.conform.email.value)){
alert("Email输入有误,请检查!");
document.conform.email.focus();
return false;
}
}
if(document.conform.phone.value.replace(/(^\s*)|(\s*$)/g, "")==""){
alert("电话不能为空!");
document.conform.phone.focus();
return false;
}
if(document.conform.phone.value.replace(/(^\s*)|(\s*$)/g, "")!=""){
if(!forPhone(document.conform.phone)){
alert("电话值不正确!请填写数字,可以包含(,),-,#符号");
document.conform.phone.focus();
return false;
}
}
if(document.conform.postalcode.value.replace(/(^\s*)|(\s*$)/g, "")==""){
alert("邮编不能为空!");
document.conform.postalcode.focus();
return false;
}
if(document.conform.postalcode.value.replace(/(^\s*)|(\s*$)/g, "")!=""){
if(!forPostalcode(document.conform.postalcode)){
alert("所填邮编不正确!请填写数字");
document.conform.postalcode.focus();
return false;
}
}
if(document.conform.address.value.replace(/(^\s*)|(\s*$)/g, "")==""){
alert("地址不能为空!");
document.conform.address.focus();
return false;
}
document.conform.submit();
}
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -