📄 wm.sys_announce.asp
字号:
<!--#include file="WM.Sys_Cook.asp"-->
<%
If CheckAdminFlag("Announce") = False Then Call WRMPS.ErrView("·您没有权限进行此操作",0)
Call WM_Content()
Sub WM_Content()
Dim WM_Sort,WM_Tit,WM_Content,WM_Time,WM_Begin,WM_End,WM_ShowType,WM_Key,SearchSort,Sql,i,ID
Page = WRMPS.CheckStr(Request("Page"), 1)
SearchSort = WRMPS.CheckStr(Request("SearchSort"), 1)
Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Content = Content & "<form name='form1' action='WM.Sys_Announce.asp' method='post'><tr class=td2><td colspan=2> <a href=WM.Sys_Announce.asp>管理首页</a> | <a href=?Action=Add>添加公告</a>"
Content = Content & " <select name=SearchSort onChange='javascript:submit()'>" & vbCrLf
Content = Content & "<option value=''" & WRMPS.GetCheckVer("", SearchSort, 0) & ">查看所有公告</option>" & vbCrLf
Content = Content & "<option value='-1'" & WRMPS.GetCheckVer("-1", SearchSort, 0) & ">查看所有共用公告</option>" & vbCrLf
Content = Content & "<option value='0'" & WRMPS.GetCheckVer("0", SearchSort, 0) & ">查看网站首页公告</option>" & vbCrLf
Call DBConnBegin()
Set Rs = server.createobject("adodb.recordset")
Set Rso = Conn.Execute("Select WM_ID,WM_ChannelName From WM_Channel Where WM_Module in(1,2,4,5,6) and WM_Key > 0 Order By WM_OrderID")
Do While Not Rso.Eof
Content = Content & "<option value='"&Rso(0)&"'" & WRMPS.GetCheckVer(""&Rso(0)&"", SearchSort, 0) & ">查看"&Rso(1)&"公告</option>" & vbCrLf
Rso.Movenext
Loop
Rso.Close
Content = Content & "</select></td></tr></form>" & vbCrLf
Content = Content & "</Table>" & vbCrLf
Select Case WRMPS.CheckStr(Request("Action"), 0)
Case "Add"
Content = Content & "<Script language='JavaScript' Src='../Inc/GetDate.Js'></Script>" & vbCrLf
Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Content = Content & "<tr class=td4><td Colspan=2><strong>添加公告</strong></td></tr>" & vbCrLf
Content = Content & "<form name='addform' method='post' Action='?Action=Save'>" & vbCrLf
Content = Content & "<tr class=td2><td width='20%'><strong>所属频道</strong></td><td width='80%'>"
Content = Content & "<select name='WM_Sort'>" & vbCrLf
Content = Content & "<option value='-1'>共用公告</option>" & vbCrLf
Content = Content & "<option value='0' selected>网站首页公告</option>" & vbCrLf
Set Rs = Conn.Execute("Select WM_ID,WM_ChannelName From WM_Channel Where WM_Module in(1,2,4,5,6) and WM_Key > 0 Order By WM_OrderID")
Do While Not Rs.Eof
Content = Content & "<option value='"&Rs(0)&"'>"&Rs(1)&"公告</option>" & vbCrLf
Rs.Movenext
Loop
Rs.Close
Content = Content & "</select> <font Class=Font2>*</font></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>标题</strong></td><td><input name='WM_Tit' type='text' style='width:400' maxlength='50' value=''> <font Class=Font2>*</font></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>内容</strong></td><td><INPUT type='hidden' name='Content' value=''><IFRAME ID=EditContent SRC='../Plus/Edit/edit.asp?ID=Content&sMode=EDIT&Tool=EDIT' FRAMEBORDER=0 SCROLLING=no WIDTH=600 HEIGHT=300></IFRAME> <font Class=Font2>*</font></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>发布时间</strong></td><td><input name='WM_Time' type='text' style='width:150' maxlength='50' value='"&Now()&"'> <font Class=Font2>*</font></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>有效期</strong><br>为空则永久有效</td><td><input name='WM_Begin' type='text' style='width:100' maxlength='10'><a style='cursor:pointer;' onClick='PopCalendar.show(document.addform.WM_Begin, ""yyyy-mm-dd"", null, null, null, ""11"");'><img src='../Images/other/Calendar.gif' border='0' Style='Padding-Top:10px' align='absmiddle'></a> 至 <input name='WM_End' type='text' style='width:100' maxlength='10'><a style='cursor:pointer;' onClick='PopCalendar.show(document.addform.WM_End, ""yyyy-mm-dd"", null, null, null, ""11"");'><img src='../Images/other/Calendar.gif' border='0' Style='Padding-Top:10px' align='absmiddle'></a></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>显示类型</strong></td><td><input type='radio' name='ShowType' value=0 Class=Radio>全部 <input type='radio' name='ShowType' value=1 checked Class=Radio>平板 <input type='radio' name='ShowType' value=2 Class=Radio>弹出 <font Class=Font2>*</font></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>是否显示</strong></td><td><input type='radio' name='Key' value=1 Class=Radio checked>显示 <input type='radio' name='Key' value=0 Class=Radio>关闭 <font Class=Font2>*</font></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>模板选择</strong></td><td>"&TempSelect(0,12,0,"TempID")&"</td></tr>" & vbCrLf
Content = Content & "<tr class=td3><td></td><td><input type=submit name='Submit' value='提 交'></td></tr>" & vbCrLf
Content = Content & "</form></table><script>document.addform.WM_Tit.focus()</script>" & vbCrLf
Case "Edit"
Content = Content & "<Script language='JavaScript' Src='../Inc/GetDate.Js'></Script>" & vbCrLf
Rso.Open "Select WM_Tit,WM_Content,WM_User,WM_Time,WM_ShowType,WM_Sort,WM_Key,WM_BeginDate,WM_EndDate,WM_TempID From WM_Announce Where WM_ID = " & WRMPS.CheckStr(Request("ID"), 1) & "", Conn, 1, 1
If Not Rso.EOF Then
Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 class=td1>" & vbCrLf
Content = Content & "<tr class=td4><td Colspan=2><strong>添加公告</strong></td></tr>" & vbCrLf
Content = Content & "<form name='addform' method='post' Action='?Action=EditSave&Page="&Page&"&SearchSort="&SearchSort&"&ID="&WRMPS.CheckStr(Request("ID"), 1)&"'>" & vbCrLf
Content = Content & "<tr class=td2><td width='20%'><strong>所属频道</strong></td><td width='80%'>"
Content = Content & "<select name='WM_Sort'>" & vbCrLf
Content = Content & "<option value='-1'" & WRMPS.GetCheckVer(-1, Rso(5), 0) & ">共用公告</option>" & vbCrLf
Content = Content & "<option value='0'" & WRMPS.GetCheckVer(0, Rso(5), 0) & ">网站首页公告</option>" & vbCrLf
Set Rs = Conn.Execute("Select WM_ID,WM_ChannelName From WM_Channel Where WM_Module in(1,2,4,5,6) and WM_Key > 0 Order By WM_OrderID")
Do While Not Rs.Eof
Content = Content & "<option value='"&Rs(0)&"'" & WRMPS.GetCheckVer(Rs(0), Rso(5), 0) & ">"&Rs(1)&"公告</option>" & vbCrLf
Rs.Movenext
Loop
Rs.Close
Content = Content & "</select> <font Class=Font2>*</font></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>标题</strong></td><td><input name='WM_Tit' type='text' style='width:400' maxlength='50' value='"&Rso(0)&"'> <font Class=Font2>*</font></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>内容</strong></td><td>"
Content = Content & "<INPUT type='hidden' name='Content'"
If Rso(1) <> "" Then
Content = Content & " Value=""" & Server.HTMLEncode(WRMPS.CheckStr(Rso(1), 5)) & """>" & vbCrLf
Else
Content = Content & " Value=''>" & vbCrLf
End If
Content = Content & "<IFRAME ID=EditContent SRC='../Plus/Edit/edit.asp?ID=Content&sMode=EDIT&Tool=EDIT' FRAMEBORDER=0 SCROLLING=no WIDTH=600 HEIGHT=300></IFRAME> <font Class=Font2>*</font></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>发布时间</strong></td><td><input name='WM_Time' type='text' style='width:150' maxlength='50' value='"&Rso(3)&"'> <font Class=Font2>*</font></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>有效期</strong><br>为空则永久有效</td><td><input name='WM_Begin' type='text' style='width:100' maxlength='10' value='"&Rso(7)&"'><a style='cursor:pointer;' onClick='PopCalendar.show(document.addform.WM_Begin, ""yyyy-mm-dd"", null, null, null, ""11"");'><img src='../Images/other/Calendar.gif' border='0' Style='Padding-Top:10px' align='absmiddle'></a> 至 <input name='WM_End' type='text' style='width:100' maxlength='10' value='"&Rso(8)&"'><a style='cursor:pointer;' onClick='PopCalendar.show(document.addform.WM_End, ""yyyy-mm-dd"", null, null, null, ""11"");'><img src='../Images/other/Calendar.gif' border='0' Style='Padding-Top:10px' align='absmiddle'></a></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>显示类型</strong></td><td><input type='radio' name='ShowType' value=0 Class=Radio" & WRMPS.GetCheckVer(0, Rso(4), 1) & ">全部 <input type='radio' name='ShowType' value=1 Class=Radio" & WRMPS.GetCheckVer(1, Rso(4), 1) & ">平板 <input type='radio' name='ShowType' value=2 Class=Radio" & WRMPS.GetCheckVer(2, Rso(4), 1) & ">弹出 <font Class=Font2>*</font></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>是否显示</strong></td><td><input type='radio' name='Key' value=1 Class=Radio" & WRMPS.GetCheckVer(1, Rso(6), 1) & ">显示 <input type='radio' name='Key' value=0 Class=Radio" & WRMPS.GetCheckVer(0, Rso(6), 1) & ">关闭 <font Class=Font2>*</font></td></tr>" & vbCrLf
Content = Content & "<tr class=td2><td><strong>模板选择</strong></td><td>"&TempSelect(Rso(9),12,0,"TempID")&"</td></tr>" & vbCrLf
Content = Content & "<tr class=td3><td></td><td><input type=submit name='Submit' value='提 交'></td></tr>" & vbCrLf
Content = Content & "</form></table><script>document.addform.WM_Tit.focus()</script>" & vbCrLf
End If
Rso.Close
Case "EditSave"
WM_Sort = WRMPS.CheckStr(Request.Form("WM_Sort"),1)
If WM_Sort = "" Then WM_Sort = 0
WM_Tit = WRMPS.CheckStr(Request.Form("WM_Tit"),0)
If WM_Tit = "" Or Len(WM_Tit) > 50 Then Call WRMPS.ErrView("·请输入不大于50字符的公告标题", 0): Exit Sub
For i = 1 To Request.Form("Content").Count
WM_Content = WM_Content & Request.Form("Content")(i)
Next
WM_Content = WRMPS.CheckStr(WM_Content, 5)
If WM_Content = "" Then Call WRMPS.ErrView("·请输入公告内容", 0): Exit Sub
WM_Time = Request.Form("WM_Time")
If IsDate(WM_Time) = False Or WM_Time = "" Then WM_Time = Now()
WM_Begin = WRMPS.CheckStr(Request.Form("WM_Begin"),0)
WM_End = WRMPS.CheckStr(Request.Form("WM_End"),0)
If WM_Begin <> "" and IsDate(WM_Begin) Then WM_Begin = CDate(WM_Begin) Else WM_Begin = Null
If WM_End <> "" and IsDate(WM_End) Then WM_End = CDate(WM_End) Else WM_End = Null
If WM_Begin <> "" And WM_End <> "" Then
If CDate(WM_End) <= CDate(WM_Begin) Then Call WRMPS.ErrView("·有效期限输入有误", 0): Exit Sub
End If
WM_ShowType = WRMPS.CheckStr(Request.Form("ShowType"),1)
If WM_ShowType = "" Then WM_ShowType = 1
WM_Key = WRMPS.CheckStr(Request.Form("Key"),1)
If WM_Key = "" Then WM_Key = 1
TempID = WRMPS.CheckStr(Request.Form("TempID"), 1)
If TempID = "" Then TempID = 0
Rs.Open "Select WM_Tit,WM_Content,WM_Time,WM_ShowType,WM_Sort,WM_Key,WM_BeginDate,WM_EndDate,WM_TempID From WM_Announce Where WM_ID = " & WRMPS.CheckStr(Request("ID"), 1) & "" ,Conn , 1,3
Rs(0) = WM_Tit
Rs(1) = WM_Content
Rs(2) = WM_Time
Rs(3) = WM_ShowType
Rs(4) = WM_Sort
Rs(5) = WM_Key
Rs(6) = WM_Begin
Rs(7) = WM_End
Rs(8) = TempID
Rs.Update
Rs.Close
Call WRMPS.ErrView("·公告修改成功<meta http-equiv=refresh content='1;URL=?SearchSort="&SearchSort&"&Page=" & Page & "'>",1)
Case "Save"
WM_Sort = WRMPS.CheckStr(Request.Form("WM_Sort"),1)
If WM_Sort = "" Then WM_Sort = 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -