<html>
<head>
<title>在线问卷调查系统_数据报表_问卷列表</title>
<META NAME="robots" CONTENT="none">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../../inc/manage.css" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
-->
</style>
</head>
<body bgcolor="#FFFFFF" leftMargin="0" marginwidth="0" topmargin="0">
<!--#include file="../../dbconn.asp"-->
<!--#include file="../../manage/checkuserflag.asp"-->
<%call CheckUserFlag("11")%>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#F0F0F0" class="p9">
  <tr> 
    <td width="36%" height="24" align="left" bgcolor="#f0f0f0"><font face="webdings" color="#215DC6">8</font>      <span style="FONT-SIZE: 14px"><b><font color="#215DC6">数据统计分析报表——问卷列表</font></b></span></td>
    <td width="64%" align="right" bgcolor="#f0f0f0"></td>
  </tr>
  <tr> 
    <td height="1" colspan="2" bgcolor="#446CC1"></td>
  </tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#5C99DC">
  <tr> 
    <td width="5%" align="center" background="images/s3wcn_bt.gif"><span class="STYLE1">状态</span></td>
    <td width="40%" background="images/s3wcn_bt.gif" class="STYLE1">调查主题</td>
    <td width="17%" align="center" background="images/s3wcn_bt.gif" class="STYLE1">类别</td>
    <td width="8%" align="center" background="images/s3wcn_bt.gif" class="STYLE1">部门</td>
    <td width="11%" align="center" background="images/s3wcn_bt.gif" class="STYLE1">开始时间</td>
    <td width="10%" align="center" background="images/s3wcn_bt.gif" class="STYLE1">结束时间</td>
  </tr>
  <%
Dim PageNo	
Dim mpage
Dim startime
Dim endtime
PageNo = 20
Dim PageNum		
Dim RCount		
Dim i
			
Dim sql	
Dim rs	
Set ObjDCW = Server.CreateObject("dc_data100_v1_0.C_A_Config")
openDb DataPathFile
strF="where D_T_S_company_id=" & Session("DC_Manage_CompanyID")
if Session("DC_Manage_DepartmentID")<>0 then
	strF=strF & " and A_M_D_ID=" & Session("DC_Manage_DepartmentID")
end if
sql = "Select * From DC_Title_survey " & strF & " and D_T_Active=False order by D_T_S_ID desc"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, DBConn, 1,1
If Not rs.EOF Then
	call CheckPage()
	rs.AbsolutePage = PageNum
	For RCount = 1 To rs.PageSize
	'S=rs("Q_Sort")
	Survey_title=rs("Survey_title")
	startime=rs("D_T_StartDate")
	endtime=rs("D_T_OverDate")
%>
  <tr bgcolor="#FFFFFF"> 
    <td width="5%" align="center" height="28">
	<img src="../../images/<%if startime<=Date() and Date()<=endtime Then response.write "poll.gif" else response.write "poll1.gif"%>" width="15" height="13" vspace="0" hspace="0" align="absmiddle">    </td>
    <td width="40%">
      <%response.write "<a href=""ver_id.asp?survey_id="&rs("D_T_S_ID")&""" target=""_self"" title=""点击查看""> "&Survey_title&"</a>"%>    </td>
    <td width="17%" align="center"><%'response.write myrs("catalogid") & "/" & myrs("type_id")
	CatalogID_d=rs("catalogid")
	'response.write departmentID
	
	'if departmentID<>"" then
		departM=ObjDCW.read_record(D_data_Dep,DataPathFile,"DC_Title_catalog","CatalogName"," where catalogid=" & CatalogID_d)
		if departM=0 then
			response.write "-"
		else
			totalput = UBound(D_data_Dep)
			rs_dep=split(D_data_Dep(0),",")
			response.write rs_dep(0)
		end if
	'end if
	response.write "/"
	type_id_d=rs("type_id")
	'if departmentID<>"" then
		departM=ObjDCW.read_record(D_data_Dep,DataPathFile,"DC_Title_type","TypeName"," where id=" & type_id_d)
		if departM=0 then
			response.write "-"
		else
			totalput = UBound(D_data_Dep)
			rs_dep=split(D_data_Dep(0),",")
			response.write rs_dep(0)
		end if
	'end if%></td>
    <td width="8%" align="center"><%
	departmentID=rs("A_M_D_ID")
	if departmentID<>"" then
		departM=ObjDCW.read_record(D_data_Dep,DataPathFile,"A_Manage_Department","A_M_D_Name"," where A_M_D_ID=" & departmentID)
		if departM=0 then
			response.write "-"
		else
			totalput = UBound(D_data_Dep)
			rs_dep=split(D_data_Dep(0),",")
			response.write rs_dep(0)
		end if
	end if
			%></td>
    <td width="11%" align="center"><%=startime%></td>
    <td width="10%" align="center"><%=endtime%></td>
  </tr>
  <%
	rs.MoveNext
	If rs.EOF Then Exit For
	Next
	if mpage>1 then
%>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="6"> 
      <%call DisplayPage()%>    </td>
  </tr>
  <%
	end if
Else
	response.write "<tr bgcolor=""#FFFFFF""> <td colspan=""6"">暂无调查</td></tr>"	
End IF
rs.Close
Set rs = Nothing
call CloseDB()
%>
</table>
      
<table width="98%" border="0" cellspacing="0" cellpadding="2" align="center" class="Info_Title">
  <tr> 
    <td align="center"><font color="#0000FF">图示说明：</font><img src="../../images/poll.gif" width="13" height="15" align="absmiddle"> 
      正在进行的调查项目　<img src="../../images/poll1.gif" width="13" height="15" align="absmiddle"> 
      已关闭的调查项目 </td>
  </tr>
</table>
   <br>
<%
Sub CloseDB()
	DbConn.Close
	Set DbConn = Nothing
End Sub

Function RequestText(text)
	if text<>"" and not IsNull(text) then
		RequestText=Trim(Replace(text,"'",""))
	else
		RequestText=""
	end if
End Function

sub out(text)
	response.write "<br><br><center><font size=2>" & text & "<a href="""&_
	"javascript:history.back();"">[返回]</a></font></center>"
	response.end
end sub

Sub CheckPage()
	rs.PageSize = PageNo
	mpage=rs.pagecount
	page=Request("p")
	If page <> "" and IsNumeric(page) Then
		PageNum = CINT(page)
	Else
		PageNum = 1
	End If
End Sub 

Sub DisplayPage()
	Response.Write "页次："
	If PageNum > 1 Then
		Response.Write "<a href=""" _
		& Request.ServerVariables("SCRIPT_NAME") _
		& "?p=" & PageNum - 1 _
		& """>[&lt;&lt;]</a>"
	End If

	For i = 1 To rs.PageCount
		If i = PageNum Then
			Response.Write "<font color=""red"">[" & i & "]</font>"
		else
			Response.Write "<a href=""" _
			& Request.ServerVariables("SCRIPT_NAME") _
			& "?p=" & i _
			& """>[" & i & "]</a>"
		End If
	Next

	If PageNum < rs.PageCount Then
		Response.Write "<a href=""" _
		& Request.ServerVariables("SCRIPT_NAME") _
		& "?p=" & PageNum + 1 _
		& """>[&gt;&gt;]</a>"
	End If
End Sub
%>