<%@ control language="VB" autoeventwireup="false" inherits="Admin_Clients_CC_FTPUsers, MachSol.MachPanel.Web" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="EM" %>
<%@ Register Src="~/Template/ResourcesQuota.ascx" TagName='ResourceQuota' TagPrefix='EM' %>

<div class="col-xs-12">
    <div class="card">
        <div class="header">
            <div class="displayInlineBlock">
                <h2>
                    <asp:Literal ID="Ltl_SubsInfo" runat="server" /></h2>
            </div>
            <asp:LinkButton ID="Btn_GoBack" runat="server" Text="<%$ Resources:Content,String1045 %>" CausesValidation="false"
                 CssClass="btn btn-primary waves-effect pull-right m-t--4px" />
        </div>
        <div class="body">
            <div class="row" id="Pnl_Heading" runat="server">
                <div class="col-xs-12 Div_OpsRow" id="Div_OpsRow" runat="server">
                    <div class="card">
                        <div class="header">
                            <h3><%= Resources.Content.GN00001320%></h3>
                        </div>
                        <div class="body">
                            <div class="row">
                                <div class="col-xs-12">
                                    <asp:Button ID="Btn_AddFTPUser" runat="server" CausesValidation="false" class="btn btn-primary waves-effect btnAction" ValidationGroup="FTPUser" Text="<%$ Resources:Content,L00125%>" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xs-12" id="Pnl_FTPUsersListing" runat="server">
                    <asp:GridView ID="Gv_FTPUsers" 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,USM0061%>" HeaderStyle-CssClass="col-xs-5" ItemStyle-CssClass="col-xs-5">
                                <ItemTemplate>
                                    <asp:Label ID="Lbl_Name" runat="server"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$ Resources:Content,SPT002257%>" HeaderStyle-CssClass="col-xs-5" ItemStyle-CssClass="col-xs-5">
                                <ItemTemplate>
                                    <asp:Label ID="Lbl_HomeDir" runat="server"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$ Resources:Content,GN0000360%>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LB_Edit" runat="server" CssClass="btn btn-primary waves-effect" CommandName="FTPEdit"
                                        Text='<%$ Resources:Content, GN0000276 %>' CausesValidation="false"></asp:LinkButton>
                                    <asp:LinkButton ID="LB_Remove" runat="server" CssClass="btn btn-primary waves-effect btnAction" CommandName="FTPRemove"
                                        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>

            <%--//Add/Edit FTP User--%>
            <div class="row" id="Pnl_AddFTPUser" runat="server">
                <div class="col-xs-12">
                    <div class="card">
                        <div class="header">
                            <h3>
                                <asp:Literal ID="Ltl_AddHeader" runat="server" Text="<%$ Resources:Content,L00125%>" EnableViewState="false" /></h3>
                        </div>
                        <div class="body">
                            <div class="row">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:Content,SPT002256%>" EnableViewState="false" />:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_FTPAName" runat="server" MaxLength="12"  TabIndex="1"></asp:TextBox>
                                            <asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ID="RequiredFieldValidator6"
                                                ControlToValidate="TxBx_FTPAName" ValidationGroup="FTPUser" Display="None"></asp:RequiredFieldValidator>
                                            <EM:FilteredTextBoxExtender ID="FTE_TxBx_FTPAName" runat="server" TargetControlID="TxBx_FTPAName"
                                                FilterType="Numbers,UppercaseLetters,LowercaseLetters,Custom" ValidChars="_.-" />
                                            <asp:RangeValidator ControlToValidate="TxBx_FTPAName" ID="RV_TxBx_FTPAName" MinimumValue="2"
                                                MaximumValue="5" runat="server" Display="None" SetFocusOnError="true"></asp:RangeValidator>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Literal7" runat="server" Text="<%$ Resources:Content,SPT002257%>" EnableViewState="false" />:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_HomeDirectory" runat="server" Width="325px" Enabled="false"
                                                TabIndex="2"></asp:TextBox>
                                            <asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ID="RequiredFieldValidator1"
                                                ControlToValidate="TxBx_HomeDirectory" ValidationGroup="FTPUser" Display="None"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-5 col-xs-12">
                                    <asp:Button ID="Btn_Browse" Text="<%$ Resources:Content,SPT002093%>" runat="server" CssClass="btn btn-primary waves-effect" CausesValidation="false" TabIndex="3" />
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Literal2" runat="server" Text="<%$ Resources:Content,GN0000569%>" EnableViewState="false" />:</label>                                    
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_Password" runat="server" TextMode="Password" TabIndex="4"></asp:TextBox>
                                          <%--  <asp:RegularExpressionValidator ID="REV_TxBx_FTPPassword" runat="server" ErrorMessage='Invalid Password.'
                                                ControlToValidate="TxBx_Password" Display="None" SetFocusOnError="True" ValidationExpression="^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$"
                                                ValidationGroup="FTPUser"></asp:RegularExpressionValidator>
                                            <asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ID="RequiredFieldValidator2"
                                                ControlToValidate="TxBx_Password" ValidationGroup="FTPUser" Display="None">
                                            </asp:RequiredFieldValidator>--%>
                                        </div>
                                    </div>
                                    <asp:CheckBox ID="CB_Show" runat="server" Text="<%$ Resources:Content,FAM0049 %>" />
                                </div>
                                <div class="col-sm-5 col-xs-12">
                                    <div class="form-group">
                                    <asp:LinkButton ID="lb_Generate" runat="server" Text="<%$ Resources:Content,SMI0195%>" CausesValidation="false" TabIndex="-1" class="btn btn-primary waves-effect"></asp:LinkButton></div>
                                    <div id="Div_PasswordPolicy" runat="server" class="help-text sm"></div>
                                    <br /><asp:Literal ID="Literal46" runat="server" Text="<%$ Resources:Content,GN00001530%>"
                                                        EnableViewState="false"></asp:Literal>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Literal11" runat="server" Text="<%$ Resources:Content,GN0001196%>" EnableViewState="false" />:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_ConfPassword" runat="server" TextMode="Password" TabIndex="5"></asp:TextBox>
                                            <asp:CompareValidator ID="CV_TxBx_ConfPassword" runat="server" SetFocusOnError="true"
                                                ErrorMessage='<%$ Resources:Content,DGN1110005 %>' ControlToCompare="TxBx_Password"
                                                ControlToValidate="TxBx_ConfPassword" Display="None" ValidationGroup="FTPUser"></asp:CompareValidator>
                                            <%--<asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ID="RequiredFieldValidator3"
                                                ControlToValidate="TxBx_ConfPassword" ValidationGroup="FTPUser" Display="None">
                                            </asp:RequiredFieldValidator>--%>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row" id="Tr_Read" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Literal12" runat="server" Text="<%$ Resources:Content,SPT002244%>" EnableViewState="false" />:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <asp:CheckBox ID="ChBx_ReadPermission" TabIndex="6" Checked="true" runat="server" Text=" " />
                                    </div>
                                </div>
                            </div>
                            <div class="row" id="Tr_Write" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Literal13" runat="server" Text="<%$ Resources:Content,SPT002245%>" EnableViewState="false" />:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <asp:CheckBox ID="ChBx_WritePermission" Checked="true" runat="server" TabIndex="7" Text=" " />
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Literal14" runat="server" Text="<%$ Resources:Content,SMI0489%>" EnableViewState="false" />:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <asp:CheckBox ID="CB_SendEmail" runat="server" TabIndex="7" Text=" " />
                                    </div>
                                </div>
                            </div>
                            <div class="row" id="Tr_SendEmail" runat="server">
                                <div class="col-sm-3 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Literal15" runat="server" Text="<%$ Resources:Content,String389%>" EnableViewState="false" />:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="Txt_EmailPassord" runat="server" TabIndex="8"></asp:TextBox>
                                            <asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ID="RFV_Txt_EmailPassord"
                                                Enabled="true" ControlToValidate="Txt_EmailPassord" ValidationGroup="FTPUser"
                                                Display="None" EnableClientScript='true'></asp:RequiredFieldValidator>
                                            <%--<asp:RegularExpressionValidator ID="REV_SendSetupEmail" runat="server" ErrorMessage='<%$ Resources:Content,DGN1110038%>'
                                                ControlToValidate="Txt_EmailPassord" Display="None" SetFocusOnError="True" ValidationExpression="<%$ Resources:MPRegex,EmailAddress %>"
                                                ValidationGroup="FTPUser" Enabled='true'></asp:RegularExpressionValidator>--%>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-12">
                                    <asp:Button class="btn btn-primary waves-effect btnAction" ID="Btn_Save" Text="<%$ Resources:Content,GN0000281%>" runat="server" ValidationGroup="FTPUser" TabIndex="9" />
                                    <asp:Button ID="Btn_Cancel" runat="server" Text="<%$ Resources:Content,GN0000572%>" class="btn btn-primary waves-effect" CausesValidation="false"
                                        TabIndex="10" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<asp:Button ID="Button1" Text="<%$ Resources:Content,SPT002093%>" runat="server" CssClass="btn btn-primary waves-effect" Style="display: none" TabIndex="3" />
<asp:Panel ID="Panel2" runat="server" CssClass="width-modal-popup-auto" Style="display: none">
    <ajax:UpdatePanel ID="update1" runat="server">
        <ContentTemplate>
            <div class="card" id="Tbl_Restore" runat="server">
                <div class="header">
                    <h3>File Browser</h3>
                </div>
                <div class="body">
                    <div class="row">
                        <div class="col-sm-3 col-xs-6">
                            <asp:Panel ID="Pnl_Tree" runat="server" Width="100%" Height="400px" BorderColor="ActiveBorder"
                                BorderStyle="Groove" ScrollBars="Auto">
                                <asp:TreeView ID="TV_Browsers" runat="server">
                                </asp:TreeView>
                            </asp:Panel>
                        </div>
                        <div class="col-sm-9 col-xs-12">
                            <asp:Panel ID="Panel1" runat="server" Height="400px" Width="100%" BorderColor="ActiveBorder"
                                BorderStyle="Groove" ScrollBars="Auto">
                                <asp:GridView ID="GV_Browsers" runat="server" AllowPaging="false" CssClass="table table-bordered table-striped table-hover"
                                    AutoGenerateColumns="false" EmptyDataText="<%$ Resources:Content,GN00001375%>"
                                    PageSize="500">

                                    <Columns>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,GN000170%>" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                            <ItemTemplate>
                                                <asp:Image ID="img_Name" runat="server" />
                                                <asp:LinkButton CausesValidation="false" ID="LB_Name" runat="server" CommandName="CName"></asp:LinkButton>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,DGN1119982%>" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                            <ItemTemplate>
                                                <asp:Label ID="Lbl_Size" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,GN0000673%>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                            <ItemTemplate>
                                                <asp:Label ID="Lbl_Type" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,SMI0439%>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                            <ItemTemplate>
                                                <asp:Label ID="Lbl_DateModified" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,GN00001496%>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                            <ItemTemplate>
                                                <asp:Label ID="Lbl_DateCreated" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </asp:Panel>
                        </div>
                    </div>
                    <div class="row" id="Tr_TextBox" runat="server">
                        <div class="col-sm-3 col-xs-12 row-label">
                            <label>
                                *
                                    <asp:Label ID="Lbl_TextItem" runat="server" Text="<%$ Resources:Content,SMI0440%>"></asp:Label></label>
                        </div>
                        <div class="col-sm-4 col-xs-12">
                            <div class="form-group">
                                <div class="form-line">
                                    <asp:TextBox ID="TxBx_Item" runat="server" ReadOnly="true" Enabled="false" ValidationGroup="HDir"></asp:TextBox>
                                    <%--<asp:RequiredFieldValidator ID="RFV_TxBx_Item" runat="server" ControlToValidate="TxBx_Item" ValidationGroup="HDir" ErrorMessage="*" SetFocusOnError="true"></asp:RequiredFieldValidator>
                        <asp:Button ID="Btn_Done" runat="server" Text="Done" SkinID="OKButton" ValidationGroup="HDir" OnClientClick="return SetHomeDir();" />--%>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-5 col-xs-12">
                            <asp:Button ID="Btn_Done" runat="server" Text="<%$ Resources:Content,GN0001184%>" class="btn btn-primary waves-effect" OnClientClick="return SetHomeDir();" />
                            <asp:Button ID="Btn_Close" CausesValidation="false" runat="server" Text="<%$ Resources:Content,GN000150%>" class="btn btn-primary waves-effect" />
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
        <Triggers>
            <ajax:AsyncPostBackTrigger ControlID="Btn_Done" />
        </Triggers>
    </ajax:UpdatePanel>

</asp:Panel>
<EM:ModalPopupExtender runat="server" ID="MPE_Browse" BackgroundCssClass="modalBackground"
    DropShadow="false" CancelControlID="Btn_Close" PopupControlID="Panel2" TargetControlID="Button1"
    OkControlID="Btn_Done">
</EM:ModalPopupExtender>

<asp:ValidationSummary ID="VS_EmailLists" runat="server" HeaderText='<%$ Resources:Content, EM000001 %>'
    ShowMessageBox="True" ShowSummary="False" ValidationGroup="FTPUser" />
<%--Resources Grid Pannel--%>
<asp:Button ID="Btn_Display" runat="server" Style="display: none;" />
<asp:Panel ID="Panel3" runat="server" BorderColor="ActiveBorder" BorderStyle="Groove"
    ScrollBars="Auto" CssClass="width-modal-popup-auto" Style="display: none">
    <EM:ResourceQuota runat="server" ID="ResourceQuotaView" />
</asp:Panel>
<EM:ModalPopupExtender runat="server" ID="MPE_Resource" BackgroundCssClass="modalBackground"
    DropShadow="false" PopupControlID="Panel3" TargetControlID="Btn_Display">
</EM:ModalPopupExtender>

<script language="javascript" type="text/javascript">

    function SetHomeDir() {
        var modalSelectedDir = document.getElementById('<%= TxBx_Item.ClientID %>');
        var HomeDir = document.getElementById('<%= TxBx_HomeDirectory.ClientID %>');
        //alert("ModelDir = " + modalSelectedDir.value);
        //alert("HomeDir = " + HomeDir.value);
        HomeDir.value = modalSelectedDir.value;
        //alert("Selected Dir = " + HomeDir.value);
        return true;
    }



    AllowArrowKeysInFilteredTextBoxExtender('<%=FTE_TxBx_FTPAName.ClientID%>');
</script>