Add JS files
This commit is contained in:
4
modules/EcmWorkers/js/detailView.js
Executable file
4
modules/EcmWorkers/js/detailView.js
Executable file
@@ -0,0 +1,4 @@
|
||||
$(document).ready(function () {
|
||||
console.log($("#first_name").html());
|
||||
//$("#ecmworker_name").val($("#first_name").val() + " " + $("#last_name").val());
|
||||
});
|
||||
62
modules/EcmWorkers/js/editView.js
Executable file
62
modules/EcmWorkers/js/editView.js
Executable file
@@ -0,0 +1,62 @@
|
||||
$(document).ready(function () {
|
||||
var tmp = $("#pesel");
|
||||
tmp.blur(function () {
|
||||
if (tmp.val().length != 0) {
|
||||
if (!validatepesel(tmp.val(),$("birthday").val())) {
|
||||
alert("Nie prawidłowy numer pesel!");
|
||||
// document.getElementById("pesel").focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
tmp = $("#bank_account_number");
|
||||
tmp.blur(function () {
|
||||
if (tmp.val().length != 0) {
|
||||
if (!NRBvalidatior(tmp.val())) {
|
||||
alert("Nie prawidłowy numer konta!");
|
||||
// document.getElementById("bank_account_number").focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
tmp = $("#email1");
|
||||
tmp.blur(function () {
|
||||
if (tmp.val().length != 0) {
|
||||
if (!validateEmail(tmp.val())) {
|
||||
alert("Nie prawidłowy adres email!");
|
||||
//document.getElementById("email1").focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function validatepesel(pesel, birthday) {
|
||||
var reg = /^[0-9]{11}$/;
|
||||
if (reg.test(pesel) == false) {
|
||||
//return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function NRBvalidatior(nrb) {
|
||||
nrb = nrb.replace(/[^0-9]+/g, '');
|
||||
var Wagi = new Array(1, 10, 3, 30, 9, 90, 27, 76, 81, 34, 49, 5, 50, 15, 53, 45, 62, 38, 89, 17, 73, 51, 25, 56, 75, 71, 31, 19, 93, 57);
|
||||
if (nrb.length == 26) {
|
||||
nrb = nrb + "2521";
|
||||
nrb = nrb.substr(2) + nrb.substr(0, 2);
|
||||
var Z = 0;
|
||||
for (var i = 0; i < 30; i++) {
|
||||
Z += nrb[29 - i] * Wagi[i];
|
||||
}
|
||||
if (Z % 97 == 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function validateEmail(email) {
|
||||
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
return re.test(email);
|
||||
}
|
||||
Reference in New Issue
Block a user