changes in master details-4 vadivel J 21-11-2024
This commit is contained in:
parent
bd0a29ea95
commit
dd515fafb6
@ -420,6 +420,7 @@ $routes->get('readFactoryMachineMasterDetails', 'FactoryMachineController::readF
|
|||||||
$routes->get('readFactoryMachineMasterDetailsById', 'FactoryMachineController::readFactoryMachineMasterDetailsById');
|
$routes->get('readFactoryMachineMasterDetailsById', 'FactoryMachineController::readFactoryMachineMasterDetailsById');
|
||||||
$routes->post('updateFactoryMachineMasterDetails', 'FactoryMachineController::updateFactoryMachineMasterDetails');
|
$routes->post('updateFactoryMachineMasterDetails', 'FactoryMachineController::updateFactoryMachineMasterDetails');
|
||||||
$routes->get('deleteFactoryMachineMasterDetails', 'FactoryMachineController::deleteFactoryMachineMasterDetails');
|
$routes->get('deleteFactoryMachineMasterDetails', 'FactoryMachineController::deleteFactoryMachineMasterDetails');
|
||||||
|
$routes->get('reActivateFactoryMachineMasterDetails', 'FactoryMachineController::reActivateFactoryMachineMasterDetails');
|
||||||
|
|
||||||
$routes->get('loadView_createFactoryMachineMasterDetail', 'FactoryMachineController::loadView_createFactoryMachineMasterDetail');
|
$routes->get('loadView_createFactoryMachineMasterDetail', 'FactoryMachineController::loadView_createFactoryMachineMasterDetail');
|
||||||
$routes->get('loadView_updateFactoryMachineMasterDetail', 'FactoryMachineController::loadView_updateFactoryMachineMasterDetail');
|
$routes->get('loadView_updateFactoryMachineMasterDetail', 'FactoryMachineController::loadView_updateFactoryMachineMasterDetail');
|
||||||
|
|||||||
@ -82,7 +82,6 @@ class FactoryMachineController extends BaseController
|
|||||||
$this->global['pageTitle'] = 'Factory Machine Master Details';
|
$this->global['pageTitle'] = 'Factory Machine Master Details';
|
||||||
|
|
||||||
$data['masterData'] = $this->factoryMachineMaster_model
|
$data['masterData'] = $this->factoryMachineMaster_model
|
||||||
->where('is_active', 1)
|
|
||||||
->orderBy('created_at','DESC')
|
->orderBy('created_at','DESC')
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
@ -153,4 +152,24 @@ class FactoryMachineController extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function reActivateFactoryMachineMasterDetails(){
|
||||||
|
|
||||||
|
$this->global['pageTitle'] = 'Re Activate Factory Machine Master Details';
|
||||||
|
|
||||||
|
$id = $this->request->getGet('id');
|
||||||
|
|
||||||
|
$data['is_active']=1;
|
||||||
|
|
||||||
|
$updated = $this->factoryMachineMaster_model->update($id,$data);
|
||||||
|
|
||||||
|
if ($updated) {
|
||||||
|
// Set flashdata for success message
|
||||||
|
return redirect()->to('/readFactoryMachineMasterDetails')->with('success', 'Re Activated Factory Machine Master Details');
|
||||||
|
} else {
|
||||||
|
// Set flashdata for error message
|
||||||
|
return redirect()->back()->with('error', 'Failed to Re Activate machine details');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -156,21 +156,26 @@
|
|||||||
<td>
|
<td>
|
||||||
<?php if ($record->IsActive == 0) { ?>
|
<?php if ($record->IsActive == 0) { ?>
|
||||||
|
|
||||||
<a href="<?php echo base_url() . 'reActivateDepartment/?SID=' . $record->DEPCode ?>"
|
<a
|
||||||
|
onclick="confirmReActivateDepartment(event)"
|
||||||
|
href="<?php echo base_url() . 'reActivateDepartment/?SID=' . $record->DEPCode ?>"
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
title="<?php echo $record->DEPCode ?> - Click here to Re activate Department Details"><i
|
title="<?php echo $record->DEPCode ?> - Click here to Re activate Department Details"><i
|
||||||
class="fas fa-key"></i></a></u>
|
class="fas fa-key"></i></a></u>
|
||||||
|
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|
||||||
<a href="<?php echo base_url() . 'editOlddepartment/?SID=' . $record->DEPCode ?>"
|
<a
|
||||||
|
href="<?php echo base_url() . 'editOlddepartment/?SID=' . $record->DEPCode ?>"
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
title="<?php echo $record->DEPCode ?> - Click here to View Department Details"><i
|
title="<?php echo $record->DEPCode ?> - Click here to View Department Details"><i
|
||||||
class="fas fa-edit"></i></a></u>
|
class="fas fa-edit"></i></a></u>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a href="<?php echo base_url() . 'deleteDepartment/?SID=' . $record->DEPCode ?>"
|
<a
|
||||||
|
onclick="confirmDeleteDepartment(event)"
|
||||||
|
href="<?php echo base_url() . 'deleteDepartment/?SID=' . $record->DEPCode ?>"
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
title="<?php echo $record->DEPCode ?> - Click here to Delete Department Details"><i
|
title="<?php echo $record->DEPCode ?> - Click here to Delete Department Details"><i
|
||||||
class="fas fa-trash"></i></a></u>
|
class="fas fa-trash"></i></a></u>
|
||||||
@ -318,4 +323,14 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function confirmDeleteDepartment(event){
|
||||||
|
let result = confirm("Do You want to delete department ?");
|
||||||
|
if(result){return;}else{event.preventDefault();}
|
||||||
|
}
|
||||||
|
|
||||||
|
function confirmReActivateDepartment(event){
|
||||||
|
let result = confirm("Do You want to Re activate deleted department ?");
|
||||||
|
if(result){return;}else{event.preventDefault();}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -74,7 +74,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<!-- start page title -->
|
<!-- start page title -->
|
||||||
<div>
|
<div>
|
||||||
<?php
|
<?php
|
||||||
helper('form');
|
helper('form');
|
||||||
$error = session()->getFlashdata('error');
|
$error = session()->getFlashdata('error');
|
||||||
if ($error) {
|
if ($error) {
|
||||||
@ -89,17 +89,19 @@
|
|||||||
?>
|
?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="page-title-box page-title-box-alt">
|
<div class="page-title-box page-title-box-alt">
|
||||||
<div class="page-title-right">
|
<div class="page-title-right">
|
||||||
<ol class="breadcrumb m-0">
|
<ol class="breadcrumb m-0">
|
||||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Master Details</a></li>
|
<li class="breadcrumb-item"><a href="javascript: void(0);">Master Details</a></li>
|
||||||
<li class="breadcrumb-item active">
|
<li class="breadcrumb-item active">
|
||||||
<h4 class="page-title"> <?= trim(explode(":", $pageTitle)[1]) ?> </h4>
|
<h4 class="page-title"> <?= trim(explode(":", $pageTitle)[1]) ?> </h4>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
<a class="btn btn-success" href="<?php echo base_url(); ?>loadView_createFactoryMachineMasterDetail">Add New Factory Machine</a>
|
<a class="btn btn-success"
|
||||||
</div>
|
href="<?php echo base_url(); ?>loadView_createFactoryMachineMasterDetail">Add New
|
||||||
|
Factory Machine</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -107,61 +109,95 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<div style="margin-left:auto">
|
||||||
|
<div class="form-check" style="margin-right: 25px;">
|
||||||
|
<input class="form-check-input" type="checkbox" id="showArchiveId"
|
||||||
|
name="showArchive" value="1" onchange="showArchiveList()"
|
||||||
|
style="width: 18px; height: 18px;">
|
||||||
|
<label class="form-check-label" for="showArchiveId"
|
||||||
|
style="font-size: 1rem; margin-left: 8px;">
|
||||||
|
Show Archive
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="card-body" style="overflow-x:scroll;">
|
<div class="card-body" style="overflow-x:scroll;">
|
||||||
|
|
||||||
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;">
|
|
||||||
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th >Machine Name</th>
|
|
||||||
<th >Machine Type</th>
|
|
||||||
<th >Energy Type</th>
|
|
||||||
<th style="text-align:center !important;">Action</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
if (!empty($masterData)) {
|
|
||||||
|
|
||||||
foreach ($masterData as $record) {
|
|
||||||
?>
|
|
||||||
<td ><?php echo $record['machine_name']; ?></td>
|
|
||||||
<td ><?php echo $record['machine_type'] ?></td>
|
|
||||||
<td ><?php echo $record['energy_type'] ?></td>
|
|
||||||
<td align="center">
|
|
||||||
<a data-toggle="tooltip"
|
|
||||||
href="<?php echo base_url()?>loadView_updateFactoryMachineMasterDetail?id=<?php echo $record['id'] ?>"
|
|
||||||
>
|
|
||||||
<i class="fa fa-pencil-alt" data-toggle="tooltip"
|
|
||||||
title="Click here to Edit "></i>
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
<table id="datatable" class="table table-hover table-bordered"
|
||||||
|
style="background-color:#fff;">
|
||||||
|
|
||||||
<a data-toggle="tooltip" onclick="confirmDelete(event)"
|
<thead>
|
||||||
href="<?php echo base_url(); ?>deleteFactoryMachineMasterDetails?id=<?php echo $record['id'] ?>"
|
<tr>
|
||||||
>
|
|
||||||
<i class="fa fa-trash" data-toggle="tooltip"
|
|
||||||
title="Click here to Delete "></i>
|
|
||||||
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
<th>Machine Name</th>
|
||||||
|
<th>Machine Type</th>
|
||||||
|
<th>Energy Type</th>
|
||||||
</td>
|
<th style="text-align:center !important;">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
</thead>
|
||||||
}
|
<tbody>
|
||||||
}
|
<?php
|
||||||
?>
|
|
||||||
|
if (!empty($masterData)) {
|
||||||
</tbody>
|
|
||||||
</table>
|
foreach ($masterData as $record) {
|
||||||
|
|
||||||
|
?>
|
||||||
|
<tr class="<?php if ($record['is_active'] == 0) {
|
||||||
|
echo "deactivatedRow";
|
||||||
|
} ?>" style="<?php if ($record['is_active'] == 0) {
|
||||||
|
echo "display:none";
|
||||||
|
} ?>">
|
||||||
|
|
||||||
|
<td><?php echo $record['machine_name']; ?></td>
|
||||||
|
<td><?php echo $record['machine_type'] ?></td>
|
||||||
|
<td><?php echo $record['energy_type'] ?></td>
|
||||||
|
<td align="center">
|
||||||
|
|
||||||
|
<?php if ($record['is_active'] == 0) { ?>
|
||||||
|
|
||||||
|
<a data-toggle="tooltip"
|
||||||
|
onclick="confirmReActivateMachineDetail(event)"
|
||||||
|
href="<?php echo base_url(); ?>reActivateFactoryMachineMasterDetails?id=<?php echo $record['id'] ?>">
|
||||||
|
<i class="fa fa-key" data-toggle="tooltip"
|
||||||
|
title="Click here to Re activate machine detail "></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<?php } else { ?>
|
||||||
|
|
||||||
|
|
||||||
|
<a data-toggle="tooltip"
|
||||||
|
href="<?php echo base_url() ?>loadView_updateFactoryMachineMasterDetail?id=<?php echo $record['id'] ?>">
|
||||||
|
<i class="fa fa-pencil-alt" data-toggle="tooltip"
|
||||||
|
title="Click here to Edit machine detail "></i>
|
||||||
|
|
||||||
|
</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 machine detail"></i>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div> <!-- end card body-->
|
</div> <!-- end card body-->
|
||||||
</div> <!-- end card -->
|
</div> <!-- end card -->
|
||||||
</div><!-- end col-->
|
</div><!-- end col-->
|
||||||
@ -174,22 +210,22 @@
|
|||||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function () {
|
||||||
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
|
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
|
||||||
var dateSplit = date.split('-');
|
var dateSplit = date.split('-');
|
||||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||||
};
|
};
|
||||||
// Initialize the DataTable
|
// Initialize the DataTable
|
||||||
|
|
||||||
var table = $('#datatable').DataTable({
|
var table = $('#datatable').DataTable({
|
||||||
dom: 'Blfrtip',
|
dom: 'Blfrtip',
|
||||||
buttons: [
|
buttons: [
|
||||||
'excel', 'pdf'
|
'excel', 'pdf'
|
||||||
],
|
],
|
||||||
pageLength: 10,
|
pageLength: 10,
|
||||||
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ],
|
lengthMenu: [[10, 20, 30, 50, -1], [10, 20, 30, 50, "All"]],
|
||||||
responsive: false,
|
responsive: false,
|
||||||
order: false,
|
order: false,
|
||||||
language: {
|
language: {
|
||||||
paginate: {
|
paginate: {
|
||||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||||
@ -200,7 +236,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// Handle form submission
|
// Handle form submission
|
||||||
$("#DateRangeFilter").submit(function(e) {
|
$("#DateRangeFilter").submit(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
table.draw();
|
table.draw();
|
||||||
});
|
});
|
||||||
@ -208,11 +244,43 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function confirmDelete(event){
|
function confirmDelete(event) {
|
||||||
|
|
||||||
let result= confirm(` Do you Confirm to Delete the Factory Machine?`);
|
let result = confirm(` Do you Confirm to Delete the Factory Machine?`);
|
||||||
if(result){return result; }else{event.preventDefault();}
|
if (result) { return result; } else { event.preventDefault(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function confirmReActivateMachineDetail(event) {
|
||||||
|
let result = confirm(` Do you Confirm to Re Activate Factory Machine Detail?`);
|
||||||
|
if (result) { return result; } else { event.preventDefault(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function showArchiveList() {
|
||||||
|
let isChecked = $("#showArchiveId").prop('checked');
|
||||||
|
|
||||||
|
// Show or hide the rows based on checkbox status
|
||||||
|
$(".deactivatedRow").each(function () {
|
||||||
|
if (isChecked) {
|
||||||
|
$(this).show();
|
||||||
|
} else {
|
||||||
|
$(this).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
let table = $('#datatable').DataTable();
|
||||||
|
|
||||||
|
showArchiveList();
|
||||||
|
|
||||||
|
table.on('draw', function () {
|
||||||
|
showArchiveList();
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user