Skip to content

Commit

Permalink
Merge pull request #253 from DasunThathsara/dasun
Browse files Browse the repository at this point in the history
fix: admin deletion functionality for superadmin
  • Loading branch information
DasunThathsara authored Jan 31, 2024
2 parents 93f11af + 69bf03f commit eccb6b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/models/UserModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public function getAdminCount(){

// View all admins
public function viewAdmins(){
$this->db->query('SELECT * FROM user WHERE userType = "admin"');
$this->db->query('SELECT * FROM user WHERE userType = "admin" AND status != 10');

$results = $this->db->resultSet();

Expand All @@ -420,7 +420,7 @@ public function viewAdmin($admin_id){

// Remove admin
public function removeAdmin($admin_id){
$this->db->query('DELETE FROM user WHERE id = :id');
$this->db->query('UPDATE user SET status = 10 WHERE id = :id');
$this->db->bind(':id', $admin_id);

// Execute
Expand Down
5 changes: 1 addition & 4 deletions app/views/superAdmin/admins.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
<!-- SIDE NAVIGATION -->
<?php
$section = 'lands';
//require APPROOT.'/views/inc/components/sidenavbar.php';

//print_r(session_id());
session_destroy();
require APPROOT.'/views/inc/components/sidenavbar.php';
?>

<main class="page-container">
Expand Down

0 comments on commit eccb6b4

Please sign in to comment.