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

📄 bs_add.asp

📁 好用的管理,代码程序 好用的管理,代码程序
💻 ASP
字号:
<!--#include file="config.asp"-->
<!--#include file="Inc/Ubbcode.asp"-->
<!--#include file="Inc/Function.asp"-->
<!--#include file="Conn.asp"-->
<%
dim strFileName
const MaxPerPage=20
dim totalPut,CurrentPage,TotalPages
dim i,j
dim ArticleID
dim Title1
dim sql
dim BigClassName,SmallClassName,SpecialName
dim PurviewChecked
dim strAdmin,arrAdmin

PurviewChecked=false
strFileName="bs_add.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName & "&SpecialName=" & SpecialName

Title1=Trim(request("Title"))
ArticleID=Request("ArticleID")
BigClassName=Trim(request("BigClassName"))
SmallClassName=Trim(request("SmallClassName"))
SpecialName=trim(request("SpecialName"))

if request("page")<>"" then
    currentPage=cint(request("page"))
else
	currentPage=1
end if

sql="select * from Bs_Product where ArticleID>0"
if session("purview")>4 then
	sql=sql & " and Editor='" & Session("admin") & "' and Passed=false"
end if
if Title1<>"" then
	sql=sql & " and Title like '%" & Title1 & "%' "
end if
if BigClassName<>"" then
	sql=sql & " and BigClassName='" & BigClassName & "' "
	if SmallClassName<>"" then
		sql=sql & " and SmallClassName='" & SmallClassName & "' "
	end if
else
	if SpecialName<>"" then
		sql=sql & " and SpecialName='" & SpecialName & "' "
	end if
end if
sql=sql & " order by articleid desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
%>
	  
<!-- #include file="Inc/Head.asp" -->
<BR>
<table cellpadding="2" cellspacing="1" border="0" width="91%" align="center" class="a2">
	<tr>
		<td class="a1" height="25" align="center"><strong>添 加  <strong> 石 材 </strong>订 单  </strong></td>
  </tr>
	<tr class="a4">
		<td align="center">
      <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" >
        <tr class="Title1">
          <td bgcolor="#F0F0F0" height="25"><table width="100%" border="0" cellpadding="0" cellspacing="0" >
            <tr class="tdbg">
              <form name="searchsoft" method="get" action="bs_add.asp">
                <td height="25" bgcolor="#F0F0F0"><strong>&nbsp;查找</strong>
                    <input name="Title" type="text" class=smallInput id="Title3" size="20" maxlength="50">
                    <input name="Query" type="submit" id="Query" value="查 询">
                    请输入名称后按查询,如果为空,查找所有。
                  <label></label></td>
              </form>
            </tr>
          </table></td>
        </tr>
        
        <tr class="Title1"> 
          <td bgcolor="#F0F0F0" height="25">|&nbsp; 
            <%
dim sqlBigClass,sqlSmallClass,rsBigClass,rsSmallClass,sqlSpecial,rsSpecial
sqlBigClass="select * from Bs_PrBigClass"
Set rsBigClass= Server.CreateObject("ADODB.Recordset")
rsBigClass.open sqlBigClass,conn,1,1
if rsBigClass.eof then 
	response.Write("还没有任何栏目,请首先添加栏目。")
end if
do while not rsBigClass.eof
	if rsBigClass("BigClassName")=BigClassName then
		response.Write("<a href='bs_add.asp?BigClassName=" & rsBigClass("BigClassName") & "'><font color='red'>" & rsBigClass("BigClassName") & "</font></a> | ")
		if session("purview")=3 then
			strAdmin=rsBigClass("Admin")
			if Instr(strAdmin,"|")>0 then
				arrAdmin=split(strAdmin)
				for i=0 to ubound(arrAdmin)
					if trim(arrAdmin(i))=session("admin") then
						PurviewChecked=True
						exit for
					end if
				next
			else
				if trim(strAdmin)=session("Admin") then
					PurviewChecked=True
				end if
			end if
		end if
	else
		response.Write("<a href='bs_add.asp?BigClassName=" & rsBigClass("BigClassName") & "'>" & rsBigClass("BigClassName") & "</a> | ")
	end if
	rsBigClass.movenext
loop
rsBigClass.close
set rsBigClass=nothing
%>          </td>
        </tr>
        <%
