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

📄 cost_jh.asp

📁 财务预算管理 财务支出
💻 ASP
字号:
<%@language=vbscript codepage=936 %>
<%
Option Explicit
%>
<!--#include file="sysconfig.asp"-->
<!--#include file="Inc/Function_1.asp"-->
<%
dim totalPut,CurrentPage,TotalPages
dim i
dim id
dim pinmu
dim sql,rs
dim guikou_id,danwei_id,xiangmu_id,rs1,rs2
dim strAdmin,arrAdmin
const MaxPerPage=20
pinmu=Trim(request("pinmu"))
id=Request("id")
guikou_id=Trim(request("guikou_id"))
danwei_id=Trim(request("danwei_id"))
xiangmu_id=Trim(request("xiangmu_id"))
dim strFileName
strFileName="cost_jh.asp?guikou_id=" & guikou_id& "&danwei_id=" & danwei_id & "&xiangmu_id=" & xiangmu_id

if request("page")<>"" then
    currentPage=cint(request("page"))
else
	currentPage=1
end if

sql="select * from cost_jh where cost_delete=0"
if pinmu<>"" then
	sql=sql & " and pinmu like '%" & pinmu & "%'"
end if
if guikou_id<>"" then
	sql=sql & " and guikou_id='" & guikou_id & "'"
	if danwei_id<>"" then
		sql=sql & " and danwei_id='" & danwei_id & "'"
		if xiangmu_id<>"" then
		sql=sql & " and xiangmu_id='" & xiangmu_id & "'"
	    end if
	end if
else

end if

sql=sql & " order by id desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
%>
<SCRIPT language=javascript>
function unselectall()
{
	if(document.del.chkAll.checked)
	{
		document.del.chkAll.checked = document.del.chkAll.checked;
	} 	
}
function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.Name != "chkAll")
			e.checked = form.chkAll.checked;
	}
}
function ConfirmDel()
{
   if(confirm("确定要删除选中的预算吗?一旦删除将不能恢复!"))
     return true;
   else
     return false;
}
</SCRIPT>
<!-- #include file="Inc/Head.asp" -->
<BR>
<table cellpadding="2" cellspacing="1" border="0" align="center" class="a2">
  <tr>
		
    <td width="783" height="25" align="center" class="a1"><strong>预 算 管 理</strong></td>
	</tr>
	<tr class="a4">
		<td align="center">
      <table width="100%" border="0" align="center" cellpadding="5" cellspacing="2" class="border">
        <tr class="title"> 
          <td height="25" bgcolor="#C0C0C0" class="t1"><a href="cost_jh.asp">所有预算</a>&nbsp; |&nbsp; 
            <%
dim sqlguikou,sqldanwei,sqlxiangmu,rsguikou,rsdanwei,rsxiangmu,rsa,rsb,rsc
sqlguikou="select * from guikou where cost_delete=0"
Set rsguikou= Server.CreateObject("ADODB.Recordset")
rsguikou.open sqlguikou,conn,1,1
if rsguikou.eof then 
	response.Write("还没有任何归口,请首先添加归口。")
end if
do while not rsguikou.eof
	if rsguikou("id")=guikou_id then
		response.Write("<font color='#FF0000'><a href='cost_jh.asp?guikou_id=" & rsguikou("id") & "'>" & rsguikou("guikou_name") & "</a></font> | ")
		else
		response.Write("<a href='cost_jh.asp?guikou_id=" & rsguikou("id") & "'>" & rsguikou("guikou_name") & "</a> | ")
	end if
	rsguikou.movenext
loop
rsguikou.close
set rsguikou=nothing
%>
          </td>
        </tr>
        <%
if guikou_id<>"" then
	sqldanwei="select * from danwei  where cost_delete=0 and  guikou_id='" & guikou_id & "'"
	Set rsdanwei= Server.CreateObject("ADODB.Recordset")
	rsdanwei.open sqldanwei,conn,1,1
	if not (rsdanwei.bof and rsdanwei.eof) then
		response.write "<tr class='t1'><td bgcolor='#E3E3E3'>"
		do while not rsdanwei.eof
			if rsdanwei("id")=danwei_id then
				response.Write("<font color='#FF0000'>&nbsp;<a href='cost_jh.asp?guikou_id=" & rsdanwei("guikou_id") & "&danwei_id=" & rsdanwei("id") & "'>" & rsdanwei("danwei_name") & "</a></font>&nbsp;&nbsp;")
				else
				response.Write("&nbsp;<a href='cost_jh.asp?guikou_id=" & rsdanwei("guikou_id") & "&danwei_id=" & rsdanwei("id") & "'>" & rsdanwei("danwei_name") & "</a>&nbsp;&nbsp;")
			end if
			rsdanwei.movenext
		loop
		response.write "</td></tr>"
	end if
	rsdanwei.close
	set rsdanwei=nothing
end if
%>
        <%
if danwei_id<>"" then
	sqlxiangmu="select * from xiangmu where cost_delete=0 and  guikou_id='" & guikou_id & "'and danwei_id='" & danwei_id & "'"
	Set rsxiangmu= Server.CreateObject("ADODB.Recordset")
	rsxiangmu.open sqlxiangmu,conn,1,1
	if not (rsxiangmu.bof and rsxiangmu.eof) then
		response.write "<tr class='t1'><td bgcolor='#EEEEEEE'>"
		do while not rsxiangmu.eof
			if rsxiangmu("id")=danwei_id then
				response.Write("<font color='#FF0000'>&nbsp;<a href='cost_jh.asp?guikou_id=" & rsxiangmu("guikou_id") & "&danwei_id=" & rsxiangmu("danwei_id") &"&xiangmu_id=" & rsxiangmu("id") & "'>" & rsxiangmu("xiangmu_name") & "</a></font>&nbsp;&nbsp;")
				else
				response.Write("&nbsp;<a href='cost_jh.asp?guikou_id=" & rsxiangmu("guikou_id") & "&danwei_id=" & rsxiangmu("danwei_id") &"&xiangmu_id=" & rsxiangmu("id") & "'>" & rsxiangmu("xiangmu_name") & "</a>&nbsp;&nbsp;")
			end if
			rsxiangmu.movenext
		loop
		response.write "</td></tr>"
	end if
	rsxiangmu.close
	set rsxiangmu=nothing
end if
%>

      </table>
      <form name="del" method="Post" action="cost_jh_Del.asp" onSubmit="return ConfirmDel();">
        <table width="100%" border="0" cellpadding="0" cellspacing="2">
          <tr class="t1"> 
            <td height="25" bgcolor="#CCCCCC"><a href="cost_jh.asp">&nbsp;预算管理</a> 
              &gt;&gt; 
              <%
if request.querystring="" then
	response.write "所有预算"
else
	if request("Query")<>"" then
		if pinmu<>"" then
			response.write "品目中含有“<font color=blue>" & pinmu & "</font>”的预算"
		else
			response.Write("所有预算")
		end if
 	else
		if guikou_id<>"" then
			set rsa=conn.execute("select * from guikou where cost_delete=0 and id="&guikou_id&"")
			response.write rsa("guikou_name")
			response.write "<a href='cost_jh.asp?guikou_id=" & guikou_id & "'>(" & guikou_id & ")</a>&nbsp;&gt;&gt;&nbsp;"
			if danwei_id<>"" then
				set rsb=conn.execute("select * from danwei where cost_delete=0 and id="&danwei_id&"")
				response.write rsb("danwei_name")
				response.write "<a href='cost_jh.asp?guikou_id=" & guikou_id & "&danwei_id=" & danwei_id & "'>(" & danwei_id & ")</a>&nbsp;&gt;&gt;&nbsp;"
				if xingmu_id<>"" then
				    set rsc=conn.execute("select * from xiangmu where cost_delete=0 and id="&xiangmu_id&"")
				    response.write rsc("xiangmu_name")
    				response.write "<a href='cost_jh.asp?guikou_id=" & guikou_id & "&danwei_id=" & danwei_id & "&xiangmu_id=" & xiangmu_id & "'>(" & xiangmu_id & ")</a>"
				 end if
			else
				response.write "所有单位所有项目"
			end if
		end if
	end if
end if
%>
            </td>
            <td width="150" bgcolor="#CCCCCC">&nbsp; 
              <%
  	if rs.eof and rs.bof then
		response.write "共有 0 个预算</td></tr></table>"
	else
    	totalPut=rs.recordcount
		if currentpage<1 then
       		currentpage=1
    	end if
    	if (currentpage-1)*MaxPerPage>totalput then
	   		if (totalPut mod MaxPerPage)=0 then
	     		currentpage= totalPut \ MaxPerPage
		  	else
		      	currentpage= totalPut \ MaxPerPage + 1
	   		end if

    	end if
		response.Write "共找到 " & totalPut & " 个预算"
%>
            </td>
          </tr>
        </table>
        <%		
	    if currentPage=1 then
        	showContent
        	showpage strFileName,totalput,MaxPerPage,true,false,"个预算"
   	 	else
   	     	if (currentPage-1)*MaxPerPage<totalPut then
         	   	rs.move  (currentPage-1)*MaxPerPage
         		dim bookmark
           		bookmark=rs.bookmark
            	showContent
            	showpage strFileName,totalput,MaxPerPage,true,false,"个预算"
        	else
	        	currentPage=1
           		showContent
           		showpage strFileName,totalput,MaxPerPage,true,false,"个预算"
	    	end if
		end if
	end if
