📄 default.asp
字号:
<%@ codepage ="936" %><%if instr(session("flag"),"54")=0 thenresponse.redirect "../login.asp"response.endend if%><!--#include file="../../conn/dbconn2.asp" --><!--#include file="../config.asp"--><link rel="stylesheet" type="text/css" href="../style.css"><body bgcolor="#FFFFFF" marginheight=0 marginwidth=0 leftmargin=0><SCRIPT>function view(url){ var url; window.open(url,'_blank','status=no,scrollbars=yes,top=20,left=110,width=600,height=460'); }</SCRIPT></script><%dim totalPut dim CurrentPagedim TotalPagesdim i,jif not isempty(request("page")) thencurrentPage=cint(request("page"))elsecurrentPage=1end ifdim rsdim sqlif 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 typeid=request("typeid")set rs=server.createobject("adodb.recordset") if typeid="" thensql="select * from commerce where Title like '%"&request("txtitle")&"%' order by NewsID desc"elsesql="select * from commerce where Title like '%"&request("txtitle")&"%' and typeid="+cstr(typeid)+" order by NewsID desc"end ifrs.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 showContentshowpage totalput,MaxPerPage,"default.asp"else if (currentPage-1)*MaxPerPage<totalPut then rs.move (currentPage-1)*MaxPerPage dim bookmark bookmark=rs.bookmark showContentshowpage totalput,MaxPerPage,"default.asp"else currentPage=1 showContentshowpage totalput,MaxPerPage,"default.asp"end if end if rs.close end if set rs=nothingsub showContent%><center><TABLE border=0 cellPadding=3 cellSpacing=0 width="600" style="border-collapse: collapse" bordercolor="#111111"><TBODY><TR bgcolor="#ffffcc"> <TD align=left bgcolor="#FFFFFF"> <form name="search" method="POST" action="default.asp"><p align="center"><img src="../images/search.gif"> 搜索关键字:<input type="text" name="txtitle" size="25" style="font-size: 9pt"> <select style="font-size: 9pt" name="typeid"><option value="" selected>--选择类别--</option><option value="1">职业培训</option><option value="2">营销技巧</option><option value="3">企业管理</option><option value="4">法律咨询</option><option value="5">合同样本</option><option value="6">规章制度</option><option value="7">WTO专栏</option>end select</font></select> <INPUT align=absMiddle border=0 src="../images/search1.gif" type=image name="I2"></p></td></TR></TBODY></TABLE> <TABLE width="600" border="0" cellspacing="0" cellpadding="2"><TR><TD><a href="add.asp"><img border=0 alt="录入信息数据" src="../images/add.gif"></a></TD></TR> </TABLE><CENTER><table border="1" cellspacing="0" width="600" cellpadding="4" bordercolorlight="#CAE6FF" bordercolordark="#CAE6FF" style="border-collapse: collapse" bordercolor="#111111"><tr height=25 bgcolor="#cccccc"> <td width="45" align="left" bgcolor="#F0F8FF"><font color="#Ff6600"><b>ID号</b></font></td><td width="335" align="center" bgcolor="#F0F8FF"><font color="#Ff6600"><b>文章标题</b></font></td><td width="80" align="center" bgcolor="#F0F8FF"><font color="#Ff6600"><b>所属类型</b></font></td><td width="55" align="center" bgcolor="#F0F8FF"><font color="#Ff6600"><b>修改</b></font></td><td width="55" align="center" bgcolor="#F0F8FF"><input type='submit' value='删除'></td></tr><%do while not rs.eof%><tr height="20" bgcolor="#ffffff"> <td width="45" align="left"><font face="Arial"><b><%=rs("newsid")%></b></font> </td><td width="335"><a href=javascript:view('shownews.asp?newsid=<%=rs("newsid")%>')><%=rs("title")%></a> </td><td width="80" align="center"><%=rs("typename")%> </td><td width="55" align="center"><a href=edit.asp?Newsid=<%=rs("Newsid")%>><img border="0" src="../images/edit.gif"></a></td><td width="55" align="center"><input type='checkbox' name='selAnnounce' value='<%=cstr(rs("newsid"))%>'></td></tr><% i=i+1if i>=MaxPerPage then exit dors.movenextloop%></table></center><%end subfunction showpage(totalnumber,maxperpage,filename)dim nif 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>" response.write "<tr height=30><td align=left width=80>"response.write "<a href=add.asp><img border=0 alt=添加数据 src=../images/add.gif></td>"response.write "<td align=right>"response.write "共<font color=#ff6600><b>"&n&"</b></font>页 第<font color=#ff6600><b>"&CurrentPage&"</b></font>页 共检索到<font color=#ff6600><b>"&totalnumber&"</b></font>条 " response.write "最前页 上一页" else response.write "<table border=0 width=600 cellspacing=0 cellpadding=0>"response.write "<tr height=30><td align=left width=80>"response.write "<a href=add.asp><img border=0 alt=添加数据 src=../images/add.gif></td>"response.write "<td align=right>"response.write "共<font color=#ff6600><b>"&n&"</b></font>页 第<font color=#ff6600><b>"&CurrentPage&"</b></font>页 共检索到<font color=#ff6600><b>"&totalnumber&"</b></font>条 " response.write " <a href="&filename&"?page=1&typeid="&typeid&"&txtitle="&request("txtitle")&">最前页</a>" response.write " <a href="&filename&"?page="&CurrentPage-1&"&typeid="&typeid&"&txtitle="&request("txtitle")&">上一页</a> " end if if n-currentpage<1 then response.write "下一页 最后页" else response.write " <a href="&filename&"?page="&(CurrentPage+1)&"&typeid="&typeid&"&txtitle="&request("txtitle")&">" response.write "下一页</a> <a href="&filename&"?page="&n&"&typeid="&typeid&"&txtitle="&request("txtitle")&">最后页</a>" end if response.write "</td>"response.write "</tr>"response.write "</table>"response.write "</form>"end functionsub deleteannounce(id)dim rs,sqlset rs=server.createobject("adodb.recordset")sql="delete from [commerce] where newsid="&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 + -