employee module changes-1 vadivel J 06-12-2024

This commit is contained in:
vadivelJ96 2024-12-06 15:11:36 +05:30
parent ebc063632b
commit 7728284015
3 changed files with 46 additions and 27 deletions

View File

@ -382,7 +382,7 @@ class Inwardgateregister extends BaseController
if (!empty($MasterFile)) {
$requestMasterFileName = $MasterFile->getName();
if ($MasterFile && $MasterFile->isValid() && !$MasterFile->hasMoved()) {
if (!empty($this->inwardgateregister_model->isFileExistsInIGRmaster($requestMasterFileName))) {
if (!empty($this->inwardgateregister_model->isFileExistsInIGRmaster(filename: $requestMasterFileName))) {
log_message('error', 'File already exists in the database'.$requestMasterFileName);
}
else{
@ -1727,7 +1727,7 @@ function updateIGRWeight(){
// Ensure file exists and is not a directory
if (file_exists($filePath) && is_file($filePath)) {
// Sanitize filename for ZIP
$sanitizedFilename = preg_replace('/[^a-zA-Z0-9_\-\.]/', '_', $file->filename);
$sanitizedFilename = preg_replace('/[^a-zA-Z0-9_\-\.]/', '_', $file->file);
if (!$zip->addFile($filePath, $sanitizedFilename)) {
echo '<script>alert("Failed to add file: ' . $file->filename . '");</script>';
$zip->close();

View File

@ -315,11 +315,13 @@
}
function ValidatePassport() {
var regsaid = /^[aA-prPR-wyWY][1-9]\d\s?\d{4}[1-9]$/ig;
var passport = $("#passportno").val();
//alert(passport);
var regsaid = /^[A-Z][1-9]\d\s?\d{4}[1-9]$/;
var passport = $("#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 (false);
} else {
return true;
@ -1001,7 +1003,7 @@
class="form-control" value="Aadhar" readonly>
</div>
<div class="col-md-4">
<label>Select Aadhar File</label>
<label>Select Aadhar File</label><br>
<input type="file" name="emp_file1" class="">
</div>
@ -1027,7 +1029,7 @@
class="form-control" value="PAN" readonly>
</div>
<div class="col-md-4">
<label>Select PAN File</label>
<label>Select PAN File</label><br>
<input type="file" name="emp_file2" class="">
</div>
</div>
@ -1039,8 +1041,15 @@
<input type="text" id="passportno" maxlength="9"
onchange="ValidatePassport();" name="passportno"
style="text-transform:uppercase" class="form-control"
pattern="[aA-prPR-wyWY]{1}[1-9]{1}\d{1}\s\d{4}[1-9]{1}" title="The first digit or the last digit will never be 0
The first character cannot be Q, X or Z. (eg:A12 34567)" onkeypress="return alpha(event);">
pattern="^[A-Z][1-9]\d\s?\d{4}[1-9]$"
title="
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."
>
</div>
<div class="col-md-4">
@ -1049,7 +1058,7 @@
class="form-control" value="Passport" readonly>
</div>
<div class="col-md-4">
<label>Select Passport File</label>
<label>Select Passport File</label><br>
<input type="file" name="emp_file3" class="">
</div>
@ -1063,7 +1072,7 @@
class="form-control" value="Bank Passbook" readonly>
</div>
<div class="col-md-4">
<label>Select Bank PassBok File</label>
<label>Select Bank PassBok File</label><br>
<input type="file" name="emp_file4" class="">
</div>
</div>
@ -1076,7 +1085,7 @@
class="form-control" value="Other Document" >
</div>
<div class="col-md-4">
<label>Select Other Document File </label>
<label>Select Other Document File </label><br>
<input type="file" name="emp_file5" class="">
</div>
</div>

View File

@ -1026,7 +1026,7 @@ if (!empty($EmpDetails)) {
<?php }?>
<div class="col-md-4">
<label>Update Aadhar File</label>
<label>Update Aadhar File</label><br>
<input type="file" name="emp_file1" class=""
value="">
</div>
@ -1064,7 +1064,7 @@ if (!empty($EmpDetails)) {
<?php }?>
<div class="col-md-4">
<label>Update PAN File</label>
<label>Update PAN File</label><br>
<input type="file" name="emp_file2" class="">
</div>
@ -1102,7 +1102,7 @@ if (!empty($EmpDetails)) {
<?php }?>
<div class="col-md-4">
<label>Update Passport File</label>
<label>Update Passport File</label><br>
<input type="file" name="emp_file3" class="">
</div>
@ -1130,7 +1130,7 @@ if (!empty($EmpDetails)) {
<?php }?>
<div class="col-md-4">
<label>Update Bank PassBok File</label>
<label>Update Bank PassBok File</label><br>
<input type="file" name="emp_file4" class="">
</div>
@ -1157,7 +1157,7 @@ if (!empty($EmpDetails)) {
<?php }?>
<div class="col-md-4">
<label>Update Other Document File </label>
<label>Update Other Document File </label><br>
<input type="file" name="emp_file5" class="">
</div>
@ -1210,12 +1210,17 @@ if (!empty($EmpDetails)) {
<div class="col-md-4"><label>Passport Number</label>
<input type="text" id="passportno" maxlength="9"
onchange="ValidatePassport();" name="passportno"
name="passportno"
style="text-transform:uppercase" class="form-control"
pattern="[aA-prPR-wyWY]{1}[1-9]{1}\d{1}\s\d{4}[1-9]{1}"
title="The first digit or the last digit will never be 0
The first character cannot be Q, X or Z. (eg:A12 34567)"
onkeypress="return alpha(event);">
pattern="^[A-Z][1-9]\d\s?\d{4}[1-9]$"
title="
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."
>
</div>
<div class="col-md-4">
<label>Passport File Name</label>
@ -1340,7 +1345,7 @@ if (!empty($EmpDetails)) {
//var reg = /(?=.*[A-Za-z]).{5,}(?=.*[0-9]).{4,}(?=.*[A-Za-z]).{1,}$/;
var regpan = /^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$/;
var PAN = $('#panno').val();
var PAN = $('#panno').val().trim();
if (PAN != '') {
if (regpan.test(PAN) == false) {
@ -1361,7 +1366,7 @@ if (!empty($EmpDetails)) {
function ValidateAadhar() {
//alert('validation entered');
var reg = /^\d{4}\s\d{4}\s\d{4}$/
var aadhar = $('#aadharno').val();
var aadhar = $('#aadharno').val().trim();
var aadhar_count = $('#aadharno').val().length;
if (aadhar != '') // && aadhar_count != '')
@ -1692,11 +1697,16 @@ if (!empty($EmpDetails)) {
}
function ValidatePassport() {
var regsaid = /^[A-PR-WY][1-9]\d\s?\d{4}[1-9]$/ig;
var passport = $("#passportno").val();
//alert(passport);
var regsaid = /^[A-Z][1-9]\d\s?\d{4}[1-9]$/ig;
var passport = $("#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;
}