| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/adeetie_hellogtx/assets/js/ |
Upload File : |
$(document).ready(() => {
let unAuthEmail = ['gmail.com', 'hotmail.com', 'rediff.com', 'outlook.com', 'yahoo.com', 'yahoo.co.in', 'aol.com'];
$.validator.addMethod("alphas", function(value, element) {
return this.optional(element) || value == value.match(/^[a-zA-Z ]+$/);
});
$.validator.addMethod("official", function(value, element) {
this.optional(element);
if(value) {
let emailExt = value.split("@")[1];
return unAuthEmail.indexOf(emailExt) > -1 ? false: true;
}
});
$("#firegistration").validate({
rules: {
company: {
required: true,
minlength: 5
},
address: {
required: true,
minlength: 5
},
name: {
required: true,
minlength: 5,
alphas: true
},
designation: {
required: true,
minlength: 5,
alphas: true
},
email: {
required: true,
email: true,
official: true
},
mobile_number: {
required: true,
minlength: 10,
maxlength: 10,
number: true
},
inc_date: {
required: true,
minlength: 5
},
rbi_reg_date: {
required: true,
minlength: 5
},
authorized_by: {
required: true,
minlength: 8,
alphas: true
},
category: {
required: true
},
branch_name: {
required: true,
minlength: 5
},
loan_sanctioned_lastyear: {
required: true,
min: 50
},
loan_disbursed_lastyear: {
required: true,
min: 50
}
},
messages: {
company: {
required: "Please provide valid Financial Institution Name",
minlength: "Please provide valid Financial Institution Name",
alphas: "Please provide valid Financial Institution Name"
},
address: {
required: "Please provide valid Financial Institution address",
minlength: "Please provide valid Financial Institution address"
},
name: {
required: "Please provide valid Nodal Officer Name",
minlength: "Please provide valid name",
alphas: "Please provide valid name"
},
designation: {
required: "Please provide valid designation",
minlength: "Please provide valid designation",
alphas: "Please provide valid designation"
},
email: {
required: "Please provide official email id",
minlength: "Please provide official email id",
official: "Please provide official email id"
},
mobile_number: {
required: "Please provide valid Mobile Number",
minlength: "Please provide valid Mobile no"
},
authorized_by: {
required: "Please provide valid Authorized By",
minlength: "Please provide valid Authorized By",
alphas: "Only Alphabet and space is allowed"
},
category: {
required: "Please select a Financial Institution category"
},
branch_name: {
required: "Please provide Branch Name",
minlength: "Please provide Branch Name"
},
inc_date: {
required: "Please provide Incorporation Date",
minlength: "Please provide Incorporation Date"
},
rbi_reg_date: {
required: "Please provide RBI Registration Date",
minlength: "Please provide RBI Registration Date"
},
business_performance: {
required: "Please provide Business Performance",
minlength: "Please provide Business Performance"
},
}, submitHandler: function (form, event) {
let unAuthEmail = ['gmail.com', 'hotmail.com', 'rediff.com', 'outlook.com', 'yahoo.com', 'yahoo.co.in', 'aol.com'];
const email = jQuery("#emailid").val();
let emailExt = email.split("@")[1];
if (unAuthEmail.indexOf(emailExt) > -1) {
$("#emailid").parent().after('<label id="emailid-error" class="error" for="emailid">Please enter official email id</label>');
return false;
} else {
$("#emailid").parent().after("");
return true;
}
}
});
});
$(document).ready(() => {
$("#category").on("change", function () {
if (this.value === 'nbfc') {
$("#nbfcbox").show();
$("#creditrating").show();
$("#creditratingReport").show();
} else {
$("#nbfcbox").hide();
$("#creditrating").hide();
$("#creditratingReport").hide();
$("#nbfc_category").val('');
$("#credit_rating").val('');
}
});
});
const app = {};
app.uploadUrl = '';
app.fileUpload = (event, ids) => {
if (!event.files[0]) {
return;
}
const file = event.files[0];
const formData = new FormData();
formData.append("csrf_test_name", url.csrf)
formData.append("userfile", file);
formData.append("name", ids);
axios.post(`${app.uploadUrl}/upload/`, formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
}).then((response) => {
if(response.data.status === 'failed') {
$("#fileuploadErrorMsg").html(response.data.filename);
$("#fileuploadError").modal('show');
return;
}
$(`#${ids}`).val(response.data.filename);
url.csrf = response.data.ci_token_name;
});
}