⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netvoteinfo.asp

📁 又一套oa 系统,供大家使用学习,更多的源代码正在上传中,好的程序应该大家共同使用
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#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 "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 "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='#115F8F'><tr><td colspan='2' bgcolor=ffffff><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=cccccc><tr bgcolor='#FFFFFF'><td height='24'>"
select case action
case "addvote"
response.Write "<table width='100%' border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#A1BBE0'><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='#FFFFFF'><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='#FFFFFF'><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='#FFFFFF'><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='#A1BBE0'><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='#FFFFFF'><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='#FFFFFF'><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='#FFFFFF'><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='#FFFFFF'><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='#FFFFFF'><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='#FFFFFF'><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='#A1BBE0'><form action='?action=editvotesave' method='post' name='form1'><tr ><td colspan='2' class='td4'>修改调查项目</td></tr><tr bgcolor='#FFFFFF'><td align='right' width='22%'>调查主题:</td><td><input name='title' type='text' value='"&Qrs("WS_QuestionTitle")&"' size='30' maxlength='100'></td></tr><tr bgcolor='#FFFFFF'><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='#FFFFFF'><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='#FFFFFF'><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='#FFFFFF'><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='#FFFFFF'><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='#A1BBE0'><form action='?action=AddOptionsave' method='post' name='form1'><tr ><td colspan='2'><font color='#FFFFFF'><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='#FFFFFF'><td width='22%' align='center'><div align='right'>开始时间:</div></td><td width='78%'>"&rs("WS_QuestionStartDate")&"</td></tr><tr  bgcolor='#FFFFFF'><td align='center' width='22%'><div align='right'>结束时间:</div></td><td align='left' width='78%'>"&rs("WS_QuestionEndDate")&"</td></tr>"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -