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

<!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 runat="server">
    <title></title>
    <link id="CssName" rel="stylesheet" type="text/css" runat="server" />
	<script type="text/javascript" src="../../js/Common.js"></script>
    <script type="text/javascript">
        function CheckField(obj, Id) {
            if (obj.checked) {
                DianCMS_$("RepTrField_" + Id + "").style.display = "";
            }
            else {
                DianCMS_$("RepTrField_" + Id + "").style.display = "none";
            }
        }

        function LoadRepField() {
            var fieldstring = DianCMS_$("FieldString").value;
            if (fieldstring.length > 0) {
                if (fieldstring.length > 0) {
                    for (var i = 0; i < fieldstring.split(",").length; i++) {
                        DianCMS_$("RepTrField_" + fieldstring.split(",")[i] + "").style.display = "";
                    }
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <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="morewherelist.aspx">多条件规则列表</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="txtName" runat="server" Columns="40" CssClass="in1"></asp:TextBox>
                <asp:TextBox ID="FieldString" runat="server" Style="display: none"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                选择模型：
            </td>
            <td class="bqright">
                <asp:RadioButtonList ID="RadioModel" runat="server" RepeatColumns="6" 
                    RepeatDirection="Horizontal" AutoPostBack="True" 
                    onselectedindexchanged="RadioModel_SelectedIndexChanged">
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                选择筛选字段：
            </td>
            <td class="bqright">
                <asp:DataList ID="DataField" runat="server" RepeatDirection="Horizontal" RepeatColumns="6"
                    OnItemDataBound="DataField_ItemDataBound">
                    <ItemTemplate>
                        <table cellpadding="2" cellspacing="0" border="0" class="ShopColor">
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtFieldId" runat="server" Text='<%#Eval("FieldId") %>' Style="display: none"></asp:TextBox><asp:CheckBox ID="CheckBox1" runat="server" /><%#Eval("Alias") %>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:DataList>
            </td>
        </tr>
        <asp:Repeater ID="Repeater1" runat="server" 
            onitemdatabound="Repeater1_ItemDataBound">
            <HeaderTemplate>            
                <tr>
                    <td class="bqleft">
                        字段名称
                    </td>
                    <td class="bqright">
                        <table cellpadding="2" cellspacing="1" bgcolor="#cccccc" width="100%">
                            <tr class="bqright">
                                <td width="16%" align="center"><b>筛选条件</b></td>
                                <td width="42%" align="center"><b>显示值</b></td>
                                <td width="42%" align="center"><b>搜索值</b></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr style="display: none" id="RepTrField_<%#Eval("FieldId") %>">
                    <td class="bqleft">
                        <%#Eval("Alias") %><asp:TextBox ID="txtFieldId" runat="server" style="display:none" Text='<%#Eval("FieldId") %>'></asp:TextBox><asp:TextBox ID="txtContent" runat="server" style="display:none" Text='<%#Eval("Content") %>'></asp:TextBox><asp:TextBox ID="txtFieldData" runat="server" Text='<%#Eval("FieldData") %>' style="display:none"></asp:TextBox>：
                    </td>
                    <td class="bqright">
                        <table cellpadding="2" cellspacing="1" bgcolor="#cccccc" width="100%">
                            <tr class="bqright">
                                <td width="16%">
                                    <asp:RadioButtonList ID="RadioWhere" runat="server" RepeatDirection="Vertical">
                                        <asp:ListItem Value="1" Selected="True">等于</asp:ListItem>
                                        <asp:ListItem Value="2">范围</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                                <td width="42%"><asp:TextBox ID="txtShowValue" runat="server" TextMode="MultiLine" Rows="4" style="width:100%;"></asp:TextBox><asp:Literal ID="Literal1" runat="server"></asp:Literal></td>
                                <td width="42%"><asp:TextBox ID="txtSearchValue" runat="server" TextMode="MultiLine" Rows="4" style="width:100%;"></asp:TextBox><asp:Literal ID="Literal2" runat="server"></asp:Literal></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        <tr>
            <td class="bqleft">
                默认值：
            </td>
            <td class="bqright"><asp:TextBox ID="txtBuXian" runat="server" CssClass="in1" Columns="20" Text="不限"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                链接地址：
            </td>
            <td class="bqright"><asp:TextBox ID="txtSearchName" runat="server" CssClass="in1" Columns="30" Text="/search/search_1.aspx"></asp:TextBox> 用于模型搜索的文件名及路径
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                默认连接代码：
            </td>
            <td class="bqright"><asp:TextBox ID="txtMoRenHtml" runat="server" 
                    
                    Text="&lt;li&gt;&lt;a href=&quot;{d_url}&quot;&gt;{d_value}&lt;/a&gt;&lt;/li&gt;" 
                    CssClass="in1" Columns="60"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                选中时连接代码：
            </td>
            <td class="bqright"><asp:TextBox ID="txtXuanZhongHtml" runat="server" 
                    
                    Text="&lt;li class=&quot;xz&quot;&gt;&lt;a href=&quot;{d_url}&quot;&gt;{d_value}&lt;/a&gt;&lt;/li&gt;" CssClass="in1" 
                    Columns="60"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="bqleft">
                是否重写URL：
            </td>
            <td class="bqright">
                <asp:RadioButtonList ID="RadioURLRewriter" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="True" Selected="True">是</asp:ListItem>
                    <asp:ListItem Value="False">否</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td class="bqleft">
            </td>
            <td class="bqright" height="50">
                <asp:Button ID="Button1" runat="server" Text=" 确认 " CssClass="btn radius30 pad_0_30" OnClick="Button1_Click" />
            </td>
        </tr>
    </table>
    <script>
        LoadRepField();</script>
    </form>
</body>
</html>
