diff --git a/app/Config/Routes.php b/app/Config/Routes.php index e0f01c0..6ec32dd 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -68,6 +68,7 @@ $routes->get("org_list/", "Business::index"); $routes->get("new_org/(:any)", "Business::new_org/$1"); $routes->post("insert_org/", "Business::insert_org"); $routes->get("delete_org/(:any)", "Business::delete_org/$1"); +$routes->get("activate_org/(:any)", "Business::activate_org/$1"); #Donor Routes (also known as contributor,customer) $routes->get("Contributor_list/", "Customer::index"); diff --git a/app/Controllers/Business.php b/app/Controllers/Business.php index ba3c10c..c8b39bf 100644 --- a/app/Controllers/Business.php +++ b/app/Controllers/Business.php @@ -18,11 +18,11 @@ class Business extends BaseController $where = ['business_id' => (int)get_business_id(), 'isactive' => 1]; } else { $this->logger->info("Buiness: Listing In Super-admin role ."); - $where = ['isactive !=' => NULL]; + $where = ['business_id !=' => 0,'isactive !=' => NULL]; } $BusinessModel = new BusinessModel(); $data['page_name'] = 'Organization Details'; - $data['organzations'] = $BusinessModel->where($where)->where('business_id !=', 0)->where('isactive', 1)->findAll(); + $data['organzations'] = $BusinessModel->where($where)->findAll(); // $data['lastQuery'] = $BusinessModel->getLastQuery(); // print_r($data);die; $this->render_page('business_list', $data); @@ -291,6 +291,17 @@ class Business extends BaseController return redirect()->route('org_list'); } + public function activate_org($id){ + helper('session'); + $session_uid = get_logged_user_id(); + $BusinessModel = new BusinessModel(); + + $data['isactive'] = 1; + $data['updated_by'] = $session_uid; + $BusinessModel->update($id, $data); + + return redirect()->route('org_list'); + } public function insertDonationBusiness($businessId) { $db = \Config\Database::connect(); diff --git a/app/Views/business_list.php b/app/Views/business_list.php index e9d0e65..87becc1 100644 --- a/app/Views/business_list.php +++ b/app/Views/business_list.php @@ -22,13 +22,22 @@