📄 sca_save.asp
字号:
<!--#include file="top.asp"-->
<%if userflag2=0 then
response.redirect"ok.asp?action=flag"
end if%>
<%page=request("page")
if page="" then page=1
scatitle=request("scatitle")
if userflag33<>1 then
sca=code_jk(request("scas"))
else
For i = 1 To Request.Form("scas").Count
sca = sca & Request.Form("scas")(i)
Next
end if
key=request("key")
scasort=request("scasort")
ypxxone_id=request("ypxxone_id")
ypxxtwo_id=request("ypxxtwo_id")
addone_id=request("addone_id")
addtwo_id=request("addtwo_id")
yp_id=session("id")
key1=cityscakey
ldate=CInt(request("ldate"))
pic1=request("magicfacepic(1)")
pic2=request("magicfacepic(2)")
pic3=request("magicfacepic(3)")
if pic1="" then pic1="img/null.bmp"
if pic2="" then pic2="img/null.bmp"
if pic3="" then pic3="img/null.bmp"
if request("action")="del" then
page=request("page")
if page="" then page=1
conn.execute("delete from SMT_sca where SMT_id=" & request("id")&" and SMT_yp_id="&session("id")&"")
conn.execute("delete from SMT_leaveword where SMT_book_sort=3 and SMT_book_table=" & request("id")&" and SMT_book_ypid="&session("id")&"")
Response.Redirect "ok.asp?url=sca.asp?page="&page
elseif request("action")="add" then
'====================================
if scatitle="" then
errstyle="·请输入完整的商机标题!"
scripterr
end if
if sca="" or len(sca)<20 then
errstyle="·请输入不少于20个字符的商机内容!"
scripterr
end if
if ypxxone_id<>"" and ypxxtwo_id="" then
errstyle="·如果您选择了行业大类,那么其小类必须选择!"
scripterr
end if
if addone_id<>"" and addtwo_id="" then
errstyle="·如果您选择了省,那么其地区必须选择!"
scripterr
end if
begindate=now()
lastdate=now()+ldate
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from SMT_yp where SMT_id="&yp_id
rs.open sql,conn,1,1
ypxxone_id_=rs("SMT_ypxxone_id")
ypxxtwo_id_=rs("SMT_ypxxtwo_id")
addone_id_=rs("SMT_addone_id")
addtwo_id_=rs("SMT_addtwo_id")
rs.close
if ypxxone_id="" then
ypxxone_id=ypxxone_id_
ypxxtwo_id=ypxxtwo_id_
end if
if addone_id="" then
addone_id=addone_id_
addtwo_id=addtwo_id_
end if
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from SMT_sca where SMT_yp_id="& session("id")
rs.open sql,conn,1,3
if userflag2<>0 then
if rs.recordcount >= cint(userflag2) then
errstyle="·您是"&vipshow&",只能上传最多 "&userflag2&" 条商贸机会!"
scripterr
end if
else
errstyle="·对不起,此功能已对"&vipshow&"关闭!"
scripterr
end if
rs.addnew
rs("SMT_scatitle")=scatitle
rs("SMT_sca")=sca
rs("SMT_key")=key
rs("SMT_key1")=key1
rs("SMT_yp_id")=yp_id
rs("SMT_scasort")=scasort
rs("SMT_begindate")=begindate
rs("SMT_lastdate")=lastdate
rs("SMT_ypxxone_id")=ypxxone_id
rs("SMT_ypxxtwo_id")=ypxxtwo_id
rs("SMT_addone_id")=addone_id
rs("SMT_addtwo_id")=addtwo_id
rs("SMT_pic1")=pic1
rs("SMT_pic2")=pic2
rs("SMT_pic3")=pic3
rs.update
rs.close
set rs=nothing
if cityscakey=1 then
response.redirect"ok.asp?url=sca_add.asp"
elseif cityscakey=0 then
response.redirect"ok.asp?url=sca_add.asp&key=yes"
end if
elseif request("action")="edit" then
if scatitle="" then
errstyle="·请输入完整的商机标题!"
scripterr
end if
if sca="" or len(sca)<20 then
errstyle="·请输入不少于20个字符的商机内容!"
scripterr
end if
if ypxxone_id<>"" and ypxxtwo_id="" then
errstyle="·如果您选择了行业大类,那么其小类必须选择!"
scripterr
end if
if addone_id<>"" and addtwo_id="" then
errstyle="·如果您选择了省,那么其地区必须选择!"
scripterr
end if
begindate=request("begindate")
lastdate=cdate(begindate)+ldate
ypxxone_id_=request("ypxxone_id_")
ypxxtwo_id_=request("ypxxtwo_id_")
addone_id_=request("addone_id_")
addtwo_id_=request("addtwo_id_")
if ypxxone_id="" then
ypxxone_id=ypxxone_id_
ypxxtwo_id=ypxxtwo_id_
end if
if addone_id="" then
addone_id=addone_id_
addtwo_id=addtwo_id_
end if
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from SMT_sca where SMT_id="&request("id")&" and SMT_yp_id="&session("id")
rs.open sql,conn,1,3
if userflag2=0 then
errstyle="·对不起,此功能已对"&vipshow&"关闭!"
scripterr
end if
rs("SMT_scatitle")=scatitle
rs("SMT_sca")=sca
rs("SMT_key")=key
rs("SMT_key1")=key1
rs("SMT_yp_id")=yp_id
rs("SMT_scasort")=scasort
rs("SMT_lastdate")=lastdate
rs("SMT_ypxxone_id")=ypxxone_id
rs("SMT_ypxxtwo_id")=ypxxtwo_id
rs("SMT_addone_id")=addone_id
rs("SMT_addtwo_id")=addtwo_id
rs("SMT_pic1")=pic1
rs("SMT_pic2")=pic2
rs("SMT_pic3")=pic3
rs.update
rs.close
set rs=nothing
if cityscakey=1 then
response.redirect"ok.asp?url=sca.asp&page="&page
elseif cityscakey=0 then
response.redirect"ok.asp?url=sca.asp&page="&page&"&key=yes"
end if
elseif request("action")="key" then
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from SMT_sca where SMT_id="&request("id")&" and SMT_yp_id="&session("id")
rs.open sql,conn,1,3
rs("SMT_key")=request("zt")
rs.update
rs.close
set rs=nothing
response.redirect"ok.asp?url=sca.asp?page="&page
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -