<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
else
if session("flag")>1 then
response.Write "<p align=center><font color=red>您没有此项目管理权限！</font></p>"
response.End
end if
end if
%><!--#include file="ljconn.asp"-->
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../img/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {
	font-size: 12px;
	font-weight: bold;
}
.style3 {font-size: 12px}
.style4 {font-size: 12; }
-->
</style>
</head>
<body>
<%
'//删除商品
selectbookid=request("selectbookid")
key=request("key")
'selectm=request("selectm")
px=request("px")
if selectbookid<>"" then
conn.execute "delete from lyb where id in ("&selectbookid&")"
conn.execute "delete from hfly where lyid in ("&selectbookid&")"

response.Redirect "managebbs.asp?px="&request("px")&"&key="&request("key")&""
conn.close
set conn=nothing
response.End
end if
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr> 
<form name="form1" method="post" action="managebbs.asp?px=<%=request("px")%>&key=<%=request("key")%>">
<td height="100"> 
<%'开始分页
set rs=server.CreateObject("adodb.recordset")
select case request("px")
case ""
rs.open "select * from lyb where sfhy=0 order by id desc",conn,1,1
flag="BBS"

case 1
rs.open "select * from lyb where anclassid=1 and sfhy=1 order by id desc",conn,1,1
flag="BBS"

case 2008
rs.open "select * from lyb where id like '%"+key+"%' and sfhy=1 order by id desc",conn,1,1
flag="BBS"
case 2009
rs.open "select * from lyb where title like '%"+key+"%' and sfhy=1 order by id desc",conn,1,1
flag="BBS"
case else
rs.open "select * from lyb where anclassid="&cint(request.QueryString("px"))&" order by id desc",conn,1,1
flag="BBS"
end select'else
%>
<table class="tableBorder" width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
  <tr>
    <td colspan="5" align="center" background="img/admin_bg_1.gif"><span class="style2"><font color="#ffffff"><%=flag%>查看与修改</font></span></td>
  </tr>
  <tr>
    <td colspan="7" align="left" bgcolor="#D7D7FF"></td>
  </tr>
  <tr bgcolor="#E8F1FF">
    <td width="7%" align="center"><span class="style3">Id</span></td>
    <td align="center"><span class="style3">名称</span></td>
    <td width="10%" align="center" class="style3">发布人</td>
    <td width="21%" align="center"><span class="style3">加入时间</span></td>
    <td width="18%" align="center"><span class="style3">选 择</span></td>
  </tr>
  <%if rs.recordcount=0 then%>
  <tr>
    <td colspan=7><span class="style3">抱歉,没找到你想要的!<a href="managebbs.asp">返回>>></a></span></td>
  </tr>
  <%else%>
  <%
	if not isempty(request("page")) then
      					currentPage=cint(request("page"))
   					else
      					currentPage=1
   					end if
					rs.pagesize=12
   					totalPut=rs.recordcount '记录总数    
   					totalPage=rs.pagecount    
   					MaxPerPage=rs.pagesize    
      				if currentpage<1 then    
          				currentpage=1    
      				end if    
      				if currentpage>totalPage then    
          				currentpage=totalPage    
      				end if    
   					if currentPage=1 then    
      					showContent    
                        showpages1
    				else    
         				if (currentPage-1)*MaxPerPage<totalPut then    
         					rs.move  (currentPage-1)*MaxPerPage    
         					dim bookmark    
         					bookmark=rs.bookmark '移动到开始显示的记录位置    
         					showContent    
                  showpages1
      					end if    
   					end if    
					%>
  <%sub showContent   
					dim i
					%>
  <%for i=1 to rs.pagesize%>
  
  <tr bgcolor="#E8F1FF">
    <td height="20" align="center"><a href=showbbs.asp?id=<%=rs("id")%> class="style4"><%=rs("id")%></a></td>
    <td width="44%" style='PADDING-LEFT: 10px'><a href=showbbs.asp?id=<%=rs("id")%> class="style4" target="_blank"><% if len(trim(rs("title")))>18 then
			response.write left(trim(rs("title")),18)&".."
			else
			response.write trim(rs("title"))
			end if%></a>&nbsp;<a href=showbbs.asp?id=<%=rs("id")%> class="style4" target="_blank">查看</a></td>
    <td align="center" class="style3"><%=rs("fbr")%></td>
    <td align="center"><span class="style4"><%=rs("adddate")%></span></td>
    <td align="center"><input name="selectbookid" type="checkbox" id="selectbookid" value="<%=rs("id")%>">    </td>
  </tr>
  <%rs.movenext
  if rs.eof then exit for
  next
  %>
  <%end sub%>
  <%
sub showpages1()     
dim n     
n=totalPage
%>
  <tr align="center" bgcolor="#E8F1FF">
    <td height="20" colspan="7"><span class="style3">
      <% If currentPage <> 1 Then %>
&nbsp;<a href="managelyb.asp?Page=1&px=<%=px%>&key=<%=key%>" class="top">首页</a>&nbsp;<a href="managelyb.asp?Page=<%=(currentPage-1)%>&px=<%=px%>&key=<%=key%>" class="top">上一页</a>
      <%else%>
&nbsp;首页&nbsp;上一页
      <% End If %>
      <% If currentPage <> rs.PageCount Then %>
      <a href="managelyb.asp?Page=<%=(currentPage+1)%>&px=<%=px%>&key=<%=key%>" class="top">下一页</a>&nbsp;<a href="managelyb.asp?Page=<%=totalPage%>&px=<%=px%>&key=<%=key%>" class="top">尾页</a>
      <%else%>
      下一页&nbsp;尾页
      <% End If %>
      第<%=currentPage%>页/共<%=totalPage%>页&nbsp;共有<%=rs.RecordCount%>条</span></td>
  </tr>
  <%end sub%>
  <tr bgcolor="#E8F1FF">
    <td height="30" colspan="5" align="center"><table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="87%" align="center">&nbsp;</td>
          <td width="13%" align="right"><span class="style3 style3">全选
              <input type="checkbox" name="checkbox" value="Check All" onClick="mm()">
              <input type="submit" name="Submit" value="删 除" onClick="return test();">
          </span></td>
        </tr>
      </table></td>
    </table>
<table width="12" height="7" border="0" cellpadding="0" cellspacing="0">
<tr> 
<td height=7></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
<table class="tableBorder" width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
  <tr>
    <td colspan="2" align="center" background="img/admin_bg_1.gif"><span class="style3"><b><font color="#ffffff">查询</font></b></span></td>
  </tr>
  <tr bgcolor="#E8F1FF">
    <form name="form2" method="post" action="managelyb.asp" onSubmit="return checkdata()">
      <td height="50" align="left"><table border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="200" align="center">
            <input name="key" type="text" id="key"></td>
          <td width="120" align="center">
            <select name="px" id="px">
              <option value="2008">按ID</option>
              <option value="2009">按名称</option>
            </select></td>
          <td width="40" height="30" align="center">
            <input type="submit" name="Submit2" value="查 询"></td>
        </tr>
      </table>
    </form>
  </tr>
</table>
<!--#include file="copyright.asp"-->
<%end if
rs.close 
set rs=nothing
conn.close   
set conn=nothing
%>
</body>
</html>
<script>
function test()
{
  if(!confirm('确认删除吗？')) return false;
}
</script>
<script language=javascript>
function mm()
{
   var a = document.getElementsByTagName("input");
   if(a[0].checked==true){
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = false;
   }
   else
   {
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = true;
   }
}
</script>

