mod_info.asp

来自「CityCN V2.1 是自主开发的基于ASP+Access的新型资讯信息系统。」· ASP 代码 · 共 481 行 · 第 1/2 页

ASP
481
字号
<!--#include file="config.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="mod_config.asp" -->
<!--#include file="sub_change.asp" -->
<%
if siteread="yes" then response.redirect "error.asp?v=siteread"  end if

dim id,ok
id=trim(request.QueryString("id"))
if len(id)=0 or IsNumeric(id)=flase then response.redirect "error.asp?v=infomore_error" end if

ok=strchange(left(trim(request.QueryString("ok")),1))

dim errormax,citymax,leibie,leibiemax,name,namemax,about,aboutmax,address,addressmax,bus,busmax,pay,paymax,site,sitemax,tel,telmax,qq,qqmax,pic1,pic2,pic3,pic4,picmax,other,othermax,boss,bossmax,password,userip,lock
citymax=4
leibiemax=4
namemax=12
aboutmax=240
addressmax=200
busmax=200
paymax=200
sitemax=100
telmax=100
qqmax=20
picmax=200
othermax=800
bossmax=200
passwordmax=18
errormax=""

if ok="y" then
  password=strchange(trim(request.form("password")))
  if len(password)=0 then errormax=errormax&"管理密码不能为空!<br>" end if
  if len(guolv(password))>0 then errormax=errormax&"管理密码中数据“"&guolv(password)&"”被系统过滤!<br>" end if
  
  name=strchange(trim(request.form("name")))
  if len(name)=0 then errormax=errormax&"资讯名称不能为空!<br>" end if
  if len(name)>namemax then errormax=errormax&"资讯名称超过系统最大字符数" &namemax&",目前字符数:"&len(name)&"!<br>" end if
  if len(guolv(name))>0 then errormax=errormax&"资讯名称中数据“"&guolv(name)&"”被系统过滤!<br>" end if  
  
  city=strchange(trim(request.form("city")))
  if len(city)=0 or city="0" then errormax="城市名称不能为空!<br>" end if
  if len(city)>citymax then errormax=errormax&"城市名称超过系统最大字符数" &citymax&",目前字符数:"&len(city)&"!<br>" end if
  if len(guolv(city))>0 then errormax=errormax&"城市名称中数据“"&guolv(city)&"”被系统过滤!<br>" end if  
  
  leibie=strchange(trim(request.form("leibie")))
  if len(leibie)=0 or leibie="0" then errormax=errormax&"资讯类别不能为空!<br>" end if
  if len(leibie)>leibiemax then errormax=errormax&"资讯类别超过系统最大字符数" &leibiemax&",目前字符数:"&len(leibie)&"!<br>" end if
  if len(guolv(leibie))>0 then errormax=errormax&"资讯类别中数据“"&guolv(leibie)&"”被系统过滤!<br>" end if
   
  about=strchange(trim(request.form("about")))
  if len(about)=0 then errormax=errormax&"咨询介绍不能为空!<br>" end if
  if len(about)>aboutmax then errormax=errormax&"资讯介绍超过系统最大字符数" &aboutmax&",目前字符数:"&len(about)&"!<br>" end if
  if len(guolv(about))>0 then errormax=errormax&"资讯介绍中数据“"&guolv(about)&"”被系统过滤!<br>" end if
  
  address=strchange(trim(request.form("address")))
  if len(address)>addressmax then errormax=errormax&"资讯地址超过系统最大字符数" &addressmax&",目前字符数:"&len(address)&"!<br>" end if
  if len(guolv(address))>0 then errormax=errormax&"资讯地址中数据“"&guolv(address)&"”被系统过滤!<br>" end if
  
  bus=strchange(trim(request.form("bus")))
  if len(bus)>busmax then errormax=errormax&"公交线路超过系统最大字符数" &busmax&",目前字符数:"&len(bus)&"!<br>" end if
  if len(guolv(bus))>0 then errormax=errormax&"公交线路中数据“"&guolv(bus)&"”被系统过滤!<br>" end if
  
  pay=strchange(trim(request.form("pay")))
  if len(pay)>paymax then errormax=errormax&"消费情况超过系统最大字符数" &paymax&",目前字符数:"&len(pay)&"!<br>" end if
  if len(guolv(pay))>0 then errormax=errormax&"消费情况中数据“"&guolv(pay)&"”被系统过滤!<br>" end if
  
  site=strchange(trim(request.form("site")))
  if len(site)>sitemax then errormax=errormax&"资讯网站超过系统最大字符数" &sitemax&",目前字符数:"&len(site)&"!<br>" end if
  if len(guolv(site))>0 then errormax=errormax&"资讯网站中数据“"&guolv(site)&"”被系统过滤!<br>" end if
  
  tel=strchange(trim(request.form("tel")))
  if len(tel)>telmax then errormax=errormax&"联系电话超过系统最大字符数" &telmax&",目前字符数:"&len(tel)&"!<br>" end if
  if len(guolv(tel))>0 then errormax=errormax&"联系电话中数据“"&guolv(tel)&"”被系统过滤!<br>" end if
  
  qq=strchange(trim(request.form("qq")))
  if len(qq)>qqmax then errormax=errormax&"腾讯QQ超过系统最大字符数" &qqmax&",目前字符数:"&len(qq)&"!<br>" end if
  if len(guolv(qq))>0 then errormax=errormax&"腾讯QQ中数据“"&guolv(qq)&"”被系统过滤!<br>" end if
  
  pic1=strchange(trim(request.form("pic1")))
  if len(pic1)>picmax then errormax=errormax&"图 片 1超过系统最大字符数" &picmax&",目前字符数:"&len(pic1)&"!<br>" end if
  if len(guolv(pic1))>0 then errormax=errormax&"图 片 1中数据“"&guolv(pic1)&"”被系统过滤!<br>" end if
  
  pic2=strchange(trim(request.form("pic2")))
  if len(pic2)>picmax then errormax=errormax&"图 片 2超过系统最大字符数" &picmax&",目前字符数:"&len(pic2)&"!<br>" end if
  if len(guolv(pic2))>0 then errormax=errormax&"图 片 2中数据“"&guolv(pic2)&"”被系统过滤!<br>" end if
  
  pic3=strchange(trim(request.form("pic3")))
  if len(pic3)>picmax then errormax=errormax&"图 片 3超过系统最大字符数" &picmax&",目前字符数:"&len(pic3)&"!<br>" end if
  if len(guolv(pic3))>0 then errormax=errormax&"图 片 3中数据“"&guolv(pic3)&"”被系统过滤!<br>" end if
  
  pic4=strchange(trim(request.form("pic4")))
  if len(pic4)>picmax then errormax=errormax&"图 片 4超过系统最大字符数" &picmax&",目前字符数:"&len(pic4)&"!<br>" end if
  if len(guolv(pic4))>0 then errormax=errormax&"图 片 4中数据“"&guolv(pic4)&"”被系统过滤!<br>" end if
  
  other=strchange(trim(request.form("other")))
  if len(other)>othermax then errormax=errormax&"其它信息超过系统最大字符数" &othermax&",目前字符数:"&len(other)&"!<br>" end if
  if len(guolv(other))>0 then errormax=errormax&"其它信息中数据“"&guolv(other)&"”被系统过滤!<br>" end if
  
  boss=strchange(trim(request.form("boss")))
  if len(boss)>bossmax then errormax=errormax&"老板信息超过系统最大字符数" &bossmax&",目前字符数:"&len(boss)&"!<br>" end if
  if len(guolv(boss))>0 then errormax=errormax&"老板信息中数据“"&guolv(boss)&"”被系统过滤!<br>" end if
 
  userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
  If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR") 
  
  if len(errormax)>0 then 
    errormax="抱歉:以下字段数据需要修改。<br>" & errormax
  else
    dim pov,quhao
    set rspov=server.CreateObject("adodb.recordset")
    rspov.open "select * from 城市 where 审核=1 and 城市='" & city & "'",conn,1,1
    if rspov.recordcount=1 then
      pov=rspov("省份")
      quhao=rspov("区号")
      rspov.close
      set rspov=nothing
    else
      response.write "<Script Language=JavaScript>alert('抱歉!程序此处逻辑错误!错误代码:Add_info_1。请和系统管理员联系 QQ:"&adminqq&"');</Script>"
      response.redirect "index.asp"
      response.end
    end if
    
    set rs=server.CreateObject("adodb.recordset")
    rs.open"select * from 资讯 where 编号="&id,conn,3,3
    if rs.recordcount<>1 then
      errormax="抱歉!该资讯名称不存在或者信息不唯一,请检查!"
      rs.close
      set rs=nothing
    else
      if rs("管理密码")<>password or isnull(rs("管理密码")) then
        errormax="密码错!您无权修改此信息,请确认您的身份!如果您确实是此资讯负责人请和系统管理员联系QQ:"&adminqq
      else
        set rs_is=server.CreateObject("adodb.recordset")
        rs_is.open"select * from 资讯 where 名称='"&name&"' and 城市='"&city&"'",conn,1,1
        if rs_is.recordcount>1 then
          errormax="抱歉!您修改的资讯名称与其他资讯名称相同!请修改!"
        else
          dim mod_old,mod_new
          mod_old=""
          mod_new=""
          if rs("名称")<>name then 
            mod_old=mod_old&"名称:"&rs("名称")&"<br>"
            mod_new=mod_new&"名称:"&name&"<br>"
          end if
          if rs("城市")<>city then
            mod_old=mod_old&"城市:"&rs("城市")&"<br>"
            mod_new=mod_new&"城市:"&city&"<br>"
          end if
          if cstr(rs("类别"))<>leibie then
            mod_old=mod_old&"类别:"&rs("类别")&"<br>"
            mod_new=mod_new&"类别:"&leibie&"<br>"
          end if
          if rs("介绍")<>about then
            mod_old=mod_old&"介绍:"&rs("介绍")&"<br>"
            mod_new=mod_new&"介绍:"&about&"<br>"
          end if
          if rs("地址")<>address then
            mod_old=mod_old&"地址:"&rs("地址")&"<br>"
            mod_new=mod_new&"地址:"&address&"<br>"
          end if
          if rs("消费")<>pay then
            mod_old=mod_old&"消费:"&rs("消费")&"<br>"
            mod_new=mod_new&"消费:"&pay&"<br>"
          end if
          if rs("公交")<>bus then
            mod_old=mod_old&"公交:"&rs("公交")&"<br>"
            mod_new=mod_new&"公交:"&bus&"<br>"
          end if
          if rs("网站")<>site then
            mod_old=mod_old&"网站:"&rs("网站")&"<br>"
            mod_new=mod_new&"网站:"&site&"<br>"
          end if
          if rs("电话")<>tel then
            mod_old=mod_old&"电话:"&rs("电话")&"<br>"
            mod_new=mod_new&"电话:"&tel&"<br>"
          end if
          if rs("即时通讯")<>qq then
            mod_old=mod_old&"QQ:"&rs("即时通讯")&"<br>"
            mod_new=mod_new&"QQ:"&qq&"<br>"
          end if
          if rs("图片1")<>pic1 then
            mod_old=mod_old&"图片1:"&rs("图片1")&"<br>"
            mod_new=mod_new&"图片1:"&pic1&"<br>"
          end if
          if rs("图片2")<>pic2 then
            mod_old=mod_old&"图片2:"&rs("图片2")&"<br>"
            mod_new=mod_new&"图片2:"&pic2&"<br>"
          end if
          if rs("图片3")<>pic3 then
            mod_old=mod_old&"图片3:"&rs("图片3")&"<br>"
            mod_new=mod_new&"图片3:"&pic3&"<br>"
          end if
          if rs("图片4")<>pic4 then
            mod_old=mod_old&"图片4:"&rs("图片4")&"<br>"
            mod_new=mod_new&"图片4:"&pic4&"<br>"
          end if
          if rs("其他")<>other then
            mod_old=mod_old&"其他:"&rs("其他")&"<br>"
            mod_new=mod_new&"其他:"&other&"<br>"
          end if
          if rs("老板信息")<>boss then
            mod_old=mod_old&"老板:"&rs("老板信息")&"<br>"
            mod_new=mod_new&"老板:"&boss&"<br>"
          end if
          
          if mod_old="" then
            errormax="您什么也没有修改阿!"
          else
            lock=rs("锁定")
            
            rs("名称")=name
            rs("省份")=pov
            rs("城市")=city
            rs("区号")=quhao
            rs("类别")=leibie
            rs("介绍")=about
            rs("地址")=address
            rs("消费")=pay
            rs("公交")=bus
            rs("网站")=site
            rs("电话")=tel
            rs("即时通讯")=qq
            rs("图片1")=pic1
            rs("图片2")=pic2
            rs("图片3")=pic3
            rs("图片4")=pic4
            rs("其他")=other
            rs("老板信息")=boss
            rs("审核")=sitepass
            if lock=1 then rs("审核")=1
            rs("日期")=now()
            rs.update
            rs.close
            set rs=nothing
            
            set rsbeian=server.CreateObject("adodb.recordset")
            rsbeian.open "select * from 管理备案",conn,3,3
            rsbeian.addnew
            rsbeian("业务类型")="资讯"
            rsbeian("业务编号")=id

⌨️ 快捷键说明

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