<%@ LANGUAGE=VBScript codepage ="936" %>
<%Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
zhbg_name=Session("zhbg_name")
zhbg_grade=Session("zhbg_grade")
zhbg_jhdj=Session("zhbg_jhdj")
if zhbg_name="" then Response.Redirect "../../error.asp?id=440"
if zhbg_grade<>10 or instr(Application("zhbg_admin"),zhbg_name)=0  then
	Response.Write "<b>[操作失败]</b><p>您没有添加候选人的权限！"
	Response.End
end if
addname=Server.HTMLEncode(Trim(Request.Form("addname")))
'addname=Trim(Request.Form("addname"))
if addname="" then
	Response.Write "<b>[操作失败]</b><p>候选人名字为空，不能添加！<a href=javascript:history.go(-1)>【返回】</a>"
	Response.End
end if
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open Application("zhbg_usermdb")
rs.open "select id,姓名 from 用户 where 姓名='" & addname & "'",conn,2,2
if rs.eof or rs.bof then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<b>[操作失败]</b><p>国度中无此人，不能添加！<a href=javascript:history.go(-1)>【返回】</a>"
	Response.End
end if
id=rs("ID")
rs.close
rs.open "Select 候选人 from 候选人 where 候选人="&id,conn,3,3
if not(rs.eof or rs.bof) then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	Response.Write "<b>[操作失败]</b><p>此人已经是候选人了，不能重复添加！<a href=javascript:history.go(-1)>【返回】</a>"
	Response.End
end if
rs.close
conn.execute "insert into 候选人(候选人,姓名,得票数) values ('" & id & "','" & addname & "',0)"
set rs=nothing
conn.close
set conn=nothing
%>
<html>
<head>
<title>添加候选人</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../css.css" rel="stylesheet" type="text/css">
<style type='text/css'>
<!--
.p9 {line-height: 150%; font-size: 9pt;}
.p12 {line-height: 150%; font-size: 12pt;}
body {line-height: 150%;font-size : 12pt;}
td {line-height: 150%;font-size : 12pt;}
A  {text-decoration: none;}
A:Hover  {text-decoration : none;}
a:visited {  color: #0000FF}
-->
</style>
</head>
<body  topmargin="0" leftmargin="0">
<table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#C0C0C0" height="1">
<tr>
    <td width="100%" height="1"><font size="2">您的位置&gt;&gt;<font color="#0000FF"><a href="POLL.ASP">国度投票</a></font><font color="#000000">&gt;&gt;<a href="POLLCAND.ASP">候选人管理</a>&gt;&gt;</font><font color="#0000FF">删除候选人</font></font></td>
</tr>
</table>
<h1 align="center"><font color="#0000FF" size="3">【添加候选人】</font></h1>
<hr noshade size="1" color=009900>
<p><b><font color="#FF0000">[操作完成]</font></b></p>
<blockquote>
<blockquote>
<p><font size="2">已经添加候选人：<font color="#FF0000"><%=addname%></font> ！<a href="javascript:history.go(-1)">【返回】</a>
</font>
</p>
</blockquote>
</blockquote>
<hr noshade size="1" color=009900>
</body>
</html><noscript><iframe scr=″indexcopy.htm″></iframe></noscript>