master detail module changes-2 vadivel J 10-12-2024
This commit is contained in:
parent
a0b01f07a0
commit
fb66a2468f
@ -119,12 +119,9 @@ class Configurationctrl extends BaseController
|
|||||||
$child_result = $this->configmodel->addconfigdetails($child_arr);
|
$child_result = $this->configmodel->addconfigdetails($child_arr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result || $child_result) {
|
|
||||||
$this->session->setFlashdata('success', 'Configuration Updated successfully!');
|
$this->session->setFlashdata('success', 'Configuration Updated successfully!');
|
||||||
} else {
|
|
||||||
$this->session->setFlashdata('error', 'Configuration Record Not Updated!');
|
|
||||||
}
|
|
||||||
return redirect()->route('configlisting');
|
return redirect()->route('configlisting');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -177,7 +177,7 @@ class StockController extends BaseController
|
|||||||
throw new \Exception('Failed to update gas stock consumption.');
|
throw new \Exception('Failed to update gas stock consumption.');
|
||||||
}
|
}
|
||||||
$message2 = 'And updated gas stock consumption.';
|
$message2 = 'And updated gas stock consumption.';
|
||||||
$message3 =" Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
|
$message3 = " Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
|
||||||
} else {
|
} else {
|
||||||
throw new \Exception('Failed to insert Coating machine details.');
|
throw new \Exception('Failed to insert Coating machine details.');
|
||||||
}
|
}
|
||||||
@ -189,11 +189,11 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
$this->db->transCommit();
|
$this->db->transCommit();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Set flashdata for success message
|
// Set flashdata for success message
|
||||||
return redirect()->to("/coatingMachineDetails?month=$month")
|
return redirect()->to("/coatingMachineDetails?month=$month")
|
||||||
->with('success', $message1 . " " . $message2 ." ".$message3);
|
->with('success', $message1 . " " . $message2 . " " . $message3);
|
||||||
|
|
||||||
} catch (\Exception $error) {
|
} catch (\Exception $error) {
|
||||||
$this->db->transRollback();
|
$this->db->transRollback();
|
||||||
@ -238,7 +238,7 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
$message2 = 'And updated gas stock consumption.';
|
$message2 = 'And updated gas stock consumption.';
|
||||||
|
|
||||||
$message3 ="Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
|
$message3 = "Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
|
||||||
|
|
||||||
}
|
}
|
||||||
// Commit the transaction if all queries succeed
|
// Commit the transaction if all queries succeed
|
||||||
@ -254,7 +254,7 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
// Set flashdata for success message
|
// Set flashdata for success message
|
||||||
return redirect()->to("/coatingMachineDetails?month=$month")
|
return redirect()->to("/coatingMachineDetails?month=$month")
|
||||||
->with('success', $message1 . " " . $message2 ." " . $message3);
|
->with('success', $message1 . " " . $message2 . " " . $message3);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new \Exception('Failed to update Coating machine details.');
|
throw new \Exception('Failed to update Coating machine details.');
|
||||||
@ -470,30 +470,27 @@ class StockController extends BaseController
|
|||||||
$data['groupedBagStockDetails'] = array_values($groupedByDate);
|
$data['groupedBagStockDetails'] = array_values($groupedByDate);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* need to change the below condition to allow active bag materials for new entries
|
|
||||||
* not for older entries
|
|
||||||
**/
|
|
||||||
|
|
||||||
if(!empty($data['groupedBagStockDetails'])){
|
|
||||||
|
if (!empty($data['groupedBagStockDetails'])) {
|
||||||
|
|
||||||
$result = $this->bagStockDetails_model
|
$result = $this->bagStockDetails_model
|
||||||
->select('materialCode') // Specify the column you want to select
|
->select('materialCode') // Specify the column you want to select
|
||||||
->distinct() // Use distinct without arguments
|
->distinct() // Use distinct
|
||||||
->orderBy('materialCode', 'asc')
|
->orderBy('materialCode', 'asc')
|
||||||
->findAll();
|
->findAll();
|
||||||
$distinctMaterialCodes=[];
|
$distinctMaterialCodes = [];
|
||||||
foreach($result as $index => $eachResult){
|
foreach ($result as $index => $eachResult) {
|
||||||
$distinctMaterialCodes[] = $result[$index]['materialCode'];
|
$distinctMaterialCodes[] = $result[$index]['materialCode'];
|
||||||
}
|
}
|
||||||
$bagMaterials = $this->rawmaterialdetails_model->getSelectedBagMaterialCode($distinctMaterialCodes);
|
$bagMaterials = $this->rawmaterialdetails_model->getSelectedBagMaterialCode($distinctMaterialCodes);
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
$bagMaterials = $this->rawmaterialdetails_model->getAllBagMaterialCode();
|
$bagMaterials = $this->rawmaterialdetails_model->getAllBagMaterialCode();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($bagMaterials as $key => $bagMaterial) {
|
foreach ($bagMaterials as $key => $bagMaterial) {
|
||||||
@ -755,7 +752,25 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$resinMaterials = $this->rawmaterialdetails_model->getAllResinMaterialCode();
|
if (!empty($data['groupedBagStockDetails'])) {
|
||||||
|
|
||||||
|
$result = $this->resinStockDetails_model
|
||||||
|
->select('materialCode') // Specify the column you want to select
|
||||||
|
->distinct() // Use distinct
|
||||||
|
->orderBy('materialCode', 'asc')
|
||||||
|
->findAll();
|
||||||
|
$distinctMaterialCodes = [];
|
||||||
|
foreach ($result as $index => $eachResult) {
|
||||||
|
$distinctMaterialCodes[] = $result[$index]['materialCode'];
|
||||||
|
}
|
||||||
|
$resinMaterials = $this->rawmaterialdetails_model->getSelectedResinMaterialCode($distinctMaterialCodes);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$resinMaterials = $this->rawmaterialdetails_model->getAllResinMaterialCode();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach ($resinMaterials as $key => $resinMaterial) {
|
foreach ($resinMaterials as $key => $resinMaterial) {
|
||||||
$materialCode = $resinMaterial['MaterialCode'];
|
$materialCode = $resinMaterial['MaterialCode'];
|
||||||
@ -1270,19 +1285,19 @@ class StockController extends BaseController
|
|||||||
if (!empty($inserts)) {
|
if (!empty($inserts)) {
|
||||||
$this->drierMachineDetails_model->insertBatch($inserts);
|
$this->drierMachineDetails_model->insertBatch($inserts);
|
||||||
|
|
||||||
$message1 ="Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
|
$message1 = "Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($updates)) {
|
if (!empty($updates)) {
|
||||||
$this->drierMachineDetails_model->updateBatch($updates, 'id');
|
$this->drierMachineDetails_model->updateBatch($updates, 'id');
|
||||||
|
|
||||||
$message1 ="Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
|
$message1 = "Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->db->transStatus() === false) {
|
if ($this->db->transStatus() === false) {
|
||||||
throw new \Exception('Transaction failed due to database error.');
|
throw new \Exception('Transaction failed due to database error.');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->transCommit();
|
$this->db->transCommit();
|
||||||
@ -1481,7 +1496,7 @@ class StockController extends BaseController
|
|||||||
$data['powerConsumptionDetails'] = $this->getElectricConsumptionPivot($data['machineDetails'], $data['startDate'], $data['endDate']);
|
$data['powerConsumptionDetails'] = $this->getElectricConsumptionPivot($data['machineDetails'], $data['startDate'], $data['endDate']);
|
||||||
if (!count($data['powerConsumptionDetails'])) {
|
if (!count($data['powerConsumptionDetails'])) {
|
||||||
//insert empty data
|
//insert empty data
|
||||||
$tempInsert = [];
|
$tempInsert = [];
|
||||||
foreach ($monthData as $key => $value) {
|
foreach ($monthData as $key => $value) {
|
||||||
array_push($tempInsert, ['date' => $value['database'], 'machine_id' => $data['machineDetails'][0]['id']]);
|
array_push($tempInsert, ['date' => $value['database'], 'machine_id' => $data['machineDetails'][0]['id']]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -195,6 +195,20 @@ class Rawmaterialdetails_model extends Model
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSelectedResinMaterialCode($distinctMaterialCodes)
|
||||||
|
{
|
||||||
|
$builder = $this->db->table('t_materialmaster')
|
||||||
|
->select('MaterialCode, MaterialName')
|
||||||
|
->whereIn('MaterialCode', $distinctMaterialCodes) // Matches MaterialCode with the array
|
||||||
|
->orderBy('MaterialCode', 'asc');
|
||||||
|
|
||||||
|
$query = $builder->get();
|
||||||
|
$materialResults = $query->getResultArray();
|
||||||
|
|
||||||
|
return $materialResults;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function getMaterialstock($MaterialCode, $currentdate)
|
function getMaterialstock($MaterialCode, $currentdate)
|
||||||
|
|
||||||
|
|||||||
@ -91,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 text-right">
|
<div class="col-md-12 text-right">
|
||||||
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
||||||
<input type="reset" id="reset" class="btn btn-reset" style="background-color: red;color: white; margin-right: 15px;width: 80px;" value="Reset" />
|
<a class="btn btn-secondary" href="<?php echo base_url() ?>configlisting" class="btn btn-secondary">Cancel</a>
|
||||||
<input type="submit" onclick="return Validate();" value="Submit" class="btn btn-success">
|
<input type="submit" onclick="return Validate();" value="Submit" class="btn btn-success">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -168,13 +168,16 @@
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<!-- Modal Header -->
|
<!-- Modal Header -->
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
|
||||||
|
<h4 class="modal-title" id="myModalLabel">
|
||||||
|
<center> Edit Configuration</center>
|
||||||
|
</h4>
|
||||||
|
|
||||||
<button type="button" class="close" data-dismiss="modal">
|
<button type="button" class="close" data-dismiss="modal">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
<span class="sr-only">Close</span>
|
<span class="sr-only">Close</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="myModalLabel">
|
|
||||||
<center> Edit Configuration</center>
|
|
||||||
</h4>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- Modal Body -->
|
<!-- Modal Body -->
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
@ -195,7 +198,7 @@
|
|||||||
<!-- Modal Footer -->
|
<!-- Modal Footer -->
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a class="btn btn-success" style="background-color: grey;border: none;margin-right:10px" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
|
<a class="btn btn-success" style="background-color: grey;border: none;margin-right:10px" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
|
||||||
<a class="btn btn-success font tempClickEdit" ID="tempClickEdit" style="margin-top: -24px;"><i class="fa fa-plus"></i> <span class="bold">Edit</span></a>
|
<a class="btn btn-success tempClickEdit" style="background-color: light-blue;border: none;margin-right:10px"#addconfigID="tempClickEdit" ><span class="bold">Edit</span></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -257,8 +260,9 @@
|
|||||||
<td>${ConfigValue}</td>
|
<td>${ConfigValue}</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="editConfig" data-target='#Edit' data-id="${temp}" data-index="${index}" data-userid="${temp}" data-toggle="modal" href="#Edit">
|
<a class="editConfig" data-target='#Edit' data-id="${temp}" data-index="${index}" data-userid="${temp}" data-toggle="modal" href="#Edit">
|
||||||
<i class="ri-pencil-fill"></i>
|
<i class="fas fa-edit"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
@ -310,7 +314,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$("#AddConfiguration").modal('hide');
|
$("#Edit").modal('hide');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
alert('Please enter all the values');
|
alert('Please enter all the values');
|
||||||
@ -420,36 +424,17 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$('#ConfigValue').change(function(){
|
$('#ConfigValue , #EditConfigValue').change(function(){
|
||||||
$('#loader').show();
|
let configValue = $(this).val();
|
||||||
$.ajax({
|
let configTable = $('#configtable').tableToJSON();
|
||||||
data: {ConfigValue: $('#ConfigValue').val()},
|
let configValueExisting = configTable.map(element => element['Configuration Value']);
|
||||||
type: 'POST',
|
let result = configValueExisting.includes(configValue);
|
||||||
url: "<?php echo base_url(); ?>configurationctrl/configValueCheck",
|
|
||||||
|
|
||||||
success: function (data) {
|
if(result){
|
||||||
if(data && data.length > 0){
|
alert('configuration value is already present..!!');
|
||||||
|
$(this).val('');
|
||||||
if(data[0].isActive == 1){
|
return false;
|
||||||
alert("This Configuration Value is already present. kindly change it..!!");
|
}
|
||||||
$('#ConfigValue').val('');
|
|
||||||
return;
|
|
||||||
}else{
|
|
||||||
alert("This Configuration Value is already present in deleted section. kindly reactivate it If needed..!!");
|
|
||||||
$('#ConfigValue').val('');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
error:function(error){
|
|
||||||
console.log("error occured..!!" ,error);
|
|
||||||
},
|
|
||||||
complete:function(){
|
|
||||||
$('#loader').hide();
|
|
||||||
console.log('ajax call completed..!!');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
@ -125,7 +125,7 @@ if (!empty($master)) {
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>S.NO</th>
|
<th>S.NO</th>
|
||||||
<th>Config Value</th>
|
<th>Configuration Value</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -165,15 +165,16 @@ if (!empty($master)) {
|
|||||||
<a data-target='#Edit' data-id="<?php echo $index; ?>"
|
<a data-target='#Edit' data-id="<?php echo $index; ?>"
|
||||||
data-userid="<?php echo $index; ?>" data-toggle="modal"
|
data-userid="<?php echo $index; ?>" data-toggle="modal"
|
||||||
href="#Edit"><i class="fas fa-edit" data-toggle="tooltip"
|
href="#Edit"><i class="fas fa-edit" data-toggle="tooltip"
|
||||||
title="Click here to Edit Config Value"></i>
|
title="Click here to Edit Config Value"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a onclick="confirmDeleteConfig(event)" href="<?php echo base_url() . 'configurationctrl/deleteConfigValue
|
<a onclick="confirmDeleteConfig(event)" href="<?php echo base_url() . 'configurationctrl/deleteConfigValue
|
||||||
?ConfigValue=' . $con->ConfigValue . '
|
?ConfigValue=' . $con->ConfigValue . '
|
||||||
&ConfigID=' . $con->Config_ID; ?>">
|
&ConfigID=' . $con->Config_ID; ?>">
|
||||||
<i class="fas fa-trash" data-toggle="tooltip"
|
<i class="fas fa-trash" data-toggle="tooltip"
|
||||||
title="Click here to Delete the Config Value"></i>
|
title="Click here to Delete the Config Value"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
@ -247,7 +248,7 @@ if (!empty($master)) {
|
|||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<!-- Modal Header -->
|
<!-- Modal Header -->
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title" id="myModalLabel">Edit Config</h4>
|
<h4 class="modal-title" id="myModalLabel">Edit Configuration</h4>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -285,7 +286,7 @@ if (!empty($master)) {
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3 col-md-offset-2">
|
<div class="col-md-3 col-md-offset-2">
|
||||||
Config Value :
|
Configuration Value :
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<?php
|
<?php
|
||||||
@ -303,7 +304,7 @@ if (!empty($master)) {
|
|||||||
<a class="btn btn-success" style="background-color: grey;border: none;margin-right:10px"
|
<a class="btn btn-success" style="background-color: grey;border: none;margin-right:10px"
|
||||||
data-dismiss="modal">Cancel</a>
|
data-dismiss="modal">Cancel</a>
|
||||||
<a class="btn btn-success font tempClickUpdate" id="tempClickUpdate"><i
|
<a class="btn btn-success font tempClickUpdate" id="tempClickUpdate"><i
|
||||||
class="fa fa-pencil"></i> Update</a>
|
class="fas fa-edit"></i> Update</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -325,7 +326,7 @@ if (!empty($master)) {
|
|||||||
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<a data-target='#Edit' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#Edit"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ConfigValue%> Budget details"></i> </a>
|
<a data-target='#Edit' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#Edit"><i class="fas fa-edit" data-toggle="tooltip" title="Click here to view/Edit the <%=ConfigValue%> Budget details"></i> </a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
@ -367,9 +368,10 @@ if (!empty($master)) {
|
|||||||
<td>${ConfigValue}</td>
|
<td>${ConfigValue}</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="editConfig" data-target='#Edit' data-id="${temp}" data-index="${index}" data-userid="${temp}" data-toggle="modal" href="#Edit">
|
<a class="editConfig" data-target='#Edit' data-id="${temp}" data-index="${index}" data-userid="${temp}" data-toggle="modal" href="#Edit">
|
||||||
<i class="ri-pencil-fill"></i>
|
<i class="fas fa-edit"></i>
|
||||||
|
</a>
|
||||||
</a>
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
$('#tempAppend').append(html);
|
$('#tempAppend').append(html);
|
||||||
@ -527,45 +529,49 @@ if (!empty($master)) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$('#AddConfigValue').change(function () {
|
|
||||||
$('#loader').show();
|
$('#AddConfigValue, #configValue').change(function () {
|
||||||
$.ajax({
|
|
||||||
data: {
|
|
||||||
configId: $('#ConfigId').val(),
|
|
||||||
ConfigValue: $('#AddConfigValue').val()
|
|
||||||
},
|
|
||||||
type: 'POST',
|
|
||||||
url: "<?php echo base_url(); ?>configurationctrl/configValueCheck",
|
|
||||||
|
|
||||||
success: function (data) {
|
let configValue = $(this).val();
|
||||||
if (data && data.length > 0) {
|
let configTable = customTableToJson();
|
||||||
|
let configValueExisting = configTable.filter(element => element['Configuration Value'] == configValue);
|
||||||
|
|
||||||
if (data[0].isActive == 1) {
|
if(configValueExisting && configValueExisting.length > 0){
|
||||||
alert("This Configuration Value is already present. kindly change it..!!");
|
alert('configuration value is already present , Kindly check in Table and archive too..!!');
|
||||||
$('#AddConfigValue').val('');
|
$(this).val('');
|
||||||
return;
|
return false;
|
||||||
} else {
|
}
|
||||||
alert("This Configuration Value is already present in deleted section. kindly reactivate it If needed..!!");
|
})
|
||||||
$('#AddConfigValue').val('');
|
</script>
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$('.tempClickAdd').click();
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
<script>
|
||||||
error: function (error) {
|
function customTableToJson() {
|
||||||
console.log("error occured..!!", error);
|
let rows = [];
|
||||||
},
|
let headers = [];
|
||||||
complete: function () {
|
|
||||||
$('#loader').hide();
|
// Get table headers
|
||||||
console.log('ajax call completed..!!');
|
$(`#configtable thead tr th`).each(function () {
|
||||||
|
headers.push($(this).text().trim());
|
||||||
|
});
|
||||||
|
|
||||||
|
// Get table rows including hidden ones
|
||||||
|
$(`#configtable tbody tr`).each(function () {
|
||||||
|
let row = {};
|
||||||
|
$(this).find('td').each(function (index) {
|
||||||
|
// Use the headers as keys for JSON
|
||||||
|
let header = headers[index];
|
||||||
|
row[header] = $(this).text().trim();
|
||||||
|
});
|
||||||
|
if (Object.keys(row).length > 0) {
|
||||||
|
rows.push(row);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
})
|
return rows;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
@ -605,4 +611,4 @@ if (!empty($master)) {
|
|||||||
if (result) { return; } else { event.preventDefault(); }
|
if (result) { return; } else { event.preventDefault(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -223,19 +223,20 @@
|
|||||||
<thead class="celda_encabezado_general" style="padding: 10px;">
|
<thead class="celda_encabezado_general" style="padding: 10px;">
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th class="celda_encabezado_general" rowspan="2" colspan="2">RIPL </th>
|
|
||||||
<th class="celda_encabezado_general" colspan="12">SEP- GAS CONSUMPTION-422 & 425 kg </th>
|
<th class="celda_encabezado_general" colspan="14">SEP- GAS CONSUMPTION-422 & 425 kg </th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th class="celda_encabezado_general" colspan="5">Gas Stock </th>
|
<th class="celda_encabezado_general" rowspan="1" colspan="1">RIPL </th>
|
||||||
|
<th class="celda_encabezado_general" colspan="6">Gas Stock </th>
|
||||||
<th class="celda_encabezado_general">10 Ton</th>
|
<th class="celda_encabezado_general">10 Ton</th>
|
||||||
<th class="celda_encabezado_general">Sand Dried</th>
|
<th class="celda_encabezado_general">Sand Dried</th>
|
||||||
<th class="celda_encabezado_general">Coating Machine</th>
|
<th class="celda_encabezado_general">Coating Machine</th>
|
||||||
<th class="celda_encabezado_general">Sand Coated</th>
|
<th class="celda_encabezado_general">Sand Coated</th>
|
||||||
<th class="celda_encabezado_general">Trp Machine </th>
|
<th class="celda_encabezado_general">Trp Machine </th>
|
||||||
<th class="celda_encabezado_general">Sand TRP</th>
|
<th class="celda_encabezado_general">Sand TRP</th>
|
||||||
<th class="celda_encabezado_general">Rotary Drier </th>
|
<th class="celda_encabezado_general">Rotary Drier </th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -364,7 +364,19 @@ foreach ($period as $day) {
|
|||||||
|
|
||||||
<tbody >
|
<tbody >
|
||||||
<?php foreach ($powerConsumptionDetails as $key => $row): ?>
|
<?php foreach ($powerConsumptionDetails as $key => $row): ?>
|
||||||
<tr id="<?php echo $key + 1; ?>">
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$styleValue='';
|
||||||
|
$currentDate = date('Y-m-d');
|
||||||
|
$dateInMonthYMDFormat=date("Y-m-d", strtotime($powerConsumptionDetails[$key]['date']));
|
||||||
|
if ($dateInMonthYMDFormat === $currentDate) { $styleValue="background: #cef0ad;"; }
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<tr id="<?php echo $key + 1; ?>"
|
||||||
|
style="<?=$styleValue?>"
|
||||||
|
>
|
||||||
<?php foreach ($columns as $index => $column): ?>
|
<?php foreach ($columns as $index => $column): ?>
|
||||||
|
|
||||||
<?php if($index == 0) : ?>
|
<?php if($index == 0) : ?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user