if BigClassName<>"" then
	sqlSmallClass="select * from Bs_PrSmallClass where BigClassName='" & BigClassName & "'"
	Set rsSmallClass= Server.CreateObject("ADODB.Recordset")
	rsSmallClass.open sqlSmallClass,conn,1,1
	if not (rsSmallClass.bof and rsSmallClass.eof) then
		response.write "<tr '><td bgcolor='#F0F0F0'>"
		do while not rsSmallClass.eof
			if rsSmallClass("SmallClassName")=SmallClassName then
				response.Write("&nbsp;<a href='bs_add.asp?BigClassName=" & rsSmallClass("BigClassName") & "&SmallClassName=" & rsSmallClass("SmallClassName") & "'><font color='red'>" & rsSmallClass("SmallClassName") & "</font></a>&nbsp;&nbsp;")
				if session("purview")=4 then
					strAdmin=rsSmallClass("Admin")
					if Instr(strAdmin,"|")>0 then
						arrAdmin=split(strAdmin)
						for i=0 to ubound(arrAdmin)
							if trim(arrAdmin(i))=session("admin") then
								PurviewChecked=True
								exit for
							end if
						next
					else
						if trim(strAdmin)=session("Admin") then
							PurviewChecked=True
						end if
					end if
				end if
			else
				response.Write("&nbsp;<a href='bs_add.asp?BigClassName=" & rsSmallClass("BigClassName") & "&SmallClassName=" & rsSmallClass("SmallClassName") & "'>" & rsSmallClass("SmallClassName") & "</a>&nbsp;&nbsp;")
			end if
			rsSmallClass.movenext
		loop
		response.write "</td></tr>"
	end if
	rsSmallClass.close
	set rsSmallClass=nothing
end if
%>
      </table>
       <table width="100%" border="0" cellpadding="2" cellspacing="1">
          <tr> 
            <td width="892" height="25" bgcolor="#CCCCCC"><a href="Bs_Article.asp">&nbsp;管理</a> 
              &gt;&gt; 
            <%
if request.querystring="" then
	response.write "所有"
else
	if request("Query")<>"" then
		if Title1<>"" then
			response.write "名称中含有“<font color=blue>" & Title1 & "</font>”的"
		else
			response.Write("所有")
		end if
 	else
		if BigClassName<>"" then
			response.write "<a href='bs_add.asp?BigClassName=" & BigClassName & "'>" & BigClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
			if SmallClassName<>"" then
				response.write "<a href='bs_add.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName & "'>" & SmallClassName & "</a>"
			else
				response.write "所有小类"
			end if
		end if
		if SpecialName<>"" then
			response.write "<font color=red>[专题]</font> " & SpecialName
		end if
	end if
end if
%>            </td>
            <td width="140" bgcolor="#F0F0F0">&nbsp;
            <%
  	if rs.eof and rs.bof then
		response.write "共找到 0 个</td></tr></table>"
	else
    	totalPut=rs.recordcount
		if currentpage<1 then
       		currentpage=1
    	end if
    	if (currentpage-1)*MaxPerPage>totalput then
	   		if (totalPut mod MaxPerPage)=0 then
	     		currentpage= totalPut \ MaxPerPage
		  	else
		      	currentpage= totalPut \ MaxPerPage + 1
	   		end if

    	end if
		response.Write "共找到 " & totalPut & " 个"
%>            </td>
          </tr>
        </table>
        <%		
	    if currentPage=1 then
        	showContent
        	showpage strFileName,totalput,MaxPerPage,true,false,"个"
   	 	else
   	     	if (currentPage-1)*MaxPerPage<totalPut then
         	   	rs.move  (currentPage-1)*MaxPerPage
         		dim bookmark
           		bookmark=rs.bookmark
            	showContent
            	showpage strFileName,totalput,MaxPerPage,true,false,"个"
        	else
	        	currentPage=1
           		showContent
           		showpage strFileName,totalput,MaxPerPage,true,false,"个"
	    	end if
		end if
	end if
%>
        <%  
sub showContent
   	dim i
    i=0
%>
        <table  border="0" cellspacing="1" width="100%" cellpadding="2" style="word-break:break-all">
          <tr bgcolor="#F0F0F0" class="Title1"> 
            <td width="80" height="25" align="center" bgcolor="#F0F0F0"><strong>我方名称</strong></td>
            <td width="138" align="center" bgcolor="#F0F0F0" ><strong>工厂名称</strong></td>
            <td width="132" align="center" ><strong>主要特征或说明</strong></td>
            <td width="137" align="center" ><strong>图片预览</strong></td>
            <td width="175" align="center" ><strong>操作</strong></td>
          </tr>
          <%do while not rs.eof%>
          <tr class="tdbg"> 
            <td width="80" height="22" align="center" bgcolor="#F0F0F0"><%=rs("Product_Id")%></td>
            <td bgcolor="#F0F0F0">&nbsp;<a href="Bs_ProductShow.asp?ArticleID=<%=rs("articleid")%>" target="_blank"><%=rs("Title")%></a></td>
            <td width="132" align="center" bgcolor="#F0F0F0"><%=rs("bs_Content")%></td>
            <td width="137" align="center" bgcolor="#F0F0F0"><img src="<%=rs("DefaultPicUrl")%>" alt="" width="50" height="50" /></td>
            <td width="175" align="center" bgcolor="#F0F0F0"><a href="bs_eshop.asp?Product_Id=<%=rs("Product_Id")%>"target="_blank">添加到第<span style="color: #FF0000"><%=request.cookies("ddh")%></span>号订单</td>
          </tr>
		  
          <%
	i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	loop
%>
        </table>
        <%
   end sub 
%>
      </form>
      <BR>		</td>
	</tr>
</table>
<BR>
<%
rs.close
set rs=nothing  
call CloseConn()
%>
<%response.end%>

⌨️ 快捷键说明

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