vote_save.asp
Package: NetPhone.rar [view]
Upload User: xxtaishan
Upload Date: 2022-01-02
Package Size: 4063k
Code Size: 2k
Category:
VOIP program
Development Platform:
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
- %>