📄 rizhisave.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")
a4=session("hxf_u_nickname")
a7=request.form("a4")
action=request("action")
a1=request.form("a1")
a2=request.form("a2")
a3=request.form("a3")
a5=request.form("a5")
a6=request.form("a6")
if a5="" then a5="无"
'检验数据合法性
if a1="" or a2="" or a3="" then
%>
<script language=vbscript>
MsgBox "错误:输入不能有空,没有信息的请填写[不详]!"
location.href = "rizhi.asp?action=<%=action%>"
</script>
<%else
if action=30 then
set tablelist=conn.execute("select * from 工作日志 where a2='" &a2 &"'")
end if
if action=35 then
set tablelist=conn.execute("select * from 记事本 where a2='" &a2 &"'")
end if
if action=41 then
set tablelist=conn.execute("select * from 值班 where a2='" &a2 &"'")
end if
if action=42 then
set tablelist=conn.execute("select * from 档案 where a2='" &a2 &"'")
end if
if not(tablelist.eof and tablelist.bof) then
%>
<script language=vbscript>
MsgBox "错误:数据库中已经存在此此信息,禁止重复提交!"
location.href = "rizhi.asp?action=<%=action%>"
</script>
<%else
'写入记录
if action=30 then
sql="SELECT * FROM 工作日志 WHERE 有效=true"
set rs=conn.Execute(sql)
If not(Rs.Bof OR Rs.Eof) Then
id=rs("id")
sql="update 工作日志 set a1='"&a1&"',a2='"&a2&"',a3='"&a3&"',a4='"&a4&"',有效=false where id="&id
conn.Execute(sql)
else
conn.execute("insert into 工作日志(a1,a2,a3,a4) values('" &a1 &"','" &a2 &"','" &a3 &"','" &a4&"')")
end if
end if
if action=35 then
sql="SELECT * FROM 记事本 WHERE 有效=true"
set rs=conn.Execute(sql)
If not(Rs.Bof OR Rs.Eof) Then
id=rs("id")
sql="update 记事本 set a1='"&a1&"',a2='"&a2&"',a3='"&a3&"',a4='"&a4&"',有效=false where id="&id
conn.Execute(sql)
else
conn.execute("insert into 记事本(a1,a2,a3,a4,a5) values('" &a1 &"','" &a2 &"','" &a3 &"','" &a4&"','" &a5&"')")
end if
end if
if action=41 then
sql="SELECT * FROM 值班 WHERE 有效=true"
set rs=conn.Execute(sql)
If not(Rs.Bof OR Rs.Eof) Then
id=rs("id")
sql="update 值班 set a1='"&a1&"',a2='"&a2&"',a3='"&a3&"',a4='"&a4&"',有效=false where id="&id
conn.Execute(sql)
else
conn.execute("insert into 值班(a1,a2,a3,a4,a5) values('" &a1 &"','" &a2 &"','" &a3 &"','" &a4&"','" &a5&"')")
end if
end if
if action=42 then
sql="SELECT * FROM 档案 WHERE 有效=true"
set rs=conn.Execute(sql)
If not(Rs.Bof OR Rs.Eof) Then
id=rs("id")
sql="update 档案 set a1='"&a1&"',a2='"&a2&"',a3='"&a3&"',a4='"&a7&"',a5='"&a5&"',a6='"&a6&"',a7='"&a4&"',有效=false where id="&id
conn.Execute(sql)
else
conn.execute("insert into 档案(a1,a2,a3,a4,a5,a6,a7) values('" &a1 &"','" &a2 &"','" &a3 &"','" &a7&"','" &a5&"','" &a6&"','" &a4&"')")
end if
end if
%>
<script language=vbscript>
MsgBox "系统提示:提交成功,按此返回!"
location.href = "rizhi.asp?action=<%=action%>"
</script>
<%end if
conn.close
set conn=nothing
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -