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

📄 admsort.asp

📁 商务网站,信息分类,可以搜索加上ACCESS数据库
💻 ASP
字号:
<%Option Explicit%>
<!--#include file="CONFIG.ASP"-->
<!--#include file="adoconn.asp"-->
<!--#include file="functions.asp"-->

<%
dim sql,objRS,objRS_path
dim sortid
dim i
dim thispath,p,tmp1,tmp2,tmp3
dim tmpid,tmpsortname,comment
dim pagecount,currpage,Spage,Epage,recordcount

sortid = Request.QueryString("sortid")
currpage = request.querystring("currpage")
if sortid = "" or not IsNumeric(sortid) then
    Response.Write("错误参数")
    Response.End
else
    sql = "select * from sort where parentID = " & Clng(sortid)
    Set objRS = Server.CreateObject("ADODB.RecordSet")
    objRS.Open sql,objConn,3,1
    sql = "select * from pathform where thispath like '%" & sortid & "'"
    Set objRS_path = objConn.Execute(sql)
    if not objRS_path.EOF then
        tmp1 = objRS_path("thispath")
        tmp2 = objRS_path("pathname")
        tmp3 = tmp2
        p = tmp2
        thispath = GetPath(tmp1,tmp2,TRUE)
        p = "<a href=""admclass.asp?sortid=" & sortid & """>首页∷" & Replace(p,chr(255),"∷") & "</a>"
        p = Server.URLEncode(p)
        tmp3 = right(tmp3,len(tmp3) - instrrev(tmp3,chr(255)))
        tmp3 = Server.HTMLEncode("<a href=""admclass.asp?sortid=" & sortid & """ target=""searchtop"">" & tmp3 & "</a>")
    end if
