<!--#include file="../inc/DAL.asp"-->
<!--#include file="../inc/page.asp"-->
<!--#include file="Check.asp"-->
<%
Dim ConfigRS
Set ConfigRS=Server.CreateObject( "ADODB.Recordset" )
if request.form("Method")="AddGift" then
    ConfigRS.OPEN "select top 1 * from [i_Sys_Notice]" , DB_CONN , 1 , 3
    ConfigRS.addnew()
    ConfigRS("i_Sys_Notice_Name")=request.form("i_Sys_Notice_Name")
    ConfigRS("i_Sys_Notice_Href")=request.form("i_Sys_Notice_Href")
    ConfigRS("i_Sys_Notice_Sort")=request.form("i_Sys_Notice_Sort")
    ConfigRS("i_Sys_Notice_Content")=request.form("i_Sys_Notice_Content")
    ConfigRS.update()
    ConfigRS.close()
    RW "<script>location.href='SetIndexNotice.asp?t="&request.QueryString("t")&"';</script>":response.end()
end if

if request.QueryString("Method")="Del" then 
    DB_CONN.EXECUTE("delete from [i_Sys_Notice] where [i_Sys_Notice_ID]="&request.QueryString("ID"))
    RW "<script>location.href='SetIndexNotice.asp?t="&request.QueryString("t")&"';</script>":response.end()
end if

Set ConfigRS=DB_CONN.EXECUTE("select * from [i_Sys_Notice] order by [i_Sys_Notice_Sort] desc,[i_Sys_Notice_Time] desc")

ConfigRS.pagesize=20
if isempty(request("page")) or request("page")="" then curpage=1 else curpage=Cint(request("page")) end if
if not ConfigRS.eof then ConfigRS.absolutepage = curpage
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>iShow Manage System</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/layoutContent.css" rel="stylesheet" type="text/css" />
<link href="themes/blue/styles.css" rel="stylesheet" type="text/css" />
<style>
.JSTB{border:#ccc solid 1px;border-right:none;border-bottom:none;margin-top:20px;}
.JSTB th,.JSTB td{border-bottom:#ccc solid 1px; border-right:#ccc solid 1px;}
</style>
</head>
<body>
<div class="contentcontainer">
    <div class="headings alt">
        <h2>首页公告&nbsp;&nbsp;&nbsp;<a href="SetNotice.asp" style="text-decoration:none;">系统公告设置</a></h2>
    </div>
    <div class="contentbox">
        <table class="JSTB" width="100%" cellpadding="0" cellspacing="0" border="0">
            <th colspan="10">公告列表</th>
            <tr>
                <td>ID</td>
                <td>标题</td>
                <td>链接地址</td>
                <td>内容</td>
                <td>发布时间</td>
                <td>排序</td>
                <td>操作</td>
            </tr>
            <%
            dim iPage 
            while (not ConfigRS.eof and iPage<ConfigRS.pagesize )
            %>
            <tr>
                <td>&nbsp;<%=ConfigRS("i_Sys_Notice_ID")%></td>
                <td>&nbsp;<%=ConfigRS("i_Sys_Notice_Name")%></td>
                <td>&nbsp;<%=ConfigRS("i_Sys_Notice_Href")%></td>
                <td>&nbsp;<%=ConfigRS("i_Sys_Notice_Content")%></td>
                <td>&nbsp;<%=ConfigRS("i_Sys_Notice_Time")%></td>
                <td>&nbsp;<%=ConfigRS("i_Sys_Notice_Sort")%></td>
                <td>&nbsp;<a href="?Method=Del&t=<%=request.QueryString("t")%>&ID=<%=ConfigRS("i_Sys_Notice_ID")%>" onclick="return confirm('确认要删除吗?');">删除</a>
                </td>
            </tr>
            <%
            iPage=iPage+1
            ConfigRS.MoveNext
            wend
            %>
            <tr>
                <td colspan="10"><%=ExportPageInfo(ConfigRS,curpage,iPage,"SetIndexNotice.asp?1=1"&replace(Request.QueryString,"page","1")&"&")%></td>
            </tr>
        </table>
        
        <form action="#" method="post" >
            <table class="CB" width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td width="350">
                        <label for="i_Sys_Notice_Name"><strong>公告标题:</strong></label>
                        <input type="text" id="i_Sys_Notice_Name" name="i_Sys_Notice_Name" class="inputbox" value=""/>
                    </td>
                    <td>
                        <label for="i_Sys_Notice_Href"><strong>公告链接:</strong></label>
                        <input type="text" id="i_Sys_Notice_Href" name="i_Sys_Notice_Href" class="inputbox" value=""/>
                    </td>
                </tr>
                <tr>
                    <td clospan="2">
                        <label for="i_Sys_Notice_Sort"><strong>排序(数字):</strong></label>
                        <input type="text" id="i_Sys_Notice_Sort" name="i_Sys_Notice_Sort" class="inputbox" value="0"/>
                    </td>
                </tr>
                <tr>
                    <td clospan="2">
                        <label for="i_Sys_Notice_Content"><strong>内容:</strong></label>
                        <textarea cols="40" rows="5" name="i_Sys_Notice_Content" id="i_Sys_Notice_Content"></textarea>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input type="hidden" value="AddGift" name="Method"/>
                        <input type="submit" value="新增" class="btn" />
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
</body>
</html>
