<%'guidedisplay=1%>

<!--#include file="admin_start.asp" -->

<%
id=request("id")

if not MySys.check.isInteger(id) then
   MySys.Error.info = "请提交合法的投票调查分类id！"
   MySys.Error.location = "back"
   MySys.Error.err()
End If

id=int(id)

rs.open"select * from jins_vote_list where vote_id="&id&" ",conn,1,1
if rs.eof and id>0 then
   MySys.Error.info = "您请求的投票调查不存在！"
   MySys.Error.location = "back"
   MySys.Error.err()
End If

%>
<body topmargin="30" marginwidth="10" marginheight="10">
<form name=edit_html target=admin_edit_html method=post><input type=hidden name=c value=''><input type=hidden name=formname value=''><input type=hidden name=inputname value=''></form>
<form name=vote action="admin_info_vote_edit_handle.asp?action=edit&id=<%=id%>" method=post>
<table cellpadding="3" cellspacing="4" width="90%" height="30" align=center style='border:1px solid #ebebeb' >
	<tr>
		<td width="2%" align=right><img alt='点击弹开编辑框' onclick="opencat(basic_open)" style='CURSOR: hand' src="Images/index_search.gif" width="8" height="16"></td>
		<td  width="98%" align=left>
		<font color="#ebebeb"> | </font>
		<img alt='点击弹开提示信息框' onclick="opencat(vote_ads_open)" style='CURSOR: hand' src="Images/icon_info.gif" width="13" height="13" hspace="0" align="absmiddle">			
		<font color="#ebebeb"> | </font>
		编辑投票调查
	    </td>
	</tr>		
	<tr id="vote_ads_open" style="display:  ">
		<td colspan="10" align=left>
		<table cellpadding="4" cellspacing="2" width="99%" height="30" align=center style='border:1px dashed #B7B7B7' >
			<tr>
				<td colspan="8" width='100%' style="line-height:150% ">
				·点击 <img src="Images/checkall.gif" width="19" height="19" align="absmiddle"> 增加选项<br>
				·点击 <img src="Images/cancleall.gif" width="19" height="19" align="absmiddle"> 减少选项<br>
			</td>
			</tr>
		</table>
		</td>
	</tr>
	
	<tr id="basic_open" >
		<td colspan="10" align=left style='padding-bottom:5px'>
		<table cellpadding="4" cellspacing="2" bgcolor='#f7f7f7' width="99%" height="30" align=center style='border:1px dashed #808080;padding:20px' >
			<tr>
				<td  width="25%" align=right>加入时间:</td>
				<td  colspan="2"  width="75%" align=left>
				<input value='<%=rs("vote_addtime")%>' name='vote_addtime' size=20>
				</td>
			</tr>
			<tr>
				<td  width="25%" align=right>投票调查开关:</td>
				<td  colspan="2"  width="75%" align=left>
				<select name=vote_open >
				<option value=1 <%if rs("vote_open")=1 then response.write "selected"%> >打开</option>
				<option value=0 <%if rs("vote_open")=0 then response.write "selected"%> >关闭</option>
				</select>
				</td>
			</tr>

		</table><br>

		<table cellpadding="4" cellspacing="2" bgcolor='#f7f7f7' width="99%" height="30" align=center style='border:1px dashed #808080;padding:20px' >
			<tr>
				<td  width="25%" align=right>投票调查名称:</td>
				<td colspan="2" width="75%" align=left>
				<input value='<%=rs("vote_title")%>' name='vote_title' size=60>
				</td>
			</tr>
			<%
			n_options=request("n_options")
			
			v=rs("vote_option")
			vv=rs("vote_select")
			if v<>"" then 
				v=split(v,",")
				vv=split(vv,",")
				n_v=ubound(v)+1
			else
			    n_v=0
			end if
			
			if n_options="" then n_options=n_v
			
			if n_options<=0 then n_options=1
			for ii=1 to n_options
			%>
			<tr>
				<td  width="25%" align=right>选项<%=ii%>:</td>
				<td colspan="2" width="75%" align=left>
				<input value='<%if ii<=n_v then response.write v(ii-1) %>' name='vote_option_<%=ii%>' size=47> 已选 <input value='<%if ii<=n_v then response.write vv(ii-1) else response.write 0%>' name='vote_select_<%=ii%>' size=5>
				</td>
			</tr>
			<%
			next
			%>
	<tr>
		<td height='1' colspan="9" background='images/dot03.gif'></td>
	</tr>
			<tr>
				<td  width="25%" align=right></td>
				<td colspan="2" width="75%" align=left>
				  <img src="Images/checkall.gif" width="19" height="19" align="absmiddle"> <a href='admin_info_vote_edit.asp?id=<%=request("id")%>&n_options=<%=n_options+1%>'>添加选项</a>
				  <img src="Images/cancleall.gif" width="19" height="19"align="absmiddle"> <a href='admin_info_vote_edit.asp?id=<%=request("id")%>&n_options=<%=n_options-1%>'>减少选项</a></td>
			</tr>

		</table><br>
		</td>
	</tr>

	<tr>
		<td height='1' colspan="9" background='images/dot03.gif'></td>
	</tr>
	
	<tr>
	  <td height='30' colspan="8" width='100%' align=center >
	  <input type=hidden value="<%=n_options%>" name=n_options>
	  <input type=submit value="提交投票调查！" >
	   <input type=reset value="重置" > 
	   <input onclick='history.back(-1)' type=button value="返回" >	  </td>

	</tr>
</table>		
<SCRIPT language=javascript>
	function opencat(cat)
	{
 	 	if(cat.style.display=="none"){
     	cat.style.display="";
  		} else {
     	cat.style.display="none"; 
  		}
	}</SCRIPT>
</form>
<%
rs.close
%>
<!--#include file="admin_end.asp" -->