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

📄 productlist.asp

📁 生成html的ASP企业站点,可以进行二次开发的
💻 ASP
字号:
<%@ LANGUAGE = VBScript %>
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312" />
<TITLE>导航栏目列表</TITLE>
<link rel="stylesheet" href="Images/Admin.css">
<script language="javascript" src="../Script/Admin.js"></script>
</HEAD>
<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/ConnSiteData.asp" -->
<!--#include file="CheckAdmin.asp"-->
<BODY>
<%
Dim quanxian
quanxian=trim(Request.ServerVariables(name))

if Instr(session("AdminPurview"),"|12,")=0 then
  response.write ("<br><br><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限!</font></div>")
  response.end
end if
%>
<%
dim Result,Keyword,SortID,SortPath
Result=request.QueryString("Result")
Keyword=request.QueryString("Keyword")
SortID=request.QueryString("SortID")
SortPath=request.QueryString("SortPath")
function PlaceFlag()
  if Result="Search" then
	If Keyword<>"" Then
		Response.Write "产品:列表 -> 检索 -> 关键字:<font color='red'>"&Keyword&"</font>"
	Else
		Response.Write "产品:列表 -> 检索 -> 关键字为空(显示全部产品)"
	End If
  else
    if SortPath<>"" then
      Response.Write "产品:列表 -> <a href='ProductList.asp'>全部</a>"
	  TextPath(SortID)
	else
      Response.Write "产品:列表 -> 全部"
	end if
  end if
end function
%>
<br>
<table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr>
    <th>产品检索及分类查看:添加,修改,删除产品信息</th>
  </tr>
  <tr>
    <td height="24" align="center" nowrap="nowrap"  class="forumrow"><a href="ProductEdit.asp?Result=Add" onclick='changeAdminFlag(&quot;添加产品信息&quot;)'>添加产品信息</a><font color="#0000FF">&nbsp;|&nbsp;</font><a href="ProductList.asp" onclick='changeAdminFlag(&quot;产品列表&quot;)'>查看所有产品信息</a>&nbsp;|&nbsp;</font><a href="ProductSort.asp?Action=Add&amp;ParentID=0" onclick='changeAdminFlag(&quot;产品列表&quot;)'>添加产品类别</a>&nbsp;|&nbsp;</font><a href="OrderList.asp" onclick='changeAdminFlag(&quot;产品列表&quot;)'>查看订单信息</a><font color="#0000FF">&nbsp;|&nbsp;</font><a href="Admin_htmlsort.asp" onclick='changeAdminFlag(&quot;生成其他信息分类页面&quot;)'>生成产品分类页面</a><font color="#0000FF">&nbsp;|&nbsp;</font><a href="Admin_htmlpro.asp" onclick='changeAdminFlag(&quot;生成其他信息详细页面&quot;)'>生成产品详细页面</a></td>
  </tr>
</table>
<br>
<table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
<form name="formSearch" method="post" action="Search.asp?Result=Products">
  <tr>
    <th height="22">【产品检索及分类查看】</th>
  </tr>
  <tr>
    <td class="forumRow">关键字:<input name="Keyword" type="text" value="<%=Keyword%>" size="20"> <input name="submitSearch" type="submit" value="搜索产品"></td>
  </tr>
  <tr>
    <td class="forumRow"><%PlaceFlag()%></td>
  </tr>
  </form>
</table>
<br>
<table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
<form action="DelContent.asp?Result=Products" method="post" name="formDel">
  <tr>
    <td class="title" width="20">ID</td>
	<td width="20" align="center" class="title">中</td>
	<td width="20" align="center" class="title">英</td>
	<td class="title">产品编号</td>
	<td class="title">产品标题</td>
	<td width="40" align="center" class="title">状态</td>
	<td width="80" align="center" class="title">查看组别</td>
	<td width="60" align="center" class="title">市场价</td>
	<td width="60" align="center" class="title">批发价</td>
	<td width="40" align="center" class="title">型号</td>
	<td width="40" align="center" class="title">库存</td>
	<td width="40" align="center" class="title">操作</td>
	<td width="80" align="center" class="title"> <input onClick="CheckAll(this.form)" name="buttonAllSelect" type="button" id="submitAllSearch" value="全选"> <input onClick="CheckOthers(this.form)" name="buttonOtherSelect" type="button" id="submitOtherSelect" value="反选"></td>
  </tr>
  <% ProductsList() %>
  </form>
</table>
</BODY>
</HTML>

<%

function ProductsList()
  dim idCount
  dim pages
      pages=20
  dim pagec
  dim page
      page=clng(request("Page"))
  dim pagenc
      pagenc=2
  dim pagenmax
  dim pagenmin
  dim datafrom
      datafrom="LiangJingCMS_Products"
  dim datawhere
      if Result="Search" then
	     datawhere="where ProductNameCH like '%" & Keyword &_
		           "%' "
	  else
	    if SortPath<>"" then
		  datawhere="where Instr(SortPath,'"&SortPath&"')>0 "
        else
		  datawhere=""
		end if
	  end if
  dim sqlid
  dim Myself,PATH_INFO,QUERY_STRING
      PATH_INFO = request.servervariables("PATH_INFO")
	  QUERY_STRING = request.ServerVariables("QUERY_STRING")'
      if QUERY_STRING = "" then
	    Myself = PATH_INFO & "?"
	  else
	   if Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
	   Myself = PATH_INFO & "?" & QUERY_STRING & "&"
	   else
	    Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
	   end if
	  end if
  dim taxis
      taxis="order by id desc"
  dim i
  dim rs,sql
  sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,0,1
  idCount=rs("idCount")
  if(idcount>0) then
    if(idcount mod pages=0)then
	  pagec=int(idcount/pages)
   	else
      pagec=int(idcount/pages)+1
    end if
    sql="select id from ["& datafrom &"] " & datawhere & taxis
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,1
    rs.pagesize = pages
    if page < 1 then page = 1
    if page > pagec then page = pagec
    if pagec > 0 then rs.absolutepage = page  
    for i=1 to rs.pagesize
	  if rs.eof then exit for  
	  if(i=1)then
	    sqlid=rs("id")
	  else
	    sqlid=sqlid &","&rs("id")
	  end if
	  rs.movenext
    next
  end if
  if(idcount>0 and sqlid<>"") then
    sql="select * from ["& datafrom &"] where id in("& sqlid &") "&taxis
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,0,1
    while(not rs.eof)
	  Response.Write "<tr>" & vbCrLf
      Response.Write "<td nowrap class=""forumRow"">"&rs("ID")&"</td>" & vbCrLf
      if rs("ViewFlagCH") then
        Response.Write "<td nowrap align='center' class=""forumRow""><a href=""Conversion.asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=downCH""><font color='green'>√</font></a></td>" & vbCrLf
      else
        Response.Write "<td nowrap align='center' class=""forumRow""><a href=""Conversion.asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=upCH""><font color='red'>×</font></a></td>" & vbCrLf
	  end If
      if rs("ViewFlagEN") then
        Response.Write "<td nowrap align='center' class=""forumRow""><a href=""Conversion.asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=downEN""><font color='green'>√</font></a></td>" & vbCrLf
      else
        Response.Write "<td nowrap align='center' class=""forumRow""><a href=""Conversion.asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=upEN""><font color='red'>×</font></a></td>" & vbCrLf
	  end If
	  Response.Write "<td nowrap class=""forumRow""><input type=""text"" name=""ProductNo"" size=""12"" value="""&rs("ProductNo")&"""></td>" & vbCrLf
	  Response.Write "<td nowrap title='"&rs("ProductNameCH")&"' class=""forumRow""><input type=""text"" name=""ProductNameCH"" size=""35"" value="""&rs("ProductNameCH")&"""></td>" & vbCrLf
      Response.Write "<td nowrap align='center' class=""forumRow"">" & vbCrLf
      if rs("NewFlag") then Response.Write "<font color='red'>新品</font> "
      if rs("CommendFlag") then Response.Write "<font color='green'>推荐</font>"
	  if rs("NewFlag") = false And rs("CommendFlag") = false then Response.Write "普通"
      Response.Write "</td>"
      if rs("Exclusive")=">=" then
        Response.Write "<td nowrap align=""center"" class=""forumRow"">"&ViewGroupName(rs("GroupID"))&" <font color='green'>隶</font></td>" & vbCrLf
      else
        Response.Write "<td nowrap align=""center"" class=""forumRow"">"&ViewGroupName(rs("GroupID"))&" <font color='red'>专</font></td>" & vbCrLf
	  end if
	  Response.Write "<td nowrap align='center' class=""forumRow""><input type=""text"" name=""N_Price"" size=""5"" value="""&rs("N_Price")&""" onkeypress=""if (event.keyCode < 45 || event.keyCode > 57) event.returnValue=false""></td>" & vbCrLf
      Response.Write "<td nowrap align='center' class=""forumRow""><input type=""text"" name=""P_Price"" size=""5"" value="""&rs("P_Price")&""" onkeypress=""if (event.keyCode < 45 || event.keyCode > 57) event.returnValue=false""></td>" & vbCrLf
	  Response.Write "<td nowrap class=""forumRow""><input type=""text"" name=""ProductModel"" size=""5"" value="""&rs("ProductModel")&"""></td>" & vbCrLf
	  Response.Write "<td nowrap class=""forumRow""><input type=""text"" name=""Stock"" size=""5"" value="""&rs("Stock")&""" onkeypress=""if (event.keyCode < 45 || event.keyCode > 57) event.returnValue=false""></td>" & vbCrLf
      Response.Write "<td align=""center""nowrap class=""forumRow""><a href='ProductEdit.asp?Result=Modify&ID="&rs("ID")&"'>修改</a><input name=""pro_id"" type=""hidden"" value="""&rs("ID")&"""></td></td>" & vbCrLf
 	  Response.Write "<td nowrap align='center' class=""forumRow""><input name='selectID' type='checkbox' value='"&rs("ID")&"'></td>" & vbCrLf
      Response.Write "</tr>" & vbCrLf
	  rs.movenext
    wend
    Response.Write "<tr>" & vbCrLf
    Response.Write "<td colspan='13' nowrap align=""right"" class=""forumRow""><input type=""submit"" name=""batch"" value=""中文批量显示"" onClick=""return test();""> <input type=""submit"" name=""batch"" value=""英文批量显示"" onClick=""return test();""> <input type=""submit"" name=""batch"" value=""中文批量不显示"" onClick=""return test();""> <input type=""submit"" name=""batch"" value=""英文批量不显示"" onClick=""return test();""> <input name='batch' type='submit' value='删除所选' onClick=""return test();""></td>" & vbCrLf
    Response.Write "</tr>" & vbCrLf
  else
    response.write "<tr><td nowrap align='center' colspan='13' class=""forumRow"">暂无产品信息</td></tr>"
  end if
  Response.Write "<tr>" & vbCrLf
  Response.Write "<td colspan='13' nowrap class=""forumRow"">" & vbCrLf
  Response.Write "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
  Response.Write "<tr>" & vbCrLf
  Response.Write "<td class=""forumRow"">共计:<font color='red'>"&idcount&"</font>条记录 页次:<font color='red'>"&page&"</font></strong>/"&pagec&" 每页:<font color='red'>"&pages&"</font>条</td>" & vbCrLf
  Response.Write "<td align='right'>" & vbCrLf
  pagenmin=page-pagenc
  pagenmax=page+pagenc
  if(pagenmin<1) then pagenmin=1
  if(page>1) then response.write ("<a href='"& myself &"Page=1'><font style='font-size: 14px; font-family: Webdings'>9</font></a> ")
  if(pagenmin>1) then response.write ("<a href='"& myself &"Page="& page-(pagenc*2+1) &"'><font style='font-size: 14px; font-family: Webdings'>7</font></a> ")
  if(pagenmax>pagec) then pagenmax=pagec
  for i = pagenmin to pagenmax
	if(i=page) then
	  response.write (" <font color='red'>"& i &"</font> ")
	else
	  response.write ("[<a href="& myself &"Page="& i &">"& i &"</a>]")
	end if
  next
  if(pagenmax<pagec) then response.write (" <a href='"& myself &"Page="& page+(pagenc*2+1) &"'><font style='font-size: 14px; font-family: Webdings'>8</font></a> ")
  if(page<pagec) then response.write ("<a href='"& myself &"Page="& pagec &"'><font style='font-size: 14px; font-family: Webdings'>:</font></a> ")
  Response.Write "第<input name='SkipPage' onKeyDown='if(event.keyCode==13)event.returnValue=false' onchange=""if(/\D/.test(this.value)){alert('请输入需要跳转到的页数并且必须为整数!');this.value='"&Page&"';}"" style='width: 28px;' type='text' value='"&Page&"'>页" & vbCrLf
  Response.Write "<input name='submitSkip' type='button' onClick='GoPage("""&Myself&""")' value='转到'>" & vbCrLf
  Response.Write "</td>" & vbCrLf
  Response.Write "</tr>" & vbCrLf
  Response.Write "</table>" & vbCrLf
  rs.close
  set rs=nothing
  Response.Write "</td>" & vbCrLf
  Response.Write "</tr>" & vbCrLf
end Function

Function TextPath(ID)
  Dim rs,sql
  Set rs=server.CreateObject("adodb.recordset")
  sql="Select * From LiangJingCMS_ProductSort where ID="&ID
  rs.open sql,conn,1,1
  TextPath=" -> <a href=ProductList.asp?SortID="&rs("ID")&"&SortPath="&rs("SortPath")&">"&rs("SortNameCH")&"</a>"
  if rs("ParentID")<>0 then TextPath rs("ParentID")
  response.write(TextPath)
End Function

Function SortText(ID)
  Dim rs,sql
  Set rs=server.CreateObject("adodb.recordset")
  sql="Select * From LiangJingCMS_ProductSort where ID="&ID
  rs.open sql,conn,1,1
  SortText=rs("SortNameCH")
  rs.close
  set rs=nothing
End Function

Function ViewGroupName(GruopID)
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select GroupID,GroupNameCH from LiangJingCMS_MemGroup where GroupID='"&GruopID&"'"
  rs.open sql,conn,1,1
  if rs.bof and rs.eof then
    ViewGroupNameSi="未设组别"
  else
    ViewGroupName=rs("GroupNameCH")
  end if
  rs.close
  set rs=nothing
end Function
%>

⌨️ 快捷键说明

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