From 0d1d94ecf5a1ed5ed67114e8faa3a12d6f58a0ca Mon Sep 17 00:00:00 2001 From: vadivel J Date: Mon, 28 Oct 2024 11:26:24 +0530 Subject: [PATCH] finished igr file upload issue --- app/Controllers/Inwardgateregister.php | 20 +++++++++++--------- app/Views/inwardgateregister.php | 20 ++++++++++++++------ app/Views/viewinwardgateregister.php | 19 ++++++++++++------- 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php index 5144abd7..c38f8b03 100755 --- a/app/Controllers/Inwardgateregister.php +++ b/app/Controllers/Inwardgateregister.php @@ -708,6 +708,7 @@ function viewIGRDetails() function UpdateIGR() { + $IGRNo = $this->request->getPost('igr'); $PONo = $this->request->getPost('po'); @@ -754,12 +755,13 @@ function viewIGRDetails() $fileupdated_count = 0; $fileupdated_name = []; - $fileNames = $this->request->getPost('file_name'); - $files = $this->request->getFiles(); + $fileNames = $this->request->getPost('file_name'); + $files = $this->request->getFileMultiple('emp_file'); - if(isset($files['emp_file'])) + + if(isset($files)) { - foreach ($files['emp_file'] as $index => $file) { + foreach ($files as $index => $file) { if ($file->isValid() && !$file->hasMoved()) { @@ -768,10 +770,10 @@ function viewIGRDetails() $newName = $file->getRandomName(); $file->move($path, $newName); // Store the file information in the database - $additionalFiles = array( - 'Remarks' => $finallyfilename, - 'FilePath' => $newName, - 'IGRNO' => $IGRNo, + $additionalFiles = array( + 'Remarks' => $finallyfilename, + 'FilePath' => $newName, + 'IGRNO' => $IGRNo, 'PONO' => $PONo ); $lastInsertFileId = $this->inwardgateregister_model->uploadAdditionalFile($additionalFiles); @@ -779,7 +781,7 @@ function viewIGRDetails() $fileupdated_count++; $fileupdated_name[] = $finallyfilename; } - } + } } } diff --git a/app/Views/inwardgateregister.php b/app/Views/inwardgateregister.php index ce5c179f..6ffe06e5 100755 --- a/app/Views/inwardgateregister.php +++ b/app/Views/inwardgateregister.php @@ -241,9 +241,17 @@ -
+
-
+
+
+ +
+ + +
@@ -840,16 +848,16 @@