%>
        <%  
sub showContent()
   	dim i
    i=0
%>
        <table class="border" border="0" cellspacing="2" width="100%" cellpadding="0" >
          <tr bgcolor="#C0C0C0" class="t1"> 
            <td width="5%" height="25" align="center"><strong>选中</strong></td>
            <td width="5%"  height="25" align="center" bgcolor="#C0C0C0"><strong>ID</strong></td>
            <td width="12%" align="center" bgcolor="#C0C0C0"><strong>预算编号</strong></td>
            <td width="12%" align="center" bgcolor="#C0C0C0" ><strong>单位名称</strong></td>
            <td width="12%" align="center" bgcolor="#C0C0C0" ><strong>项目名称</strong></td>
            <td width="12%" align="center" bgcolor="#C0C0C0" ><strong>品目</strong></td>
            <td width="12%" align="center" bgcolor="#C0C0C0" ><strong>预算金额</strong></td>
            <td width="12%" align="center" ><strong>加入时间</strong></td>
            <td width="6%" align="center" ><strong>年初</strong></td>
            <td width="10%" align="center" ><strong>操作</strong></td>
          </tr>
          <%do while not rs.eof%>
          <tr class="t1"> 
            <td width="5%" height="22" align="center" bgcolor="#C0C0C0"> 
              <input name='id'type='checkbox'onclick="unselectall()" id="id" value='<%=cstr(rs("id"))%>'> </td>
            <td width="5%" align="center" bgcolor="#E3E3E3"><%=rs("id")%></td>
            <td width="12%" align="center" bgcolor="#E3E3E3"><%=rs("cost_no")%></td>
            <td width="12%" align="center" bgcolor="#E3E3E3"> 
              <%set rs1=conn.execute("select * from danwei where cost_delete=0 and id="&rs("danwei_id")&"")%>
              <%=rs1("danwei_name")%></td>
            <td width="12%" align="center" bgcolor="#E3E3E3"> 
              <%set rs2=conn.execute("select * from xiangmu where cost_delete=0 and  id="&rs("xiangmu_id")&"")%>
              <%=rs2("xiangmu_name")%></td>
            <td width="12%" align="center" bgcolor="#E3E3E3"><%=rs("pinmu")%></td>
            <td width="12%" align="center" bgcolor="#E3E3E3"><%=rs("cost_number")%></td>
            <td width="12%" align="center" bgcolor="#E3E3E3"><%= FormatDateTime(rs("UpdateTime"),2) %></td>
            <td width="6%" align="center" bgcolor="#E3E3E3"> 
              <%if rs("yearless") then%> 年初 <%else%>追加<%end if%> </td>
            <td width="10%" align="center" bgcolor="#E3E3E3">
			<%if admin_quanli=1 then%>
			 <a href="cost_jh_edit.asp?id=<%=rs("id")%>">修改</a> 
              <a href="cost_jh_Del.asp?id=<%=rs("id")%>&Action=Del" onClick="return ConfirmDel();">删除</a> 
            <%else if  admin_quanli=2 and rs("guikou_id")=admin_guikou_id then %>
			 <a href="cost_jh_edit.asp?id=<%=rs("id")%>">修改</a> 
			 <%else%>
			<%end if%>
			<%end if%>
			</td>
          </tr>
          <%
	i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	loop
%>
   </table>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr class="t1"> 
            <td width="250" height="30"> 
              <input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
              选中本页显示的所有预算</td>
            <td> 
				<%if admin_quanli=1 then%>
              <input name="submit" type='submit'value='删除选定的预算'<%if session("purview")>=3 and session("purview")<=4 and PurviewChecked=False then response.write "disabled"%>> 
              <input name="Action" type="hidden" id="Action" value="Del">
			  <%else%>
			  <% end  if%></td>
          </tr>
        </table>
<%
   end sub 
%>
      </form>
      <br> 
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
        <tr class="tdbg">
          <form name="search" method="get" action="cost_jh.asp">
            <td height="25"> <span class="t1"><strong>查找预算:</strong> 
              <input name="pinmu" type="text" class=smallInput id="pinmu" size="20" maxlength="50">
              <input name="Query" type="submit" id="Query" value="查 询">
              &nbsp;&nbsp;请输入<font color="#FF0000">&quot;品目&quot;</font>模糊查询。如果为空,则查找所有预算。</span></td>
          </form>
        </tr>
      </table><BR>
		</td>
	</tr>
</table>
<BR>
<%
rs.close
set rs=nothing  
%>
<br>
<%htmlend%>

⌨️ 快捷键说明

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