vote_save.asp
资源名称:NetPhone.rar [点击查看]
上传用户:xxtaishan
上传日期:2022-01-02
资源大小:4063k
文件大小:2k
源码类别:
IP电话/视频会议
开发平台:
ASP/ASPX
- <!--#include file="vote_conn.asp"-->
- <%
- if request("id")<>"del" then
- err=0
- title=request("title")
- if title="" then
- err=1
- error=error+"标题不能为空n"
- end if
- a=0
- for i=1 to request("choose").count
- if request("choose")(i)="" then
- exit for
- end if
- a=a+1
- next
- if a=0 then
- err=1
- error=error+"选择内容不能为空n"
- end if
- if err=1 then
- response.write "<script>alert('"&error&"');</script>"
- response.write "<script>history.back(1);</script>"
- response.end
- end if
- end if
- if request("id")="xg" then '调查修改
- conn.execute("update class set title='"&title&"',style='"&request("style")&"' where id="&request("classid"))
- conn.execute("delete from vote where class="&request("classid"))
- for i=1 to request("choose").count
- if request("choose")(i)<>"" then
- conn.execute("insert into vote (vote,color,class) values ('"&request("choose")(i)&"','"&request("color")(i)&"',"&request("classid")&")")
- else
- exit for
- end if
- next
- response.write "<script>alert('修改调查成功');</script>"
- response.write "<script>location.href='vote_list.asp';</script>"
- elseif request("id")="del" then '调查删除
- conn.execute("delete from vote where class="&request("classid"))
- conn.execute("delete from class where id="&request("classid"))
- response.write "<script>alert('删除调查成功');</script>"
- response.write "<script>location.href='vote_list.asp';</script>"
- else
- conn.execute("insert into class (title,style) values ('"&title&"','"&request("style")&"')")
- set rs=server.createobject("adodb.recordset")
- sql="select top 1 * from class where title='"&title&"' order by id desc"
- rs.open sql,conn,3,1
- classid=rs("id")
- rs.close
- set rs=nothing
- for i=1 to request("choose").count
- if request("choose")(i)<>"" then
- conn.execute("insert into vote (vote,color,class) values ('"&request("choose")(i)&"','"&request("color")(i)&"',"&classid&")")
- else
- exit for
- end if
- next
- response.write "<script>alert('添加调查成功');</script>"
- response.write "<script>location.href='vote_list.asp';</script>"
- end if
- conn.close
- set conn=nothing
- %>