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

📄 guanli.asp

📁 一个人用ASP+SQL制作的个人博客
💻 ASP
字号:

<%@ LANGUAGE = VBScript.Encode %>
<!--#include file="security.asp"-->
<!--#include file="articleconn.asp"-->
<!--#include file="home1.asp"-->
<%
dim zhuid,typeid
zhuid = Request.QueryString("zhuid")
typeid = Request.QueryString("typeid")
if zhuid="" then
Response.Write("错误参数")
Response.End
else
set rs2=server.createobject("adodb.recordset")
sql2="select * from zhu where zhuid="&zhuid
rs2.open sql2,conn,1,1
zhu=rs2("zhu")
rs2.close
set rs3=server.createobject("adodb.recordset")
sql3="select * from type where typeid="&typeid
rs3.open sql3,conn,1,1
types=rs3("type")
rs3.close%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=rs1("homes")%>=><%=rs1("home")%></title><link rel="stylesheet" type="text/css" href="css/style.css">
<body marginwidth="0" leftmargin="0" bgcolor="#666666" topmargin="0" marginheight="0" >
<center>
  <p>&nbsp;</p>
  <%if typeid <>"" then%> 
  <table width="760" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td><font class=3dfont><a href="mimi.asp">管理中心首页</a><img src="IMAGES/MORE.GIF" width="29" height="9"><a href="guanli.asp?zhuid=<%=zhuid%>"><%=zhu%></a><img src="IMAGES/MORE.GIF" width="29" height="9"><%=types%></font></td>
    </tr>
  </table><%else%>
  <table width="760" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td><font class=3dfont><a href="<%=rs1("url")%>"><%=rs1("homes")%></a><img src="IMAGES/MORE.GIF" width="29" height="9"><a href="index.asp"><%=rs1("home")%></a><img src="IMAGES/MORE.GIF" width="29" height="9"><%=zhu%></font></td>
    </tr>
  </table>
  <table width="760" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td valign="top"> <br>
        <%
sql="SELECT * FROM type WHERE zhuid='"&zhuid&"'"
Set rs2=Conn.Execute(sql)%>
        <%
do while not rs2.bof and not rs2.eof
%>
        <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr> 
            <td width="33%"><font class=3dfont><a href="guanli.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=navy><%=rs2("type")%></font></a></font></td>
            <%RS2.MoveNext%>
            <td width="33%"> 
              <%if not RS2.EOF then%>
              <font class=3dfont><a href="guanli.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=navy><%=rs2("type")%></font></a></font> 
              <%RS2.MoveNext%>
              <%end if%>
            </td>
            <td width="33%"> 
              <%if not RS2.EOF then%>
              <font class=3dfont><a href="guanli.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=navy><%=rs2("type")%></font></a></font> 
              <%RS2.MoveNext%>
              <%end if%>
            </td>
          </tr>
        </table>
        <%rs2.movenext
loop
rs2.close
set rs2=nothing%>
        <br>
      </td>
    </tr>
  </table>
  <%end if%>
  <%if typeid<>"" then%>
  <table width="760" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td width="160" valign="top"> 
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td> 
              <center>
                <font class="3dfont" color="#669900"><b> <%
if rs1("list1") <> "1"  then
else%> </b></font><font class="3dfont">☆相关分类☆</font> 
              </center>
            </td>
          </tr>
          <tr> 
            <td> 
              <%
sql="SELECT * FROM type WHERE zhuid='"&zhuid&"'"
Set rs2=Conn.Execute(sql)
if rs1("list")<>"1" then%>
              <center>
                <select name="select" onChange="javascript:window.location.href=this.options[this.selectedIndex].value">
                  <option>选择分类</option>
                  <%
do while not rs2.bof and not rs2.eof
%>
                  <option value=guanli.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>><%=rs2("type")%></option>
                  <%rs2.movenext
loop
rs2.close
set rs2=nothing%>
                </select>
              </center>
              <%else%>
              <%
do while not rs2.bof and not rs2.eof
%>
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td> 
                    <center>
                      <font class=3dfont><a href="guanli.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><%=rs2("type")%></a></font> 
                    </center>
                  </td>
                </tr>
              </table>
              <%rs2.movenext
