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 @@ State Zip File + Status Action - + @@ -38,10 +47,15 @@ + " class="edit-button" title="Click to Edit Business"> - " class="delete-button" title="Click to Delete Business"> + + " class="delete-button" title="Click to Delete Business"> + + " class="active-button" title="Click to Active Business"> + diff --git a/app/Views/template/topbar.php b/app/Views/template/topbar.php index 3c4aa34..ac44d85 100644 --- a/app/Views/template/topbar.php +++ b/app/Views/template/topbar.php @@ -193,7 +193,7 @@ - <?= $company_name; ?> + <?= $company_name; ?> diff --git a/app/Views/user_form.php b/app/Views/user_form.php index 1526654..4ee051b 100644 --- a/app/Views/user_form.php +++ b/app/Views/user_form.php @@ -10,7 +10,7 @@ - +
" method="post" enctype="multipart/form-data" id="myForm">
@@ -23,18 +23,23 @@
-
+ +
-
+
+ + +
diff --git a/app/Views/user_list.php b/app/Views/user_list.php index 1275cad..a450d1d 100644 --- a/app/Views/user_list.php +++ b/app/Views/user_list.php @@ -80,7 +80,7 @@ - + " class="fe-user-check" title="Click to Active User" > ; + var user_id = $(this).data('user-id'); Swal.fire({ title: "Are you sure?", text: "You won't be able to revert this!",