<!--#include file="../conn.asp"-->
<!-- #include file="../admin/check_master.asp" -->
<%
searchcontent=trim(request("searchcontent"))
searchkind=request("searchkind")
if searchkind="" then
	str="select * from sms order by id desc"
else
	str="select * from sms where "&searchkind&" like '%"&searchcontent&"%' order by id desc"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open str,conn,3,1
page=request("page")
if page="" then
page=1
else 
page=cint(trim(request("page")))
end if
ipagesize=20
rs.pagesize=ipagesize

%>
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/xmwuye.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
function selectAll()  //全选
{
	var f=document.selectform
	var box=f.checkbox1
    var length=0
	if(box && !box[0]){length=1}
	if(box[0]){length=box.length}

    if (length == 0 ){return;}
    if (length ==1 ){box.checked=true;}
    if (length>1){
      for (var i = 0; i < length; i++){
        box[i].checked=true;
       }
    }
}
function selectRev()  //反选
{
	var f=document.selectform
	var box=f.checkbox1
    var length=0
	if(box && !box[0]){length=1}
	if(box[0]){length=box.length}

    if (length == 0 ){return;}
    if (length ==1 ){box.checked=!(box.checked);}
    if (length>1){
      for (var i = 0; i < length; i++){
        box[i].checked=!box[i].checked;
       }
    }

}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<br>
<table width="98%" border="0" align="center">
  <TR align=center>
<FORM METHOD=POST ACTION="<%=request.servervariables("script_name")%>" >
	  <TD> 
        <INPUT TYPE="text" NAME="searchcontent" size=20>
        <select name="searchkind">
          <option value="title">标题</option>
          <option value="content">内容</option>
        </select>
        <INPUT TYPE="submit" value="搜索" name="">
        <A HREF="adminpostsms.asp">[发送系统短信]</A></TD>
</FORM>
</TR>
</TABLE>
<table width="98%" border="0" bgcolor="#333333" cellspacing="1" cellpadding="0" align="center">
  <tr bgcolor="#f3f3f3" align=center> 
    <td width="5%" height="20" bgcolor="#f3f3f3">选择</td>
    <td width="5%" bgcolor="#f3f3f3">编号</td>
    <td width="20%">标题</td>
    <td width="20%">内容</td>
    <td>日期</td>
    <td width="10%">修改</td>
    <td width="10%">删除</td>
  </tr>
  <form name="selectform" method=post action="pldelsms.asp">
    <input type="hidden" name="op" value="选择转正">
    <input type="hidden" name="returnURL" value="managesms.asp?<%=Request.QueryString%>">
    <script language="JavaScript">
  <!--
  function select_pl_submit(optype){
	var f=document.forms["selectform"]
	f.op.value=optype
	f.submit()
  }
  //-->
  </script>
    <%if not rs.eof then
	  rs.absolutepage=page
	  i=1
	  do while not rs.eof
	  %>
    <tr bgcolor="#FFFFFF" align=center> 
      <td height="20"><input name="checkbox1" type="checkbox" id="checkbox1" value="<%=rs("id")%>"></td>
      <td height="20"><%=i%></td>
      <td><%=rs("title")%></td>
      <td><%=rs("content")%></td>
      <td><%=rs("indate")%></td>
      <td><A HREF="admineditsms.asp?id=<%=rs("id")%>">[修改]</A></td>
      <td><A HREF="sms_ope_act.asp?ope=del&id=<%=rs("id")%>">[删除]</A></td>
    </tr>
    <%
  rs.movenext
  i=i+1
  if i>ipagesize then exit do
  loop
  %>
    <tr bgcolor="#FFFFFF"> 
      <td height="22" colspan="12"> <input name="button" type="button" onclick="selectAll()" value="全选"> 
        <input name="button" type="button" onclick="selectRev()" value="反选"> <input name="button" type="button" onclick="selectAll();selectRev()" value="全不选"> 
        <input name="button" type="button" onclick="select_pl_submit('选择删除')" value="将所选删除" <%if instr(session("admin_qs"),3)<=0 then%>disabled<%end if%>>
      </td>
    </tr>
  </form>
  <tr align=center bgcolor="#FFFFFF"> 
    <td colspan="15"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="77%"> <div align="center">共<%=rs.recordcount%>个话题 第<%=page%>页/共<%=rs.pagecount%>页　 
              <%if page>1 then%>
              <a href="<%=request.servervariables("script_name")%>?page=1&searchcontent=<%=searchcontent%>&searchkind=<%=searchkind%>">［首　页］</a> 
              <%else%>
              ［首　页］ 
              <%end if%>
              <%if page>1 then%>
              <a href="<%=request.servervariables("script_name")%>?page=<%=page-1%>&searchcontent=<%=searchcontent%>&searchkind=<%=searchkind%>">［上一页］</a> 
              <%else%>
              ［上一页］ 
              <%end if%>
              <%if page<rs.pagecount then%>
              <a href="<%=request.servervariables("script_name")%>?page=<%=page+1%>&searchcontent=<%=searchcontent%>&searchkind=<%=searchkind%>">［下一页］</a> 
              <%else%>
              ［下一页］ 
              <%end if%>
              <%if page<>rs.pagecount then%>
              <a href="<%=request.servervariables("script_name")%>?page=<%=rs.pagecount%>&searchcontent=<%=searchcontent%>&searchkind=<%=searchkind%>">［尾　页］</a> 
              <%else%>
              ［尾　页］ 
              <%end if%>
              　</div></td>
          <form name="form2" method="post" action="<%=request.servervariables("script_name")%>">
            <td width="23%"> <div align="center">第 
                <input type="text" name="page" size="3">
                页 
                <INPUT TYPE="hidden" name="searchcontent" value="<%=searchcontent%>">
                <INPUT TYPE="hidden" name="searchkind" value="<%=searchkind%>">
                <input type="submit" name="Submit" value="GO！">
              </div></td>
          </form>
        </tr>
      </table></td>
  </tr>
  <%else%>
  <tr bgcolor="#F2F9F9"> 
    <td colspan=15> <div align=center> 找不到纪录！ </div></td>
  </tr>
  <%end if%>
</table>
<br>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>