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

📄 shopping.asp

📁 网上商场 帐户管理方面     1.实现了购物车和收藏夹的功能。     2.实现了历史订单查询以及即时订单跟踪。     3.实现了个人资料修改,查询以及送货人信息修改和查询。  
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="conn.asp"-->
<%if request.cookies("bookshop")("username")="" then
response.write "<script language=javascript>alert('对不起,您还没有登陆!');window.location.reload('javascript:window.close()')</script>"
response.End
end if%>
<!--#include file="webconfig.asp"-->
<html>
<head>
<title>我要下订单</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
<br>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="images/menu_bar01.jpg">
        <tr> 
          <td><div align="center"><strong><font color="#FFFFFF">我要下订单</font></strong></div></td>
        </tr>
      </table></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('对不起,您没有选择商品!');window.location.reload('javascript:window.close()')</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="96%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
  <form name="form1" method="post" action="">
    <tr> 
      <td width="48%" bgcolor="#5F95D3"><div align="center"><font color="#FFFFFF">商品名称</font></div></td>
      <td width="13%" bgcolor="#5F95D3"><div align="center"><font color="#FFFFFF">市场价</font></div></td>
      <td width="11%" bgcolor="#5F95D3"><div align="center"><font color="#FFFFFF">折扣</font></div></td>
      <td width="7%" bgcolor="#5F95D3"><div align="center"><font color="#FFFFFF">数量</font></div></td>
      <td width="12%" bgcolor="#5F95D3"><div align="center"><font color="#FFFFFF">小计</font></div></td>
      <td width="9%" bgcolor="#5F95D3"><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 bgcolor="#EFF5FE" STYLE='PADDING-LEFT: 5px'><%=trim(rs("bookname"))%>
        <input type=hidden name=bookname value=<%=trim(rs("bookname"))%>></td>
      <td bgcolor="#EFF5FE"><div align="center"><%=formatnumber(rs("shichangjia"),2)&"元"%></div></td>
      <input type=hidden name=huiyuanjia value=<%=rs("huiyuanjia")%>>
      <td bgcolor="#EFF5FE"><div align="center"><%=formatnumber(rs("dazhe")*100,2)&"%"%></div></td>
      <td bgcolor="#EFF5FE"><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 bgcolor="#EFF5FE"><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 bgcolor="#EFF5FE"><div align="center"> 
          <input style="background-color: #A5C1E0; background-repeat: repeat; background-attachment: scroll; color: #000000; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; height: 18px; line-height: normal; border: 1px solid #000000; background-position: 0% 50%" type="submit" name="Submit" value="修改"  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="#EFF5FE">
      <td height="18" colspan="6" ><div align="right"><font color="#FF0000">总计:<%=iii%>元&nbsp;&nbsp;&nbsp;&nbsp;</font></div></td>
    </tr>
    <tr bgcolor="#EFF5FE"> 
      <td height="32" colspan="6" ><div align="center"> 
          <input style="background-color: #A5C1E0; background-repeat: repeat; background-attachment: scroll; color: #000000; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; height: 18px; line-height: normal; border: 1px solid #000000; background-position: 0% 50%" type="submit" name="Submit2" value="下一步" onclick="this.form.action='shopping.asp?action=ckxp1&id=<%=bookid%>';this.form.submit()" >
          &nbsp;&nbsp; 

        </div></td> 
    </tr>
  </form>
</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="96%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
  <form name="shouhuoxx" method="post" action="shopping.asp?action=ok&id=<%=bookid%>&userid=<%=userid%>">
    <%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%>
    <tr bgcolor="#EFF5FE"> 
      <td width="211" STYLE='PADDING-LEFT: 10px'>收货人姓名:</td>
      <td width="731" height="28" STYLE='PADDING-LEFT: 10px'><input name="shouhuoname" type="text" id="shouhuoname" size="12" value=<%=trim(rs("shouname"))%>> 
        &nbsp;&nbsp;性 别: 
        <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>"
		  case else
