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

📄 shop.asp

📁 该软件是帮助大学生更好的生活
💻 ASP
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
%>
<!-- #include file="inc/conn.asp" -->
<!--#include file="inc/Conn_User.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/func.asp"-->

<!-- #include file="inc_shop/config_shop.asp" -->
<!-- #include file="inc_shop/jk_pagecute.asp" -->
<%
dim strChannel,sqlChannel,rsChannel,ChannelUrl,ChannelName
dim strFileName,MaxPerPage,totalPut,CurrentPage,TotalPages
dim BeginTime,EndTime,founderr, errmsg
dim PageTitle,strPath,strPageTitle
dim SkinID,ClassID,AnnounceCount
dim UserGuestName,UserType,UserSex,UserEmail,UserHomepage,UserOicq,UserIcq,UserMsn
dim WriteName,WriteType,WriteSex,WriteEmail,WriteOicq,WriteIcq,WriteMsn,WriteHomepage
dim WriteFace,WriteImages,WriteTitle,WriteContent,SaveEdit,SaveEditId
dim GuestType,LoginName,AdminReplyContent
dim SubmitType,GuestPath,TitleName,keyword

dim nid,nummer,page,rssum,thepages,viewpage,pageurl,sqladd  '--JK


strFileName="shop.asp"
SkinID=0

strPath= "&nbsp;您现在的位置:&nbsp;<a href='" & SiteUrl & "'>" & SiteName & "</a>"
strPageTitle= SiteTitle

BeginTime=Timer
ClassID=0

call cid_sid()
if cid=0 then
  if action="search" then
    pagetitle=pagetitle & "查询结果"
  else
    pagetitle=pagetitle & channelName & "首页"
  end if
else
  if action="search" then
    pagetitle=pagetitle & "查询结果"
  else
    pagetitle=pagetitle & "分类浏览"
  end if
end if
%>
<html>
<head>
<title><%=strPageTitle & " >> " & PageTitle%></title>
<!--#include file="inc/Skin_CSS.asp"-->
<%call MenuJS()%>
</head>
<body <%=Body_Label%> onmousemove='HideMenu()'>
<!--#include file="top.asp"-->
<table border="0" align="center" cellpadding="0" cellspacing="0" class="border2">
  <tr> 
    <td width="192" align="left" valign="top" class="td_left">
    <%
	  call shop_sort()
	  call shop_left()
	  %></td>
    <td width=583 valign="top"> 
	  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td><table width='100%' border=0 align=center cellpadding="0" cellspacing="0">
              <tr>
                <td align=center>
                  <%
if cid=0 then
  if action="search" then
    call shop_list()
  else
    call shop_main()
  end if
else
  call shop_list()
end if
%>
                </td>
              </tr>
            </table></td>
        </tr>
    </table></td>
  </tr>
</table>

<% call Bottom() %>
</td>
</tr></table>
<% call PopAnnouceWindow(400,300) %>
<% call ShowAD(0) %>                         
<% call ShowAD(4) %>                         
<% call ShowAD(5) %>    
</body>
</html>
<script>
 mtDropDown.initialize();
</script>
<%
call CloseConn()

sub shop_main()
%>
<table border=0 width='100%' cellspacing=0 cellpadding=0>
<tr>
 <td>
   <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td class='title_bg_center'>最新产品</td>
    </tr>
 </table></td>
</tr>
<tr> 
  <td valign="top">
    <table width="100%" border="0" cellpadding="0" cellspacing="5">
    <tr> 
      <td valign="top"> 
<%
  sql="select top 3 id,name,serial,brand,stock,smallimg,price_1,price_2,remark_1 from product where hidden order by id desc"
  set rs=conn.execute(sql)
  dim i
  do while not rs.eof
    response.write vbcrlf&"<tr valign=top>"
    for i=1 to 3
      if rs.eof or rs.bof then exit for
      response.write vbcrlf&"<td width='33%' align=center>"&shop_view()&"</td>"
      rs.movenext
    next
    response.write vbcrlf&"</tr>"
  loop
  rs.close
%>
      </td>
    </tr>
   </table>
   </td>
  </tr>
</table>

 <table border=0 width='100%' cellspacing=0 cellpadding=0>
<tr>
 <td>
   <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td class='title_bg_center'>推荐产品</td>
    </tr>
 </table></td>
</tr>
<tr> 
  <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="5">
    <tr> 
      <td valign="top"> 
<%
  sql="select top 3 id,name,serial,brand,stock,smallimg,price_1,price_2,remark_1 from product where isgood and hidden order by tim desc,id desc"
  set rs=conn.execute(sql)
  do while not rs.eof
    response.write vbcrlf&"<td width='33%' align=center>"&shop_view()&"</td>"
    rs.movenext
  loop
  rs.close
  set rs=nothing
%>
      </td>
    </tr>
   </table></td>
  </tr>
 </table>
<%
end sub

sub shop_list()
  dim j,sea_type,keyword
  pageurl="shop.asp?":sqladd=""
  thepages=0:viewpage=1:nummer=6
  sea_type=trim(request.querystring("sea_type"))
  keyword=replace(trim(request.querystring("keyword")),"'","")
  if cid>0 then
    sqladd=" and c_id="&cid
    pageurl=pageurl&"c_id="&cid&"&"
    if sid>0 then
      sqladd=sqladd&" and s_id="&sid
      pageurl=pageurl&"s_id="&sid&"&"
    end if
  end if
  if len(keyword)>0 and (sea_type="name" or sea_type="brand" or sea_type="remark_1") then
    sqladd=sqladd&" and "&sea_type&" like '%"&keyword&"%'"
    pageurl=pageurl&"keyword="&server.htmlencode(keyword)&"&sea_type="&sea_type&"&"
  end if
%>
<table border=0 width='100%' cellspacing=0 cellpadding=0><tr><td>
   <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td class='title_bg_center'>产品列表</td>
    </tr>
 </table></td>
</tr>
<tr> 
  <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="5">
    <tr> 
      <td valign="top"> 
<%
  sql="select id,name,serial,brand,stock,smallimg,price_1,price_2,remark_1 from product where hidden "&sqladd&" order by id desc"
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,1,1
  if rs.eof and rs.bof then
    rssum=0
  else
    rssum=rs.recordcount
  end if
  call format_pagecute()
  if int(viewpage)>1 then
    rs.move (viewpage-1)*nummer
  end if
  for j=1 to nummer\3
    if rs.eof or rs.bof then exit for
    response.write vbcrlf&"<tr valign=top>"
    for i=1 to 3
      if rs.eof or rs.bof then exit for
      response.write vbcrlf&"<td width='33%' align=center>"&shop_view()&"</td>"
      rs.movenext
    next
    response.write vbcrlf&"</tr><tr><td height=5></td></tr>"
  next
%>
      </td>
    </tr>
   </table></td>
  </tr>
<tr>
<td height=25 align=center>页次:<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>&nbsp;&nbsp;分页:<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,8,"#ff0000")%></td>
<%
'call showpage("shop.asp",rs.recordcount,rs.pagesize,true,true,"个产品或服务")
%>
</tr>
</table>
<%
  rs.close:set rs=nothing
end sub

function shop_view()
  nid=rs("id")
  dim imgstr
  imgstr=trim(rs("smallimg"))
  if len(imgstr)<1 then
    imgstr="uploadshoppic/no.jpg"
   else
    imgstr="uploadshoppic/" & imgstr
  end if
  shop_view=vbcrlf&"<table border=0 width='90%' cellspacing=0 cellpadding=0 class=tf>" & _
	    vbcrlf&"<tr><td height=5></td></tr>" & _
	    vbcrlf&"<tr><td colspan=2 align=center><a href='shop_view.asp?id="&nid&"' target='_blank'><img src='"& imgstr &"' border=0 " & w_h & "></a></td></tr>" & _
	    vbcrlf&"<tr><td colspan=2 align=center height=25><a href='shop_view.asp?id="&nid&"' target='_blank'><b>"&rs("name")&"</b></a></td></tr>" & _
	    vbcrlf&"<tr><td colspan=2 align=center>价格:<font color=aray>"&pu&""&rs("price_1")&"</font> 会员:<font color=red>"&pu&"<u>"&rs("price_2")&"</u></font></td></tr>" & _
	    vbcrlf&"<tr><td colspan=2 align=center height=30 nowap><a href='shop_bag.asp?id="&nid&"'><img align=absMiddle src='images/buy.gif' border=0></a>&nbsp;&nbsp;[ <a href='shop_view.asp?id="&nid&"' target='_blank'>详细介绍</a> ]</td></tr>" & _
	    vbcrlf&"</table>"
end function
%>

⌨️ 快捷键说明

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