<%@ Page language="c#" Codebehind="SurveyItem.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.SurveyItem" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	    <!--#include file="inc/head.inc"-->
		<title>问卷调查题目</title>
		<script type="text/javascript" src='inc/SurveyItem.js'></script>
		<script type="text/javascript" src='inc/commond.js'></script>
		<style type="text/css">
		    .textContent{display:none; margin-right:10px;}
		</style>
	</head>
	<body>
		<div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" />问卷调查管理</div>
		<div class="sub_container_content">
		    
	        <div class="frame">
	            <div class="frame_title"> 问卷调查题目管理</div>
	            <div class="frame_content">
                    <asp:Repeater id="rptSurveyItem" runat="server">
                        <ItemTemplate>
                            <form id='form_<%#Container.ItemIndex %>' action="SurveyItem.aspx" onsubmit="return false;">
                                <table class="tableBorder" cellSpacing="0" cellPadding="0" width="95%" align="center" border="1" id="tb_question">
		                            <tr>
			                            <td style="width:100px;">问卷题目：</td>
			                            <td>
			                                <input type="text" name="txtQuestion_hide" size="80" maxlength="250" value='<%# DataBinder.Eval(Container.DataItem,"Title") %>' />
			                                <span class="textContent"><%# DataBinder.Eval(Container.DataItem,"Title") %></span>
			                                <span class="textContent modifyOption hand" data='<%# DataBinder.Eval(Container.DataItem,"SurveyItemID") %>'>[修改]</span>
			                                <span id="deleteQuestion" class="textContent hand" data='<%# DataBinder.Eval(Container.DataItem,"SurveyItemID") %>'>[删除]</span>
			                                <input type="hidden" name="SurveyItemID" value='<%# DataBinder.Eval(Container.DataItem,"SurveyItemID") %>' />
			                            </td>
		                            </tr>
		                            <tr>
			                            <td>选项类型：</td>
			                            <td>
				                            <input type="radio" id='rdChoiceType_0_<%# DataBinder.Eval(Container.DataItem,"SurveyItemID") %>' name="rdChoiceType" value="0" <%# (bool)DataBinder.Eval(Container.DataItem,"IsMultiChoice") ? "" : "checked='checked'" %>   /><label for='rdChoiceType_0_<%# DataBinder.Eval(Container.DataItem,"SurveyItemID") %>'>单选</label>
				                            <input type="radio" id='rdChoiceType_1_<%# DataBinder.Eval(Container.DataItem,"SurveyItemID") %>' name="rdChoiceType" value="1"<%# (bool)DataBinder.Eval(Container.DataItem,"IsMultiChoice") ? "checked='checked'" : "" %> /><label for='rdChoiceType_1_<%# DataBinder.Eval(Container.DataItem,"SurveyItemID") %>'>多选</label>
			                            </td>
		                            </tr>
		                            <tr>
			                            <td>选项：</td>
			                            <td>
				                            <table id="tb_options">
				                                <tr>
				                                    <td>
				                                        <asp:Repeater ID="rptOptions" runat="server" DataSource='<%# BindOptions((int)DataBinder.Eval(Container.DataItem,"SurveyItemID")) %>'>
				                                            <ItemTemplate>
				                                                <div class="txtOption"><input type="text" name="txtOption_hide" size="30" value='<%# DataBinder.Eval(Container.DataItem,"OptionName") %>' /><span class="textContent"><%# DataBinder.Eval(Container.DataItem,"OptionName") %></span><span class="textContent modifyOption hand">[修改]</span><span class="textContent hand deleteOption hide" data='<%# DataBinder.Eval(Container.DataItem,"SurveyOptionID") %>'>[删除]</span></div>
				                                            </ItemTemplate>
				                                        </asp:Repeater>
				                                        <input type="button" name="btnAddMoreOption" value="增加选项填写框" class="inputbtn" /><input type="hidden" name="hiddenOptionNum" value="1" />
				                                    </td>
				                                </tr>
				                            </table>
			                            </td>
		                            </tr>
		                            <tr>
			                            <td>&nbsp;</td>
			                            <td>
			                                <input type="submit" name="btnSubmit" value="保存选项" class="inputbtn" />
			                            </td>
		                            </tr>
	                            </table>
	                            <br />
                            </form>
                        </ItemTemplate>
                    </asp:Repeater>

	                <form id="formAdd" action="SurveyItem.aspx" method="post" style="display:none;">
	                    <table class="tableBorder" cellSpacing="0" cellPadding="0" width="95%" align="center" border="1" id="tb_question">
		                    <tr>
			                    <td style="width:100px;">问卷题目：</td>
			                    <td>
			                        <input type="text" name="txtQuestion" size="80" maxlength="250" /><span class="textContent"></span><span id="modifyQuestion" class="textContent modifyQuestion hand">[修改]</span><span id="deleteQuestion" class="textContent hand" data="0">[删除]</span><input type="hidden" name="SurveyItemID" value="0" />
			                    </td>
		                    </tr>
		                    <tr>
			                    <td>选项类型：</td>
			                    <td>
				                    <input type="radio" id="rdChoiceType_0" name="rdChoiceType" value="0" checked="checked" /><label for="rdChoiceType_0">单选</label>
				                    <input type="radio" id="rdChoiceType_1" name="rdChoiceType" value="1" /><label for="rdChoiceType_1">多选</label>
			                    </td>
		                    </tr>
		                    <tr>
			                    <td>选项：</td>
			                    <td>
				                    <table id="tb_options">
				                        <tr>
				                            <td>
				                                <div class="txtOption"><input type="text" name="txtOption" size="30" /><span class="textContent"></span><span class="textContent modifyOption hand">[修改]</span><span class="textContent hand deleteOption hide" data="0">[删除]</span></div>
				                                <input type="button" name="btnAddMoreOption" value="增加选项填写框" class="inputbtn" /><input type="hidden" name="hiddenOptionNum" value="1" />
				                            </td>
				                        </tr>
				                    </table>
			                    </td>
		                    </tr>
		                    <tr>
			                    <td>&nbsp;</td>
			                    <td>
			                        <input type="submit" name="btnSubmit" value="提交" class="inputbtn" />
			                    </td>
		                    </tr>
	                    </table>
	                    <br />
	                </form>
	                <input type="button" id="btnAddQuestion" value="增加题目填写框" class="inputbtn" />
	                <a href='Survey.aspx?Action=<%= (Request.QueryString["from"] != null ? "Manage" : "Modify&ID=" + Request.QueryString["SurveyID"]) %>'>返回</a>
	            </div>
            </div>
		</div>
		</div>
		</div>
	</body>
</html>
