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

📄 adminnews.asp

📁 报名系统
💻 ASP
字号:
<!--#include file=function.asp-->
<%CheckAdmin3%>
<!--#include file="conn.asp"-->
<%
'开始添加操作
	function invert(str) 
    invert=replace(replace(replace(replace(str,"<","&lt;"),">","&gt;"),chr(13),"<br>")," ","&nbsp;") 
    invert=replace(replace(replace(replace(invert,"[img]","<img src="),"[b]","<b>"),"[red]","<font color=red>"),"[blue]","<font color=blue>") 
    invert=replace(replace(replace(replace(invert,"[/img]","></img>"),"[/b]","</b>"),"[/red]","</font>"),"[/blue]","</font>") 
end function
if request("action")="add" then
o_title=request("o_title")
check=request("check")
o_content=invert(request("o_content"))
o_date=now()


'添加活动
conn.execute "insert into Activity (o_title,check,o_content,o_date) values ('"&o_title&"','"&check&"','"&o_content&"','"&o_date&"')" 
response.redirect "newslist.asp" 
response.end
end if
%>
<%
'开始删除操作
if request("action")="del" then
conn.execute "delete * from Activity where o_title='"&request("delnews")&"'"
response.redirect "newslist.asp" 
response.end
end if
%>
<%
'开始修改操作
if request("action")="modi" then

modio_title=request("modio_title")
check=request("check")
modio_titleto=request("modio_titleto")
modio_content=request("modio_content")


'检验修改后的活动是否唯一
if modio_title<>modio_titleto then 
sql="select * from Activity where o_title='"&o_titleto&"' order by o_id desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
if not(rs.eof or rs.bof) then
response.write"<SCRIPT language=JavaScript>alert('对不起,此活动名称不唯一,请核实!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
rs.close
set rs=nothing
end if

conn.execute "update Activity set o_title='"&modio_titleto&"', check='"&check&"', o_content='"&modio_content&"' where o_title='"&modio_title&"'"

response.redirect "newslist.asp"
response.end
end if
%>
<html>
<head>
<LINK href="../style.css" rel=stylesheet type=text/css>
<title>OWEN 活动管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body topmargin="0" leftmargin="0" bgcolor="#9999CC">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="15%" valign="top" bgcolor="#9999CC" style="border-right: 1 solid #000000">
      <!--#include file="left.asp"-->
    </td>
    <td width="85%" valign="top" bgcolor="#D8D8EB"><br> 
      <%if request("a")="a" then%>
      <table border="0" cellspacing="1" cellpadding="4" bgcolor="#000000" align="center" width="50%">
        <tr bgcolor="#9999CC"> 
          <td colspan="2">添加活动</td>
        </tr>
        <form name="adminnews" method="post" action="adminnews.asp">
         
          <tr bgcolor="#FFFFFF"> 
            <td width="30%" align="right">活动名称:</td>
            <td> <input type="text" name="o_title" class=input> </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td align="right">活动描叙:</td>
            <td> <textarea name="o_content" cols="40" rows="5" class=input></textarea></td>
          </tr> 
		  <tr bgcolor="#FFFFFF">
            <td align="right">活动状态:</td>
            <td><input name="check" type="radio" value=1 checked>
               开放 <input type="radio" name="check" value=0> 关闭</td>
          </tr>
          <tr bgcolor="#BDBDDD"> 
            <td colspan="2" align="center"> <input type="submit" name="Submit" value="添 加"> 
              <input type="hidden" name="action" value="add"> </td>
          </tr> 
		 
        </form>
      </table>
      <br> <table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td align="center"><a href="javascript:history.go(-1)">以后再添加</a></td> 
        </tr>
      </table>
      <%end if%>
      <br>
	  <%if request("a")="d" then%>
      <table border="0" cellspacing="1" cellpadding="4" bgcolor="#000000" align="center" width="50%">
        <tr bgcolor="#9999CC"> 
          <td colspan="2">删除活动</td>
  </tr>
  <form name="delnews" method="post" action="adminnews.asp">
          <tr bgcolor="#FFFFFF"> 
            <td width="30%" align="right">招聘活动名称:</td>
            <td> 
              <input type="text" name="delnews" class=input value=<%=request("delnews")%> readonly>
      </td>
    </tr>
          <tr bgcolor="#FFFFFF"> 
            <td colspan="2" align="center"> 
              <input type="submit" name="Submit2" value="删 除">
        <input type="hidden" name="action" value="del">
      </td>
    </tr>
  </form>
</table>
<br>
<table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center"><a href="javascript:history.go(-1)">不删除了,我要返回</a></td>
  </tr>
</table>
<%end if%>

<br>
<%
if request("a")="m" then
%>
      <table width="50%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#000000">
        <tr bgcolor="#9999CC"> 
          <td colspan="2">修改活动</td>
  </tr>
  <form name="modio_title" method="post" action="adminnews.asp">
          <tr bgcolor="#FFFFFF"> 
            <td width="15%" align="right">活动标题:</td>
            <td width="85%"> 
              <input type="text" name="modio_titleto" class=input value=<%=request("modio_title")%>>
      </td>
    </tr>
	      <tr bgcolor="#FFFFFF"> 
            <td align="right">活动内容:</td>
            <td> 
              <textarea name="modio_content" cols="40" rows="5" class=input>
<%=request("o_content")%>
</textarea></td>
    </tr>
	  <tr bgcolor="#FFFFFF">
            <td align="right">活动状态:</td>
            <td><input name="check" type="radio" value=1 <%  if  request("check")=1 then response.write "checked" end if%>>
               开放 <input type="radio" name="check" value=0 <%  if  request("check")=0 then response.write "checked" end if%>> 关闭</td>
          </tr>
    <tr bgcolor="#BDBDDD"> 
      <td colspan="2" align="center"> 
        <input type="submit" name="Submit22" value="修 改">
        <input type="hidden" name="modio_title" value=<%=request("modio_title")%>>
        <input type="hidden" name="action" value="modi">
      </td>
    </tr>
  </form>
</table><% End If %>
    </td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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