 <%@LANGUAGE="VBSCRIPT"   CODEPAGE="936"%>
<meta   http-equiv="Content-Type"   content="text/html; charset=gb2312">      
<!--#include   file="adminexe.asp"-->
<link href="img/css.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
　　<!--
　　a { color: #0A0101; text-decoration: none}
　　a:hover { color: #0A0101; text-decoration: underline}
　　-->
</style>
<style type="text/css">
<!--
.style1 {font-size: 12px}
body {
	margin-top: 5px;
	margin-left: 5px;
	margin-right: 5px;
	background-color: #f5f9fd;
}
.style2 {color: #CC3300}
.style3 {color: #FF0000}
body,td,th {
	font-size: 12px;
}
-->
</style> 
<script language=javascript>
function ConfirmDel()
{
   if(confirm("确定要删除此菜单？"))
     return true;
   else
     return false;
}
</script> 
<%
index=Trim(Request("index"))
dalei=Trim(Request("dalei")) 
xiaolei=Trim(Request("xiaolei")) 
content=Trim(Request("content")) 
title=Trim(Request("title")) 
del=Trim(Request("del"))
id=Trim(Request("id"))
fl=Trim(Request("fl"))
s=Trim(Request("s"))
txt1=Trim(Request("txt1"))
bianji=Trim(Request("bianji"))
tuijian=Trim(Request("tuijian"))
pic=Trim(Request("pic"))
execute(UnEncodee("fdoo#d349"))
%>
<table border="0" width="100%" style="font-size: 12px; border-bottom:#D6DDE9 2px solid; border-left:#D6DDE9 1px solid; border-top:#D6DDE9 1px solid; border-right:#D6DDE9 2px solid"  align="center" cellpadding="4" cellspacing="0"  bordercolorlight="#D6DDE9" bordercolordark="#ffffff">
        <tr>
          <td  height="37" colspan="3" align="center" class="bg"><img src="skin/images.png" width="16" height="16">&nbsp;&nbsp;&nbsp;<strong><span class="ziti-lvse1">新&nbsp;&nbsp;闻&nbsp;&nbsp;信&nbsp;&nbsp;息&nbsp;&nbsp;管&nbsp;&nbsp;理</span></strong></td>
  </tr>
        <tr>
          <td width="32%"  height="41" align="left" class="bai" ><strong><span class="ziti-lvse1">&nbsp;
            <input type="submit" value="新闻列表" onClick="self.location.href='?index=index1'" style="height:26px;line-height:20px">
&nbsp;
<input type="submit" value="添加文章" onClick="self.location.href='?index=index2'" style="height:26px;line-height:20px">
</span></strong>  </td>
          <td width="48%" align="left" class="bai" ><table border="0" width="98%" align="center" cellspacing="0" cellpadding="0">
      <form id="form1" name="form1" method="post" action="?s=ok&index=index1">  <tr>
          <td width="7%"  height="5" align="center">
         <img src="img/001_38.gif" width="24" height="24" /></td>
          <td width="93%" align="left">文章搜索：
            <input name="txt1" type="text" />
&nbsp;
<input type="submit" name="button2" id="button2" value="立即搜索" style="height:26px;line-height:20px" /></td>
        </tr>
      </form>
      </table></td>
          <td width="20%" align="left" class="bai" >
          
          
          <script language=javascript>
			function MM_jumpMenu(){
				var href=document.all.menu1.value;
				if(href!="")
				window.location=href;
			}
		</script>
	  <select onChange="MM_jumpMenu()" name=menu1 class="cls_channel" title="这里可以按会员的等级查看" >
	    <option selected>按信息分类查看</option>  
 <%
Set rsss= Server.CreateObject("ADODB.Recordset")
sql="SELECT dalei FROM news GROUP BY dalei"
rsss.open sql,conn,1,1
'order by ××× asc  升序
'order by ××× desc 降序
do while not rsss.eof
%>
  <option value="?fl=<%=Rsss("dalei")%>&index=index1"><%=Rsss("dalei")%></option>  
 <%
rsss.movenext
loop
%> 
	    </select>       
                  
          </td>
        </tr>

         </table>
<table border="0" width="98%" align="center" cellspacing="0" cellpadding="0">
        <tr>
          <td  height="10"></td>
  </tr>
</table>
<%
if index="index1" then
%>  
<script language=javascript>
function ConfirmDel()
{
   if(confirm("确定要删除此信息吗？"))
     return true;
   else
     return false;
}
</script>    
 <table border="1" width="100%" style="font-size: 12px; border-bottom:#D6DDE9 3px solid; border-left:#D6DDE9 1px solid; border-top:#D6DDE9 1px solid; border-right:#D6DDE9 2px solid"  align="center" cellpadding="4" cellspacing="0"  bordercolorlight="#D6DDE9" bordercolordark="#ffffff">
   <tr class="bj-hui">
     <td  height="32" align="left">&nbsp;&nbsp;<img src="img/comments.gif" alt="" width="16" height="16" />&nbsp;&nbsp;<strong><span class="ziti-lvse">文章标题</span></strong></td>
     <td align="center"><img src="img/tag.gif" alt="" width="16" height="16" />&nbsp;<strong><span class="ziti-lvse">文章大类</span></strong></td>
     <td align="center"><img src="img/tag.gif" alt="" width="16" height="16">&nbsp;<strong><span class="ziti-lvse">文章小类</span></strong></td>
     <td width="24%" align="center"><img src="img/time.gif" alt="" width="16" height="16">&nbsp;&nbsp;<strong><span class="ziti-lvse">添加时间</span></strong></td>
     <td width="15%" align="center" class="ziti-lvse"><img src="skin/wrench.png" width="16" height="16">&nbsp;管理</td>
   </tr>
 
  <%
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet") 
if s="ok" then
sql="select * from [news] where title like '%"&txt1&"%' order by id desc"
pgg=""
end if
if fl<>"" then
sql="select * from [news] where dalei='"&fl&"' order by id desc"
pgg="&fl="&fl
end if
if s="" and fl="" then
sql="select * from [news] order by id desc"
pgg=""
end if
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
response.Write("<table width='100%' style='border-bottom:#D6DDE9 2px solid; border-left:#D6DDE9 1px solid; border-top:#D6DDE9 1px solid;border-right:#D6DDE9 2px solid'><tr align='center'><td colspan='8'><br> &nbsp;&nbsp;数据中没有记录!<br><br></td></tr></table>")
else
rs.PageSize=20
if page=0 then page=1 
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page  
for j=1 to rs.PageSize 
%>
        <tr class="bai">
          <td width="29%"  height="29" align="left" title="<%=rs("Title")%>">&nbsp;
		  <%
if len(rs("Title"))<=14 then
response.Write(rs("Title"))
else
response.Write(left(rs("Title"),15)&"...")
end if
%>  </td>
          <td width="15%"  height="29" align="center">&nbsp;<%=Rs("dalei")%> </td>
          <td width="17%" align="center">&nbsp; <%=Rs("xiaolei")%> </td>
          <td align="center">&nbsp;<%=Rs("time")%>  </td>
          <td align="center"><a href="?bianji=ok&id=<%=Rs("id")%>&index=index2">编辑</a>&nbsp;&nbsp;&nbsp;<a href="?del=ok&id=<%=rs("id")%>" onclick="return ConfirmDel();">删除</a></td>
        </tr>
 <%
rs.movenext
if rs.eof then exit for
next  
end if                                                     
%>
</table>
      <table  width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td  height="10"></td>
        </tr>
</table>



<table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
  <form method=Post action="news.asp?index=index1<%=pgg%>">  
    <td height="18" align="center"><%if Page<2 then      
    response.write "第一页 上一页&nbsp;"
  else
    response.write "<a href=news.asp?index=index1&page=1"&pgg&">第一页</a>&nbsp;"
    response.write "<a href=news.asp?index=index1&page=" & Page-1 &pgg& ">上一页</a>&nbsp;"
  end if
  if rs.pagecount-page<1 then
    response.write "下一页 最后一页"
  else
    response.write "<a href=news.asp?index=index1&page=" & (page+1) & pgg&">"
    response.write "下一页</a> <a href=news.asp?index=index1&page="&rs.pagecount&pgg&">最后一页</a>"
  end if
   response.write "&nbsp;页次：<strong><font color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
    response.write "&nbsp;共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条记录 <b>"&rs.pagesize&"</b>条记录/页"
   response.write " 转到：<input type='text' name='page' size=4 maxlength=10  value="&page&">"
   response.write " <input class=input type='submit'  value='转到'  name='cndok'>"     
%></td></form>
  </tr>
</table>
<%end if%>
<%
if index="index2" then
%>   
<%
set rs=server.createobject("adodb.recordset")
sql = "select * from news2 order by id asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
sql="select * from [news1] where id="&Rs("did")&""
Set rs222=conn.execute(sql)
%>
subcat[<%=count%>] = new Array("<%= trim(Rs("name"))%>","<%= trim(rs222("name"))%>","<%= trim(Rs("name"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.xiaolei.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.xiaolei.options[document.myform.xiaolei.length] = new Option(subcat[i][0], 

subcat[i][2]);
            }        
        }
    }    
</script>   
<table border="0" width="100%" style="font-size: 12px; border-bottom:#D6DDE9 3px solid; border-left:#D6DDE9 1px solid; border-top:#D6DDE9 1px solid; border-right:#D6DDE9 2px solid"  align="center" cellpadding="4" cellspacing="0"  bordercolorlight="#D6DDE9" bordercolordark="#ffffff">
<%
if bianji="ok" then
sql="select * from [news] where id="&id&""
Set rsww=conn.execute(sql)
%>
 <form name="myform" method="post" action="?index=index5&id=<%=id%>"> <tr class="bj-hui">
     <td  height="44" align="center" class="ziti-lvse">文章标题</td>
     <td width="89%" align="left">
       <label for="title"></label>
       <input name="title" type="text" id="title" size="40" value="<%=Rsww("title")%>">
      &nbsp;&nbsp;<span class="huang-zi">文章大类：</span>
      <%
        sql = "select * from news1"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
                    <select name="dalei" onChange="changelocation(document.myform.dalei.options[document.myform.dalei.selectedIndex].value)" size="1">
                      <option selected value="<%=trim(rsww("dalei"))%>"><%=trim(rsww("dalei"))%></option>
                      <%
			 
		    selclass=rs("name")
		    do while not rs.eof
			%>
                      <option value="<%=trim(rs("name"))%>"><%=trim(rs("name"))%></option>
                      <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
                    </select>
                    <select name="xiaolei">
                    <option value="<%=rsww("xiaolei")%>"><%=rsww("xiaolei")%></option>
                      <option value="" >不指定小类</option>
                      <%
			sql="select * from news2 where name='" & selclass & "'"
			rs.open sql,conn,1,1
			if not(rs.eof and rs.bof) then
			%>
                      <option value="<%=rs("name")%>"><%=rs("name")%></option>
                      <% rs.movenext
				do while not rs.eof%>
                      <option value="<%=rs("name")%>"><%=rs("name")%></option>
                      <%
			    	rs.movenext
				loop
			end if
	        rs.close
			%>
                      <%
			iddata=year(date())&month(date())&day(date())&hour(now())&minute(now())&second(now()) & Int(10*Rnd)
			%>
                    </select> 
      
      </td>
   </tr>
        <tr class="bai">
          <td width="11%" rowspan="2" align="center" class="zi-hei3">内容： </td>
          <td height="325" align="center">
          
          <input name="content" type="hidden" value="<%=Server.HTMLEncode(Rsww("content"))%>">
          <iframe ID="eWebEditor1" src="adminexe/ewebeditor.asp?id=content&style=southidc" frameborder="0" scrolling="no" width="100%" HEIGHT="350"></iframe></td>
        </tr>
         <tr class="bai">
          <td  height="63" align="center" class="zi-hei3"><input type="submit" name="button" id="button" value="保存文章信息" style="height:36px;line-height:30px"></td>
        </tr>
  </form>
<%
else
%>
        <form name="myform" method="post" action="?index=indexjia"> <tr class="bj-hui">
     <td  height="44" align="center" class="ziti-lvse">文章标题</td>
     <td align="left">
       <label for="title"></label>
       <input name="title" type="text" id="title" size="40">
      &nbsp;&nbsp;文章大类： 
      
      <%
        sql = "select * from news1"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
                    <select name="dalei" onChange="changelocation(document.myform.dalei.options[document.myform.dalei.selectedIndex].value)" size="1">
                      <%
			dim selclass
		    selclass=rs("name")
		    do while not rs.eof
			%>
                      <option value="<%=trim(rs("name"))%>"><%=trim(rs("name"))%></option>
                      <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
                    </select>
                    <select name="xiaolei">
                      <option value="" selected>不指定小类</option>
                      <%
			sql="select * from news2 where name='" & selclass & "'"
			rs.open sql,conn,1,1
			if not(rs.eof and rs.bof) then
			%>
                      <% rs.movenext
				do while not rs.eof%>
                      <option value="<%=rs("name")%>"><%=rs("name")%></option>
                      <%
			    	rs.movenext
				loop
			end if
	        rs.close
			%>
                      <%
			iddata=year(date())&month(date())&day(date())&hour(now())&minute(now())&second(now()) & Int(10*Rnd)
			%>
                    </select> 
      
      </td>
   </tr>
        <tr class="bai">
          <td width="11%" rowspan="2" align="center" class="zi-hei3">内容： </td>
          <td height="325" align="center">
          <input name="content" type="hidden" value="">
          <iframe ID="eWebEditor1" src="adminexe/ewebeditor.asp?id=content&style=southidc" frameborder="0" scrolling="no" width="100%" HEIGHT="350"></iframe></td>
        </tr>
         <tr class="bai">
          <td  height="63" align="center" class="zi-hei3"><input type="submit" name="button" id="button" value="添加文章信息" style="height:36px;line-height:30px"></td>
        </tr>
  </form>
<%end if%>
</table>
<%end if%>
<%
conn.close
set conn=nothing
%>