<!--#include file="articleconn.asp"-->
<%
if request.cookies("adminok")="" then
  response.redirect "login.asp"
end if
%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>极品笑话</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<script language="javascript">
function popwin2(id,path)
{		window.open("openarticle.asp?id="+id+"&ppath="+path,"","height=450,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>
<link rel="stylesheet" href="style/style.css" type="text/css">
</head>
<%
   const MaxPerPage=18
   dim totalPut   
   dim CurrentPage
   dim TotalPages
   dim i,j

   dim typename
   
   typename="热线笑话站"
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
   dim sql
   dim rs
   dim rstype
   dim typesql
   dim typeid,typename1
   if not isEmpty(request("typeid")) then
	typeid=request("typeid")
   else
	typeid=1
   end if
 set rstype=server.createobject("adodb.recordset")
  typesql="select * from type where typeID="&cstr(typeid)
 rstype.open typesql,conn,1,1
 if not rstype.eof then
	typename1=rstype("type")
 end if
	rstype.close
	set rstype=nothing
%>

<body>

<div align="center"><center>
  </center></div><div align="center"><center>     
     
    <table border="0" width="600" cellspacing="0" cellpadding="0">
      <tr>     
        <td width="100%"> 
          <p align="center"><br>
            <a href="manage.asp?typeid=1">儿童篇</a>｜<a href="manage.asp?typeid=2">夫妻篇</a>｜<a href="manage.asp?typeid=5">爱情篇</a>｜<a href="manage.asp?typeid=4">医疗篇</a>｜<a href="manage.asp?typeid=9">家庭篇</a>｜<a href="manage.asp?typeid=10">政治篇</a>｜<a href="manage.asp?typeid=11">电脑篇</a>｜<a href="manage.asp?typeid=12">军事篇</a>｜<a href="manage.asp?typeid=13">古代篇</a>｜<a href="manage.asp?typeid=14">文化篇</a>｜<a href="manage.asp?typeid=15">艺术篇</a>｜<a href="manage.asp?typeid=16">经营篇</a>｜<br>
            <a href="manage.asp?typeid=17">司法篇</a>｜<a href="manage.asp?typeid=18">体育篇</a>｜<a href="manage.asp?typeid=19">交通篇</a>｜<a href="manage.asp?typeid=20">宗教篇</a>｜<a href="manage.asp?typeid=21">鬼话篇</a>｜<a href="manage.asp?typeid=22">名人篇</a>｜<a href="manage.asp?typeid=23">校园篇</a>｜<a href="manage.asp?typeid=24">交往篇</a>｜<a href="manage.asp?typeid=25">愚人篇</a>｜<a href="manage.asp?typeid=26">民间篇</a>｜<a href="manage.asp?typeid=27">综合</a>｜<a href="manage.asp?typeid=30">成人篇</a>｜<br>
            <a href="manage.asp?typeid=28">顺口溜</a>｜<a href="manage.asp?typeid=29">漫画篇</a>｜<a href="manage.asp?typeid=32">网友趣文</a>｜<a href="manage.asp?typeid=31">魔鬼辞典</a>｜<a href="manage.asp?typeid=34">脑筋急转弯</a>｜<a href="changepass.asp" title="用于修改管理员密码名称以及增加修改删除栏目"><font color=red>管理页面</font></a>｜<a href='addarticle.asp?typeid="&typeid&"'><font color='red'>增加笑话</font></a> 
          <p align=center>
            <%  
sql="select articleid,title,dateandtime,hits from learning where typeid="+cstr(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,"manage.asp"  
            showContent  
            showpage totalput,MaxPerPage,"manage.asp"  
       else  
          if (currentPage-1)*MaxPerPage<totalPut then  
            rs.move  (currentPage-1)*MaxPerPage  
            dim bookmark  
            bookmark=rs.bookmark  
           showpage totalput,MaxPerPage,"manage.asp"  
            showContent  
             showpage totalput,MaxPerPage,"manage.asp"  
        else  
	        currentPage=1  
           showpage totalput,MaxPerPage,"manage.asp"  
           showContent  
           showpage totalput,MaxPerPage,"manage.asp"  
	      end if  
	   end if  
   rs.close  
   end if  
	          
   set rs=nothing    
   conn.close  
   set conn=nothing  
    
  
   sub showContent  
       dim i  
	   i=0  
  
%>
          <div align="center">
<div align="center"><center>
                <table border="1" cellspacing="0" width="589" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0">
                  <tr bgcolor="#eaeaea"> 
                    <td width="46" align="center" height="20">ID号</td>  
                    <td width="400" align="center">笑话标题</td>  
                    <td width="69" align="center">修改</td>  
                    <td width="68" align="center">删除</td>  
        </tr>  
<%do while not rs.eof%>  
        <tr>  
          <td height="23" width="46"><p align="center"><%=rs("articleid")%></td>  
          <td width="400"><p align="center"><a href="javascript:popwin2(<%=rs("articleid")%>)"><%=rs("title")%></a></td>  
          <td width="69"><p align="center"><a  
    href="edit.asp?id=<%=rs("articleid")%>">修改</a></td>  
          <td width="68"><p align="center"><a  
    href="dele.asp?id=<%=rs("articleid")%>">删除</a></td>  
        </tr>  
<% i=i+1  
	      if i>=MaxPerPage then exit do  
	      rs.movenext  
	   loop  
		  %>  
      </table>  
      </center></div>
            <%  
   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 "<form method=Post action="&filename&"?typeid="&typeid&">"  
  response.write "<p align='center'>&nbsp;"  
  if CurrentPage<2 then  
    response.write "<font color='#000080'>首页 上一页</font>&nbsp;"  
  else  
    response.write "<a href="&filename&"?page=1&typeid="&typeid&">首页</a>&nbsp;"  
    response.write "<a href="&filename&"?page="&CurrentPage-1&"&typeid="&typeid&">上一页</a>&nbsp;"  
  end if  
  if n-currentpage<1 then  
    response.write "<font color='#000080'>下一页 尾页</font>"  
  else  
    response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&typeid="&typeid&">"  
    response.write "下一页</a> <a href="&filename&"?page="&n&"&typeid="&typeid&">尾页</a>"  
  end if  
   response.write "<font color='#000080'>&nbsp;页次：</font><strong><font color=red>"&CurrentPage&"</font><font color='#000080'>/"&n&"</strong>页</font> "  
    response.write "<font color='#000080'>&nbsp;共<b>"&totalnumber&"</b>篇笑话 <b>"&maxperpage&"</b>篇笑话/页</font> "  
   response.write " <font color='#000080'>转到：</font><input type='text' name='page' size=4 maxlength=10 class=smallInput value="&currentpage&">"  
   response.write "<input class=buttonface type='submit'  value='Goto'  name='cndok'></span></p></form>"  
         
end function  
  
   
%>
          </div>
        </td>  
  </tr>  
</table>  
</center></div>  
</body>  
</html>  
