<%
Action=request("action")
if Action="" then 
%>
<link href="web_jspok.css" rel="stylesheet" type="text/css">

<form action="main.asp?adminjob=addvote&action=save" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#A3BFE8">
  <tr>
    <td height="20" colspan="2" align="center" bgcolor="#E9F1F8">发布投票</td>
  </tr>
  <tr>
    <td height="20" colspan="2" align="center" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  
  <tr>
    <td width="21%" height="20" align="center" bgcolor="#E9F1F8">投票名称</td>
    <td width="79%" align="left" bgcolor="#E9F1F8"><input name="title" type="text" id="title"  style="width:400px" size="45"/></td>
  </tr>
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">投票时间</td>
    <td align="left" bgcolor="#E9F1F8"><input name="time" type="text" id="time"  style="width:400px" size="45" value="<%=date()%>"/></td>
  </tr>
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">投票项目</td>
    <td align="left" bgcolor="#E9F1F8"><input name="xm_1" type="text" id="xm_1"  style="width:400px" size="45"/>
    一</td>
  </tr>
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">&nbsp;</td>
    <td align="left" bgcolor="#E9F1F8"><input name="xm_2" type="text" id="xm_2"  style="width:400px" size="45"/>
    二</td>
  </tr>
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">&nbsp;</td>
    <td align="left" bgcolor="#E9F1F8"><input name="xm_3" type="text" id="xm_3"  style="width:400px" size="45"/>
    三</td>
  </tr>
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">&nbsp;</td>
    <td align="left" bgcolor="#E9F1F8"><input name="xm_4" type="text" id="xm_4"  style="width:400px" size="45"/>
    四</td>
  </tr>
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">&nbsp;</td>
    <td align="left" bgcolor="#E9F1F8"><label></label></td>
  </tr>
  
  <tr>
    <td height="20" colspan="2" align="center" bgcolor="#E9F1F8">&nbsp;</td>
  </tr>
  <tr>
    <td height="20" colspan="2" align="center" bgcolor="#E9F1F8"><label>
      <input type="submit" name="Submit" value="发布投票">
    </label></td>
  </tr>
</table>
</form>
<%else%>
<%
Title=server.HTMLEncode(trim(request("title")))
Ttime=server.HTMLEncode(trim(request("time")))
xm1=server.HTMLEncode(trim(request("xm_1")))
xm2=server.HTMLEncode(trim(request("xm_2")))
xm3=server.HTMLEncode(trim(request("xm_3")))
xm4=server.HTMLEncode(trim(request("xm_4")))
if Title="" or xm1="" then 
response.write "<script>alert('信息提示\n请填写相关信息');history.go(-1);</Script>"
else
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from vote"
rs.open sql,conn,1,3 
for i=1 to 4
rs.addnew
rs("v_title")=Title
rs("v_name")=request.Form("xm_"& i &"")
rs.update
next
rs.close
set rs=nothing
response.write "<script language='javascript'>alert('信息提示\n添加成功');location='main.asp?adminjob=addvote';</script>"
end if
%>
<%end if%>
