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


<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">
    <!--[if gt IE 5.5]>
	<link rel="stylesheet" type="text/css" href="../css/ProgressforIE.css" />	
<![endif]-->
    <%--</script>--%>
    <div class="content-header">
        <h1 style="background-image: url('../dist/img/leave-type.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lbl_Header" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <asp:UpdatePanel ID="upLeave" runat="server">
            <ContentTemplate>
                <asp:Panel ID="pnlProgress" runat="server" Style="display: none;">
                    <asp:Panel ID="pnlLoading" runat="server" HorizontalAlign="center">
                        <div class="InsideProgressBar">
                            <div class="row" style="margin-top: 10px">
                                <img src="../dist/img/logo-Progress.png" />
                            </div>
                            <div class="row" style="min-width: 280px">
                                <img src="../dist/img/default.gif" style="width: 100px" />
                            </div>
                            <div class="row" style="margin-bottom: 10px">
                                <asp:Label ID="lblLoading" runat="server" ForeColor="black" Style="text-align: center"
                                    Text="Please Wait..." Font-Bold="true" Font-Size="12px" Font-Italic="true" Font-Family="Arial"></asp:Label>
                            </div>
                            <div class="clear clearfix">
                            </div>
                        </div>
                    </asp:Panel>
                </asp:Panel>
                <asp:HiddenField ID="hdnProgress" runat="server" />
                <cc1:ModalPopupExtender ID="popupProgress" runat="server" TargetControlID="hdnProgress"
                    BackgroundCssClass="ModalPopup" PopupControlID="pnlProgress" BehaviorID="popupProgress">
                </cc1:ModalPopupExtender>
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="btn_save" />
                <asp:PostBackTrigger ControlID="btnTest" />
            </Triggers>
        </asp:UpdatePanel>
        <div class="inr-ftr">
            <div class="row">
                <div class="col-sm-12">
                    <div class="pull-right">
                        <h6>
                            <span style="color: Red">|</span><span style="padding-left: 10px; padding-right: 10px"><asp:Label
                                ID="lbl_Man" runat="server"></asp:Label>
                                (5 No.)</span>
                        </h6>
                    </div>
                </div>
            </div>
        </div>
        <div class="emp-filter">
            <div class="form-horizontal">
                <div class="row">
                    <div class="col-md-12">
                        <div class="row form-group">
                            <div class="col-md-2">
                                <asp:Label ID="lblhostName" runat="server" Text="Hostname"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txthostName" runat="server" CssClass="form-control man-dat" MaxLength="100"></asp:TextBox>
                            </div>
                            <div class="col-md-1">
                            </div>
                            <div class="col-md-2">
                                <asp:Label ID="Label1" runat="server" Text="Port"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtPort" onkeypress="return numbers_dot(event,this)" runat="server" CssClass="form-control man-dat" MaxLength="5"></asp:TextBox>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-2">
                                <asp:Label ID="Label2" runat="server" Text="Service Name"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtServiceName" runat="server" CssClass="form-control man-dat" MaxLength="100"></asp:TextBox>
                            </div>
                            <div class="col-md-1">
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-2">
                                <asp:Label ID="Label3" runat="server" Text="Username"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtUserName" runat="server" CssClass="form-control man-dat" MaxLength="100"></asp:TextBox>
                            </div>
                            <div class="col-md-1">
                            </div>
                            <div class="col-md-2">
                                <asp:Label ID="Label4" runat="server" Text="Password"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtPwd" TextMode="Password" MaxLength="100" runat="server" CssClass="form-control man-dat"></asp:TextBox>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-6"></div>
                            <div class="col-md-3">
                                <asp:CheckBox ID="chkboxShowpwd" Text="Show Password" runat="server"
                                    CssClass="checkbox checkbox-primary" onclick="showPassword();" />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-5">
                            </div>
                            <div class="col-md-6">
                                <div class="pull-right-button">
                                    <asp:LinkButton ID="btn_save" CssClass="btn save-btn fa-floppy-o" runat="server" OnClientClick="if(ValidateControl()) $find('popupProgress').show();else return false;" OnClick="btn_save_Click" />
                                    <asp:LinkButton ID="btnTest" CssClass="btn save-btn" Text="Test Connection" runat="server" OnClick="btnTest_Click" OnClientClick="if(ValidateControl()) $find('popupProgress').show();else return false;"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        function showPassword() {
            var x;
            x = document.getElementById("ctl00_BodyContentPH_txtPwd");
            if (x.type === "password") {
                x.type = "text";
            } else {
                x.type = "password";
            }
        }
        var MaxLength = "Maximum length is ";
        function MaxLengthh(maxLength) {
            MaxLength = maxLength;
        }

        function ValidateControl() {

            if (document.getElementById('ctl00_BodyContentPH_txthostName').value == "") {
                alert("Enter Hostname");
                document.getElementById('ctl00_BodyContentPH_txthostName').focus();
                return false;
            }
            if (document.getElementById('ctl00_BodyContentPH_txtPort').value == "") {
                alert("Enter Port value");
                document.getElementById('ctl00_BodyContentPH_txtPort').focus();
                return false;
            }
            if (document.getElementById('ctl00_BodyContentPH_txtServiceName').value == "") {
                alert("Enter Service name");
                document.getElementById('ctl00_BodyContentPH_txtServiceName').focus();
                return false;
            }
            if (document.getElementById('ctl00_BodyContentPH_txtUserName').value == "") {
                alert("Enter Username");
                document.getElementById('ctl00_BodyContentPH_txtUserName').focus();
                return false;
            }
            if (document.getElementById('ctl00_BodyContentPH_txtPwd').value == "") {
                alert("Enter Password");
                document.getElementById('ctl00_BodyContentPH_txtPwd').focus();
                return false;
            }
            return confirm("Are your sure to save Oracle Database Configuration?")
        }
        function number_dot(e, ctrl) {
            dec_limit = arguments[1];
            var keycode;
            if (window.event) keycode = window.event.keyCode;
            else if (e) keycode = e.which;
            else return true;
            if ((keycode == 8) || (keycode == 0)) {
                return true;
            }
            val = ctrl.value;
            dot_index = val.indexOf('.');
            if (dot_index != -1) {
                dec_pts = (val.length - dot_index);
                if (!dec_limit) dec_limit = 3; else dec_limit = dec_limit + 1;
            }
            if (document.selection) {
                var selection = document.selection.createRange();
                var selected_text = selection.text;
            }
            else if (document.getSelection) {
                var start = ctrl.selectionStart;
                var end = ctrl.selectionEnd;
                var selected_text = ctrl.value.substring(start, end);
            }
            if ((val.length == 0 || selected_text != "") && (keycode == 46))	// || keycode==48
            {
                return false;
            }
            else if (dot_index != -1 && keycode == 46) {
                return false;
            }
            else if (!(keycode >= 48 && keycode <= 58) && (keycode != 13) && (keycode != 46) && (keycode = 36) && (keycode != 8) && (keycode != 0) && (keycode = 45) && (keycode = 47)) {
                return false;
            }
            else return true;
        }
        function numbers_dot(e, ctrl) {
            dec_limit = arguments[1];
            var keycode;
            if (window.event) keycode = window.event.keyCode;
            else if (e) keycode = e.which;
            else return true;
            if ((keycode == 8) || (keycode == 0)) {
                return true;
            }
            val = ctrl.value;
            dot_index = val.indexOf('.');
            if (dot_index != -1) {
                dec_pts = (val.length - dot_index);
                if (!dec_limit) dec_limit = 3; else dec_limit = dec_limit + 1;
            }
            if (document.selection) {
                var selection = document.selection.createRange();
                var selected_text = selection.text;
            }
            else if (document.getSelection) {
                var start = ctrl.selectionStart;
                var end = ctrl.selectionEnd;
                var selected_text = ctrl.value.substring(start, end);
            }
            if ((val.length == 0 || selected_text != "") && (keycode == 46))	// || keycode==48
            {
                return false;
            }
            else if (dot_index != -1 && keycode == 46) {
                return false;
            }
            else if (!(keycode >= 48 && keycode <= 57) && (keycode != 13) && (keycode != 46) && (keycode = 36) && (keycode != 8) && (keycode != 0)) {
                return false;
            }
            else return true;
        }
    </script>

</asp:Content>
