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

📄 admin_mfk_news.asp

📁 机票订票系统,使用ASP
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
call managemode
dim action
action=trim(request("action"))
select case action
case "edit"
call edit
case "del"
call del
case "editok"
call editok
case else
response.write("<script>alert('错误的参数传递!请确定你从有效链接进入!');history.back();</script>")
end select
sub del
dim id
id=trim(request("id"))
sql="delete * from news where id="&id
conn.execute(sql)
response.write("<script>alert('删除新闻成功!按确定重新载入!');location='admin_denews.asp?action=de';</script>")
end sub
sub edit
dim id
id=trim(request("id"))
if id="" or not isnumeric(id) then
response.write("<script>alert('参数传递错误!请确定你从有效链接进入!');history.back();</script>")
end if
set rs=conn.execute("select * from news where id="&id)
if rs.eof or rs.bof then
closeconn
response.write("<script>alert('没有找到相关的新闻!请确定你从有效链接进入!');history.back();</script>")
end if
%>
<script>
function check(){
if(form1.ntitle.value==""){
alert("请输入新闻标题!");
return false;
}
if(form1.ndt.value==""){
alert("请输入新闻加入时间!");
return false;
}
if(form1.ntext.value==""){
alert("请输入新闻内容!");
return false;
}
}
</script>
<style type="text/css">
<!--
.style1 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
<table width="618" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<form action="?action=editok" method="post" name="form1" onsubmit="return check();">
  <tr bgcolor="#EFEFEF">
    <td height="26" colspan="2">  
      <div align="center" class="style1">编辑新闻 </div></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="109" height="26" align="center">新闻标题:</td>
    <td width="506" height="26"><input name="ntitle" type="text" id="ntitle" size="40" value="<%=rs("ntitle")%>"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="26" align="center">新闻选项:</td>
    <td height="26">日期:
    <input name="ndt" type="text" id="ndt" size="15" value="<%=rs("ndt")%>">
    类别:
    <select name="classid" id="classid">
	   <option value="<%=rs("classid")%>" selected><%if rs("classid")=0 then response.write ("机票常识")  end if
												   if rs("classid")=1  then response.write("旅客须知") end if
												   if rs("classid")=2  then  response.write("其他") end if
												    %></option>
      <option value="0">机票常识</option>
	  <option value="1">旅客须知</option>
      <option value="2">其他</option>
        </select>
        <input name="id" type="hidden" id="id" value="<%=id%>"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="26" align="center">新闻内容:</td>
    <td height="26"><textarea name="ntext" cols="60" rows="12" id="ntext"><%=rs("ntext")%></textarea></td>
  </tr>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="26" colspan="2"><input type="submit" name="Submit" value="确定修改">
      
    <input type="reset" name="Submit2" value="重新载入"></td>
  </tr>
  </form>
</table>
<%
closers(rs)
end sub
sub editok
dim ntitle,ndt,ntop,ntext,id,classid
ntitle=replace(trim(request("ntitle")),"'","")
ndt=replace(trim(request("ndt")),"'","")
ntop=request("ntop")
ntext=replace(request("ntext"),"'","”")
id=trim(request("id"))
classid=request("classid")
if ntop="y" then
ntop=1
else
ntop=0
end if
usql="update news set ntitle='"&ntitle&"',ndt='"&ndt&"',ntop='"&ntop&"',ntext='"&ntext&"',classid='"&classid&"'where id="&id
conn.execute(usql)
response.write("<script>alert('修改新闻成功!按确定重新载入!');location='admin_denews.asp?action=de';</script>")
end sub
call manageend
%>

⌨️ 快捷键说明

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