📄 yongchesave.asp
字号:
<%action=request.querystring("action")
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
connstr=Application("hg_connstr")
conn.open connstr
ljldj=Session("hxf_u_grade")
%>
<%
'获取数据
sid=clng(request.querystring("id"))
action=request("action")
a1=request.form("a1")
a2=request.form("a2")
a3=request.form("a3")
a4=request.form("a4")
a5=request.form("a5")
a6=session("hxf_u_nickname")
a7 = Request.ServerVariables("REMOTE_ADDR")
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
a8=n & "-" & y & "-" & r & " " & s & ":" & f & ":" & m
'检验数据合法性
if a1="" or a2="" or a3="" or a4="" or a5="" then
%>
<script language=vbscript>
MsgBox "错误:输入不能有空,没有信息的请填写[不详]!"
location.href = "yongcheshenqing.asp?action=23"
</script>
<%else
if action=23 then
set tablelist=conn.execute("select * from 用车申请 where a1='"&a1&"' and a9=true")
else
set tablelist=conn.execute("select * from 用车申请 where a9=true and id<>"&sid)
end if
if not(tablelist.eof and tablelist.bof) then
%>
<script language=vbscript>
MsgBox "错误:您所选择车辆请求已经派出,请重新选择其他的车辆!"
location.href = "yongcheshenqing.asp?action=23"
</script>
<%else
'写入记录
if action=23 then
conn.execute("insert into 用车申请(a1,a2,a3,a4,a5,a6,a7,a8) values('" &a1 &"','" &a2 &"','" &a3 &"','" &a4&"','" &a5&"','" &a6&"','" &a7&"','" &a8&"')")
else
conn.execute("update 用车申请 set a1='"&a1&"',a2='"&a2&"',a3='"&a3&"',a4='"&a4&"',a5='"&a5&"',a6='"&a6&"',a7='"&a7&"',a8='"&a8&"',a9='"&a9&"',a10='"&a10&"',a11='"&a11&"',a12='"&a12&"' where id="&sid)
end if
%>
<script language=vbscript>
MsgBox "系统提示:提交成功,按此返回!"
location.href = "yongcheshenqing.asp?action=23"
</script>
<%end if
conn.close
set conn=nothing
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -