?? projectstat4_list.asp
字號:
<!--#include file="../Include/AdoConn.asp"-->
<!--#include file="../Include/online.asp"-->
<%
dim WhereProjectJD
'根據查詢界面,生成where選項。
select case trim(Request.Form ("ProjectJD"))
case ""
WhereProjectJD=" and 項目進度<>'申報'"
case "申報"
WhereProjectJD=" and (項目進度='推薦' or 項目進度='接收')"
case "初審"
WhereProjectJD=" and 項目進度='初審'"
case "專家論證"
WhereProjectJD=" and 項目進度='初審'"
case "立項"
WhereProjectJD=" and 項目進度='立項'"
end select
'創建一記錄集
set objres=server.CreateObject ("adodb.recordset")
objres.CursorType =3
objres.CursorLocation =3
objres.LockType =2
role=trim(Request.Form("role"))
'根據角色生成where選項
select case role
case 0 '系統維護員
strSQLWhere=""
case 1 '申報者
strSQLWhere=" and 項目負責人='"&session("usercode")&"'"
case 2 '主管部門
strSQLWhere=" and left(項目負責人,3)='"&left(session("usercode"),3)&"'"
case 3 '項目計劃員
strSQLWhere=""
case 4 '項目管理員
strSQLWhere=" and 分配接收處室='"&session("Departcode")&"'"
case 5 '項目撥款員
strSQLWhere=" and 合同編碼<>''"
case 6 '部門領導
strSQLWhere=""
end select
dim ProjectType'所有項目類別
ProjectType=array("標題","11","12","21","22","23","31","32","33","34","41","42","43","44","45","46","47","48","總計")
'根據form選擇的表生成列標題,及sql語句
dim rol'列標題
rol=array("合計金額","無償","貼息","有償")
rol_display=array("合計金額","無償","貼息","有償","項目數量","平均額度")
redim stat(ubound(ProjectType),ubound(rol)+2)'統計值,加2為,"項目數量","平均額度"
'初始化
for i=0 to ubound(stat,1)
for j=0 to ubound(stat,2)
stat(i,j)=0
next
next
for i=0 to ubound(rol_display)
stat(0,i)=rol_display(i)
next
'打開記錄集
dim strsql
strsql="select 項目類別,申請經費總額,無償,貼息,有償 from xt_vd_ProjectStat where 1=1 "&strSQLWhere&whereProjectJD&" order by 項目類別"
objres.Open strsql,strconn
if not objres.EOF then
for r=1 to objres.RecordCount
for i=1 to ubound(ProjectType)-1'每條記錄與行標題比較,減一為去掉總計行
if objres(0)=ProjectType(i) then'確定哪行
for j=0 to ubound(rol)'
stat(i,j)=stat(i,j)+clng(objres(j+1))'經費總額,無償,有償,貼息
stat(ubound(stat,1),j)=stat(ubound(stat,1),j)+clng(objres(j+1))'縱向合計
next
stat(i,ubound(rol)+1)=stat(i,ubound(rol)+1)+1'項目數加1
stat(i,ubound(rol)+2)=stat(i,0)/stat(i,ubound(rol)+1)'平均額度,即總額除項目數
stat(ubound(Stat,1),ubound(rol)+1)=stat(ubound(Stat,1),ubound(rol)+1)+1'項目總數
Stat(ubound(Stat,1),Ubound(Stat,2))=Stat(ubound(Stat,1),0)/stat(ubound(stat,1),ubound(rol)+1)'總計除項目數的平均額度
end if
next
objres.MoveNext
next
end if
objres.Close
%>
<html>
<head>
<title>項目列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="/CssLib/CssLink.css">
</head>
<body bgcolor="#FFFFFF" text="#000000" onload="window.top.ProjectMax()">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="457" align="center"><img src="images/STAT4.gif" width="378" height="25">
(單位:萬元)</td>
<td width="50">
<div align="center"><a href="../Project/ProjectStat_Query.asp"><img src="../public/images/query.gif" width="24" height="18" border="0"></a><a href="../Project/ProjectStat_Query.asp><img src="../public/images/query.gif" width="24" height="18" border="0"><br>
</a> <font color="#003399">查詢</font></div>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0" bordercolor="#0099FF" align="center" bgcolor="#006699">
<tr bordercolor="#0099FF" align="center">
<td colspan="2" bgcolor="#FFFFFF">
<table border="0" cellspacing="1" cellpadding="0" bordercolor="#0099FF" align="center" bgcolor="#006699" width="100%">
<tr bordercolor="#0099FF" align="center" bgcolor="#6699CC">
<td height="30" width="80"><font color="#FFFFFF">計劃類別</font></td>
<td height="30" width="80"><font color="#FFFFFF">計劃層次</font></td>
</tr>
<tr bordercolor="#0099FF" align="center">
<td rowspan="2" height="17" bgcolor="#FFFFFF" width="80">應用開發</td>
<td height="16" bgcolor="#FFFFFF" width="80">重點</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">啟動</td>
</tr>
<tr bordercolor="#0099FF" align="center">
<td rowspan="3" height="16" bgcolor="#FFFFFF" width="80">科技攻關</td>
<td height="16" bgcolor="#FFFFFF" width="80">重大 </td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">重點</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">一般</td>
</tr>
<tr bordercolor="#0099FF" align="center">
<td rowspan="4" height="16" bgcolor="#FFFFFF" width="80">產業化</td>
<td height="16" bgcolor="#FFFFFF" width="80">重大</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">重點</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">一般</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">專利</td>
</tr>
<tr bordercolor="#0099FF" align="center">
<td rowspan="8" height="16" bgcolor="#FFFFFF" width="80">創新條件與<br>
環境建設</td>
<td height="16" bgcolor="#FFFFFF" width="80">中介服務</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">國際合作</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">工程中心</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">重點實驗室</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">企業孵化器</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">軟科學</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">科學普及</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td height="16" width="80">其他</td>
</tr>
<tr bordercolor="#0099FF" align="center">
<td height="16" bgcolor="#FFFFFF" width="80"> </td>
<td height="16" bgcolor="#FFFFFF" width="80">總計</td>
</tr>
</table>
</td>
<td height="325">
<table width="100%" border="0" cellspacing="1" cellpadding="0" bordercolor="#0099FF" align="center" bgcolor="#006699">
<%for i=0 to ubound(stat,1) %>
<tr align="center">
<%for j=0 to ubound(stat,2)%>
<%if i=0 then%>
<td bgcolor="#6699CC" width="80" height="30">
<%if Stat(i,j)<>"0" then response.write "<font color='#ffffff'>"&stat(i,j)&"</font>" end if%>
<%else%>
<td bgcolor="#FFFFFF" width="80" height="16">
<%if Stat(i,j)<>"0" then
if j<>ubound(stat,2) then response.write Stat(i,j) else Response.Write formatNumber(Stat(i,j),2) end if
end if%>
<%end if%>
</td>
<%next%>
</tr>
<%next%>
</table>
</td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -