⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cost_jh_save.asp

📁 财务预算管理 财务支出
💻 ASP
字号:
<!--#include file="sysconfig.asp"-->
<!--#include file="Inc/Config.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
server_vv=len(Request.ServerVariables("SERVER_NAME"))
server_v1=left(Cstr(Request.ServerVariables("HTTP_REFERER")),server_vv)
server_v2=left(Cstr("http://"&Request.ServerVariables("SERVER_NAME")),server_vv)
if server_v1<>server_v2 and server_v1<>"" and server_v2<>"" then
response.write("<script>alert('错误:禁止从站点外部提交数据!.')</script>")
response.end
end if
%>
<%
dim rs,sql,ErrMsg,FoundErr
dim id,guikou_id,danwei_id,xiangmu_id,cost_no,cost_number,pinmu,yearless,admin,UpdateTime
FoundErr=false
id=Trim(Request.Form("id"))
guikou_id=trim(request.form("s1"))
danwei_id=trim(request.form("s2"))
xiangmu_id=trim(request.form("s3"))
cost_number=trim(request.form("cost_number"))
cost_no=trim(request.form("cost_no"))
pinmu=trim(request.form("pinmu"))
 if   request("yearless")<>""   then   
        yearless=1   
  else   
        yearless=0   
  end   if
'yearless=trim(request.form("yearless"))
admin=trim(request.form("admin"))
updatetime=trim(request.form("updatetime"))

if guikou_id="" then
	founderr=true
	errmsg=errmsg+"<li>未指定所属归口</li>"
end if
if danwei_id="" then
	founderr=true
	errmsg=errmsg+"<li>未指定所属单位</li>"
end if
if xiangmu_id="" then
	founderr=true
	errmsg=errmsg+"<li>未指定所属项目</li>"
end if
if cost_number="" then
	founderr=true
	errmsg="<li>金额不能为空1</li>"
end if

if founderr=false then
	if UpdateTime<>"" and IsDate(UpdateTime)=true then
		UpdateTime=CDate(UpdateTime)
	else
		UpdateTime=now()
	end if
	set rs=server.createobject("adodb.recordset")
	if request("action")="add" then
		sql="select top 1 * from cost_jh" 
		rs.open sql,conn,1,3
		rs.addnew
		 rs("cost_number")=0
		 rs("cost_delete")=0
		rs.update
		call SaveData()
		rs.update
        id=rs("id")
		rs.close
		set rs=nothing
	elseif request("action")="Modify" then
  		if id<>"" then
			sql="select * from cost_jh where id=" & id
			rs.open sql,conn,1,3
			if not (rs.bof and rs.eof) then
				call SaveData()
				rs.update
				rs.close
				set rs=nothing
 			else
				founderr=true
				errmsg=errmsg+"<li>找不到,可能已经被其他人删除。</li>"
				call WriteErrMsg()
			end if
		else
			founderr=true
			errmsg=errmsg+"<li>不能确定id的值</li>"
			call WriteErrMsg()
		end if
	else
		founderr=true
		errmsg=errmsg+"<li>没有选定参数</li>"
		call WriteErrMsg()
	end if

	call CloseConn()
%>
<!-- #include file="Inc/Head.asp" -->
<BR>
<table cellpadding="2" cellspacing="1" border="0" width="510" align="center" class="a2">
	<tr>
		<td class="a1" height="25" align="center"><strong>添加 修改 预算</strong></td>
	</tr>
	<tr class="a4">
		<td align="center">
      <table class="border" align=center width="500" border="0" cellpadding="0" cellspacing="2" bordercolor="#999999">
        <tr align=center bgcolor="#999999"> 
          <td  height="25" colspan="2" class="cost_no"><b> 
            <%if request("action")="add" then%>
            添加 
            <%else%>
            修改 
            <%end if%>
            预算成功</b></td>
        </tr>
        <tr>
          <td height="22" align="right" bgcolor="#C0C0C0">预 算 ID:</td>
          <td bgcolor="#E3E3E3"><%=id%></td>
        </tr>
        <tr> 
          <td height="22" align="right" bgcolor="#C0C0C0">所属情况:</td>
          <td bgcolor="#E3E3E3"> <%=guikou_id%>
            <%set rsguikou=conn.execute("select * from guikou where id="&guikou_id&"")%> <%=rsguikou("guikou_name")%> <%=danwei_id%>
            <%set rsdanwei=conn.execute("select * from danwei where id="&danwei_id&"")%> <%=rsdanwei("danwei_name")%> <%=xiangmu_id%>
            <%set rsxiangmu=conn.execute("select * from xiangmu where id="&xiangmu_id&"")%> <%=rsxiangmu("xiangmu_name")%></td>
        </tr>
        <tr> 
          <td width="120" height="22" align="right" bgcolor="#C0C0C0">预算编号:</td>
          <td width="374" bgcolor="#E3E3E3"><%=cost_no%></td>
        </tr>
        <tr> 
          <td height="22" align="right" bgcolor="#C0C0C0">预算金额:</td>
          <td bgcolor="#E3E3E3"><%=cost_number%> </td>
        </tr>
        <tr> 
          <td height="22" align="right" bgcolor="#C0C0C0">预算品目:</td>
          <td bgcolor="#E3E3E3"><%=pinmu%> </td>
        </tr>
        <tr> 
          <td height="22" align="right" bgcolor="#C0C0C0">不是年初:</td>
          <td bgcolor="#E3E3E3"><% if yearless<>1 then%>
            <%else%> <%end if%>
            是年初数</td>
        </tr>
        <tr> 
          <td height="22" align="right" bgcolor="#C0C0C0">添加人员:</td>
          <td bgcolor="#E3E3E3"><%=admin%></td>
        </tr>
        <tr> 
          <td height="22" align="right" bgcolor="#C0C0C0">录入时间:</td>
          <td bgcolor="#E3E3E3"><%=updatetime%></td>
        </tr>
        <tr> 
          <td height="22" colspan="2" bgcolor="#E3E3E3" class="tdbg"> <p align="center"> 
              【<a href="cost_jh_edit.asp?id=<%=id%>">修改预算</a>】&nbsp;【<a href="cost_jh_add.asp">继续添加预算</a>】&nbsp;【<a href="cost_jh.asp">预算管理</a>】&nbsp;</p></td>
        </tr>
      </table>
		</td>
	</tr>
</table>
<BR>
<%htmlend%>
<%
else
	WriteErrMsg
end if

sub SaveData()
	rs("guikou_id")=guikou_id
	rs("danwei_id")=danwei_id
	rs("xiangmu_id")=xiangmu_id
	rs("cost_no")=cost_no
    rs("cost_number")=cost_number
	rs("pinmu")=pinmu
	rs("yearless")=yearless
	rs("admin")=admin
	rs("UpdateTime")=UpdateTime

end sub
%>

⌨️ 快捷键说明

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