ProductList.asp
上传用户:mtjhgs
上传日期:2021-12-08
资源大小:3755k
文件大小:13k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <%@ LANGUAGE = VBScript.Encode %>
  2. <HTML xmlns="http://www.w3.org/1999/xhtml">
  3. <HEAD>
  4. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312" />
  5. <TITLE>导航栏目列表</TITLE>
  6. <link rel="stylesheet" href="Images/Admin.css">
  7. <script language="javascript" src="../Script/Admin.js"></script>
  8. </HEAD>
  9. <!--#include file="../Include/Const.asp" -->
  10. <!--#include file="../Include/ConnSiteData.asp" -->
  11. <!--#include file="CheckAdmin.asp"-->
  12. <BODY>
  13. <%
  14. if Instr(session("AdminPurview"),"|12,")=0 then
  15.   response.write ("<br><br><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限!</font></div>")
  16.   response.end
  17. end if
  18. %>
  19. <%
  20. dim Result,Keyword,SortID,SortPath
  21. Result=request.QueryString("Result")
  22. Keyword=request.QueryString("Keyword")
  23. SortID=request.QueryString("SortID")
  24. SortPath=request.QueryString("SortPath")
  25. function PlaceFlag()
  26.   if Result="Search" then
  27. If Keyword<>"" Then
  28. Response.Write "产品:列表 -> 检索 -> 关键字:<font color='red'>"&Keyword&"</font>"
  29. Else
  30. Response.Write "产品:列表 -> 检索 -> 关键字为空(显示全部产品)"
  31. End If
  32.   else
  33.     if SortPath<>"" then
  34.       Response.Write "产品:列表 -> <a href='ProductList.asp'>全部</a>"
  35.   TextPath(SortID)
  36. else
  37.       Response.Write "产品:列表 -> 全部"
  38. end if
  39.   end if
  40. end function
  41. %>
  42. <br>
  43. <table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
  44.   <tr>
  45.     <th>产品检索及分类查看:添加,修改,删除产品信息</th>
  46.   </tr>
  47.   <tr>
  48.     <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>
  49.   </tr>
  50. </table>
  51. <br>
  52. <table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
  53. <form name="formSearch" method="post" action="Search.asp?Result=Products">
  54.   <tr>
  55.     <th height="22">【产品检索及分类查看】</th>
  56.   </tr>
  57.   <tr>
  58.     <td class="forumRow">关键字:<input name="Keyword" type="text" value="<%=Keyword%>" size="20"> <input name="submitSearch" type="submit" value="搜索产品"></td>
  59.   </tr>
  60.   <tr>
  61.     <td class="forumRow"><%PlaceFlag()%></td>
  62.   </tr>
  63.   </form>
  64. </table>
  65. <br>
  66. <table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
  67. <form action="DelContent.asp?Result=Products" method="post" name="formDel">
  68.   <tr>
  69.     <td class="title" width="20">ID</td>
  70. <td width="20" align="center" class="title">中</td>
  71. <td width="20" align="center" class="title">英</td>
  72. <td class="title">产品编号</td>
  73. <td class="title">产品标题</td>
  74. <td width="40" align="center" class="title">状态</td>
  75. <td width="80" align="center" class="title">查看组别</td>
  76. <td width="60" align="center" class="title">市场价</td>
  77. <td width="60" align="center" class="title">批发价</td>
  78. <td width="40" align="center" class="title">型号</td>
  79. <td width="40" align="center" class="title">库存</td>
  80. <td width="40" align="center" class="title">操作</td>
  81. <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>
  82.   </tr>
  83.   <% ProductsList() %>
  84.   </form>
  85. </table>
  86. </BODY>
  87. </HTML>
  88. <%
  89. function ProductsList()
  90.   dim idCount
  91.   dim pages
  92.       pages=20
  93.   dim pagec
  94.   dim page
  95.       page=clng(request("Page"))
  96.   dim pagenc
  97.       pagenc=2
  98.   dim pagenmax
  99.   dim pagenmin
  100.   dim datafrom
  101.       datafrom="Wygkcnflash_Products"
  102.   dim datawhere
  103.       if Result="Search" then
  104.      datawhere="where ProductNameCH like '%" & Keyword &_
  105.            "%' "
  106.   else
  107.     if SortPath<>"" then
  108.   datawhere="where Instr(SortPath,'"&SortPath&"')>0 "
  109.         else
  110.   datawhere=""
  111. end if
  112.   end if
  113.   dim sqlid
  114.   dim Myself,PATH_INFO,QUERY_STRING
  115.       PATH_INFO = request.servervariables("PATH_INFO")
  116.   QUERY_STRING = request.ServerVariables("QUERY_STRING")'
  117.       if QUERY_STRING = "" or Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
  118.     Myself = PATH_INFO & "?"
  119.   else
  120.     Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
  121.   end if
  122.   dim taxis
  123.       taxis="order by id desc"
  124.   dim i
  125.   dim rs,sql
  126.   sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
  127.   set rs=server.createobject("adodb.recordset")
  128.   rs.open sql,conn,0,1
  129.   idCount=rs("idCount")
  130.   if(idcount>0) then
  131.     if(idcount mod pages=0)then
  132.   pagec=int(idcount/pages)
  133.     else
  134.       pagec=int(idcount/pages)+1
  135.     end if
  136.     sql="select id from ["& datafrom &"] " & datawhere & taxis
  137.     set rs=server.createobject("adodb.recordset")
  138.     rs.open sql,conn,1,1
  139.     rs.pagesize = pages
  140.     if page < 1 then page = 1
  141.     if page > pagec then page = pagec
  142.     if pagec > 0 then rs.absolutepage = page  
  143.     for i=1 to rs.pagesize
  144.   if rs.eof then exit for  
  145.   if(i=1)then
  146.     sqlid=rs("id")
  147.   else
  148.     sqlid=sqlid &","&rs("id")
  149.   end if
  150.   rs.movenext
  151.     next
  152.   end if
  153.   if(idcount>0 and sqlid<>"") then
  154.     sql="select * from ["& datafrom &"] where id in("& sqlid &") "&taxis
  155.     set rs=server.createobject("adodb.recordset")
  156.     rs.open sql,conn,0,1
  157.     while(not rs.eof)
  158.   Response.Write "<tr>" & vbCrLf
  159.       Response.Write "<td nowrap class=""forumRow"">"&rs("ID")&"</td>" & vbCrLf
  160.       if rs("ViewFlagCH") then
  161.         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
  162.       else
  163.         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
  164.   end If
  165.       if rs("ViewFlagEN") then
  166.         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
  167.       else
  168.         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
  169.   end If
  170.   Response.Write "<td nowrap class=""forumRow""><input type=""text"" name=""ProductNo"" size=""12"" value="""&rs("ProductNo")&"""></td>" & vbCrLf
  171.   Response.Write "<td nowrap title='"&rs("ProductNameCH")&"' class=""forumRow""><input type=""text"" name=""ProductNameCH"" size=""35"" value="""&rs("ProductNameCH")&"""></td>" & vbCrLf
  172.       Response.Write "<td nowrap align='center' class=""forumRow"">" & vbCrLf
  173.       if rs("NewFlag") then Response.Write "<font color='red'>新品</font> "
  174.       if rs("CommendFlag") then Response.Write "<font color='green'>推荐</font>"
  175.   if rs("NewFlag") = false And rs("CommendFlag") = false then Response.Write "普通"
  176.       Response.Write "</td>"
  177.       if rs("Exclusive")=">=" then
  178.         Response.Write "<td nowrap align=""center"" class=""forumRow"">"&ViewGroupName(rs("GroupID"))&" <font color='green'>隶</font></td>" & vbCrLf
  179.       else
  180.         Response.Write "<td nowrap align=""center"" class=""forumRow"">"&ViewGroupName(rs("GroupID"))&" <font color='red'>专</font></td>" & vbCrLf
  181.   end if
  182.   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
  183.       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
  184.   Response.Write "<td nowrap class=""forumRow""><input type=""text"" name=""ProductModel"" size=""5"" value="""&rs("ProductModel")&"""></td>" & vbCrLf
  185.   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
  186.       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
  187.     Response.Write "<td nowrap align='center' class=""forumRow""><input name='selectID' type='checkbox' value='"&rs("ID")&"'></td>" & vbCrLf
  188.       Response.Write "</tr>" & vbCrLf
  189.   rs.movenext
  190.     wend
  191.     Response.Write "<tr>" & vbCrLf
  192.     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
  193.     Response.Write "</tr>" & vbCrLf
  194.   else
  195.     response.write "<tr><td nowrap align='center' colspan='13' class=""forumRow"">暂无产品信息</td></tr>"
  196.   end if
  197.   Response.Write "<tr>" & vbCrLf
  198.   Response.Write "<td colspan='13' nowrap class=""forumRow"">" & vbCrLf
  199.   Response.Write "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
  200.   Response.Write "<tr>" & vbCrLf
  201.   Response.Write "<td class=""forumRow"">共计:<font color='red'>"&idcount&"</font>条记录 页次:<font color='red'>"&page&"</font></strong>/"&pagec&" 每页:<font color='red'>"&pages&"</font>条</td>" & vbCrLf
  202.   Response.Write "<td align='right'>" & vbCrLf
  203.   pagenmin=page-pagenc
  204.   pagenmax=page+pagenc
  205.   if(pagenmin<1) then pagenmin=1
  206.   if(page>1) then response.write ("<a href='"& myself &"Page=1'><font style='font-size: 14px; font-family: Webdings'>9</font></a> ")
  207.   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> ")
  208.   if(pagenmax>pagec) then pagenmax=pagec
  209.   for i = pagenmin to pagenmax
  210. if(i=page) then
  211.   response.write (" <font color='red'>"& i &"</font> ")
  212. else
  213.   response.write ("[<a href="& myself &"Page="& i &">"& i &"</a>]")
  214. end if
  215.   next
  216.   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> ")
  217.   if(page<pagec) then response.write ("<a href='"& myself &"Page="& pagec &"'><font style='font-size: 14px; font-family: Webdings'>:</font></a> ")
  218.   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
  219.   Response.Write "<input name='submitSkip' type='button' onClick='GoPage("""&Myself&""")' value='转到'>" & vbCrLf
  220.   Response.Write "</td>" & vbCrLf
  221.   Response.Write "</tr>" & vbCrLf
  222.   Response.Write "</table>" & vbCrLf
  223.   rs.close
  224.   set rs=nothing
  225.   Response.Write "</td>" & vbCrLf
  226.   Response.Write "</tr>" & vbCrLf
  227. end Function
  228. Function TextPath(ID)
  229.   Dim rs,sql
  230.   Set rs=server.CreateObject("adodb.recordset")
  231.   sql="Select * From Wygkcnflash_ProductSort where ID="&ID
  232.   rs.open sql,conn,1,1
  233.   TextPath=" -> <a href=ProductList.asp?SortID="&rs("ID")&"&SortPath="&rs("SortPath")&">"&rs("SortNameCH")&"</a>"
  234.   if rs("ParentID")<>0 then TextPath rs("ParentID")
  235.   response.write(TextPath)
  236. End Function
  237. Function SortText(ID)
  238.   Dim rs,sql
  239.   Set rs=server.CreateObject("adodb.recordset")
  240.   sql="Select * From Wygkcnflash_ProductSort where ID="&ID
  241.   rs.open sql,conn,1,1
  242.   SortText=rs("SortNameCH")
  243.   rs.close
  244.   set rs=nothing
  245. End Function
  246. Function ViewGroupName(GruopID)
  247.   dim rs,sql
  248.   set rs = server.createobject("adodb.recordset")
  249.   sql="select GroupID,GroupNameCH from Wygkcnflash_MemGroup where GroupID='"&GruopID&"'"
  250.   rs.open sql,conn,1,1
  251.   if rs.bof and rs.eof then
  252.     ViewGroupNameSi="未设组别"
  253.   else
  254.     ViewGroupName=rs("GroupNameCH")
  255.   end if
  256.   rs.close
  257.   set rs=nothing
  258. end Function
  259. %>