diff --git a/app/Views/addEmployeenew.php b/app/Views/addEmployeenew.php index 584c36fc..3e6464d8 100755 --- a/app/Views/addEmployeenew.php +++ b/app/Views/addEmployeenew.php @@ -314,10 +314,17 @@ $("#photo").src(""); } + + function capitalizeFirstLetter(word) { + if (!word) return ""; // Handle empty or undefined strings + return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); + } + function ValidatePassport() { - var regsaid = /^[A-Z][1-9]\d\s?\d{4}[1-9]$/; - var passport = $("#passportno").val().trim(); + var regsaid =/^[A-Z][1-9]\d\s?\d{4}[1-9]$/; + + var passport = capitalizeFirstLetter($("#passportno").val().trim()); if (regsaid.test(passport) == false) { alert('You have entered invalid Passport.'); @@ -1042,7 +1049,6 @@ IsActive; - $ProfilePicPath=''; + $ProfilePicPath = ''; if (!empty($Emp->ProfilePic)) { - $ProfilePicPath = base_url().'public/uploads/images/' . $Emp->ProfilePic; + $ProfilePicPath = base_url() . 'public/uploads/images/' . $Emp->ProfilePic; } else { - $ProfilePicPath = base_url().'public/assets/dist/img/avatar.png'; + $ProfilePicPath = base_url() . 'public/assets/dist/img/avatar.png'; } $Reference_Name = $Emp->Reference_Name; $Reference_ContactNumber = $Emp->Reference_ContactNumber; @@ -202,9 +202,8 @@ if (!empty($EmpDetails)) {
-
+
@@ -213,8 +212,8 @@ if (!empty($EmpDetails)) {
your image + src="" alt="your image" + style="width: 139px;" /> @@ -239,8 +238,8 @@ if (!empty($EmpDetails)) { - + readonly> +
@@ -1004,34 +1003,33 @@ if (!empty($EmpDetails)) { maxlength="14" onchange="ValidateAadhar();" class="form-control" onkeypress="return isNumberKey(event)" required - value=""> + value="">
+ maxlength="255" class="form-control" value="Aadhar" + readonly>
+ if (!empty($aadharFile)) { ?>
- - - -
- -
- - + + + +
+ +
+ +
-
- +
+
- +
@@ -1042,33 +1040,32 @@ if (!empty($EmpDetails)) { onchange="validatePAN();" class="form-control" pattern="([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}" title=" 5 character,4 Digit Numbers,1 character (ex:ABCDE1234A) " - onkeypress="return alpha(event);" - value="" - > + onkeypress="return alpha(event);" value="">
+ maxlength="255" class="form-control" value="PAN" + readonly>
- +
- - - -
- -
- - + + + + + +
+ +

- +
@@ -1077,36 +1074,35 @@ if (!empty($EmpDetails)) { + value="">
+ maxlength="255" class="form-control" value="Passport" + readonly>
- +
- - - -
- -
- - + + + + + +
+ +

- + @@ -1118,23 +1114,23 @@ if (!empty($EmpDetails)) { maxlength="255" class="form-control" value="Bank Passbook" readonly> - +
- - - -
- -
- - + + + + + +
+ +

- +
@@ -1143,25 +1139,25 @@ if (!empty($EmpDetails)) { + value="">
- +
- - - -
- -
- - + + + + + +
+ +

- + @@ -1211,8 +1207,8 @@ if (!empty($EmpDetails)) {
+ The last character should be any number from 1 to 9.">
@@ -1698,17 +1693,16 @@ if (!empty($EmpDetails)) { } function ValidatePassport() { - var regsaid = /^[A-Z][1-9]\d\s?\d{4}[1-9]$/ig; - var passport = $("#passportno").val().trim(); + var regsaid = /^[A-Z][1-9]\d\s?\d{4}[1-9]$/; + + var passport = capitalizeFirstLetter($("#passportno").val().trim()); + if (regsaid.test(passport) == false) { alert('You have entered invalid Passport.'); - alert(` The first character must be an uppercase alphabet. - The next two characters should be numbers, - with the first character ranging from 1 to 9 and the second character from 0 to 9. - It may include zero or one white space character. - The subsequent four characters can be any number from 0 to 9. - The last character should be any number from 1 to 9."`); - return; + alert(`The first character must be an uppercase alphabet. The next two characters should be numbers,with the first character ranging from 1 to 9 and the second character from 0 to 9. It may include zero or one white space character. The subsequent four characters can be any number from 0 to 9. The last character should be any number from 1 to 9."`); + return (false); + } else { + return true; } } @@ -2063,16 +2057,25 @@ if (!empty($EmpDetails)) {