<!--#include file="setup.asp"-->
<!--#include file="plus/Ex_Stock/Exsm_Plus_Conn.asp"-->
<!--#include file="plus/Ex_Stock/Exsm_Plus_Const.asp"-->
<%
	Dim currentPage,page_count,totalrec,Pcount
	'检查用户名和ＩＤ是否合法
	If Exsm.UserID="" or Exsm.UserID=0 or not isnumeric(Exsm.UserID) or Exsm.StockHolder="" Then
		Response.Redirect "Exsm_Plus_Gupiao.asp"
	Else
		set Rs=stock_conn.execute("select UserName,LockUser from Ex_User where ID="&Exsm.UserID&"")
		'是否存在用户
		If Rs.eof and Rs.bof Then
			Response.Redirect "Exsm_Plus_Gupiao.asp"
		'用户是否锁定
		Elseif Rs(1)>1 Then
			Response.Redirect "Exsm_Plus_Gupiao.asp"
		'是否已经登录
		Elseif not Exsm.Members Then
			Response.Redirect "Exsm_Plus_Gupiao.asp"
		'检查用户等级
		Elseif not Exsm.StockAdmin Then
			Response.Redirect "Exsm_Plus_Gupiao.asp"
		'再次验证身份
		Elseif not Rs(0)=Exsm.StockHolder Then
			Response.Redirect "Exsm_Plus_Gupiao.asp"
		Else
			select case request("action")
				case "glance1"
					call glance1()
				case "AddAnn"
					call AddAnn()
				case "SaveAnnB"
					call SaveAnnB()
				case "EditAnn"
					call EditAnn()
				case "DelAnnA"
					call DelAnnA()
				case "EditAnnInfo"
					call EditAnnInfo()
				case "AnnAEdit"
					call AnnAEdit()
				case "AddAnn1"
					call AddAnn1()
				case "SaveAnnA"
					call SaveAnnA()
				case "EditAnn1"
					call EditAnn1()
				case "DelAnnB"
					call DelAnnB()
				case "EditAnnInfo1"
					call EditAnnInfo1()
				case "AnnBEdit"
					call AnnBEdit()
				case else
					call main()
			End select
		End if
	End if
	Sub main()
		Exsm.Title 1,"浏览股市公告"
%>
		<table class=a2 width=<%=Exsm.AssignWidth%> cellspacing=1 cellpadding=3 align=center border=0>
			<tr>
				<td colspan=3 align=center height=25 class=a1>-=> 浏 览 股 市 公 告 <=-</td>
			</tr>
<%
			sql="select Title,Content,Color,AddTime,UserName,id from EX_Announcement order by ID desc"
			set rs=stock_conn.execute(sql)
			If rs.eof and rs.bof Then
				response.Write "<tr><td class=a3>当前没有公告。</td></tr></table>"
			End if
			currentPage=request("page")
			If currentpage="" or not isnumeric(currentpage) Then
				currentpage=1
			End if
			Set rs= Server.CreateObject("ADODB.Recordset")
			rs.open sql,stock_conn,1,1
			If rs.eof and rs.bof Then
			else
				rs.PageSize=CInt(Exsm.Setting_Info(15))
				rs.AbsolutePage=currentpage
				page_count=0
				totalrec=rs.recordcount
				do while (not rs.eof) and (not page_count = rs.PageSize)
%>
			<tr>
				<td height=25 colspan=2 class=a3 align=center><b>-=> <%=server.htmlencode(rs("title"))%> <=-</b></td>
			</tr>	
			<tr>
				<td class=a3 colspan=2 valign=top><br><blockquote><%=rs("content")%></blockquote></td>  
			</tr>
			<tr>
				<td colspan=1 class=a4>&nbsp;<b>发布人</b>：<%=server.htmlencode(rs("username"))%></td>
				<td colspan=1 class=a4 align=right><b>发布时间</b>： <%=rs("addtime")%>&nbsp;</td>
			</tr>
