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

📄 syscode_shop.asp

📁 后台登陆admin.asp
💻 ASP
📖 第 1 页 / 共 5 页
字号:
response.write "&nbsp;<font color=""#FF0000"">├ "&rs2("scat_name")&"</a></font>" & vbCrLf
else
response.write "&nbsp;<a href='?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
'作  用:产品分类——横排
'参  数:无
'Web:    www.ynsky.com.cn
'=================================================
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"">〖"&rs1("scat_name")&"〗</font><BR>"
else
response.write "<a href='?scat_id="&rs1("scat_id")&"'>〖"&rs1("scat_name")&"〗</a><BR>"
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;&nbsp;<font color=""#FF0000"">├ "&rs2("scat_name")&"</a></font>"
else
response.write "&nbsp;&nbsp;<a href='?scat_id="&rs2("scat_id")&"'>├ "&rs2("scat_name")&"</a>"
end if
rs2.movenext
loop
response.write "<BR>"
rs1.movenext
loop
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing
end sub
sub search_shop()
Response.Write "<div align=center><form name='form2' method='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=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=<%=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>
    <td width="5" bgcolor="#F0F0F0"></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='530'></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

⌨️ 快捷键说明

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