Gas stock details changes-3 vadivel J 28-11-2024

This commit is contained in:
vadivelJ96 2024-11-28 11:53:58 +05:30
parent 12463ca78b
commit e26e5290a3
2 changed files with 13 additions and 6 deletions

View File

@ -145,7 +145,7 @@ class StockController extends BaseController
$date = $postData['date']; $date = $postData['date'];
$shift = $postData['shift']; $shift = $postData['shift'];
// Check if the same shift already exists on the same date // Check if the same shift already exists on the same date
$sameShiftOnDateExists = $this->coatingMachineDetails_model $sameShiftOnDateExists = $this->coatingMachineDetails_model
->where('date', $date) ->where('date', $date)
->where('shift', $shift) ->where('shift', $shift)
@ -177,6 +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..!!";
} else { } else {
throw new \Exception('Failed to insert Coating machine details.'); throw new \Exception('Failed to insert Coating machine details.');
} }
@ -188,7 +189,7 @@ class StockController extends BaseController
} }
$this->db->transCommit(); $this->db->transCommit();
$message3 ="Kindly Update the next month Gas Stock If older month Gas Stock Updated..!!";
// Set flashdata for success message // Set flashdata for success message
return redirect()->to("/coatingMachineDetails?month=$month") return redirect()->to("/coatingMachineDetails?month=$month")
@ -237,7 +238,7 @@ class StockController extends BaseController
} }
$message2 = 'And updated gas stock consumption.'; $message2 = 'And updated gas stock consumption.';
$message3 ="Kindly Update the next 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
@ -959,7 +960,7 @@ class StockController extends BaseController
} }
} }
echo "Data Saved Successfully"; echo "Data Saved Successfully Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
} }
private function updateGasStockConsumption($date, $consumption) private function updateGasStockConsumption($date, $consumption)
@ -1248,13 +1249,13 @@ class StockController extends BaseController
if (!empty($inserts)) { if (!empty($inserts)) {
$this->drierMachineDetails_model->insertBatch($inserts); $this->drierMachineDetails_model->insertBatch($inserts);
$message3 ="Kindly Update the next 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');
$message3 ="Kindly Update the next 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) {

View File

@ -200,6 +200,12 @@
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if (session()->getFlashdata('success')): ?>
<div class="alert alert-success">
<?= session()->getFlashdata('success'); ?>
</div>
<?php endif; ?>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">