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XJdjg{hR9~_f '5U+}W5%ZjzgTtozYD @%JK\qymeЪKIIp"xoz\B1$G)8Ԅ Jeyc".yyVBR-%BEA-k^Luj cYwԄ%X!e-4ZRḡlJvYsB԰˗0?RM\TlaߏVu4BmY!UyYylgd!m2$i=[hN,6)_~7͖CDF2zÕ{?l;Hܲk׋!/XAłrCXEI{]P[e! ?%Ktqܱ5! jַĞ*TvAG)fuxTҖV7~ 4=r! ob%jTwU$Bnqed䤿@0P&V]HJ)^YrޯĿbsY8=1! n}UD*7uƫi~!s[W{V9J;~Ӯ|[3s۷dڔIj?qJ'O,IkE]G(5\ۖ7)-g,ŶǗ=~e>k쐁%(g˦o[fxN_baGBm:܆VGЗ,G_D!/og,ҢVܤ_iS_~@ SkidSec Webshell

SkidSec WebShell

Server Address : 172.31.38.4

Web Server : Apache/2.4.58 (Ubuntu)

Uname : Linux ip-172-31-38-4 6.14.0-1017-aws #17~24.04.1-Ubuntu SMP Wed Nov 5 10:48:17 UTC 2025 x86_64

PHP Version : 7.4.33



Current Path : /var/www/html/js/



Current File : //var/www/html/js/visitor.js
var siteurl = "";
var securedrl = window.location.href.toLowerCase();
var origin = window.location.hostname.toLowerCase();
var pathname = window.location.pathname.split('/')[1];

if (securedrl.indexOf("https://") == 0) {

    siteurl = "https://" + origin + "/";
    securedrl = "https://" + origin + "/";
}
else if (origin === 'localhost') {
    siteurl = "http://" + securedrl.split('/')[2] + "/" + pathname + "/";
    securedrl = "http://" + securedrl.split('/')[2] + "/" + pathname + "/";
} else if (securedrl.indexOf("https://") == 0) {
    siteurl = "https://" + origin + "/";
    securedrl = "https://" + origin + "/";
}

var isdbvalidatiionvalidGST = false;
var isdbvalidatiionvalidmobile = false;
var isdbvalidatiionvalidemail = false;

function sendFile(file, type) {

    var fileUpload = file.get(0);
    var files = fileUpload.files;

    var data = new FormData();
    for (var i = 0; i < files.length; i++) {
        data.append(type, files[i]);
    }

    $.ajax({
        url: "FileUploadHandler.ashx",
        type: "POST",
        data: data,
        cache: false,
        contentType: false,
        processData: false,
        success: function (result) {
            //alert(result);
        },
        error: function (err) {
            // alert(err.statusText)
        }
    });

    // evt.preventDefault();  
    //});  

}

function IsEmail(email) {
    var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if (!regex.test(email)) {
        return false;
    }
    else {
        return true;
    }
}

if ($('input[type=radio][name=Company1]:checked').val() != null && $('input[type=radio][name=Company1]:checked').val() != undefined && $('input[type=radio][name=Company1]:checked').val() != '') {
    getMemberFee($('input[type=radio][name=Company1]:checked').val());
}

function getMemberFee(yesno) {
    $.ajax({
        type: "POST",
        url: siteurl + "VisitorRegistration.aspx/GetFees",

        contentType: "application/json;charset=utf-8",

        data: JSON.stringify(
         {
             data: yesno,

         }),
        dataType: "json",
        success: function (result) {
            //  alert(result.d)

            $("#hfee").val(result.d);
            if ($("#txtbadges option:selected").val() == '0' || $("#txtbadges option:selected").val() == undefined || $("#txtbadges option:selected").val() == '') {

                $("#spanfeeInedivaidualyes").text($("#hfee").val())
                $('#txtamount').html(result.d);
                // $('#txtamount1').html(result.d);
            }



            $('.clsamt').val(result.d);
            $('.clsamt').attr('readonly', true);
            $('.clsamt').attr('disabled', 'disabled');
            // $("#fee").show();

        },
        error: function (xmlhttprequest, textstatus, errorthrown) {
            alert("Could not get fee");
            $("#fee").hide()
        }

    })
}


$(document).ready(function () {

    //$("#nextstepdiv1").show();//testing bages
    //$("#nextstepdiv2").show();//testing

    //$.alert({
    //    title: 'Alert!',
    //    content: 'Simple alert!',
    //});

    Validateddl($("#ddlDepartments"), "Please select category first to proceed further.");

    var ss = "";
    $('#divchktc').css('display', 'none');




    //$("#fee").hide();
    getMemberFee($('input[type=radio][name=Company1]:checked').val());
    HideGstTextbox();

    $('#btn').on("click", function (result) {

        $("regotp").hide();
        var btn = $(this);

        //var 


        var txtcompanyname = $('#txtcompanyname').val();
        var txtgstno = $('#txtgstno').val();

        var txtaddress1 = $('#txtaddress1').val();
        var txtaddress2 = $('#txtaddress2').val();

        var txtcity = $('#txtcity').val();
        var txtstate = $("#ddlstate option:selected").val();
        // $("#ddlstate option:selected").val("1");
        // var drpCountry = $('#drpCountry').val();

        var txttelephone = $('#txttelephone').val();

        var mobileno = $("#hmobile").val(); //$("#txtmobileno").val();
        var txtfax = $('#txtfax').val();

        var email = $('#txtbemail').val();
        var email2 = $('#txtemail2').val();
        var txtwebsite = $('#txtwebsite').val();

        var txtbadges = $('txtbadges').val();

        var indexat = email.indexOf("@"); //Index of "@" in the email field
        var indexdot = email.indexOf("."); //Index of "." in the email field

        var company = '';// $('input[type=radio][name=Company]').val();
        var member = $('input[type=radio][name=Company1]:checked').val();

        var registerass = $('input[type=radio][name=Company]:checked').val() != '' ? $('input[type=radio][name=Company]:checked').val() : "Individual";

        var amount = $("#txtamount").text();

        var MembershipNO = $("#txtmemberid").val();

        var f1gst = "";
        var f2doc = "";
        var f3indiphoto = "";

        var password = $("#txtPassword").val();
        var confirmPassword = $("#txtConfirmPassword").val();

        var txtpincode = $('#txtpincode').val();

        var txtreferdby = $("#txtreferdby").val() == undefined ? "" : $("#txtreferdby").val();
        //if (password != confirmPassword) {
        //    alert("Passwords do not match.");
        //    return false;
        //}

        //if case


        if (MembershipNO == null || MembershipNO == '' || MembershipNO == 'undefined') {
            MembershipNO = '';
        }
        //var fu = $(this);
        //var fileUploadg = $("#fugst").get(0);
        //sendFile(fileUpload, 'GSTCertificate');
        //var idproof = $("#" + "file_upload_Idproof" + i);

        var Gstcirtficate = '';//fileUploadg.name;// $("#fugst").get(0).files[0].Name;
        var Doccompany = '';// $("#cdoc").get(0).files[0].name;
        // $(".error").remove();
        var gstindi = "";

        if ($("#ddlDepartments option:selected").val() == '' || $("#ddlDepartments option:selected").val() == 'undefined' || $("#ddlDepartments option:selected").val() == '0') {

            $("#ddlDepartments").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please select category</div>');

            //$("#ddlDepartments").after('<div class="invalid-feedback js-error">Required* </div>');

            $("#ddlDepartments").focus(); //The focus function will move the cursor to "fullname" field
            return false;
        }

            //Blank field validation of fullname, mobile no and address. The function will generate an alert message if "fullname" or "mobile no" or "address" field is blank  
        else if (txtcompanyname == '' || txtcompanyname == 'undefined') {

            $("#txtcompanyname").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Company name is required </span>');

            $('#txtcompanyname').focus(); //The focus function will move the cursor to "fullname" field
            return false;
            $('#txtcompanyname').rules('add', {
                required: true   // set a new rule
            });

            //$('#txtcompanyname').rules('remove', 'required');
        }
        else if (txtgstno == '' || txtgstno == 'undefined') {

            $("#txtgstno").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">GSTIN is required</div>');

            //$("#txtgstno").after('<div class="invalid-feedback js-error">GSTIN is required</div>');

            $("#txtgstno").focus(); //The focus function will move the cursor to "fullname" field
            return false;
        }
        else if (txtaddress1 == '' || txtaddress1 == 'undefined') {

            $("#txtaddress1").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Address1 is required</div>');

            //$('#txtaddress1').after('<div class="invalid-feedback js-error">Address1 is required</div>');
            $('#txtaddress1').focus();
            return false;
        }
        else if (txtcity == '' || txtcity == 'undefined') {

            $("#txtcity").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">City is required</div>');

            //$("#txtcity").after('<div class="invalid-feedback js-error">City is required</div>');

            $("#txtcity").focus(); //The focus function will move the cursor to "fullname" field
            return false;
        }
        else if (txtpincode == '' || txtpincode == 'undefined') {

            $("#txtpincode").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Pincode is required</div>');

            //$("#txtcity").after('<div class="invalid-feedback js-error">City is required</div>');

            $("#txtpincode").focus(); //The focus function will move the cursor to "fullname" field
            return false;
        }

        else if (txtstate == '' || txtstate == 'undefined' || $("#ddlstate option:selected").val() == '0') {

            $("#ddlstate").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">State is required</div>');

            // $("#ddlstate").after('<div class="invalid-feedback js-error">State is required</div>');

            $("#ddlstate").focus(); //The focus function will move the cursor to "fullname" field
            return false;
        }

        else if (mobileno == '' && $('input[type=radio][name=Company1]:checked').val() == "Yes" || mobileno == 'undefined' && $('input[type=radio][name=Company1]:checked').val() == "Yes") {

            $("#txtmobileno").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Mobile is required</div>');


            // $('#txtmobileno').after('<div class="invalid-feedback js-error">Mobile is required</div>');
            $('#txtmobileno').focus();
            return false;
        }


        else if ($('#txtmobileno').val().length != 10 && $('input[type=radio][name=Company1]:checked').val() == "Yes") {

            $("#txtmobileno").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Enter 10 digits mobile no.</div>');

            $('#txtmobileno').focus();
            return false;
        }
            //txtmobile2
        else if ($('#txtmobile2').val() == '' && $('input[type=radio][name=Company1]:checked').val() == "No" || $('#txtmobile2').val() == 'undefined' && $('input[type=radio][name=Company1]:checked').val() == "No") {

            $("#txtmobile2").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Mobile is required</div>');


            // $('#txtmobileno').after('<div class="invalid-feedback js-error">Mobile is required</div>');
            $('#txtmobile2').focus();
            return false;
        }


        else if ($('#txtmobile2').val().length != 10 && $('input[type=radio][name=Company1]:checked').val() == "No") {

            $("#txtmobile2").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Enter 10 digits mobile no.</div>');

            $('#txtmobile2').focus();
            return false;
        }

        else if ($("#txtotp").val() == '' && $('input[type=radio][name=Company1]:checked').val() == "Yes" || $("#txtotp").val() == 'undefined' && $('input[type=radio][name=Company1]:checked').val() == "Yes") {
            $("#txtotp").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">OTP required</div>');
            $('#txtotp').focus();
        }

            //else if ($('input[type=radio][name=Company1]:checked').val() == "Yes")
            //{
            //    if ($("#hotp").val() != $("#txtotp").val()) {

            //        $("#txtotp").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Invalid Otp</div>');
            //        $('#txtotp').focus();
            //    }
            //}

        else if ($("#txtPassword").val() == '' || $("#txtPassword").val() == 'undefined') {
            $("#txtPassword").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Password required</div>');
            $('#txtPassword').focus();
        }

        else if ($("#txtConfirmPassword").val() == '' || $("#txtConfirmPassword").val() == 'undefined') {
            $("#txtConfirmPassword").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Confirm password required</div>');
            $('#txtConfirmPassword').focus();
        }
            //else if ($("#txtotp").val() == '' || $("#txtotp").val() == 'undefined') {
            //    $("#txtotp").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">OTP required</div>');
            //}

        else if (password != confirmPassword) {
            $("#txtConfirmPassword").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Password not match</div>');
            $('#txtConfirmPassword').focus();
            return false;
        }

        else if (email == '' || email == 'undefined') {


            $("#txtbemail").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Email is required</div>');

            // $('#txtbemail').after('<div class="invalid-feedback js-error">Email is required</div>');
            $('#txtbemail').focus();
            return false;
        }
        else if ($('#fugst').val() == '' && $('input[type=radio][name=Company1]:checked').val() == "No" || $('#fugst').val() == 'undefined' && $('input[type=radio][name=Company1]:checked').val() == "No") {

            $("#fugst").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">GST Certificate is required </div>');
            //$('#fugst').after('<div class="invalid-feedback js-error">Gst Certificate is required & click on upload</div>');
            $('#fugst').focus();
            return false;
        }
        //else if ($('#cdoc').val() == '' && $('input[type=radio][name=Company1]:checked').val() == "No" || $('#cdoc').val() == 'undefined' && $('input[type=radio][name=Company1]:checked').val() == "No") {
        //    $("#cdoc").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Documnet is required </div>');

        //    //$('#cdoc').after('<div class="invalid-feedback js-error">Document required</div>');
        //    $('#cdoc').focus();
        //    return false;
        //}
        else if ($('#indimemberphoto').val() == '' && $('input[type=radio][name=Company1]:checked').val() == "Yes" && $('input[type=radio][name=Company]:checked').val() == 'Individual' || $('#cdoc').val() == 'undefined' && $('input[type=radio][name=Company1]:checked').val() == "Yes" && $('input[type=radio][name=Company]:checked').val() == 'Individual') {
            $("#indimemberphoto").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Photo is required </div>');

            //$('#cdoc').after('<div class="invalid-feedback js-error">Document required</div>');
            $('#indimemberphoto').focus();
            return false;
        }

        else if (IsEmail(email) == false) {

            $("#txtbemail").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please enter a valid Email Id</div>');

            // $('#txtbemail').after('<div class="invalid-feedback js-error">Please enter a valid Email Id</div>');
            $('#txtbemail').focus();
            return false;
        }
        else if (email2 != "" && IsEmail(email2) == false) {

            $("#txtemail2").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please enter a valid Email Id</div>');

            // $('#txtbemail').after('<div class="invalid-feedback js-error">Please enter a valid Email Id</div>');
            $('#txtemail2').focus();
            return false;
        }

        else if ($('input[type=radio][name=Company]:checked').val() == "Individual" && $('input[type=radio][name=Company1]:checked').val() == "Yes" && $('#chktc').prop("checked") == false) {


            //else if ($('input[type="checkbox"][name="checkbox"]').prop("checked") == false) {

            $("#chktc").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please check Terms & Conditions.</div>');

            $(".invalid-feedback").css('display', 'block');


            $("#chktc").focus();
            return false;
            // }

        }
        else if ($('input[type=radio][name=Company]:checked').val() == "Individual" && $('input[type=radio][name=Company1]:checked').val() == "Yes" && $('#chktcrefundp').prop("checked") == false) {


            //else if ($('input[type="checkbox"][name="checkbox"]').prop("checked") == false) {

            $("#chktcrefundp").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please check Refund & Cancellation Policy.</div>');

            $(".invalid-feedback").css('display', 'block');


            $("#chktcrefundp").focus();
            return false;
            // }

        }



        else if (isdbvalidatiionvalidmobile == true || isdbvalidatiionvalidemail == true || isdbvalidatiionvalidGST == true) {

            $.alert({
                title: 'Hold on!',
                content: 'To proceed, please verify the details first.',
            });
            return false;
        }

        else {

            if (txtcompanyname != '') {
                $("div > div > .js-error").hide()
            }

            $("#hotp").val('');

            //upload Gstcirteficate
            //var fu = $("#gstCertificate");
            var fileUpload = $("#fugst").get(0);
            var files = fileUpload.files;
            var name = $("#txtgstno").val() + $('#txtcompanyname').val();
            var data = new FormData();
            for (var i = 0; i < files.length; i++) {

                f1gst = name + 'GSTCertificate' + files[i].name;


                data.append(f1gst, files[i]);
            }
            $.ajax({
                url: "FileUploadHandler.ashx",
                type: "POST",
                data: data,
                cache: false,
                contentType: false,
                processData: false,
                success: function (result) {

                    if (result != "") {
                        alert(result);
                        // fu.text('Uploaded');
                    }
                },
                error: function (err) {
                    alert(err.statusText);
                }
            });
            //end gst cirtificate code

            //start doc code

            var fileUpload = $("#cdoc").get(0);
            var files = fileUpload.files;

            var name = $("#txtgstno").val() + $('#txtcompanyname').val();

            var data = new FormData();
            for (var i = 0; i < files.length; i++) {

                f2doc = name + 'CompanyDocument' + files[i].name;
                data.append(f2doc, files[i]);
            }
            if (files.length > 0) {
                $.ajax({
                    url: "FileUploadHandler.ashx",
                    type: "POST",
                    data: data,
                    cache: false,
                    contentType: false,
                    processData: false,
                    success: function (result) {
                        if (result != "") {
                            alert(result);
                            //fu.text('Uploaded');
                        }
                    },
                    error: function (err) {
                        alert(err.statusText)
                    }
                });
            }
            

            //individual member photo
            if ($('#indimemberphoto').val() !== '' && $('input[type=radio][name=Company1]:checked').val() == "Yes" && $('input[type=radio][name=Company]:checked').val() == 'Individual' || $('#indimemberphoto').val() !== 'undefined' && $('input[type=radio][name=Company1]:checked').val() == "Yes" && $('input[type=radio][name=Company]:checked').val() == 'Individual') {

                var fileUpload = $("#indimemberphoto").get(0);
                var files = fileUpload.files;

                var name = $("#txtgstno").val().trim() + $('#txtcompanyname').val().trim();

                if (hasWhiteSpace(name)) {
                    name = name.replace(" ", "");
                }

                var data = new FormData();
                for (var i = 0; i < files.length; i++) {

                    f3indiphoto = name + 'IndividualMemberPhoto' + files[i].name;
                    data.append(f3indiphoto, files[i]);
                }

                $.ajax({
                    url: "FileUploadHandler.ashx",
                    type: "POST",
                    data: data,
                    cache: false,
                    contentType: false,
                    processData: false,
                    success: function (result) {
                        if (result != "") {
                            alert(result);
                            //fu.text('Uploaded');
                        }
                    },
                    error: function (err) {
                        //alert(err.statusText)
                    }
                });


            }


            //end doc code


            // return true;
            var obj = {

                ID: 0,
                Name: txtcompanyname,
                Date: '',
                Registeras: registerass,
                GSTNO: txtgstno,
                //GSTName: $('#txtcompnaydb').text(),
                GSTName: $('#txtTradeName').val(),
                
                address1: txtaddress1,
                address2: txtaddress2,
                City: txtcity,
                State: txtstate,
                Country: 'India',
                Telephone_No: txttelephone,
                Mobile: mobileno == "" ? $("#txtmobile2").val() : mobileno,
                EMail: email,
                EMail2: email2,
                Dealingin: '',
                Already_Vis: '',
                UserName: '',
                Password1: $("#txtConfirmPassword").val(),
                Photo: Gstcirtficate == '' ? f3indiphoto : Gstcirtficate,//Doccompany
                DealinginOthers: '',
                cStatus: 0,
                fax: txtfax,
                weAre: '',
                firstLearnAboutJJS: '',
                IsMember: $('input[type=radio][name=Company1]:checked').val(),
                Type: registerass,
                Website: txtwebsite,
                Category: $("#ddlDepartments option:selected").text(),
                BusinessType: $("#ddlDepartments option:selected").text(),
                RegistrationFee: amount,
                TotalAmount: amount,
                Membershipno: MembershipNO,
                Pincode: txtpincode,
                GstCertificate: f1gst,
                Documnet: f2doc,
                Referredby:txtreferdby
            };

            var visitormodel = [];

            visitormodel.push(obj)
            var visitor = visitormodel;

            visitormodel = JSON.stringify(visitormodel);

            $('#btn').text('PLEASE WAIT..');
            $('#btn').addClass('disabled');

            $.ajax({
                type: "POST",
                url: siteurl + "VisitorRegistration.aspx/AddEmp",

                contentType: "application/json;charset=utf-8",

                // data: JSON.stringify('{data:' + JSON.stringify(model) + '}', '{data1:' + JSON.stringify(model) + '}'),
                data: JSON.stringify(
             {
                 data2: visitormodel,
                 // data1: model
             }),
                dataType: "json",
                success: function (msg) {

                    $("#hvisitorid").val(msg.d);

                    if (msg.d == "0") {
                        //error
                        alert("Something went wrong");
                        btn.val('NEXT')
                        btn.prop('disabled', false);
                        $("nextstepdiv").hide();
                        $("nextstepdiv2").hide();
                        $("regIndividual").hide();
                        $('#feeb').hide();


                        $('#txtmemberid').attr('readonly', false);
                        $('#txtmemberid').remove('disabled', 'disabled');
                        $('#txtmemberid').remove('input-disabled');

                        $('#ddlDepartments').attr('readonly', false);
                        $('#ddlDepartments').attr('disabled', '');
                        $('#ddlDepartments').remove('input-disabled');


                        $('input[type=radio][name=Company1]').attr("disabled", false);


                        $('input[type=radio][name=Company]').attr("disabled", false);

                        $('#divchktc').css('display', 'none');

                    }
                    else if (msg.d == "2") {
                        //error
                        alert("One member can fill form at once");

                        btn.val('NEXT')
                        btn.prop('disabled', false);
                        $("#nextstepdiv").hide();
                        $("#nextstepdiv2").hide();
                        $("#feeb").hide()

                        $("#regIndividual").hide();

                        $('#txtmemberid').attr('readonly', false);
                        $('#txtmemberid').remove('disabled', 'disabled');
                        $('#txtmemberid').remove('input-disabled');

                        $('#ddlDepartments').attr('readonly', false);
                        $('#ddlDepartments').attr('disabled', '');
                        $('#ddlDepartments').remove('input-disabled');

                        $('input[type=radio][name=Company1]').attr("disabled", false);
                        $('input[type=radio][name=Company]').attr("disabled", false);
                    }

                    else {
                        //alert("Registration successfully completed");
                        // Clear();


                        if ($('input[type=radio][name=Company]:checked').val() == 'Company') {



                            btn.val('NEXT')
                            btn.hide();

                            //$("regIndividual").hide();
                            $("#hrefmemberlist").hide();
                            $("#regotp").hide();
                            $("#nextstepdiv1").show();
                            $("#nextstepdiv2").show();
                            $("#regCompany").hide();
                            $('#feeb').show();

                            btn.scrollTop();

                            //$("#feeb").show()

                            $('#divchktc2').css('display', 'block');

                            $('#divchktc').css('display', 'block');

                            //$("divmember").hide();
                            $('input[type=radio][name=Company]').attr("disabled", true);

                            $('#txtmemberid').attr('readonly', true);
                            $('#txtmemberid').attr('disabled', 'disabled');
                            $('#txtmemberid').addClass('input-disabled');

                            $('#ddlDepartments').attr('readonly', true);
                            $('#ddlDepartments').attr('disabled', 'disabled');
                            $('#ddlDepartments').addClass('input-disabled');


                            $('input[type=radio][name=Company1]').attr("disabled", true);

                            $("#tableDiv").focus();
                        }
                        else {


                            $("#htm").html(msg.d);
                            //comment 25/12/2019
                            //alert("Registration successfully completed");
                            //Clear();
                            //refresh();
                            //End comment 25/12/2019

                        }

                    }
                },
                error: function (xmlhttprequest, textstatus, errorthrown) {
                    alert("Something went wrong");
                    $("nextstepdiv").hide();
                    $('#feeb').hide();
                    $("nextstepdiv2").hide();
                    btn.val('NEXT');
                }

            });
        }
    });



    $('#btnINDIVIDUAL').on("click", function (result) {

        var btn = $(this);

        var itxtname = $('#itxtname').val();

        var itxtaddress1 = $('#itxtaddress1').val();
        var itxtaddress2 = $('#itxtaddress2').val();

        var itxtcity = $('#itxtcity').val();
        // var itxtstate = $('#itxtstate').val();
        var idrpCountry = $('#iddlcountrystate option:selected').val();

        var itxtmobile = $('#itxtmobile').val();
        // var txtfax = $('#txtfax').val();

        var email = $('#itxtemail').val();
        //var txtwebsite = $('#txtwebsite').val();

        //var txtbadges = $('txtbadges').val();

        var indexat = email.indexOf("@"); //Index of "@" in the email field
        var indexdot = email.indexOf("."); //Index of "." in the email field

        var registeras = "";//$('input[type=radio][name=Company]:checked').val() != '' && $("#ddlDepartments option:selected").val().toLocaleLowerCase() != 'student' || $('input[type=radio][name=Company]:checked').val() =='' && $("#ddlDepartments option:selected").val().toLocaleLowerCase() != 'media' ? $('input[type=radio][name=Company]:checked').val() : "Individual";
        var member = $('input[type=radio][name=Company1]:checked').val();

        var student1 = "";//for id card
        var studentpic = "";
        var student2 = "";

        var indiphtoto = "";
        var indidoc = "";

        var mediapic = "";
        var mediacard = "";

        var indigst = "";

        //var membershipnumber=$("#txtmemberid").val()

        var amount = $("#txtamount").text();
        var totmaount1 = $("#txtamount1").text();
        //$("#txtamount").val();

        // $(".error").remove();

        var password = $("#itxtPassword").val();
        var confirmPassword = $("#itxtConfirmPassword").val();

        var itxtpincode = $('#itxtpincode').val();

        var txtreferdbystu = $("#txtreferdbystu").val() == undefined ? "" : $("#txtreferdbystu").val();


        if ($("#ddlDepartments option:selected").val() == '' || $("#ddlDepartments option:selected").val() == 'undefined' || $("#ddlDepartments option:selected").val() == '0') {

            $("#ddlDepartments").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please select category</div>');

            $("#ddlDepartments").focus(); //The focus function will move the cursor to "fullname" field
            return false;
        }
            //Blank field validation of fullname, mobile no and address. The function will generate an alert message if "fullname" or "mobile no" or "address" field is blank  


            //Blank field validation of fullname, mobile no and address. The function will generate an alert message if "fullname" or "mobile no" or "address" field is blank  
        else if (itxtname == '' || itxtname == 'undefined') {

            $("#itxtname").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Name is required</div>');

            $('#itxtname').focus(); //The focus function will move the cursor to "fullname" field
            return false;
            $('#itxtname').rules('add', {
                required: true   // set a new rule
            });

            //$('#txtcompanyname').rules('remove', 'required');
        }

        else if ($('#itxtindividualname').val() == '' && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#itxtindividualname').val() == null && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#itxtindividualname').val() == undefined && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media') {

            $("#itxtindividualname").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Name is required</div>');

        }

        else if ($("#itxtPassword").val() == '' || $("#itxtPassword").val() == 'undefined') {
            $("#itxtPassword").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Password required</div>');
            $('#itxtPassword').focus();
        }

        else if ($("#itxtConfirmPassword").val() == '' || $("#itxtConfirmPassword").val() == 'undefined') {
            $("#itxtConfirmPassword").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Confirm password required</div>');
            $('#itxtConfirmPassword').focus();
        }

        else if (password != confirmPassword) {
            $("#itxtConfirmPassword").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Password not match</div>');
            $('#itxtConfirmPassword').focus();
            return false;

        }


        else if (itxtaddress1 == '' || itxtaddress1 == 'undefined') {

            $("#itxtaddress1").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Address1 is required</div>');

            $('#itxtaddress1').focus();
            return false;
        }
        else if (itxtcity == '' || itxtcity == 'undefined') {

            $("#itxtcity").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">City is required</div>');

            $("#itxtcity").focus(); //The focus function will move the cursor to "fullname" field
            return false;
        }

        else if (itxtpincode == '' || itxtpincode == 'undefined') {

            $("#itxtpincode").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Pincode is required</div>');

            $("#itxtpincode").focus(); //The focus function will move the cursor to "fullname" field
            return false;
        }
        else if (idrpCountry == '0' || idrpCountry == 'undefined' || idrpCountry == '' || idrpCountry == "") {

            $("#iddlcountrystate").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">State is required</div>');

            $("#iddlcountrystate").focus(); //The focus function will move the cursor to "fullname" field
            return false;
        }
            //else if (drpCountry == '' || drpCountry == 'undefined') {

            //    $("#drpCountry").after('<div class="invalid-feedback js-error">Country name is required</div>');

            //    $("#drpCountry").focus(); //The focus function will move the cursor to "fullname" field
            //    return false;
            //}
        else if ($("#itxtmobile").val() == '' || $("#itxtmobile").val() === 'undefined') {

            $("#itxtmobile").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Mobile is required</div>');

            // $('#txttelephone').after('<div class="invalid-feedback js-error">Mobile is required</div>');
            $('#itxtmobile').focus();
            return false;
        }
            //else if (txtfax == '' || txtfax == 'undefined') {
            //    $('#txtfax').after('<div class="invalid-feedback js-error">Fax is required</div>');
            //    $('#txtfax').focus();
            //    return false;
            //}

        else if (email == '' || email == 'undefined') {

            $("#itxtemail").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Email is required</div>');

            $('#itxtemail').focus();
            return false;
        }
            //Validation of valid email address. The function will generate an alert message if "email" field is blank or incorrect
        else if (IsEmail(email) == false) {

            $("#itxtemail").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please enter a valid Email Id</div>');
            //$('#itxtemail').length()
            $('#itxtemail').focus();
            return false;
        }
        else if ($('#itxtmobile').val().length != 10) {

            $("#itxtmobile").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Enter 10 digits mobile no.</div>');

            $('#itxtmobile').focus();
            return false;
        }
        else if ($("#itxtgstno").val() == '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $("#itxtgstno").val() == 'undefined' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media') {

            $("#itxtgstno").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">GSTIN is required</div>');

            $('#itxtgstno').focus();
            return false;
        }


            //itxtgstno

        else if ($('#ifupid').val() == '' && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#ifupid').val() == null && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#ifupid').val() == undefined && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media') {

            $("#ifupid").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Select file first.</div>');

        }


        else if ($('#ifupPhoto').val() == '' && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#ifupPhoto').val() == null && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#ifupPhoto').val() == undefined && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media') {

            $("#ifupPhoto").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Select file first.</div>');

        }
        else if ($('#fuindigst').val() == '' && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#fuindigst').val() == null && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#fuindigst').val() == undefined && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media') {

            $("#fuindigst").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Select file first.</div>');

        }

        else if ($('#ifustudent1').val() == '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent1').val() == null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent1').val() == undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student') {

            $("#ifustudent1").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Select file first.</div>');

        }
        else if ($('#ifupstudent2').val() == '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifupstudent2').val() == null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifupstudent2').val() == undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student') {

            $("#ifupstudent2").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Select file first.</div>');

        }

        else if ($('#ifustudent3').val() == '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent3').val() == null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent3').val() == undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student') {

            $("#ifustudent3").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Select file first.</div>');

        }
            //mdedia start

        else if ($('#fumedia1').val() == '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumedia1').val() == null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumedia1').val() == undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media') {

            $("#fumedia1").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Select file first.</div>');

        }

        else if ($('#fumdedia2').val() == '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumdedia2').val() == null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumdedia2').val() == undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media') {

            $("#fumdedia2").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Select file first.</div>');

        }
        else if ($('#fumedia3').val() == '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumedia3').val() == null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumedia3').val() == undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media') {

            $("#fumedia3").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Select file first.</div>');

        }
            //end media validaion

        else if ($('input[type="checkbox"][name="checkbox"]').prop("checked") == false) {

            $("#chktc").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please check Terms & Conditions.</div>');

            $(".invalid-feedback").css('display', 'block');


            $("#chktc").focus();
            return false;
        }

        else if ($('#chktcrefundp').prop("checked") == false) {

            $("#chktcrefundp").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please check Refund  & Cancellation Policy.</div>');

            $(".invalid-feedback").css('display', 'block');


            $("#chktcrefundp").focus();
            return false;
        }

        else if (isdbvalidatiionvalidmobile == true || isdbvalidatiionvalidemail == true || isdbvalidatiionvalidGST == true && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student') {

            $.alert({
                title: 'Hold on!',
                content: 'To proceed, please verify the details first.',
            });
            return false;
        }



        else {

            if (itxtname != '') {
                $("div > div > .js-error").hide()
            }

            //indivisaul
            if ($('#ifupid').val() != '' && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#ifupid').val() != null && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#ifupid').val() != undefined && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media') {

                registeras = "Individual";
                //var fu = $(this);
                var fileUpload = $("#ifupid").get(0);
                var files = fileUpload.files;
                var name = $("#itxtname").val().trim() + $('#itxtmobile').val().trim();
                var data = new FormData();
                for (var i = 0; i < files.length; i++) {

                    indidoc = name + 'IndividualId' + files[i].name;
                    data.append(indidoc, files[i]);
                }
                sendindifiles(data);

                //$("#ifupid").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">file uploaded</div>');

            }
            if ($('#ifupPhoto').val() != '' && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#ifupPhoto').val() != null && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#ifupPhoto').val() != undefined && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media') {

                registeras = "Individual";
                var fileUpload = $("#ifupPhoto").get(0);
                var files = fileUpload.files;
                var name = $("#itxtname").val().trim() + $('#itxtmobile').val().trim();
                var data = new FormData();
                for (var i = 0; i < files.length; i++) {

                    indiphtoto = name + 'IndividualPhoto' + files[i].name;
                    data.append(indiphtoto, files[i]);
                }
                sendindifiles(data);


                //$("#ifupPhoto").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">file uploaded</div>');

            }

            if ($('#fuindigst').val() != '' && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#fuindigst').val() != null && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#fuindigst').val() != undefined && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media') {

                registeras = "Individual";
                var fileUpload = $("#fuindigst").get(0);
                var files = fileUpload.files;
                var name = $("#itxtname").val().trim() + $('#itxtmobile').val().trim();
                var data = new FormData();
                for (var i = 0; i < files.length; i++) {

                    indigst = name + 'IndividualGst' + files[i].name;
                    data.append(indigst, files[i]);
                }
                sendindifiles(data);



            }
            //student 


            if ($('#ifustudent1').val() != '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent1').val() != null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent1').val() != undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student') {

                registeras = "Individual";
                var fileUpload = $("#ifustudent1").get(0);
                var files = fileUpload.files;
                var name = $("#itxtname").val().trim() + $('#itxtmobile').val().trim();
                var data = new FormData();
                for (var i = 0; i < files.length; i++) {

                    studentpic = name + 'StudentPassportsizephoto' + files[i].name;//passportsizephoto
                    data.append(studentpic, files[i]);
                }
                sendindifiles(data);

                //$("#ifustudent1").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">student file upload</div>');

            }


            if ($('#ifustudent1').val() != '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent1').val() != null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent1').val() != undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student') {

                registeras = "Individual";
                var fileUpload = $("#ifustudent1").get(0);
                var files = fileUpload.files;
                var name = $("#itxtname").val().trim() + $('#itxtmobile').val().trim();
                var data = new FormData();
                for (var i = 0; i < files.length; i++) {

                    student1 = name + 'StudentPhoto' + files[i].name;//for college id card sudent1
                    data.append(student1, files[i]);
                }
                sendindifiles(data);

                //$("#ifustudent1").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">student file upload</div>');

            }

            if ($('#ifustudent3').val() != '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent3').val() != null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent3').val() != undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student') {

                registeras = "Individual";
                var fileUpload = $("#ifustudent3").get(0);
                var files = fileUpload.files;
                var name = $("#itxtname").val().trim() + $('#itxtmobile').val().trim();
                var data = new FormData();
                for (var i = 0; i < files.length; i++) {

                    indidoc = name + 'StudentBonafideCertificate' + files[i].name;//bonafidecertificate
                    data.append(indidoc, files[i]);
                }
                sendindifiles(data);

                //$("#ifustudent3").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">student secoond file upload .</div>');

            }

            //media

            if ($('#fumedia1').val() != '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumedia1').val() != null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumedia1').val() != undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media') {

                registeras = "Individual";
                var fileUpload = $("#fumedia1").get(0);
                var files = fileUpload.files;
                var name = $("#itxtname").val().trim() + $('#itxtmobile').val().trim();
                var data = new FormData();
                for (var i = 0; i < files.length; i++) {

                    mediacard = name + 'MediaCard' + files[i].name;
                    data.append(mediacard, files[i]);
                }
                sendindifiles(data);

                //$("#fumedia1").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">media saved.</div>');

            }

            if ($('#fumdedia2').val() != '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumdedia2').val() != null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumdedia2').val() != undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media') {

                registeras = "Individual";
                var fileUpload = $("#fumdedia2").get(0);
                var files = fileUpload.files;
                var name = $("#itxtname").val().trim() + $('#itxtmobile').val().trim();
                var data = new FormData();
                for (var i = 0; i < files.length; i++) {

                    mediapic = name + 'MediaPhoto' + files[i].name;
                    data.append(mediapic, files[i]);
                }
                sendindifiles(data);

                //$("#fumdedia2").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">media saved.</div>');

            }
            if ($('#fumedia3').val() != '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumedia3').val() != null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumedia3').val() != undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media') {

                registeras = "Individual";
                var fileUpload = $("#fumedia3").get(0);
                var files = fileUpload.files;
                var name = $("#itxtname").val().trim() + $('#itxtmobile').val().trim();
                var data = new FormData();
                for (var i = 0; i < files.length; i++) {

                    indidoc = name + 'MediaDocument' + files[i].name;
                    data.append(indidoc, files[i]);
                }
                sendindifiles(data);


                //  $("#fumedia3").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">media saved.</div>');

            }
            //ifupid
            //sendFile(file, type)

            // return true;
            var obj = {

                ID: 0,
                Name: itxtname,
                Date: '',
                Registeras: registeras,
                GSTNO: $("#itxtgstno").val(),
                GSTName: $('#txtcompnaydb').text(),
                address1: itxtaddress1,
                address2: itxtaddress2,
                City: itxtcity,
                State: itxtcity,
                Country: idrpCountry,
                Telephone_No: '',
                Mobile: itxtmobile,
                EMail: email,
                Dealingin: '',
                Already_Vis: '',
                UserName: '',
                Password1: password,
                Photo: indiphtoto,
                DealinginOthers: '',
                cStatus: 0,
                fax: '',
                weAre: '',
                firstLearnAboutJJS: '',
                IsMember: member,
                Type: registeras,
                Website: '',
                Category: $("#ddlDepartments option:selected").text(),
                BusinessType: $("#ddlDepartments option:selected").text(),
                RegistrationFee: parseFloat(amount),
                GstCertificate: indigst,
                TotalAmount: parseFloat(totmaount1),
                Documnet: indidoc,
                StudentPic: studentpic,
                StudentIDcard: student1,
                MediaPic: mediapic,
                MediaCard: mediacard,
                AUTHORISEDPERSON: $('#itxtindividualname').val(),
                Pincode: itxtpincode,
                Referredby: txtreferdbystu

            };


            //var jsonstr = JSON.stringify(obj);

            //var data = { data1: jsonstr }

            btn.val('PLEASE WAIT..')
            btn.prop('disabled', true);


            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",

                url: siteurl + "VisitorRegistration.aspx/savedataindividual",
                data: '{data:' + JSON.stringify(obj) + '}',
                dataType: "json",
                //called on jquery ajax call success
                success: function (result) {
                    debugger;

                    if (result.d.toLocaleLowerCase() == "media") {

                        //alert("Registration successfully completed");

                        $.alert({
                            title: 'Registration',
                            content: 'successfully completed',
                        });

                        cleari();
                        $("#itxtgstno").val('');
                        // btn.val('MAKE PAYMENT')
                        btn.prop('disabled', false);

                        refresh();
                        //iClear();
                    }
                    else {

                        $("#htm").html(result.d);
                    }
                    //if (result.d == "1") {
                    //    //alert("Registration successfully completed");
                    //    //window.location.href = 'VisitorRegistration.aspx';
                    //    cleari();
                    //    $("#itxtgstno").val('');

                    //    btn.val('SUBMIT')
                    //    btn.prop('disabled', false);
                    //    //iClear();
                    //}


                    //btn.val('SUBMIT')
                    //btn.prop('disabled', false);



                },
                error: function ajaxError(result) {
                    btn.val('MAKE PAYMENT')
                    btn.prop('disabled', false);
                    //alert(result.error);

                }

            });

        }
    });

    $("#otpverify").click(function () {

        var otp = $("#txtotp").val();
        var hdotp = $("#hotp").val();
        if (otp == "") {

            $("#txtotp").parent('.ctrl').find('div').html('<span id="spn1" class="invalid-feedback js-error">Please enter OTP.</div>');
            $(".info_verify").hide()
            $("#btnresend").show();
        }
        else {
            if (otp == hdotp) {

                $("#hotp2").val(hdotp);
                $("#regCompany").show();
                $("#txtotp").attr("disabled", "disabled");
                $("#txtmemberid").attr('disabled', "disabled");

                $("#spn1").hide();
                $(this).hide();


                $("#txtotp").parent('.ctrl').find('div').html('<span id="spn1" class="invalid-feedback js-error"></div>');
                //$(".info_1").hide()
                $(".info_verify").show()

                $("#btnresend").hide();

                $("#dvgst").hide();
                $("#dvdoc").hide();

                if ($('input[type=radio][name=Company]:checked').val() == "Individual" && $('input[type=radio][name=Company1]:checked').val() == "Yes") {
                    $('#divchktc').show();
                    $('#divchktc').css('margin-top', '-66px');
                }
                else {
                    $('#divchktc').hide();
                    $('#divchktc').css('margin-top', '15px');
                }

                //if ($('input[type=radio][name=Company]:checked').val() == "Individual" && $('input[type=radio][name=Company1]:checked').val() == "Yes") {
                //    $("#divfeeInedivaidualyes").show();
                //    $("#spanfeeInedivaidualyes").text($("#hfee").val());

                //}
                //else {
                //    $("#divfeeInedivaidualyes").hide();
                //    // $("#spanfeeInedivaidualyes").text($("#hfee").val());
                //}

            }
            else {

                $("#spn1").show();
                $(".info_verify").hide()

                $("#btnresend").show();

                $("#txtotp").parent('.ctrl').find('div').html('<span id="spn1" class="invalid-feedback js-error">You have entered wrong OTP.</div>');
            }
        }
    });

    $("#btnresend").click(function () {

        var mobilenu = $("#hmobile").val();

        if (mobilenu != "") {

            resendotp(mobilenu);
        }
        else {
            $("#txtotp").parent('.ctrl').find('div').html('<span id="spn1" class="invalid-feedback js-error">OTP server error</div>');
        }



    });


    $("#gstCertificate").click(function (evt) {


        if ($('#txtcompanyname').val() == '' || $('#txtcompanyname').val() == 'undefined') {

            $("#txtcompanyname").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Company name is required </div>');

            $('#txtcompanyname').focus(); //The focus function will move the cursor to "fullname" field
            return false;
            $('#txtcompanyname').rules('add', {
                required: true   // set a new rule
            });

            //$('#txtcompanyname').rules('remove', 'required');
        }
        else if ($("#txtgstno").val() == '' || $("#txtgstno").val() == 'undefined') {


            $("#txtgstno").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">GSTIN is required</div>');

            // $("#txtgstno").after('<div class="invalid-feedback js-error">GSTIN is required</div>');

            $("#txtgstno").focus(); //The focus function will move the cursor to "fullname" field
            return false;
        }
        else {

            var fu = $(this);
            var fileUpload = $("#fugst").get(0);
            var files = fileUpload.files;
            var name = $("#txtgstno").val() + $('#txtcompanyname').val();
            var data = new FormData();
            for (var i = 0; i < files.length; i++) {

                var f = 'GSTCertificate' + files[i].name + name;


                data.append(f, files[i]);
            }
            $.ajax({
                url: "FileUploadHandler.ashx",
                type: "POST",
                data: data,
                cache: false,
                contentType: false,
                processData: false,
                success: function (result) {

                    if (result != "") {
                        alert(result);
                        fu.text('Uploaded');
                    }
                },
                error: function (err) {
                    alert(err.statusText);
                }
            });

            evt.preventDefault();
        }
    });

    $("#document").click(function (evt) {

        if ($('#txtcompanyname').val() == '' || $('#txtcompanyname').val() == 'undefined') {

            $("#txtcompanyname").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Company name is required</div>');

            $('#txtcompanyname').focus(); //The focus function will move the cursor to "fullname" field
            return false;
            $('#txtcompanyname').rules('add', {
                required: true   // set a new rule
            });

            //$('#txtcompanyname').rules('remove', 'required');
        }
        else if ($("#txtgstno").val() == '' || $("#txtgstno").val() == 'undefined') {

            $("#txtgstno").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">GSTIN is required</div>');

            $("#txtgstno").focus(); //The focus function will move the cursor to "fullname" field
            return false;
        }
        else {

            var fu = $(this);
            var fileUpload = $("#cdoc").get(0);
            var files = fileUpload.files;

            var name = $("#txtgstno").val() + $('#txtcompanyname').val();

            var data = new FormData();
            for (var i = 0; i < files.length; i++) {

                var f = 'CompanyDocument' + files[i].name + name;
                data.append(f, files[i]);
            }

            $.ajax({
                url: "FileUploadHandler.ashx",
                type: "POST",
                data: data,
                cache: false,
                contentType: false,
                processData: false,
                success: function (result) {
                    if (result != "") {
                        alert(result);
                        fu.text('Uploaded');
                    }
                },
                error: function (err) {
                    alert(err.statusText)
                }
            });

            evt.preventDefault();
        }
    });

    //section Memberid
    $("#txtmemberid").on("change", function () {

        //Clear();
        //cleari()
        var memid = $(this).val();

        if ($("#ddlDepartments option:selected").val() != '' || $("#ddlDepartments option:selected").val() != 'undefined' || $("#ddlDepartments option:selected").val() != '0') {

            $("#ddlDepartments").parent('.ctrl').find('div').html('<span ></div>');

        }


        if ($("#ddlDepartments option:selected").val() == '' || $("#ddlDepartments option:selected").val() == 'undefined' || $("#ddlDepartments option:selected").val() == '0') {

            $("#ddlDepartments").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please select category</div>');

            //$("#ddlDepartments").after('<div class="invalid-feedback js-error">Required* </div>');
            $("#txtmemberid").val('');

            $("#ddlDepartments").focus(); //The focus function will move the cursor to "fullname" field
            return false;
        }

        else if (memid != "") {

            Getmemberbymemberid(memid);


        }

    });

    $("#itxtmemberid").on("change", function () {

        //Clear();
        //cleari()

        var memid = $(this).val();

        if (memid != "") {

            Getmemberbymemberid(memid);
        }

    });




    //state code
    //$("#txtgstno").keyup(function () {
    //console.log("Handler for .keypress() called.");




    // });



    //state code fucntion
    $("#itxtgstno").keyup(function () {
        //console.log("Handler for .keypress() called.");
        var code = $(this);

        //mystring = mystring.substring(0, 2);

        if (code.val().length >= 1) {

            var txtcode = code.val().substring(0, 2);
            GetGSTdetailbystatecode(txtcode, 'igst');

        }

    });



    //company
    //txtgstno
    $("#txtgstno").change(function () {
        //console.log("Handler for .keypress() called.");
        var code = $(this);

        //mystring = mystring.substring(0, 2);

        if (code.val().length == 15) {



            getGST(code.val(), 'gst');


            //var txtcode = code.val().substring(0, 2);


        }

    });

    //indivdal gst no on change
    $("#itxtgstno").change(function () {
        //console.log("Handler for .keypress() called.");
        var code = $(this);

        //mystring = mystring.substring(0, 2);

        if (code.val().length == 15) {

            getGST(code.val(), 'igst');

            //var txtcode = code.val().substring(0, 2);
        }

    });

    function resendotp(mobile) {
        debugger;

        //var ss="";

        if (txtgstno != "") {
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",

                url: siteurl + "VisitorRegistration.aspx/resendotp",
                data: '{mobile: ' + JSON.stringify(mobile) + '}',
                dataType: "json",
                //called on jquery ajax call success
                success: function (result) {
                    debugger;
                    if (result.d == "") {
                        alert("Something went wrong try again");
                        // return true;
                    }

                    else {
                        $("#hotp").val(result.d);
                        $("#txtotp").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">OTP sent successfully</div>');
                        $('#txtotp').focus();
                        // return false;

                    }

                },
                error: function ajaxError(result) {
                    alert(result.error);

                    // return ss;

                }

            });
        }
    }
    function getGST(txtgstno, type) {

        debugger;
        $("#loder").show();
        //var txtgstno = $('#txtgstno').val();

        if (txtgstno != "") {
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",

                url: siteurl + "VisitorRegistration.aspx/GSTDetail",
                data: '{gstno: ' + JSON.stringify(txtgstno) + '}',
                dataType: "json",
                //called on jquery ajax call success
                success: function (result) {
                    debugger;
                    $("#loder").hide();
                    if (type == 'gst') {


                        if (result.d != "") {


                            if ($('input[type=radio][name=Company]:checked').val() === "Company" && $('input[type=radio][name=Company1]:checked').val().toLocaleLowerCase() === "yes") {

                                //company yes
                                //span 

                                $('#txtcompanyname').addClass("has-content");
                                $('#txtcompnaydb').text(result.d);
                                $('#txtcompanyname').attr('disabled', 'disabled');


                            }
                            else if ($('input[type=radio][name=Company]:checked').val() === "Individual" && $('input[type=radio][name=Company1]:checked').val().toLocaleLowerCase() === "yes") {
                                //span

                                $('#txtcompanyname').addClass("has-content");
                                $('#txtcompnaydb').text(result.d);
                                $('#txtcompanyname').attr('disabled', 'disabled');

                            }
                            else {

                                $('#txtcompanyname').addClass("has-content");
                                
                                var detail = result.d.split('~');
                                $('#txtcompanyname').val(detail[0]);
                                if (detail.length > 1) {
                                    $('#txtTradeName').addClass("has-content");
                                    $('#txtTradeName').val(detail[1]);
                                    $('#txtTradeName').attr('disabled', 'disabled');
                                }
                                $('#txtcompanyname').attr('disabled', 'disabled');
                                


                                $("#txtcompanyname").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error"></div>');

                                //$('#txtcompanyname').addClass("has-content");
                                //$('#txtcompanyname').val(result.d);
                                //$('#txtcompanyname').attr('disabled', 'disabled');

                                //$("#txtcompanyname").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error"></div>');


                            }



                            //span
                            //txtcompnaydb

                        }
                        else {

                            //$.alert({
                            //    title: 'Hold On !',
                            //    content: "Please Enter Valid GSTIN !",
                            //});
                            //isdbvalidatiionvalidGST = false;

                            $("#txtgstno").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please Enter Valid GSTIN</div>');
                            $('#txtgstno').focus();

                            $('#txtgstno').val('');

                            if ($('input[type=radio][name=Company]:checked').val() === "Company" && $('input[type=radio][name=Company1]:checked').val().toLocaleLowerCase() === "yes") {

                                //company yes
                                //span 

                                $('#txtcompnaydb').text('');
                                $('#txtcompnaydb').removeAttr('disabled');

                            }
                            else if ($('input[type=radio][name=Company]:checked').val() === "Individual" && $('input[type=radio][name=Company1]:checked').val().toLocaleLowerCase() === "yes") {
                                //span                                

                                $('#txtcompnaydb').text('');
                                $('#txtcompnaydb').removeAttr('disabled');

                            }
                            else {
                                $('#txtcompanyname').val('');
                                $('#txtcompanyname').removeAttr('disabled');

                            }



                        }
                    }

                    else {
                        if (result.d != "") {


                            if ($('input[type=radio][name=Company]:checked').val() === "Company" && $('input[type=radio][name=Company1]:checked').val().toLocaleLowerCase() === "yes") {

                                //company yes
                                //span 

                                $('#txtcompanyname').addClass("has-content");
                                $('#txtcompnaydb').text(result.d);
                                $('#txtcompanyname').attr('disabled', 'disabled');

                            }
                            else if ($('input[type=radio][name=Company]:checked').val() === "Individual" && $('input[type=radio][name=Company1]:checked').val().toLocaleLowerCase() === "yes") {
                                //span

                                $('#txtcompanyname').addClass("has-content");
                                $('#txtcompnaydb').text(result.d);
                                $('#txtcompanyname').attr('disabled', 'disabled');

                            }
                            else {
                                $('#itxtname').addClass("has-content");
                                //isdbvalidatiionvalidGST = true;
                                $('#itxtname').val(result.d);

                                $("#itxtname").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error"></div>');

                                $('#itxtname').attr('disabled', 'disabled');

                            }




                        }
                        else {

                            $("#itxtgstno").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please Enter Valid GSTIN</div>');
                            $('#itxtgstno').focus();
                            //isdbvalidatiionvalidGST = false;

                            $('#itxtgstno').val('');
                            $('#itxtname').val('');
                            $('#itxtname').removeAttr('disabled');

                        }

                    }
                },
                error: function ajaxError(result) {
                    alert(result.error);

                }

            });
        }


    }



    function cleari() {

        $(".js-disable").removeClass('input-disabled');

        $('#itxtname').val('');

        $('#itxtaddress1').val('');
        $('#itxtaddress2').val('');

        $('#itxtcity').val('');
        // var itxtstate = $('#itxtstate').val();
        $('#iddlcountrystate').val();

        $('#itxtmobile').val('');
        // var txtfax = $('#txtfax').val();

        $('#itxtemail').val('');

        $("#ifupid").val('');
        $('#ifupPhoto').val('')

        $("#iddlcountrystate > [value='0']").attr("selected", "true");

        $('#txtgstno').val('');
        //$("#txtmemberid").val("");




        //indivisaul

        $('#itxtindividualname').val('')
        if ($('#ifupid').val() != '' && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#ifupid').val() != null && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#ifupid').val() != undefined && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media') {

            $('#ifupid').val('');

            //   $("#ifupid").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">file uploaded</div>');

        }
        if ($('#ifupPhoto').val() != '' && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#ifupPhoto').val() != null && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media' || $('#ifupPhoto').val() != undefined && $('input[type=radio][name=Company]:checked').val() === 'Individual' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'student' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() != 'media') {

            $('#ifupPhoto').val('');

        }
        //student 

        if ($('#ifustudent1').val() != '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent1').val() != null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent1').val() != undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student') {

            $('#ifustudent1').val('');

            //$("#ifustudent1").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">student file upload</div>');

        }

        if ($('#ifustudent3').val() != '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent3').val() != null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student' || $('#ifustudent3').val() != undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'student') {

            $('#ifustudent3').val('');

            //$("#ifustudent3").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">student secoond file upload .</div>');

        }

        //media

        if ($('#fumedia1').val() != '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumedia1').val() != null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumedia1').val() != undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media') {


            $('#fumedia1').val('');

            //$("#fumedia1").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">media saved.</div>');

        }

        if ($('#fumdedia2').val() != '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumdedia2').val() != null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumdedia2').val() != undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media') {


            $('#fumdedia2').val('');
            //$("#fumdedia2").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">media saved.</div>');

        }
        if ($('#fumedia3').val() != '' && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumedia3').val() != null && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media' || $('#fumedia3').val() != undefined && $("#ddlDepartments option:selected").text().toLocaleLowerCase() === 'media') {


            $('#fumedia3').val('')
            //  $("#fumedia3").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">media saved.</div>');

        }

        if ($("#iddlcountrystate option:selected").val() != '' && $("#iddlcountrystate option:selected").val() != null) {
            $("#iddlcountrystate > [value='0']").attr("selected", "true");
            $("fee").hide();

        }
    }


    function Clear() {


        $('#txtotp').val('');
        $('#txtpassword').val('');
        $('#txtConfirmPassword').val('');

        $(".js-disable").attr('disabled', '');
        $(".js-disable").removeClass('input-disabled');

        $('#txtmobileno').val('');
        $('#txtcompanyname').val('');
        $('#txtgstno').val('');
        // $("#txtmemberid").val("");

        $('#txtaddress1').val('');
        $('#txtaddress2').val('');
        $('#txtcity').val('');
        $('#txtstate').val('');
        $('#drpCountry').val('');

        $('#txttelephone').val('');
        $('#txtfax').val('');

        $('#txtbemail').val('');
        $('#txtemail2').val('');
        $('#txtwebsite').val('');
        $('txtbadges').val('');
        $("#ddlstate > [value='0']").attr("selected", "true");

        var number_of_rows = $("#txtbadges").val();
        if (number_of_rows != '' || number_of_rows != 'undefined' || number_of_rows != null) {
            $('#tableDiv').html('');

        }
    }


    function MemberOrNot(ismember) {
        debugger;
        if (ismember.val() == 'Yes') {

            if ($('input[type=radio][name=Company]:checked').val() == 'Company') {

                $("#regIndividual").hide();
                $("#fee").show()
                // $("#regCompany").show();
                //$("#regotp").hide();

            }
            else if ($('input[type=radio][name=Company]:checked').val() == 'Individual') {

                //$("#regotp").show();
                $("#regIndividual").show();
                //$("#fee").show()
                $("#regCompany").hide();

            }

            $('#divmemberid').css('display', 'block');

        }

        else {

            if ($('input[type=radio][name=Company]:checked').val() == 'Company') {
                $("#regIndividual").hide();

                $("#regCompany").show();
                $("#fee").show()

            }
            else if ($('input[type=radio][name=Company]:checked').val() == 'Individual') {

                $("#regIndividual").show();
                $("#fee").show()
                $("#regCompany").hide();

            }

            //$('#regCompany').css('display', 'none');
            //$('#regIndividual').css('display', 'block');

            $("#divmemberid").hide();

            //$("#txtamount1").text("Rs. 1180 "); //= ;
            //$("#txtamount").text("1180"); //= ;
            //   alert("No");


        }
    }

    function HideGstTextbox() {
        //6-Media 4-student
        if ($("#ddlDepartments option:selected").val() == '6' || $("#ddlDepartments option:selected").val() == "4") {
            $('#indigstdiv').hide();
        }
        else {
            $('#indigstdiv').show();
        }
    }




    function refresh() {
        window.location.href = siteurl + 'VisitorRegistration.aspx';
    }

    function sendindifiles(data) {
        $.ajax({
            url: "FileUploadHandler.ashx",
            type: "POST",
            data: data,
            cache: false,
            contentType: false,
            processData: false,
            success: function (result) {
                if (result != "") {
                    alert(result);
                    //fu.text('Uploaded');
                }
            },
            error: function (err) {
                alert(err.statusText)
            }
        });
    }



});


function statecode(reff) {
    var code = $(reff);

    //mystring = mystring.substring(0, 2);

    if (code.val().length >= 1) {

        var txtcode = code.val().substring(0, 2);
        GetGSTdetailbystatecode(txtcode, 'gst');

    }
}

function GetGSTdetailbystatecode(txtcode, type) {
    //txtcode = code.val().substring(0, 3);

    //var obj = {
    //    statecode: txtcode
    //};
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",

        url: siteurl + "VisitorRegistration.aspx/GetCountryByGSTCode",
        data: '{statecode:' + JSON.stringify(txtcode) + '}',
        dataType: "json",
        //called on jquery ajax call success
        success: function (result) {

            if (result.d == null) {

                // alert("No record found");
            }
            else {
                var selectedval = result.d;

                if (type === 'gst') {

                    if ($('#ddlstate').val() != '' && $('#ddlstate').val() != null) {

                        $('#ddlstate').addClass("has-content");
                        $("#ddlstate > [value='" + selectedval + "']").attr("selected", "true");
                    }
                }
                else {

                    if ($('#iddlcountrystate').val() != '' && $('#iddlcountrystate').val() != null) {

                        $('#iddlcountrystate').addClass("has-content");
                        $("#iddlcountrystate > [value='" + selectedval + "']").attr("selected", "true");
                    }
                }
            }


        },
        error: function ajaxError(result) {
            // alert(result.error);

        }

    });
}



