<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<%dim id
id=request.QueryString("id")
if not isnumeric(id) then 
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(id) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else
set rs_shjia=server.CreateObject("adodb.recordset")
strshjia="select * from shjia where shjiaid="&id
rs_shjia.open strshjia,conn,1,1
if rs_shjia.bof and rs_shjia.eof then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else
shjname=rs_shjia("name")
shjianame=rs_shjia("username")
shjiaid=rs_shjia("shjiaid")
lx=rs_shjia("lx")
end if
end if
end if
%>
<%

dim Checked,sql
Checked=request.form("Checked")
if Checked="" then
response.write "<script>alert('对不起，请您选择投票项！');history.go(-1);</Script>"	
	Response.End 	
end if
set rs=server.createobject("adodb.recordset")
sql="Select isChecked from toupiao where IsChecked=1 and shjiaid='"&shjiaid&"'"
rs.open sql,conn,1,3
if not rs.eof then
	do while not rs.eof
		rs("IsChecked")=0
	rs.movenext
	loop
end if
rs.close

sql="Select IsChecked from toupiao where ID="&Checked
rs.open sql,conn,1,3
if not rs.EOF then
	do while not rs.EOF 
		rs("isChecked")=1
	rs.MoveNext 
	loop
end if
rs.close
set rs=nothing

conn.close
set conn=nothing
Response.write("<script>alert('选定成功！');history.back();</script>")
%>