<!--#include file="top.asp"-->
<%if userflag4=0 then
response.redirect"ok.asp?action=flag"
end if%>
<%
title=request("title")
newss=request("newss")
ly=request("ly")
addr=request("addr")
newssort=request("newssort")
page=request("page")
if page="" then page=1
if request("action")="del" then
Rem 删除一级栏目
on error resume next
sql="delete from SMT_news where SMT_id=" & request("id")
conn.execute sql
if err.Number<>0 then
err.clear
response.write ""
else
finished
end if
rs.open sql,conn,3,3
rs.delete
rs.update
Response.Redirect "ok.asp?url=news.asp&page="&page
elseif request("action")="add" then
cityping=split(cityping,"|")
for i=0 to UBound(cityping)
if instr(news,cityping(i)) then
response.write"<script>alert('添加新闻出错,下面是产生错误的可能原因:\n\n·在您的新闻内容中含有敏感字符');history.go(-1);</script>"
response.end
end if
next
Set rs=Server.CreateObject("Adodb.RecordSet")
sql="select * from SMT_news where SMT_yp_id="& session("id")&" and (SMT_id=1 or SMT_id=2 or SMT_id=3 or SMT_id=4 or SMT_id=5)"
rs.open sql,conn,1,3
if flag3<>0 then
if rs.recordcount >= cint(flag3) then
response.write"<script>alert('操作出错,下面是产生错误的可能原因:\n\n·您还是普通会员,只能上传最多 "&flag3&" 条企业动态!');history.go(-1);</script>"
response.end
end if
end if
rs.addnew
rs("SMT_title")=title
rs("SMT_news")=newss
rs("SMT_ly")=ly
rs("SMT_addr")=addr
rs("SMT_newssort")=newssort
rs("SMT_key1")=citynewskey
rs("SMT_yp_id")=session("id")
rs.update
rs.close
set rs=nothing
if citynewskey=1 then
response.redirect"ok.asp?url=news_add.asp"
else
response.redirect"ok.asp?url=news_add.asp&key=yes"
end if
elseif request("action")="edit" then
cityping=split(cityping,"|")
for i=0 to UBound(cityping)
if instr(news,cityping(i)) then
response.write"<script>alert('修改新闻出错,下面是产生错误的可能原因:\n\n·在您的新闻内容中含有敏感字符');history.go(-1);</script>"
response.end
end if
next
Set rs=Server.CreateObject("Adodb.RecordSet")
sql="select * from SMT_news where SMT_id="&request("id")
rs.open sql,conn,1,3
if rs("SMT_yp_id")<>session("id") then
response.write"<script>alert('操作出错,下面是产生错误的可能原因:\n\n·对不起,您没有权力修改此新闻');history.go(-1);</script>"
response.end
end if
rs("SMT_title")=title
rs("SMT_news")=newss
rs("SMT_ly")=ly
rs("SMT_addr")=addr
rs("SMT_newssort")=newssort
rs("SMT_key1")=citynewskey
rs.update
rs.close
set rs=nothing
if citynewskey=1 then
response.redirect"ok.asp?url=news.asp&page="&page
else
response.redirect"ok.asp?url=news.asp&key=yes&page="&page
end if
elseif request("action")="key" then
Set rs=Server.CreateObject("Adodb.RecordSet")
sql="select * from SMT_news where SMT_id="&request("id")
rs.open sql,conn,1,3
if rs("SMT_yp_id")<>session("id") then
response.write"<script>alert('操作出错,下面是产生错误的可能原因:\n\n·对不起,您没有权力修改此新闻');history.go(-1);</script>"
response.end
end if
rs("SMT_key")=request("zt")
rs.update
rs.close
set rs=nothing
response.redirect"ok.asp?url=news.asp&page="&page
end if
%>