📄 shopping.asp
字号:
<!--#include file="conn.asp"-->
<%if request.cookies("bookshop")("username")="" then
response.write "<script language=javascript>alert('对不起,您还没有登陆!');history.go(-1);</script>"
response.End
end if%>
<!--#include file="webconfig.asp"-->
<html>
<head>
<title><%=webname%>--我要下订单</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
<style>
td{font-size:9pt;line-height:120%;color:#353535}
body{font-size:9pt;line-height:120%}
a:link { color: #000000; text-decoration: none }
a:visited { color: #000000; text-decoration: none }
a:active { color: #000000; text-decoration: none }
a:hover { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>
<body leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
<table width="96%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr>
<td> </td>
</tr>
</table>
<%dim bookid,action,i
action=request.QueryString("action")
if request.QueryString("id")="" then
bookid=request("bookid")
else
bookid=request.QueryString("id")
end if
if bookid="" then
response.write "<script language=javascript>alert('对不起,您没有选择商品!');history.go(-1);</script>"
response.End
end if
select case action
'//////////////////////////////////
case ""
set rs=server.CreateObject("adodb.recordset")
rs.open "select bookid,bookname,shichangjia,huiyuanjia,dazhe from shop_books where bookid in ("&bookid&") order by bookid",conn,1,1%>
<table width="98%" border="0" cellspacing="0" cellpadding="1" align="center">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
<tr>
<td class="12v" >
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
<tr>
<td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<form name="form1" method="post" action="">
<tr>
<td width="38%" bgcolor="#666666" height="19">
<div align="center"><font color="#FFFFFF">商品名称</font></div>
</td>
<td width="15%" bgcolor="#666666" height="19">
<div align="center"><font color="#FFFFFF">市场价</font></div>
</td>
<td width="12%" bgcolor="#666666" height="19">
<div align="center"><font color="#FFFFFF">折扣</font></div>
</td>
<td width="11%" bgcolor="#666666" height="19">
<div align="center"><font color="#FFFFFF">数量</font></div>
</td>
<td width="12%" bgcolor="#666666" height="19">
<div align="center"><font color="#FFFFFF">小计</font></div>
</td>
<td width="12%" bgcolor="#666666" height="19">
<div align="center"><font color="#FFFFFF">修改数量</font></div>
</td>
</tr>
<%dim iii '定义总价
iii=0
dim bookscount,books '定义判断有几个bookid
bookscount=request.QueryString("id").count
do while not rs.eof
dim quatity '判断input 名
Quatity = CInt( Request( "ckxp"&rs("bookid")) )
If Quatity <=0 Then Quatity = 1
%>
<tr>
<td style='PADDING-LEFT: 5px' height="28" bgcolor="#efefef" width="38%"><%=trim(rs("bookname"))%>
<input type=hidden name=bookname value=<%=trim(rs("bookname"))%>>
</td>
<td height="28" bgcolor="#efefef" width="15%">
<div align="center"><%=formatnumber(rs("shichangjia"),2)&"元"%></div>
</td>
<input type=hidden name=huiyuanjia value=<%=rs("huiyuanjia")%>>
<td height="28" bgcolor="#efefef" width="12%">
<div align="center"><%=formatnumber(rs("dazhe")*100,2)&"%"%></div>
</td>
<td height="28" bgcolor="#efefef" width="11%">
<div align="center">
<input name="<%="ckxp"& rs("bookid")%>" type="text" size="3" value="<%=Quatity%>" onKeyPress= "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"onpaste = "return regInput(this,/^[0-9]*$/, window.clipboardData.getData('Text'))"ondrop= "return regInput(this,/^[0-9]*$/,event.dataTransfer.getData('Text'))">
</div>
</td>
<td height="28" bgcolor="#efefef" width="12%">
<div align="center">
<%if Quatity<=1 then
response.write formatnumber(rs("huiyuanjia")*1,2)&"元"
else
response.write formatnumber(rs("huiyuanjia")*Quatity,2)&"元"
end if
iii=formatnumber(rs("huiyuanjia")*Quatity+iii,2 )
%>
</div>
</td>
<td height="28" bgcolor="#efefef" width="12%">
<div align="center">
<input type="image" border="0" name="submit" src="images/xg.gif" width="54" height="18" onClick="this.form.action='shopping.asp?id=<%=bookid%>';this.form.submit()">
</div>
</td>
</tr>
<%if bookscount=1 then books=rs("bookid")
rs.movenext
loop
rs.close
set rs=nothing%>
<tr bgcolor="#efefef">
<td height="22" colspan="6" >
<div align="right"><font color="#FF0000">总计:<%=iii%>元 </font></div>
</td>
</tr>
<tr bgcolor="#efefef">
<td height="29" colspan="6" >
<div align="center">
<input type="image" border="0" name="submit2" src="images/xyb.gif" width="54" height="18" onClick="this.form.action='shopping.asp?action=ckxp1&id=<%=bookid%>';this.form.submit()" >
<%if bookscount=1 then%>
<input type="image" border="0" name="submit3" src="images/shc.gif" width="46" height="19" onClick="location.href='shoucang.asp?id=<%=books%>&action=add'">
<%end if%>
</div>
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
'/////////////////////////////////////////
case "ckxp1"
'response.Write bookid
set rs=server.CreateObject("adodb.recordset")
rs.open "select shouname,userid,shousex,useremail,shengshi,shouhuodizhi,youbian,usertel,zhifufangshi,songhuofangshi,userzhenshiname from [user] where username='"&request.cookies("bookshop")("username")&"'",conn,1,1
dim userid
userid=rs("userid")%>
<table width="98%" border="0" cellspacing="0" cellpadding="1" align="center">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
<tr>
<td class="12v" >
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
<tr>
<td>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000">
<form name="shouhuoxx" method="post" action="shopping.asp?action=ok&id=<%=bookid%>&userid=<%=userid%>">
<b>
<%dim rs2
set rs2=server.CreateObject("adodb.recordset")
'付值某的数量
rs2.open "select bookid from shop_books where bookid in ("&bookid&") order by bookid",conn,1,1
do while not rs2.eof
%>
<input name="<%="ckxp"&rs2("bookid")%>" type="hidden" value="<%=cint(request("ckxp"&rs2("bookid")))%>">
<%
rs2.movenext
loop
rs2.close
set rs2=nothing%>
</b>
<tr bgcolor="#EFefef">
<td width="199" style='PADDING-LEFT: 20px'><b>收货人姓名:</b></td>
<td width="771" height="28" style='PADDING-LEFT: 20px'>
<b>
<input name="shouhuoname" type="text" id="shouhuoname" size="12" value=<%=trim(rs("shouname"))%>>
性 别:
<select name="shousex" id="shousex">
<%select case rs("shousex")
case ""
response.write "<option value=0 selected>男</option><option value=1>女</option>"
case "0"
response.write "<option value=0 selected>男</option><option value=1>女</option>"
case "1"
response.write "<option value=0 >男</option><option value=1 selected>女</option>"
end select%>
</select>
<input type=hidden name=userzhenshiname value=<%=trim(rs("userzhenshiname"))%>>
</b></td>
</tr>
<tr bgcolor="#EFefef">
<td style='PADDING-LEFT: 20px' width="199"><b>收货人省/市:</b></td>
<td height="28" style='PADDING-LEFT: 20px' width="771">
<b>
<input name="shengshi" type="text" id="shengshi" value=<%=trim(rs("shengshi"))%>>
</b></td>
</tr>
<tr bgcolor="#EFefef">
<td style='PADDING-LEFT: 20px' width="199"><b>详细地址:</b></td>
<td height="28" style='PADDING-LEFT: 20px' width="771">
<b>
<input name="shouhuodizhi" type="text" id="shouhuodizhi" size="40" value=<%=trim(rs("shouhuodizhi"))%>>
</b></td>
</tr>
<tr bgcolor="#EFefef">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -