Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme

This commit is contained in:
Smart 2024-10-24 08:18:45 +05:30
commit 1be49e8aea
5 changed files with 670 additions and 380 deletions

View File

@ -198,6 +198,40 @@ class Employeedetails extends BaseController
/**
* This function is used to save the new Employee form in the database
*/
/**
* This function is used to save the new Employee form in the database
*/
/**
* This function is used to save the new Employee form in the database
*/
/**
* This function is used to save the new Employee form in the database
*/
/**
* This function is used to save the new Employee form in the database
*/
/**
* This function is used to save the new Employee form in the database
*/
/**
* This function is used to save the new Employee form in the database
*/
/**
* This function is used to save the new Employee form in the database
*/
/**
* This function is used to save the new Employee form in the database
*/
/**
* This function is used to save the new Employee form in the database
*/
/**
* This function is used to save the new Employee form in the database
*/
/**
* This function is used to save the new Employee form in the database
*/
function AddNewEmployee()
{
@ -338,11 +372,25 @@ class Employeedetails extends BaseController
if ($result) {
// Get the uploaded files
$files = $this->request->getFiles();
$fileNames = $this->request->getPost('file_name'); // Get user-entered file names
if (isset($files['emp_file'])) {
foreach ($files['emp_file'] as $index => $file) {
if ($file->isValid() && !$file->hasMoved()) {
$files1 = $this->request->getFile('emp_file1');
$files2 = $this->request->getFile('emp_file2');
$files3 = $this->request->getFile('emp_file3');
$files4 = $this->request->getFile('emp_file4');
$files5 = $this->request->getFile('emp_file5');
$files=[$files1,$files2,$files3,$files4,$files5];
$fileName1 = $this->request->getPost('file_name1');
$fileName2 = $this->request->getPost('file_name2');
$fileName3 = $this->request->getPost('file_name3');
$fileName4 = $this->request->getPost('file_name4');
$fileName5 = $this->request->getPost('file_name5');
$fileNames=[$fileName1,$fileName2,$fileName3,$fileName4,$fileName5];
if (!empty($files)) {
foreach ($files as $index => $file) {
if ($file && $file->isValid() && !$file->hasMoved()) {
// Move the file to the desired directory
$newName = $file->getRandomName();
$file->move(ROOTPATH . 'public/uploads/images/emp_files', $newName);
@ -351,16 +399,15 @@ class Employeedetails extends BaseController
$this->empFiles->save([
'file_name' => $fileNames[$index], // User-entered file name
'emp_file' => $newName, // New file name
'emp_id' => $result,
'emp_id' => $result['EmpID'],
'path' => $path
]);
}
}
}
$EmpID = $result;
$EmpID = $result['EmpID'];
$Total_Salary = $this->request->getPost('Total_salary');
$Basic_Pay = $this->request->getPost('Basic_Pay');
$HRA_Rate = $this->request->getPost('HRA_Rate');
@ -613,19 +660,46 @@ class Employeedetails extends BaseController
}
}
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
/* To Update the employee details*/
function UpdateEmployee()
{
$EmpId = $this->request->getPost('employeeid');
$EmpId = $this->request->getGet('empId');
$EmpId = $this->request->getPost('employeeid');
$PictureName = $this->request->getPost('Image');
$ModifyPictureName = $this->request->getPost('ModifyImage');
$Picture = "";
@ -816,27 +890,41 @@ class Employeedetails extends BaseController
//print_r($Employee);die();
$result = $this->employeedetails_model->UpdateEmployee($Employee, $EmpId);
// Get the uploaded files
$files = $this->request->getFiles();
$fileNames = $this->request->getPost('file_name'); // Get user-entered file names
if (isset($files['emp_file'])) {
foreach ($files['emp_file'] as $index => $file) {
if ($file->isValid() && !$file->hasMoved()) {
// Move the file to the desired directory
$newName = $file->getRandomName();
$file->move(ROOTPATH . 'public/uploads/images/emp_files', $newName);
$path = ROOTPATH . 'public/uploads/images/emp_files/' . $newName;
// Store the file information in the database
$this->empFiles->save([
'file_name' => $fileNames[$index], // User-entered file name
'emp_file' => $newName, // New file name
'emp_id' => $EmpId,
'path' => $path
]);
}
}
}
// Get the uploaded files
$files1 = $this->request->getFile('emp_file1');
$files2 = $this->request->getFile('emp_file2');
$files3 = $this->request->getFile('emp_file3');
$files4 = $this->request->getFile('emp_file4');
$files5 = $this->request->getFile('emp_file5');
$files=[$files1,$files2,$files3,$files4,$files5];
$fileName1 = $this->request->getPost('file_name1');
$fileName2 = $this->request->getPost('file_name2');
$fileName3 = $this->request->getPost('file_name3');
$fileName4 = $this->request->getPost('file_name4');
$fileName5 = $this->request->getPost('file_name5');
$fileNames=[$fileName1,$fileName2,$fileName3,$fileName4,$fileName5];
if (!empty($files)) {
foreach ($files as $index => $file) {
if ($file && $file->isValid() && !$file->hasMoved()) {
// Move the file to the desired directory
$newName = $file->getRandomName();
$file->move(ROOTPATH . 'public/uploads/images/emp_files', $newName);
$path = ROOTPATH . 'public/uploads/images/emp_files/' . $newName;
// Store the file information in the database
$this->empFiles->save([
'file_name' => $fileNames[$index], // User-entered file name
'emp_file' => $newName, // New file name
'emp_id' => $EmpId,
'path' => $path
]);
}
}
}

View File

@ -21,4 +21,3 @@ class EmpFilesModel extends Model
];
}
?>

View File

@ -86,7 +86,7 @@ class Employeedetails_model extends Model
$query = $builder->get();
$result = $query->getRowArray();
return $result['EmpID'];
return $result;
} else {
return 0;

View File

@ -423,13 +423,7 @@
<span class="d-none d-sm-inline">Proof</span>
</a>
</li>
<li class="nav-item" data-target-form="#fileForm">
<a href="#fivth" data-toggle="tab" class="nav-link">
<!-- <a data-toggle="tab" class="nav-link"> -->
<span class="number">5</span>
<span class="d-none d-sm-inline">File Upload</span>
</a>
</li>
</ul>
<div class="tab-content mb-0 b-0">
@ -1003,19 +997,37 @@
</div>
<div class="tab-pane fade" id="fourth">
<form id="proofForm" method="post" action="#" class="form-horizontal">
<form id="proofForm" method="post" action="#" class="form-horizontal" enctype="multipart/form-data">
<div class="row">
<div class="col-md-1">
</div>
<div class="col-md-11">
<div class="row">
<div class="col-md-3"><label>Aadhar Number</label> <span
<div class="col-md-4"><label>Aadhar Number</label> <span
class="badge">*</span>
<input type="text" id="aadharno" name="aadharno" maxlength="14"
onchange="ValidateAadhar();" class="form-control"
onkeypress="return isNumberKey(event)" required>
</div>
<div class="col-md-3"><label>PAN Number</label>
<div class="col-md-4">
<label>Aadhar File Name</label>
<input type="text" id="file_name" name="file_name1" maxlength="255"
class="form-control" value="Aadhar" readonly>
</div>
<div class="col-md-4">
<label>Select Aadhar File</label>
<input type="file" name="emp_file1" class="">
</div>
</div>
<div class="row">
<div class="col-md-4"><label>PAN Number</label>
<input type="text" id="panno" maxlength="10"
style="text-transform:uppercase" name="panno"
onchange="validatePAN();" class="form-control"
@ -1023,18 +1035,67 @@
title=" 5 character,4 Digit Numbers,1 character (ex:ABCDE1234A) "
onkeypress="return alpha(event);">
</div>
<div class="col-md-3"><label>Passport Number</label>
<div class="col-md-4">
<label>PAN File Name</label>
<input type="text" id="file_name" name="file_name2" maxlength="255"
class="form-control" value="PAN" readonly>
</div>
<div class="col-md-4">
<label>Select PAN File</label>
<input type="file" name="emp_file2" class="">
</div>
</div>
<div class="row">
<div class="col-md-4"><label>Passport Number</label>
<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);">
</div>
<div class="col-md-4">
<label>Passport File Name</label>
<input type="text" id="file_name" name="file_name3" maxlength="255"
class="form-control" value="Passport" readonly>
</div>
<div class="col-md-4">
<label>Select Passport File</label>
<input type="file" name="emp_file3" class="">
</div>
</div>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<label>Bank PassBok Name</label>
<input type="text" id="file_name" name="file_name4" maxlength="255"
class="form-control" value="Bank Passbook" readonly>
</div>
<div class="col-md-4">
<label>Select Bank PassBok File</label>
<input type="file" name="emp_file4" class="">
</div>
</div>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<label>Other Document File Name</label>
<input type="text" id="file_name" name="file_name5" maxlength="255"
class="form-control" value="Other Document" >
</div>
<div class="col-md-4">
<label>Select Other Document File </label>
<input type="file" name="emp_file5" class="">
</div>
</div>
</div>
</div>
@ -1042,48 +1103,11 @@
<ul class="list-inline wizard mb-0">
<li class="previous list-inline-item"><a href="javascript: void(0);" class="btn btn-secondary">Previous</a>
</li>
<li class="next list-inline-item float-right"><a href="javascript: void(0);" class="btn btn-secondary">Next</a></li>
</ul>
</div>
<div class="tab-pane fade" id="fivth">
<form id="fileForm" method="post" action="#" class="form-horizontal" enctype="multipart/form-data" style="height: 250px;">
<div class="row">
<div class="col-md-1">
</div>
<div class="col-md-11">
<div class="row">
<!-- <div class="files"> -->
<div class="col-md-4">
<label>File Name</label>
<input type="text" id="file_name" name="file_name[]" maxlength="255"
class="form-control">
</div>
<div class="col-md-4">
<label>File</label>
<input type="file" name="emp_file[]" class="form-control">
</div>
<div class="col-md-4" style="margin-top: 32px;">
<button type="button" class="btn btn-primary btn-sm a1"
onclick="appendFilesFileds()" id="day">
Add
</button>
</div>
<div id="filesContainer" class="col-12"></div>
<!-- </div> -->
</div>
</div>
</div>
</form>
<ul class="list-inline wizard mb-0">
<li class="previous list-inline-item"><a href="javascript: void(0);" class="btn btn-secondary">Previous</a>
</li>
<!-- <li class="next list-inline-item float-right"> -->
<button type="submit" class="btn btn-primary submit float-right">Submit</button>
<!-- </li> -->
</ul>
</div>
</div>
</div> <!-- tab-content -->
</div> <!-- end #rootwizard-->
@ -1122,28 +1146,6 @@
}
}
function appendFilesFileds(data) {
var newRowHtml = `
<div class="pad row">
<div class="col-md-4">
<span for="file_name">File name</span>
<input type="text" id="file_name" name="file_name[]" maxlength="255" class="form-control" value="${data != null && data != '' ? data.file_name : ''}">
</div>
<div class="col-md-4">
<span for="emp_file">File</span>
<input type="file" name="emp_file[]" class="form-control">
</div>
<div class="col-md-4" style="margin-top: 23px;">
<button type="button" class="btn btn-danger btn-sm" id="" onclick="removeContact(this)">Remove</button>
<button type="button" class="btn btn-primary btn-sm a1" onclick="appendFilesFileds()">Add</button>
</div>
</div>`;
$('#filesContainer').append(newRowHtml);
$('.a1').hide();
$('#filesContainer .pad:last .a1').show();
}
function removeContact(button) {
$(button).closest('.pad').remove();
$('#filesContainer .a1').hide();
@ -1457,7 +1459,7 @@
var combinedFormData = new FormData(); // Use FormData to handle files
// List of form IDs you want to combine
var formIds = ['#accountForm', '#profileForm', '#bankForm', '#proofForm', '#fileForm']; // Add all your form IDs here
var formIds = ['#accountForm', '#profileForm', '#bankForm', '#proofForm',]; // Add all your form IDs here
formIds.forEach(function(formId) {
var $form = $(formId);

File diff suppressed because it is too large Load Diff