📄 jszx.asp
字号:
<!--#include file="conn.asp"-->
<%if request.cookies("godbook")("username")="" then
response.write "<script language=javascript>alert('对不起,您还没有登陆!');history.go(-1);</script>"
response.End
end if%>
<!--#include file="webconfig.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=webname%>-商品信息</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- 导航菜单 -->
<!--#include file="top.asp" -->
<div id="content">
<!-- 快捷导航 -->
<div id="content_m"><a href="index.asp">首页</a> > <span class="new">订单页面</span></div>
<!-- 主内容左侧 -->
<div id="content_l">
<!-- 公告 -->
<!--#include file="history.asp"-->
<!-- 左侧目录 -->
<!--#include file="shoppingbag.asp"-->
<div class="clear-both"> </div>
</div>
<!-- 右侧内容 -->
<div id="content_r">
<!-- 购物车订单页面 -->
<div id="shoppingbaglist">
<%dim bookid,action,i
action=request("action")
set rs=server.CreateObject("adodb.recordset")
rs.open "select count(*) as rec_count from shop_action where username='"&request.cookies("godbook")("username")&"' and zhuangtai=7",conn,1,1
if rs("rec_count")=0 then
response.write "<script language=javascript>alert('对不起,您购物车没有商品,请在购物后,再去“结算中心”!');window.close();</script>"
response.End
end if
rs.close
set rs=nothing
//////////////////////////////////
select case action
case ""
set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_action.actionid,shop_action.bookid,shop_action.bookcount,shop_action.zonger,shop_books.bookname,shop_action.shjiaid,shop_books.shichangjia,shop_books.huiyuanjia,shop_books.vipjia from shop_books inner join shop_action on shop_books.bookid=shop_action.bookid where shop_action.username='"&request.cookies("godbook")("username")&"' and shop_action.zhuangtai=7",conn,1,1
%>
<!-- 第一步 -->
<form name='form1' method='post' action="jszx.asp?action=shop1">
<table width="590" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="tit">商家名称</td>
<td class="tit">商品名称</td>
<td class="tit">单价<%if request.cookies("godbook")("reglx")=2 then %>(VIP)<%else%>(会员)<%end if%></td>
<td class="tit">数量</td>
<td class="tit">总价</td>
<td class="tit">删除</td>
</tr>
<%shuliang=rs.recordcount
jianshu=0
zongji=0
do while not rs.eof%>
<tr>
<td><%id=rs("shjiaid")
if id>1 then
set rs_shj=server.CreateObject("adodb.recordset")
rs_shj.open "select name from shjia where shjiaid="&id,conn,1,1%>
<span class="new"><%=rs_shj("name")%>
<%rs_shj.close
set rs_shj=nothing
else
response.write "<span class=""new"">"&webname&""
end if%></span></td>
<td><strong><a href="list.asp?id=<%=rs("bookid")%>"><%=rs("bookname")%></a></strong> <input name="bookid" type="hidden" value="<%=rs("bookid")%>" /><input name="actionid" type="hidden" value="<%=rs("actionid")%>" /></td>
<td><%
if request.Cookies("godbook")("reglx")=2 then
response.write rs("vipjia")
else
response.write rs("huiyuanjia")
end if%>
元</td>
<td><input name="bookcount" value="<%=rs("bookcount")%>" /></td>
<td><%=rs("zonger")%></td>
<td><a href="gouwu.asp?action=del&actionid=<%=rs("actionid")%>">删除</a></td>
</tr><%jianshu=jianshu+rs("bookcount")
zongji=zongji+rs("zonger")
rs.movenext
loop
rs.close
set rs=nothing%>
</table>
<p>购物车里有商品:<%=shuliang%> 件 总数:<%=jianshu%> 件 共计:<%=zongji%> 元 您有预存款:<%=request.cookies("godbook")("yucun")%> 元</p>
<p><input type="button" name="Submit" value="" class="modbug" onclick="this.form.action='gouwu.asp?action=show';this.form.submit()" /><input type="submit" name="Submit3" value="" class="oknext" /></p>
<%set godbook=server.CreateObject("adodb.recordset")
godbook.open "select * from shop_action_jp where username='"&request.cookies("godbook")("username")&"' and zhuangtai=7",conn,1,1
if godbook.recordcount>0 then%>
<table width="590" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="tit">奖品名称</td>
<td class="tit">使用积分</td>
<td class="tit">删除</td>
</tr>
<%while not godbook.eof%>
<tr>
<td><%set godbook1=server.CreateObject("adodb.recordset")
godbook1.open "select * from shop_jiangpin where bookid="&godbook("bookid"),conn,1,1
if godbook1.recordcount=1 then
response.write "<a href='listjp.asp?id="&godbook("bookid")&"'>"&godbook1("bookname")&"</a>"
end if
godbook1.close
set godbook1=nothing%></td>
<td><%=godbook("jifen")%></td>
<td><a href="jifen.asp?actionid=<%=godbook("actionid")%>&action=del&ll=22"><img src="images/trash.gif" alt="" /></a></td>
</tr>
<%godbook.movenext
wend%>
</table>
<%end if
godbook.close
set godbook=nothing%>
</form>
<!-- 第二步 -->
<%
case "shop1"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [user] where username='"&request.cookies("godbook")("username")&"'",conn,1,1
userid=rs("userid")
%>
<table width="590" cellspacing="0" cellpadding="0">
<form name="shouhuoxx" method="post" action="jszx.asp?action=shop2" onsubmit="ssxx">
<tr>
<td colspan="2" class="tit">请正确填写以下收货信息</td>
</tr>
<tr>
<td class="left">收货人真实姓名:</td>
<td class="right"><input name="userid" type="hidden" value="<%=userid%>" /><input name="userzhenshiname" type="text" id="userzhenshiname" value=<%=trim(rs("userzhenshiname"))%> /></td>
</tr>
<tr>
<td>性别:</td>
<td class="right"><select name="shousex" id="shousex"><option value=1 <%if rs("sex")="1" then%>selected<%end if%>>男</option><option value=2 <%if rs("sex")="0" then%>selected<%end if%>>女</option><option value=0 <%if rs("sex")="2" then%>selected<%end if%>>保密</option></select></td>
</tr>
<tr>
<td>详细地址:</td>
<td class="right"><input name="shouhuodizhi" type="text" id="shouhuodizhi" value=<%=trim(rs("shouhuodizhi"))%> /></td>
</tr>
<tr>
<td>邮政编码:</td>
<td class="right"><input name="youbian" type="text" id="youbian" value="<%=rs("youbian")%>" onkeypress="event.returnValue=IsDigit();" /></td>
</tr>
<tr>
<td>联系电话:</td>
<td class="right"><input name="usertel" type="text" id="usertel" value=<%=trim(rs("usertel"))%> /></td>
</tr>
<tr>
<td>电子邮件:</td>
<td class="right"><input name="useremail" type="text" id="useremail" size="30" value=<%=trim(rs("useremail"))%> /></td>
</tr>
<tr>
<td>送货方式:</td>
<td class="right"><%set rs2=server.CreateObject("adodb.recordset")
rs2.Open "select * from youbian where youbian='"&trim(request("youbian"))&"'",conn,1,1
if rs2.recordcount=1 then
shangmen=1
else
shangmen=0
end if
rs2.close
set rs2=nothing
'//////////判断送货方式
set rs3=server.CreateObject("adodb.recordset")
rs3.Open "select * from shop_songhuo where fangshi=0 order by songidorder",conn,1,1
response.Write "<select name=songhuofangshi size=5 style='width:180px'>"
do while not rs3.EOF
if not(shangmen=3 and trim(rs3("songid"))=3) then '显示不显示“送货上门”
response.Write "<option value="&rs3("songid")
if int(rs("songhuofangshi"))=int(rs3("songid")) then
response.Write " selected>"
else
response.Write ">"
end if
response.Write trim(rs3("subject"))&"</option>"
end if
rs3.MoveNext
loop
response.Write "</select>"
rs3.Close
set rs3=nothing%></td>
</tr>
<tr>
<td>支付方式:</td>
<td class="right"><%'set rs2=server.CreateObject("adodb.recordset")
'rs2.Open "select * from shop_songhuo where songid="&trim(request("songhuofangshi")),conn,1,1
if cint(request("songhuofangshi"))=3 then
fukuan=1
else
fukuan=0
end if
'rs2.close
'set rs2=nothing
'//////////判断支付方式
set rs3=server.CreateObject("adodb.recordset")
rs3.open "select * from shop_songhuo where fangshi=1 order by songidorder",conn,1,1
response.Write "<select name=zhifufangshi size=5 style='width:180px'>"
do while not rs3.eof
if not(fukuan=4 and trim(rs3("songid"))=4) then '显示不显示“货到付款”
response.Write "<option value="&rs3("songid")
if int(rs("zhifufangshi"))=int(rs3("songid")) then
response.Write " selected>"
else
response.Write ">"
end if
response.Write trim(rs3("subject"))&"</option>"
end if
rs3.movenext
loop
response.Write "</select>"
rs3.close
set rs3=nothing%></td>
</tr>
</table>
<p><input class="front" type="button" name="Submit2" value="" onclick="javascript:history.go(-1)" />
<input class="oknext" type="submit" name="Submit4" value="" onclick='return ssxx();' /></p>
</form>
<script language="javascript" type="text/javascript">
<!--
function IsDigit()
{
return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function ssxx()
{
if(checkspace(document.shouhuoxx.userzhenshiname.value)) {
document.shouhuoxx.userzhenshiname.focus();
alert("对不起,请填写收货人姓名!");
return false;
}
if(checkspace(document.shouhuoxx.shouhuodizhi.value)) {
document.shouhuoxx.shouhuodizhi.focus();
alert("对不起,请填写收货人详细收货地址!");
return false;
}
if(checkspace(document.shouhuoxx.youbian.value)) {
document.shouhuoxx.youbian.focus();
alert("对不起,请填写邮编!");
return false;
}
if(document.shouhuoxx.youbian.value.length!=6) {
document.shouhuoxx.youbian.focus();
alert("对不起,请正确填写邮编!");
return false;
}
if(checkspace(document.shouhuoxx.usertel.value)) {
document.shouhuoxx.usertel.focus();
alert("对不起,请留下您的电话!");
return false;
}
if(checkspace(document.shouhuoxx.songhuofangshi.value)) {
document.shouhuoxx.songhuofangshi.focus();
alert("对不起,请选择送货方式!");
return false;
}
if(document.shouhuoxx.useremail.value.length!=0)
{
if (document.shouhuoxx.useremail.value.charAt(0)=="." ||
document.shouhuoxx.useremail.value.charAt(0)=="@"||
document.shouhuoxx.useremail.value.indexOf('@', 0) == -1 ||
document.shouhuoxx.useremail.value.indexOf('.', 0) == -1 ||
document.shouhuoxx.useremail.value.lastIndexOf("@")==document.shouhuoxx.useremail.value.length-1 ||
document.shouhuoxx.useremail.value.lastIndexOf(".")==document.shouhuoxx.useremail.value.length-1)
{
alert("Email地址格式不正确!");
document.shouhuoxx.useremail.focus();
return false;
}
}
else
{
alert("Email不能为空!");
document.shouhuoxx.useremail.focus();
return false;
}
}
//-->
</script>
<%
rs.close
set rs=nothing
case "shop2"
%>
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select shop_action.actionid,shop_action.bookid,shop_action.bookcount,shop_action.zonger,shop_books.bookname,shop_action.shjiaid,shop_books.anclassid,shop_books.banci,shop_books.shichangjia,shop_books.huiyuanjia,shop_books.vipjia from shop_books inner join shop_action on shop_books.bookid=shop_action.bookid where shop_action.username='"&request.cookies("godbook")("username")&"' and shop_action.zhuangtai=7 order by shop_books.shjiaid",conn,1,1
%>
<table width="590" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="tit">商家名称</td>
<td class="tit">商品名称</td>
<td class="tit">市场价</td>
<td class="tit">单价<%if request.cookies("godbook")("reglx")=2 then %>(VIP)<%else%>(会员)<%end if%></td>
<td class="tit">数量</td>
<td class="tit">邮寄浮动(单价)</td>
<td class="tit">总价</td>
</tr>
<%shuliang=rs.recordcount
jianshu=0
zongji=0
fudongjia=0
do while not rs.eof
%><tr>
<td><%id=rs("shjiaid")
if id>1 then
set rs_shj=server.CreateObject("adodb.recordset")
rs_shj.open "select name from shjia where shjiaid="&id,conn,1,1%><span class="new"><%=rs_shj("name")%>
<%
rs_shj.close
set rs_shj=nothing
else
response.write "<span class=""new"">"&webname&""
end if%></span></td>
<td><strong><%=rs("bookname")%></strong><input name="bookid2" type="hidden" value="<%=rs("bookid")%>" /><input name="actionid2" type="hidden" value="<%=rs("actionid")%>" /></td>
<td><%=rs("shichangjia")%> 元</td>
<td><%
if request.Cookies("godbook")("reglx")=2 then
response.write rs("vipjia")
else
response.write rs("huiyuanjia")
end if%>
元</td>
<td><%=rs("bookcount")%></td>
<td><%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from shop_fudong where id="&rs("banci"),conn,1,1
if cint(request("songhuofangshi"))=3 then '看是不是“送货上门”
if request.Cookies("godbook")("reglx")=2 then
fudongjia_dj=rs_s("smvip")
else
fudongjia_dj=rs_s("smhy")
end if
elseif cint(request("songhuofangshi"))=1 then '看是不是“平邮”
if request.Cookies("godbook")("reglx")=2 then
fudongjia_dj=rs_s("pyvip")
else
fudongjia_dj=rs_s("pyhy")
end if
else
if request.Cookies("godbook")("reglx")=2 then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -