<!--#include file="../../checkLogin.asp"-->
<!--#include file="../../SQLconn.asp"-->
<!doctype html>
<link rel="stylesheet" type="text/css" href="../../css/style.css" />
<script src="../../laydate/laydate.js"></script>
<html>
<head><title></title><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../../images/<%=request.cookies("imgdir")%>/css/style.css" media="all"/>
<STYLE TYPE="text/css">
    <!--
    BODY 	    {background-color: #FFFFFF; text-align: center; font-size: 12px; font-family: Verdana;}
   
    .blackBacking   {background-color: #000000;}
    .names 	    {background-color: #ff9900; font-size: 13px; color: #FFFFFF; text-decoration: none; text-align:  center;       font-family: Verdana; font-weight: bold;}
    .calendarBody   {background-color: #F2EBCB; font-size: 13px; color: #000000; text-decoration: none; text-align:  center; font-family: Verdana;}
    .calCurrentDay  {background-color: #FFCCCC; font-size: 13px; color: #FFFFFF;}
    .calOtherDay    {background-color: #E1F0FF; font-size: 16px; color: #000000;}
    .calNotDay	    {background-color: #EEF1F2; font-size: 18px; color: #000000;}
	.caltime	    {background-color: #EEF1F2; font-size: 15px; color: #990000;}
    .calFormMenu    {background-color: #AECE6A; font-size: 13px; color: #FFFFFF; text-decoration: none; text-align:  center; font-family: Verdana; font-weight: bold;}
.STYLE4 {font-size: 18}
    -->
  </STYLE>
<body>
<script Language="JavaScript">
function form_check(){
if(document.form3.sendto.value.length<1){window.alert("请选择收短信人");document.form3.sendto.focus();return (false);}
if(document.form3.CONTENT.value.length<1){window.alert("请输入内容");document.form3.CONTENT.focus();return (false);}
if(document.form3.CONTENT.value.length>100){window.alert("短信内容超过100字了，请您移步到内部邮件发送！");document.form3.CONTENT.focus();return (false);}
}

function inputname(strname)
{
form3.sendto.value=strname;	
document.form3.CONTENT.focus();return (false);		
}



</script>

<script language="javascript" type="text/javascript">
 var classlist=new Array(); //定义js数组
<%
i=1
Set rs = Conn.Execute("SELECT   * from  varSet where  name='学校网站菜单设置'")
			While NOT rs.EOF %>
			//使用asp循环填充js数组,三维数组,分别保存栏目的父ID,栏目名称,栏目ID
			
 classlist[<%=i-1%>]=new Array(<%=rs("vid")%>,"<%=rs("vname2")%>","<%=rs("vname1")%>");

 
 <%  i=i+1
 
 rs.MoveNext 
   
			Wend
			rs.Close%>

//一级栏目选择变动触发函数

function getSmallClass()
{
 var parentid=document.all.vname1.value;  //获取父栏目的ID
 document.all.vname2.length=0;   //将二级栏目下拉清空
 document.all.vname2.options.add(new Option("","0"))  //添加一个自定义的下拉选项
 for(i=0;i<classlist.length;i++)   //遍历js数组
 {
  
  if(classlist[i][2]==parentid)   //js数组里的选项符合条件(父栏目ID来判断)
  {
     document.all.vname2.options.add(new Option(classlist[i][1],classlist[i][1]))  //添加到二级栏目的下拉选项里
  }
 }
}
</script>


<%
'检查权限
       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")
 vname1=request("vname1")
 vname2=request("vname2")
 if vname2="0" then 
 vname2=""
 end if
 
 if strdate1="" then 
   strdate1=date()-150
 end if
 if strdate2="" then 
   strdate2=date()  
 end if

   %>
     

<table width="100%" height="495" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="27">
	<div class="header">
	<div class="nav">
        <ul>
            
            <li><a href="addfile.asp" target="_self">发布网站文章</a></li>
            <li class="on">管理网站文章</li>
			<li><a href="TiXing.asp" target="_self">发布文章提醒</a></li>
        </ul>
    </div>	
	</td>
  </tr>   

 
  <tr>
   <td height="470" valign="top"   class="NemuMainBox">
   
   <br>
   
   
   <FORM ACTION="manage.asp?ftype=<%=strftype%>" METHOD="post"  NAME="form1">	
<table width="95%" height="33" border="1" align="center" cellpadding="3"   cellspacing="0"  bordercolor="#6D8DD8" style="border-collapse:collapse"  class="mtablehui">
  <tr style="background-color:#D6E4FF"  class="TableHeader">
    <td height="31" colspan="3" align="center" nowrap class="NemuNot">

	<table width="846" border="0" align="center" cellspacing="0">
      <tr>
        <td width="43" class="STYLE1"><div align="right"><span class="STYLE1 STYLE2">开始</span></div></td>
        <td width="90" class="STYLE1"><b><b>
          <input name=date1  placeholder="请输入日期"  style="width:90px"  value=<%=strdate1%> class="laydate-icon" onClick="laydate()">
        </b></b></td>
        <td width="35" class="STYLE1"><div align="right"><span class="STYLE2">结束</span></div></td>
        <td width="90" class="STYLE1"><b><b>
           <input name=date2  placeholder="请输入日期"  style="width:90px"  value=<%=strdate2%> class="laydate-icon" onClick="laydate()">
        </b></b></td>
        
       <td width="41" height="28" class="STYLE1"><div align="center">类别</div></td>
		<td colspan="3" class="STYLE1">
		<select name="vname1" id="vname1" style= "width:80px " onChange="getSmallClass();">
		<option selected value=<%=vname1%>><%=vname1%></option>
		<%
		'一级栏目通过asp代码的方式加载
		Set RSsel = Conn.Execute("select avg(vid) as 序号, vname1 from  varset where name='学校网站菜单设置' group  by  vname1 order by 序号")
		While NOT RSsel.EOF %>
		<option value=<%=RSsel( "vname1" )%>><%=RSsel( "vname1" )%></option>
		<% RSsel.MoveNext
		Wend
		RSsel.Close%>
		</select></td>
		<td width="75" height="28" class="STYLE1"><div align="center">二级类别</div></td>
		<td colspan="3" class="STYLE1"><select name="vname2"  style= "width:80px"  id="vname2">
		<option selected value=<%=vname2%>><%=vname2%></option>
		
		</select></td>
		<td width="33" class="STYLE1"><div align="right"><span class="STYLE1 STYLE2">标题</span></div></td>
	   
	    <td width="80" class="STYLE1"><span class="STYLE2">
          <input name="title" type="text" id="title" size="15" style= "width:80px" value=<%=title%>  >
        </span></td>
        <td width="36" class="STYLE1"><div align="right"><span class="STYLE2">内容</span></div></td>
        <td width="92" class="STYLE1"><span class="STYLE2">
          <input name="guanjianci" type="text" id="guanjianci" size="15"    style= "width:80px" value=<%=guanjianci%>>
        </span></td>
        <td width="42" class="STYLE1 STYLE2"><input name="Submit" type="submit" class="topanniu" value="搜索" /></td>
      </tr>
    </table>
	
	</td>
  </tr>
</table>
</FORM>
   
   
   
   <%
   tname=request.cookies("tname")
   
'检查权限
 set RsPowder=Conn.Execute("select p.powderdetail  from teachers t,teacherpowder p  where t.powdergroup=p.powdergroup and tname='"&request.cookies("tname")&"' and powderdetail='系统参数'")
	 if  RsPowder.eof and  RsPowder.bof then
     sql="Select * from SchoolWeb where   (发布日期 BETWEEN '"&strdate1&"'  AND   '"&strdate2&"') AND (标题 like  '%"&title&"%')  AND (内容 like  '%"&guanjianci&"%')   and     (类别 like '"&vname1&"%') and    (二级类别 like  '"&vname2&"%') order by   id  desc"                 ' (upname ='"&tname&"')  
else
      sql="Select * from SchoolWeb where   (发布日期 BETWEEN '"&strdate1&"'  AND   '"&strdate2&"') AND (标题 like  '%"&title&"%')  AND (内容 like  '%"&guanjianci&"%')   and     (类别 like '"&vname1&"%') and    (二级类别 like  '"&vname2&"%') order by   id  desc"        
end if
Set rs=Server.CreateObject("Adodb.Recordset")
rs.open sql,conn,1,1
%>

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

%>


 

<table width="95%" align="center" border="1" cellpadding="3"   cellspacing="0"  bordercolor="#6D8DD8" style="border-collapse:collapse"  class="mtable">
<tr style="background-color:#D6E4FF"  class="TableHeader">
     
      <td height="30" align="center" nowrap class="STYLE1"><span class="STYLE1">日期</span></td>    
	  <td align="center" nowrap class="STYLE1">类别</td>
	  <td align="center" nowrap class="STYLE1">二级菜单</td>
	  <td align="center" nowrap class="STYLE1"><span class="STYLE1">标题</span></td>
	  <td align="center" nowrap class="STYLE1">发布人</td>
      <td align="center" nowrap class="STYLE1"><span class="STYLE1">操作</span></td>
  </tr>
<%
   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="100" height="30" class="STYLE1"><div align="center"><%=rs("发布日期")%></div></td>
      <td width="100" class="STYLE1"><div align="center"><a href="manage.asp?vname1=<%=rs("类别")%>" target="_self"><%=rs("类别")%></a> </div></td>
      <td width="100" class="STYLE1"><div align="center"><a href="manage.asp?vname1=<%=rs("类别")%>&vname2=<%=rs("二级类别")%>" target="_self"><%=rs("二级类别")%> </a></div></td>
      <td   class="STYLE1"><div align="left">&nbsp;<a href="viewFile.asp?id=<%=rs("id")%>"  target="_blank" class="STYLE1"><%=rs("标题")%></a></div></td> 
	 <td width="100" height="30" class="STYLE1"><div align="center"><%=rs("上传人")%></div></td>
	<td width="120" class="STYLE1">
	   <div align="center"><a href="modifyfile.asp?years=<%=years%>&amp;curpage=<%=curpage%>&amp;id=<%=rs("id")%>"  target="main" class="STYLE1">修改</a> &nbsp; 
	    <a href="delete.asp?years=<%=years%>&curpage=<%=curpage%>&id=<%=rs("id")%>"  target="main" class="STYLE1">删除</a></div></td>
    </tr>
<%  rs.movenext
    next%>
</table>

 <br>
<div align="center">
  
  <span class="STYLE1">
  <%if curpage=1 then%>
  
首页
<%else%>
<a href="?vname1=<%=vname1%>&vname2=<%=vname2%>&curpage=1>&guanjianci=<%=guanjianci%>&title=<%=title%>&date1=<%=strdate1%>&date2=<%=strdate2%>">首页</a>
<%end if%>

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

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

<%if rs.pagecount<curpage+1 then%>
尾页
<%else%>
<a href="?vname1=<%=vname1%>&vname2=<%=vname2%>&curpage=<%=rs.pagecount%>&guanjianci=<%=guanjianci%>&title=<%=title%>&date1=<%=strdate1%>&date2=<%=strdate2%>">尾页</a>
<%end if%>
(当前第<%=curpage%>页，共有<%=rs.pagecount%>页，共有：<%=rs.recordcount%>条记录)</span></div>
   
   
   <br>
   
   </td>
  </tr>
</table>
</body>
</html>