end if
if currpage = "" or IsNull(currpage) then currpage = 1
if not IsNumeric(currpage) then currpage = 1
currpage = Cint(currpage)
%>
<%
Response.Write("<form name=""searchbtmform"" action=""admbtm.asp"" method=""GET"" target=""searchbtm""><input type=""hidden"" name=""sortid"" value=""" & sortid & """><input type=""hidden"" name=""p"" value=""" & tmp3 & """></form>")
Response.Write("<script language=""JavaScript"">document.searchbtmform.submit()</script>")
%>


<HTML>
<HEAD>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<title>个人主页搜索系统</title>
<style>
<!--
form         { margin-bottom: 10 }
ul           { margin-top: 2; margin-bottom: 2 }
.top        { font-size: 10.5pt; color: red; text-decoration: none }
.top:hover  { color: yellow; text-decoration: none }
.top:visited{ color: #c0c0c0; text-decoration: underline }
.e1         { color: #c0c0c0; }
-->
</style>
<script language="JavaScript">
<!--
function mksure(sortname) {
    return(confirm('\n请三思而行!!!\n\n真的要删除 [ ' + sortname + ' ] 及其下面的所有分类和站点吗?\n\n注意,仅此一次确认!\n'));
}

function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }
function CheckAll2(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall2')
       e.checked = form.chkall2.checked;
    }
  }
function mksure2() {
    if(confirm("\n真的要删除所有选中的站点吗?     \n\n")) {
        delstaform.submit();
    }
}
//-->
</script>
</HEAD>

<body bgcolor="#FFFFFF">
<table border="0" width="100%" bgcolor="#FFFFFF" height="20" cellspacing="0" cellpadding="2">
  <tr bgcolor="cccc99"> 
    <td width="100%" height="3"><a href="admsort1.asp">首页</a><%=thispath%></td>
  </tr>
</table>
<br>
<b>分类!</b>
<%'//////////////////////////////////////  输出类名  ///////////////////////////////////////%>
<table width="100%" cellspacing="" cellpadding="" height="50">
<%do while not objRS.EOF%>
  <tr>
    <td width="33%" height="18" valign="top">             
        <ul>
          <li><%tmpid = objRS("ID") : tmpsortname = objRS("sortname") : comment = objRS("description") : if not IsNull(comment) then comment = Server.URLEncode(comment)%>
          <a href="admclass.asp?sortid=<%=tmpid%>" title="<%=objRS("description")%>"><%=tmpsortName%></a>(子类:<%=objRS("totalchild")%>)
          <br>&nbsp;&nbsp;<a href="renameclass.asp?sortid=<%=tmpid%>&parentid=<%=sortid%>&sortname=<%=Server.URLEncode(tmpsortname)%>&comment=<%=comment%>" class="top">编辑</a>|<a href="../2008admin/delclass.asp?sortid=<%=tmpid%>&parentid=<%=sortid%>" class="top" onclick="return(mksure('<%=Replace(tmpsortname,"'","’")%>'))">删除</a>|<a href="shortcut.asp?sortid=<%=tmpid%>&sortname=<%=Server.URLEncode(tmpsortname)%>&comment=<%=comment%>" class="top">首页显示</a>
          </li>       
        </ul>
    </td>
    <%objRS.MoveNext()%>
    <td width="33%" height="18" valign="top">
      <%if not objRS.EOF then%>
        <ul>
          <li><%tmpid = objRS("ID") : tmpsortname = objRS("sortname") : comment = objRS("description") : if not IsNull(comment) then comment = Server.URLEncode(comment)%>
          <a href="admclass.asp?sortid=<%=tmpid%>" title="<%=objRS("description")%>"><%=tmpsortName%></a>(子类:<%=objRS("totalchild")%>)
          <br>&nbsp;&nbsp;<a href="renameclass.asp?sortid=<%=tmpid%>&parentid=<%=sortid%>&sortname=<%=Server.URLEncode(tmpsortname)%>&comment=<%=comment%>" class="top">编辑</a>|<a href="../2008admin/delclass.asp?sortid=<%=tmpid%>&parentid=<%=sortid%>" class="top" onclick="return(mksure('<%=Replace(tmpsortname,"'","’")%>'))">删除</a>|<a href="shortcut.asp?sortid=<%=tmpid%>&sortname=<%=Server.URLEncode(tmpsortname)%>&comment=<%=comment%>" class="top">首页显示</a>
          </li>      
        </ul>   
      <%objRS.MoveNext()%>   
      <%end if%>
    </td>       
    <td width="34%" height="18" valign="top">           
      <%if not objRS.EOF then%>
        <ul>
          <li><%tmpid = objRS("ID") : tmpsortname = objRS("sortname") : comment = objRS("description") : if not IsNull(comment) then comment = Server.URLEncode(comment)%>
          <a href="admclass.asp?sortid=<%=tmpid%>" title="<%=objRS("description")%>"><%=tmpsortName%></a>(子类:<%=objRS("totalchild")%>)
          <br>&nbsp;&nbsp;<a href="renameclass.asp?sortid=<%=tmpid%>&parentid=<%=sortid%>&sortname=<%=Server.URLEncode(tmpsortname)%>&comment=<%=comment%>" class="top">编辑</a>|<a href="../2008admin/delclass.asp?sortid=<%=tmpid%>&parentid=<%=sortid%>" class="top" onclick="return(mksure('<%=Replace(tmpsortname,"'","’")%>'))">删除</a>|<a href="shortcut.asp?sortid=<%=tmpid%>&sortname=<%=Server.URLEncode(tmpsortname)%>&comment=<%=comment%>" class="top">首页显示</a>
          </li>      
        </ul>   
      <%objRS.MoveNext()%>
      <%end if%>
    </td>           
  </tr>
<%loop%>
</table>
<%'/////////////////////////////////////////////  取相关网站集  /////////////////////////////////////%>
<%
objRS.Close()
sql = "select * from stationinfo where ispass = TRUE and parentID = " & sortid & " order by id DESC"
objRS.Open sql, objConn, 3, 1

recordcount = objRS.RecordCount
objRS.PageSize = PAGESIZE
pagecount = objRS.PageCount
if currpage < 1 then
    currpage = 1
elseif currpage > pagecount then
    currpage = pagecount
end if
%>
<p>
<table border="0" width="754" cellspacing="0" cellpadding="2" bgcolor="#CCCC99">
  <tr>    
    <td width="660"><b>相关网站(<%=objRS.RecordCount%>)</b></td>    
    <td width="78"><a href="../2008admin/admregsta1.asp?sortid=<%=sortid%>">登记网站</a></td>    
  </tr>    
</table>
<%if not objRS.EOF then%>

<form name="delstaform" action="delsta.asp" method="POST">
<input type="hidden" name="sortid" value="<%=sortid%>">
<%
'========================================实现翻页=============================
if pagecount > 1 then
    Response.Write("<font color=red>" & currpage & "</font>/" & pagecount & " " & VbCrlf)
    Spage = currpage mod PARTSIZE
    if currpage > PARTSIZE then
        if Spage = 0 then Spage = PARTSIZE
        Spage = currpage - Spage + 1
    else
        Spage = 1
    end if
    Epage = Spage + PARTSIZE - 1
    if Epage > pagecount then Epage = pagecount
    if currpage > PARTSIZE then
        response.write("<a href=""admclass.asp?sortID=" & sortID & "&currpage=" & Spage - 1 & """>前" & PARTSIZE & "页</a>" & VbCrlf)
    end if
    for i = Spage to Epage
        if i = currpage then
            response.write("[<font style={color:red}><b>" & i & "</b></font>]" & VbCrlf)
        else
            response.write("[<a href=""admclass.asp?sortID=" & sortID & "&currpage=" & i & """>" & i & "</a>]" & VbCrlf)
        end if
    next
    if Epage < pagecount then
        response.write("<a href=""admclass.asp?sortID=" & sortID & "&currpage=" & Epage + 1 & """>后" & PARTSIZE & "页</a>" & VbCrlf)
    end if
    if Spage <> 1 then response.write("[<a href=""admclass.asp?sortID=" & sortID & "&currpage=1"">第一页</a>]")
    if Epage <> pagecount then response.write("[<a href=""admclass.asp?sortID=" & sortID & "&currpage=" & pagecount & """>最末页</a>]" & VbCrlf)
    response.write("<br><br>")
end if
%>
<span class="top"><input type="checkbox" name="chkall" onclick="CheckAll(this.form)">选中所有站点</span>&nbsp;&nbsp;<input type="button" value="删除选中的站点" onclick="mksure2()"><br>
<%

'//////////////////////////////////////////////  输出相关网站  ////////////////////////////////////
Response.Write("<ul>" & VbCrlf)
if not objRS.EOF then objRS.AbsolutePage = currpage
for i = 1 to PAGESIZE
	if objRS.EOF then exit for
	Response.Write("<LI type=""disc"">")
	Response.Write("<input type=""checkbox"" name=""staid"" value=""" & objRS("ID") & """>[<a href=""modify1.asp?staid=" & objRS("ID") & "&p=" & p & """ class=""top"">编辑</a>]" & VbCrlf)
	Response.Write("<a href=""" & objRS("stationurl") & """ target=""_blank"">" & objRS("stationname") & "</a> <b>" & objRS("stationlang") & "</b>" & VbCrlf)
	Response.Write("    <dl>" & VbCrlf)
	Response.Write("        <dd>" & objRS("description") & "<br><font style={font-size:10.5pt;color:#c0c0c0}>——<i> <a href=""mailto:" & objRS("email") & """ class=""e1"">(" & objRS("whopost") & ")</a>" &  objRS("thisdate") & " 点击:" & objRS("visitcount") & "</i></font>" & VbCrlf)
	Response.Write("    </dl>" & VbCrlf)
	Response.Write("</li>" & VbCrlf)
	objRS.MoveNext()
next
Response.Write("</ul>" & VbCrlf)
%>
<span class="top"><input type="checkbox" name="chkall2" onclick="CheckAll2(this.form)">选中所有站点</span>&nbsp;&nbsp;<input type="button" value="删除选中的站点" onclick="mksure2()" id=button1 name=button2><br>
<%
if pagecount > 1 then
    Response.Write("<br>")
    Response.Write("<font color=red>" & currpage & "</font>/" & pagecount & " " & VbCrlf)
    if currpage > PARTSIZE then
        response.write("<a href=""admclass.asp?sortID=" & sortID & "&currpage=" & Spage - 1 & """>前" & PARTSIZE & "页</a>" & VbCrlf)
    end if
    for i = Spage to Epage
        if i = currpage then
            response.write("[<font style={color:red}><b>" & i & "</b></font>]" & VbCrlf)
        else
            response.write("[<a href=""admclass.asp?sortID=" & sortID & "&currpage=" & i & """>" & i & "</a>]" & VbCrlf)
        end if
    next
    if Epage < pagecount then
        response.write("<a href=""admclass.asp?sortID=" & sortID & "&currpage=" & Epage + 1 & """>后" & PARTSIZE & "页</a>" & VbCrlf)
    end if
    if Spage <> 1 then response.write("[<a href=""admclass.asp?sortID=" & sortID & "&currpage=1"">第一页</a>]")
    if Epage <> pagecount then response.write("[<a href=""admclass.asp?sortID=" & sortID & "&currpage=" & pagecount & """>最末页</a>]" & VbCrlf)
    response.write("<br>")    
end if
%>
</form>
<%end if%>
<br><center>
<hr noshade size=1>
<!--#include file="copyright.asp"-->
</body>     
     
</html>     
<%
objConn.Close()
Set objRS = nothing
Set objRS_path = nothing
Set objConn = nothing
%>

⌨️ 快捷键说明

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