⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 affiche_mb_edit.asp

📁 视频点播系统
💻 ASP
字号:
<!--#include file="chklogin.asp"-->
<%

call myobj.chkrq()
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改网站公告</title>
<link href="images/style2.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
}
a:link {
	color: #0000FF;
	text-decoration: none;
}
a:visited {
	color: #0000FF;
	text-decoration: none;
}
a:hover {
	color: #FF0000;
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
-->
</style></head>

<body leftMargin="0" topMargin="0" bgcolor="#FFFFFF">
<%
action_e=request.QueryString("action")
Select Case action_e
	Case ""
	  Call main()
	Case "save_affiche"
	  Call save_affiche()
end select
%>
<%
sub main()
if request.Querystring("id")="" or myobj.ChkNum(request.Querystring("id"))=false then
	response.write"<script>alert('网站公告ID值错误');history.back();</Script>"
	response.end
else
	set rs=server.createobject("adodb.recordset")
	rs.open "select * from affiche where a_type=1 and id="&request.Querystring("id")&"",conn,1,1
	if rs.eof then
		rs.close
		set rs=nothing
		conn.close
		set conn=nothing
		response.write"<script>alert('该网站公告不存在');history.back();</Script>"
		response.end
	else
		var_title=rs("a_title")
		var_body=rs("a_body")
		var_on_top=rs("on_top")
		var_time=rs("a_time")
		var_see_count=rs("see_count")
		rs.close
		set rs=nothing
		conn.close
		set conn=nothing
	end if
end if
%>
<form name="form1" method="post" action="<%=filename%>?action=save_affiche">
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="550" height="25" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#3975CE">
  <tr>
    <td align="center" class="font1"><strong class="font1">修改网站公告</strong></td>
  </tr>
</table>

<table width="550" height="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
  <tr>
    <td align="center" bgcolor="#F7F7F7"><table width="500" height="25" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="100" align="right">网站公告标题:</td>
        <td><input name="a_title" type="text" class="input1" id="a_title" value="<%=var_title%>" size="51"></td>
      </tr>
    </table>
      <table width="500" height="25" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="100" align="right">网站公告正文:</td>
          <td><textarea name="a_body" cols="50" rows="10" class="input1" id="a_body"><%=var_body%></textarea></td>
        </tr>
      </table>
      <table width="500" height="25" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="100" align="right">是否置顶:</td>
          <td><input type="radio" name="on_top" value="true" <%if var_on_top=true then%>checked<%end if%>>
            是 
            <input name="on_top" type="radio" value="false" <%if var_on_top<>true then%>checked<%end if%>>
            否</td>
        </tr>
      </table>
      <table width="500" height="25" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="100" align="right">发布日期:</td>
          <td>&nbsp;<%=var_time%></td>
        </tr>
      </table>
      <table width="500" height="25" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="100" align="right">浏览次数:</td>
          <td>&nbsp;<%=var_see_count%></td>
        </tr>
      </table>
      <table width="500" height="40" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td align="center"><input name="Submit" type="submit" class="button1" value="确定发布"> 
            <input name="Submit" type="reset" class="button1" value="清空重写">
            <input name="id" type="hidden" id="id" value="<%=request.Querystring("id")%>"></td>
        </tr>
      </table></td>
  </tr>
</table>
</form>
<%end sub%>
<%
sub save_affiche()
if request.form("id")="" or myobj.ChkNum(request.form("id"))=false then
	response.write"<script>alert('网站公告ID值错误');history.back();</Script>"
	response.end
else
	set rs=server.createobject("adodb.recordset")
	rs.open "select * from affiche where a_type=1 and id="&request.form("id")&"",conn,1,1
	if rs.eof then
		rs.close
		set rs=nothing
		conn.close
		set conn=nothing
		response.write"<script>alert('该网站公告不存在');history.back();</Script>"
		response.end
	end if
end if
if request.form("a_title")="" or myobj.ChkLen(request.form("a_title"))>50 then
response.write"<script language=javascript>alert('网站公告标题不能为空,并且不能大于50个字符(汉字占两个字符)');history.back();</Script>"
response.end
end if
if request.form("a_body")="" or myobj.ChkLen(request.form("a_body"))>500 then
response.write"<script language=javascript>alert('网站公告正文不能为空,并且不能大于500个字符(汉字占两个字符)');history.back();</Script>"
response.end
end if
if myobj.chkbool(request.form("on_top"))=false then
response.write"<script language=javascript>alert('网站公告置顶属性值类型错误');history.back();</Script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from affiche where a_type=1 and id="&request.form("id")&"",conn,1,3
rs("a_title")=request.form("a_title")
rs("a_body")=request.form("a_body")
rs("on_top")=cbool(request.form("on_top"))
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="550" height="25" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#3975CE">
  <tr>
    <td align="center" class="font1"><strong class="font1">网站公告修改成功</strong></td>
  </tr>
</table>
<table width="550" height="100" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
  <tr>
    <td align="center" bgcolor="#F7F7F7"><p>网站公告修改成功!</p>
    <p><a href="affiche_mb_add.asp">发布新网站公告</a> <a href="affiche_mb_manage.asp">返回网站公告管理</a></p></td>
  </tr>
</table>
<%
end sub
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -