<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Masters/AgentMaster.Master"
    CodeBehind="UploadBankCreditDtls.aspx.cs" Inherits="CasheeremitAgent.Account.UploadBankCreditDtls" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cpHead" runat="server">
    <script type="text/javascript">
        function DisplayWaiting(validationgroup) {

            if (Validate(validationgroup) == 'success') {
                setTimeout('document.images["imgLoad"].src = "../Styles/images/loading.gif"', 10);
            }
        }

        function Validate(validationgroupname) {

            if (Page_ClientValidate(validationgroupname)) {
                return 'success';
            }
        }




        function validate_ID_FileSize(source, arguments) {

            arguments.IsValid = false;
            source.className = "errMsg";

            var uploadControl = document.getElementById('<%= FileUpDoc_ID.ClientID %>');
            var filesize = '<%=ConfigurationManager.AppSettings["UploadFileSize"].ToString() %>'

            if (uploadControl.files[0].size > filesize) {
                source.innerHTML = "FileSize exceeds the limit.please try uploading smaller size files.";
                arguments.IsValid = false;
            }
            else {
                arguments.IsValid = true;
            }
        }

        window.document.title = "File Upload";
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpLyremit" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="600">
    </asp:ScriptManager>
    <div id="Div1" runat="server" class="col-md-12">
        <script type="text/javascript">
           
        </script>
        <div class="clearfix">
            &nbsp;</div>
        <div class="bluHD col-md-12">
            <i class="fa fa-money iconsize" aria-hidden="true"></i>Upload Document
        </div>
        <div id="dvUpload" runat="server" class="col-md-12 vinobox">
            <div class="col-md-6">
                <div class="row mrgBot10">
                    <div class=" col-md-4">
                        Bank ReferenceNo<span class="starRed">*</span>
                    </div>
                    <div class=" col-md-7">
                        <asp:TextBox ID="txtRefNo" CssClass="txtboxM" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="reqRefeNo" runat="server" ErrorMessage="Please enter Bank Reference No."
                            CssClass="errMsg" ControlToValidate="txtRefNo" ValidationGroup="Submit" Display="Dynamic"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="regRefNo" runat="server" ValidationGroup="Submit"
                            ControlToValidate="txtRefNo" Display="Dynamic" class="errMsg" ErrorMessage="Please enter a valid Bank Reference No"
                            ValidationExpression="^([a-zA-Z0-9]{5,50})$"></asp:RegularExpressionValidator>
                    </div>
                </div>
                <div id="divIDDoc" class="row mrgBot10" runat="server">
                    <div class=" col-md-4">
                        Deposited Amount<span class="starRed">*</span>
                    </div>
                    <div class=" col-md-7">
                        <asp:TextBox ID="txtDepAmt" CssClass="txtboxM" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="reqDepAmt" runat="server" ErrorMessage="Please enter Deposited Amount"
                            CssClass="errMsg" ControlToValidate="txtDepAmt" ValidationGroup="Submit" Display="Dynamic"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="regDepAmt" runat="server" ValidationGroup="Submit"
                            ControlToValidate="txtDepAmt" Display="Dynamic" class="errMsg" ErrorMessage="Please enter a valid Deposit Amount (Min [m] and Max [x] digit)."
                            ValidationExpression="^([0-9.]{m,x})$"></asp:RegularExpressionValidator>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="row mrgBot10">
                    <div class=" col-md-4">
                        <asp:Label ID="lblFileUpload" runat="server" Text="Upload File (Bank Reciept)"></asp:Label>
                        <span class="starRed">*</span>
                    </div>
                    <div class=" col-md-7">
                        <asp:FileUpload ID="FileUpDoc_ID" runat="server" />
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ValidationGroup="Submit"
                            ControlToValidate="FileUpDoc_ID" Display="Dynamic" class="errMsg" ErrorMessage="Please select a valid file"
                            ValidationExpression="^.*\.(jpg|JPG|jpeg|JPEG|gif|GIF|pdf|PDF|png|PNG|tif|TIF|tiff|TIFF)$"></asp:RegularExpressionValidator>
                        <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="FileUpDoc_ID"
                            ClientValidationFunction="validate_ID_FileSize" Font-Size="X-Small" Display="Dynamic"
                            ValidationGroup="Submit"></asp:CustomValidator>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Please Select File."
                            CssClass="errMsg" ControlToValidate="FileUpDoc_ID" ValidationGroup="Submit" Display="Dynamic"></asp:RequiredFieldValidator>
                    </div>
                    <div id="div3" class="span12 mrg5-TB" runat="server" visible="false">
                        <span>Please upload your <b>| ID Proof :
                            <asp:Label ID="Label2" runat="server" Text="National Insurance Number"></asp:Label>
                            |</b> choosen at the time of registration</span>
                    </div>
                </div>
                <%--<div id="div2" class="row mrgBot10" runat="server">
                    <div class=" col-md-3">
                        <span class="starRed">*</span>
                    </div>
                </div>--%>
            </div>
            <br />
            <br />
            <div class="clearfix">
                &nbsp;</div>
            <div class="clearfix">
                &nbsp;</div>
            <div>
                <div class=" col-md-10">
                    <span><b style="font-size: 13px;">Note:</b>
                        <ul style="padding: 10px; font-size: 11px; color: Orange;">
                            <br />
                            <li><b>Upload file formats allowed:</b> JPEG/JPG/GIF/PDF/PNG/TIF/TIFF with a max file
                                size of <b>2 MB</b>.</li>
                        </ul>
                    </span>
                </div>
            </div>
            <div class="clearfix">
                &nbsp;</div>
            <div class="col-md-7">
                <asp:Button ID="btnSubmit" runat="server" CssClass="btnB fltR" Text="Submit" OnClick="btnSubmit_click" OnClientClick="DisplayWaiting('Submit');"
                    ValidationGroup="Submit" />
            </div>
            <div class="clrfx">
                &nbsp;</div>
        </div>
    </div>
    <div id="dvProgressbar">
        <asp:Button runat="server" ID="Button1" Style="display: none" />
        <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none">
            <div class="modal1">
                <div class="center1">
                    <!-- Start -->
                    <img id="imgLoad" alt="Please wait....." src="../Styles/images/loading.gif" />
                    <!-- End -->
                    <asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" TargetControlID="Button1"
                        PopupControlID="Panel1" BackgroundCssClass="modalBackground" DropShadow="false" />
                </div>
            </div>
        </asp:Panel>
    </div>
</asp:Content>
