From 3d70f81c9cd4b216f921f0f4246f2012c3394728 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Mon, 14 Oct 2024 08:53:20 +0530 Subject: [PATCH] minor changes-3 -vadivel J --- app/Controllers/Purchaseorder.php | 59 ++- app/Models/Purchaseorder_model.php | 2 +- app/Views/editRevenuepurchaseorder.php | 31 +- uploads/BillFiles/routes.txt | 411 ++++++++++++++++++ uploads/BillFiles/routes_1.txt | 411 ++++++++++++++++++ uploads/BillFiles/routes_2.txt | 411 ++++++++++++++++++ .../BillFiles/users_table_alter _query.txt | 4 + .../BillFiles/users_table_alter _query_1.txt | 4 + 8 files changed, 1297 insertions(+), 36 deletions(-) create mode 100644 uploads/BillFiles/routes.txt create mode 100644 uploads/BillFiles/routes_1.txt create mode 100644 uploads/BillFiles/routes_2.txt create mode 100644 uploads/BillFiles/users_table_alter _query.txt create mode 100644 uploads/BillFiles/users_table_alter _query_1.txt diff --git a/app/Controllers/Purchaseorder.php b/app/Controllers/Purchaseorder.php index 02243f3e..c0950f85 100755 --- a/app/Controllers/Purchaseorder.php +++ b/app/Controllers/Purchaseorder.php @@ -4219,6 +4219,8 @@ class Purchaseorder extends BaseController public function addloadfile() { + $uploadfiles=0; + $pono = $this->request->getPost('PONO'); $igr = $this->request->getPost('igr'); @@ -4231,6 +4233,8 @@ class Purchaseorder extends BaseController $fcount = 0; + + foreach ($files as $value) { $lastfile = $value->FilePath; @@ -4245,37 +4249,48 @@ class Purchaseorder extends BaseController if ($fcount == 0) { - if (!empty($new_file_name)) { - $Picture = $this->adfile(); - $filelist = array('PONO' => $pono, 'IGRNO' => $igr, 'FilePath' => $Picture); - $uploadfiles = $this->purchaseorder_model->insertfile($filelist); + if (!empty($new_file_name)) { + $Picture = $this->adfile(); + $filelist = array('PONO' => $pono, 'IGRNO' => $igr, 'FilePath' => $Picture); + $uploadfiles = $this->purchaseorder_model->insertfile($filelist); + if ($uploadfiles > 0) { + echo "file updated successfully!"; + } + } + }else{ + echo " File already Uploaded"; } - } - if ($uploadfiles > 0) { - echo "file updated successfully!"; - } else { - echo "No File Choose or File name already Exist"; - } } public function adfile() { - $picture = ''; - $file = $this->request->getFile('file'); - - if ($file && $file->isValid()) { - $uploadPath = base_url() . 'public/uploads/BillFiles/'; - $file->move($uploadPath); - - $picture = $file->getName(); - } else { $picture = ''; - } - - return $picture; + $file = $this->request->getFile('file'); + + if ($file && $file->isValid()) { + // Define the file system path for uploads + $uploadPath = FCPATH . 'uploads/BillFiles/'; // 'FCPATH' points to 'public' directory + + // Check if the directory exists, if not, create it + if (!is_dir($uploadPath)) { + mkdir($uploadPath, 0777, true); // Create the directory with write permissions + } + + // Move the file to the upload directory + if ($file->move($uploadPath)) { + $picture = $file->getName(); // Get the file name after moving + } else { + $picture = ''; + } + } else { + $picture = ''; + } + + return $picture; } + diff --git a/app/Models/Purchaseorder_model.php b/app/Models/Purchaseorder_model.php index 3118bfae..50084904 100755 --- a/app/Models/Purchaseorder_model.php +++ b/app/Models/Purchaseorder_model.php @@ -28,7 +28,7 @@ class Purchaseorder_model extends Model function getfies($pono) { - $builder = $this->db->table('t_purchaseorder_billupload bill') + $builder = $this->db->table('t_purchaseorder_billupload') ->select('*') ->where('PONO', $pono); diff --git a/app/Views/editRevenuepurchaseorder.php b/app/Views/editRevenuepurchaseorder.php index 658d8b76..910ad50f 100755 --- a/app/Views/editRevenuepurchaseorder.php +++ b/app/Views/editRevenuepurchaseorder.php @@ -2511,7 +2511,8 @@ if (!empty($getlogpodtl)) { - + + @@ -5437,10 +5438,14 @@ if (!empty($getlogpodtl)) { div.id = `divid${counter}`; div.className = "row"; div.innerHTML = `
-
- -
- +
+ + +
+
+ +
+
`; @@ -5458,17 +5463,17 @@ if (!empty($getlogpodtl)) { }); function addRow(counter) { - + var file = $(`#images${counter}`).val(); - if (file == '') { - alert('File not found'); - return false; + if (file == '') { + alert('Please Select File..!!'); + return false; - } else { - fileupload(counter); - } - } + } else { + fileupload(counter); + } + } diff --git a/uploads/BillFiles/routes.txt b/uploads/BillFiles/routes.txt new file mode 100644 index 00000000..a11c037a --- /dev/null +++ b/uploads/BillFiles/routes.txt @@ -0,0 +1,411 @@ +routes + +//Stock Module + +$routes->get('coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails'); +$routes->post('addNewCoatingMachineDetails' , 'StockController::addNewCoatingMachineDetails'); +$routes->post('editCoatingMachineDetails','StockController::editCoatingMachineDetails'); + + +//stock controller + public function editCoatingMachineDetails(){ + + $putData=$this->request->getPost(); + + $id = $putData['editCoatingMachineDetailId']; + + $updated= $this->coatingMachineDetails_model->update($id,$putData); + + if ($updated) { + // Set flashdata for success message + return redirect()->to('/coatingMachineDetails')->with('success', 'Coating Machine details updated successfully'); + } else { + // Set flashdata for error message + return redirect()->back()->with('error', 'Failed to update Coating machine details'); + } + + + } + +//coatingMachinedetailview + + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Customer NameDateShiftMachine On TimeMachine Off TimeMachine Running (hrs)Total CoatingTotal Coating Sand (kgs)Total Gas ConsumptionPer Hour Gas ConsumptionPer Hour Coating Sand QTYAction
+ + +     + + + + + + + +     + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/uploads/BillFiles/routes_1.txt b/uploads/BillFiles/routes_1.txt new file mode 100644 index 00000000..a11c037a --- /dev/null +++ b/uploads/BillFiles/routes_1.txt @@ -0,0 +1,411 @@ +routes + +//Stock Module + +$routes->get('coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails'); +$routes->post('addNewCoatingMachineDetails' , 'StockController::addNewCoatingMachineDetails'); +$routes->post('editCoatingMachineDetails','StockController::editCoatingMachineDetails'); + + +//stock controller + public function editCoatingMachineDetails(){ + + $putData=$this->request->getPost(); + + $id = $putData['editCoatingMachineDetailId']; + + $updated= $this->coatingMachineDetails_model->update($id,$putData); + + if ($updated) { + // Set flashdata for success message + return redirect()->to('/coatingMachineDetails')->with('success', 'Coating Machine details updated successfully'); + } else { + // Set flashdata for error message + return redirect()->back()->with('error', 'Failed to update Coating machine details'); + } + + + } + +//coatingMachinedetailview + + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Customer NameDateShiftMachine On TimeMachine Off TimeMachine Running (hrs)Total CoatingTotal Coating Sand (kgs)Total Gas ConsumptionPer Hour Gas ConsumptionPer Hour Coating Sand QTYAction
+ + +     + + + + + + + +     + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/uploads/BillFiles/routes_2.txt b/uploads/BillFiles/routes_2.txt new file mode 100644 index 00000000..a11c037a --- /dev/null +++ b/uploads/BillFiles/routes_2.txt @@ -0,0 +1,411 @@ +routes + +//Stock Module + +$routes->get('coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails'); +$routes->post('addNewCoatingMachineDetails' , 'StockController::addNewCoatingMachineDetails'); +$routes->post('editCoatingMachineDetails','StockController::editCoatingMachineDetails'); + + +//stock controller + public function editCoatingMachineDetails(){ + + $putData=$this->request->getPost(); + + $id = $putData['editCoatingMachineDetailId']; + + $updated= $this->coatingMachineDetails_model->update($id,$putData); + + if ($updated) { + // Set flashdata for success message + return redirect()->to('/coatingMachineDetails')->with('success', 'Coating Machine details updated successfully'); + } else { + // Set flashdata for error message + return redirect()->back()->with('error', 'Failed to update Coating machine details'); + } + + + } + +//coatingMachinedetailview + + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Customer NameDateShiftMachine On TimeMachine Off TimeMachine Running (hrs)Total CoatingTotal Coating Sand (kgs)Total Gas ConsumptionPer Hour Gas ConsumptionPer Hour Coating Sand QTYAction
+ + +     + + + + + + + +     + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/uploads/BillFiles/users_table_alter _query.txt b/uploads/BillFiles/users_table_alter _query.txt new file mode 100644 index 00000000..0841aa8f --- /dev/null +++ b/uploads/BillFiles/users_table_alter _query.txt @@ -0,0 +1,4 @@ +users_table_alter _query + +ALTER TABLE `trs_matri_lara`.`users` +ADD COLUMN `last_login_reminder_at` TIMESTAMP NULL DEFAULT NULL AFTER `last_login_at`; \ No newline at end of file diff --git a/uploads/BillFiles/users_table_alter _query_1.txt b/uploads/BillFiles/users_table_alter _query_1.txt new file mode 100644 index 00000000..0841aa8f --- /dev/null +++ b/uploads/BillFiles/users_table_alter _query_1.txt @@ -0,0 +1,4 @@ +users_table_alter _query + +ALTER TABLE `trs_matri_lara`.`users` +ADD COLUMN `last_login_reminder_at` TIMESTAMP NULL DEFAULT NULL AFTER `last_login_at`; \ No newline at end of file