<%

dim s_id,scat_id
dim founderr,errmsg
dim action,rsCatN,shop_temp
if request.querystring("s_id")<>"" then
    if not isInteger(request.querystring("s_id")) then
    Response.Redirect "show_error.asp?eid=传值参数非法!"
    Response.End
    end if
	s_id=CLng(request("s_id"))
else
	s_id=0
end if

if request.querystring("scat_id")<>"" then
  if not isInteger(request.querystring("scat_id")) then
    Response.Redirect "show_error.asp?eid=传值参数非法!"
    Response.End
  end if
  scat_id=CLng(request("scat_id"))
  start="网兜商城 - 商品列表"
else
  scat_id=0
  start="网兜商城 - 商品列表"
end if

if s_id>0 then
   sql="select * from shop where passed=0 and s_id="&s_id
   set rs=server.createobject("adodb.recordset")
   rs.open sql,conn,1,1
	if rs.bof and rs.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>你要找的商品不存在，或者已经被管理员删除！</li>"
	else	
		if rs("Passed")=1 then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>你要找的商品尚未被管理员审核！</li>"
		else
		        start="网兜商城 - "&rs("s_name")&""
		        scat_id=CLng(rs("scat_id"))
                end if
        end if
end if
'=================================================
if FoundErr=True then
	Call HxErrMsg()
	response.end
end if
'=================================================
'过程名：main_shop
'作  用：显示商城位置导航
'参  数：无
'=================================================
sub main_shop()
if scat_id>0 then
  Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='shop.asp'>网兜商城</a>" & vbCrLf
  sql="select * from scat where scat_id="&scat_id
  set rs3=conn.execute(sql)
  if rs3.eof then
  Response.Redirect "show_error.asp?eid=参数错误，找不到相关的记录!"
  Response.End
  End IF
  Response.Write " >> <a href=""shop.asp?action=1&scat_id="&rs3("scat_id")&""">"&rs3("scat_name")&"</a>" 
  rs3.close
  set rs3=nothing 
elseif request("t")="best" then 
  Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='shop.asp'>网兜商城</a> >> 推荐商品" & vbCrLf
elseif request("t")="tj" then 
  Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='shop.asp'>网兜商城</a> >> 特价商品" & vbCrLf
elseif request("t")="hot" then 
  Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='shop.asp'>网兜商城</a> >> 热卖商品" & vbCrLf
elseif Request("action")="1" then 
  Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='shop.asp'>网兜商城</a> >> 全部商品" & vbCrLf
else
  Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='shop.asp'>网兜商城</a> >> 首页" & vbCrLf
end if
end sub


'=================================================
'过程名：index_shop
'作  用：产品首页
'参  数：无
'=================================================
sub index_shop()
%>
      <table border="0" width="100%" align="center" cellpadding="0" cellspacing="2">
        <tr>
          <td style="padding-left:5px;"><img src=img/sub_spe_icon.gif width="19" height="17" hspace=5 border=0 align=absbottom><a href='?action=1'><font style="color: #F76885"><b>新品上架</b></font></a></td>
        </tr>
        <TR>
           <TD style="padding-left:5px;"><IMG height=2 src="img/sub_spe_sun.gif" width=555></TD>
       </TR>
        <tr>
          <td valign="top"><%call i_shop(4,22,0)%></TD>
        </tr>
        <tr>
          <td style="padding-left:5px;"><img src=img/sub_spe_icon.gif width="19" height="17" hspace=5 border=0 align=absbottom><a href='?action=1&t=best'><font style="color: #006666"><b>推荐商品</b></font></a></td>
        </tr>
        <TR>
           <TD style="padding-left:5px;"><IMG height=2 src="img/sub_theme_sun.gif" width=555></TD>
       </TR>
       <tr>
          <td valign="top"><%call i_shop(4,22,1)%></TD>
        </tr>
        <tr>
          <td style="padding-left:5px;"><img src=img/sub_spe_icon.gif width="19" height="17" hspace=5 border=0 align=absbottom><a href='?action=1&t=tj'><font style="color: #FF6600"><b>特价商品</b></font></a></td>
        </tr>
        <TR>
           <TD style="padding-left:5px;"><IMG height=2 src="img/sub_chu_sun.gif" width=555></TD>
       </TR>
        <tr>
          <td valign="top"><%call i_shop(4,22,2)%></TD>
        </tr>
      </TABLE>
<BR>
<%
end sub
'=================================================
'过程名：i_shop
'作  用：产品调用
'参  数：n-调用条数,nn-显示长度
'        sclass-----标识属性,0-最新,1-推荐,2-特价,3-热卖
'=================================================
sub i_shop(n,nn,sclass)
dim nnn
if sclass=0 then
nnn="where passed=0"
elseif sclass=1 then
nnn="where isbest = 1 and passed=0"
elseif sclass=2 then
nnn="where istj = 1 and passed=0"
elseif sclass=3 then
nnn="where ishot = 1 and passed=0"
else
nnn="where passed=0"				
end if
Response.Write "<table border=0 cellspacing=0 cellpadding=4 width='100%' align='center'><tr>" & vbCrLf
set rsb=server.createobject("adodb.recordset")
set rsb=conn.execute("SELECT top "&n&" * FROM shop "&nnn&" order by s_id desc")
i=0
do while not rsb.eof
%>
<td width=50% valign=top> 
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#E7E7E7">
  <tr> 
    <td bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="5" cellpadding="5">
        <tr> 
          <td align="center" valign="top" width="80" style="padding-right:5px"> 
            <a href="shopView.asp?s_id=<%=rsb("s_id")%>" Title='商品名称：<%=rsb("s_name")%>&#13&#10上架时间：<%=rsb("s_date")%>&#13&#10购买次数：<%=rsb("s_count")%>'><font color="#666666"><img src="<%=rsb("s_pic")%>"  width=75 border=0 align=center vspace=0 hspace=0 style='border-color:#dfdfdf'></font></a></td>
          <td valign="top"> 
            <table width="100%" border="0" cellspacing="1" cellpadding="0" height="20">
              <tr valign="top"> 
                <td height="20"><a href="shopView.asp?s_id=<%=rsb("s_id")%>"><font color="#000000"><%=gotTopic(rsb("s_name"),nn)%></font></a></td>
              </tr>
              <tr> 
                <td><font color="#666666">市场价：<%=FormatNumber(rsb("price_1"),2)%></font></td>
              </tr>
              <tr> 
                <td><font color="#006666">会员价：<%=FormatNumber(rsb("price_2"),2)%></font></td>
              </tr>
              <tr> 
                <td><font color="#FF6600">VIP 价：<%=FormatNumber(rsb("price_3"),2)%></font></td>
              </tr>
              <tr valign="bottom"> 
                <td height="20" ><a href="shopView.asp?s_id=<%=rsb("s_id")%>"><img src="img/content2.gif" border="0"></a>&nbsp;<a href="shop_Basket.asp?id=<%=rsb("s_id")%>"><img src="img/cart2.gif" border="0"></a></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
    <td width="5" bgcolor="#E7E7E7"></td>
  </tr>
</table>
</td>
<%
i=i+1
if i mod 2 = 0 then
Response.Write "</tr><tr>"
end if
rsb.movenext
loop
if rsb.bof and rsb.eof then
Response.Write "<tr><td align='center' valign='middle'>没有商品！</td></tr>"
end if
rsb.close
set rsb=nothing
Response.Write "</TABLE>" & vbCrLf
end sub
'=================================================
'过程名：top_shop
'作  用：销售排行榜
'参  数：n-调用条数,nn-显示长度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub top_shop(n,nn,NewWindows)
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
set rst=server.createobject("adodb.recordset")
set rst=conn.execute("SELECT top "&n&" * FROM shop where passed=0 ORDER by s_count DESC,s_id DESC")
do while not rst.eof
Response.Write "<tr><td height=25 class=table-xia>&nbsp;·<a href='shopView.asp?s_id="&rst("s_id")&"' Title='商品名称："&rst("s_name")&"&#13&#10上架时间："&rst("s_date")&"&#13&#10购买次数："&rst("s_count")&"' "& nnn &">"&gotTopic(rst("s_name"),nn)&"</a></td><td height=25 class=table-xia align='right'><font color=#FF6633>"&rst("price_3")&"</font>&nbsp;</td></tr>" & vbCrLf
rst.movenext
loop
if rst.bof and rst.eof then
Response.Write "<tr><td align='center' valign='middle'>当前没有商品</td></tr>"
end if
rst.close
set rst=nothing
Response.Write "</TABLE>" & vbCrLf
end sub
'=================================================
'过程名：class_shop
'作  用：产品分类——纵排
'参  数：无
'=================================================
sub class_shop()
dim i
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
sql="select * from scat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
response.write "<tr><td height=26>" & vbCrLf
if request("scat_id")=cstr(rs1("scat_id")) then
response.write "&nbsp;<font color=""#FF0000"">·<b>"&rs1("scat_name")&"</b></font>" & vbCrLf
else
response.write "&nbsp;<font color=""#FF0000"">·</font><a href='shop.asp?action=1&scat_id="&rs1("scat_id")&"'><b>"&rs1("scat_name")&"</b></a>" & vbCrLf
end if
response.write "</td><td>&nbsp;</td></tr><tr>" & vbCrLf
sql="select * from scat where sid="&rs1("scat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
i=0
do while not rs2.eof
response.write "<td width=""50%"" height=22>" & vbCrLf
if request("scat_id")=cstr(rs2("scat_id")) then
response.write "&nbsp;&nbsp;<font color=""#FF0000"">├ "&rs2("scat_name")&"</a></font>" & vbCrLf
else
response.write "&nbsp;&nbsp;<a href='shop.asp?action=1&scat_id="&rs2("scat_id")&"'>├ "&rs2("scat_name")&"</a>" & vbCrLf
end if
response.write "</td>" & vbCrLf
if i=1 then response.write "</tr><tr>" & vbCrLf
if i>1 then 
		i=1
	else
		i=i+1
	end if
rs2.movenext
loop
rs1.movenext
loop
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing
Response.Write "</TABLE>" & vbCrLf
end sub
'=================================================
'过程名：class_shop
'作  用：产品分类——横排
'参  数：无
'=================================================
sub class1_shop()
sql="select * from scat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
if request("scat_id")=cstr(rs1("scat_id")) then
response.write "<font color=""#FF0000""></font>"
else
response.write "<a href='?scat_id="&rs1("scat_id")&"'></a>"
end if
sql="select * from scat where sid="&rs1("scat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
if request("scat_id")=cstr(rs2("scat_id")) then
response.write "&nbsp;<font color=""#FF0000"">·"&rs2("scat_name")&"</a></font>"
else
response.write "&nbsp;·<a href='shop.asp?action=1&scat_id="&rs2("scat_id")&"'>"&rs2("scat_name")&"</a>"
end if
rs2.movenext
loop
rs1.movenext
loop
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing
end sub

'=================================================
'过程名：fl_shop
'作  用：首页最新产品
'参  数：num--------------调用条数
'        fontnum----------显示标题长度
'        classid----------一级分类调用id，0为全部
'        priceyes---------是否显示价格，True为是，False为否
'        cavalcadenum-----每行显示数
'        img_width--------图片宽度
'        img_height-------图片高度
'        sclass-----标识属性,0-最新,1-推荐,2-特价,3-热卖
'=================================================
sub fl_shop(num,fontnum,classid,priceyes,cavalcadenum,img_width,img_height,sclass)
dim nnn
if sclass=0 then
nnn="where passed=0"
elseif sclass=1 then
nnn="where isbest = 1 and passed=0"
elseif sclass=2 then
nnn="where istj = 1 and passed=0"
elseif sclass=3 then
nnn="where ishot = 1 and passed=0"
else
nnn="where passed=0"				
end if
Response.Write "<TABLE cellSpacing=3 cellPadding=1 border=0><TBODY><TR align=middle>" & vbCrLf
if classid=0 then
   sql="select top "&num&" * from shop "&nnn&" order by s_id DESC"
else
   sql="select top "&num&" * from shop where passed=0 and (scat_id="&classid&" or scat_id in(select scat_id from scat where sid="&classid&")) order by s_id DESC"			
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
i=0
do while not rs.eof
Response.Write "<TD>" & vbCrLf
Response.Write "<table border=0 cellspacing=0 cellpadding=0 width='138'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td width=7><img src=img/22_1.gif border=0></td>" & vbCrLf
Response.Write "<td width=""*"" background=img/22_2.gif></td>" & vbCrLf
Response.Write "<td width=7><img src=img/22_3.gif border=0></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<TR>" & vbCrLf
Response.Write "<td background=img/22_7.gif></td>" & vbCrLf
Response.Write "<td width=""*"" align=center bgcolor=#ffffff><a href='shopView.asp?s_id="&rs("s_id")&"'><b>"&gotTopic(rs("s_name"),fontnum)&"</b></a></td>" & vbCrLf
Response.Write "<td background=img/22_8.gif></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<TR>" & vbCrLf
Response.Write "<td background=img/22_7.gif></td>" & vbCrLf
Response.Write "<td width=""*"" align=center bgcolor=#ffffff>" & vbCrLf
Response.Write "<table border='0' align='center' cellpadding='2' cellspacing='1' bgcolor='#F0F0F0'>"
Response.Write "<tr><td align='center' bgcolor='#FFFFFF'><a href='shopView.asp?s_id="&rs("s_id")&"'><img border=0 src="&rs("s_pic")&" width='"&Img_Width&"' height='"&Img_height&"'></a></td>" & vbCrLf
Response.Write "</tr></table></td>" & vbCrLf
Response.Write "<td background=img/22_8.gif></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
if priceyes=True then
Response.Write "<TR>" & vbCrLf
Response.Write "<td background=img/22_7.gif></td>" & vbCrLf
Response.Write "<td width=""*"" align=center bgcolor=#ffffff><font color='#666666'>市场价:<strike>"&FormatNumber(rs("price_1"),2)&"</strike></font></td>" & vbCrLf
Response.Write "<td background=img/22_8.gif></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<TR>" & vbCrLf
Response.Write "<td background=img/22_7.gif></td>" & vbCrLf
Response.Write "<td width=""*"" align=center bgcolor=#ffffff><font color='#006666'>会员价:"&FormatNumber(rs("price_2"),2)&"</font></td>" & vbCrLf
Response.Write "<td background=img/22_8.gif></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<TR>" & vbCrLf
Response.Write "<td background=img/22_7.gif></td>" & vbCrLf
Response.Write "<td width=""*"" align=center bgcolor=#ffffff><font color='#FF6600'>VIP 价:"&FormatNumber(rs("price_3"),2)&"</font></td>" & vbCrLf
Response.Write "<td background=img/22_8.gif></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
end if
Response.Write "<TR>" & vbCrLf
Response.Write "<td background=img/22_7.gif></td>" & vbCrLf
Response.Write "<td width=""*"" align=center bgcolor=#ffffff><a href='shopView.asp?s_id="&rs("s_id")&"'><img border=0 src=img/btn_view.gif></a>&nbsp;<a href='shop_Basket.asp?id="&rs("s_id")&"' target=""CartFrame""><img border=0 src=img/btn_buy.gif></a></td>" & vbCrLf
Response.Write "<td background=img/22_8.gif></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td width=7><img src=img/22_9.gif border=0></td>" & vbCrLf
Response.Write "<td width=""*"" background=img/22_10.gif></td>" & vbCrLf
Response.Write "<td width=7><img src=img/22_11.gif border=0></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "</td>" & vbCrLf
i=i+1
if i mod cavalcadenum = 0 then
Response.Write "</tr><tr>"
end if
rs.movenext
loop
if rs.bof and rs.eof then
   Response.Write "<tr><td align=""center"" valign=""middle"">当前没有产品！</td></tr>" & vbCrLf
end if
rs.close
set rs=nothing
Response.Write "</TBODY></TABLE>" & vbCrLf
end sub





sub search_shop()
Response.Write "<div align=center><fothod='post' action='shop.asp?action=1'>商品搜索：<input type='radio' name='select' value='s_name' checked class='inuptCG'>名称&nbsp;<input type='radio' name='select' value='ss_desc' class='inuptCG'>简介&nbsp;<input type='radio' name='select' value='price_2' class='inuptCG'>价格&nbsp;&nbsp;<input type='text' name='keyword'  size='15' value='搜索关键字' maxlength='50' onfocus=""this.value=''"" class='input'>&nbsp;<input type='submit' name='search'  value='搜索' onmouseover=""this.className='boton'"" onmouseout=""this.className='botoff'""></div>" & vbCrLf
end sub
sub displayList_shop(nn,Hxperpage)
Dim CurPage,Url_Add
Url_Add="?action=1&"
If Request.QueryString("Page")<>"" Then
   Curpage=Request.QueryString("Page")
   If IsInteger(Curpage)=False Then Curpage=1
Else
   Curpage=1
End If
if request("keyword")<>"" then
  if instr(request("keyword"),"'")>0 then
    Response.Write "<script language=javascript>alert('搜索参数非法');javascript:history.back();</script>"
    Response.End
  end if
end if
dim mtyid,hx01,hx66010
mtyid=int(scat_id)
set hx01=conn.execute("select scat_id,scat_name,sid from scat order by scat_id")
do while not hx01.eof
if mtyid=hx01("sid") then
hx66010=hx66010+" or scat_id="&hx01("scat_id") '显示页所需变量shop.asp
end if
hx01.movenext
loop
hx01.close
set hx01=nothing
if scat_id>0 then
   sql="select * from shop where (scat_id="&scat_id&hx66010&") and passed=0 order by s_id DESC"
   Url_Add=Url_Add&"scat_id="&scat_id&"&"
elseif request("keyword")<>"" and (request("select")="s_name" or request("select")="ss_desc" or request("select")="price_2") then
   sql="select * from shop where "&request("select")&" like '%"&Jencode(checkspace(request("keyword")))&"%' and passed=0 order by s_id DESC"
   Url_Add=Url_Add&"select="&request("select")&"&keyword="&Server.URLEncode(request("keyword"))&"&"
elseif request("t")="best" then 
   sql="select * from shop where isbest = 1 and passed=0 order by s_id DESC"
   Url_Add=Url_Add&"t=best&"
elseif request("t")="tj" then   
   sql="select * from shop where istj=1 and passed=0 order by s_id DESC"
   Url_Add=Url_Add&"t=tj&"
elseif request("t")="hot" then  
   sql="select * from shop where ishot=1 and passed=0 order by s_id DESC"
   Url_Add=Url_Add&"t=hot&"
elseif request("t")="top" then 
   sql="select * from shop where passed=0 order by s_count DESC,s_id DESC"
   Url_Add=Url_Add&"t=top&"
else
   sql="select * from shop where passed=0 order by s_id DESC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
Response.Write "<table border=0 cellspacing=0 cellpadding=4 width='100%' align='center'><tr>" & vbCrLf
if not rs.eof then
   Dim Hx_Nums,MultiPages,i
   Rs.PageSize=Hxperpage
   Rs.AbsolutePage=CurPage
   Hx_Nums=Rs.RecordCount
   MultiPages="<tr><td colspan=""2"" height='28' align=""center"">"&MultiPage(Hx_Nums,Hxperpage,CurPage,Url_Add)&"</td></tr>"
Do Until Rs.EOF OR i=Hxperpage
%>
<td width=50% valign=top> 
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#F0F0F0">
  <tr> 
    <td bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="5" cellpadding="5">
        <tr> 
          <td align="center" valign="top" width="80" style="padding-right:5px"> 
            <a href="shopView.asp?s_id=<%=rs("s_id")%>" Title='商品名称：<%=rs("s_name")%>&#13&#10上架时间：<%=rs("s_date")%>&#13&#10购买次数：<%=rs("s_count")%>'><font color="#666666"><img src="<%=rs("s_pic")%>"  width=140 height=140 border=0 align=center vspace=0 hspace=0 style='border-color:#dfdfdf'></font></a></td>
          <td valign="top"> 
            <table width="100%" border="0" cellspacing="1" cellpadding="0" height="20">
              <tr valign="top"> 
                <td height="20" ><a href="shopView.asp?s_id=<%=rs("s_id")%>"><font color="#000000"><%=gotTopic(rs("s_name"),nn)%></font></a></td>
              </tr>
              <tr> 
                <td> <font color="#666666">市场价：<%=FormatNumber(rs("price_1"),2)%></font></td>
              </tr>
              <tr> 
                <td> <font color="#006666">会员价：<%=FormatNumber(rs("price_2"),2)%></font></td>
              </tr>
              <tr> 
                <td> <font color="#FF6600">VIP 价：<%=FormatNumber(rs("price_3"),2)%></font></td>
              </tr>
              <tr valign="bottom"> 
                <td height="20"><a href="shopView.asp?s_id=<%=rs("s_id")%>"><img src="img/content2.gif" border="0"></a>&nbsp;<a href="shop_Basket.asp?id=<%=rs("s_id")%>"><img src="img/cart2.gif" border="0"></a></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</td>
<%
i=i+1
if i mod 2 = 0 then
Response.Write "</tr>"
end if
rs.movenext
loop
else
if rs.eof and rs.bof then
Response.Write "<tr align='center'>" & vbCrLf
Response.Write "<td align=middle height='60'>"
if request("scat_id")<> "" then
Response.Write "该分类暂时没有商品"
elseif request("keyword")<>"" then
Response.Write "没有找到包含[<b><font color=red>"&request("keyword")&"</font></b>]的商品！"
else
Response.Write "没有任何商品！"
end if
Response.Write "</td></tr>" & vbCrLf
end if
end if
Response.Write(MultiPages)
Response.Write "</TABLE>" & vbCrLf
rs.close
set rs=nothing
end sub
sub content_shop()
if request.querystring("s_id")="" then
 Response.Write "<script language=javascript>alert('请指定操作的对象！');javascript:history.back();</script>"
 Response.End
end if
Response.Write "<table width='100%' border='0' cellspacing='5' cellpadding='3' align='center'>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td align='center' valign='top' width='35%'><a id='pichref' href='pic_view.asp?url="&rs("s_pic")&"' target='_blank'><img src='"&rs("s_pic")&"' id='mainpic' alt='点击新窗口查看商品图片&#13&#10上架时间："&rs("s_date")&"&#13&#10购买次数："& rs("s_count") &"' width='180' height='180' style=""border: 1px solid #CCCCCC;""></a></TD>"
Response.Write "<td width='65%' valign='top' style=""padding-top:3px;"">"
Response.Write "<table width='100%' border='0' cellspacing='1' cellpadding='2' bgcolor='#E7E7E7'>" & vbCrLf
Response.Write "<tr valign='top' bgcolor='#FFFFFF'><td width='95' align='right' bgcolor='#F0F0F0'>商品名称：</td>"
Response.Write "<td style=""padding-left:10px;"">"& rs("s_name") &"</td></tr>" & vbCrLf
if rs("s_user")<>"" then
Response.Write "<tr valign='top' bgcolor='#FFFFFF'><td width='95' align='right' bgcolor='#F0F0F0'>厂商品牌：</td>"
Response.Write "<td style=""padding-left:10px;"">"& rs("s_user") &"</td></tr>" & vbCrLf
end if
if rs("stock")<>"" then
Response.Write "<tr valign='top' bgcolor='#FFFFFF'><td width='95' align='right' bgcolor='#F0F0F0'>供货数量：</td>"
Response.Write "<td style=""padding-left:10px;"">"& rs("stock") &"</td></tr>" & vbCrLf
end if
if rs("d_unit")<>"" then
Response.Write "<tr valign='top' bgcolor='#FFFFFF'><td width='95' align='right' bgcolor='#F0F0F0'>计量单位：</td>"
Response.Write "<td style=""padding-left:10px;"">"& rs("d_unit") &"</td></tr>" & vbCrLf
end if
Response.Write "<tr valign='top' bgcolor='#FFFFFF'><td width='95' align='right' bgcolor='#F0F0F0'>市场价格：</td>"
Response.Write "<td style=""padding-left:10px;""><font color='#666666'>"&FormatNumber(rs("price_1"),2)&" 元</font></td></tr>" & vbCrLf
Response.Write "<tr valign='top' bgcolor='#FFFFFF'><td width='95' align='right' bgcolor='#F0F0F0'>会员价格：</td>"
Response.Write "<td style=""padding-left:10px;""><font color='#006666'>"&FormatNumber(rs("price_2"),2)&" 元</font></td></tr>" & vbCrLf
Response.Write "<tr valign='top' bgcolor='#FFFFFF'><td width='95' align='right' bgcolor='#F0F0F0'>VIP 价格：</td>"
Response.Write "<td style=""padding-left:10px;""><font color='#FF3300'>"&FormatNumber(rs("price_3"),2)&" 元</font></td></tr>" & vbCrLf
if rs("hg")="1" then
Response.Write "<tr valign='top' bgcolor='#FFFFFF'><td width='95' align='right' bgcolor='#F0F0F0'>积分换购：</td>"
Response.Write "<td style=""padding-left:10px;""><font color='#FF3300'>"&rs("price_5")&" "&moneyname&"</font></td></tr>" & vbCrLf
end if
Response.Write "</table>" & vbCrLf
Response.Write "</td></tr></table>" & vbCrLf
Response.Write "<table width='100%' border='0' cellspacing='5' cellpadding='2' align='center'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td width='35%' align='center'><a href='shop_Basket.asp?id="& rs("s_id") &"'><img src='img/cart.gif' border=0></a></td>"
Response.Write "<td align='center'>商品星级：<font color='red'>"& rs("commend") &"</font><td><td align='right'>商品添加："&rs("tjuser")&"&nbsp;&nbsp;</td></tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "<table width='97%' border='0' align='center' cellspacing='1' cellpadding='6' style=""border-collapse: collapse;word-break:break-all;table-layout:fixed;text-align:left"" bgcolor='#F0F0F0'>" & vbCrLf
Response.Write "<tr bgcolor='#FFFFFF'><td>"
if rs("ss_desc")<>"" then
Response.Write "<DIV style=""padding-left:10px;padding-top:10px;""><font color=#006666><B>≡ 简单介绍 ≡</B></font></DIV>" & vbCrLf
Response.Write "<DIV style=""padding-left:10px;padding-top:10px;"">"&formatStr(autourl(rs("ss_desc")))&"</DIV>" & vbCrLf
end if
Response.Write "<DIV style=""padding-left:10px;padding-top:10px;""><font color=#FF6600><B>≡ 商品介绍 ≡</B></font></DIV>" & vbCrLf
Response.Write "<DIV style=""padding-left:8px;""><IMG height=2 src='img/sub_chu_sun.gif' width='100%'></DIV>" & vbCrLf
Response.Write "<DIV vAlign=top style=""padding-left:10px;padding-top:10px;padding-bottom:20px;"">"&rs("s_desc")&"</DIV>" & vbCrLf
Response.Write "</td></tr></table>" & vbCrLf
rs.close
set rs=nothing
end sub
sub trolly_shop()
Response.Write "<table width='98%' border='0' cellspacing='0' cellpadding='0' align='center'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='36' style=""padding-left:10px;padding-top:3px""><img src='IMG/icon_gwc.gif' border='0'></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "<table width='98%' border='1' cellspacing='0' cellpadding='0' align='center' style=""border-collapse: collapse"" bordercolor='#f0f0f0'>" & vbCrLf
Response.Write "<tr align='center'>" & vbCrLf
Response.Write "<td width='7%' height='25'>操作</td><td width='*'>商品名称</td><td width='12%'>单价(元)</td><td width='10%'>赠积分</td><td width='10%'>数量</td><td width='18%'>合计(元)</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='2' colspan='6'></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
sql="select * from shop_basket where user_id='"&Hx66_name&"' and basket_check=false"
set rsw=server.createobject("adodb.recordset")
rsw.open sql, conn, 1, 1
if rsw.eof then
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='25' colspan='6' align='center'>你还没有选购任何商品</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
else
do while not rsw.eof
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='25' align='center'><a href='shop_clearbasket.asp?basket_id="&rsw("basket_id")&"'>清除</a></td>" & vbCrLf
Response.Write "<td>&nbsp;"&rsw("product_name")&"</td>" & vbCrLf
Response.Write "<td align='center'>"&rsw("price")&"</td>" & vbCrLf
Response.Write "<td align='center'>"&rsw("jifen")&"</td>" & vbCrLf
Response.Write "<td align='center'>"&rsw("basket_count")&"</td>" & vbCrLf
Response.Write "<td align='center'>"&rsw("basket_count")*rsw("price")&"</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
totalcash=totalcash+(rsw("basket_count")*rsw("price"))
totaljf=totaljf+(rsw("basket_count")*rsw("jifen"))
cartnum=cartnum+(rsw("basket_count")*1)
rsw.movenext
loop
end if
rsw.close
set rsw=nothing
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='25' colspan='3' align='center'>总计："
Response.Write "<td align='center'><font color=red>"&totaljf&"</font></td>"
Response.Write "<td align='center'><font color=red>"&cartnum&"</font></td>"
Response.Write "<td align='center'><font color=red>"&totalcash&"</font></td>"
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "<table width='100%' border='0' cellspacing='0' cellpadding='6' align='center'>" & vbCrLf
Response.Write "<tr align='center'>" & vbCrLf
Response.Write "<td width='33%'><a href='shop_clearbasket.asp'><img src='img/relbcar.gif' border='0'></a></td>" & vbCrLf
Response.Write "<td width='33%'><a href='shop_cash.asp'><img src='img/gobuy.gif' border='0'></a></td>" & vbCrLf
Response.Write "<td width='33%'><input type='button' name='Submit2' value='继续购物' onClick=""location.href='shop.asp'""></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table><BR>" & vbCrLf
end sub

'=================================================
'过程名：my_shop
'作  用：显示购物信息
'参  数：无
'=================================================
sub my_shop()
dim my_count,totalcash
if UserLogined<>True then
Response.Write "<table cellspacing=0 width='100%' cellpadding=4 height=80><tr><td  align=center>购物车内有<font color='#FF3300'><b><font color=#FF6633>0</font></b></font>个商品<br><br>总计：<font color='#FF6600'><b>0.00</b></font> 元<br><br><a href='shop_mybasket.asp'>购物车&gt;&gt;&gt;</a>&nbsp;&nbsp;<a href='shop_myuser.asp?action=dingdan'>我的订单&gt;&gt;&gt;</a></td></tr></table>"
else
sql="select * from shop_basket where user_id='"&Hx66_name&"' and basket_check=false"
set rsw=server.createobject("adodb.recordset")
rsw.open sql, conn, 1, 1
my_count=rsw.recordcount
if rsw.eof then
my_count=0
totalcash="0.00"
else
do while not rsw.eof
totalcash=totalcash+(rsw("basket_count")*rsw("price"))
rsw.movenext
loop
end if
rsw.close
set rsw=nothing
Response.Write "<table cellspacing=0 width='100%' cellpadding=4 height=80><tr><td  align=center>购物车内<font color='#FF3300'><b><font color=#FF6633>"&my_count&"</font></b></font>个商品<br><br>总计：<font color='#FF6600'><b>"&totalcash&"</b></font> 元<br><br><a href='shop_mybasket.asp'>购物车&gt;&gt;&gt;</a>&nbsp;&nbsp;<a href='shop_myuser.asp?action=dingdan'>我的订单&gt;&gt;&gt;</a></td></tr></table>"
end if
end sub
sub decideon_shop()
dim price,dj
if request.querystring("id")="" then
   response.redirect "shop_Mybasket.asp"
else
 if not isInteger(request.querystring("id")) then
 Response.Write "<script language=javascript>alert('参数非法');javascript:history.back();</script>"
 Response.End
 end if
end if
sql="select * from shop where passed=0 and s_id="&int(trim(request("id")))
set rs=server.createobject("adodb.recordset")
rs.open sql, conn, 3, 3
IF rs.eof Then
  Response.Redirect "show_error.asp?eid=参数错误，找不到相关的记录!"
  Response.End
End IF
if Hx66_Grade="1" then
   price=Rs("price_3")
   dj="VIP 价："
elseif Hx66_Grade="0" then
   price=Rs("price_2")
   dj="会员价："
else
   price=Rs("price_1")
   dj="市场价："
end if
Response.Write "<table width='98%' border='1' cellspacing='0' cellpadding='0' align='center' style=""border-collapse: collapse"" bordercolor='#f0f0f0'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='27' align='center' colspan='5'>本次所选购的商品信息，请按确认加入你的购物车</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<form method='POST' action='shop_buy.asp?action=buy&id="&rs("s_id")&"&product_name="&rs("s_name")&"&price="& price &"'>" & vbCrLf
Response.Write "<tr align='center'>" & vbCrLf
Response.Write "<td width='*' height='25'>商品名称</td>" & vbCrLf
Response.Write "<td width='120'>商品单价(元)</td>" & vbCrLf
Response.Write "<td width='60'>赠送积分</td>" & vbCrLf
Response.Write "<td width='60'>订购数量</td>" & vbCrLf
Response.Write "<td width='80'>加入购物车</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr align='center'>" & vbCrLf
Response.Write "<td height=30><font color='#FF0000'>"&rs("s_name")&"</font></td>" & vbCrLf
Response.Write "<td>"& dj&price &"</td>" & vbCrLf
Response.Write "<td>"&Rs("price_4")&"</td>" & vbCrLf
Response.Write "<td><input type='text' name='count' size='5' value='1' 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'))""></td>" & vbCrLf
Response.Write "<td><input name=B1 type=image id='B1' src='img/ok.gif' alt='确认购买' align=absMiddle width='45' height='20' cache tppabs=''>" & vbCrLf
Response.Write "</td>" & vbCrLf
Response.Write "</tr></form>" & vbCrLf
Response.Write "</table><BR>" & vbCrLf
rs.close
set rs=nothing
end sub
sub cash_shop()
%>
<script language="JavaScript">
function Checksave()
{ 
        if(document.form1.to_name.value.length == 0)
        {
                alert("收货人姓名不能为空。");
                document.form1.to_name.focus();
                return false;
        }
        else if(document.form1.tel.value.length == 0)
        {
                alert("联系电话不能为空。");
                document.form1.tel.focus();
                return false;
        }
        else if(document.form1.to_adds.value.length == 0)
        {
                alert("收货人地址不能为空。");
                document.form1.to_adds.focus();
                return false;
        }
	if (document.form1.email.value.length > 0 && !document.form1.email.value.match( /^.+@.+$/ ) ) {
	    alert("EMAIL输入错误！请重新输入");
	    document.form1.email.focus();
		return false;
	}
	else if (document.form1.postcode.value.length !=6) 
               {
		alert("请输入正确的邮政编码，长度为6位数字。");
		document.form1.postcode.focus();
		return false;
	}

        return true;
}

function CheckForm()
{
	if (document.ssproduct.product_name.value.length == "") 
{
		alert("请输入商品名.");
		document.ssproduct.product_name.focus();
		return false;
	}
	return true;
}

function regInput(obj, reg, inputStr)
{ 
        var docSel	= document.selection.createRange()
        if(docSel.parentElement().tagName != "INPUT")return false
                oSel = docSel.duplicate()
        oSel.text = ""
        var srcRange	= obj.createTextRange()
        oSel.setEndPoint("StartToStart", srcRange)
        var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
        return reg.test(str)
}
function checkspace(checkstr)
{
        var str = '';
        for(i = 0; i < checkstr.length; i++)
        {
                str = str + ' ';
        }
        return(str == checkstr);
}
//-->
</script>
<%
if UserLogined<>True then
        response.write"<SCRIPT language=JavaScript>alert('对不起，您不是我们的会员或还没有登陆，请注册或登陆！');"
        response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
Response.Write "<form action='shop_cashsave.asp?a=view' method='POST' name='form1' onSubmit=""return Checksave();"">" & vbCrLf
Response.Write "<BR><table width='98%' border='1' cellspacing='0' cellpadding='0' align='center' style='border-collapse: collapse' bordercolor='#f0f0f0'>" & vbCrLf
Response.Write "<tr align='center'><td width='*' height='25'>商品名称</td><td width='12%'>单价(元)</td><td width='12%'>积分单价</td><td width='6%'>换购</td><td width='8%'>赠积分</td><td width='8%'>数量</td><td width='16%'>合计(元)</td></tr>" & vbCrLf
set rsd=server.createobject("adodb.recordset")
sql="select * from shop_basket where user_id='"&Hx66_name&"' and basket_check=false"
rsd.open sql, conn, 1, 1
if rsd.eof then
       response.write"<SCRIPT language=JavaScript>alert('你没有订购任何商品！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
else
icount=0
do while not rsd.eof
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='25'>&nbsp;<font color=green>"&rsd("product_name")&"</font></td>" & vbCrLf
Response.Write "<td align='center'>"&rsd("price")&"</td>" & vbCrLf
if rsd("hgjifen")>0 then
Response.Write "<td align='center'>"&rsd("hgjifen")&"</td>" & vbCrLf
Response.Write "<td align='center'><input type=checkbox name='wb_"&icount&"' value='"&rsd("basket_count")&"$$"&rsd("basket_count")*rsd("hgjifen")&"$$"&rsd("basket_count")*rsd("price")&"$$"&rsd("basket_id")&"'></td>" & vbCrLf
icount=icount+1
else
Response.Write "<td align='center'>——</td>" & vbCrLf
Response.Write "<td align='center'><input type=checkbox disabled></td>" & vbCrLf
end if
Response.Write "<td align='center'>"&rsd("jifen")&"</td>" & vbCrLf
Response.Write "<td align='center'>"&rsd("basket_count")&"</td>" & vbCrLf
Response.Write "<td align='center'>"&rsd("price")*rsd("basket_count")&"</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
totalcash=totalcash+(rsd("price")*rsd("basket_count"))
totaljf=totaljf+(rsd("jifen")*rsd("basket_count"))
cartnum=cartnum+(rsd("basket_count")*1)
rsd.movenext
loop
response.write "<input type=hidden name='hg_n' value='"&icount&"'>"
end if
rsd.close
set rsd=nothing
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='25' align='center' colspan='7'><b>货款总计：<font color=red>"&totalcash&"</font>元</b>" 
Response.Write "&nbsp;&nbsp;赠积分:"&totaljf&"<input type=hidden name=totalcash value='"&totalcash&"'><input type=hidden name=totaljf value='"&totaljf&"'></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "<table width='95%' border='0' cellspacing='5' cellpadding='0' align='center'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td><font color='#FF0000'><li>此定单如果有选择积分换购，商品换购时将不计算配送费用</LI><li>请务必认真填写以下每一项信息，我们将以此给您发货</li><li>否则由此而造成的损失我们概不负责。谢谢你的支持！</LI></font></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "<table width='98%' border='1' cellspacing='0' cellpadding='0' align='center' style='border-collapse: collapse' bordercolor='#f0f0f0'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='25' colspan='2' align='center'>请填写收货人的详细信息</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td width='20%' height='28' align='right'>真实姓名：</td>" & vbCrLf
Response.Write "<td width='80%'>　<input style=""FONT-SIZE: 12px; WIDTH: 180px"" type='text' name='to_name' class=input value='"& Hx66_name &"'>&nbsp;* 必须填写,将是收货人姓名</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='28' align='right'>联系电话：</td>" & vbCrLf
Response.Write "<td>　<input style=""FONT-SIZE: 12px; WIDTH: 180px"" type='text' name='tel' class=input value=''>&nbsp;* 请如实填写,便于我们与您联系</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='28' align='right'>E-mail：</td>" & vbCrLf
Response.Write "<td>　<input style=""FONT-SIZE: 12px; WIDTH: 180px"" type='text' name='email' class=input value='"& Hx66_Email &"'>&nbsp;* 请如实填写,便于我们与您联系</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='28' align='right'>邮政编码：</td>" & vbCrLf
Response.Write "<td>　<input style=""FONT-SIZE: 12px; WIDTH: 180px"" type='text' name='postcode' class=input value='' maxlength='6'>&nbsp;* 将是送货邮政编码</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='28' align='right'>收货地址：</td>" & vbCrLf
Response.Write "<td>　<input style=""FONT-SIZE: 12px; WIDTH: 280px"" type='text' name='to_adds' class=input value=''>&nbsp;* 将是送货地址</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='28' align='right'>发票需求：</td>" & vbCrLf
Response.Write "<td>　<input type='checkbox' name='fapiao' value='1'>&nbsp;(将按总价的5%计算税率，换购商品不提供发票)</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='30' align='right'>留言备注：<br>(50汉字内)</td>" & vbCrLf
Response.Write "<td> 　<textarea style=""FONT-SIZE: 12px; WIDTH: 280px"" name='other' cols='30' class='input' rows='3'></textarea>&nbsp;* 您的特殊需求</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table><BR>" & vbCrLf
Response.Write "<table width='98%' border='1' cellspacing='5' cellpadding='0' align='center' style='border-collapse: collapse' bordercolor='#f0f0f0'>" & vbCrLf
sql="select * from shop_pay"
set rrs=server.createobject("adodb.recordset")
rrs.open sql,conn,1,1
payment1=rrs("payment1")
pay1=rrs("pay1")
payment2=rrs("payment2")
pay2=rrs("pay2")
payment3=rrs("payment3")
pay3=rrs("pay3")
payment4=rrs("payment4")
pay4=rrs("pay4")
payment5=rrs("payment5")
pay5=rrs("pay5")
rrs.close
set rrs=nothing
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='25' colspan='2' align='center'>请选择支付方式</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
if payment1<>"" then Response.Write "<tr><td height='28' colspan='2'><input name='paymenttype' type='radio' value='"&payment1&"' checked>"&payment1&"<BR>"&formatStr(autourl(pay1))&"</td></tr>" & vbCrLf
if payment2<>"" then Response.Write "<tr><td height='28' colspan='2'><input name='paymenttype' type='radio' value='"&payment2&"'>"&payment2&"<BR>"&formatStr(autourl(pay2))&"</td></tr>" & vbCrLf
if payment3<>"" then Response.Write "<tr><td height='28' colspan='2'><input name='paymenttype' type='radio' value='"&payment3&"'>"&payment3&"<BR>"&formatStr(autourl(pay3))&"</td></tr>" & vbCrLf
if payment4<>"" then Response.Write "<tr><td height='28' colspan='2'><input name='paymenttype' type='radio' value='"&payment4&"'>"&payment4&"<BR>"&formatStr(autourl(pay4))&"</td></tr>" & vbCrLf
if payment5<>"" then Response.Write "<tr><td height='28' colspan='2'><input name='paymenttype' type='radio' value='" &payment5&"'>"&payment5&"<BR>"&formatStr(autourl(pay5))&"</td></tr>" & vbCrLf
Response.Write "</table><BR>" & vbCrLf
Response.Write "<table width='98%' border='1' cellspacing='5' cellpadding='0' align='center' style='border-collapse: collapse' bordercolor='#f0f0f0'>" & vbCrLf
sql="select * from shop_ps"
set rrs=server.createobject("adodb.recordset")
rrs.open sql,conn,1,1
peisong1=rrs("peisong1")
fei1=rrs("fei1")
peisong2=rrs("peisong2")
fei2=rrs("fei2")
peisong3=rrs("peisong3")
fei3=rrs("fei3")
peisong4=rrs("peisong4")
fei4=rrs("fei4")
peisong5=rrs("peisong5")
fei5=rrs("fei5")
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='25' align='center'>请选择配送方式</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<INPUT TYPE='hidden' name='cartnum' value='"&cartnum&"'>"
Response.Write "<tr><td>"
if peisong1<>"" then Response.Write "<input name='sendtype1' type='radio' value='1' checked>"&peisong1&"<div>&nbsp;<font color=red>·</font>配送费用："&fei1&"元</div>" & vbCrLf
if peisong1<>"" and rrs("tackfei1")=1 then Response.Write "<div>&nbsp;<font color=red>·</font>购买数量大于 "&rrs("qdsum1")&" 时，超出部分的配送附加费单价："&rrs("onefei1")&"元</div>" & vbCrLf
if peisong2<>"" then Response.Write "<input name='sendtype1' type='radio' value='2'>"&peisong2&"<div>&nbsp;<font color=red>·</font>配送费用："&fei2&"元</div>" & vbCrLf
if peisong2<>"" and rrs("tackfei2")=1 then Response.Write "<div>&nbsp;<font color=red>·</font>购买数量大于 "&rrs("qdsum2")&" 时，超出部分的配送附加费单价："&rrs("onefei2")&"元</div>" & vbCrLf
if peisong3<>"" then Response.Write "<input name='sendtype1' type='radio' value='3'>"&peisong3&"<div>&nbsp;<font color=red>·</font>配送费用："&fei3&"元</div>" & vbCrLf
if peisong3<>"" and rrs("tackfei3")=1 then Response.Write "<div>&nbsp;<font color=red>·</font>购买数量大于 "&rrs("qdsum3")&" 时，超出部分的配送附加费单价："&rrs("onefei3")&"元</div>" & vbCrLf
if peisong4<>"" then Response.Write "<input name='sendtype1' type='radio' value='4'>"&peisong4&"<div>&nbsp;<font color=red>·</font>配送费用："&fei4&"元</div>" & vbCrLf
if peisong4<>"" and rrs("tackfei4")=1 then Response.Write "<div>&nbsp;<font color=red>·</font>购买数量大于 "&rrs("qdsum4")&" 时，超出部分的配送附加费单价："&rrs("onefei4")&"元</div>" & vbCrLf
if peisong5<>"" then Response.Write "<input name='sendtype1' type='radio' value='5'>"&peisong5&"<div>&nbsp;<font color=red>·</font>配送费用："&fei5&"元</div>" & vbCrLf
if peisong5<>"" and rrs("tackfei5")=1 then Response.Write "<div>&nbsp;<font color=red>·</font>购买数量大于 "&rrs("qdsum5")&" 时，超出部分的配送附加费单价："&rrs("onefei5")&"元</div>" & vbCrLf
Response.Write "</td></tr>"
Response.Write "<tr><td height='28'>&nbsp;* 如选择QQ传送，请在备注里留下你的QQ号</td></tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height='35'><div align='center'><input type=""submit"" name=""form22"" value='购物确认' class='submit'></div></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
rrs.close
set rrs=nothing
end sub
sub cashsave_shop()
if UserLogined<>True then
   response.redirect "index.asp"
   response.end
end if
if request("a")="view" then
to_name=request.form("to_name")
to_adds=request.form("to_adds")
email=request.form("email")
tel=request.form("tel")
sendtype1=request.form("sendtype1")
postcode=request.form("postcode")
paymenttype=request.form("paymenttype")
totalcash=request.form("totalcash")
totaljf=request.form("totaljf")
other=request.form("other")
cartnum=request.form("cartnum")
fapiao=clng(request.form("fapiao"))
dim hg_num,wb_num,price_num,hg_id
hg_num=0
wb_num=0
price_num=0
hg_id=0
for icount=0 to clng(request.form("hg_n"))-1
    if not request.form("wb_"&icount)="" then
       hg_num=wb_num+clng(split(Request.Form("wb_"&icount),"$$")(0))
       wb_num=wb_num+clng(split(Request.Form("wb_"&icount),"$$")(1))
       price_num=price_num+split(Request.Form("wb_"&icount&""),"$$")(2)
       hg_id=hg_id&split(Request.Form("wb_"&icount&""),"$$")(3)&","
    end if
next
hg_num=hg_num
wb_num=wb_num
price_num=price_num
hg_id=left(hg_id,len(hg_id)-1)
sql="select * from shop_ps"
set rrrs=server.createobject("adodb.recordset")
rrrs.open sql,conn,1,1
   peisong1=rrrs("peisong1")
   peisong2=rrrs("peisong2")
   peisong3=rrrs("peisong3")
   peisong4=rrrs("peisong4")
   peisong5=rrrs("peisong5")
   fei1=rrrs("fei1")
   fei2=rrrs("fei2")
   fei3=rrrs("fei3")
   fei4=rrrs("fei4")
   fei5=rrrs("fei5")
if sendtype1=1 and rrrs("tackfei1")=1 and cartnum-rrrs("qdsum1")-hg_num>0 then
   fei=fei1+(rrrs("onefei1")*(cartnum-rrrs("qdsum1")-pay_num))
   sendtype=peisong1
elseif sendtype1=1 then 
   fei=fei1
   sendtype=peisong1
end if
if sendtype1=2 and rrrs("tackfei2")=1 and cartnum-rrrs("qdsum2")-hg_num>0 then
   fei=fei2+(rrrs("onefei2")*(cartnum-rrrs("qdsum2")-pay_num))
   sendtype=peisong2
elseif sendtype1=2 then 
   fei=fei2
   sendtype=peisong2
end if
if sendtype1=3 and rrrs("tackfei3")=1 and cartnum-rrrs("qdsum3")-hg_num>0 then
   fei=fei3+(rrrs("onefei3")*(cartnum-rrrs("qdsum3")-pay_num))
   sendtype=peisong3
elseif sendtype1=3 then 
   fei=fei3
   sendtype=peisong3
end if
if sendtype1=4 and rrrs("tackfei4")=1 and cartnum-rrrs("qdsum4")-hg_num>0 then
   fei=fei4+(rrrs("onefei4")*(cartnum-rrrs("qdsum4")-pay_num))
   sendtype=peisong4
elseif sendtype1=4 then
   fei=fei4
   sendtype=peisong4
end if
if sendtype1=5 and rrrs("tackfei5")=1 and cartnum-rrrs("qdsum5")-hg_num>0 then
   fei=fei5+(rrrs("onefei5")*(cartnum-rrrs("qdsum5")-pay_num))
   sendtype=peisong5
elseif sendtype1=5 then 
   fei=fei5
   sendtype=peisong5
end if
rrrs.close
set rrrs=nothing
if cartnum-hg_num=0 then fei=0
     summoney=totalcash+fei-price_num
        if fapiao=1 then summoney=summoney*1.1
     summoney=FormatNumber(summoney,2)   
     session("summoney")=summoney
Response.Write "<BR><table width='98%' border='0' cellspacing='0' cellpadding='0' align='center'>"
Response.Write "<form name='save' action='shop_cashsave.asp?a=save' method=post>"
Response.Write "<tr>" 
Response.Write "<td height=30 align='center'><LI>"& Hx66_name &" 请确认您所填写的内容！请检查后单击“马上提交订单”或“返回修改订单”</LI></td>"
Response.Write "<input type=hidden value='ok' name='save'>"
Response.Write "</tr>"
Response.Write "</table>"
Response.Write "<table width='98%' border='1' cellspacing='0' cellpadding='0' align='center' style=""border-collapse: collapse"" bordercolor='#f0f0f0'>"
Response.Write "<tr>"
Response.Write "<td width='18%' height='28' align='center'>收货人 ：</td>"
Response.Write "<td width='32%'>&nbsp;"&to_name&" </td>"
Response.Write "<td width='18%' align='center'>E-mail：</td>"
Response.Write "<td width='32%'>&nbsp;"&email&"</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td height='28' align='center'>邮政编码：</td>"
Response.Write "<td>&nbsp;"&postcode&"</td>"
Response.Write "<td align='center'>联系电话：</td>"
Response.Write "<td>&nbsp;"&tel&"</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td align='center'>付款方式：</td>"
Response.Write "<td height='28'>&nbsp;"&paymenttype&"</td>"
Response.Write "<td align='center'>配送方式：</td>"
Response.Write "<td>&nbsp;"&sendtype&"</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td height='28' align='center'>收货地址：</td>"
Response.Write "<td colspan='3'>&nbsp;"&to_adds&"</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td align='center'>留言备注：</td>"
Response.Write "<td height='28' colspan='3'>&nbsp;"&other&"</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td height='28' align='center' colspan='4'><font color='#FF3333'>商品总价："&totalcash&" 元 &nbsp;&nbsp;配送费用："&fei&" 元&nbsp;&nbsp;&nbsp;&nbsp;总计：￥"&summoney&" 元&nbsp;，&nbsp;积分换购 "&wb_num&"（"&price_num&" 元）</td>"
Response.Write "</tr>"
Response.Write "</table>"
Response.Write "<table width='98%' border='0' cellspacing='5' cellpadding='0' align='center'>"
Response.Write "<tr>" 
Response.Write "<td height=35 align='center'>"
Response.Write "<INPUT TYPE='hidden' name='to_name' value='"&to_name&"'>"
Response.Write "<INPUT TYPE='hidden' name='email' value='"&email&"'>"
Response.Write "<INPUT TYPE='hidden' name='postcode' value='"&postcode&"'>"
Response.Write "<INPUT TYPE='hidden' name='to_adds' value='"&to_adds&"'>"
Response.Write "<INPUT TYPE='hidden' name='sendtype' value='"&sendtype&"'>"
Response.Write "<INPUT TYPE='hidden' name='tel' value='"&tel&"'>"
Response.Write "<INPUT TYPE='hidden' name='totalcash' value='"&totalcash&"'>"
Response.Write "<INPUT TYPE='hidden' name='totaljf' value='"&totaljf&"'>"
Response.Write "<INPUT TYPE='hidden' name='fei' value='"&fei&"'>"
Response.Write "<INPUT TYPE='hidden' name='other' value='"&other&"'>"
Response.Write "<INPUT TYPE='hidden' name='paymenttype' value='"&paymenttype&"'>"
Response.Write "<INPUT TYPE='hidden' name='summoney' value='"&summoney&"'>"
Response.Write "<INPUT TYPE='hidden' name='wb_num' value='"&wb_num&"'>"
Response.Write "<INPUT TYPE='hidden' name='hg_id' value='"&hg_id&"'>"
Response.Write "<INPUT TYPE='hidden' name='fapiao' value='"&fapiao&"'>"
Response.Write "<INPUT TYPE='hidden' name='hxcms76' value='SN00001m'>"
Response.Write "<input type='submit' name='Submit' value='马上提交订单'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='button' name='Submit21' onclick=""javascript:history.go(-1)"" value='返回修改订单'></td>"
Response.Write "</tr>"
Response.Write "</table><BR>"
elseif request("a")="save" and request("save")="ok" then
set rs=server.createobject("adodb.recordset")
wb_num=clng(Request.Form("wb_num"))
hg_id=trim(Request.Form("hg_id"))
yy=year(date)
mm=right("00"&month(date),2)
dd=right("00"&day(date),2)
ymd=yy&mm&dd
hh=right("00"&hour(time),2)
nn=right("00"&minute(time),2)
ss=right("00"&second(time),2)
hns=hh&nn&ss
order_number=ymd&hns 
if wb_num>0 then                
   if Hx66_points-wb_num<0 then 
           Response.Write "<script language=javascript>alert('你的实时积分不足购买本次商品');javascript:history.back();</script>"
           Response.End
   else                         
           conn.Execute=("UPDATE [user] SET points=points-"&wb_num&" where username='"&Hx66_name&"'")
           conn.Execute=("UPDATE shop_basket SET auct=true where basket_id in("&hg_id&")")
   end if
end if
user_id=Hx66_name
session("dingdan")=order_number 'session,Hx66. com.cn 6/30
sql="select id,basket_count,basket_check,order_number from shop_basket where user_id='"&user_id&"' and basket_check=false"
rs.open sql, conn, 3, 3
if rs.eof then
      response.write " 你没有订购任何商品 "
      response.end
else
      on error resume next
      do while not rs.eof
         rs("basket_check")=true
         rs("order_number")=order_number
         conn.Execute=("UPDATE shop SET s_count=s_count+"&rs("basket_count")&" where passed=0 and s_id="&int(rs("id"))&"")
      rs.movenext
      loop
      rs.update
end if
rs.close
sql="select * from shop_orders"
rs.open sql, conn, 3, 3
   rs.addnew
   rs("order_time")=now()
   rs("user_id")=user_id
   rs("order_number")=order_number
rs.update
rs.close
to_name=Server.HTMLEncode(Request.Form("to_name"))
to_adds=Server.HTMLEncode(Request.Form("to_adds"))
email=Server.HTMLEncode(Request.Form("email"))
tel=Server.HTMLEncode(Request.Form("tel"))
sendtype=Server.HTMLEncode(Request.Form("sendtype"))
postcode=Server.HTMLEncode(Request.Form("postcode"))
paymenttype=Server.HTMLEncode(Request.Form("paymenttype"))
other=Server.HTMLEncode(Request.Form("other"))
if other="" then other="没有留言"
fei=Request.Form("fei")
totalcash=Request.Form("totalcash")
summoney=Server.HTMLEncode(Request.Form("summoney"))
totaljf=Request.Form("totaljf")
fapiao=clng(Request.Form("fapiao"))
sql="select * from shop_orders where order_number='"&order_number&"'"
rs.open sql, conn, 3, 3
rs("to_name")=to_name
rs("tel")=tel
rs("sendtype")=sendtype
rs("postcode")=postcode
rs("email")=email
rs("to_adds")=to_adds
rs("paymenttype")=paymenttype
rs("other")=other
rs("fei")=clng(fei)
rs("summoney")=summoney
rs("totalcash")=clng(totalcash)
rs("jifen")=clng(totaljf)
if wb_num>0 then 
   rs("hg")=True
   rs("hgjifen")=wb_num
end if
   rs("fapiao")=fapiao
rs.update
rs.close
set rs=nothing
Response.Write "<BR>"
Response.Write "<table width='98%' border='1' cellspacing='0' cellpadding='0' align='center' style=""border-collapse: collapse"" bordercolor='#f0f0f0'>"
Response.Write "<tr>"
Response.Write "<td colspan='4' height='40' style=""padding-left:10px;""><LI>"&user_id&"，恭喜您完成购物的全过程；</LI><LI>请及时依照您选择的支付方式在七日内汇款；</LI><LI>确认您的货款后，我们将按您的运送方式向您发货或与您联系；</LI><LI>您可以在个人 [<b><font color='#FF6600'>订单查看</font></b>] 中查看到您的订单，并且您的 <font color='#996600'>购物车</font> 已被清空。</LI></td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td height='28' align='right' width='18%'>订单号：</td>"
Response.Write "<td colspan='3' style=""padding-left:10px;""><b>"&order_number&"</b></td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td height='28' align='right'>收货人：</td>"
Response.Write "<td width='32%' style=""padding-left:10px;"">"&to_name&" </td>"
Response.Write "<td width='18%' align='right'>E-mail：</td>"
Response.Write "<td width='32%' style=""padding-left:10px;"">"&email&"</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td align='right'>邮政编码：</td>"
Response.Write "<td height='28' style=""padding-left:10px;"">"&postcode&"</td>"
Response.Write "<td align='right'>联系电话：</td>"
Response.Write "<td style=""padding-left:10px;"">"&tel&"</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td height='28' align='right'>付款方式：</td>"
Response.Write "<td style=""padding-left:10px;"">"&paymenttype&"</td>"
Response.Write "<td align='right'>配送方式：</td>"
Response.Write "<td style=""padding-left:10px;"">"&sendtype&"</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td height='28' align='right'>收货地址：</td>"
Response.Write "<td colspan=3 style=""padding-left:10px;"">"&to_adds&"</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td height='28' align='right'>简短留言：</td>"
Response.Write "<td colspan=3 style=""padding-left:10px;"">"&other&"</td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td align='center' colspan=4 height='28'><font color='#FF3300'>商品总价："&totalcash&" 元 &nbsp;&nbsp;配送费用："&fei&" 元&nbsp;&nbsp; 总计：￥ "&summoney&" 元</font>&nbsp;，&nbsp;积分换购 "&wb_num&"</td>"
Response.Write "</tr>"
if totaljf<>"0" then
Response.Write "<tr><td colspan=4 height='28' style=""padding-left:10px;""><LI>此定单成交后，你将获得本站赠送您"&moneyname&":"&totaljf&"，感谢你的支持！</LI></td></tr>"
end if
Response.Write "</table>"
else
response.write"<SCRIPT language=JavaScript>alert(' 非法操作，参数错误 ！');"
response.write"JavaScript:window.close()</SCRIPT>"
response.end
end if
end sub
sub Myuser_shop()
if UserLogined<>True then
        response.write"<SCRIPT language=JavaScript>alert('对不起，您不是我们的会员或还没有登陆，请注册或登陆！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
if request("action")="dingdan" then
Dim CurPage,Url_Add
Url_Add="?action=dingdan&"
If Request.QueryString("Page")<>"" Then
   Curpage=Request.QueryString("Page")
   If IsInteger(Curpage)=False Then Curpage=1
Else
   Curpage=1
End If
sql="select * from shop_orders where user_id='"&Hx66_name&"' order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
Response.Write "<table width='100%' border='1' cellspacing='1' cellpadding='0' align='center' style=""border-collapse: collapse"" bordercolor='#f0f0f0'>"
Response.Write "<tr align='center'>"
Response.Write "<td height='25' width='*'>订单号</td><td width='14%'>支付金额</td><td width='12%'>支付积分</td><td width='23%'>下单时间</td><td width='15%'>定单状态</td><td width='8%'>操作</td>"
Response.Write "</tr>"
if not rs.eof then
   Dim Hx_Nums,MultiPages,i
   Hxperpage=20
   Rs.PageSize=Hxperpage
   Rs.AbsolutePage=CurPage
   Hx_Nums=Rs.RecordCount
   MultiPages="<tr><td colspan=""6"" height='28' align=""center"">"&MultiPage(Hx_Nums,Hxperpage,CurPage,Url_Add)&"</td></tr>"
Do Until Rs.EOF OR i=Hxperpage
Response.Write "<tr>"
Response.Write "<td height='25'>&nbsp;&nbsp;<font color=#FF0000>"&i+1&"、</font>"&rs("order_number")&"</td>"
Response.Write "<td align='center'>"&rs("summoney")&"</td>"
Response.Write "<td align='center'>"&rs("hgjifen")&"</td>"
Response.Write "<td>&nbsp;"&rs("order_time")&"</td>"
Response.Write "<td align='center'>"
        if rs("order_zf")=false then order_zt="货款未支付"
        if rs("order_zf")=true then order_zt="<font color=#FF6600>货款已划出</font>"
        if rs("order_sk")=1 then order_zt="<font color=#0000FF>商家已收款</font>"
        if rs("order_zt")=true then order_zt="<font color=#CC00CC>商家已发货</font>"
        if rs("order_sh")=1 then order_zt="<font color=#009933>交易已完结</font>"
        if rs("order_cw")=true then order_zt="<font color=#FF0000>无效的订单</font>"
Response.Write ""& order_zt &"</td>"
Response.Write "<td align='center'>[<a href='shop_myuser.asp?action=views&order_number="&rs("order_number")&"'>详情</a>]</td>"
Response.Write "</tr>"
i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then
Response.Write "<tr align='center'>" & vbCrLf
Response.Write "<td align=middle height='60' colSpan=5>"
Response.Write "你还没有任何定单！"
Response.Write "</td></tr>" & vbCrLf
end if
end if
Response.Write(MultiPages)
Response.Write "</table>" & vbCrLf
rs.close
set rs=nothing
elseif request("action")="views" then
Response.Write "<table width='100%' border='1' style=""border-collapse: collapse;border:dotted 1px"" bordercolor='#ffffff' cellpadding='0' cellspacing='0' align='center'>"
order_number=trim(replace(request("order_number"),"'",""))
user_id=trim(replace(request("user_id"),"'",""))
sql="select * from shop_orders where user_id='"&Hx66_name&"' and order_number='"&order_number&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql, conn, 1, 1
if rs.eof then
        response.write "<tr><td align='center'>没有此订单信息,请确认你的订单号输入是否正确</td></tr>"
        response.end
else
        if rs("order_zf")=false then order_zt="订单尚未处理，如您已经支付了货款，请确认修改定单状态。"
        if rs("order_zf")=true then order_zt="您的货款支付，请等待我们确认。"
        if rs("order_sk")=1 then order_zt="您的支付已经确认，我们将在24小时内给你发货。"
        if rs("order_zt")=true then order_zt="商品已递出，请注意查收。收货后请确认修改定单状态。"
        if rs("order_sh")=1 then order_zt="此订单已经交易完结。谢谢您的支持！"
        if rs("order_cw")=true then order_zt="此订单为无效订单。"
Response.Write "<tr>"
Response.Write "<td height='25' colspan='4'><font color=#FF0000>·</font>订单号为：<font color='#FF0000'>"&order_number&"</font>&nbsp;&nbsp;&nbsp;&nbsp;<a href='shop_myuser.asp?action=Myuser_dell&id="&rs("id")&"&order_number="&rs("order_number")&"&user_id="& rs("user_id") &"'>[删除此订单]</a></td>"
Response.Write "</tr>"
session("summoney")=rs("summoney")
session("dingdan")=order_number
Response.Write "<tr bgcolor='#F7F7F7'>"
Response.Write "<td height='26' width='15%'>&nbsp; 支付金额：</td>"
Response.Write "<td width='35%'>&nbsp; "&rs("summoney")&"</td>"
Response.Write "<td width='15%'>&nbsp; 下单时间：</td>"
Response.Write "<td width='35%'>&nbsp; "&rs("order_time")&"</td>"
Response.Write "</tr>"
Response.Write "<tr bgcolor='#F7F7F7'>"
Response.Write "<td height='26'>&nbsp; 支付积分：</td>"
Response.Write "<td>&nbsp; "&rs("hgjifen")&"</td>"
Response.Write "<td>&nbsp; 支付方式：</td>"
Response.Write "<td>&nbsp; "&rs("paymenttype")&"</td>"
Response.Write "</tr>"
Response.Write "<tr bgcolor='#F7F7F7'>"
Response.Write "<td height='26'>&nbsp; 发票需求：</td>"
Response.Write "<td>&nbsp;" 
if rs("fapiao")=1 then Response.Write "&nbsp;需要发票" else Response.Write "&nbsp;不需要发票" end if
Response.Write "</td>"
Response.Write "<td>&nbsp; 配送方式：</td>"
Response.Write "<td>&nbsp; "&rs("sendtype")&"</td>"
Response.Write "</tr>"
Response.Write "<tr bgcolor='#F7F7F7'>"
Response.Write "<td height='26'>&nbsp; 收货人姓名：</td>"
Response.Write "<td>&nbsp; "&rs("to_name")&"</td>"
Response.Write "<td>&nbsp; 联系Email：</td>"
Response.Write "<td>&nbsp; "&rs("email")&"</td>"
Response.Write "</tr>"
Response.Write "<tr bgcolor='#F7F7F7'>"
Response.Write "<td height='26'>&nbsp; 收货人地址：</td>"
Response.Write "<td colspan='3'>&nbsp; "&rs("to_adds")&"</td>"
Response.Write "</tr>"
Response.Write "<tr bgcolor='#F7F7F7'><form name='form1' method='post' action='shop_myuser.asp?id="&rs("id")&"&action=Myuser_edit'>"
Response.Write "<td colspan='4' height='30'>&nbsp;&nbsp;" 
if rs("order_cw")=false then
Response.Write "<input name='checkbox' type='checkbox' DISABLED id='checkbox' value='checkbox' checked>未作任何处理<span style='font-family:Wingdings;'>à</span>" 
   if rs("order_zf")=false then
       Response.Write "<input name='order_zf' type='checkbox' id='order_zf' value='ok'>用户确认支付"
   else
       Response.Write "<input name='checkbox' type='checkbox' DISABLED id='checkbox' value='checkbox' checked>用户已划出款"
       if rs("order_sh")=0 then
            if rs("order_sk")=1 then Response.Write "<span style='font-family:Wingdings;'>à</span><input name='checkbox' type='checkbox' DISABLED id='checkbox' value='checkbox' checked>商家已经收到款"
            if rs("order_zt")=true then Response.Write "<span style='font-family:Wingdings;'>à</span><input name='checkbox' type='checkbox' DISABLED id='checkbox' value='checkbox' checked>商家已经发货"
            if rs("order_sh")=0 and rs("order_sk")=1 and rs("order_zt")=true then Response.Write "<span style='font-family:Wingdings;'>à</span><input name='order_sh' type='checkbox' id='order_sh' value='ok'>用户收到货确认"
       else
            Response.Write "<span style='font-family:Wingdings;'>à</span><input name='checkbox' type='checkbox' DISABLED id='checkbox' value='checkbox' checked>用户已收到货"
       end if
   end if
else
       Response.Write "此订单为无效订单"
end if
Response.Write "</td></tr>"
Response.Write "<tr bgcolor='#F7F7F7'>"
Response.Write "<td height='30'>&nbsp; 订单状态：</td>"
Response.Write "<td colspan='3'>&nbsp; "
if rs("order_sh")<>1 and rs("order_cw")=false then
Response.Write "<input class='input' name='submit' value='修改订单状态' type='submit'>"
else
response.write "<font color=red><b>订单工作流程全部完成，</b></font>"
end if
Response.Write "&nbsp;"& order_zt &"</td></form></tr>"
rs.close
set rs=nothing
Response.Write "</table>"
Response.Write "<br>"
Response.Write "<table width='98%' border='0' style=""border-collapse: collapse;border:dotted 1px"" cellpadding='0' cellspacing='0' align='center' bordercolor='#808080'>"
Response.Write "<tr>"
Response.Write "<td colspan='5' height='25'>&nbsp;&nbsp;= 此订单商品详情 =</td>"
Response.Write "</tr>"
sql="select * from shop_basket where user_id='"&Hx66_name&"' and order_number='"&order_number&"'"
set rsa=server.createobject("adodb.recordset")
rsa.open sql, conn, 3, 3
do while not rsa.eof
Response.Write "<tr>"
Response.Write "<td width='14%' height='25'>&nbsp; 商品名称：</td>"
Response.Write "<td width='*'>&nbsp;"& rsa("product_name") &"</td>"
Response.Write "<td width='15%' align='center'>数量/单价(元)</td>"
Response.Write "<td width='18%'>&nbsp;"&rsa("basket_count")&"/"&rsa("price")&"</td>"
Response.Write "<td width='18%' align='center'>"
if rsa("auct")=True then 
Response.Write "<font color=red>积分换购:"&rsa("hgjifen")&"</font>" 
else 
Response.Write "——" 
end if
Response.Write "</td></tr>"
rsa.movenext
loop
rsa.close
set rsa=nothing
end if
Response.Write "</table>"
else
  Response.Redirect "show_error.asp?eid=参数错误，找不到相关的记录!"
  Response.End
end if
end sub 
if request("action")="Myuser_edit" then
dim tit_fir
    set rs=server.CreateObject("adodb.recordset")
    sqlstrs="select * from shop_orders where user_id='"&Hx66_name&"' and id="&int(request("id"))
    rs.open sqlstrs,conn,1,3
    if rs.bof and rs.eof then
       response.write"<SCRIPT language=JavaScript>alert('请指定操作对象！');"
       response.write"javascript:history.go(-1)</SCRIPT>"
       response.end
    else
       order_number=rs("order_number")
       order_zf=rs("order_zf")
       order_sk=clng(rs("order_sk"))
       order_sh=clng(rs("order_sh"))
       jifen=clng(rs("jifen"))
       if request.form("order_zf")="ok" and order_zf=false then 
            rs("order_zf")=true
            tit_fir="提交成功"
       else
            if request.form("order_sh")="ok" and order_sk=1 and order_sh=0 then 
                 rs("order_sh")=1
                 tit_fir="提交成功"
                 if order_sh=0 and jifen>0 then 
                     conn.execute "UPDATE [user] SET points = points + "&jifen&" where userid="&Hx66_uid
                     tit_fir="提交成功，此次购物你已获得"&jifen&""&moneyname&""
                 end if
            end if
       end if
       rs.update   
       rs.close
    end if
url="shop_myuser.asp?action=views&order_number="&order_number&""
response.write"<SCRIPT language=JavaScript>alert('"&tit_fir&"！');"
response.write"this.top.location.href='"&url&"';</SCRIPT>"
response.end
end if
if request("action")="Myuser_dell" then
    set rss=server.CreateObject("adodb.recordset")
    sqlstrs="select * from shop_orders where order_sk=0 and user_id='"&Hx66_name&"' and id="&int(request("id"))
    rss.open sqlstrs,conn,1,3
    if rss.bof and rss.eof then
       response.write"<SCRIPT language=JavaScript>alert('对不起，商家已确认的定单你不能删除！');"
       response.write"javascript:history.go(-1)</SCRIPT>"
       response.end
    else
          do while not rss.eof
              set rssc=server.CreateObject("adodb.recordset")
              sqlstrsc="select * from shop_basket where order_number='"&rss("order_number")&"'"
              rssc.open sqlstrsc,conn,1,3
                  do while not rssc.eof
                     rssc.delete
                     rssc.movenext
                  loop
                  rssc.close
              rss.delete
              rss.movenext
          loop
          rss.close
    end if
url="shop_myuser.asp?action=dingdan"
response.redirect url
end if
%>

