📄 admin_check.asp
字号:
<%@ codepage ="936" %><%if instr(session("flag"),"22")=0 thenresponse.redirect "../login.asp"response.endend if%><!--#include file="../../conn/dbconn2.asp" --><link rel="stylesheet" type="text/css" href="../style.css"><body bgcolor="#FFFFFF" marginheight=0 marginwidth=0 leftmargin=0><script language="javascript">function show_set(mylink){window.open(mylink,"new",'top=110,left=280,width=240,height=60,scrollbars=no')}</script><%dim totalPut dim CurrentPagedim TotalPagesdim i,jconst MaxPerPage=8if not isempty(request("page")) thencurrentPage=cint(request("page"))elsecurrentPage=1end ifif not isempty(request("selAnnounce")) thenidlist=request("selAnnounce")if instr(idlist,",")>0 thendim idarridArr=split(idlist)dim idfor i = 0 to ubound(idarr)id=clng(idarr(i))call deleteannounce(id)nextelsecall deleteannounce(clng(idlist))end ifend if dim rsdim sqlsearch=request("search")set rs=server.createobject("adodb.recordset") sql="select * from spzs where flag=1"if search=1 thensql=sql & " and cpmc like '%"&request("txtitle")&"%'"elsesql=sql & " and sccj like '%"&request("txtitle")&"%'"end if sql=sql & "order by ID desc"rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write "<p align='center'>对不起,没有您要查询的信息</p>" 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 if currentPage=1 then showContent totalput,MaxPerPageshowpage totalput,MaxPerPage,"Admin_Check.ASP"else if (currentPage-1)*MaxPerPage<totalPut then rs.move (currentPage-1)*MaxPerPage dim bookmark bookmark=rs.bookmark showContent totalput,MaxPerPageshowpage totalput,MaxPerPage,"Admin_Check.ASP"else currentPage=1 showContent totalput,MaxPerPageshowpage totalput,MaxPerPage,"Admin_Check.ASP"end if end if rs.close end if set rs=nothingsub showContent (totalput,MaxPerPage)%><center><TABLE border=0 cellPadding=3 cellSpacing=1 width="600"><TBODY><Form name="search" method="POST" action="Admin_Check.ASP"><TR><TD height=30><font color="#ff0000">点击产品名称进行相应操作</font></td><TD><td><IMG border=0 src="../images/search.gif"></td><TD> 搜索关键字:<input type="text" name="txtitle" size="25" style="font-size: 9pt"> <select style="font-size: 9pt" name="search"><option value="" selected>--选择类别--</option><option value="1">产品名称</option><option value="2">生产厂家</option> end select<INPUT align=absMiddle border=0 src="../images/search1.gif" type=image></td></TR></FORM></TBODY></TABLE><BR><BR><CENTER><TABLE border="0" cellspacing="1" width="600" cellpadding="4"><TBODY><Form name="searchuser" method="POST" action="Admin_Check.ASP"><TR height=25 bgcolor="#e8f4ff"> <TD width="45" align="left"><font color="#Ff6600"><b>编号</b></TD><TD width="200" align="center"><font color="#Ff6600"><b>产品名称</b></TD><TD align=middle width="250"><font color="#Ff6600"><b>生产厂家</b></TD><TD width="80" align="center"><font color="#Ff6600"><b>修改</b></TD><TD width="55" align="center"><input type='submit' value='删除'></TD></TR><%DO while not rs.eof%><TR height="25" bgcolor="#ffffff"> <TD width="45" align="left"><font face="Arial"><b><%=rs("id")%></b></font></TD><TD width="220"><a href=edit.asp?id=<%=rs("id")%>><%=rs("cpmc")%></a></TD><TD align=left width="300"><%=rs("sccj")%></TD><TD width="80" align="center"><a href='javascript:show_set("set.asp?id=<%=rs("id")%>")'><img src="../images/m_olds.gif" border=0></a></TD><TD width="55" align="center"><input type='checkbox' name='selAnnounce' value='<%=cstr(rs("ID"))%>'></td></TR><% i=i+1if i>=MaxPerPage then exit dors.movenextloop%></FORM></TABLE></center><%end subfunction showpage(totalnumber,maxperpage,filename) dim n if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if if CurrentPage<2 then response.write "<table border=0 width=600 cellspacing=0 cellpadding=0 bgcolor=#e8f4ff>" response.write "<tr height=30>"response.write "<td align=left>"response.write "共<font color=#ff6600><b>"&n&"</b></font>页 第<font color=#ff6600><b>"&CurrentPage&"</b></font>页 共检索到<font color=#ff6600><b>"&totalnumber&"</b></font>条相关信息</td>" response.write "<td align=right>"response.write "【最前页】【上一页】" else response.write "<table border=0 width=600 cellspacing=0 cellpadding=0 bgcolor=#e8f4ff>"response.write "<tr height=30>"response.write "<td align=left>"response.write "共<font color=#ff6600><b>"&n&"</b></font>页 第<font color=#ff6600><b>"&CurrentPage&"</b></font>页 共检索到<font color=#ff6600><b>"&totalnumber&"</b></font>条相关信息</td>" response.write "<td align=right>"response.write "【<a href="&filename&"?page=1&search="&search&"&txtitle="&request("txtitle")&">最前页</a>】" response.write "【<a href="&filename&"?page="&CurrentPage-1&"&search="&search&"&txtitle="&request("txtitle")&">上一页</a>】 " end if if n-currentpage<1 then response.write "【下一页】【最后页】" else response.write "【<a href="&filename&"?page="&(CurrentPage+1)&"&search="&search&"&txtitle="&request("txtitle")&">" response.write "下一页</a>】【<a href="&filename&"?page="&n&"&search="&search&"&txtitle="&request("txtitle")&">最后页</a>】" end if response.write "</form>" response.write "</td>"response.write "</tr>"response.write "</table>"end functionsub deleteannounce(id)dim rs,sqlset rs=server.createobject("adodb.recordset")sql="delete from [spzs] where id="&cstr(id)conn.execute sqlif err.Number<>0 thenerr.clearresponse.write "删 除 失 败 !<br>"end ifEnd sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -