<!--#include file="../SQLconn.asp"-->

<html>
<head><title></title><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../css/style.css" />

<style type="text/css">
<!--
.STYLE2 {color: #000000}
-->
</style>
<body>


<script>

<!--打开公告-->
function open_notify(NOTIFY_ID,FORMAT)
{
 URL="openFile.asp?id="+NOTIFY_ID;
 myleft=(screen.availWidth-700)/2;
 myleft=80;
 mytop=80
 mywidth=(screen.availWidth-160);
 myheight=(screen.availHeight-120);
 if(FORMAT=="1")
 {
    myleft=0;
    mytop=0
    mywidth=screen.availWidth-10;
    myheight=screen.availHeight-40;
 }
 window.open(URL,'_blank',"height="+myheight+",width="+mywidth+",status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");
}
</script>

<script language=javascript>


function unselectall(){
if(document.myform.chkAll.checked){
document.myform.chkAll.checked = document.myform.chkAll.checked&0;
}
}
function CheckAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.Name != 'chkAll'&&e.disabled==false)
e.checked = form.chkAll.checked;
}
}
</script>




<%

strftype=request("ftype")
tname=request.cookies("tname")

'检查权限
        Set MyOAASPObj = Server.CreateObject("YFSchoolOApro.YFSchoolDll")
            if MyOAASPObj.QuanXian(tname,"信息管理")=0 then 
		    response.redirect  "../NoPower.asp"
           end if 
		   set MyOAASPObj=nothing
'检查权限结束

 strdate1=request("date1")
 strdate2=request("date2")
 title=request("title")
 guanjianci=request("guanjianci")
 if strdate1="" then 
   strdate1=date()-150
 end if
 if strdate2="" then 
   strdate2=date()
  
 end if



'检查权限,如果是系统管理员，就显示所有的通知，否则只显示自己的通知。
Set MyOAASPObj= Server.CreateObject("YFSchoolOApro.YFSchoolDll")
	if MyOAASPObj.QuanXian(tname,"系统参数")=0 then    
   sql="Select * from gonggao where   (fDate BETWEEN '"&strdate1&"'  AND   '"&dateadd("d",1,strdate2)&"') AND (Title like  '%"&title&"%')  AND (Content like  '%"&guanjianci&"%') and    (upName ='"&tname&"') and  (ftype='"&strftype&"') order by ontop desc,   id  desc"
else
     sql="Select * from gonggao where   (fDate BETWEEN '"&strdate1&"'  AND   '"&strdate2&"') AND (Title like  '%"&title&"%')  AND (Content like  '%"&guanjianci&"%') and     (ftype='"&strftype&"')   order by ontop desc, id  desc"
end if


Set rs=Server.CreateObject("Adodb.Recordset")
rs.open sql,conn,1,1
%>

<%
rs.pagesize=13 '每页记录条数
curpage=Request.QueryString("curpage") '将URL参数curpage传给curpage变量
rs.absolutepage=curpage '将本页设为curpage设置的页数
if curpage=0 then
   curpage=1
end if 


%>

<table width="95%" height="30" border="1" align="center" cellpadding="3"   cellspacing="0"  bordercolor="#6D8DD8"  class="mtablehui">
  <tr style="background-color:#D6E4FF"  class="TableHeader">
    <td height="30" colspan="3" align="center" nowrap class="NemuNot">
<FORM ACTION="manage.asp?ftype=<%=strftype%>" METHOD="post"  NAME="form1">	
	<table width="690" border="0" align="center" cellspacing="0">
      <tr>
        <td width="45" class="STYLE1"><div align="right"><span class="STYLE1 STYLE2">开始&nbsp;</span></div></td>
        <td width="105" class="STYLE1"><b><b>
          <input name=date1 onClick="javascript:window.open('day.asp?form=form1&field=date1&oldDate='+this.value,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=200,top=220,left=250');"  size="12" readonly  value=<%=strdate1%>>
        </b></b></td>
        <td width="51" class="STYLE1"><div align="right"><span class="STYLE2">结束&nbsp;</span></div></td>
        <td width="105" class="STYLE1"><b><b>
          <input name=date2 onClick="javascript:window.open('day.asp?form=form1&field=date2&oldDate='+this.value,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=200,top=220,left=250');"  size="12" readonly  value=<%=strdate2%>>
        </b></b></td>
        <td width="52" class="STYLE1"><div align="right"><span class="STYLE1 STYLE2">标题&nbsp;</span></div></td>
        <td width="105" class="STYLE1"><span class="STYLE2">
          <input name="title" type="text" id="title" size="15" value=<%=title%>>
        </span></td>
        <td width="68" class="STYLE1"><div align="right"><span class="STYLE2">关键词&nbsp;</span></div></td>
        <td width="132" class="STYLE1"><span class="STYLE2">
          <input name="guanjianci" type="text" id="guanjianci" size="15" value=<%=guanjianci%>>
        </span></td>
        <td width="78" class="STYLE1 STYLE2"><input name="Submit" type="submit" class="topanniu" value="搜索" /></td>
      </tr>
    </table>
	</FORM>
	</td>
  </tr>
</table>
<table width="881" height="7" border="0">
  <tr>
    <td height="3"></td>
  </tr>
</table>
  <table width="95%" border="1" align="center" cellpadding="3"   cellspacing="0"  bordercolor="#6D8DD8"  class="mtable">
 <tr style="background-color:#D6E4FF"  class="TableHeader">
     
  
	  <td align="center" nowrap class="STYLE1"><span class="STYLE1">标题<%=fid%></span></td>  	  
      <td align="center" nowrap class="STYLE1"><span class="STYLE1">发布范围</span></td>
	   <td height="27" align="center" nowrap class="STYLE1"><span class="STYLE1">日期</span></td>
      <td align="center" nowrap class="STYLE1"><span class="STYLE1">操作</span></td>
  </tr>
  <FORM ACTION="deleteDuo.asp?ftype=<%=strftype%>&curpage=<%=curpage%>&guanjianci=<%=guanjianci%>&title=<%=title%>&date1=<%=strdate1%>&date2=<%=strdate2%>" METHOD="post"  NAME="form2">
<%
   for i= 1 to rs.pagesize
      if rs.eof then
         exit for
      end if
%>
    <tr onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#EFF8FF'">
	 
      
      <td width="491" class="STYLE1">&nbsp;
	  <input type="checkbox" name="checkbox" value=<%=rs("id")%>>&nbsp;
	  <a href="javascript:open_notify(<%=rs("id")%>,'0');">&nbsp;<%=rs("title")%><a></td> 
	<td width="60" class="STYLE1"><div align="center"><%=rs("sendto")%></div></td>
	<td width="104" height="28" class="STYLE1"><div align="center"><%=formatdatetime(rs("fdate"),2)%></div></td>
	<td width="286" class="STYLE1">
	
	<div align="center">
	 <a href="fujian.asp?curpage=<%=curpage%>&id=<%=rs("id")%>"  target="main" class="STYLE1">附件</a>&nbsp;
	 <a href="picture.asp?curpage=<%=curpage%>&id=<%=rs("id")%>"  target="main" class="STYLE1">图片</a>&nbsp;
	 <a href="modifyfile.asp?curpage=<%=curpage%>&id=<%=rs("id")%>"  target="main" class="STYLE1">修改</a>&nbsp;
	 <%if trim(rs("ontop"))="顶置" then   %>
                 <a href="dingzhi.asp?curpage=<%=curpage%>&ID=<%=rs("id")%>&istop=0&ftype=<%=strftype%>">不顶置</a>&nbsp;&nbsp;
                 <%else %>
                 <a href="dingzhi.asp?curpage=<%=curpage%>&ID=<%=rs("id")%>&istop=1&ftype=<%=strftype%>">顶置</a>&nbsp;&nbsp;
                 <%end if  %>
	 
	 <a   href= "# "   onclick= "javascript:if(confirm( '您真的要删除记录？ '))href= 'delete.asp?ftype=<%=strftype%>&curpage=<%=curpage%>&guanjianci=<%=guanjianci%>&title=<%=title%>&date1=<%=strdate1%>&date2=<%=strdate2%>&id=<%=rs("id")%>'; "> 删除 </a>&nbsp; 
	 <a href="viewsee.asp?curpage=<%=curpage%>&id=<%=rs("id")%>&ftype=<%=strftype%>"  target="_blank" class="STYLE1"> 点击</a>	 </div></td>
    </tr>
<%  rs.movenext
    next%>
	
<tr>
    <td height="28" colspan="4">
	
	<span class="STYLE1">&nbsp;<input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox'>全选</span>&nbsp;&nbsp;&nbsp;&nbsp;
	<input name="Submit2" type="submit" class="topanniu" value="删除"></td>
  </tr>
  
</table>
 
 
   
<label></label>
<table width="100%" border="1" align="center" cellpadding="3"   cellspacing="0"  bordercolor="#6D8DD8"  class="mtable">
</table>
</div> <br>
<div align="center" class="STYLE1">
<%if curpage=1 then%>
首页
<%else%>
<a href="?ftype=<%=strftype%>&curpage=1&guanjianci=<%=guanjianci%>&title=<%=title%>&date1=<%=strdate1%>&date2=<%=strdate2%>">首页</a>
<%end if%>

<%if curpage=1 then%>
上一页
<%else%>
<a href="?ftype=<%=strftype%>&curpage=<%=curpage-1%>&guanjianci=<%=guanjianci%>&title=<%=title%>&date1=<%=strdate1%>&date2=<%=strdate2%>">上一页</a>
<%end if%>

<%if rs.pagecount<curpage+1 then%>
下一页
<%else%>
<a href="?ftype=<%=strftype%>&curpage=<%=curpage+1%>&guanjianci=<%=guanjianci%>&title=<%=title%>&date1=<%=strdate1%>&date2=<%=strdate2%>">下一页</a>
<%end if%>

<%if rs.pagecount<curpage+1 then%>
尾页
<%else%>
<a href="?ftype=<%=strftype%>&curpage=<%=rs.pagecount%>&guanjianci=<%=guanjianci%>&title=<%=title%>&date1=<%=strdate1%>&date2=<%=strdate2%>">尾页</a>
<%end if%>
<span class="STYLE2">(当前第<%=curpage%>页，共有<%=rs.pagecount%>页，共有：<%=rs.recordcount%>条记录)</span></div>

</body>
</html>