response.write "<option value=0  selected>男</option><option value=1 >女</option>"
		  
		  end select%>
        </select> <input type=hidden name=userzhenshiname value=<%=trim(rs("userzhenshiname"))%>> 
      </td>
    </tr>
    <tr bgcolor="#EFF5FE"> 
      <td STYLE='PADDING-LEFT: 10px'>收货人省/市:</td>
      <td height="28" STYLE='PADDING-LEFT: 10px'><input name="shengshi" type="text" id="shengshi" value=<%=trim(rs("shengshi"))%>></td>
    </tr>
    <tr bgcolor="#EFF5FE"> 
      <td STYLE='PADDING-LEFT: 10px'>详细地址:</td>
      <td height="28" STYLE='PADDING-LEFT: 10px'><input name="shouhuodizhi" type="text" id="shouhuodizhi" size="40" value=<%=trim(rs("shouhuodizhi"))%>></td>
    </tr>
    <tr bgcolor="#EFF5FE"> 
      <td STYLE='PADDING-LEFT: 10px'>邮编:</td>
      <td height="28" STYLE='PADDING-LEFT: 10px'><input name="youbian" type="text" id="youbian" size="12" value=<%=rs("youbian")%>> 
      </td>
    </tr>
    <tr bgcolor="#EFF5FE"> 
      <td STYLE='PADDING-LEFT: 10px'>电话:</td>
      <td height="28" STYLE='PADDING-LEFT: 10px'><input name="usertel" type="text" id="usertel" size="12" value=<%=trim(rs("usertel"))%>> 
        &nbsp;<font color=red>请准确填写,我们将通过此电话和您进行确认.</font></td>
    </tr>
    <tr bgcolor="#EFF5FE"> 
      <td STYLE='PADDING-LEFT: 10px'>电子邮件:</td>
      <td height="28" STYLE='PADDING-LEFT: 10px'><input name="useremail" type="text" id="useremail" value=<%=trim(rs("useremail"))%>></td>
    </tr>
    <%=trim(request("useremail"))%> 
    <tr bgcolor="#EFF5FE"> 
      <td height="32" STYLE='PADDING-LEFT: 10px'>请选择送货方式:</td>
      <td height="28" STYLE='PADDING-LEFT: 10px'> <table border="0" cellpadding="0" cellspacing="0">
          <tr> 
            <td width="22" rowspan="4"> <%dim rs3
          '//////////判断送货方式
          set rs3=server.CreateObject("adodb.recordset")
          rs3.Open "select * from shop_songhuo where fangshi=0 order by songidorder",conn,1,1
          response.Write "<select cols='10'  name=songhuofangshi size="&rs3.recordcount&" id=songhuofangshi>"
          do while not rs3.EOF
          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>"
          rs3.MoveNext
          loop
          response.Write "</select>"
          rs3.Close
          set rs3=nothing
         %> </td>
            <td width="19">&nbsp;</td>
            <td><font color=red>&nbsp;<strong>送货方式</strong></font></td>
            <td><font color=red>&nbsp;<strong>资费</strong></font></td>
            <td><font color=red>&nbsp;<strong>送抵时间</strong></font></td>
          </tr>
          <tr>
            <td width="19">&nbsp;</td>
            <td width="129"><font color=red>&nbsp;送货上门(限上海市内)</font> </td>
            <td width="68"><font color=red>&nbsp;10元</font></td>
            <td width="105"><font color=red>&nbsp;当天</font></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><font color=red>&nbsp;邮政包裹</font> </td>
            <td><font color=red>&nbsp;10元</font></td>
            <td><font color=red>&nbsp;5 - 7日内送达</font></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><font color=red>&nbsp;EMS</font></td>
            <td><font color=red>&nbsp;40元</font></td>
            <td><font color=red>&nbsp;2 - 3日内送达</font></td>
          </tr>
        </table></td>
    </tr>
    <tr bgcolor="#EFF5FE"> 
      <td height="32" STYLE='PADDING-LEFT: 10px'>请选择支付方式:</td>
      <td height="28" STYLE='PADDING-LEFT: 10px'> </select> 
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="3%"> <%
          '//////////判断支付方式
          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="&rs3.recordcount&" id=zhifufangshi>"
          do while not rs3.eof
          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>"
          rs3.movenext
          loop
          response.Write "</select>"
          rs3.close
          set rs3=nothing     
	  rs.close
	  set rs=nothing%> </td>
            <td width="19">&nbsp;</td>
            <td width="95%">注:其中的&quot;&nbsp;货到付款&quot;支付方式,即本公司送货人员上门之后,当面结清货款。</td>
          </tr>
        </table></td>
    </tr>
    <tr bgcolor="#EFF5FE"> 
      <td height="32" STYLE='PADDING-LEFT: 10px'>简单留言:</td>
      <td height="28" STYLE='PADDING-LEFT: 10px'><textarea name="liuyan" cols="40" rows="5" id="liuyan"></textarea></td>
    </tr>
    <tr bgcolor="#EFF5FE"> 
      <td height="32" STYLE='PADDING-LEFT: 10px'>&nbsp; </td>
      <td height="32" STYLE='PADDING-LEFT: 10px'><input  style="background-color: #A5C1E0; background-repeat: repeat; background-attachment: scroll; color: #000000; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; height: 18px; line-height: normal; border: 1px solid #000000; background-position: 0% 50%" type="submit" name="Submit3" value="提交订单" onclick="return ssxx();" id=ddd></td>
    </tr>
  </form>
</table>
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}

function ssxx()
{
   if(checkspace(document.shouhuoxx.shouhuoname.value)) {
	document.shouhuoxx.shouhuoname.focus();
    alert("对不起,请填写收货人姓名!");
	return false;
  }
  if(checkspace(document.shouhuoxx.shengshi.value)) {
	document.shouhuoxx.shengshi.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(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(checkspace(document.shouhuoxx.zhifufangshi.value)) {
	document.shouhuoxx.zhifufangshi.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 || 

⌨️ 快捷键说明

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