<%@ control language="VB" autoeventwireup="false" inherits="RCC_Voice_CC_ForwardingRule, MachSol.MachPanel.Web" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Assembly="MachSol.MachPanel.Utility" Namespace="MachSol.MachPanel.Utility"
    TagPrefix="EM" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="EM" %>
<%@ Register Src="~/Template/CC/Selectable_Selected_LBX.ascx" TagName="AddSelectableSelected" TagPrefix="EM" %>

<asp:Panel ID="Pnl_Listing" runat="server" DefaultButton="Btn_ApplyFilter">
    <div class="row Div_OpsRow" id="Div_OpsRow" runat="server">
        <div class="col-xs-12">
            <div class="card">
                <div class="header">
                    <h3>
                        <%= Resources.Content.SMI0423%>                                                                                                                                 
                    </h3>
                </div>
                <div class="body">
                    <div class="clearfix">
                        <asp:Button ID="Btn_AddForwarding" class="btn btn-primary waves-effect btnAction" runat="server"
                            Text='<%$ Resources:Content,AddForwardingRule %>' />
                    </div>
                </div>
            </div>
        </div>
    </div>

    <asp:Panel ID="Pnl_Btn_ApplyFilter" runat="server" CssClass="row" DefaultButton="Btn_ApplyFilter">
        <div class="panel-group search-panel" id="AS_Forwardings" role="tablist" aria-multiselectable="true">
            <div class="col-xs-12" role="tab" id="SH_Forwardings">
                <div class="card">
                    <div class="header" role="button" data-toggle="collapse" data-parent="#AS_Forwardings" href="#<%= CSB_Forwardings.ClientID%>" aria-expanded="true" aria-controls="SH_Forwardings">
                        <h3>
                            <%= Resources.Content.GN0000395%>
                        </h3>
                    </div>
                    <div id="CSB_Forwardings" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_Forwardings" aria-expanded="false">
                        <div class="row">

                            <div class="col-md-3 col-sm-6 col-xs-12">
                                <div class="form-group form-float">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_SrchIncomingToNumber" runat="server" CssClass="allowonlyintegervalues" MaxLength="19"></asp:TextBox>
                                        <asp:Label ID="Label2" runat="server" class="form-label" EnableViewState="false"
                                            Text="<%$ Resources:Content,IncomingToNumber%>"></asp:Label>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3 col-sm-6 col-xs-12">
                                <div class="form-group form-float">
                                    <div class="form-line">
                                        <asp:TextBox ID="TxBx_SrchForwardToNumber" runat="server" CssClass="allowonlyintegervalues" MaxLength="19"></asp:TextBox>
                                        <asp:Label ID="Label1" runat="server" class="form-label" EnableViewState="false"
                                            Text="<%$ Resources:Content,ForwardToNumber%>"></asp:Label>
                                    </div>

                                </div>
                            </div>
                            <div class="col-md-3 col-sm-6 col-xs-12">
                                <div class="form-group form-float">
                                    <asp:DropDownList ID="Ddl_SrchType" runat="server">
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-md-3 col-sm-6 col-xs-12">
                                <div class="form-group form-float">
                                    <asp:DropDownList ID="Ddl_SrchTransparent" runat="server">
                                        <asp:ListItem Text="<%$ Resources:Content,SelectTransparent %>" Value="-1"></asp:ListItem>
                                        <asp:ListItem Text="<%$ Resources:Content,GN000195 %>" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="<%$ Resources:Content,GN0000860 %>" Value="0"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="col-md-3 col-sm-6 col-xs-12">
                                <div class="form-group form-float">
                                    <asp:Button ID="Btn_ApplyFilter" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN0000391%>" />
                                    <asp:Button ID="Btn_ClearFilter" Visible="false" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,String289 %>" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>

    <EM:MPGridView ID="GV_ForwardingsListing" CssClass="table table-bordered table-striped table-hover" AllowSorting="true"
        AllowPaging="true" EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server" AutoGenerateColumns="False">
        <Columns>
            <asp:TemplateField SortExpression="IncomingToNumber" HeaderStyle-CssClass="col-xs-2"
                HeaderText='<%$ Resources:Content, IncomingToNumber %>'>
                <ItemTemplate>
                    <asp:Label ID="LB_IncomingToNumber" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Resources:Content,GN0000673%>" HeaderStyle-CssClass="col-xs-2">
                <ItemTemplate>
                    <asp:Label ID="LB_Type" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField SortExpression="ForwardToNumber" HeaderText="<%$ Resources:Content,ForwardToNumber%>" HeaderStyle-CssClass="col-xs-2">
                <ItemTemplate>
                    <asp:Label ID="LB_ForwardToNumber" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Resources:Content,Transparent%>" HeaderStyle-CssClass="col-xs-2">
                <ItemTemplate>
                    <asp:Label ID="LB_Transparent" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Resources:Content,DEV1134%>" HeaderStyle-CssClass="col-xs-2">
                <ItemTemplate>
                    <asp:HyperLink ID="LB_Subscriber" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText='<%$ Resources:Content, GN0000360 %>' HeaderStyle-CssClass="col-xs-2">
                <ItemTemplate>
                    <asp:Button ID="Btn_Edit" runat="server" Text="<%$ Resources:Content,Edit %>"
                        CssClass="btn btn-primary waves-effect" CommandName="Edit" Visible="false" />
                    <asp:Button ID="Btn_Remove" runat="server" Text="<%$ Resources:Content, Remove %>"
                        CssClass="btn btn-primary waves-effect btnAction" CommandName="Remove" />
                    <EM:ConfirmButtonExtender ID="CBE_Remove" runat="server" ConfirmText="<%$Resources:Content,RemoveForwardingRuleConfirmation%>"
                        TargetControlID="Btn_Remove">
                    </EM:ConfirmButtonExtender>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <PagerTemplate>
            <EM:Pager ID="Pager" runat="server" />
        </PagerTemplate>
    </EM:MPGridView>
</asp:Panel>

<asp:Panel ID="Pnl_Add" runat="server" Visible="false">

    <div class="row">
        <div class="col-xs-12">
            <div class="card">
                <div class="header">
                    <h3>
                        <asp:Label ID="Lbl_AddEditTitle" runat="server" Text="<%$ Resources:Content,AddForwardingRule%>"></asp:Label>
                    </h3>
                </div>
                <div class="body">
                    <div class="row">
                        <div class="col-xs-12" id="OptionRow" runat="server">
                            <asp:RadioButtonList ID="RBL_Options" runat="server" RepeatDirection="Horizontal" AutoPostBack="true">
                                <asp:ListItem Selected="True" Text="<%$ Resources:Content,GN00001134 %>" Value="0"></asp:ListItem>
                                <asp:ListItem Selected="false" Text="<%$ Resources:Content,DEV1134 %>" Value="1"></asp:ListItem>
                            </asp:RadioButtonList>
                        </div>
                    </div>
                    <div class="row" id="SubscriberRow" runat="server" visible="false">
                        <div class="col-sm-3 col-xs-12 row-label">
                            *
                            <asp:Literal ID="Literal4" runat="server" Text='<%$ Resources:Content, DEV1134 %>' />:
                        </div>
                        <div class="col-sm-4 col-xs-12">
                            <div class="form-group">
                                <asp:DropDownList ID="ddl_Subscribers" runat="server" AutoPostBack="true"></asp:DropDownList>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-sm-3 col-xs-12 row-label">
                            
                            <asp:Literal ID="Literal22" runat="server" Text='<%$ Resources:Content,IncomingToNumber %>' />:
                        </div>
                        <div class="col-sm-3 col-xs-12">
                            <div class="form-group">
                                <asp:DropDownList ID="Ddl_IncomingToNumber" runat="server"></asp:DropDownList>
                            </div>
                            <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server"
                                ControlToValidate="Ddl_IncomingToNumber"
                                ErrorMessage="<%$ Resources:Content,IncomingToNumberRequired %>"
                                Display="none" ValidationExpression="^(?!.*?(-1)).*$" ValidationGroup="AddForwarding" SetFocusOnError="true">
                            </asp:RegularExpressionValidator>--%>
                        </div>


                       <%-- <div class="col-sm-3 col-xs-12" id="Div_TxBx_IncomingToNumber">
                            <div class="form-group form-float">
                                <div class="form-line">
                                    <asp:TextBox runat="server" ID="TxBx_IncomingToNumber" CssClass="range2 allowonlyintegervalues"></asp:TextBox>
                                    <asp:Label ID="Label3" runat="server" class="form-label" EnableViewState="false"
                                        Text="<%$ Resources:Content,strOREnterNumber%>"></asp:Label>
                                </div>
                            </div>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                                Display="None"
                                ControlToValidate="TxBx_IncomingToNumber" ErrorMessage='<%# Resources.Content.OnlyIntegerValues %>'
                                ValidationExpression="^[0-9]*$" ValidationGroup="AddPortNumber" SetFocusOnError="true">
                            </asp:RegularExpressionValidator>

                        </div>--%>
                    </div>
                    <div class="row">
                        <div class="col-sm-3 col-xs-12 row-label">
                            *
                            <asp:Literal ID="Literal1" runat="server" Text='<%$ Resources:Content,ForwardToNumber %>' />:
                        </div>
                       <%-- <div class="col-sm-3 col-xs-12">
                            <div class="form-group">
                                <asp:DropDownList ID="Ddl_ForwardToNumber" runat="server" onchange="ShowHideFields();"></asp:DropDownList>
                            </div>
                            <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
                                ControlToValidate="Ddl_ForwardToNumber"
                                ErrorMessage="<%$ Resources:Content,ForwardToNumberRequired %>"
                                Display="none" ValidationExpression="^(?!.*?(-1)).*$" ValidationGroup="AddForwarding" SetFocusOnError="true">
                            </asp:RegularExpressionValidator>
                        </div>--%>
                        <div class="col-sm-3 col-xs-12" id="Div_TxBx_ForwardToNumber">
                            <div class="form-group form-float">
                                <div class="form-line">
                                    <asp:TextBox runat="server" ID="TxBx_ForwardToNumber" CssClass="range2 allowonlyintegervalues"></asp:TextBox>
                                  <%--  <asp:Label ID="Label4" runat="server" class="form-label" EnableViewState="false"
                                        Text="<%$ Resources:Content,strOREnterNumber%>"></asp:Label>--%>
                                </div>
                            </div>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server"
                                Display="None"
                                ControlToValidate="TxBx_ForwardToNumber" ErrorMessage='<%# Resources.Content.OnlyIntegerValues %>'
                                ValidationExpression="^[0-9]*$" ValidationGroup="AddPortNumber" SetFocusOnError="true">
                            </asp:RegularExpressionValidator>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1"
                                runat="server"
                                Display="None"
                                SetFocusOnError="true"
                                ControlToValidate="TxBx_ForwardToNumber"
                                ValidationGroup="AddPortNumber"></asp:RequiredFieldValidator>

                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-3 col-xs-12 row-label">
                            *
                            <asp:Literal ID="Literal3" runat="server" Text='<%$ Resources:Content,Type %>' />:
                        </div>
                        <div class="col-sm-3 col-xs-12">
                            <div class="form-group">
                                <asp:DropDownList ID="Ddl_Type" runat="server"></asp:DropDownList>
                            </div>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server"
                                ControlToValidate="Ddl_Type"
                                ErrorMessage="<%$ Resources:Content,TypeRequired %>"
                                Display="none" ValidationExpression="^(?!.*?(-1)).*$" ValidationGroup="AddForwarding" SetFocusOnError="true">
                            </asp:RegularExpressionValidator>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-3 col-xs-12 row-label">
                            <asp:Literal ID="Literal2" runat="server" Text='<%$ Resources:Content,Transparent %>' />:
                        </div>
                        <div class="col-sm-3 col-xs-12">
                            <div class="form-group">
                                <div class="checkbox">
                                    <asp:CheckBox ID="ChBx_Transparent" runat="server" Text=" " Checked="false" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-12">
                            <asp:HiddenField ID="HFId" Value="0" runat="server" />
                            <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="true" ShowSummary="false"
                                ValidationGroup="AddForwarding" HeaderText="<%$ Resources:Content,EM000001%>" />
                            <asp:Button ID="Btn_Save" class="btn btn-primary waves-effect btnAction" ValidationGroup="AddForwarding" CausesValidation="true" runat="server" Text='<%$ Resources:Content,GN0000281 %>' />
                            <asp:Button ID="Btn_Cancel" CausesValidation="false" runat="server" Text='<%$ Resources:Content,GN0000572 %>' class="btn btn-primary waves-effect" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <%--<script type="text/javascript">
        $(document).ready(function () {
            ShowHideFields();
        });
        function ShowHideFields() {
            if ($("#<%= Ddl_IncomingToNumber.ClientID%>").val() == "-1") {
                $("#Div_TxBx_IncomingToNumber").removeClass("hide");
            }
            else {
                $("#Div_TxBx_IncomingToNumber").addClass("hide");
            }
            if ($("#<%= Ddl_ForwardToNumber.ClientID%>").val() == "-1") {
                $("#Div_TxBx_ForwardToNumber").removeClass("hide");
            }
            else {
                $("#Div_TxBx_ForwardToNumber").addClass("hide");
            }
        }
    </script>--%>
</asp:Panel>