loop
rs2.close
set rs2=nothing
end if
end if%>
            </td>
          </tr>
        </table>
        
      </td>
      <td valign="top"> 
        <%
   MaxPerPage=rs1("duo")
   dim totalPut,CurrentPage,TotalPages,i,j,page
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
sql="select * from learning where zhuid="&zhuid&" and typeid="&typeid&" order by articleid desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
 if rs.eof and rs.bof then
       response.write "<p align='center'> 还 没 有 任 何 电 影</p>"
   else
	  totalPut=rs.recordcount
      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
           showpage totalput,MaxPerPage,"guanli.asp"
            showContent
            showpage1 totalput,MaxPerPage,"guanli.asp"
       else
          if (currentPage-1)*MaxPerPage<totalPut then
            rs.move  (currentPage-1)*MaxPerPage
            dim bookmark
            bookmark=rs.bookmark
           showpage totalput,MaxPerPage,"guanli.asp"
            showContent
            showpage1 totalput,MaxPerPage,"guanli.asp"
        else
	        currentPage=1
          showpage totalput,MaxPerPage,"guanli.asp"
           showContent
           showpage1 totalput,MaxPerPage,"guanli.asp"
	      end if
	   end if
   rs.close
   end if
   set rs=nothing
   sub showContent
       dim i
	   i=0
          do while not rs.eof%>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="80">电影名称:</td>
            <td><a href="soft.asp?id=<%=rs("articleid")%>&typeid=<%=rs("typeid")%>&zhuid=<%=rs("zhuid")%>" target="_blank"><%=rs("title")%></a> 
              <%if RS("dateandtime")>=date() then response.write("&nbsp;&nbsp;&nbsp;<image src=images/new.gif>")%> 
              <%if RS("best") = true then response.write("&nbsp;&nbsp;&nbsp;<image src=images/tui.gif alt=站长推崇>")%> 
            </td>
            <td width="60"> 
              <div align="center"><a
    href="edit.asp?id=<%=rs("articleid")%>">修改</a></div>
            </td>
            <td width="60"> 
              <div align="center"><a
    href="delete.asp?id=<%=rs("articleid")%>">删除</a></div>
            </td>
          </tr>
        </table>
        <% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
 end sub 
function showpage(totalnumber,maxperpage,filename)
  dim n
  if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
  else
     n= totalnumber \ maxperpage+1
  end if
  Response.Write "<table border=""0"" cellspacing=""1"" width=""100%"">"
  response.write "<tr><td width=""38%"">"
  Response.Write "共有专辑:<font face=""arial"" color=""red"">"&totalnumber&"</font>个 <font face=""arial"" color=""red"">"&CurrentPage&"/"&n&"</font>页</td>"
  response.write "<td width=""36%""><div align=""right"">"
  if CurrentPage<2 then
    response.write "首页 上一页&nbsp;"
  else
    response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page=1>首页</a>&nbsp;"
    response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&CurrentPage-1&">上一页</font></a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "下一页 尾页"
  else
       response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&(CurrentPage+1)
    response.write ">下一页</a> <a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&n&">尾页</a>"
  end if
  Response.Write "</div></td></tr></table>"
end function 
function showpage1(totalnumber,maxperpage,filename)
  dim n
  if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
  else
     n= totalnumber \ maxperpage+1
  end if
   Response.Write "<table border=""0"" cellspacing=""1"" width=""100%"">"
  response.write "<tr><td align=""left""><td width=""64%"">"
  gotopage
  response.write "<td width=""36%""><div align=""right"">"
  if CurrentPage<2 then
    response.write "首页 上一页&nbsp;"
  else
    response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page=1>首页</a>&nbsp;"
    response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "下一页 尾页"
  else
       response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&(CurrentPage+1)
    response.write ">下一页</a> <a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&n&">尾页</a>"
  end if
  Response.Write "</div></td></tr></table>"
end function 
sub gotopage%>
        <form action=<%response.write ""&filename&"?typeid="&typeid&"&zhuid="&zhuid&""%> method="POST">
          转到 
          <input type="Text" name="page" value="<%if request("page")="" then%>1<%else%><%=request("page")%><%end if%>" size="1" maxlength="4" style="font-size:9pt;background-color:#f7f7f7;border-left: 1px solid rgb(192,192,192); border-right: 1px solid rgb(192,192,192); border-top: 1px solid rgb(192,192,192); border-bottom: 1px solid rgb(192,192,192)">
          <input type="Image" src="images/go.gif" tppabs="" width="20" height="20" align="absmiddle" title="执行" name="Image">
        </form>
        <%end sub
function showpage2(totalnumber,maxperpage,filename)

  dim n
  if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
  else
     n= totalnumber \ maxperpage+1
  end if
  response.write "<form method=Post action="&filename&"?typeid="&typeid&"&zhuid="&zhuid&">"
  response.write "<p align='center'>&gt;&gt;分页&nbsp;"
  if CurrentPage<2 then
    response.write "><font color='999966'>首页 上一页</font>&nbsp;"
  else
    response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page=1&>首页</a>&nbsp;"
    response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "<font color='999966'>下一页 尾页</font>"
  else
       response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&(CurrentPage+1)
    response.write ">下一页</a> <a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&n&">尾页</a>"
  end if
   response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
    response.write "&nbsp;共<b>"&totalnumber&"</b>部电影<b>"&maxperpage&"</b>部电影/页 "
   response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=smallInput value="&currentpage&">"
   response.write "<input class=buttonface type='submit'  value=' 确定 '  name='cndok'></span></p></form>"
end function 
%>
      </td>
    </tr>
  </table>
  <%end if%>
</center>
</body></html>
<%end if
rs1.close
set rs1=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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