<%
				page_count = page_count + 1
				rs.movenext
				loop
			Pcount=rs.PageCount
%>
		</table>
		<table width=<%=Exsm.AssignWidth%> cellspacing=0 cellpadding=1 align=center border=0>
			<tr>
				<td align=left>&nbsp;共 <font color=blue><%=totalrec%></font> 条，每页 <font color=blue><%=rs.PageSize%></font> 条，第 <font color=red><%=currentpage%></font> 页 / 共 <font color=blue><%=Pcount%></font> 页</td><td align=right><%call Exsm.DispPageNum(currentpage,Pcount,"""?action=glance&page=","""")%>&nbsp;</td>
			</tr>
		</table>
<%
			End if
			rs.close
			set rs=nothing
		Exsm.RootShowA
	End Sub
	Sub glance1()
		Exsm.Title 1,"浏览股市即时信息"
%>
		<table class=a2 width=<%=Exsm.AssignWidth%> cellspacing=1 cellpadding=3 align=center border=0>
			<tr>
				<td colspan=3 align=center height=25 class=a1>-=> 浏 览 股 市 即 时 信 息 <=-</td>
			</tr>
			<tr align=center valign="middle" > 
				<td class=a4 width=35><b>ID</b></td>
				<td class=a4><b>公告内容</b></td>
				<td class=a4 width=160><b>发布时间</b></td>
			</tr>
<%
			sql="select * from EX_News order by ID desc"
			set rs=stock_conn.execute(sql)
			If rs.eof and rs.bof Then
				Response.Write "<tr><td class=a3 colspan=3>当前没有即时信息。</td></tr></table>"
			End if
			currentPage=request("page")
			If currentpage="" or not isnumeric(currentpage) Then
				currentpage=1
			End if
			Set rs= Server.CreateObject("ADODB.Recordset")
			rs.open sql,stock_conn,1,1
			If rs.eof and rs.bof Then
			else
				rs.PageSize=CInt(Exsm.Setting_Info(16))
				rs.AbsolutePage=currentpage
				page_count=0
				totalrec=rs.recordcount
				do while (not rs.eof) and (not page_count = rs.PageSize)
%>
			<tr>
				<td class=a3 align=center><%=rs("id")%></td>
				<td class=a3 valign=top><Font color="<%=Rs("Color")%>">★&nbsp;<%=rs("content")%></Font></td>
				<td class=a3 align=center><%=rs("addtime")%></td>
			</tr>
<%
				page_count = page_count + 1
				rs.movenext
				loop
			Pcount=rs.PageCount
%>
		</table>
		<table width=<%=Exsm.AssignWidth%> cellspacing=0 cellpadding=1 align=center border=0>
			<tr>
				<td align=left>共 <font color=blue><%=totalrec%></font> 条，每页 <font color=blue><%=rs.PageSize%></font> 条，第 <font color=red><%=currentpage%></font> 页 / 共 <font color=blue><%=Pcount%></font> 页</td><td align=right width=28%><%call Exsm.DispPageNum(currentpage,Pcount,"""?action=glance1&page=","""")%></td>
			</tr>
		</table>
<%
			End if
			rs.close
			set rs=nothing
		Exsm.RootShowA
	End Sub
	Sub AddAnn()
		Exsm.Title 1,"发布即时信息"
%>
		<table class=a2 width=<%=Exsm.AssignWidth%> cellspacing=1 cellpadding=3 align=center border=0>
			<tr>
				<td colspan=2 align=center height=25 class=a1>-=> 发 布 即 时 信 息 <=-</td>
			</tr>
			<form action="?action=SaveAnnB" method="post" name="form2">
			<tr>
				<td class=a3 valign=top width=30%><b>内　　容</b>：<br><br>发表的内容请控制在[250]Byte以内<br><br><font color=red>HTML语法 支持<br>UBB 语法 不支持</font></td>
				<td class=a3><textarea cols="60" name="Content" rows="8"></textarea></td>
			</tr>
			<tr>
				<td class=a4 colspan=2 align=center><input type=submit name="submit" value="发 布"></td>
			</tr>
			</form>
		</table>
<%
		Exsm.RootShowA
	End Sub
	Sub SaveAnnB()
		Dim username,Mycontent,l_content
		If request("content")="" Or Exsm.Syllable(request("content"))>250 Then
			Exsm.Errmess="<li>请输入新闻内容，或内容长度大于了[250]Byte。"
			Call Exsm.Endinfo(1)
			Exit sub
		Else
			Mycontent=replace(request("content"),"'","")
		End if
		stock_conn.execute("insert into EX_News (content,Color,addtime) values('"&Mycontent&"','"&Exsm.RndColor&"',"&SqlSmNowString&")")
		l_content=replace("公新管理：发布新闻，内容："&Mycontent&" ","'","")
		stock_conn.execute("insert into EX_Log (l_boardid,l_touser,l_username,l_content,l_addtime,l_ip,l_type) values('"&Exsm.UserID&"','"&Exsm.ScriptName&"','"&Exsm.StockHolder&"','"&l_content&"',"&SqlSmNowString&",'"&Exsm.UserIP&"',1)")
		Exsm.DelStockCahe("Exsm_Imitate_News")
		Exsm.Sucmess="<li>您已经成功的发布了新闻。"
		Call Exsm.Endinfo(1)
	End Sub
	Sub EditAnn()
		Exsm.Title 1,"管理即时信息"
%>
		<table class=a2 width=<%=Exsm.AssignWidth%> cellspacing=1 cellpadding=3 align=center border=0>
			<tr>
				<td colspan=4 align=center height=25 class=a1>-=> 管 理 即 时 信 息 <=-</td>
			</tr>
			<tr>
		 		<td class=a4 align=center width=35><b>ID</b></th>
				<td class=a4 align=center><b>内容</b></th>
				<td class=a4 align=center width=160><b>发布时间</b></th>
				<td class=a4 align=center width=30><b>操作</b></th>
			</tr>
			<form action="?action=DelAnnA" method="post" name="form1">
<%
			Dim hf
			sql="select * from EX_News order by ID desc"
			set rs=stock_conn.execute(sql)
			If Rs.eof and rs.bof Then
				hf=0
				response.Write "<tr><td class=a3 colspan=5>当前没有新闻</td></tr></table>"
			End if
			hf=1
			currentPage=request("page")
			If currentpage="" or not isnumeric(currentpage) Then
				currentpage=1
			End if
			Set rs= Server.CreateObject("ADODB.Recordset")
			rs.open sql,stock_conn,1,1
			If rs.eof and rs.bof Then
			else
				rs.PageSize=CInt(Exsm.Setting_Info(16))
				rs.AbsolutePage=currentpage
				page_count=0
				totalrec=rs.recordcount
				do while (not rs.eof) and (not page_count = rs.PageSize)
%>
	    		<tr align="center">
	    			<td class=a3><%=Rs("id")%></td>
				<td class=a3 align="left"><a href="?action=EditAnnInfo&id=<%=Rs("id")%>"><Font color="<%=Rs("Color")%>">★&nbsp;<%=server.htmlencode(Replace(Replace(Rs("content"),"[ExU]",""),"[/ExU]",""))%></Font></a></td>
				<td class=a3><%=Rs("addtime")%></td>
	    			<td class=a3><input type="checkbox" name="id" value="<%=Rs("id")%>"></td>
			</tr>
<%
				page_count = page_count + 1
				rs.movenext
				loop
			Pcount=rs.PageCount
			If hf=1 Then
%>
			<tr>
				<td class=a4 colspan=4 align=right>请选择要删除的即时信息，<input type=checkbox name=chkall value=on onclick="CheckAll(this.form)">全选 <input type=submit name=Submit value=执行  onclick="{if(confirm('您确定执行删除操作吗?')){this.document.form1.submit();return true;}return false;}"></td>
			</tr>
<%
			End if
%>
			</form>
		</table>
		<table width=<%=Exsm.AssignWidth%> cellspacing=0 cellpadding=1 align=center border=0>
			<tr>
				<td align=left>共 <font color=blue><%=totalrec%></font> 条，每页 <font color=blue><%=rs.PageSize%></font> 条，第 <font color=red><%=currentpage%></font> 页 / 共 <font color=blue><%=Pcount%></font> 页</td><td align=right width=28%><%call Exsm.DispPageNum(currentpage,Pcount,"""?action=EditAnn&page=","""")%></td>
			</tr>
		</table>
		<script language="JavaScript">
		function CheckAll(form)
		{
			for (var i=0;i<form.elements.length;i++)
			{
				var e = form.elements[i];
				if (e.name != 'chkall')
				{
					e.checked = form.chkall.checked;
				}
			}
		}
		</script>
<%
			End if
		rs.close
		set rs=nothing
		Exsm.RootShowA
	End Sub
	Sub DelAnnA()
		Dim delid,l_content
		delid=replace(request.form("id"),"'","")
		If delid<>"" Then
			stock_conn.execute("delete from EX_News where id in ("&delid&")")
		Else
			Exsm.Errmess="<li>请选择要删除的即时消息。"
			Call Exsm.Endinfo(1)
			Exit sub
		End if
		l_content=replace("公新管理：删除新闻，ＩＤ："&delid&" ","'","")
		stock_conn.execute("insert into EX_Log (l_boardid,l_touser,l_username,l_content,l_addtime,l_ip,l_type) values('"&Exsm.UserID&"','"&Exsm.ScriptName&"','"&Exsm.StockHolder&"','"&l_content&"',"&SqlSmNowString&",'"&Exsm.UserIP&"',1)")
		Exsm.DelStockCahe("Exsm_Imitate_News")
		Exsm.Sucmess="<li>删除新闻成功。"
		Call Exsm.Endinfo(1)
	End Sub
	Sub EditAnnInfo()
		Dim ExRsAnnou
		If not isnumeric(request("id")) Then
			Exsm.Errmess="<li>错误的参数。"
			Call Exsm.Endinfo(1)
			Exit Sub
		End if
		set ExRsAnnou=stock_conn.execute("select * from EX_News where id="&request("id"))
		If ExRsAnnou.eof Then
			Exsm.Errmess="<li>错误的参数！未找到需要编辑的即时信息。"
			Call Exsm.Endinfo(1)
			Exit Sub
		End if
		Exsm.Title 1,"编辑即时信息"
%>
		<table class=a2 width=<%=Exsm.AssignWidth%> cellspacing=1 cellpadding=3 align=center border=0>
			<tr>
				<td colspan=2 align=center height=25 class=a1>-=> 编 辑 股 市 即 时 信 息 <=-</td>
			</tr>
			<form action="?action=AnnAEdit&id=<%=request("id")%>" method="post">
			<tr>
  				<td class=a3 valign=top width=30%><b>内　　容</b>：<br><br>编辑的内容最好控制在[250]Byte以内<br><br><font color="red">HTML语法 支持<br>UBB 语法 不支持</font></td>
				<td class=a3><textarea cols="60" name="Content" rows="8"><%=server.htmlencode(Replace(Replace(ExRsAnnou("content"),"[ExU]",""),"[/ExU]",""))%></textarea></td>
			</tr>
			<tr>
				<td class=a4 colspan=2 align=center><input type=submit name="submit" value="发布"></td>
			</tr>
			</form>
		</table>
<%
		Exsm.RootShowA
	End Sub
	Sub AnnAEdit()
		Dim username,Mycontent,l_content
		If not isnumeric(request("id")) Then
			Exsm.Errmess="<li>错误的参数。"
			Call Exsm.Endinfo(1)
			Exit Sub
		End if	
		If request("content")=""  or Exsm.Syllable(request("content"))>250 Then
			Exsm.Errmess="<li>请输入新闻内容，或内容长度大于了[250]Byte。"
			Call Exsm.Endinfo(1)
			Exit Sub
		Else
			Mycontent=replace(request("content"),"'","")
		End if
		stock_conn.execute("update EX_News set content='"&Mycontent&"',addtime="&SqlSmNowString&" where id="&request("id"))
		l_content=replace("公新管理：编辑新闻，内容："&Mycontent&" ","'","")
		stock_conn.execute("insert into EX_Log (l_boardid,l_touser,l_username,l_content,l_addtime,l_ip,l_type) values('"&Exsm.UserID&"','"&Exsm.ScriptName&"','"&Exsm.StockHolder&"','"&l_content&"',"&SqlSmNowString&",'"&Exsm.UserIP&"',1)")
		Exsm.DelStockCahe("Exsm_Imitate_News")
		Exsm.Sucmess="<li>您已经成功的修改了新闻。"
		Call Exsm.Endinfo(1)
	End Sub
	Sub AddAnn1()
		Exsm.Title 1,"发布公告"
%>
		<table class=a2 width=<%=Exsm.AssignWidth%> cellspacing=1 cellpadding=3 align=center border=0>
			<tr>
				<td colspan=2 align=center height=25 class=a1>-=> 发 布 公 告 <=-</td>
			</tr>
			<form action="?action=SaveAnnA" method="post" name="form3">
			<tr>
    				<td class=a3><b>用 户 名</b>：</td>
				<td class=a3><%=Exsm.StockHolder%><input name="username" type="hidden" value="<%=Exsm.StockHolder%>"></td>
			</tr>
			<tr>
				<td class=a4><b>标　　题</b>：<br>发布公告主题请控制在[100]Byte以内</td>
				<td class=a4><input name="AnnTitle" type=text size=60></td>
			</tr>
			<tr>
				<td class=a3><b>颜　　色</b>：<br>发布公告内容颜色</td>
				<td class=a3>
				<SELECT name="color"> 
					<option style="background-color:black;color: black" value="black" selected> black </option>
					<option style="background-color:blue;color: blue" value="blue"> blue </option>
					<option style="background-color:red;color: red" value="red"> red </option>
					<option style="background-color:olive;color: olive" value="olive"> olive </option>
					<option style="background-color:teal;color: teal" value="teal"> teal </option>
					<option style="background-color:maroon;color: maroon" value="maroon"> maroon </option>
					<option style="background-color:navy;color: navy" value="navy"> navy</option>
					<option style="background-color:gray;color: gray" value="gray"> gray</option>
					<option style="background-color:lime;color: lime" value="lime"> lime</option>
					<option style="background-color:Fuchsia;color: Fuchsia" value="Fuchsia"> Fuchsia </option>
					<option style="background-color:yellow;color: yellow" value="yellow"> yellow </option>
					<option style="background-color:green;color: green" value="green"> green</option>
					<option style="background-color:Purple;color: Purple" value="Purple"> Purple</option>
				</SELECT>
				</td>
			</tr>
			<tr>
				<td class=a4 valign=top width=30%><b>内　　容</b>：<br>控制在[500]Byte以内<br><br><font color="red">HTML语法 支持<br>UBB 语法 不支持</font></td>
				<td class=a4><textarea cols="60" name="Content" rows="8"></textarea></td>
			</tr>
			<tr>
				<td class=a3 colspan=2 align=center><input type=submit name="submit" value="发布"></td>
			</tr>
			</form>
		</table>
<%
		Exsm.RootShowA
	End Sub
	Sub SaveAnnA()
		Dim Anntitle,Mycontent,l_content
		AnnTitle=trim(replace(Request.form("AnnTitle"),"'",""))
		Mycontent=trim(replace(Request.form("content"),"'",""))
		If AnnTitle="" or Exsm.Syllable(AnnTitle)>100 Then
			Exsm.Errmess="<li>请输入公告标题，或主题长度大于了[100]Byte。"
			Call Exsm.Endinfo(1)
			Exit Sub
		End if
		If request("content")="" or Exsm.Syllable(request("content"))>500 Then
			Exsm.Errmess="<li>请输入公告内容，或内容长度大于了[500]Byte。"
			Call Exsm.Endinfo(1)
			Exit Sub
		End if
		stock_conn.execute("insert into EX_Announcement (Title,Content,Color,AddTime,UserName) values ('"&AnnTitle&"','"&Mycontent&"','"&request.form("color")&"',"&SqlSmNowString&",'"&Exsm.StockHolder&"')")
		l_content=replace("公新管理：发布公告，主题："&AnnTitle&" ","'","")
		stock_conn.execute("insert into EX_Log (l_boardid,l_touser,l_username,l_content,l_addtime,l_ip,l_type) values('"&Exsm.UserID&"','"&Exsm.ScriptName&"','"&Exsm.StockHolder&"','"&l_content&"',"&SqlSmNowString&",'"&Exsm.UserIP&"',1)")
		Exsm.DelStockCahe("Exsm_Imitate_Ann")
		Exsm.Sucmess="<li>您已经成功的发布了公告。"
		Call Exsm.Endinfo(1)
	End Sub
	Sub EditAnn1()
		Exsm.Title 1,"管理公告"
%>
		<table class=a2 width=<%=Exsm.AssignWidth%> cellspacing=1 cellpadding=3 align=center border=0>
			<tr>
				<td colspan=5 align=center height=25 class=a1>-=> 管 理 公 告 <=-</td>
			</tr>
			<tr align=center>
				<td class=a4 align=center width=35><b>ID</b></td>
				<td class=a4 align=center><b>标题</b></td>
				<td class=a4 align=center width=80><b>发布人</b></td>
				<td class=a4 align=center width=160><b>发布时间</b></td>
				<td class=a4 align=center width=30><b>操作</b></td>
			</tr>
			<form action="?action=DelAnnB" method="post" name="form1">
<%
			Dim hf
			sql="select Title,Content,Color,AddTime,UserName,id from EX_Announcement order by ID desc"
			set rs=stock_conn.execute(sql)
			If rs.eof and rs.bof Then
				hf=0
				response.Write "<tr><td colspan=5 class=a3>当前没有公告</td></tr></table>"
			End if
			hf=1
			currentPage=request("page")
			If currentpage="" or not isnumeric(currentpage) Then
				currentpage=1
			End if
			Set rs= Server.CreateObject("ADODB.Recordset")
			rs.open sql,stock_conn,1,1
			If rs.eof and rs.bof Then
			else
				rs.PageSize=CInt(Exsm.Setting_Info(15))
				rs.AbsolutePage=currentpage
				page_count=0
				totalrec=rs.recordcount
				do while (not rs.eof) and (not page_count = rs.PageSize)
%>	
			<tr align="center">
    				<td class=a3><%=rs("id")%></td>
				<td class=a3 align="left"><a href="?action=EditAnnInfo1&id=<%=rs("id")%>"><%=server.htmlencode(rs("title"))%></a></td>
    				<td class=a3><%=server.htmlencode(rs("UserName"))%></td>
				<td class=a3><%=rs("addtime")%></td>
    				<td class=a3><input type="checkbox" name="id" value="<%=rs("id")%>"></td>
			</tr>
<%
				page_count = page_count + 1
				rs.movenext
				loop
			Pcount=rs.PageCount
			If hf=1 Then
%>	
			<tr>
				<td class=a4 colspan=5 align=right>请选择要删除的公告，<input type=checkbox name=chkall value=on onclick="CheckAll(this.form)">全选 <input type=submit name=Submit value=执行  onclick="{if(confirm('您确定执行删除操作吗?')){this.document.form1.submit();return true;}return false;}"></td>
			</tr>
<%
			End if
%>
			</form>
		</table>
		<table width=<%=Exsm.AssignWidth%> cellspacing=0 cellpadding=1 align=center border=0>
			<tr>
				<td align=left>共 <font color=blue><%=totalrec%></font> 条，每页 <font color=blue><%=rs.PageSize%></font> 条，第 <font color=red><%=currentpage%></font> 页 / 共 <font color=blue><%=Pcount%></font> 页</td><td align=right><%call Exsm.DispPageNum(currentpage,Pcount,"""?action=EditAnn1&page=","""")%></td>
			</tr>	
		</table>
		<script language="JavaScript">
		function CheckAll(form)
		{
			for (var i=0;i<form.elements.length;i++)
			{
				var e = form.elements[i];
				if (e.name != 'chkall')
				{
					e.checked = form.chkall.checked;
				}
			}
		}
		</script>
<%
			End if
			rs.close
			set rs=nothing
		Exsm.RootShowA
	End Sub
	Sub DelAnnB()
		Dim delid,l_content
		delid=replace(request.form("id"),"'","")
		If delid<>"" Then
			stock_conn.execute("delete from EX_Announcement where id in ("&delid&")")
		Else
			Exsm.Errmess="<li>请选择要删除的公告。"
			Call Exsm.Endinfo(1)
			Exit sub
		End if
		l_content=replace("公新管理：删除公告，ＩＤ："&delid&" ","'","")
		stock_conn.execute("insert into EX_Log (l_boardid,l_touser,l_username,l_content,l_addtime,l_ip,l_type) values('"&Exsm.UserID&"','"&Exsm.ScriptName&"','"&Exsm.StockHolder&"','"&l_content&"',"&SqlSmNowString&",'"&Exsm.UserIP&"',1)")
		Exsm.DelStockCahe("Exsm_Imitate_Ann")
		Exsm.Sucmess="<li>删除公告成功。"
		Call Exsm.Endinfo(1)
	End Sub
	Sub EditAnnInfo1()
		Dim ExRsAnnouI
		If not isnumeric(request("id")) Then
			Exsm.Errmess="<li>错误的参数。"
			Call Exsm.Endinfo(1)
			Exit Sub
		End if
		set ExRsAnnouI=stock_conn.execute("select * from EX_Announcement where id="&request("id"))
		If ExRsAnnouI.eof Then
			Exsm.Errmess="<li>错误的参数！未找到需要编辑的公告。"
			Call Exsm.Endinfo(1)
			Exit Sub
		End if
		Exsm.Title 1,"编辑公告"
%>
		<table class=a2 width=<%=Exsm.AssignWidth%> cellspacing=1 cellpadding=3 align=center border=0>
			<tr>
				<td colspan=2 align=center height=25 class=a1>-=> 编 辑 股 市 公 告 <=-</td>
			</tr>
			<form action="?action=AnnBEdit&id=<%=request("id")%>" method="post">
			<tr>
				<td class=a3><b>用 户 名</b>：</td>
				<td class=a3><input type=text name=username value="<%=ExRsAnnouI("username")%>"></td>
			</tr>
			<tr>
				<td class=a4><b>标　　题</b>：<br>编辑公告主题请控制在50字以内</td>
				<td class=a4><INPUT name="AnnTitle" type=text size=60 value="<%=ExRsAnnouI("title")%>"></td>
			</tr>
			<tr>
				<td class=a3><b>颜　　色</b>：<br>被编辑公告内容的颜色</td>
				<td class=a3>
				<SELECT name=color> 
					<option style="background-color:black;color: black" value="black" <%If ExRsAnnouI("color")="black" Then%> selected <%End if%>> black </option>
					<option style="background-color:blue;color: blue" value="blue" <%If ExRsAnnouI("color")="blue" Then%> selected <%End if%>> blue </option>
					<option style="background-color:red;color: red" value="red" <%If ExRsAnnouI("color")="red" Then%> selected <%End if%>> red </option>
					<option style="background-color:olive;color: olive" value="olive" <%If ExRsAnnouI("color")="olive" Then%> selected <%End if%>> olive </option>
					<option style="background-color:teal;color: teal" value="teal" <%If ExRsAnnouI("color")="teal" Then%> selected <%End if%>> teal </option>
					<option style="background-color:maroon;color: maroon" value="maroon" <%If ExRsAnnouI("color")="maroon" Then%> selected <%End if%>> maroon </option>
					<option style="background-color:navy;color: navy" value="navy" <%If ExRsAnnouI("color")="navy" Then%> selected <%End if%>> navy</option>
					<option style="background-color:gray;color: gray" value="gray" <%If ExRsAnnouI("color")="gray" Then%> selected <%End if%>> gray</option>
					<option style="background-color:lime;color: lime" value="lime" <%If ExRsAnnouI("color")="lime" Then%> selected <%End if%>> lime</option>
					<option style="background-color:Fuchsia;color: Fuchsia" value="Fuchsia" <%If ExRsAnnouI("color")="Fuchsia" Then%> selected <%End if%>> Fuchsia </option>
					<option style="background-color:yellow;color: yellow" value="yellow" <%If ExRsAnnouI("color")="yellow" Then%> selected <%End if%>> yellow </option>
					<option style="background-color:green;color: green" value="green" <%If ExRsAnnouI("color")="green" Then%> selected <%End if%>> green</option>
					<option style="background-color:Purple;color: Purple" value="Purple" <%If ExRsAnnouI("color")="Purple" Then%> selected <%End if%>> Purple</option>
				</SELECT>
				</td>
			</tr>
			<tr>
				<td class=a4 valign=top width=30%><b>内　　容</b>：<br><br>控制在250字以内<br><font color="red">HTML语法 支持<br>UBB 语法 不支持</font></td>
				<td class=a4>
				<textarea cols="60" name="Content" rows="8"><%=server.htmlencode(ExRsAnnouI("content"))%></textarea></td>
			</tr>
			<tr>
				<td class=a3 colspan=2 align=center><input type=submit name="submit" value="发布"></td>
			</tr>
			</form>
		</table>
<%
		Exsm.RootShowA
	End Sub
	Sub AnnBEdit()
		Dim username,AnnTitle,Mycontent,l_content
		If not isnumeric(request("id")) Then
			Exsm.Errmess="<li>错误的参数。"
			Call Exsm.Endinfo(1)
			Exit Sub
		End if	
		If request("username")="" Then
			Exsm.Errmess="<li>请输入发布者。"
			Call Exsm.Endinfo(1)
			Exit Sub
		Else
			username=replace(request("username"),"'","")
		End if
		If request("AnnTitle")="" or Exsm.Syllable(request("AnnTitle"))>100 Then
			Exsm.Errmess="<li>请输入公告标题，或主题长度大于了[100]Byte。"
			Call Exsm.Endinfo(1)
			Exit Sub
		Else
			AnnTitle=replace(request("AnnTitle"),"'","")
		End if
		If request("content")="" or Exsm.Syllable(request("content"))>500 Then
			Exsm.Errmess="<li>请输入公告内容，或内容长度大于了[500]Byte。"
			Call Exsm.Endinfo(1)
			Exit Sub
		Else
			Mycontent=replace(request("content"),"'","")
		End if
		stock_conn.execute("update EX_Announcement set title='"&AnnTitle&"',content='"&Mycontent&"',username='"&username&"',color='"&request.Form("color")&"',addtime="&SqlSmNowString&" where id="&request("id"))
		l_content=replace("公新管理：编辑公告，主题："&AnnTitle&" ","'","")
		stock_conn.execute("insert into EX_Log (l_boardid,l_touser,l_username,l_content,l_addtime,l_ip,l_type) values('"&Exsm.UserID&"','"&Exsm.ScriptName&"','"&Exsm.StockHolder&"','"&l_content&"',"&SqlSmNowString&",'"&Exsm.UserIP&"',1)")
		Exsm.DelStockCahe("Exsm_Imitate_Ann")
		Exsm.Sucmess="<li>您已经成功的修改了公告。"
		Call Exsm.Endinfo(1)
	End Sub
%>