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

📄 admin_source.asp

📁 新闻发布系统
💻 ASP
字号:
<!--#include file = "include.asp"-->
<!--#include file = "admin_CheckMana.asp"-->
<%
if EnoughPopedom("changgui")=1 then
Response.write"<script>alert(""[操作失败]\n\n你的权限不足!\n\n请与系统管理员联系获得足够的权限!"");location.href=""javascript:history.back()"";</script>"
Response.end
end if
call main()%>
<%sub main()%>
<%
'=========================================================
'产品目录:风讯产品N系列
'软件名称:风讯站点管理系统
'当前版本:2004.I.0225
'最新更新:2004.2.10
'=========================================================
'Copyright (C) 2002-2004 cooin.com. All rights reserved.
'网站: http://www.cooin.com  Foosun.net
'程序制作:轻风云(QQ:655071)
'Email:skeen@cooin.com,skeen@Foosun.net
'论坛支持:风讯在线论坛(http://bbs.cooin.com   http://bbs.foosun.net)
'=========================================================
if Request("action") = "add" then
	call add()
elseif request("action") = "save" then
	call save()
elseif request("action") = "del" then
	call del()
elseif request("action") = "edit" then
	call edit()
elseif request("action") = "saveedit" then
	call saveedit()
else
	call fromlist()
end if
%>
<%end sub%>
<%sub fromlist()%>
<table width="95%" cellspacing="1" cellpadding="0" bgcolor="#84BE7E" align="center">
  <tr bgcolor=#cccccc><td bgcolor="#BBCEE8"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/bg1.gif">
        <tr> 
          <td height="26"> <div align="center">信息来源列表</div></td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr bgcolor=#ffffff>
    <td height="31">【<a href=admin_source.asp?action=add><font color=#cc0000>增加来源</font></a>】</td>
  </tr>
<tr bgcolor=#eeeeee>
    <td height="32" bgcolor="#F7FFF4"> 
      <%Set RS = Server.CreateObject("ADODB.RecordSet")
sql = "select * from [sourcea] where Settype=1 order by id DESC"
RS.Open sql, Conn, 1, 1
if rs.eof and rs.bof then
response.write("<center><font color=red>目前还没有新闻来源!</font> 请<a href=?action=add>点击这里</a>添加")
else
do while not rs.EOF%>
      <a href=<%=rs("surl")%> target=_blank><font color=blue><%=rs("sourcea")%></font></a> 
      (<a href=admin_source.asp?action=edit&id=<%=rs("id")%>>修</a>|<a href=admin_source.asp?action=del&id=<%=rs("id")%> onClick="return Del()">删</a>) 
      &nbsp; 
      <%
RS.MoveNext()
loop
end if
rs.close
set rs=nothing%>
      <!--#include file = name.asp-->
    </td>
  </tr></table>
<%end sub%>


<%sub add()%>
<table width="95%" cellspacing="1" cellpadding="0" bgcolor="#84BE7E" align="center">
  <form action="admin_source.asp?action=save" method=POST name=add>
<tr bgcolor=#cccccc><td bgcolor="#BBCEE8">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/bg1.gif">
          <tr> 
            <td height="26"> <div align="center"><b>添加信息来源</b></div></td>
          </tr>
        </table>
        
      </td>
    </tr>
<tr bgcolor=#eeeeee>
      <td height="31" bgcolor="#F7FFF4"><center> 名称: 
        <input name=SourceA type=text id="SourceA" size=15>
网址:<input name=surl type=text id="surl" value="http://" size=40>
        &nbsp;
<input type="submit" name="Submit" value="确定"> &nbsp;<input type="Reset" name="Reset" value="重填">
        <!--#include file = name.asp-->
      </td>
    </tr></form></table>
<%end sub%>



<%sub save()%>
<%if request("sourcea")="" then%>
<script language=javascript>  
alert( "错误:请输入来源名称!"  );
location.href = "javascript:history.back()"  
</script>
<%elseif request("surl")="" then%>
<script language=javascript>  
alert( "错误:请输入来源网址!"  );
location.href = "javascript:history.back()"  
</script>
<%else%>
<%
set rs = server.CreateObject ("adodb.recordset")
sql = "select * from [sourcea]"
	rs.Open sql,conn,1,3
	rs.AddNew
	rs("Sourcea") = Request("Sourcea")
	rs("surl") = Request("surl")
	rs("Settype")=1
	rs.Update 
	rs.Close 
set rs=nothing
%>
<script language=javascript>  
alert( "恭喜:新闻来源添加成功"  );
location.href = "admin_source.asp"  
</script>
<%end if%>
<%end sub%>



<%sub del()
sql="delete from [sourcea] where id="&cstr(request("id"))
conn.execute(sql)
%>
<script language=javascript>  
alert( "新闻来源删除成功"  );
location.href = "admin_Source.asp"  
</script>
<%end sub%>



<%sub edit()%>
<%
     set rs=server.createobject("adodb.recordset")
   sql="select * from [Sourcea] where id="&request("id")
   rs.open sql,conn,1,1
%>

<table width="95%" cellspacing="1" cellpadding="0" bgcolor="#84BE7E" align="center">
  <form action="admin_Source.asp?action=saveedit&id=<%=rs("id")%>" method=POST name=edit>
<tr bgcolor=#cccccc>
      <td bgcolor="#BBCEE8">
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/bg1.gif">
          <tr> 
            <td height="26"> <div align="center"><b>修改信息来源</b></div></td>
          </tr>
        </table></td></tr>
<tr bgcolor=#eeeeee>
      <td height="40" bgcolor="#F7FFF4"><center> 名称: 
        <input name=SourceA type=text id="SourceA" value=<%=rs("SourceA")%> size=15>
网址:<input name=surl type=text id="surl" value=<%=rs("surl")%> size=40>
&nbsp;<input type="submit" name="Submit" value="确定"> &nbsp;<input type="Reset" name="Reset" value="重填">
        <!--#include file = name.asp-->
      </td>
    </tr></form></table>
<%end sub%>


<%sub saveedit()%>
<%if request("Sourcea")="" then%>
<script language=javascript>  
alert( "错误:请输入来源名称!"  );
location.href = "javascript:history.back()"  
</script>
<%elseif request("surl")="" then%>
<script language=javascript>  
alert( "错误:请输入来源网址!"  );
location.href = "javascript:history.back()"  
</script>
<%else%>
<%sql="update [Sourcea] set Sourcea='"&request("Sourcea")&"',surl='"&request("surl")&"',Settype=1 where id="&cstr(request("id"))
conn.execute(sql)%>
<script language=javascript>  
alert( "新闻来源修改成功!"  );
location.href = "admin_Source.asp"  
</script>
<%end if%>
<%end sub%>

⌨️ 快捷键说明

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