stock module 1 vadivel J 31-12-2024
This commit is contained in:
parent
e31025bb37
commit
19137a3098
@ -484,4 +484,9 @@ $routes->post('updateGasStockDetails', 'StockController::updateGasStockDetails')
|
|||||||
|
|
||||||
//trp sand use stock details
|
//trp sand use stock details
|
||||||
$routes->match(['GET', 'POST'], 'trpSandUseStockDetails', 'StockController::trpSandUseStockDetails');
|
$routes->match(['GET', 'POST'], 'trpSandUseStockDetails', 'StockController::trpSandUseStockDetails');
|
||||||
$routes->post('updateTrpSandUseStockDetails', 'StockController::updateTrpSandUseStockDetails');
|
$routes->post('updateTrpSandUseStockDetails', 'StockController::updateTrpSandUseStockDetails');
|
||||||
|
|
||||||
|
//trp production stock details
|
||||||
|
$routes->match(['GET', 'POST'], 'trpProductionDetails', 'StockController::trpProductionDetails');
|
||||||
|
$routes->post('updateTrpProductionDetails', 'StockController::updateTrpProductionDetails');
|
||||||
|
|
||||||
|
|||||||
@ -1265,6 +1265,24 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function trpProductionDetails(){}
|
||||||
|
|
||||||
|
public function updateTrpProductionDetails(){}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------gwm----------------------------------------------
|
// --------------------------------------------gwm----------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -199,10 +199,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button type="button" class="btn btn-danger" data-target="#productionBatchCardDetailModalId"
|
|
||||||
|
<!-- <button type="button" class="btn btn-danger" data-target="#productionBatchCardDetailModalId"
|
||||||
data-toggle="modal">
|
data-toggle="modal">
|
||||||
Add Production Batch Card
|
Add Production Batch Card
|
||||||
</button>
|
</button> -->
|
||||||
|
|
||||||
<button type="button" class="btn btn-success" data-target="#coatingMachineDetailModal"
|
<button type="button" class="btn btn-success" data-target="#coatingMachineDetailModal"
|
||||||
data-toggle="modal">
|
data-toggle="modal">
|
||||||
Add Shift Record
|
Add Shift Record
|
||||||
@ -232,7 +234,7 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<div class=form-row>
|
<div class=form-row>
|
||||||
<div class="form-group col-md-2 mt-2 ">
|
<div class="form-group col-md-3 mt-2 ">
|
||||||
|
|
||||||
<input type="text"
|
<input type="text"
|
||||||
value="<?= $month; ?>" name="month"
|
value="<?= $month; ?>" name="month"
|
||||||
@ -242,10 +244,25 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-3">
|
||||||
<button type="submit" class="btn btn-success"> Change Month </button>
|
<button type="submit" class="btn btn-success"> Change Month </button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-6">
|
||||||
|
<div class="dropdown float-right mt-2">
|
||||||
|
<a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown"
|
||||||
|
aria-expanded="false">
|
||||||
|
<i class="mdi mdi-dots-vertical m-0 text-muted h3"></i>
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
|
<a style="cursor:pointer"
|
||||||
|
class="dropdown-item" data-toggle="modal" data-target="#filterModalId">
|
||||||
|
Filter
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@ -841,6 +858,7 @@
|
|||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -848,6 +866,80 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 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">
|
||||||
|
<?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">
|
||||||
|
|
||||||
|
<?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>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -887,6 +979,8 @@
|
|||||||
$('#machineOffTimeHrId ').select2();
|
$('#machineOffTimeHrId ').select2();
|
||||||
$('#editMachineOnTimeHrId ').select2();
|
$('#editMachineOnTimeHrId ').select2();
|
||||||
$('#editMachineOffTimeHrId ').select2();
|
$('#editMachineOffTimeHrId ').select2();
|
||||||
|
$('#fromDateFilter ').select2();
|
||||||
|
$('#toDateFilter ').select2();
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@ -1184,4 +1278,47 @@
|
|||||||
autoclose: true,
|
autoclose: true,
|
||||||
orientation: 'bottom'
|
orientation: 'bottom'
|
||||||
})
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function customFilterDate(){
|
||||||
|
|
||||||
|
let fromDate = $('#fromDateFilter').val(); //01-12-2024
|
||||||
|
let toDate = $('#toDateFilter').val(); //05-12-2024
|
||||||
|
|
||||||
|
$('#coatingMachineDetailTableId').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>
|
||||||
@ -437,8 +437,9 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
<!-- modal section -->
|
<!-- modal section -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- filter modal -->
|
||||||
<div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true">
|
<div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-lg">
|
<div class="modal-dialog modal-md">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title" id="filterModalLabelId">Filter Options</h4>
|
<h4 class="modal-title" id="filterModalLabelId">Filter Options</h4>
|
||||||
@ -1003,4 +1004,13 @@ function convertToDate(dateString) {
|
|||||||
return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day
|
return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day
|
||||||
}
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#fromDateFilter ').select2();
|
||||||
|
$('#toDateFilter ').select2();
|
||||||
|
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
@ -867,7 +867,9 @@
|
|||||||
|
|
||||||
<a href="<?php echo base_url(); ?>bagStockDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>Bag Stock Details</a>
|
<a href="<?php echo base_url(); ?>bagStockDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>Bag Stock Details</a>
|
||||||
|
|
||||||
<a href="<?php echo base_url(); ?>trpSandUseStockDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>Trp Sand Use Stock Details</a>
|
<a href="<?php echo base_url(); ?>trpSandUseStockDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>TRP Sand Use Stock Details</a>
|
||||||
|
|
||||||
|
<a href="<?php echo base_url(); ?>trpProductionDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>TRP Production Details</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user