<!--#include file="conn.asp"-->
<%set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from shjia where name='"&request.Cookies("godbook")("shjianame")&"' ",conn,1,1
id=rs_s("shjiaid")

action=request("action")
select case action
case "addnews"
	call addnews()
case "savenews"
	call savenews()
case "editnews"
	call editnews()
case "saveedit"
	call saveedit()
case "newslists"
	call newslists()
case "delnews"
	call delnews()
end select%>

<%sub addnews()%>

<link href="../image/css.css" rel="stylesheet" type="text/css">
<link href="images/bg.css" rel="stylesheet" type="text/css">
</head><body topmargin="2">
<img src="images/1.jpg">
<%end sub
sub newslists()%>
<link href="../image/css.css" rel="stylesheet" type="text/css">
<link href="images/bg.css" rel="stylesheet" type="text/css">
<table class="tableBorder" width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#EFF7CE">
<tr> 
<td align="center" bgcolor="#63C700" height="25" colspan="4">管理新闻</td>
</tr>
<tr bgcolor="#EFF7CE" align="center"> 
<td width="10%">序号 </td>
<td width="50%">新闻标题</td>
<td width="30%">添加时间</td>
<td width="10%">操作</td>
</tr>
<%  set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from news where shjiaid="&id&" order by addtime desc",conn,1,1
	if err.number<>0 then
	request.write "数据库中无数据"
	end if  
	do while not rs.eof
	%>
	<tr bgcolor="#EFF7CE"> 
    <td align="center"><a href="../news_shjia.asp?id=<%=rs("newsid")%>" target="_blank"><%=rs("newsid")%></a></td>
    <td bgcolor="#EFF7CE" style='PADDING-LEFT: 10px'><a href=?action=editnews&newsid=<%=rs("newsid")%>><%=rs("title")%></a></td>
    <td align="center"><%=rs("addtime")%></td>
	<td align="center"><a href="?action=delnews&newsid=<%=rs("newsid")%>"><font color="#FF0000">删除</font></a> 
    </td>
</tr>
<%rs.movenext
  	loop	
	rs.close
	set rs=nothing%>	
</table>
<%end sub%>