📄 reports_hz.asp
字号:
<%@language=vbscript codepage=936 %>
<%
Option Explicit
%>
<!--#include file="sysconfig.asp"-->
<!--#include file="Inc/Function_1.asp"-->
<%
dim id,sql,sql_jh,sql_detail,sqlguikou,rs,rsguikou,rs_jh,rs_detail,guikou_id,totalput,sum_y,sum_j,sum_r
dim count_sum_y,count_sum_j,count_sum_r
guikou_id=Trim(request("guikou_id"))
totalput=0
dim strFileName
strFileName="reports_hz.asp?guikou_id=" & guikou_id
sql="select * from danwei where cost_delete=0"
if guikou_id<>"" then
sql=sql & " and guikou_id='" & guikou_id & "'"
end if
sql=sql & " order by id "
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
totalPut=rs.recordcount
%>
<!-- #include file="Inc/Head.asp" -->
<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="reports_hz.asp">所有单位汇总表</a> |
<%
'分类选择
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("<a href='reports_hz.asp?guikou_id=" & rsguikou("id") & "'><font color='#FF0000'>" & rsguikou("guikou_name") & "</font></a> | ")
else
response.Write("<a href='reports_hz.asp?guikou_id=" & rsguikou("id") & "'>" & rsguikou("guikou_name") & "</a> | ")
end if
rsguikou.movenext
loop
rsguikou.close
set rsguikou=nothing
%>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="2">
<tr>
<td height="25" bgcolor="#CCCCCC" class="t1"><a href="reports_hz.asp"> 所有单位汇总表</a>
>>
<%
if guikou_id<>"" then
set rsguikou=conn.execute("select * from guikou where cost_delete=0 and id="&guikou_id&"")
response.write "<a href='reports_hz.asp?guikou_id=" & guikou_id & "'>" &rsguikou("guikou_name")& "</a> "
else
response.write "所有单位"
end if
%>
</td>
<td width="150" bgcolor="#CCCCCC" class="t1">
<%
if rs.eof and rs.bof then
response.write "共有 0 个单位</td></tr></table>"
else
response.Write "共找到 " & totalPut & " 个单位"
%>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="border">
<tr bgcolor="#C0C0C0" class="title">
<td height="25" colspan="5" align="center" bgcolor="#C0C0C0" class="t1" ><strong>荆州市政府采购执行情况汇总表
<input type="hidden" name="out_word3" onclick="vbscript:buildDoc" value="导出到word" class="notPrint">
<input type="hidden" name="out_excel2" onclick="AutomateExcel();" value="导出到excel" class="notPrint">
<input name="out_excel12" type="button" class="notPrint" id="out_excel12" onclick="javascript:AutomateExcel() " value="打印到excel">
<input type="button" name="out_word22" onclick="vbscript:buildDoc" value="打印到word" class="notPrint">
</strong></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="2" class="border" id="reports" >
<tr bgcolor="#C0C0C0" class="t1">
<td width="20%" height="25" align="center" bgcolor="#C0C0C0" ><strong>单位名称</strong></td>
<td width="20%" align="center" bgcolor="#C0C0C0" ><strong>年初采购预算</strong></td>
<td width="20%" align="center" bgcolor="#C0C0C0" ><strong>政府计划下达金额</strong></td>
<td width="20%" align="center" bgcolor="#C0C0C0" ><strong>实际政府采购金额</strong></td>
<td width="20%" align="center" ><strong>政府采购预算余额</strong></td>
</tr>
<% count_sum_y=0
count_sum_j=0
count_sum_r=0
do while not rs.eof%>
<tr class="t1">
<td width="20%" height="22" align="center" bgcolor="#E3E3E3"><%=rs("danwei_name")%> </td>
<td width="20%" align="center" bgcolor="#E3E3E3">
<% sum_y=0
id=rs("id")
sql_jh="select * from cost_jh where danwei_id="&id
Set rs_jh= Server.CreateObject("ADODB.Recordset")
rs_jh.open sql_jh,conn,1,1
if not(rs_jh.bof and rs_jh.eof) then
do while not rs_jh.eof
sum_y=sum_y+rs_jh("cost_number")
rs_jh.movenext
loop
else
end if
Response.Write(sum_y)
rs_jh.close
set rs_jh=nothing
%> </td>
<td width="20%" align="center" bgcolor="#E3E3E3">
<% sum_j=0
sum_r=0
sql_detail="select * from cost_detail where danwei_id="&id
Set rs_detail= Server.CreateObject("ADODB.Recordset")
rs_detail.open sql_detail,conn,1,1
if not(rs_detail.bof and rs_detail.eof) then
do while not rs_detail.eof
sum_j=sum_j+rs_detail("cost_number_j")
sum_r=sum_r+rs_detail("cost_number_r")
rs_detail.movenext
loop
else
end if
Response.Write(sum_j)
rs_detail.close
set rs_detail=nothing
%> </td>
<td width="20%" align="center" bgcolor="#E3E3E3"><%=sum_r%></td>
<td width="20%" align="center" bgcolor="#E3E3E3"><%=sum_y-sum_r%></td>
</tr>
<%
count_sum_y=count_sum_y+sum_y
count_sum_j=count_sum_j+sum_j
count_sum_r=count_sum_r+sum_r
rs.movenext
loop
%>
<tr bgcolor="#E3E3E3" class="t1">
<td width="20%">
<div align="center"><strong>合计</strong></div></td>
<td width="20%">
<div align="center"><strong><%=count_sum_y%></strong></div></td>
<td width="20%" bgcolor="#E3E3E3">
<div align="center"><strong><%=count_sum_j%></strong></div></td>
<td width="20%">
<div align="center"><strong><%=count_sum_r%></strong></div></td>
<td width="20%">
<div align="center"><strong><%=count_sum_y-count_sum_r%></strong></div></td>
</tr>
<tr bgcolor="#E3E3E3" class="t1" >
<td height="25" align="center" >内容:
<%if guikou_id<>"" then
set rsguikou=conn.execute("select * from guikou where cost_delete=0 and id="&guikou_id&"")
response.write rsguikou("guikou_name")
else
response.write "所有单位"
end if
%>
</td>
<td height="25" align="center" > </td>
<td height="25" align="center" >制表人:<%=Session("username")%></td>
<td height="25" align="center" > </td>
<td height="25" align="center" >制表时间:<%=month(now())%>月<%=day(now())%>日</td>
</tr>
</table>
<%
end if
%>
<br>
<BR>
</td>
</tr>
</table>
<BR>
<!--#include file="print.asp"-->
<%
call htmlend
rs.close
set rs=nothing
call CloseConn()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -