<%@ page language="C#" masterpagefile="~/MasterFile/TimeCheck.master" autoeventwireup="true" inherits="System_Settings_SystemSetting_MailConfiguration, App_Web_buswflca" %>

<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">

    <script language="javascript" type="text/javascript">
        var EnterAdminEmailId = "Enter Admin mail Id";
        var EnterIPAddress = "Enter IP Address / Host Name";
        var EnterPortNumber = "Enter Port Number";
        var Areyousuretosave = "Are you sure, to save?";
        function SetAlertMessages(enterAdminEmailId, enterIPAddress, enterPortNumber, areyousuretosave) {
            EnterAdminEmailId = enterAdminEmailId;
            EnterIPAddress = enterIPAddress;
            EnterPortNumber = enterPortNumber;
            Areyousuretosave = areyousuretosave;
        }
        function AuthenticateUserEnableDisable(btnValue) {
            if (btnValue == '1') {
                document.getElementById('ctl00_BodyContentPH_txtUserName').disabled = false;
                document.getElementById('ctl00_BodyContentPH_txtPassword').disabled = false;
                document.getElementById('ctl00_BodyContentPH_txtUserName').style.background = "#ffffff";
                document.getElementById('ctl00_BodyContentPH_txtPassword').style.background = "#ffffff";
            }
            else {
                document.getElementById('ctl00_BodyContentPH_txtUserName').disabled = true;
                document.getElementById('ctl00_BodyContentPH_txtPassword').disabled = true;
                document.getElementById('ctl00_BodyContentPH_txtUserName').style.background = "#d3dbe7";
                document.getElementById('ctl00_BodyContentPH_txtPassword').style.background = "#d3dbe7";
                document.getElementById('ctl00_BodyContentPH_txtUserName').value = '';
                document.getElementById('ctl00_BodyContentPH_txtPassword').value = '';
            }
        }
        function MailValidation() {
            if (document.getElementById('ctl00_BodyContentPH_txtMailId').value == '') {
                alert(EnterAdminEmailId);
                return false;
            }
            else if (document.getElementById('ctl00_BodyContentPH_txtIPAddress').value == '') {
                alert(EnterIPAddress);
                return false;
            }
            else if (document.getElementById('ctl00_BodyContentPH_txtSMTPPort').value == '') {
                alert(EnterPortNumber);
                return false;
            }
            else {
                return confirm(Areyousuretosave);
            }
        }

    </script>

    <div class="content-header">
        <h1 style="background-image: url('../dist/img/MailConfiguration.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lbl_Header" runat="server" Text="Mail Configuration"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div class="inr-ftr">
            <div class="row">
                <div class="col-sm-6 col-xs-5">
                </div>
                <div class="col-sm-6 col-xs-7">
                    <div class="leave-manda">
                        <span>|</span>
                        <asp:Label ID="Label1" Visible="True" runat="server" Text="Mandatory" ForeColor="black"></asp:Label>
                        (3 No.)
                    </div>
                </div>
            </div>
        </div>
        <div class="emp-filter">
            <div class="row">
                <div class="col-md-12">
                    <div class="form-horizontal">
                        <div class="row form-group" style="display: none">
                            <div class="col-md-12">
                                *
                        <asp:Label ID="lbl_IndicatesMandatoryFields" runat="server" Text="Indicates mandatory fields"></asp:Label>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-3">
                                <asp:Label ID="lblMailId" runat="server" Text="Admin Mail Id"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtMailId" runat="server" CssClass="form-control man-dat"
                                    onCut="return false" onDrop="return false" MaxLength="50"></asp:TextBox>
                                <asp:RegularExpressionValidator ID="RegVtxtMailId" runat="server" ErrorMessage="Enter Valid Email Id"
                                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="txtMailId"
                                    Display="None" SetFocusOnError="True">*</asp:RegularExpressionValidator>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-3">
                                <asp:Label ID="lblServerIP" runat="server" Text="Server IP/Host Name"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtIPAddress" runat="server" CssClass="form-control man-dat"
                                    onCut="return false" onDrop="return false" MaxLength="30"></asp:TextBox>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-3">
                                <asp:Label ID="lblSMTPPort" runat="server" Text="SMTP Port"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtSMTPPort" runat="server" CssClass="form-control man-dat"
                                    onCut="return false" onDrop="return false" MaxLength="5"></asp:TextBox>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-3">
                                <asp:Label ID="lblSSLEnable" runat="server" Text="SSL Enable"></asp:Label>
                            </div>
                            <div class="col-md-3 pad-left-0px">
                                <div class="col-md-4">
                                    <asp:RadioButton ID="rbtnSSLYes" runat="server" CssClass="radio radio-primary" GroupName="SSL"
                                        Text="Yes" />
                                </div>
                                <div class="col-md-4">
                                    <asp:RadioButton ID="rbtnSSLNo" runat="server" GroupName="SSL" Text="No" CssClass="radio radio-primary" />
                                </div>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-3">
                                <asp:Label ID="lblAuthentication" runat="server" Text="Authentication"></asp:Label>
                            </div>
                            <div class="col-md-3 pad-left-0px">
                                <div class="col-md-4">
                                    <asp:RadioButton ID="rbtnAuthenticationYes" GroupName="Authentication" runat="server"
                                        Text="Yes" onclick="return AuthenticateUserEnableDisable('1');" CssClass="radio radio-primary" />
                                </div>
                                <div class="col-md-4">
                                    <asp:RadioButton ID="rbtnAuthenticationNo" GroupName="Authentication" runat="server"
                                        Text="No" onclick="return AuthenticateUserEnableDisable('0');" CssClass="radio radio-primary" />
                                </div>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-3">
                                <asp:Label ID="lblUserName" runat="server" Text="User Name"></asp:Label><span style="color: #ff0000"></span>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtUserName" runat="server" CssClass="form-control"
                                    onCut="return false" onDrop="return false" MaxLength="30"></asp:TextBox>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-3">
                                <asp:Label ID="lblPassword" runat="server" Text="Password"></asp:Label><span style="color: #ff0000"></span>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtPassword" TextMode="Password" runat="server"
                                    CssClass="form-control" onCut="return false" onDrop="return false" MaxLength="30"
                                    onkeypress="return character_number_nospace_pwd(event,this)"></asp:TextBox>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-3">
                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
                                    ShowSummary="False" />
                            </div>
                            <div class="col-md-3">
                                <div class="pull-right-button">
                                    <asp:LinkButton ID="btn_Add" CssClass="btn save-btn fa-floppy-o" runat="server" OnClick="btn_Add_Click"
                                        OnClientClick="javascript:if(Page_ClientValidate()) return MailValidation();return false;"
                                        Style="margin-left: 0px" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
