📄 projectstat1_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'所有列标题,用于数据库查询
dim rol_display'所有列标题,用于显示
dim strsql
select case Request.form("table")
case "1"
rol=array ("合计","电子信息","自动化","生物制药","材料化工","节能环保","社会发展","农业","其他")
rol_display=rol
strsql="select 项目类别,技术领域,count(项目编码) as 总数 from xt_VD_ProjectStat where 1=1 "&strSQLWhere&whereProjectJD&" group by 项目类别,技术领域 order by 项目类别"
case "2"
rol=array ("合计","浑南新区","张士开发区","农业高新区","沈河区","和平区","大东区","铁西区","皇姑区","东陵区","于洪区","苏家屯","新城子","法库","新民","辽中","康平","其它")
rol_display=array("合计","浑南","张士","农业","沈河","和平","大东","铁西","皇姑","东陵","于洪","苏家屯","新城子","法库","新民","辽中","康平","其它")
strsql="select 项目类别,所在区,count(项目编码) as 总数 from xt_VD_ProjectStat where 1=1 "&strSQLWhere&whereProjectJD&" group by 项目类别,所在区 order by 项目类别"
case "3"
Response.end
case "4"
Response.End
end select
redim stat(ubound(ProjectType),ubound(rol))
'初始化
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
'打开记录集
objres.Open strsql,strconn
if not objres.EOF then
for r=1 to objres.RecordCount
for i=1 to ubound(ProjectType)-1'每条记录与行标题比较,减一为去掉总计行,i从1开始为去掉标题行
if objres(0)=ProjectType(i) then'确定哪行
for j=1 to ubound(rol)'从1开始为去掉合计列(0)
if objres(1)=rol(j) then '确定哪列
Stat(i,j)=objres(2)
stat(i,0)=stat(i,0)+objres(2)'横向合计
stat(ubound(stat,1),j)=stat(ubound(stat,1),j)+objres(2)'纵向合计
stat(ubound(stat,1),0)=stat(ubound(stat,1),0)+objres(2)'总计
end if
next
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/STAT<%=request.form("table")%>.gif" width="378" height="25" align="middle"></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="0" cellpadding="0" bordercolor="#0099FF" align="center" bgcolor="#006699">
<tr bordercolor="#0099FF" align="center">
<td bgcolor="#FFFFFF" width="128" valign="top">
<table width="128" border="0" cellspacing="1" cellpadding="0" bordercolor="#0099FF" align="center" bgcolor="#006699">
<tr bordercolor="#0099FF" align="center" bgcolor="#6699CC">
<td height="30" width="58"><font color="#FFFFFF">计划类别</font></td>
<td width="70" height="30"><font color="#FFFFFF">计划层次</font></td>
</tr>
<tr bordercolor="#0099FF" align="center">
<td rowspan="2" height="17" bgcolor="#FFFFFF">应用开发</td>
<td width="70" height="16" bgcolor="#FFFFFF">重点</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">启动</td>
</tr>
<tr bordercolor="#0099FF" align="center">
<td rowspan="3" height="16" width="58" bgcolor="#FFFFFF">科技攻关</td>
<td width="70" height="16" bgcolor="#FFFFFF">重大 </td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">重点</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">一般</td>
</tr>
<tr bordercolor="#0099FF" align="center">
<td rowspan="4" height="16" width="58" bgcolor="#FFFFFF">产业化</td>
<td width="70" height="16" bgcolor="#FFFFFF">重大</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">重点</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">一般</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">专利</td>
</tr>
<tr bordercolor="#0099FF" align="center">
<td rowspan="8" height="16" width="58" bgcolor="#FFFFFF">创新条件与<br>
环境建设</td>
<td width="70" height="16" bgcolor="#FFFFFF">中介服务</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">国际合作</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">工程中心</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">重点实验室</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">企业孵化器</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">软科学</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">科学普及</td>
</tr>
<tr bordercolor="#0099FF" bgcolor="#FFFFFF" align="center">
<td width="70" height="16">其他</td>
</tr>
<tr bordercolor="#0099FF" align="center">
<td width="58" height="16" bgcolor="#FFFFFF"> </td>
<td width="70" height="16" bgcolor="#FFFFFF">总计</td>
</tr>
</table>
</td>
<td height="324" bgcolor="#6699CC">
<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 response.write stat(i,j) end if%>
<%end if%>
</td>
<%next%>
</tr>
<%next%>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -