<%@ page language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" inherits="Admin_Hostmatic_DNSTemplate, MachSol.MachPanel.Web" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Src="./CC/DnsTemplatesEdit.ascx" TagName="DNSEdits" TagPrefix="EM" %>
<%@ Register Src="./CC/DnsTemplateAdd.ascx" TagName="DNSAdd" TagPrefix="EM" %>
<%@ Register Src="./CC/DnsTemplateRecords.ascx" TagName="DNSRec" TagPrefix="EM" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="EM" %>
<asp:Content ID="Content4" ContentPlaceHolderID="CPH_Content" runat="Server">

    <script type="text/javascript">
        function DDL_IndexChanged(DDL_Id, TxBx_Id, TxBx_Id1, TxBx_Name, Service, Protocol, Weight, Port) {
            var TxBx_Priority = document.getElementById(TxBx_Id);
            var DDL_Type = document.getElementById(DDL_Id);
            var TxBx_Host1 = document.getElementById(TxBx_Id1);
            var TxBx_Name1 = document.getElementById(TxBx_Name);
            var DDL_Service1 = document.getElementById(Service);
            var DDL_Protocol1 = document.getElementById(Protocol);
            var TxBx_Weight1 = document.getElementById(Weight);
            var TxBx_Port1 = document.getElementById(Port);

            if (DDL_Type.options[DDL_Type.selectedIndex].value == "0") {
                DDL_Service1.style.display = "none";
                DDL_Service1.style.visiblility = "none";
                DDL_Protocol1.style.display = "none";
                DDL_Protocol1.style.visiblility = "none";
                TxBx_Weight1.disabled = true;
                TxBx_Port1.disabled = true;

                DDL_Service1.disabled = true;
                TxBx_Priority.disabled = true;
                TxBx_Host1.disabled = true;
                TxBx_Name1.disabled = true;
            }
            else if (DDL_Type.options[DDL_Type.selectedIndex].value == "1") {
                DDL_Service1.style.display = "none";
                DDL_Service1.style.visiblility = "none";
                DDL_Protocol1.style.display = "none";
                DDL_Protocol1.style.visiblility = "none";
                TxBx_Weight1.disabled = true;
                TxBx_Port1.disabled = true;

                TxBx_Priority.disabled = true;
                TxBx_Host1.disabled = false;
                TxBx_Host1.focus();
                TxBx_Name1.disabled = false;
                TxBx_Name1.value = '@'
            }
            else if (DDL_Type.options[DDL_Type.selectedIndex].value == "2") {

                DDL_Service1.style.display = "none";
                DDL_Service1.style.visiblility = "none";
                DDL_Protocol1.style.display = "none";
                DDL_Protocol1.style.visiblility = "none";
                TxBx_Weight1.disabled = true;
                TxBx_Port1.disabled = true;

                TxBx_Host1.value = '%IPAddress%'
                TxBx_Priority.disabled = true;
                TxBx_Host1.disabled = false;
                TxBx_Name1.disabled = false;
                TxBx_Name1.focus();
                TxBx_Name1.value = '@'
            }
            else if (DDL_Type.options[DDL_Type.selectedIndex].value == "3") {
                DDL_Service1.style.display = "none";
                DDL_Service1.style.visiblility = "none";
                DDL_Protocol1.style.display = "none";
                DDL_Protocol1.style.visiblility = "none";
                TxBx_Weight1.disabled = true;
                TxBx_Port1.disabled = true;

                TxBx_Priority.disabled = false;
                TxBx_Host1.disabled = false;
                TxBx_Name1.disabled = false;
                TxBx_Name.value = '@'
                TxBx_Host1.focus();
                TxBx_Priority.value = '15'
            }
            else if (DDL_Type.options[DDL_Type.selectedIndex].value == "4") {
                DDL_Service1.style.display = "none";
                DDL_Service1.style.visiblility = "none";
                DDL_Protocol1.style.display = "none";
                DDL_Protocol1.style.visiblility = "none";
                TxBx_Weight1.disabled = true;
                TxBx_Port1.disabled = true;

                TxBx_Host1.value = '%DomainName%'
                TxBx_Priority.disabled = true;
                TxBx_Host1.disabled = false;
                TxBx_Name1.disabled = false;
                TxBx_Name1.value = '@'
            }

            else if (DDL_Type.options[DDL_Type.selectedIndex].value == "5") {
                DDL_Service1.style.display = "none";
                DDL_Service1.style.visiblility = "none";
                DDL_Protocol1.style.display = "none";
                DDL_Protocol1.style.visiblility = "none";
                TxBx_Weight1.disabled = true;
                TxBx_Port1.disabled = true;

                TxBx_Priority.disabled = true;
                TxBx_Host1.value = ''
                TxBx_Host1.height = 40;
            }
            else if (DDL_Type.options[DDL_Type.selectedIndex].value == "6") {
                DDL_Service1.style.display = "";
                DDL_Service1.style.visiblility = "";
                DDL_Protocol1.style.display = "";
                DDL_Protocol1.style.visiblility = "";

                TxBx_Weight1.disabled = false;
                TxBx_Port1.disabled = false;

                TxBx_Priority.disabled = false;
                TxBx_Host1.value = ''
                TxBx_Host1.height = 40;
                TxBx_Name1.disabled = true;
                TxBx_Name1.value = '@'
            }

        }
    </script>

    <div class="col-xs-12">
        <div class="card">
            <div class="header">
                <h2>
                    <asp:Literal ID="Ltl_SubsInfo" runat="server" Text="DNS Templates" /></h2>
            </div>
            <div class="body">
                <EM:TabContainer ID="TC_DNSTemplate" runat="server" OnClientActiveTabChanged="loadTabPanel">
                    <EM:TabPanel ID="Tab_DNSTemplates" runat="server" HeaderText="<%$ Resources:Content,M0122%>">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab0" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent0" runat="server" Visible="true">
                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="card Div_OpsRow" id="Div_OpsRow" runat="server">
                                            <div class="header">
                                                <h3>
                                                    <%= Resources.Content.GN00001320%>      <%--Operations--%>                                                                                                                             
                                                </h3>
                                            </div>
                                            <div class="body">
                                                <div class="row">
                                                    <div class="col-xs-12">
                                                        <asp:Button class="btn btn-primary waves-effect btnAction" ID="Btn_AddDNSTemplate" runat="server" Text="<%$ Resources:Content,SMI664%>" />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <br />
                                        <div class="card">
                                            <div class="body">
                                                <div class="row">
                                                    <div class="col-xs-12">
                                                        <asp:GridView ID="Gv_DNSTemplateListing" runat="server" AllowPaging="true" DataSourceID=""
                                                            CssClass="table table-bordered table-striped table-hover" AutoGenerateColumns="false" EmptyDataText="<%$ Resources:Content,GN00001375%>">

                                                            <Columns>
                                                                <asp:TemplateField HeaderText="<%$ Resources:Content,GN0000678%>" HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1">
                                                                    <ItemTemplate>
                                                                        <asp:LinkButton ID="LB_TemplateID" runat="server" CommandName="Name"></asp:LinkButton>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="<%$ Resources:Content,SMI665%>" HeaderStyle-CssClass="col-xs-6" ItemStyle-CssClass="col-xs-6">
                                                                    <ItemTemplate>
                                                                        <asp:LinkButton ID="LB_TemplateName" runat="server" CommandName="Name"></asp:LinkButton>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="<%$ Resources:Content,SMI666%>" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="img_InUse" runat="server"></asp:Label>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="<%$ Resources:Content,GN00001320%>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                                                    <ItemTemplate>
                                                                        <asp:LinkButton ID="LB_Edit" runat="server" CommandName="DNSEdit" CssClass="btn btn-primary waves-effect"
                                                                            Text='<%$ Resources:Content, GN0000276 %>' CausesValidation="false"></asp:LinkButton>
                                                                        <asp:LinkButton ID="LB_Remove" runat="server" CommandName="DNSRemove" CssClass="btn btn-primary waves-effect btnAction"
                                                                            Text='<%$ Resources:Content, GN0000278 %>' CausesValidation="false"></asp:LinkButton>
                                                                        <EM:ConfirmButtonExtender ID="CBE_Remove" runat="server" ConfirmText="<%$Resources:Content,CBE001%>"
                                                                            TargetControlID="LB_Remove">
                                                                        </EM:ConfirmButtonExtender>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                            </Columns>
                                                            <%--PagerTemplate Start--%>
                                                            <PagerTemplate>
                                                                <EM:Pager ID="Pager1" runat="server" />
                                                            </PagerTemplate>
                                                            <%--PagerTemplate End--%>
                                                        </asp:GridView>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>
                    <EM:TabPanel ID="Tab_DNSTempRec" runat="server" HeaderText="<%$ Resources:Content,SMI667%>" Enabled="false">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab1" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent1" runat="server" Visible="false">
                                <div class="row Div_OpsRow" id="Div_OpsRow2" runat="server">
                                    <div class="col-xs-12">
                                        <div class="card">
                                            <div class="header">
                                                <h3>
                                                    <%= Resources.Content.GN00001320%>      <%--Operations--%>                                                                                                                             
                                                </h3>
                                            </div>
                                            <div class="body">
                                                <asp:Button class="btn btn-primary waves-effect btnAction" ID="Btn_Edit" runat="server" Text="<%$ Resources:Content,GN0000276%>" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <EM:DNSRec ID="DNSRec" runat="server" />
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>
                    <EM:TabPanel ID="Tab_DNSEdit" runat="server" HeaderText="<%$ Resources:Content,SMI668%>" Enabled="false">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab2" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent2" runat="server" Visible="false">
                                <EM:DNSEdits ID="DNSEdits" runat="server" />
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>
                    <EM:TabPanel ID="Tab_DNSAdd" runat="server" HeaderText="<%$ Resources:Content,SMI669%>" Enabled="false">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab3" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent3" runat="server" Visible="false">
                                <EM:DNSAdd ID="DNSAdd" runat="server" />
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>
                </EM:TabContainer>
            </div>
        </div>
    </div>
</asp:Content>
