Welcome to the Admin Panel

Manage user privileges

connect()->prepare($sql); $stmt->execute(); $row = $stmt->fetch(); while($row = $stmt->fetch()) { if($_SESSION['email'] != $row['email']) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } } } public function getCountryNameWithID($id) { $sql = "SELECT * FROM countries WHERE id = ?"; $stmt = $this->connect()->prepare($sql); $stmt->execute([$id]); $row = $stmt->fetch(); return $row['name']; } public function checkIfIsUserAdmin($id) { $sql = "SELECT * FROM admins WHERE user_id = ?"; $stmt = $this->connect()->prepare($sql); $stmt->execute([$id]); $row = $stmt->fetch(); if($row) return 'yes'; else return 'no'; } } $generateObj = new generateUsers(); $generateObj->generate(); ?>
Name Email Country Status  
'; $name = 'No name set'; if(isset($row['name'])) $name = $row['name']; if(isset($row['surname'])) $name = $name.' '.$row['surname']; echo $name; echo ''; echo $row['email']; echo ''; echo $this->getCountryNameWithID($row['country_id']); echo ''; if($this->checkIfIsUserAdmin($row['id']) == 'yes' ) $admin = 'admin'; else $admin = 'user'; echo $admin; echo ''; if($admin == 'admin') { $add = 'disable'; $remove = ''; } else { $remove = 'disable'; $add = ''; } echo '
Add
Remove
'; echo '