<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"--><!--#INCLUDE FILE="../HXINCLUDE/SelectDate.asp"-->
<%if WS_S.MemberPriv("WS_SystemSetnetvoteinfo")<>1 then HX_GoBack "对不起,您的权限不够!",""
action=request("action"):ColumnName="":Tablename="HX_VoteQuestion":Tablename1="HX_VoteAnswer"
select case action
'''''''''''''''''''''''''''''''''''''''''''''''''''''''管理开始
  case "AddPoll"
    title = Request.Form("title")
	if title="" then HX_GoBack "调查主题不能为空",""
	if not ISDATE(Request.Form("startt")) or not isdate(Request.Form("endt")) then	HX_GoBack "日期格式不对。",""
	startt = CDATE(Request.Form("startt")):endt = CDATE(Request.Form("endt")):active = Request.Form("active"):n=CINT(request.form("N"))
	for i=1 to n
		if Request.Form("o"&i)="" then Call HX_GoBack("所有调查选项不能为空!","")
	next
	if active=1 then Conn.Execute("UPDATE HX_VoteQuestion SET WS_QuestionActive=0")
	Conn.Execute("Insert into HX_VoteQuestion (WS_QuestionTitle,WS_QuestionStartDate,WS_QuestionEndDate,WS_QuestionActive) values('"& title & "','" & startt & "','" & endt & "','" & active & "')")
	Set rs = Conn.Execute( "SELECT @@IDENTITY" )
	id = rs(0)
	Call WS_S.HX_RSClose(rs)
	for i=1 to n
	Conn.Execute("Insert into HX_VoteAnswer (WS_VQID,WS_AnswerTitle) values('" & id & "','" & Request.Form("o"&i) & "')")
	next
	Response.Redirect"netvoteinfo.asp?action=manage"
	response.end
case "WSQDEL"
  	pid=request("pid")
	if pid<>"" and isnumeric(pid) then
	   if conn.execute("select * from HX_VoteQuestion where WS_QuestionActive=true and WS_VQID="&pid).eof then
	     conn.execute("delete from HX_VoteQuestion where WS_VQID="&pid)
	     conn.execute("delete from HX_VoteAnswer where WS_VQID="&pid)
	   else
	    HX_GoBack "对不起！正在进行的调查项目不能删除！",""
	   end if	   
	end if
	   Response.Redirect"netvoteinfo.asp?action=manage":response.end
case "WSADEL"
  	pid=request("pid"):aid=request("aid")
	if pid<>"" and isnumeric(pid) and aid<>"" and isnumeric(aid) then  conn.execute("delete from HX_VoteAnswer where WS_VQID="&pid&" and WS_Void="&aid)	   
    Response.Redirect"netvoteinfo.asp?action=editvote&pid="&pid:response.end
case "editoptionsave"
  aid =Request("aid"):pid =Request("pid"): content=request("content")
  if pid="" or isnull(pid) or not isnumeric(pid) or aid="" or isnull(aid) or not isnumeric(aid) then  HX_GoBack "参数错误！",""
  if content="" or isnull(content) then  HX_GoBack "调查选项不能为空！",""
  set rs=WS_S.HX_SetRSD("WS_AnswerTitle","HX_VoteAnswer"," WHERE WS_VQID = " & pid & " AND WS_VOID = " & aid)
  if rs.recordcount<=0 then HX_GoBack "参数错误！","" else  rs("WS_AnswerTitle")=content:rs.update	
  Response.Redirect"netvoteinfo.asp?action=editvote&pid="&pid:response.end
case "AddOptionsave"	
    content = Request.Form("content"):G = Request.Form("G"):pid =Request.Form("pid")
	if content="" then HX_GoBack "调查选项不能为空！","" 
	Conn.Execute("Insert into HX_VoteAnswer (WS_VQID,WS_AnswerTitle) values('" & pid & "','" & content & "')")
	if G="T" then 
	 Response.Redirect "netvoteinfo.asp?action=addoption&pid="&pid
	 response.end 
	else 
	 Response.Redirect "netvoteinfo.asp?action=editvote&pid="&pid
	 response.end
	end if
case "editvotesave"	
    pid =Request.Form("pid"):title =Request.Form("title")
	if title="" then Call HX_GoBack("调查主题不能为空!","")
	if not ISDATE(Request.Form("startt")) or not isdate(Request.Form("endt")) then	HX_GoBack "日期格式不对!","" 
	startt = CDATE(Request.Form("startt")):endt = CDATE(Request.Form("endt")):active =Request.Form("active")
	If active = 1 Then Conn.Execute("UPDATE HX_VoteQuestion SET WS_QuestionActive=0")
	Conn.Execute("UPDATE HX_VoteQuestion SET WS_QuestionTitle = '" & title & "', WS_QuestionStartDate = '" & startt & "',WS_QuestionEndDate = '" & endt & "', WS_QuestionActive = '" & active & "' WHERE WS_VQID = " & pid )
    Response.Redirect"netvoteinfo.asp?action=manage":response.end
  
  '''''''''''''''''''''''管理结束
case "sendvote"
    WS_QuestionID=request.form("WS_QuestionID"):WS_Void = Request.Form("poll"):N_Quest = Request.Form("N_Question")
	if session("poll" & WS_QuestionID)<>"" and isnumeric(session("poll" & WS_QuestionID)) then	PollNum = session("poll" & WS_QuestionID)
	If WS_QuestionID = "" or WS_Void = "" Then Call HX_GoBack( "请选择一个选项!","")
	if PollNum=WS_QuestionID then 
	 HX_GoBack "对不起，此项目你已经投过票了!",""  
	else
		Conn.Execute("Update HX_VoteAnswer SET WS_VoteCount = WS_VoteCount+1 Where WS_Void= " & WS_Void)
		Conn.Execute("Update HX_VoteQuestion SET WS_QuestionVote = WS_QuestionVote+1 Where WS_VQID = " & WS_QuestionID)		
		session("poll" & WS_QuestionID) = WS_QuestionID		
		response.redirect ("netvoteinfo.asp?WS_QuestionID=" & WS_QuestionID)
		response.end
	end if	
end select  
Orderby=" where WS_QuestionStartDate<= #" & Date() & "# and WS_QuestionEndDate>= #" & Date() & "# " 
response.Write "<head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title></title><link rel=stylesheet type=text/css href='../HXinclude/HX_Style.css'></head><body topmargin='20' leftmargin='0' bottommargin='25'><table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td colspan='2' bgcolor=FFFBE8><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>网络调查</font></td></tr></table><table width='100%'  border='0' cellpadding='0' cellspacing='1' bgcolor=613c25><tr bgcolor='#FFFBE8'><td height='24'>"
select case action
case "addvote"
response.Write "<table width='100%' border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#BF9B73'><form action='?action=addvotenext' method='post'><tr><td  colspan='2' class=td4><img src='../HXimages/netvote/poll.gif' width='13' height='15' align='absmiddle' vspace='2' hspace='2'>添加新调查项目(第一步)</td></tr><tr bgcolor='#FFFBE8'><td class='Info_Title' width='30%' align='center'><div align='right'>调查主题：</div></td><td class='Info_Title' width='70%'><input name='T' type='text' size='30' maxlength='100'></td></tr><tr bgcolor='#FFFBE8'><td width='30%' align='center'><div align='right'>调查选项数：</div></td><td width='70%'><select name='N'>"
for i=1 to 15
response.Write "<option value='"&i&"'>"&i&"</option>"
next
response.Write "</select></td></tr><tr  bgcolor='#FFFBE8'><td colspan='2' align='right'><input type='submit' name='Submit2' value='下一步'> <input type='button' name='Submit2' value=' 返 回 ' onclick='javascript:history.go(-1);'></td></tr></form></table>"
case "addvotenext"
   T=request.form("T")
   N=request.form("N")
   response.Write "<table width='100%' border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#BF9B73'><form action='?action=AddPoll' method='post' name='form1'><tr><td  colspan='2' class='td4'><img src='../HXimages/netvote/poll.gif' width='13' height='15' align='absmiddle' vspace='2' hspace='2'>添加新调查项目(第二步)</td></tr><tr bgcolor='#FFFBE8'><td class='Info_Title' width='30%' align='center'><div align='right'>调查主题：</div></td><td class='Info_Title' width='70%'><input name='title' type='text' id='pollquestion' size='30' maxlength='100' value='"&T&"'></td></tr><tr bgcolor='#FFFBE8'><td width='30%' align='center'><div align='right'>开始时间：</div></td><td width='70%'><input name='startt' type='text' id='startdate' value='"&Date()&"' size='12' maxlength='10' readonly> <input onclick=""popUpcalendar(this, form1.startt, 'yyyy-mm-dd')"" type='button' value='选择' title='选择开始时间'></td></tr><tr bgcolor='#FFFBE8'><td width='30%' align='center'><div align='right'>结束时间：</div></td><td width='70%'><input name='endt' type='text' id='enddate' value='"&Date+7&"' size='12' maxlength='10' readonly> <input onclick=""popUpcalendar(this, form1.endt, 'yyyy-mm-dd')"" type='button' value='选择' title='选择开始时间'></td></tr>"
   for i=1 to N
    response.Write "<tr bgcolor='#FFFBE8'><td align='center'><div align='right'>选项"&i&"：</div></td><td><input name='o"&i&"' type='text' size='20' maxlength='50'></td></tr>"
   next
   response.Write "<tr bgcolor='#FFFBE8'><td align='right'><div align='right'>设为当前调查项目？</div></td><td><input type='radio' name='active' value='1' id='active' checked class='radio'><label for='active'>是</label> <input name='active' type='radio' value='0' id='active1' class='radio'><label for='active1'>否</label></td></tr><tr  bgcolor='#FFFBE8'><td colspan='2' align='right'><input type='hidden' name='N' value='"&N&"'> <input type='submit' name='Submit' value=' 添 加 '> <input type='button' name='Submit2' value=' 上一步 ' onclick='javascript:history.go(-1);'></td></tr></form></table>"
case "editvote"
  pid=request("pid")
  if pid="" or isnull(pid) or not isnumeric(pid) then HX_GoBack "参数错误！",""
  set Qrs=WS_S.HX_SetRSD("",Tablename," where WS_VQID="&pid)
  set Ars=WS_S.HX_SetRSD("",Tablename1," where WS_VQID="&pid)
  response.Write "<table width='100%' border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#BF9B73'><form action='?action=editvotesave' method='post' name='form1'><tr ><td colspan='2' class='td4'>修改调查项目</td></tr><tr bgcolor='#FFFBE8'><td align='right' width='22%'>调查主题：</td><td><input name='title' type='text' value='"&Qrs("WS_QuestionTitle")&"' size='30' maxlength='100'></td></tr><tr bgcolor='#FFFBE8'><td width='22%' align='right'>开始时间：</td><td><input name='startt' type='text' value='"&Qrs("WS_QuestionStartDate")&"' size='12' readonly> <input onclick=""popUpcalendar(this, form1.startt, 'yyyy-mm-dd')"" type='button' value='选择' title='选择开始时间'></td></tr><tr bgcolor='#FFFBE8'><td width='22%' align='right'>结束时间：</td><td><input name='endt' type='text' value='"&Qrs("WS_QuestionEndDate")&"' size='12' readonly> <input onclick=""popUpcalendar(this, form1.endt, 'yyyy-mm-dd')"" type='button' value='选择' title='选择开始时间'></td></tr>"
  i = 0  
  Do until Ars.EOF
    i = i + 1
	response.Write "<tr bgcolor='#FFFBE8'><td width='22%' align='right'>调查选项"&i&"：</td><td width='61%'>"&Ars("WS_AnswerTitle")&"<a href='?action=editoption&pid="&Qrs("WS_VQID")&"&aid="&Ars("WS_Void")&"&option="&i&"'><img src='../hximages/edit.gif' width='15' height='13' border='0' vspace='2' hspace='2' align='absmiddle'></a><a href='?action=WSADEL&aid="&Ars("WS_Void")&"&pid="&PID&"'><img src='../hximages/delete.gif' width='15' height='13' border='0' vspace='2' hspace='2' align='absmiddle'></a></td></tr>"
	Ars.MoveNext
	Loop
	response.Write "<tr bgcolor='#FFFBE8'><td align='right'>当前调查项目？</td><td><input type='radio' name='active' value='1' "
	if Qrs("WS_QuestionActive") then response.write "checked"
	 response.Write " class='radio' id='active'><label for='active'>是</label>  <input name='active' type='radio' value='0'  "
	 if not Qrs("WS_QuestionActive") then response.write "checked"
	 response.Write " class='radio' id='active1'><label for='active1'>否</label></td></tr><tr bgcolor='#FFFBE8'><td align='center' colspan='2'><input type='hidden' name='pid' value='"&pid&"'> <input type='submit' name='Submit' value='更 新'> <input type='button' name='add' value='添加新选项' onClick=""window.location.href='?action=addoption&pid="&pid&"';""></td></tr></form></table>"
case "addoption"
  pid =Request("pid")
  if pid="" or isnull(pid) or not isnumeric(pid) then  HX_GoBack "参数错误！",""
  set rs=WS_S.HX_SetRSD("p.WS_QuestionTitle, p.WS_QuestionStartDate, p.WS_QuestionEndDate, a.WS_AnswerTitle","HX_VoteQuestion p, HX_VoteAnswer a"," WHERE p.WS_VQID = a.WS_VQID AND p.WS_VQID = " & pid)
  if rs.recordcount<=0 then HX_GoBack "参数错误！",""
  response.Write "<table width='100%' border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#BF9B73'><form action='?action=AddOptionsave' method='post' name='form1'><tr ><td colspan='2'><font color='#FFFBE8'><img src='../hximages/netvote/poll.gif' width='13' height='15' align='absmiddle' vspace='2' hspace='2'><font color='#FF0000'>调查主题：</font>"&rs("WS_QuestionTitle")&"</font></td></tr><tr bgcolor='#FFFBE8'><td width='22%' align='center'><div align='right'>开始时间：</div></td><td width='78%'>"&rs("WS_QuestionStartDate")&"</td></tr><tr  bgcolor='#FFFBE8'><td align='center' width='22%'><div align='right'>结束时间：</div></td><td align='left' width='78%'>"&rs("WS_QuestionEndDate")&"</td></tr>"
  choice = 0
  Do until rs.EOF
    choice = choice + 1
	response.Write "<tr bgcolor='#FFFBE8'><td align='center' width='22%'><div align='right'>调查选项"&choice&"：</div></td><td align='left' width='78%'>"&rs("WS_AnswerTitle")&"</td></tr>"
	rs.MoveNext
  Loop
response.Write "<tr bgcolor='#FFFBE8'><td align='center' width='22%'><div align='right'>调查选项"&choice + 1&"：</div></td><td width='78%'><input name='content' type='text' size='20' maxlength='50'></td></tr><tr bgcolor='#FFFBE8'><td align='center' width='22%'><div align='right'>设 置：</div></td><td width='78%'><input type='radio' name='G' value='T' checked class='radio' id='T'><label for='T'>添加下一个</label> <input type='radio' name='G' value='F' class='radio' id='F'><label for='F'>提交后返回</label></td></tr><tr bgcolor='#FFFBE8'><td colspan='2' align='center'><input type='hidden' name='pid' value='"&pid&"'> <input name='submit' type='submit' value='提 交'></td></tr></form></table>"
case "editoption"
 aid =Request("aid"):pid =Request.QueryString("pid")
if pid="" or isnull(pid) or not isnumeric(pid) or aid="" or isnull(aid) or not isnumeric(aid) then  HX_GoBack "参数错误！","" 
set rs=WS_S.HX_SetRSD("p.WS_QuestionTitle, p.WS_QuestionStartDate, p.WS_QuestionEndDate, a.WS_AnswerTitle","HX_VoteQuestion p, HX_VoteAnswer a"," WHERE p.WS_VQID = a.WS_VQID AND p.WS_VQID = " & pid & " AND a.WS_VOID = " & aid)
if rs.recordcount<=0 then HX_GoBack "参数错误！",""
response.Write "<table width='100%' border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#BF9B73'><form action='?action=editoptionsave' method='post'><tr ><td colspan='2' ><img src='../HXIMAGES/netvote/poll.gif' width='13' height='15' align='absmiddle' vspace='2' hspace='2'><font color='#FF0000'>调查主题：</font>"&rs("WS_QuestionTitle")&"</td></tr><tr bgcolor='#FFFBE8'><td width='21%' align='center'>开始时间：</td><td width='79%'>"&rs("WS_QuestionStartDate")&"</td></tr><tr bgcolor='#FFFBE8'><td width='21%' align='center'>结束时间：</td><td width='79%'>"&rs("WS_QuestionEndDate")&"</td></tr><tr bgcolor='#FFFBE8'><td align='center'>调查选项"&Request.QueryString("option")&"： </td><td><input name='content' type='text' value='"&rs("WS_AnswerTitle")&"' size='20' maxlength='50'></td></tr><tr bgcolor='#FFFBE8'><td colspan='2' align='center'><input type='hidden' name='aid' value='"&aid&"'><input type='hidden' name='pid' value='"&pid&"'><input name='action' type='submit' id='action' value='更新选项'></td></tr></form></table>"
case "manage"
  response.Write "<table width='100%' border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#BF9B73'><tr><td width='6%' align='center' >状态</td><td width='48%' >调查主题</td><td width='8%' align='center' >投票数</td><td width='14%' align='center' >开始时间</td><td width='14%' align='center' >结束时间</td><td width='10%' align='center' >操作</td></tr>"
  set rs=WS_S.HX_SetRSD("",Tablename," Order By WS_QuestionStartDate,WS_QuestionEndDate DESC")
  If rs.recordcount>0 Then
	do until rs.eof
	startime=rs("WS_QuestionStartDate")
	endtime=rs("WS_QuestionEndDate")
	response.Write "<tr bgcolor='#FFFBE8'><td width='6%' align='center'><img src='../HXIMAGES/netvote/"
	if rs("WS_QuestionActive") then response.write "poll" else response.write "poll1"
	response.Write ".gif' width='13' height='15'></td><td width='48%'><a href='netvoteinfo.asp?WS_QuestionID="&rs("WS_VQID")&"'>"&rs("WS_QuestionTitle")&"</a></td><td width='8%' align='center'>"&rs("WS_QuestionVote")&"</td><td width='14%' align='center'>"&startime&"</td><td width='14%' align='center'>"&endtime&"</td><td width='10%' align='center'><a href='netvoteinfo.asp?action=editvote&pid="&rs("WS_VQID")&"'><img src='../HXIMAGES/edit.gif' width='15' height='13' border='0' hspace='2' alt='编辑'></a> <a href='netvoteinfo.asp?action=WSQDEL&pid="&rs("WS_VQID")&"'><img src='../HXIMAGES/delete.gif' width='15' height='13' border='0' hspace='2' alt='删除'></a></td></tr>"
	rs.MoveNext
   loop
  Else
	response.write "<tr bgcolor=""#FFFBE8""><td colspan=""6"">暂无调查</td></tr>"	
 End IF
response.Write "</table>"
case else 
    WS_QuestionID=request("WS_QuestionID")
	if WS_QuestionID<>"" and isnumeric(WS_QuestionID) then  Orderby=Orderby&" and WS_VQID="&WS_QuestionID
	set rs=WS_S.HX_SetRSD("WS_VQID,WS_QuestionTitle,WS_QuestionVote",Tablename,Orderby)
    if rs.recordcount>0 then
	N_Quest = rs("WS_QuestionTitle")
	WS_QuestionID = Cint(rs("WS_VQID"))
	if session("poll" & WS_QuestionID)<>"" and isnumeric(session("poll" & WS_QuestionID)) then
	PollNum = Cint(session("poll" & WS_QuestionID))
	end if
	sql = "SELECT * FROM HX_VoteAnswer WHERE WS_VQID=" & WS_QuestionID
	Set ars = Server.CreateObject("ADODB.Recordset")
	ars.Open sql, Conn, 1, 1
	C=ars.recordcount
	ReDim A_Count(c)
		i=65
		p_total=0
		For N=1 to C
			A_Count(N)=ars("WS_VoteCount")
			WS_Void = ars("WS_Void")
			WS_AnswerTitle = ars("WS_AnswerTitle")
			p_total=p_total+A_Count(N)
        	Content1=Content1 & "[" & chr(i) & "]<input type=""radio"" name=""poll"" checked class=""radio"" id="&chr(i)&" value=""" & WS_Void & """><label for="&chr(i)&">"
        	Content1=Content1 & WS_AnswerTitle & "</label><br>"
		ars.MoveNext
		i=i+1
		Next
	ars.Close
	Set ars = Nothing	
	i=65
	For N=1 to C
		if A_Count(N) = 0 then
			p_percent = 0
		Else
			p_percent = (A_Count(N)/p_total) * 100
		End If		
		Content20=Content20 & "<tr><td align=""right"" valign=""bottom"">[" & chr(i) & "]</td></tr>"
	 	Content21=Content21 & "<tr><td valign=""bottom""><img src=""../HXimages/netvote/p1.gif"" width=""" & p_percent & """ height=""8"">&nbsp; <font color=""#7C96B8"">" & FormatNumber(p_percent,2) & "%&nbsp;[" & A_Count(N) & "人]</font></td></tr>"

		Content30=Content30 & "<td width=""40"" valign=""bottom"" align=""center""><font color=""#7C96B8"">" & FormatNumber(p_percent,2) & "%</font><br><img src=""../HXimages/netvote/p2.gif"" width=""8"" height=""" & p_percent & """ vspace=""1""></td>"
		Content31=Content31 & "<td width=""40"" align=""center"">[" & chr(i) & "]</td>"
		i=i+1
	Next
response.Write "<table width='100%' border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#BF9B73'><form action='?action=sendvote' method='post'><input type='hidden' name='WS_QuestionID' value='"&WS_QuestionID&"'><input type='hidden' name='N_Question' value='"&N_Quest&"'><tr><td colspan='2' class=td4>当前调查项目</td></tr><tr bgcolor='#F2F2F2'><td width='49%'><font color='#000000'>主题："&N_Quest&"</font></td><td width='51%'><font color='#000000'>[调查结果显示]</font><input type='radio' name='list' onclick=""L1.style.display='inline';L2.style.display='none';"" checked class='radio' style='background-color:#FFFBE8; '>横向显示 　　<input type='radio' name='list' onclick=""L2.style.display='inline';L1.style.display='none';"" class='radio' style='background-color:#FFFBE8; '>纵向显示</td></tr><tr><td width='49%' bgcolor='#FFFBE8' valign='top'>"&Content1&"</td><td width='51%' bgcolor='#FFFBE8'><table width='100%' ><tr><td width='48%' class='small' id='L1' height='120'><table width='100%' border='0' cellspacing='0' cellpadding='1'><tr><td valign='bottom' width='22'><table width='100%' border='0' cellspacing='0' cellpadding='0' height='120'><tr><td align='right' valign='bottom' height='18'>&nbsp;</td></tr>"&Content20 &"<tr><td height='18'>&nbsp; </td></tr></table></td><td class='L1' valign='bottom'><table width='100%' border='0' cellspacing='0' cellpadding='0' height='120'><tr><td valign='bottom' height='18'>&nbsp;</td></tr>"&Content21&"<tr><td height='18'>&nbsp; </td></tr></table></td></tr></table></td><td width='52%' class='small' valign='bottom' id='L2' style='display:none;'><table border='0' cellspacing='0' cellpadding='0' class='L2'><tr><td valign='bottom' align='center' height='120' width='19'></td>"&Content30 &"<td valign='bottom' align='center' height='120' width='20'></td></tr></table><table border='0' cellspacing='0' cellpadding='0' align='left'><tr><td valign='bottom' align='center'  width='19' height='18'></td>"&Content31&"</tr></table></td></tr></table></td></tr><tr bgcolor='#F2F2F2'><td width='49%' bgcolor='#F2F2F2' valign='bottom' height='2'> <input type='submit' value=' 提 交 ' "
If PollNum = WS_QuestionID then response.write "disabled"
 response.write "> <input type='reset' name='Submit3' value=' 重 选 '></td><td width='51%' height='2'>总投票数: "&p_total&"</td></tr></form></table>"
 sql = "Select WS_VQID,WS_QuestionTitle,WS_QuestionStartDate,WS_QuestionVote,WS_QuestionActive FROM HX_VoteQuestion WHERE WS_QuestionStartDate <= #" & Date() & "# AND WS_QuestionEndDate >= #" & Date() & "# and WS_VQID <> " & WS_QuestionID
 Set rs = Server.CreateObject("ADODB.Recordset")
 rs.Open sql, Conn, 1, 1
 response.write "<br><table width='100%' border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#BF9B73'><tr><td height='21' colspan='4'><font color='#000000'>其他调查项目</font></td></tr>"
 if rs.recordcount<=0 then 
   response.write "<tr><td colspan='4' align='center' bgcolor='#FFFBE8'>没有其他调查项目了</td></tr>"
 else
  response.write "<tr bgcolor=FFFBE8><td width='5%'>&nbsp;</td><td width='51%' height='20' >调查主题</td><td width='15%' align='center'>参加人数</td><td width='29%'>开始日期</td></tr>"
   do until rs.eof
    response.write "<tr><td width='5%' bgcolor='#FFFBE8' align='center'><img src='../HXIMAGES/netvote/"
	if rs("WS_QuestionActive") then response.write "poll" else response.write "poll1"
	response.write ".gif' width='13' height='15'></td><td width='51%' bgcolor='#FFFBE8'><a href='netvoteinfo.asp?WS_QuestionID="&rs("WS_VQID")&"'>"&rs("WS_QuestionTitle")&"</a></td><td width='15%' bgcolor='#FFFBE8' align='center'>"&rs("WS_QuestionVote")&"</td><td width='29%' bgcolor='#FFFBE8'>["&rs("WS_QuestionStartDate")&"]</td></tr>"
  rs.MoveNext
  loop
end if
 response.write "</table>"
else
 response.write "对不起，暂无调查项目"   
end if
end select	 	 
response.write "</td></tr><tr bgcolor='#FFFBE8'><td height='24' align=right><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td width='76%'>图示说明： <img src='../HXIMAGES/netvote/poll.gif' width='13' height='15' align=absmiddle>正在进行的调查项目　 <img src='../HXIMAGES/netvote/poll1.gif' width='13' height='15' align=absmiddle>其他调查项目&nbsp;</td><td width='24%' align=right><a href='netvoteinfo.asp?action=manage'>调查管理</a>&nbsp;&nbsp; <a href='netvoteinfo.asp?action=addvote'>添加调查</a>&nbsp;</td></tr></table></td></tr></table></td></tr></table>"  
%>