<%@ page language="C#" autoeventwireup="true" inherits="admin_survey_setsurveyitem, DianCMS" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Import Namespace="D.Common" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link id="CssName" rel="stylesheet" type="text/css" runat="server" />
    <script src="../../js/Common.js" type="text/javascript"></script>
    <script src="../../js/date/date.js" type="text/javascript"></script>
    <script src="../../js/lhgdialog/lhgcore.lhgdialog.min.js?self=true&skin=<%=Function.GetCssNameColor()%>" type="text/javascript"></script>
    <script type="text/javascript">
        function sel() {
            var TypeCount = document.getElementsByName("radClass");
            var p = 0;
            if (navigator.appName == "Microsoft Internet Explorer") {
                p = 1;
            }
            var t;
            for (var i = p; i < TypeCount.length; i++) {
                if (TypeCount[i].checked) {
                    t = TypeCount[i].value;
                }
            }

            switch (t) {
                case "bit":
                    DianCMS_$("divradio").style.display = "none";
                    DianCMS_$("divbit").style.display = "";
                    DianCMS_$("divinput").style.display = "none";
                    break;
                case "input":
                    DianCMS_$("divradio").style.display = "none";
                    DianCMS_$("divbit").style.display = "none";
                    DianCMS_$("divinput").style.display = "";
                    break;
                default:
                    DianCMS_$("divradio").style.display = "";
                    DianCMS_$("divbit").style.display = "none";
                    DianCMS_$("divinput").style.display = "none";
                    break;
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server" onkeydown="Save()">
        <table class="dh" cellpadding="0" cellspacing="0" border="0" align="center">
            <tr>
                <td>
                    <asp:Image ID="P_Go" runat="server" ImageAlign="AbsMiddle" />
                    您现在的位置：<a href="../info.aspx">后台管理</a> >> <a href="surveylist.aspx">调查列表</a> >> <a href="surveyitemlist.aspx?surveyid=<%=Request.QueryString["surveyid"] %>">调查选项列表</a> >> 设置问卷调查
                </td>
            </tr>
        </table>
        <table class="border" cellspacing="1" cellpadding="0" width="99%" border="0" align="center">
            <tr>
                <td class="bqleft">调查问题：
                </td>
                <td class="bqright">
                    <asp:TextBox ID="txtTitle" runat="server" TextMode="MultiLine" Rows="5" Columns="50"></asp:TextBox><font color="#ff0066">*</font>
                </td>
            </tr>
            <tr>
                <td class="bqleft">调查类型：
                </td>
                <td class="bqright">
                    <asp:RadioButtonList ID="radClass" runat="server" RepeatDirection="Horizontal" onchange="sel()">
                        <asp:ListItem Value="radio" Selected="True">单选项</asp:ListItem>
                        <asp:ListItem Value="listbox">多选项</asp:ListItem>
                        <asp:ListItem Value="bit">是否/对错项</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tbody id="divradio" runat="server">
                <tr>
                    <td class="bqleft">调查选项：
                    </td>
                    <td class="bqright">
                        <asp:ScriptManager ID="ScriptManager1" runat="server">
                        </asp:ScriptManager>
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                    <tr>
                                        <td>
                                            <asp:TextBox ID="txtContent" runat="server" TextMode="MultiLine" Rows="6" Columns="60" Style="display: none"></asp:TextBox><asp:TextBox ID="txtId" runat="server" Text="0" Style="display: none"></asp:TextBox>
                                            <asp:GridView ID="GridView1" HeaderStyle-CssClass="title" runat="server" AutoGenerateColumns="False"
                                                CssClass="border" DataKeyNames="Id" RowStyle-CssClass="tdMoveTr" HorizontalAlign="Center" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" OnRowDataBound="GridView1_RowDataBound">
                                                <RowStyle CssClass="tdMoveTr" />
                                                <Columns>
                                                    <asp:TemplateField HeaderText="选项标题" HeaderStyle-CssClass="t1">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtTitle" CssClass="in1" Columns="20" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="选项样式">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtStyle" CssClass="in1" Columns="20" runat="server" Text='<%# Bind("Style") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("Style") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="排序值">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtOrderId" CssClass="in1" Columns="10" runat="server" Text='<%# Bind("OrderId") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("OrderId") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:CommandField HeaderText="操作" ShowEditButton="True" />
                                                    <asp:CommandField HeaderText="删除" ShowDeleteButton="True" />
                                                </Columns>
                                                <HeaderStyle CssClass="title" Font-Bold="True" />
                                                <EmptyDataTemplate>
                                                    <tr class="title">
                                                        <td class="t1">选项标题
                                                        </td>
                                                        <td>选项样式
                                                        </td>
                                                        <td>排序值
                                                        </td>
                                                        <td>操作
                                                        </td>
                                                        <td>删除
                                                        </td>
                                                    </tr>
                                                </EmptyDataTemplate>
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <table class="border" cellspacing="1" cellpadding="0" border="0" align="center" style="margin-bottom: 10px; margin-top: 10px;">
                                                <tr>
                                                    <td class="bqleft" colspan="2"><b>创建一个选项</b></td>
                                                </tr>
                                                <tr>
                                                    <td class="bqleft">选项标题：
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtName" runat="server" TextMode="MultiLine" Rows="3" Columns="50"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="bqleft">选项样式：
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtStyle" runat="server" CssClass="in1" Columns="20" Text="#FF9966"></asp:TextBox>如：样式名称：voteimg1 或者 #FF9966 <font color="red">颜色值必须以#开始
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="bqleft">排序值：
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtOrderId" runat="server" CssClass="in1" Text="0" Columns="10"></asp:TextBox>数字越小，排列越靠前。
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="bqleft"></td>
                                                    <td height="40">
                                                        <asp:Button ID="Button1" runat="server" Text=" 创建选项 " CssClass="btn"
                                                            OnClick="Button1_Click" /><asp:Literal ID="Literal2" runat="server"></asp:Literal>
                                                        创建、编辑或删除一个选项后，需要点击【确认】按钮才能生效
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td class="bqleft">增加其他：
                    </td>
                    <td class="bqright">
                        <asp:RadioButtonList ID="radIsOther" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Value="1" Selected="True">是</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
            </tbody>
            <tbody id="divbit" style="display: none" runat="server">
                <tr>
                    <td class="bqleft">『是』字文本：
                    </td>
                    <td class="bqright">
                        <asp:TextBox ID="bitTrueTxt" runat="server" CssClass="in1" Text="是"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="bqleft">『否』字文本：
                    </td>
                    <td class="bqright">
                        <asp:TextBox ID="bitFalseTxt" runat="server" CssClass="in1" Text="否"></asp:TextBox></td>
                </tr>
            </tbody>
            <tbody id="divinput" style="display: none" runat="server">
                <tr>
                    <td class="bqleft">填空内容：
                    </td>
                    <td class="bqright">
                        <asp:TextBox ID="txtInput" runat="server" TextMode="MultiLine" Rows="6" Columns="50"></asp:TextBox></td>
                </tr>
            </tbody>
            <tr>
                <td class="bqleft">排序值：
                </td>
                <td class="bqright">
                    <asp:TextBox ID="txtOrderId2" runat="server" CssClass="in1" Text="0"></asp:TextBox>数字越小，排列越靠前</td>
            </tr>
            <tr>
                <td class="bqleft"></td>
                <td class="bqright" align="center" height="40">
                    <asp:Button ID="DianCMS_Submit" runat="server" Text=" 确定(Ctrl+s) " CssClass="btn radius30 pad_0_30" OnClick="btnSubmit_Click" />
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
