From e24ea0329f2f2c5cf2582423d6020922a8739049 Mon Sep 17 00:00:00 2001 From: vadivel J Date: Fri, 25 Oct 2024 10:52:38 +0530 Subject: [PATCH] igr issue --- app/Controllers/Inwardgateregister.php | 15 +++++++++++---- app/Views/viewinwardgateregister.php | 11 ++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php index 80ab9aca..3585b655 100755 --- a/app/Controllers/Inwardgateregister.php +++ b/app/Controllers/Inwardgateregister.php @@ -1673,11 +1673,18 @@ function updateIGRWeight(){ { // Get all file details for the given IGR number $fileDetails = $this->inwardgateregister_model->getAllIgrFileDetails($igrno); - if (empty($fileDetails)) { - echo ''; - redirect('ViewIGR', 'refresh'); - return; + + dd($fileDetails); + + foreach($fileDetails as $file){ + if (empty($file->file)) { + + $this->session->setFlashdata('message', 'There are no files.'); + + return redirect()->to('/ViewIGR'); + } } + // Define the root path for files $rootPath = ROOTPATH . 'public/uploads/Igrfiles/'; diff --git a/app/Views/viewinwardgateregister.php b/app/Views/viewinwardgateregister.php index d410e5ee..383179b4 100755 --- a/app/Views/viewinwardgateregister.php +++ b/app/Views/viewinwardgateregister.php @@ -165,6 +165,12 @@ + getFlashdata('message')): ?> + + +
@@ -245,7 +251,7 @@ TransporterName ?> IGRStatus == 'ST074' ? 'Draft' : 'Completed'; ?> - IGRNO)){ ?> + IGRNO)){ ?> @@ -670,8 +676,7 @@ type: "POST", url: "ViewIGRDetails", success: function(data) { - // success:function(data) { - // $('#content').loader('hide'); + var parsedData = JSON.parse(data); console.log(parsedData); if (parsedData['details'].length === 0) {