function displaydata() {

    //$("#ddlDepartments").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please select category</div>');
/*
    if ($("#ddlDepartments option:selected").val() == "0") {
        $("#ddlDepartments").parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Please select category</div>');
    }
    else {

        $("#ddlDepartments").parent('.ctrl').find('div').html('');
	*/
        $('#membermodal').modal('show');
		var associationType = "associationType";
        $.ajax({
            type: "POST",
        //    url: siteurl + "checkMembershipNoUpdated.php/BindDatatable",
        //    data: "{}",
			url: "https://www.gjc.org.in/NJA_Awards/getMemberAjax.php",		
			data: { valueType : associationType },
            dataType: "json",
            success: function (data) {
               console.log(data);
                y = 1;
                $("#grd_viewvisitor").empty();
                $("#grd_viewvisitor").append("<tr class='danger'><th>S.No.</th><th>Membership No. </th><th>Company Name </th><th>Authorised Person </th></tr>");
				
                for (var i = 0; i < data.length; i++) {
                    var index = parseInt(i) + 1;
                    //$("#grd_viewvisitor").append("<tr><td>" + index + "</td><td><a class='fancybox fancybox.iframe' href='ViewDetail.aspx?boothid=" + data.d[i].BoothID + "'>" + data.d[i].Exehibitorname + "</a></td><td>" + data.d[i].Boothno + "</td><td>" + data.d[i].City + "</td><td>" + data.d[i].Category + "</td></tr>");
                    $("#grd_viewvisitor").append("<tr><td>" + index + "</td><td><a onclick=funfillmemberno('" + data[i].membership_no + "') href='javascript:void(0)' >" + data[i].membership_no + "</a></td><td>" + data[i].company_name + "</td><td>" + data[i].auth_person + "</td></tr>");
                }
            },
            error: function (result) {
                alert(result.responseText);
            }
        });
    //}
    //}
}


function funfillmemberno(memberno) {

    $("#txtmemberid").val(memberno);
    $('#membermodal').modal('toggle');

    Getmemberbymemberid(memberno);
}


function Getmemberbymemberid(memberid) {

    $("#loder").show();
    debugger;



    GETMemberRegisterornot(memberid);
    $("#txtmemberid").attr('disabled', "disabled");

}

function GETMemberRegisterornot(mnumber) {
    debugger;

    var obj = {

        Membershipno: mnumber

    };

    //var ss="";
    //$("#loder").hide();
    var check = "0";

    if (txtgstno != "") {
        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",

            url: siteurl + "VisitorRegistration.aspx/GETMemberRegisterornot",
            data: '{membershipno: ' + JSON.stringify(mnumber) + '}',
            dataType: "json",
            //called on jquery ajax call success
            success: function (result) {
                debugger;

                if (result.d == "1") {

                    //alert("You are already registered please login");

                    $.confirm({
                        title: '',
                        content: 'Mobile No./Email/GSTIN is already registered as trade visitor. Please LOGIN to access your account.',
                        buttons: {
                            Login: function () {
                                $.alert('Please Wait');
                                window.location.href = siteurl + 'Visitorlogin.aspx';

                            }
                            //,
                            //cancel: function () {

                            //    $('#txtmemberid').attr('readonly', false);
                            //    $('#txtmemberid').attr('disabled', '');
                            //    $('#txtmemberid').remove('input-disabled');
                            //   // $.alert('Canceled!');
                            //}
                            //,
                            //somethingElse: {
                            //    text: 'Something else',
                            //    btnClass: 'btn-blue',
                            //    keys: ['enter', 'shift'],
                            //    action: function () {
                            //        $.alert('Something else?');
                            //    }
                            //}
                        }
                    });

                    //window.location.href = siteurl + 'Visitorlogin.aspx';
                    $("#txtmemberid").val("");
                    $("#regotp").hide();
                    $("#hrefmemberlist").show();
                    $("#loder").hide();
                    check = "0";
                    // $('#divchktc').css('display', 'block');
                    //error msg

                }

                else {
                    check = "0";
                    $.ajax({
                        type: "POST",
                        contentType: "application/json; charset=utf-8",

                        url: siteurl + "VisitorRegistration.aspx/getdata",
                        data: '{visitor1:' + JSON.stringify(obj) + '}',
                        dataType: "json",
                        //called on jquery ajax call success
                        success: function (result) {

                            Clear();
                            debugger;
                            if (result.d == null) {



                                $("#loder").hide();
                                $("#regIndividual").hide();
                                $("#txtmemberid").val('');
                                // $('#divchktc').css('display', 'block');
                                // alert("MemberId not match please select no to fill form");

                                $.alert({
                                    title: 'Member ID not found',
                                    content: 'Member ID not match please select "no" to fill form',
                                });

                            }
                            else {


                                //if (check == "1") {

                                //    alert("You are already registered please login");
                                //    $("#txtmemberid").val("");
                                //    $("#regotp").hide();
                                //    $("#hrefmemberlist").show();
                                //    $("#loder").hide();

                                //}
                                // else {
                                $("#loder").hide();
                                $(".js-disable").attr('disabled', 'disabled');
                                $(".js-disable").addClass('input-disabled');


                                $("#hrefmemberlist").hide()
                                $('#regotp').show();
                                //$('#divchktc').css('display', 'block');

                                //$('#regCompany').show();
                                if (result.d.COMPANYNAME == null) {

                                }
                                else {


                                    //$('#txtcompnaydb').text(result.d.COMPANYNAME);

                                    $('#txtcompanyname').val(result.d.COMPANYNAME)
                                    $('#txtcompanyname').addClass("has-content");
                                }


                                var selectedval = result.d.STATE;
                                // var selddlstate = $("#ddlstate option:selected").val(result.d.STATE);

                                $("#ddlstate > [value='" + selectedval + "']").attr("selected", "true");
                                //$("#ddlstate option:selected").val(result.d.STATE).toLocaleLowerCase();

                                $('#hotp').val(result.d.ZONE);


                                if ($('#ddlstate').val() != '' && $('#ddlstate').val() != null) {
                                    $('#ddlstate').addClass("has-content");
                                }
                                $('#txtpincode').val(result.d.PINCODE);
                                if ($('#txtpincode').val() != '' && $('#txtpincode').val() != null) {
                                    $('#txtpincode').addClass("has-content");


                                }

                                $('#txtaddress1').val(result.d.ADDRESSLINE1);
                                if ($('#txtaddress1').val() != '' && $('#txtaddress1').val() != null) {
                                    $('#txtaddress1').addClass("has-content");
                                }
                                $('#txtaddress2').val(result.d.ADDRESSLINE2);
                                if ($('#txtaddress2').val() != '' && $('#txtaddress2').val() != null) {
                                    $('#txtaddress2').addClass("has-content");
                                }

                                $('#txtcity').val(result.d.CITY);
                                if ($('#txtcity').val() != '' && $('#txtcity').val() != null) {
                                    $('#txtcity').addClass("has-content");
                                }

                                $('#txtstate').val(result.d.STATE);
                                if ($('#txtstate').val() != '' && $('#txtstate').val() != null) {
                                    $('#txtstate').addClass("has-content");
                                }
                                $('#txtmobileno').val(result.d.MOBILENO);


                                if ($('#txtmobileno').val() != '' && $('#txtmobileno').val() != null) {

                                    $("#hmobile").val(result.d.MOBILENO);

                                    var mobileee = $('#txtmobileno').val().substring(7, 10);

                                    //var mobileee = $('#txtmobileno').val(result.d.MOBILENO);

                                    $('#txtmobileno').val('XXXXXXX' + mobileee);
                                    $('#txtmobileno').addClass("has-content");
                                }
                                $('#txttelephone').val(result.d.PHONENO);
                                if ($('#txttelephone').val() != '' && $('#txttelephone').val() != null) {
                                    $('#txttelephone').addClass("has-content");
                                }

                                $('#txtbemail').val(result.d.EMAILID);
                                if ($('#txtbemail').val() != '' && $('#txtbemail').val() != null) {
                                    $('#txtbemail').addClass("has-content");
                                }
                                //$('#txtwebsite').val(result.d.Website);
                                //if ($('#txtwebsite').val() != '' && $('#txtwebsite').val() != null) {
                                //    $('#txtwebsite').addClass("has-content");
                                //}
                                // }
                            }

                        },
                        error: function ajaxError(result) {
                            alert(result.error);

                        }

                    });



                }
                return result;
                // return check;
            },
            error: function ajaxError(result) {
                //alert(result.error);
                check = "0";
                return check;

            }

        });
    }
}

function clickenter(event) {
    if (event.keyCode === 13) {
        Search();
    }

}


function Search() {
    var memberno = $("#memberno").val();
    var compname = $("#compname").val();
    var authperson = $("#authperson").val();
//alert(memberno);

    if (memberno != '' || compname != '' || authperson != '') {
        //confirm("Are You Sure ?");
        $.ajax({
            type: "POST",
            //contentType: "application/json; charset=utf-8",
        //  url: siteurl + "VisitorRegistration.aspx/Search",
			url: "https://www.gjc.org.in/NJA_Awards/getMemberAjax.php",
        //  data: '{MemberNo:"' + memberno + '",Company:"' + compname + '",AuthPerson:"' + authperson + '"}',
		    data: "actiontype=checkType_member&MemberNo="+memberno+"&Company="+compname+"&AuthPerson="+authperson,
            dataType: "json", 
            success: function (data) {
                $("#grd_viewvisitor").empty();
                $("#grd_viewvisitor").append("<tr class='danger'><th>S.No.</th><th>Membership No. </th><th>Company Name </th><th>Authorised Person </th></tr>");
                for (var i = 0; i < data.length; i++) {
                    var index = parseInt(i) + 1;
                    //$("#grd_viewvisitor").append("<tr><td>" + index + "</td><td><a class='fancybox fancybox.iframe' href='ViewDetail.aspx?boothid=" + data.d[i].BoothID + "'>" + data.d[i].Exehibitorname + "</a></td><td>" + data.d[i].Boothno + "</td><td>" + data.d[i].City + "</td><td>" + data.d[i].Category + "</td></tr>");
                    $("#grd_viewvisitor").append("<tr><td>" + index + "</td><td><a onclick=funfillmemberno('" + data[i].membership_no + "') href='javascript:void(0)' >" + data[i].membership_no + "</a></td><td>" + data[i].company_name + "</td><td>" + data[i].auth_person + "</td></tr>");
                }
            },
            error: function (result) {
                alert("Error");
            }
        });
    }
    else {
        displaydata();
    }
}

function ValidateTextbox(txtboxname, msg) {

    var txtvalue = $(txtboxname).val();
    if (txtvalue == '' || txtvalue == 'undefined') {


        $(txtboxname).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">' + msg + ' </span>');
        $(txtboxname).focus();
    }
    else {
        $(txtboxname).parent('.ctrl').find('div').html('');
    }

}

function ValidateMobileno(txtboxname) {

    var txtvalue = $(txtboxname).val();
    var msg = "Mobile is required";
    if (txtvalue == '' || txtvalue == 'undefined') {


        $(txtboxname).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">' + msg + ' </span>');
        $(txtboxname).focus();
    }
    else if (txtvalue.length != 10) {
        msg = "Enter 10 digits mobile no.";
        $(txtboxname).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">' + msg + ' </span>');
        $(txtboxname).focus();

    }
    else {
        $(txtboxname).parent('.ctrl').find('div').html('');
    }

}

function Validateddl(ddl, msg) {

    var txtvalue = $(ddl).val();

    if (txtvalue == '0' || txtvalue == 'undefined' || txtvalue == null) {

        $(ddl).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">' + msg + ' </span>');
        $(ddl).focus();
    }
    else {
        $(ddl).parent('.ctrl').find('div').html('');
    }

}
function emailid(emailid) {

    var txtvalue = $(emailid).val();
    var msg = "Invalid Eamil";

    if (txtvalue == '' || txtvalue == undefined) {
        msg = "Email is Required";
        $(emailid).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">' + msg + ' </span>');
        $(emailid).focus();

    }

    else if (IsEmail(txtvalue) == false) {

        $(emailid).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">' + msg + ' </span>');
        $(emailid).focus();

    }
    else {
        $(emailid).parent('.ctrl').find('div').html('');
    }

}

function ValidateCheckBox(checkbox) {

    var txtvalue = $(checkbox).val();
    var msg = "Please check Terms & Conditions";

    if ($(checkbox).is(':checked') == false) {

        $(checkbox).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">' + msg + ' </span>');
        $(checkbox).focus();
        $(".invalid-feedback").css('display', 'block');

    }
    else {
        $(checkbox).parent('.ctrl').find('div').html('');
    }

}

function ValidateCheckBoxRNC(checkbox) {

    var txtvalue = $(checkbox).val();
    var msg = "Please check Refund & Cancellation Policy.";

    if ($(checkbox).is(':checked') == false) {

        $(checkbox).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">' + msg + ' </span>');
        $(checkbox).focus();
        $(".invalid-feedback").css('display', 'block');

    }
    else {
        $(checkbox).parent('.ctrl').find('div').html('');
    }

}

function divfeeindiyes() {
    if ($('input[type=radio][name=Company]:checked').val() == "Individual" && $('input[type=radio][name=Company1]:checked').val() == "Yes") {
        $("#divfeeInedivaidualyes").show();
        $("#spanfeeInedivaidualyes").text($("#hfee").val());

    }
    else {
        $("#divfeeInedivaidualyes").hide();
        // $("#spanfeeInedivaidualyes").text($("#hfee").val());
    }
}

function validateEmpBadgesMobile(txtmob) {
    var txtvalue = $(txtmob).val();


    if ($(txtmob).val().length != 10) {
        msg = "Enter 10 digits mobile no.";
        $(txtmob).css({
            "border-color": "#ff0000",
            "border-width": "1px",
            "border-style": "solid"
        })
        //$(txtmob).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">' + msg + ' </span>');
        $(txtmob).focus();
        $(txtmob).attr('title', $(txtmob).val());

    }


    else {
        $(txtmob).css({
            "border-color": "",
            "border-width": "",
            "border-style": ""
        });
        $(txtmob).attr('title', $(txtmob).val());

    }

}

function EmpEmailid(emailid) {

    var txtvalue = $(emailid).val();
    var msg = "Invalid Eamil";

    if (txtvalue == '' || txtvalue == undefined) {
        msg = "Email is Required";
        $(emailid).css({
            "border-color": "#ff0000",
            "border-width": "1px",
            "border-style": "solid"
        })
        $(emailid).focus();

    }

    else if (IsEmail(txtvalue) == false) {

        $(emailid).css({
            "border-color": "#ff0000",
            "border-width": "1px",
            "border-style": "solid"
        });
        $(emailid).attr('title', $(emailid).val());
    }
    else {
        $(emailid).css({
            "border-color": "",
            "border-width": "",
            "border-style": ""
        });
        $(emailid).attr('title', $(emailid).val());
    }

}

function checkmobileno(mobilenoreff) {

    $(mobilenoreff).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error"></span>');
    //alert("mobile no check function callecd");
    var mobileno = $(mobilenoreff).val();

    if (mobileno != "") {
        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",

            url: siteurl + "VisitorRegistration.aspx/Checkmobileno",
            data: '{mobileno:' + JSON.stringify(mobileno) + '}',
            dataType: "json",
            //called on jquery ajax call success
            success: function (result) {
                debugger;

                if (result.d == "1") {

                    isdbvalidatiionvalidmobile = true;

                    $(mobilenoreff).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Mobile no already registered with us. </span>');

                }
                else {

                    isdbvalidatiionvalidmobile = false;
                    $(mobilenoreff).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error"></span>');


                }
            },
            error: function ajaxError(result) {
                //  alert(result.error);

            }

        });
    }

}

function checkGSTNO(GSTINreff) {

    $(GSTINreff).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error"></span>');
    //alert("mobile no check function callecd");
    var GSTIN = $(GSTINreff).val();

    if (GSTIN != "") {
        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",

            url: siteurl + "VisitorRegistration.aspx/checkGSTNO",
            data: '{GSTIN:' + JSON.stringify(GSTIN) + '}',
            dataType: "json",
            //called on jquery ajax call success
            success: function (result) {
                debugger;

                if (result.d == "1") {
                    isdbvalidatiionvalidGST = true;

                    $(GSTINreff).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">GSTIN is already registered with us. </span>');

                }
                else {

                    isdbvalidatiionvalidGST = false;
                    $(GSTINreff).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error"></span>');


                }
            },
            error: function ajaxError(result) {
                //  alert(result.error);

            }

        });
    }

}

function ValidateTextboxGST(txtboxname, msg) {

    var txtvalue = $(txtboxname).val();
    var msg = "GSTIN is required";
    if (txtvalue == '' || txtvalue == 'undefined') {


        $(txtboxname).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">' + msg + ' </span>');

        $(txtboxname).focus();
    }
    else if (txtvalue.length != 15) {
        msg = "Enter 15 digits GSTIN";
        $(txtboxname).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">' + msg + ' </span>');
        $(txtboxname).focus();
        isdbvalidatiionvalidGST = true;



    }
    else {
        isdbvalidatiionvalidGST = false;
        $(txtboxname).parent('.ctrl').find('div').html('');

    }

}

function CheckEmailID(reff) {


    email = $(reff).val();


    if (IsEmail(email)) {

        if (email != "" && email.length > 4) {
            var obj = {
                Email: email
            };
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: siteurl + "VisitorRegistration.aspx/CheckEmail",
                data: '{Email:' + JSON.stringify(email) + '}',
                dataType: "json",
                //called on jquery ajax call success
                success: function (result) {

                    if (result.d == null) {

                        // alert("No record found");
                    }
                    else {
                        if (result.d == "1") {

                            $(reff).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Email already registered with us.</span>');
                            var v = $("#herrorcount").val();

                            isdbvalidatiionvalidemail = true;

                            if (v != "") {
                                $("#herrorcount").val(parseInt(v) + 1);
                            }
                            //alert("email already ");
                        }
                        else {
                            $(reff).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error"></span>');
                            var v = $("#herrorcount").val();

                            isdbvalidatiionvalidemail = false;

                            if (v != "") {

                                $("#herrorcount").val(parseInt(v) - 1);
                            }
                            //  alert("new email");
                        }
                    }
                },
                error: function ajaxError(result) {
                    // alert(result.error);

                }
            });
        }
    }
    else {
        isdbvalidatiionvalid = false;
        $(reff).parent('.ctrl').find('div').html('<span class="invalid-feedback js-error">Email Invalid</span>');

    }
}


function ValidateGreenFileUpload(txtboxname) {

    var txtvalue = $(txtboxname).val();


    if (txtvalue == '' || txtvalue == 'undefined') {

        $(txtboxname).css({
            "border-color": "#ff0000",
            "border-width": "1px",
            "border-style": "solid"
        });
        $(txtboxname).removeClass("file_upload");


    }
    else {
        $(txtboxname).css({
            "border-color": "",
            "border-width": "",
            "border-style": ""
        });
        // $(txtboxname).addClass("file_upload");
        // $.contains
        //$.inArray($("#file_upload_Idproof").val().split('.').pop().toLowerCase(), fileExtension) == -1
        if ($(txtboxname).val().split('.').pop().toLowerCase() == "jpg") {

            $(txtboxname).addClass("jpg_upload");

            //  alert("jpg");
        }
        else if ($(txtboxname).val().split('.').pop().toLowerCase() == "jpeg") {

            $(txtboxname).addClass("jpg_upload");

            //  alert("jpg");
        }
        else if ($(txtboxname).val().split('.').pop().toLowerCase() == "pdf") {

            $(txtboxname).addClass("pdf_upload");

            // alert("pdf");
        }
        else {


            $(txtboxname).val('');
            $(txtboxname).removeClass("jpg_upload");
            $(txtboxname).removeClass("pdf_upload");
            $.alert({
                title: 'Alert!',
                content: 'Only jpg, jpeg, pdf formats are allowed !',
            });
        }
    }

}

function removerow(rowreff) {

    $("#loder").show();
    var txtvalue = $(rowreff).val();

    var empid = $(rowreff).attr("data-empid");

    var visitorid = $('#hvisitorid').val();

    if (confirm("Are you sure you want to remove ?")) {
        if (empid != "") {

            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",

                url: siteurl + "VisitorRegistration.aspx/removeaddempdetails",
                data: '{empid:' + JSON.stringify(empid) + '}',
                dataType: "json",
                //called on jquery ajax call success
                success: function (result) {
                    debugger;
                    $("#loder").hide();

                    if (result.d == "1") {

                        $(rowreff).closest("tr").remove();
                        //remove row

                        debugger;
                        $.ajax({
                            type: "POST",
                            contentType: "application/json; charset=utf-8",
                            url: siteurl + "VisitorRegistration.aspx/BindEmptable",
                            data: '{visitorid:' + JSON.stringify(visitorid) + '}',
                            dataType: "json",
                            success: function (data) {
                                // alert("success");
                                y = 1;
                                debugger;
                                $("#tblempdeatil").empty();
                                var tt;
                                $("#hrowcount").val(data.d.length);
                                //data.d.length

                                var amt = 0;
                                //$("#tblempdeatil").append("<tr class='danger'><th>S.No.</th><th>Membership No. </th><th>Company Name </th><th>Authorised Person </th></tr>");
                                for (var i = 0; i < data.d.length; i++) {
                                    var index = parseInt(i) + 1;
                                    //$("#grd_viewvisitor").append("<tr><td>" + index + "</td><td><a class='fancybox fancybox.iframe' href='ViewDetail.aspx?boothid=" + data.d[i].BoothID + "'>" + data.d[i].Exehibitorname + "</a></td><td>" + data.d[i].Boothno + "</td><td>" + data.d[i].City + "</td><td>" + data.d[i].Category + "</td></tr>");

                                    // var idpro = (data.d[i].IdProof).indexOf('.pdf') > -1 ? "<a href='#'><i class='fa fa-file-pdf-o'></i></a>" : "<img src='uploads/idproofemp/" + data.d[i].IdProof + "' style='max-height:80px;' />"


                                    tt += "<tr><td>" + index + "</td><td>" + data.d[i].Name + "</td><td>" + data.d[i].MobileNo + "</td><td>" + data.d[i].Email + "</td><td>" + data.d[i].Designation + "</td><td align='right'>" + parseFloat(data.d[i].Amount) + "/-</td><td><img src='uploads/idproofemp/" + data.d[i].IdProof + "' style='max-height:40px;' /></td><td><img src='uploads/panCardemp/" + data.d[i].PanCard + "' style='max-height:40px;' /></td><td><img src='uploads/colorPhotoemp/" + data.d[i].ColorPhoto + "' style='max-height:40px;' /></td><td><img src='images/close.png' style='max-height:20px;' onclick='removerow(this)'  data-empid='" + data.d[i].id + "'  title='Remove'></td></tr>";

                                    amt += parseFloat(data.d[i].Amount);

                                }

                                $("#txtamountbadges").text(amt);

                                $("#tblempdeatil").append(tt);
                                $("#loder").hide();
                                clearemp();
                            },
                            error: function (result) {
                                alert(result.responseText);
                                $("#loder").hide();

                            }
                        });


                    }
                    else {

                        //eeror alert


                    }
                },
                error: function ajaxError(result) {
                    //  alert(result.error);
                    $("#loder").hide();

                }

            });

        }
    }

}

function checkfileExt(file) {
    var fileExtension = ['jpg', 'jpeg', 'pdf'];


    if ($.inArray($(file).val().split('.').pop().toLowerCase(), fileExtension) == -1) {


        $.alert({
            title: 'Hold On !',
            content: "Only " + fileExtension.join(', ') + " formats are allowed.",
        });


        $(file).val('');
        return false;


    }
    else {

        // return true;
    }

    if (file.files[0].size <= 2e+6) {
        return true;
    }
    else {

        $.alert({
            title: 'Hold On !',
            content: "File size must be less then or equal 2MB",
        });

        $(file).val('');

        return false;

    }
}

function hasWhiteSpace(s) {
    return /\s/g.test(s);
}


//function readURL(input) {

//    if (input.files && input.files[0]) {
//        var reader = new FileReader();



//        reader.onload = function (e) {

//            // var idd1= e.attr("id");
//            var idd = input.name;


//            var image;



//            var extention = input.files[0].name.split('.').pop().toLocaleLowerCase();
//            if (extention === "jpg" || extention === "pdf") {
//                if (input.files[0].size <= 2e+6) {
//                  //  image.setAttribute("src", e.target.result);
//                } else {
//                    alert("File size must be less then or equal 2MB", "error");
//                    $(input).val("");
//                    //$(".imgPriview").prop("src", "../images/noimage.jpg");

//                }


//            } else {
//                ShowNotify("Only .jpg file type allowed!", "error");
//                $(input).val("");
//                $(".imgPriview").prop("src", "../images/noimage.jpg");
//            }

//            //   $('#imglogo').attr('src', e.target.result);
//        }

//        //reader.readAsDataURL(input.files[0]);
//    }
//}