From 7cdda4a7ef016b9da84247d2ffcbae8bf14e64f3 Mon Sep 17 00:00:00 2001 From: heama Date: Tue, 19 Mar 2024 10:56:34 +0530 Subject: [PATCH] remove button and logo issue --- app/Controllers/Business.php | 21 ++++--- app/Views/business_form.php | 117 ++++++++++++++++++++++++++--------- 2 files changed, 101 insertions(+), 37 deletions(-) diff --git a/app/Controllers/Business.php b/app/Controllers/Business.php index 076cd21..13e3e1c 100644 --- a/app/Controllers/Business.php +++ b/app/Controllers/Business.php @@ -76,7 +76,7 @@ class Business extends BaseController } else{ $details = $smodel->where(['business_id' => $session_bid, 'isactive' => 1])->first(); - + // print_r($session_bid);die; } // echo json_decode($details);die; $data['details'] = $details; @@ -168,9 +168,9 @@ class Business extends BaseController } else { // It's an update operation if ($session_role === 'sadmin') { - $isactive = $this->request->getPost('bcheckbox'); - $data['isactive'] = ($isactive == 'on') ? 1 : 0; - } + + $data['isactive'] = 1; + $data['updated_by'] = $session_uid; $BusinessModel->update($business_id, $data); $businessId = $business_id; @@ -178,6 +178,7 @@ class Business extends BaseController $BusinessModel->updateDonationData($businessId, $selectedDonations); } +} // ... existing code ... @@ -318,11 +319,13 @@ if (empty($setting_id)) { // Redirect based on user role if ($session_role === 'sadmin') { - if (empty($business_id)) { - // Redirect to the organization list after inserting a new organization - return redirect()->route('org_list'); - } -} else { + return redirect()->route('org_list'); + } + + +// Redirect based on user role +if ($session_role !== 'sadmin') { + session()->setFlashdata('success', 'User has been updated successfully.'); // Assuming 'index' is the route name for your index page return redirect()->to(base_url("new_org/{$business_id}")); diff --git a/app/Views/business_form.php b/app/Views/business_form.php index 01df4cb..4c50588 100644 --- a/app/Views/business_form.php +++ b/app/Views/business_form.php @@ -227,6 +227,7 @@
+