minor changes-3 -vadivel J

This commit is contained in:
vadivelJ96 2024-10-14 08:53:20 +05:30
parent 407249994e
commit 3d70f81c9c
8 changed files with 1297 additions and 36 deletions

View File

@ -4219,6 +4219,8 @@ class Purchaseorder extends BaseController
public function addloadfile()
{
$uploadfiles=0;
$pono = $this->request->getPost('PONO');
$igr = $this->request->getPost('igr');
@ -4231,6 +4233,8 @@ class Purchaseorder extends BaseController
$fcount = 0;
foreach ($files as $value) {
$lastfile = $value->FilePath;
@ -4245,37 +4249,48 @@ class Purchaseorder extends BaseController
if ($fcount == 0) {
if (!empty($new_file_name)) {
$Picture = $this->adfile();
$filelist = array('PONO' => $pono, 'IGRNO' => $igr, 'FilePath' => $Picture);
$uploadfiles = $this->purchaseorder_model->insertfile($filelist);
if (!empty($new_file_name)) {
$Picture = $this->adfile();
$filelist = array('PONO' => $pono, 'IGRNO' => $igr, 'FilePath' => $Picture);
$uploadfiles = $this->purchaseorder_model->insertfile($filelist);
if ($uploadfiles > 0) {
echo "file updated successfully!";
}
}
}else{
echo " File already Uploaded";
}
}
if ($uploadfiles > 0) {
echo "file updated successfully!";
} else {
echo "No File Choose or File name already Exist";
}
}
public function adfile()
{
$picture = '';
$file = $this->request->getFile('file');
if ($file && $file->isValid()) {
$uploadPath = base_url() . 'public/uploads/BillFiles/';
$file->move($uploadPath);
$picture = $file->getName();
} else {
$picture = '';
}
return $picture;
$file = $this->request->getFile('file');
if ($file && $file->isValid()) {
// Define the file system path for uploads
$uploadPath = FCPATH . 'uploads/BillFiles/'; // 'FCPATH' points to 'public' directory
// Check if the directory exists, if not, create it
if (!is_dir($uploadPath)) {
mkdir($uploadPath, 0777, true); // Create the directory with write permissions
}
// Move the file to the upload directory
if ($file->move($uploadPath)) {
$picture = $file->getName(); // Get the file name after moving
} else {
$picture = '';
}
} else {
$picture = '';
}
return $picture;
}

View File

@ -28,7 +28,7 @@ class Purchaseorder_model extends Model
function getfies($pono)
{
$builder = $this->db->table('t_purchaseorder_billupload bill')
$builder = $this->db->table('t_purchaseorder_billupload')
->select('*')
->where('PONO', $pono);

View File

@ -2511,7 +2511,8 @@ if (!empty($getlogpodtl)) {
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
<input type="hidden" name="hiddenIGRNO" id="hiddenIGRNO" value="<?php echo $IGRNO; ?>" />
</div>
<thead>
<tr>
@ -5437,10 +5438,14 @@ if (!empty($getlogpodtl)) {
div.id = `divid${counter}`;
div.className = "row";
div.innerHTML = `<div class="form-row px-4">
<div class="form-group col-md-3">
<label>Upload File</label>
<input type="file" name="browseFiles" id="images${counter}" onchange="Copyfilename(${this.name}); "><br>
<span><button class="btn btn-success btn-small add add_this" id="addbtn" onclick="addRow(${counter})">ADD</button></span>
<div class="form-group col-md-4">
<label>Upload Purchase Order Bill </label>
<input type="file" name="browseFiles" id="images${counter}" onchange="Copyfilename(${this.name}); ">
</div>
<div class="form-group col-md-4 ml-3 mt-2">
<button class="btn btn-success btn-sm add add_this" id="addbtn" onclick="addRow(${counter})">ADD</button>
</div>
</div>
</div>`;
@ -5458,17 +5463,17 @@ if (!empty($getlogpodtl)) {
});
function addRow(counter) {
var file = $(`#images${counter}`).val();
if (file == '') {
alert('File not found');
return false;
if (file == '') {
alert('Please Select File..!!');
return false;
} else {
fileupload(counter);
}
}
} else {
fileupload(counter);
}
}

View File

@ -0,0 +1,411 @@
routes
//Stock Module
$routes->get('coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails');
$routes->post('addNewCoatingMachineDetails' , 'StockController::addNewCoatingMachineDetails');
$routes->post('editCoatingMachineDetails','StockController::editCoatingMachineDetails');
//stock controller
public function editCoatingMachineDetails(){
$putData=$this->request->getPost();
$id = $putData['editCoatingMachineDetailId'];
$updated= $this->coatingMachineDetails_model->update($id,$putData);
if ($updated) {
// Set flashdata for success message
return redirect()->to('/coatingMachineDetails')->with('success', 'Coating Machine details updated successfully');
} else {
// Set flashdata for error message
return redirect()->back()->with('error', 'Failed to update Coating machine details');
}
}
//coatingMachinedetailview
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;">
<thead>
<tr>
<th style="text-align:center !important;">Customer Name</th>
<th style="text-align:center !important;">Date</th>
<th style="text-align:center !important;">Shift</th>
<th style="text-align:center !important;">Machine On Time</th>
<th style="text-align:center !important;">Machine Off Time</th>
<th style="text-align:center !important;">Machine Running (hrs)</th>
<th style="text-align:center !important;">Total Coating</th>
<th style="text-align:center !important;">Total Coating Sand (kgs)</th>
<th style="text-align:center !important;">Total Gas Consumption</th>
<th style="text-align:center !important;">Per Hour Gas Consumption</th>
<th style="text-align:center !important;">Per Hour Coating Sand QTY</th>
<th style="text-align:center !important;">Action</th>
</tr>
</thead>
<tbody>
<?php
if (!empty($coatingMachineDetails)) {
foreach ($coatingMachineDetails as $record) {
?>
<tr data-id="<?php echo $record['id'] ?>">
<td align="center"><?php echo $record['customerName']; ?></td>
<td align="center"><?php echo $record['date'] ?></td>
<td align="center"><?php echo $record['shift'] ?></td>
<td align="center"><?php echo $record['machineOnTime'] ?></td>
<td align="center"><?php echo $record['machineOffTime'] ?></td>
<td align="center"><?php echo $record['machineRunningInHrs']??'' ?></td>
<td align="center"><?php echo $record['totalCoating'] ?></td>
<td align="center"><?php echo $record['totalCoatingSandInKg'] ?></td>
<td align="center"><?php echo $record['totalGasConsumption'] ?></td>
<td align="center"><?php echo $record['perHourGasConsumption']??'' ?></td>
<td align="center"><?php echo $record['perHourCoatingSandQTY']??'' ?></td>
<td align="center">
<a data-toggle="tooltip" class="edit-btn" data-target="editCoatingMachineDetailModal" data-toggle="modal"
style="cursor:pointer">
<i class="fa fa-pencil-alt" data-toggle="tooltip"
title="Click here to Edit "></i>
&nbsp;&nbsp;&nbsp;
</a>
<a data-toggle="tooltip" onclick="confirmDelete(event)"
href="<?php echo base_url(); ?>deleteFactoryMachineMasterDetails?id=<?php echo $record['id'] ?>"
>
<i class="fa fa-trash" data-toggle="tooltip"
title="Click here to Delete "></i>
&nbsp;&nbsp;&nbsp;
</a>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
</div>
<!-- coatingMachineDetailModal -->
<div class="modal fade" id="coatingMachineDetailModal" tabindex="-1" role="dialog" aria-labelledby="coatingMachineDetailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" style="width:1060px !important ;" role="document">
<div class="modal-content" >
<div class="modal-header">
<h5 class="modal-title" id="coatingMachineDetailModalLabel">
Add New Coating Machine Detail</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<!-- form -->
<form method="post" id="coatingMachineDetailModalFormId" action="<?php echo base_url(); ?>addNewCoatingMachineDetails">
<div class="modal-body">
<div class="form-row">
<div class="form-group col-md-3">
<label for="dateId">Date</label>
<span class="badge mandatory">*</span>
<input type="date" class="form-control" id="dateId"
name="date" value="">
</div>
<div class="form-group col-md-3">
<label for="shiftId">Shift</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="shiftId"
name="shift" value="">
</div>
<div class="form-group col-md-3">
<label for="machineOnTimeId">Machine On Time</label>
<span class="badge mandatory">*</span>
<input type="time" class="form-control" id="machineOnTimeId"
name="machineOnTime" value="">
</div>
<div class="form-group col-md-3">
<label for="machineOffTimeId">Machine Off Time</label>
<span class="badge mandatory">*</span>
<input type="time" class="form-control" id="machineOffTimeId"
name="machineOffTime" value="">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label for="customerNameId">Customer Name</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="customerNameId"
name="customerName" value="">
</div>
<div class="form-group col-md-3">
<label for="totalCoatingId">Total Coating</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalCoatingId"
name="totalCoating" value="">
</div>
<div class="form-group col-md-3">
<label for="totalCoatingSandId">Total Coating Sand (in Kg)</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalCoatingSandId"
name="totalCoatingSandInKg" value="">
</div>
<div class="form-group col-md-3">
<label for="totalGasConsumptionId">Total Gas Consumption</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalGasConsumptionId"
name="totalGasConsumption" value="">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Save </button>
</div>
</form>
</div>
</div>
</div>
<!-- editCoatingMachineDetailModal -->
<div class="modal fade" id="editCoatingMachineDetailModal" tabindex="-1" role="dialog" aria-labelledby="editCoatingMachineDetailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" style="width:1060px !important ;" role="document">
<div class="modal-content" >
<div class="modal-header">
<h5 class="modal-title" id="editCoatingMachineDetailModalLabel">
Edit Coating Machine Detail</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<!-- form -->
<form method="post" id="editCoatingMachineDetailModalFormId" action="<?php echo base_url(); ?>editCoatingMachineDetails">
<div class="modal-body">
<div class="form-row">
<div class="form-group col-md-3">
<label for="dateId">Date</label>
<span class="badge mandatory">*</span>
<input type="date" class="form-control" id="editDateId"
name="date" value="">
<input type="hidden" name="editCoatingMachineDetailId" id="editCoatingMachineDetailId">
</div>
<div class="form-group col-md-3">
<label for="shiftId">Shift</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editShiftId"
name="shift" value="">
</div>
<div class="form-group col-md-3">
<label for="machineOnTimeId">Machine On Time</label>
<span class="badge mandatory">*</span>
<input type="time" class="form-control" id="editMachineOnTimeId"
name="machineOnTime" value="">
</div>
<div class="form-group col-md-3">
<label for="machineOffTimeId">Machine Off Time</label>
<span class="badge mandatory">*</span>
<input type="time" class="form-control" id="editMachineOffTimeId"
name="machineOffTime" value="">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label for="customerNameId">Customer Name</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editCustomerNameId"
name="customerName" value="">
</div>
<div class="form-group col-md-3">
<label for="totalCoatingId">Total Coating</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editTotalCoatingId"
name="totalCoating" value="">
</div>
<div class="form-group col-md-3">
<label for="totalCoatingSandId">Total Coating Sand (in Kg)</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editTotalCoatingSandId"
name="totalCoatingSandInKg" value="">
</div>
<div class="form-group col-md-3">
<label for="totalGasConsumptionId">Total Gas Consumption</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editTotalGasConsumptionId"
name="totalGasConsumption" value="">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Save </button>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<!-- <script type="text/javascript">
$(function () {
$('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100]
});
});
</script> -->
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
// Initialize the DataTable
var table = $('#datatable').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
],
pageLength: 10, // Default rows per page
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options
// responsive: true, // Responsive table
order: [], // Default ordering (column index 0, descending)
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
}
});
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>
<script>
function confirmDelete(event){
let result= confirm(` Do you Confirm to Delete the Factory Machine?`);
if(result){return result; }else{event.preventDefault();}
}
</script>
<script>
$(document).ready(function() {
$('#exampleSelect2').select2();
});
</script>
<script>
$(document).ready(function() {
$('#datatable tbody').on('click', '.edit-btn', function() {
var row = $(this).closest('tr');
// Get values from the row
var customerName = row.find('td:eq(0)').text();
var date = row.find('td:eq(1)').text();
var shift = row.find('td:eq(2)').text();
var machineOnTime = row.find('td:eq(3)').text();
var machineOffTime = row.find('td:eq(4)').text();
var machineRunningInHrs= row.find('td:eq(5)').text();
var totalCoating = row.find('td:eq(6)').text();
var totalCoatingSandInKg = row.find('td:eq(7)').text();
var totalGasConsumption = row.find('td:eq(8)').text();
var perHourGasConsumption =row.find('td:eq(9)').text();
var perHourCoatingSandQTY =row.find('td:eq(10)').text();
// Fill the modal fields with the values
$('#editCustomerNameId').val(customerName);
$('#editDateId').val(date);
$('#editShiftId').val(shift);
$('#editMachineOnTimeId').val(machineOnTime);
$('#editMachineOffTimeId').val(machineOffTime);
$('#editTotalCoatingId').val(totalCoating);
$('#editTotalCoatingSandId').val(totalCoatingSandInKg);
$('#editTotalGasConsumptionId').val(totalGasConsumption);
$('#editCoatingMachineDetailId').val(row.data('id'));
// Show the modal
$('#editCoatingMachineDetailModal').modal('show');
});
});
</script>

View File

@ -0,0 +1,411 @@
routes
//Stock Module
$routes->get('coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails');
$routes->post('addNewCoatingMachineDetails' , 'StockController::addNewCoatingMachineDetails');
$routes->post('editCoatingMachineDetails','StockController::editCoatingMachineDetails');
//stock controller
public function editCoatingMachineDetails(){
$putData=$this->request->getPost();
$id = $putData['editCoatingMachineDetailId'];
$updated= $this->coatingMachineDetails_model->update($id,$putData);
if ($updated) {
// Set flashdata for success message
return redirect()->to('/coatingMachineDetails')->with('success', 'Coating Machine details updated successfully');
} else {
// Set flashdata for error message
return redirect()->back()->with('error', 'Failed to update Coating machine details');
}
}
//coatingMachinedetailview
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;">
<thead>
<tr>
<th style="text-align:center !important;">Customer Name</th>
<th style="text-align:center !important;">Date</th>
<th style="text-align:center !important;">Shift</th>
<th style="text-align:center !important;">Machine On Time</th>
<th style="text-align:center !important;">Machine Off Time</th>
<th style="text-align:center !important;">Machine Running (hrs)</th>
<th style="text-align:center !important;">Total Coating</th>
<th style="text-align:center !important;">Total Coating Sand (kgs)</th>
<th style="text-align:center !important;">Total Gas Consumption</th>
<th style="text-align:center !important;">Per Hour Gas Consumption</th>
<th style="text-align:center !important;">Per Hour Coating Sand QTY</th>
<th style="text-align:center !important;">Action</th>
</tr>
</thead>
<tbody>
<?php
if (!empty($coatingMachineDetails)) {
foreach ($coatingMachineDetails as $record) {
?>
<tr data-id="<?php echo $record['id'] ?>">
<td align="center"><?php echo $record['customerName']; ?></td>
<td align="center"><?php echo $record['date'] ?></td>
<td align="center"><?php echo $record['shift'] ?></td>
<td align="center"><?php echo $record['machineOnTime'] ?></td>
<td align="center"><?php echo $record['machineOffTime'] ?></td>
<td align="center"><?php echo $record['machineRunningInHrs']??'' ?></td>
<td align="center"><?php echo $record['totalCoating'] ?></td>
<td align="center"><?php echo $record['totalCoatingSandInKg'] ?></td>
<td align="center"><?php echo $record['totalGasConsumption'] ?></td>
<td align="center"><?php echo $record['perHourGasConsumption']??'' ?></td>
<td align="center"><?php echo $record['perHourCoatingSandQTY']??'' ?></td>
<td align="center">
<a data-toggle="tooltip" class="edit-btn" data-target="editCoatingMachineDetailModal" data-toggle="modal"
style="cursor:pointer">
<i class="fa fa-pencil-alt" data-toggle="tooltip"
title="Click here to Edit "></i>
&nbsp;&nbsp;&nbsp;
</a>
<a data-toggle="tooltip" onclick="confirmDelete(event)"
href="<?php echo base_url(); ?>deleteFactoryMachineMasterDetails?id=<?php echo $record['id'] ?>"
>
<i class="fa fa-trash" data-toggle="tooltip"
title="Click here to Delete "></i>
&nbsp;&nbsp;&nbsp;
</a>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
</div>
<!-- coatingMachineDetailModal -->
<div class="modal fade" id="coatingMachineDetailModal" tabindex="-1" role="dialog" aria-labelledby="coatingMachineDetailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" style="width:1060px !important ;" role="document">
<div class="modal-content" >
<div class="modal-header">
<h5 class="modal-title" id="coatingMachineDetailModalLabel">
Add New Coating Machine Detail</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<!-- form -->
<form method="post" id="coatingMachineDetailModalFormId" action="<?php echo base_url(); ?>addNewCoatingMachineDetails">
<div class="modal-body">
<div class="form-row">
<div class="form-group col-md-3">
<label for="dateId">Date</label>
<span class="badge mandatory">*</span>
<input type="date" class="form-control" id="dateId"
name="date" value="">
</div>
<div class="form-group col-md-3">
<label for="shiftId">Shift</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="shiftId"
name="shift" value="">
</div>
<div class="form-group col-md-3">
<label for="machineOnTimeId">Machine On Time</label>
<span class="badge mandatory">*</span>
<input type="time" class="form-control" id="machineOnTimeId"
name="machineOnTime" value="">
</div>
<div class="form-group col-md-3">
<label for="machineOffTimeId">Machine Off Time</label>
<span class="badge mandatory">*</span>
<input type="time" class="form-control" id="machineOffTimeId"
name="machineOffTime" value="">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label for="customerNameId">Customer Name</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="customerNameId"
name="customerName" value="">
</div>
<div class="form-group col-md-3">
<label for="totalCoatingId">Total Coating</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalCoatingId"
name="totalCoating" value="">
</div>
<div class="form-group col-md-3">
<label for="totalCoatingSandId">Total Coating Sand (in Kg)</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalCoatingSandId"
name="totalCoatingSandInKg" value="">
</div>
<div class="form-group col-md-3">
<label for="totalGasConsumptionId">Total Gas Consumption</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalGasConsumptionId"
name="totalGasConsumption" value="">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Save </button>
</div>
</form>
</div>
</div>
</div>
<!-- editCoatingMachineDetailModal -->
<div class="modal fade" id="editCoatingMachineDetailModal" tabindex="-1" role="dialog" aria-labelledby="editCoatingMachineDetailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" style="width:1060px !important ;" role="document">
<div class="modal-content" >
<div class="modal-header">
<h5 class="modal-title" id="editCoatingMachineDetailModalLabel">
Edit Coating Machine Detail</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<!-- form -->
<form method="post" id="editCoatingMachineDetailModalFormId" action="<?php echo base_url(); ?>editCoatingMachineDetails">
<div class="modal-body">
<div class="form-row">
<div class="form-group col-md-3">
<label for="dateId">Date</label>
<span class="badge mandatory">*</span>
<input type="date" class="form-control" id="editDateId"
name="date" value="">
<input type="hidden" name="editCoatingMachineDetailId" id="editCoatingMachineDetailId">
</div>
<div class="form-group col-md-3">
<label for="shiftId">Shift</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editShiftId"
name="shift" value="">
</div>
<div class="form-group col-md-3">
<label for="machineOnTimeId">Machine On Time</label>
<span class="badge mandatory">*</span>
<input type="time" class="form-control" id="editMachineOnTimeId"
name="machineOnTime" value="">
</div>
<div class="form-group col-md-3">
<label for="machineOffTimeId">Machine Off Time</label>
<span class="badge mandatory">*</span>
<input type="time" class="form-control" id="editMachineOffTimeId"
name="machineOffTime" value="">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label for="customerNameId">Customer Name</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editCustomerNameId"
name="customerName" value="">
</div>
<div class="form-group col-md-3">
<label for="totalCoatingId">Total Coating</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editTotalCoatingId"
name="totalCoating" value="">
</div>
<div class="form-group col-md-3">
<label for="totalCoatingSandId">Total Coating Sand (in Kg)</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editTotalCoatingSandId"
name="totalCoatingSandInKg" value="">
</div>
<div class="form-group col-md-3">
<label for="totalGasConsumptionId">Total Gas Consumption</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editTotalGasConsumptionId"
name="totalGasConsumption" value="">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Save </button>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<!-- <script type="text/javascript">
$(function () {
$('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100]
});
});
</script> -->
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
// Initialize the DataTable
var table = $('#datatable').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
],
pageLength: 10, // Default rows per page
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options
// responsive: true, // Responsive table
order: [], // Default ordering (column index 0, descending)
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
}
});
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>
<script>
function confirmDelete(event){
let result= confirm(` Do you Confirm to Delete the Factory Machine?`);
if(result){return result; }else{event.preventDefault();}
}
</script>
<script>
$(document).ready(function() {
$('#exampleSelect2').select2();
});
</script>
<script>
$(document).ready(function() {
$('#datatable tbody').on('click', '.edit-btn', function() {
var row = $(this).closest('tr');
// Get values from the row
var customerName = row.find('td:eq(0)').text();
var date = row.find('td:eq(1)').text();
var shift = row.find('td:eq(2)').text();
var machineOnTime = row.find('td:eq(3)').text();
var machineOffTime = row.find('td:eq(4)').text();
var machineRunningInHrs= row.find('td:eq(5)').text();
var totalCoating = row.find('td:eq(6)').text();
var totalCoatingSandInKg = row.find('td:eq(7)').text();
var totalGasConsumption = row.find('td:eq(8)').text();
var perHourGasConsumption =row.find('td:eq(9)').text();
var perHourCoatingSandQTY =row.find('td:eq(10)').text();
// Fill the modal fields with the values
$('#editCustomerNameId').val(customerName);
$('#editDateId').val(date);
$('#editShiftId').val(shift);
$('#editMachineOnTimeId').val(machineOnTime);
$('#editMachineOffTimeId').val(machineOffTime);
$('#editTotalCoatingId').val(totalCoating);
$('#editTotalCoatingSandId').val(totalCoatingSandInKg);
$('#editTotalGasConsumptionId').val(totalGasConsumption);
$('#editCoatingMachineDetailId').val(row.data('id'));
// Show the modal
$('#editCoatingMachineDetailModal').modal('show');
});
});
</script>

View File

@ -0,0 +1,411 @@
routes
//Stock Module
$routes->get('coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails');
$routes->post('addNewCoatingMachineDetails' , 'StockController::addNewCoatingMachineDetails');
$routes->post('editCoatingMachineDetails','StockController::editCoatingMachineDetails');
//stock controller
public function editCoatingMachineDetails(){
$putData=$this->request->getPost();
$id = $putData['editCoatingMachineDetailId'];
$updated= $this->coatingMachineDetails_model->update($id,$putData);
if ($updated) {
// Set flashdata for success message
return redirect()->to('/coatingMachineDetails')->with('success', 'Coating Machine details updated successfully');
} else {
// Set flashdata for error message
return redirect()->back()->with('error', 'Failed to update Coating machine details');
}
}
//coatingMachinedetailview
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;">
<thead>
<tr>
<th style="text-align:center !important;">Customer Name</th>
<th style="text-align:center !important;">Date</th>
<th style="text-align:center !important;">Shift</th>
<th style="text-align:center !important;">Machine On Time</th>
<th style="text-align:center !important;">Machine Off Time</th>
<th style="text-align:center !important;">Machine Running (hrs)</th>
<th style="text-align:center !important;">Total Coating</th>
<th style="text-align:center !important;">Total Coating Sand (kgs)</th>
<th style="text-align:center !important;">Total Gas Consumption</th>
<th style="text-align:center !important;">Per Hour Gas Consumption</th>
<th style="text-align:center !important;">Per Hour Coating Sand QTY</th>
<th style="text-align:center !important;">Action</th>
</tr>
</thead>
<tbody>
<?php
if (!empty($coatingMachineDetails)) {
foreach ($coatingMachineDetails as $record) {
?>
<tr data-id="<?php echo $record['id'] ?>">
<td align="center"><?php echo $record['customerName']; ?></td>
<td align="center"><?php echo $record['date'] ?></td>
<td align="center"><?php echo $record['shift'] ?></td>
<td align="center"><?php echo $record['machineOnTime'] ?></td>
<td align="center"><?php echo $record['machineOffTime'] ?></td>
<td align="center"><?php echo $record['machineRunningInHrs']??'' ?></td>
<td align="center"><?php echo $record['totalCoating'] ?></td>
<td align="center"><?php echo $record['totalCoatingSandInKg'] ?></td>
<td align="center"><?php echo $record['totalGasConsumption'] ?></td>
<td align="center"><?php echo $record['perHourGasConsumption']??'' ?></td>
<td align="center"><?php echo $record['perHourCoatingSandQTY']??'' ?></td>
<td align="center">
<a data-toggle="tooltip" class="edit-btn" data-target="editCoatingMachineDetailModal" data-toggle="modal"
style="cursor:pointer">
<i class="fa fa-pencil-alt" data-toggle="tooltip"
title="Click here to Edit "></i>
&nbsp;&nbsp;&nbsp;
</a>
<a data-toggle="tooltip" onclick="confirmDelete(event)"
href="<?php echo base_url(); ?>deleteFactoryMachineMasterDetails?id=<?php echo $record['id'] ?>"
>
<i class="fa fa-trash" data-toggle="tooltip"
title="Click here to Delete "></i>
&nbsp;&nbsp;&nbsp;
</a>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
</div>
<!-- coatingMachineDetailModal -->
<div class="modal fade" id="coatingMachineDetailModal" tabindex="-1" role="dialog" aria-labelledby="coatingMachineDetailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" style="width:1060px !important ;" role="document">
<div class="modal-content" >
<div class="modal-header">
<h5 class="modal-title" id="coatingMachineDetailModalLabel">
Add New Coating Machine Detail</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<!-- form -->
<form method="post" id="coatingMachineDetailModalFormId" action="<?php echo base_url(); ?>addNewCoatingMachineDetails">
<div class="modal-body">
<div class="form-row">
<div class="form-group col-md-3">
<label for="dateId">Date</label>
<span class="badge mandatory">*</span>
<input type="date" class="form-control" id="dateId"
name="date" value="">
</div>
<div class="form-group col-md-3">
<label for="shiftId">Shift</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="shiftId"
name="shift" value="">
</div>
<div class="form-group col-md-3">
<label for="machineOnTimeId">Machine On Time</label>
<span class="badge mandatory">*</span>
<input type="time" class="form-control" id="machineOnTimeId"
name="machineOnTime" value="">
</div>
<div class="form-group col-md-3">
<label for="machineOffTimeId">Machine Off Time</label>
<span class="badge mandatory">*</span>
<input type="time" class="form-control" id="machineOffTimeId"
name="machineOffTime" value="">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label for="customerNameId">Customer Name</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="customerNameId"
name="customerName" value="">
</div>
<div class="form-group col-md-3">
<label for="totalCoatingId">Total Coating</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalCoatingId"
name="totalCoating" value="">
</div>
<div class="form-group col-md-3">
<label for="totalCoatingSandId">Total Coating Sand (in Kg)</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalCoatingSandId"
name="totalCoatingSandInKg" value="">
</div>
<div class="form-group col-md-3">
<label for="totalGasConsumptionId">Total Gas Consumption</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalGasConsumptionId"
name="totalGasConsumption" value="">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Save </button>
</div>
</form>
</div>
</div>
</div>
<!-- editCoatingMachineDetailModal -->
<div class="modal fade" id="editCoatingMachineDetailModal" tabindex="-1" role="dialog" aria-labelledby="editCoatingMachineDetailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" style="width:1060px !important ;" role="document">
<div class="modal-content" >
<div class="modal-header">
<h5 class="modal-title" id="editCoatingMachineDetailModalLabel">
Edit Coating Machine Detail</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<!-- form -->
<form method="post" id="editCoatingMachineDetailModalFormId" action="<?php echo base_url(); ?>editCoatingMachineDetails">
<div class="modal-body">
<div class="form-row">
<div class="form-group col-md-3">
<label for="dateId">Date</label>
<span class="badge mandatory">*</span>
<input type="date" class="form-control" id="editDateId"
name="date" value="">
<input type="hidden" name="editCoatingMachineDetailId" id="editCoatingMachineDetailId">
</div>
<div class="form-group col-md-3">
<label for="shiftId">Shift</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editShiftId"
name="shift" value="">
</div>
<div class="form-group col-md-3">
<label for="machineOnTimeId">Machine On Time</label>
<span class="badge mandatory">*</span>
<input type="time" class="form-control" id="editMachineOnTimeId"
name="machineOnTime" value="">
</div>
<div class="form-group col-md-3">
<label for="machineOffTimeId">Machine Off Time</label>
<span class="badge mandatory">*</span>
<input type="time" class="form-control" id="editMachineOffTimeId"
name="machineOffTime" value="">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label for="customerNameId">Customer Name</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editCustomerNameId"
name="customerName" value="">
</div>
<div class="form-group col-md-3">
<label for="totalCoatingId">Total Coating</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editTotalCoatingId"
name="totalCoating" value="">
</div>
<div class="form-group col-md-3">
<label for="totalCoatingSandId">Total Coating Sand (in Kg)</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editTotalCoatingSandId"
name="totalCoatingSandInKg" value="">
</div>
<div class="form-group col-md-3">
<label for="totalGasConsumptionId">Total Gas Consumption</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editTotalGasConsumptionId"
name="totalGasConsumption" value="">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Save </button>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<!-- <script type="text/javascript">
$(function () {
$('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100]
});
});
</script> -->
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
// Initialize the DataTable
var table = $('#datatable').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
],
pageLength: 10, // Default rows per page
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options
// responsive: true, // Responsive table
order: [], // Default ordering (column index 0, descending)
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
}
});
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>
<script>
function confirmDelete(event){
let result= confirm(` Do you Confirm to Delete the Factory Machine?`);
if(result){return result; }else{event.preventDefault();}
}
</script>
<script>
$(document).ready(function() {
$('#exampleSelect2').select2();
});
</script>
<script>
$(document).ready(function() {
$('#datatable tbody').on('click', '.edit-btn', function() {
var row = $(this).closest('tr');
// Get values from the row
var customerName = row.find('td:eq(0)').text();
var date = row.find('td:eq(1)').text();
var shift = row.find('td:eq(2)').text();
var machineOnTime = row.find('td:eq(3)').text();
var machineOffTime = row.find('td:eq(4)').text();
var machineRunningInHrs= row.find('td:eq(5)').text();
var totalCoating = row.find('td:eq(6)').text();
var totalCoatingSandInKg = row.find('td:eq(7)').text();
var totalGasConsumption = row.find('td:eq(8)').text();
var perHourGasConsumption =row.find('td:eq(9)').text();
var perHourCoatingSandQTY =row.find('td:eq(10)').text();
// Fill the modal fields with the values
$('#editCustomerNameId').val(customerName);
$('#editDateId').val(date);
$('#editShiftId').val(shift);
$('#editMachineOnTimeId').val(machineOnTime);
$('#editMachineOffTimeId').val(machineOffTime);
$('#editTotalCoatingId').val(totalCoating);
$('#editTotalCoatingSandId').val(totalCoatingSandInKg);
$('#editTotalGasConsumptionId').val(totalGasConsumption);
$('#editCoatingMachineDetailId').val(row.data('id'));
// Show the modal
$('#editCoatingMachineDetailModal').modal('show');
});
});
</script>

View File

@ -0,0 +1,4 @@
users_table_alter _query
ALTER TABLE `trs_matri_lara`.`users`
ADD COLUMN `last_login_reminder_at` TIMESTAMP NULL DEFAULT NULL AFTER `last_login_at`;

View File

@ -0,0 +1,4 @@
users_table_alter _query
ALTER TABLE `trs_matri_lara`.`users`
ADD COLUMN `last_login_reminder_at` TIMESTAMP NULL DEFAULT NULL AFTER `last_login_at`;