error in po revenue -vadivel J
This commit is contained in:
parent
3d70f81c9c
commit
e9f221f1ca
@ -137,6 +137,7 @@ $routes->post('purchaseorder/UpdateComplaint', 'Purchaseorder::UpdateComplaint')
|
|||||||
$routes->get('purchaseorder/Savencrlist', 'Purchaseorder::Savencrlist');
|
$routes->get('purchaseorder/Savencrlist', 'Purchaseorder::Savencrlist');
|
||||||
$routes->get('purchaseorder/Nonconfirmativelist','Purchaseorder::Nonconfirmativelist');
|
$routes->get('purchaseorder/Nonconfirmativelist','Purchaseorder::Nonconfirmativelist');
|
||||||
$routes->post('purchaseorder/addloadfile','Purchaseorder::addloadfile');
|
$routes->post('purchaseorder/addloadfile','Purchaseorder::addloadfile');
|
||||||
|
$routes->post('purchaseorder/uploadfile', 'Purchaseorder::uploadfile');
|
||||||
|
|
||||||
//Zohobooks sync
|
//Zohobooks sync
|
||||||
$routes->match(['GET', 'POST'],'user/zohobooks_api_fetch_all','User::zohobooks_api_fetch_all');
|
$routes->match(['GET', 'POST'],'user/zohobooks_api_fetch_all','User::zohobooks_api_fetch_all');
|
||||||
|
|||||||
@ -657,6 +657,7 @@ class Purchaseorder extends BaseController
|
|||||||
$data['getlogpodtl'] = $this->purchaseorder_model->getlogpodtl($PONO);
|
$data['getlogpodtl'] = $this->purchaseorder_model->getlogpodtl($PONO);
|
||||||
|
|
||||||
$data['WorkStatus'] = $this->purchaseorder_model->getStatus(7);
|
$data['WorkStatus'] = $this->purchaseorder_model->getStatus(7);
|
||||||
|
$data['billfile'] = $this->purchaseorder_model->getBillFile($PONO);
|
||||||
$this->global['pageTitle'] = 'Edit Revenue Purchase order form';
|
$this->global['pageTitle'] = 'Edit Revenue Purchase order form';
|
||||||
$this->loadViews("editRevenuepurchaseorder", $this->global, $data, NULL);
|
$this->loadViews("editRevenuepurchaseorder", $this->global, $data, NULL);
|
||||||
|
|
||||||
@ -4251,14 +4252,23 @@ class Purchaseorder extends BaseController
|
|||||||
|
|
||||||
if (!empty($new_file_name)) {
|
if (!empty($new_file_name)) {
|
||||||
$Picture = $this->adfile();
|
$Picture = $this->adfile();
|
||||||
|
if($Picture){
|
||||||
$filelist = array('PONO' => $pono, 'IGRNO' => $igr, 'FilePath' => $Picture);
|
$filelist = array('PONO' => $pono, 'IGRNO' => $igr, 'FilePath' => $Picture);
|
||||||
$uploadfiles = $this->purchaseorder_model->insertfile($filelist);
|
$uploadfiles = $this->purchaseorder_model->insertfile($filelist);
|
||||||
if ($uploadfiles > 0) {
|
if ($uploadfiles > 0) {
|
||||||
echo "file updated successfully!";
|
echo "file updated successfully!";
|
||||||
}
|
return true;
|
||||||
}
|
}
|
||||||
} else{
|
} else{
|
||||||
echo " File already Uploaded";
|
echo " Internal Server Error..!!";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
echo " File already Uploaded with this name..!!";
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -4270,21 +4280,33 @@ class Purchaseorder extends BaseController
|
|||||||
$file = $this->request->getFile('file');
|
$file = $this->request->getFile('file');
|
||||||
|
|
||||||
if ($file && $file->isValid()) {
|
if ($file && $file->isValid()) {
|
||||||
|
|
||||||
|
$fileName = str_replace(" ", "", $file->getName());
|
||||||
|
|
||||||
// Define the file system path for uploads
|
// Define the file system path for uploads
|
||||||
$uploadPath = FCPATH . 'uploads/BillFiles/'; // 'FCPATH' points to 'public' directory
|
$uploadPath = FCPATH . '/public/uploads/BillFiles/'; // 'FCPATH' points to 'public' directory
|
||||||
|
|
||||||
// Check if the directory exists, if not, create it
|
// Check if the directory exists, if not, create it
|
||||||
if (!is_dir($uploadPath)) {
|
if (!is_dir($uploadPath)) {
|
||||||
mkdir($uploadPath, 0777, true); // Create the directory with write permissions
|
mkdir($uploadPath, 0777, true); // Create the directory with write permissions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Log file name and path to check if the upload path is correct
|
||||||
|
error_log("Upload Path: " . $uploadPath);
|
||||||
|
error_log("File Name: " . $file->getName());
|
||||||
|
|
||||||
// Move the file to the upload directory
|
// Move the file to the upload directory
|
||||||
if ($file->move($uploadPath)) {
|
if ($file->move($uploadPath,$fileName)) {
|
||||||
$picture = $file->getName(); // Get the file name after moving
|
$picture = $fileName; // Get the file name after moving
|
||||||
|
error_log("File uploaded successfully: " . $picture);
|
||||||
} else {
|
} else {
|
||||||
|
// Log the error if file move fails
|
||||||
|
error_log("Failed to move file. Error: " . $file->getErrorString());
|
||||||
$picture = '';
|
$picture = '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// Log invalid file or failed validation
|
||||||
|
error_log("File is not valid or not uploaded.");
|
||||||
$picture = '';
|
$picture = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4294,6 +4316,8 @@ class Purchaseorder extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function splpodata()
|
function splpodata()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -4351,57 +4375,35 @@ class Purchaseorder extends BaseController
|
|||||||
|
|
||||||
$oldfile = $this->request->getPost('param2');
|
$oldfile = $this->request->getPost('param2');
|
||||||
|
|
||||||
$newfile = $this->request->getPost('file');
|
$newfile = $this->request->getFile('file');
|
||||||
// $new_file_name =$_FILES['file']['name'];
|
|
||||||
$newfile = str_replace(" ", "", $newfile);
|
|
||||||
|
|
||||||
|
$Picture='';
|
||||||
|
$uploadfile=0;
|
||||||
|
|
||||||
|
if (!empty($newfile)) {
|
||||||
|
|
||||||
if (!empty($_FILES['file']['name'])) {
|
$Picture = $this->adfile();
|
||||||
|
|
||||||
$Picture = $this->add();
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$Picture = $oldfile;
|
$Picture = $oldfile;
|
||||||
}
|
}
|
||||||
//echo $Picture;die;
|
|
||||||
$uploadfile = $this->purchaseorder_model->updatefile($bill, $Picture, $oldfile);
|
|
||||||
|
|
||||||
|
|
||||||
// if($uploadfile > 0){
|
if($Picture !=''){
|
||||||
echo "updated successfully!";
|
|
||||||
// }
|
$uploadfile = $this->purchaseorder_model->updatefile($bill, $Picture);
|
||||||
// else{
|
|
||||||
// echo "updated successfully!";
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// function add()
|
|
||||||
// {
|
if($uploadfile > 0){
|
||||||
// $picture = '';
|
echo "updated successfully!";
|
||||||
// if (!empty($_FILES['file']['name'])) {
|
}
|
||||||
// $config['upload_path'] = 'public/uploads/BillFiles/';
|
else{
|
||||||
// $config['allowed_types'] = '*';
|
echo "Update Failed (maybe same file provided for update kindly check)..!!";
|
||||||
// //$config['file_name'] = $_FILES['file']['name'];
|
}
|
||||||
// $config['file_name'] = str_replace(" ", "", $_FILES['file']['name']);
|
}
|
||||||
|
|
||||||
|
|
||||||
// //print_r($config) ;die;
|
|
||||||
// //Load upload library and initialize configuration
|
|
||||||
// $this->load->library('upload', $config);
|
|
||||||
// $this->upload->initialize($config);
|
|
||||||
// if ($this->upload->do_upload('file')) {
|
|
||||||
// $uploadData = $this->upload->data();
|
|
||||||
// $picture = $uploadData['file_name'];
|
|
||||||
// } else {
|
|
||||||
// $error = array('error' => $this->upload->display_errors());
|
|
||||||
// $picture = '';
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// $picture = '';
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return $picture;
|
|
||||||
// }
|
|
||||||
public function add()
|
public function add()
|
||||||
{
|
{
|
||||||
$picture = '';
|
$picture = '';
|
||||||
@ -4409,8 +4411,8 @@ class Purchaseorder extends BaseController
|
|||||||
// Check if file is uploaded
|
// Check if file is uploaded
|
||||||
if ($file = $this->request->getFile('file')) {
|
if ($file = $this->request->getFile('file')) {
|
||||||
// Define upload directory and allowed file types
|
// Define upload directory and allowed file types
|
||||||
$uploadPath = base_url() . 'public/uploads/BillFiles/'; // You can change this path as needed
|
$uploadPath = base_url() . 'public/uploads/BillFiles/';
|
||||||
$allowedTypes = '*'; // You can change this to specific file types like 'jpg|png|gif'
|
$allowedTypes = '*';
|
||||||
|
|
||||||
// Set the file name without spaces
|
// Set the file name without spaces
|
||||||
$fileName = str_replace(" ", "", $file->getName());
|
$fileName = str_replace(" ", "", $file->getName());
|
||||||
|
|||||||
@ -2322,15 +2322,12 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
|||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
function updatefile($bill, $Picture, $oldfile)
|
function updatefile($bill, $Picture)
|
||||||
{
|
{
|
||||||
|
|
||||||
// if($oldfile != ''){
|
|
||||||
// //unlink("public/uploads/BillFiles/".$oldfile);//this deletes the file on particular folder too
|
|
||||||
// }
|
|
||||||
$this->db->table('t_purchaseorder_billupload')
|
$this->db->table('t_purchaseorder_billupload')
|
||||||
->set('FilePath', $Picture) //value that used to update column
|
->set('FilePath', $Picture)
|
||||||
->where('BillNo', $bill) //which row want to upgrade
|
->where('BillNo', $bill)
|
||||||
->update();
|
->update();
|
||||||
$afftectedRows = $this->db->affectedRows();
|
$afftectedRows = $this->db->affectedRows();
|
||||||
return $afftectedRows;
|
return $afftectedRows;
|
||||||
@ -2338,29 +2335,13 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// function newlogpo($logpo)
|
function getBillFile($PONO){
|
||||||
// {
|
$builder = $this->db->table('t_purchaseorder_billupload')->select('*')
|
||||||
|
->where('PONO', $PONO);
|
||||||
// $this->db->transStart();
|
$query = $builder->get();
|
||||||
// $builder = $this->db->table('T_ponewlogs_Details');
|
|
||||||
// $builder->insert($logpo);
|
|
||||||
|
|
||||||
// $insert_id = $this->db->affectedRows();
|
|
||||||
// $this->db->transComplete();
|
|
||||||
// return $insert_id;
|
|
||||||
|
|
||||||
|
|
||||||
// // $this->db->transStart();
|
|
||||||
// $builder = $this->db->table('t_polog_details');
|
|
||||||
// $builder->insert($logpo);
|
|
||||||
|
|
||||||
// // $insert_id = $this->db->affectedRows();
|
|
||||||
// // $this->db->transComplete();
|
|
||||||
// // return $insert_id;
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
return $query->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
function insertlogpo($logpo)
|
function insertlogpo($logpo)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2501,8 +2501,8 @@ if (!empty($getlogpodtl)) {
|
|||||||
<table id="table3" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;">
|
<table id="table3" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;">
|
||||||
<div class="form-row" style="padding-bottom: 10px;">
|
<div class="form-row" style="padding-bottom: 10px;">
|
||||||
|
|
||||||
<div class="col-md-offset-10 col-md-8">
|
<div class=" col-md-8 px-2">
|
||||||
|
<label>Upload Purchase Order Bill </label>
|
||||||
<input type="button" class="btn btn-success" id="addmorebutton" value=" ADD FILES "><br>
|
<input type="button" class="btn btn-success" id="addmorebutton" value=" ADD FILES "><br>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -2547,8 +2547,9 @@ if (!empty($getlogpodtl)) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td><span onclick="openbillmodel(<?php echo $index ?>);"><i class="ri-pencil-fill"></i></span>
|
<td style="cursor:pointer"><span onclick="openbillmodel(<?php echo $index ?>);"><i class="ri-pencil-fill"></i></span>
|
||||||
<?php if (!empty($gd->FilePath)) { ?>
|
<?php if (!empty($gd->FilePath)) { ?>
|
||||||
|
|
||||||
<a target="_blank" href="<?php echo base_url() . 'public/uploads/BillFiles/' ?><?php echo $gd->FilePath ?>"><i class="fa fa-download"></i></a>
|
<a target="_blank" href="<?php echo base_url() . 'public/uploads/BillFiles/' ?><?php echo $gd->FilePath ?>"><i class="fa fa-download"></i></a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
@ -3997,7 +3998,7 @@ if (!empty($getlogpodtl)) {
|
|||||||
<div class="modal-dialog modal-lg">
|
<div class="modal-dialog modal-lg">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title">Update Bill Details</h4>
|
<h4 class="modal-title">Update Bill Details - <span id="showBillNoId"> </span></h4>
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-hidden="true">×</button>
|
aria-hidden="true">×</button>
|
||||||
</div>
|
</div>
|
||||||
@ -4011,9 +4012,10 @@ if (!empty($getlogpodtl)) {
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-5">
|
<div class="form-group col-md-5">
|
||||||
|
|
||||||
|
<label for="images">Select New PO Bill file <br /><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
|
||||||
<input type="file" size="20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="billimag" name="images" onChange="filecheck();" />
|
<input type="file" size="20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="billimag" name="images" onChange="filecheck();" />
|
||||||
<label for="images">Select file <br /><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
|
<br><br>
|
||||||
|
<p><b>Previously Uploaded PO Bill <span class="text-danger" id="showPreviousPoBill"></span></b> </p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="hideoldfile" id="hideoldfile" class="form-control" readonly>
|
<input type="hidden" name="hideoldfile" id="hideoldfile" class="form-control" readonly>
|
||||||
@ -4087,6 +4089,8 @@ if (!empty($getlogpodtl)) {
|
|||||||
|
|
||||||
$("#hideoldfile").val(file);
|
$("#hideoldfile").val(file);
|
||||||
$("#hidebillno").val(Billno);
|
$("#hidebillno").val(Billno);
|
||||||
|
$('#showBillNoId').text(Billno);
|
||||||
|
$('#showPreviousPoBill').text(file);
|
||||||
$("#billModel").modal("show");
|
$("#billModel").modal("show");
|
||||||
|
|
||||||
|
|
||||||
@ -5294,31 +5298,60 @@ if (!empty($getlogpodtl)) {
|
|||||||
var param1 = $('#hidebillno').val();
|
var param1 = $('#hidebillno').val();
|
||||||
var param2 = $('#hideoldfile').val();
|
var param2 = $('#hideoldfile').val();
|
||||||
|
|
||||||
// var filename = $("#billimag").val();
|
|
||||||
// filename = filename.split('\\');
|
|
||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
formData.append('param1', param1);
|
formData.append('param1', param1);
|
||||||
formData.append('param2', param2);
|
formData.append('param2', param2);
|
||||||
|
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: formData,
|
data: formData, // The form data to send (contains the file)
|
||||||
type: "POST",
|
type: "POST", // HTTP method
|
||||||
url: "<?php echo base_url() ?>purchaseorder/uploadfile",
|
url: "<?php echo base_url();?>purchaseorder/uploadfile", // URL to send the request to
|
||||||
cache: false,
|
cache: false, // Disable caching of the response
|
||||||
contentType: false,
|
contentType: false, // Tell jQuery not to set content type (it's handled by FormData)
|
||||||
processData: false,
|
processData: false, // Don't process the data into a query string (needed for FormData)
|
||||||
|
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$('#loader').hide();
|
$('#loader').hide(); // Hide loader on success
|
||||||
alert(data);
|
alert(data); // Show response data (you may want to customize this)
|
||||||
window.location.reload();
|
$('#billModel').modal('hide'); // Hide the modal if file uploaded successfully
|
||||||
// $('#spl').find('td').eq(5).text(filename[2]);
|
window.location.reload(); // Reload the page to reflect changes
|
||||||
$('#billModel').modal('hide');
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
error: function(xhr, status, error) { // Handle errors gracefully
|
||||||
|
$('#loader').hide(); // Hide the loader even on error
|
||||||
|
let errorMessage = '';
|
||||||
|
|
||||||
|
// Custom error messages based on status codes
|
||||||
|
switch (xhr.status) {
|
||||||
|
case 404:
|
||||||
|
errorMessage = "Error 404: File upload URL not found.";
|
||||||
|
break;
|
||||||
|
case 500:
|
||||||
|
errorMessage = "Error 500:"+ xhr.status + ": " + xhr.responseJSON.message;
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
errorMessage = "Error: Network issue or request aborted.";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
errorMessage = "Error " + xhr.status + ": " + xhr.responseJSON.message;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show an alert with a specific error message
|
||||||
|
alert(errorMessage);
|
||||||
|
console.error("Error details:", xhr, status, error); // For debugging in the console
|
||||||
|
},
|
||||||
|
|
||||||
|
complete: function(xhr, status) { // This function runs after success or error
|
||||||
|
$('#loader').hide(); // Hide loader no matter what happens (success/error)
|
||||||
|
console.log("Request completed with status:", status); // Log completion status (success/error)
|
||||||
|
console.log("Request completed with xhr:", xhr)
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function splupdate() {
|
function splupdate() {
|
||||||
@ -5439,10 +5472,9 @@ if (!empty($getlogpodtl)) {
|
|||||||
div.className = "row";
|
div.className = "row";
|
||||||
div.innerHTML = `<div class="form-row px-4">
|
div.innerHTML = `<div class="form-row px-4">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label>Upload Purchase Order Bill </label>
|
<br>
|
||||||
<input type="file" name="browseFiles" id="images${counter}" onchange="Copyfilename(${this.name}); ">
|
<input type="file" name="browseFiles" id="images${counter}" onchange="Copyfilename(${this.name}); ">
|
||||||
</div>
|
<br>
|
||||||
<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>
|
<button class="btn btn-success btn-sm add add_this" id="addbtn" onclick="addRow(${counter})">ADD</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -1,411 +0,0 @@
|
|||||||
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>
|
|
||||||
|
|
||||||
</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>
|
|
||||||
|
|
||||||
</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">×</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">×</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>
|
|
||||||
|
|
||||||
@ -1,411 +0,0 @@
|
|||||||
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>
|
|
||||||
|
|
||||||
</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>
|
|
||||||
|
|
||||||
</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">×</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">×</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>
|
|
||||||
|
|
||||||
@ -1,411 +0,0 @@
|
|||||||
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>
|
|
||||||
|
|
||||||
</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>
|
|
||||||
|
|
||||||
</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">×</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">×</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>
|
|
||||||
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
users_table_alter _query
|
|
||||||
|
|
||||||
ALTER TABLE `trs_matri_lara`.`users`
|
|
||||||
ADD COLUMN `last_login_reminder_at` TIMESTAMP NULL DEFAULT NULL AFTER `last_login_at`;
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
users_table_alter _query
|
|
||||||
|
|
||||||
ALTER TABLE `trs_matri_lara`.`users`
|
|
||||||
ADD COLUMN `last_login_reminder_at` TIMESTAMP NULL DEFAULT NULL AFTER `last_login_at`;
|
|
||||||
Loading…
Reference in New Issue
Block a user