📄 add_contract.asp
字号:
<!--#include file="user_timeout.asp"-->
<!--#include file="getabcd.asp"-->
<%
c_no=trim(request("c_no"))
c_content=trim(request("c_content"))
c_file=trim(request("c_file"))
c_total=request("c_total")
first_payment=request("first_payment")
last_payment=c_total-first_payment
'response.write c_no&"|"&c_content&"|"&c_total&"|"&first_payment&"|"&last_payment
'response.end
if c_no="" or c_total="" or c_content="" or first_payment="" then
errmsg="所填项均不能为空,请重新填写!"
return_url="main.asp"
elseif not IsNumeric(c_total) or not IsNumeric(first_payment) or not IsNumeric(last_payment) then
errmsg="总金额、首款必须为数字,请重新填写!"
return_url="main.asp"
elseif last_payment<0 then
errmsg="总金额不能小于首款,请重新填写!"
return_url="main.asp"
else
sql="select * from contract where c_no='"&c_no&"'"
rs.open sql,conn,1,1
query_num=rs.recordcount
'response.write sql
'response.write query_num
'response.end
rs.close
if query_num>0 then
errmsg="合同“<font color=red>"&c_no&"</font>”已存在,请重新填写!"
return_url="main.asp"
else
tmp="nothing"
if c_file<>"" then
'文件上传
tmp=c_no&mid(c_file,instrrev(c_file,"."),4)
'response.write tmp
'response.end
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.LoadFromFile c_file
objStream.SaveToFile Server.MapPath("con_files/"&tmp),2
objStream.Close
end if
sql1="insert into contract (c_no,c_content,c_total,first_payment,last_payment,create_time,c_state,c_file) values ('"&c_no&"','"&c_content&"',"&c_total&","&first_payment&","&last_payment&",'"&now()&"','new','"&tmp&"')"
rs.open sql1,conn,0,1
'response.write sql1&"hahaha"
'response.end
errmsg="合同“<font color=red>"&c_no&"</font>”录入成功!"
return_url="main.asp"
end if
end if
%>
<html>
<head>
<title>北华航天工业学院 设备合同管理系统</title>
<META HTTP-EQUIV=REFRESH CONTENT='1; URL=<%=return_url%>'>
<link href="global.css" rel="stylesheet" type="text/css">
</head>
<body>
<br><br><br><br><br><br><br><br><br><br><br>
<center><%=errmsg%></center>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -