Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
29c77a5376
@ -121,6 +121,7 @@ $routes->post('addNewEmployee', 'Employeedetails::AddNewEmployee');
|
||||
$routes->post('deleteEmployeeFile', 'Employeedetails::deleteEmployeeFile');
|
||||
$routes->get('employeeListing', 'Employeedetails::index');
|
||||
$routes->get('employeedetails/ViewEmployee', 'Employeedetails::ViewEmployee');
|
||||
$routes->get('employeedetails/downloadEmployeeDetails', 'Employeedetails::downloadEmployeeDetails');
|
||||
$routes->post('employeedetails/UpdateEmployee', 'Employeedetails::UpdateEmployee');
|
||||
$routes->get('exportemployee', 'Employeedetails::exportemployee');
|
||||
|
||||
@ -203,6 +204,7 @@ $routes->match(['GET', 'POST'], 'overTimeDetails', 'Monthlypay::overTimeDetails'
|
||||
$routes->get('emppaydate/addemppaydate', 'Emppaydate::addemppaydate');
|
||||
$routes->post('emppaydate/addNewemppay', 'Emppaydate::addNewemppay');
|
||||
$routes->get('emppaydate/editOldemppay/(:num)', 'Emppaydate::editOldemppay/$1');
|
||||
$routes->get('emppaydate/downloadEmpLoanData/(:num)', 'Emppaydate::downloadEmpLoanData/$1');
|
||||
$routes->post('emppaydate/editemppay', 'Emppaydate::editemppay');
|
||||
$routes->post('emppaydate/deleteEmpPay', 'Emppaydate::deleteEmpPay');
|
||||
|
||||
|
||||
@ -14,6 +14,8 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
|
||||
use Mpdf\Mpdf;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Style\Alignment;
|
||||
use App\Models\EmpFilesModel;
|
||||
use App\Models\AppConfigModel;
|
||||
@ -637,6 +639,33 @@ class Employeedetails extends BaseController
|
||||
|
||||
$this->loadViews("editEmployeenew", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
|
||||
function downloadEmployeeDetails($EmpNO = '')
|
||||
{
|
||||
$EmpID = $_GET['EmpID'];
|
||||
|
||||
$data['EmpDetails'] = $this->employeedetails_model->viewemployee($EmpID);
|
||||
$data['emp_data'] = $this->empFiles->where('emp_id', $EmpID)->where('is_active', 1)->findAll();
|
||||
$data['empPay'] = $this->emppaydate_model->getEmpPayData($EmpID);
|
||||
// dd($data);
|
||||
|
||||
|
||||
// Load the HTML view and pass data
|
||||
$html = view('employee_pdf_view', $data);
|
||||
|
||||
|
||||
$mpdf = new Mpdf();
|
||||
$mpdf->WriteHTML($html);
|
||||
|
||||
// Output the PDF
|
||||
$fName = $data['EmpDetails'][0]->EmpID.'-Employee-Details.pdf';
|
||||
return $mpdf->Output($fName, "D");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* To Check the email exists in the database or not for the employee*/
|
||||
function checkMailEmp()
|
||||
{
|
||||
|
||||
@ -10,7 +10,7 @@ use App\Models\Emppaydate_model;
|
||||
|
||||
use App\Models\Payroll_model;
|
||||
|
||||
|
||||
use Mpdf\Mpdf;
|
||||
/**
|
||||
* Module : Payslip
|
||||
* Emppaydate Class to control all Employee paydate related operations.
|
||||
@ -142,13 +142,32 @@ class Emppaydate extends BaseController
|
||||
|
||||
$data['loan_histoty'] = $this->emppaydate_model->getUserLoanHistoryInfo($data['emppay'][0]->Loan_ID);
|
||||
|
||||
// print_r($data['loan_histoty']);die;
|
||||
|
||||
$this->global['pageTitle'] = 'Edit Employee Pay Monthly Details ';
|
||||
|
||||
$this->loadViews("editOldemppay", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
function downloadEmpLoanData($paydataid = "")
|
||||
{
|
||||
|
||||
$data['emppay'] = $this->emppaydate_model->getUserInfo($paydataid);
|
||||
|
||||
$data['loan_histoty'] = $this->emppaydate_model->getUserLoanHistoryInfo($data['emppay'][0]->Loan_ID);
|
||||
|
||||
|
||||
// Load HTML view
|
||||
$html = view('loan_pdf', $data);
|
||||
|
||||
$mpdf = new Mpdf();
|
||||
$mpdf->SetTitle("Employee Loan Report");
|
||||
$mpdf->WriteHTML($html);
|
||||
|
||||
// Download the PDF
|
||||
$fName = $data['emppay'][0]->PAYEMPID."-loan-details.pdf";
|
||||
return $mpdf->Output($fName, "D");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -261,12 +261,12 @@ class Monthlypay extends BaseController
|
||||
} else {
|
||||
$W31OT = null;
|
||||
}
|
||||
$totalworkinghrs = $data['Total Hrs'];
|
||||
$totalworkinghrs = $data['Worked Hrs'];
|
||||
$totalothrs = $data['OT Hrs'];
|
||||
$paidleave = $data['Paid Leave'];
|
||||
$daysworked = $data['Days Worked'];
|
||||
$absent = $data['Absent'];
|
||||
$sundayCount = $data['Total Sunday'];
|
||||
$sundayCount = $data['Sunday'];
|
||||
|
||||
$monthattendance = array(
|
||||
'Month_Year' => $Month_Year, 'NoofDays' => $NoofDays, 'EmpID' => $EmpID, 'WH1' => $W1H, 'OT1' => $W1OT, 'WH2' => $W2H, 'OT2' => $W2OT, 'WH3' => $W3H, 'OT3' => $W3OT,
|
||||
|
||||
@ -135,13 +135,14 @@
|
||||
} else {
|
||||
$cdate = date('d-m-Y', strtotime($record->Created_date));
|
||||
} ?>
|
||||
<td><a class="a_tag_link" href="<?php echo base_url() . 'employeedetails/ViewEmployee/?EmpID=' . $record->EmpID; ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to view Employee details"><?php echo $record->EmpID ?> </a></u>
|
||||
<?php if($record->is_driver){ ?>
|
||||
|
||||
<a title="Trip Details" style="cursor:pointer;" href="<?= base_url() . 'loadDriverAttendance?drv_id=' . $record->EmpID; ?>">
|
||||
<i class="fa fa-truck"></i>
|
||||
<td>
|
||||
<a class="a_tag_link" href="<?php echo base_url() . 'employeedetails/ViewEmployee/?EmpID=' . $record->EmpID; ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to view Employee details"><?php echo $record->EmpID ?> </a></u>
|
||||
|
||||
|
||||
<a href="<?php echo base_url() . 'employeedetails/downloadEmployeeDetails/?EmpID=' . $record->EmpID; ?>">
|
||||
<i class="fas fa-download"></i>
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</td>
|
||||
<td><?php echo $record->FirstName; ?></td>
|
||||
|
||||
80
app/Views/employee_pdf_view.php
Normal file
80
app/Views/employee_pdf_view.php
Normal file
@ -0,0 +1,80 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Employee Details</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; font-size: 12px; }
|
||||
.container { width: 100%; margin: 20px auto; }
|
||||
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
|
||||
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
|
||||
th { background-color: #f2f2f2; }
|
||||
.header { font-size: 18px; font-weight: bold; text-align: center; margin-bottom: 20px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<div class="header">Employee Details</div>
|
||||
|
||||
<!-- Employee Personal Details -->
|
||||
<table>
|
||||
<tr>
|
||||
<th>Employee ID</th> <td><?= $EmpDetails[0]->EmpID ?? '-' ?></td>
|
||||
<th>Name</th> <td><?= $EmpDetails[0]->FirstName . ' ' . ($EmpDetails[0]->LastName ?? '') ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Gender</th> <td><?= $EmpDetails[0]->Gender ?? '-' ?></td>
|
||||
<th>Date of Birth</th> <td><?= date('d-m-Y', strtotime($EmpDetails[0]->DateofBirth ?? '')) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Contact Number</th> <td><?= $EmpDetails[0]->ContactNumber ?? '-' ?></td>
|
||||
<th>Email</th> <td><?= $EmpDetails[0]->EmailId ?? '-' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Department</th> <td><?= $EmpDetails[0]->DepartmentName ?? '-' ?></td>
|
||||
<th>Designation</th> <td><?= $EmpDetails[0]->Designation ?? '-' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Date of Joining</th> <td><?= date('d-m-Y', strtotime($EmpDetails[0]->DateofJoining ?? '')) ?></td>
|
||||
<th>Marital Status</th> <td><?= $EmpDetails[0]->MartialStatus ?? '-' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Blood Group</th> <td><?= $EmpDetails[0]->BloodGroup ?? '-' ?></td>
|
||||
<th>Father's Name</th> <td><?= $EmpDetails[0]->FatherName ?? '-' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Aadhar No</th> <td><?= $EmpDetails[0]->AadharNo ?? '-' ?></td>
|
||||
<th>PAN No</th> <td><?= $EmpDetails[0]->PANNo ?? '-' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Present Address</th> <td colspan="3"><?= $EmpDetails[0]->PresentAddress ?? '-' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Permanent Address</th> <td colspan="3"><?= $EmpDetails[0]->PermanentAddress ?? '-' ?></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<!-- Employee Salary Details -->
|
||||
<div class="header">Salary Details</div>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Basic Pay</th> <td><?= number_format($empPay->Basic_Pay ?? 0, 2) ?></td>
|
||||
<th>HRA Amount</th> <td><?= number_format($empPay->HRA_Amount ?? 0, 2) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>HRA Rate</th> <td><?= number_format($empPay->HRA_Rate ?? 0, 2) ?>%</td>
|
||||
<th>PF Rate</th> <td><?= number_format($empPay->PF_Rate ?? 0, 2) ?>%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ESI Rate</th> <td><?= number_format($empPay->ESI_Rate ?? 0, 2) ?>%</td>
|
||||
<th>Total Salary</th> <td><strong><?= number_format($empPay->TotalSalary ?? 0, 2) ?></strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -55,6 +55,8 @@
|
||||
<td><?php echo $record->Remaining_Due; ?></td>
|
||||
<td><?php echo $record->Paid_Amount; ?></td>
|
||||
<td>
|
||||
<a href="<?php echo base_url() . 'emppaydate/downloadEmpLoanData/' . $record->Pay_Data_ID; ?>"><i class="fas fa-download"></i></a>
|
||||
|
||||
<a href="<?php echo base_url() . 'emppaydate/editOldemppay/' . $record->Pay_Data_ID; ?>"><i class="fas fa-pencil-alt"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
49
app/Views/loan_pdf.php
Normal file
49
app/Views/loan_pdf.php
Normal file
@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Loan Report</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; }
|
||||
h2 { text-align: center; }
|
||||
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
|
||||
th, td { border: 1px solid black; padding: 8px; text-align: left; }
|
||||
th { background-color: #f2f2f2; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Employee Loan Report</h2>
|
||||
|
||||
<table>
|
||||
<tr><th>Employee ID</th><td><?= $emppay[0]->PAYEMPID; ?></td></tr>
|
||||
<tr><th>Employee Name</th><td><?= $emppay[0]->FirstName; ?></td></tr>
|
||||
<tr><th>Basic Pay</th><td><?= $emppay[0]->Basic_Pay; ?></td></tr>
|
||||
<tr><th>Total Salary</th><td><?= $emppay[0]->TotalSalary; ?></td></tr>
|
||||
<tr><th>Loan Amount</th><td><?= $emppay[0]->Loan_Amount; ?></td></tr>
|
||||
<tr><th>Loan Issued Date</th><td><?= $emppay[0]->Loan_Issued_Date; ?></td></tr>
|
||||
<tr><th>Monthly Due</th><td><?= $emppay[0]->Monthly_Due; ?></td></tr>
|
||||
<tr><th>Remaining Dues</th><td><?= $emppay[0]->Remaining_Due; ?></td></tr>
|
||||
<tr><th>Paid Amount</th><td><?= $emppay[0]->Paid_Amount; ?></td></tr>
|
||||
</table>
|
||||
|
||||
<h3>Loan History</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Due Amount</th>
|
||||
<th>Balance Amount</th>
|
||||
<th>Due Date</th>
|
||||
<th>Entry Date</th>
|
||||
</tr>
|
||||
<?php foreach ($loan_histoty as $key => $value) { ?>
|
||||
<tr>
|
||||
<td><?= $value->Due_Amount; ?></td>
|
||||
<td><?= $value->Balance_Amount; ?></td>
|
||||
<td><?= $value->Due_Date; ?></td>
|
||||
<td><?= $value->Entry_Date; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@ -212,20 +212,18 @@
|
||||
<?php echo form_dropdown('monthyear', $ot, set_value('monthyear', $currentselection), 'id="monthyear"', 'class="form-control select2'); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="col-3 ">
|
||||
<i id="exportButton" class="fas fa-download download-icon" style="font-size: x-large; margin-top:12px;" title="Export Excel"></i>
|
||||
</div>
|
||||
<div class="col-3 text-right" id="savebutton">
|
||||
|
||||
</div>
|
||||
<div class="col-3 text-right d-flex" style="justify-content: end;" id="savebutton">
|
||||
<i class="fe-maximize noti-icon" onclick="toggleDivFullscreen()" style="margin-right: 15px;
|
||||
margin-top: 5px;
|
||||
font-size: 28px;"></i>
|
||||
<div class="col-9 text-right d-flex" style="justify-content: end;" id="savebutton">
|
||||
|
||||
<input type="text" id="searchInput" placeholder="Search..." style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc;border-radius: 5px;margin-right:15px;">
|
||||
|
||||
<input type="button" id="submit" value="Save" class="btn btn-success" onclick="getAllData();" style="margin-top:0px;">
|
||||
<!-- <input type="button" id="submit" value="Save" class="btn btn-success" onclick="getAllData();" style="margin-top:0px;"> -->
|
||||
|
||||
<i id="exportButton" class="fas fa-download download-icon" style="margin-right: 15px;margin-top: 8px;font-size:25px;" title="Export Excel"></i>
|
||||
|
||||
<i class="fe-maximize noti-icon" onclick="toggleDivFullscreen()" style="margin-right: 15px;margin-top: 5px;font-size: 28px;" title="Full screen view"></i>
|
||||
|
||||
<i class="fas fa-save" onclick="getAllData();" style="margin-right: 15px;margin-top: 5px;font-size:28px;" title="Save"></i>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1398,6 +1396,14 @@ function showMessage(msg) {
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
$("#searchInput").on("keyup", function () {
|
||||
let value = $(this).val().toLowerCase(); // Convert input to lowercase for case-insensitive search
|
||||
|
||||
$("#table-responsive tbody tr").filter(function () {
|
||||
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -327,16 +327,16 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-8">
|
||||
|
||||
<!-- <a style="cursor:pointer"
|
||||
class="dropdown-item" data-toggle="modal" data-target="#filterModalId">
|
||||
Filter
|
||||
</a> -->
|
||||
<div class="col-7">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 ">
|
||||
<div class="col-2">
|
||||
|
||||
<a style="cursor:pointer"
|
||||
class="btn btn-secondary " data-toggle="modal" data-target="#filterModalId">
|
||||
Date Filter
|
||||
</a>
|
||||
|
||||
<button type="button" class="btn btn-success m-0" data-target="#coatingMachineDetailModal"
|
||||
data-toggle="modal">
|
||||
|
||||
@ -345,13 +345,12 @@
|
||||
if($month == date('M-Y') ){
|
||||
?>
|
||||
|
||||
<div class="col-7">
|
||||
<!-- right now client is not using this -->
|
||||
<!-- <a class="dropdown-item" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a> -->
|
||||
<div class="col-6">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-2 m-0">
|
||||
<div class="col-3 m-0">
|
||||
<button type="button" class="btn " style="background-color:maroon;color:white" data-target="#customizeModalId"
|
||||
data-toggle="modal">
|
||||
Customize
|
||||
@ -359,16 +358,16 @@
|
||||
|
||||
<?php
|
||||
} else { ?>
|
||||
<div class="col-8">
|
||||
<div class="col-7">
|
||||
<!-- right now client is not using this -->
|
||||
<!-- <a class="dropdown-item" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a> -->
|
||||
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<div class="col-2">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<a class="btn btn-secondary" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a>
|
||||
<input type="button" class="btn btn-success px-4" id="saveId" value="Save">
|
||||
|
||||
</div>
|
||||
@ -773,7 +772,7 @@
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="bagDropdown">Select Bag</label>
|
||||
<select id="bagDropdown" class="form-control">
|
||||
<select id="bagDropdown" class="form-control select2">
|
||||
<option value="">Select Bag</option>
|
||||
<?php foreach($bagMaterials as $bagMaterial): ?>
|
||||
<option value=" <?= $bagMaterial['MaterialName']?>">
|
||||
@ -791,7 +790,7 @@
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="dateDropdown">Select Date</label>
|
||||
<select id="dateDropdown" class="form-control">
|
||||
<select id="dateDropdown" class="form-control select2">
|
||||
<?php foreach($datesInMonth as $selectDate): ?>
|
||||
<?php $selectDate=DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
|
||||
<option value="<?=$selectDate?>"><?=$selectDate?></option>
|
||||
@ -809,6 +808,11 @@
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('.select2').select2();
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -338,13 +338,12 @@ foreach ($period as $day) {
|
||||
if($month == date('M-Y') ){
|
||||
?>
|
||||
|
||||
<div class="col-7">
|
||||
<!-- right now client is not using this -->
|
||||
<!-- <a class="dropdown-item" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a> -->
|
||||
<div class="col-6">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-2 m-0">
|
||||
<div class="col-3 m-0">
|
||||
|
||||
<button type="button" class="btn " style="background-color:maroon;color:white" data-target="#customizeModalId"
|
||||
data-toggle="modal">
|
||||
Customize
|
||||
@ -352,15 +351,14 @@ foreach ($period as $day) {
|
||||
|
||||
<?php
|
||||
} else { ?>
|
||||
<div class="col-8">
|
||||
<!-- right now client is not using this -->
|
||||
<!-- <a class="dropdown-item" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a> -->
|
||||
|
||||
<div class="col-7">
|
||||
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<div class="col-2">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<a class="btn btn-secondary" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a>
|
||||
|
||||
<input type="button" class="btn btn-success px-4" id="saveId" value="Save">
|
||||
|
||||
@ -933,7 +931,7 @@ foreach ($period as $day) {
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="dieselDropdown">Select Bag</label>
|
||||
<select id="dieselDropdown" class="form-control">
|
||||
<select id="dieselDropdown" class="form-control select2">
|
||||
<option value="">Select Diesel</option>
|
||||
<?php foreach ($dieselMachines as $dieselMachine): ?>
|
||||
<option value=" <?= $dieselMachine['machine_name'] ?>">
|
||||
@ -951,7 +949,7 @@ foreach ($period as $day) {
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="dateDropdown">Select Date</label>
|
||||
<select id="dateDropdown" class="form-control">
|
||||
<select id="dateDropdown" class="form-control select2">
|
||||
<?php foreach ($datesInMonth as $selectDate): ?>
|
||||
<?php $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
|
||||
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
|
||||
@ -1634,6 +1632,7 @@ foreach ($period as $day) {
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#customizeHeader').select2();
|
||||
$('.select2').select2();
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
@ -323,15 +323,18 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-8">
|
||||
<div class="col-7">
|
||||
<!-- right now client is not using this -->
|
||||
<!-- <a style="cursor:pointer"
|
||||
class="dropdown-item" data-toggle="modal" data-target="#filterModalId">Filter</a> -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 ">
|
||||
<div class="col-2 ">
|
||||
|
||||
<a style="cursor:pointer"
|
||||
class="btn btn-secondary" data-toggle="modal" data-target="#filterModalId">
|
||||
Date Filter</a>
|
||||
|
||||
|
||||
<button type="button" class="btn btn-success m-0" data-target="#additionalEntriesModalId"
|
||||
data-toggle="modal">
|
||||
|
||||
@ -319,11 +319,15 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<div class="col-1">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<div class="col-2">
|
||||
<a style="cursor:pointer"
|
||||
class="btn btn-secondary " data-toggle="modal" data-target="#filterModalId">
|
||||
Date Filter
|
||||
</a>
|
||||
<button class="btn btn-success m-0 px-3" type="button" id="saveId">Save</button>
|
||||
</div>
|
||||
|
||||
@ -499,10 +503,133 @@
|
||||
</div>
|
||||
|
||||
|
||||
<!-- modal section -->
|
||||
|
||||
<!-- filter modal -->
|
||||
<div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="filterModalLabelId">Filter Options</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$currentDateInDmY = date('d-m-Y');
|
||||
?>
|
||||
|
||||
<?php
|
||||
$startDate = DateTime::createFromFormat('M-Y', $month);
|
||||
|
||||
if ($startDate) {
|
||||
$startDate->modify('first day of this month');
|
||||
$daysInMonth = $startDate->format('t');
|
||||
$dateArray = [];
|
||||
|
||||
for ($i = 0; $i < $daysInMonth; $i++) {
|
||||
$dateArray[] = $startDate->format('d-m-Y');
|
||||
$startDate->modify('+1 day');
|
||||
}
|
||||
} else {
|
||||
echo "Invalid date format.";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!-- From Date Filter -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="fromDateFilter">Select From Date</label>
|
||||
|
||||
<select id="fromDateFilter" name="fromDateFilter" class="form-control select2">
|
||||
<?php if (!empty($dateArray)) : ?>
|
||||
<?php foreach ($dateArray as $index => $date) : ?>
|
||||
<option value="<?= $date ?>" ><?= $date ?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- To Date Filter -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="toDateFilter">Select Date</label>
|
||||
|
||||
<select id="toDateFilter" name="toDateFilter" class="form-control select2">
|
||||
|
||||
<?php if (!empty($dateArray)) : ?>
|
||||
<?php foreach ($dateArray as $date) : ?>
|
||||
<option value="<?= $date ?>" <?= ($date == $currentDateInDmY) || ($date == $dateArray[9]) ?"selected" :" " ?> ><?= $date ?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-primary float-right" onclick="customFilterDate()">Filter</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
<!-- end modal section -->
|
||||
|
||||
|
||||
<script>
|
||||
function customFilterDate(){
|
||||
|
||||
let fromDate = $('#fromDateFilter').val(); //01-12-2024
|
||||
let toDate = $('#toDateFilter').val(); //05-12-2024
|
||||
|
||||
$('#dustAndRoughStockDetailsTableId').find('tbody tr').each(function() {
|
||||
const rowCells = $(this).find('td');
|
||||
let tableDate = rowCells.eq(0).text();
|
||||
let result = checkDateRange(fromDate,toDate,tableDate);
|
||||
if (result) {
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#filterModalId').modal('hide');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkDateRange(fromDate, toDate, tableDate) {
|
||||
// Convert the dates to a comparable format (YYYY-MM-DD)
|
||||
let from = convertToDate(fromDate);
|
||||
let to = convertToDate(toDate);
|
||||
let table = convertToDate(tableDate);
|
||||
|
||||
// Return true if the table date is within the range
|
||||
return table >= from && table <= to;
|
||||
}
|
||||
|
||||
|
||||
function convertToDate(dateString) {
|
||||
// Convert from DD-MM-YYYY to YYYY-MM-DD for comparison
|
||||
let parts = dateString.split('-');
|
||||
return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('.select2').select2();
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
@ -290,14 +290,17 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-8">
|
||||
<div class="col-7">
|
||||
<!-- right now client is not using this -->
|
||||
<!-- <a style="cursor:pointer"
|
||||
class="dropdown-item" data-toggle="modal" data-target="#filterModalId">Filter</a> -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-1 ">
|
||||
<div class="col-2">
|
||||
|
||||
<a style="cursor:pointer"
|
||||
class="btn btn-secondary" data-toggle="modal" data-target="#filterModalId">
|
||||
Date Filter</a>
|
||||
|
||||
<button type="button" class="btn btn-success m-0 px-4" id="saveId" >
|
||||
Save
|
||||
|
||||
@ -360,13 +360,11 @@ foreach ($period as $day) {
|
||||
if($month == date('M-Y') ){
|
||||
?>
|
||||
|
||||
<div class="col-7">
|
||||
<!-- right now client is not using this -->
|
||||
<!-- <a class="dropdown-item" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a> -->
|
||||
<div class="col-6">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-2 m-0">
|
||||
<div class="col-3 m-0">
|
||||
<button type="button" class="btn " style="background-color:maroon;color:white" data-target="#customizeModalId"
|
||||
data-toggle="modal">
|
||||
Customize
|
||||
@ -374,16 +372,13 @@ foreach ($period as $day) {
|
||||
|
||||
<?php
|
||||
} else { ?>
|
||||
<div class="col-8">
|
||||
<!-- right now client is not using this -->
|
||||
<!-- <a class="dropdown-item" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a> -->
|
||||
|
||||
<div class="col-7">
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<div class="col-2">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<a class="btn btn-secondary" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a>
|
||||
<input type="button" class="btn btn-success px-4" id="saveId" value="Save">
|
||||
|
||||
</div>
|
||||
@ -956,7 +951,7 @@ foreach ($period as $day) {
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="powerDropdown">Select Bag</label>
|
||||
<select id="powerDropdown" class="form-control">
|
||||
<select id="powerDropdown" class="form-control select2">
|
||||
<option value="">Select Electric Machines</option>
|
||||
<?php foreach ($electricMachines as $powerMachine): ?>
|
||||
<option value=" <?= $powerMachine['machine_name'] ?>">
|
||||
@ -974,7 +969,7 @@ foreach ($period as $day) {
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="dateDropdown">Select Date</label>
|
||||
<select id="dateDropdown" class="form-control">
|
||||
<select id="dateDropdown" class="form-control select2">
|
||||
<?php foreach ($datesInMonth as $selectDate): ?>
|
||||
<?php $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
|
||||
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
|
||||
@ -991,6 +986,11 @@ foreach ($period as $day) {
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('.select2').select2();
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
@ -348,13 +348,11 @@ foreach ($period as $day) {
|
||||
if($month == date('M-Y') ){
|
||||
?>
|
||||
|
||||
<div class="col-7">
|
||||
<!-- right now client is not using this -->
|
||||
<!-- <a class="dropdown-item" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a> -->
|
||||
|
||||
<div class="col-6">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-2 m-0">
|
||||
<div class="col-3 m-0">
|
||||
<button type="button" class="btn " style="background-color:maroon;color:white" data-target="#customizeModalId"
|
||||
data-toggle="modal">
|
||||
Customize
|
||||
@ -362,16 +360,14 @@ foreach ($period as $day) {
|
||||
|
||||
<?php
|
||||
} else { ?>
|
||||
<div class="col-8">
|
||||
<!-- right now client is not using this -->
|
||||
<!-- <a class="dropdown-item" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a> -->
|
||||
|
||||
<div class="col-7">
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<div class="col-2">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<a class="btn btn-secondary" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a>
|
||||
|
||||
<input type="button" class="btn btn-success px-4" id="saveId" value="Save">
|
||||
|
||||
</div>
|
||||
@ -762,7 +758,7 @@ foreach ($period as $day) {
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="resinDropdown">Select Bag</label>
|
||||
<select id="resinDropdown" class="form-control">
|
||||
<select id="resinDropdown" class="form-control select2">
|
||||
<option value="">Select Resin</option>
|
||||
<?php foreach ($resinMaterials as $resinMaterial): ?>
|
||||
<option value=" <?= $resinMaterial['MaterialName'] ?>">
|
||||
@ -780,7 +776,7 @@ foreach ($period as $day) {
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="dateDropdown">Select Date</label>
|
||||
<select id="dateDropdown" class="form-control">
|
||||
<select id="dateDropdown" class="form-control select2">
|
||||
<?php foreach ($datesInMonth as $selectDate): ?>
|
||||
<?php $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
|
||||
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
|
||||
@ -815,6 +811,13 @@ foreach ($period as $day) {
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('.select2').select2();
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
function navigateToResin() {
|
||||
$('.close').click();
|
||||
|
||||
@ -308,11 +308,15 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<div class="col-2">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<div class="col-2">
|
||||
<a style="cursor:pointer"
|
||||
class="btn btn-secondary " data-toggle="modal" data-target="#filterModalId">
|
||||
Date Filter
|
||||
</a>
|
||||
<button class="btn btn-success m-0 px-3" type="button" id="saveId">Save</button>
|
||||
</div>
|
||||
|
||||
@ -529,7 +533,133 @@
|
||||
|
||||
|
||||
|
||||
<!-- modal section -->
|
||||
|
||||
<!-- filter modal -->
|
||||
<div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true">
|
||||
<div class="modal-dialog modal-md">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="filterModalLabelId">Filter Options</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$currentDateInDmY = date('d-m-Y');
|
||||
?>
|
||||
|
||||
<?php
|
||||
$startDate = DateTime::createFromFormat('M-Y', $month);
|
||||
|
||||
if ($startDate) {
|
||||
$startDate->modify('first day of this month');
|
||||
$daysInMonth = $startDate->format('t');
|
||||
$dateArray = [];
|
||||
|
||||
for ($i = 0; $i < $daysInMonth; $i++) {
|
||||
$dateArray[] = $startDate->format('d-m-Y');
|
||||
$startDate->modify('+1 day');
|
||||
}
|
||||
} else {
|
||||
echo "Invalid date format.";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!-- From Date Filter -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="fromDateFilter">Select From Date</label>
|
||||
|
||||
<select id="fromDateFilter" name="fromDateFilter" class="form-control select2">
|
||||
<?php if (!empty($dateArray)) : ?>
|
||||
<?php foreach ($dateArray as $index => $date) : ?>
|
||||
<option value="<?= $date ?>" ><?= $date ?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- To Date Filter -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="toDateFilter">Select Date</label>
|
||||
|
||||
<select id="toDateFilter" name="toDateFilter" class="form-control select2">
|
||||
|
||||
<?php if (!empty($dateArray)) : ?>
|
||||
<?php foreach ($dateArray as $date) : ?>
|
||||
<option value="<?= $date ?>" <?= ($date == $currentDateInDmY) || ($date == $dateArray[9]) ?"selected" :" " ?> ><?= $date ?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-primary float-right" onclick="customFilterDate()">Filter</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div>
|
||||
|
||||
|
||||
<!-- end modal section -->
|
||||
|
||||
|
||||
<script>
|
||||
function customFilterDate(){
|
||||
|
||||
let fromDate = $('#fromDateFilter').val(); //01-12-2024
|
||||
let toDate = $('#toDateFilter').val(); //05-12-2024
|
||||
|
||||
$('#trpSandUseStockDetailsTableId').find('tbody tr').each(function() {
|
||||
const rowCells = $(this).find('td');
|
||||
let tableDate = rowCells.eq(0).text();
|
||||
let result = checkDateRange(fromDate,toDate,tableDate);
|
||||
if (result) {
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#filterModalId').modal('hide');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkDateRange(fromDate, toDate, tableDate) {
|
||||
// Convert the dates to a comparable format (YYYY-MM-DD)
|
||||
let from = convertToDate(fromDate);
|
||||
let to = convertToDate(toDate);
|
||||
let table = convertToDate(tableDate);
|
||||
|
||||
// Return true if the table date is within the range
|
||||
return table >= from && table <= to;
|
||||
}
|
||||
|
||||
|
||||
function convertToDate(dateString) {
|
||||
// Convert from DD-MM-YYYY to YYYY-MM-DD for comparison
|
||||
let parts = dateString.split('-');
|
||||
return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('.select2').select2();
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user