public function Profile() { $categoriesModel = new CategoriesModel(); $categories = $categoriesModel->getAllCategories(); $model["categories"] = $categories; $usersModel = new UsersModels(); $userInfo = $usersModel->getUserInfo($_SESSION['username']); $model["userInfo"] = $userInfo; return new View($model); }
/** * @admin */ public function users($id = null) { if ($id != null) { View::$viewBag['editing'] = $id; } if (isset($_POST['editUserButton'])) { $username = $_POST['username']; $email = $_POST['email']; $role = $_POST['role']; $cash = $_POST['cash']; $userId = $_POST['userId']; $userModels = new UsersModels(); $userModels->editUser($username, $email, $role, $cash, $userId); } $userModel = new UsersModels(); $users = $userModel->getAllUsers(); $model["users"] = $users; $categoriesModel = new CategoriesModel(); $categories = $categoriesModel->getAllCategories(); $model["categories"] = $categories; return new View($model); }
public function logout() { $userModel = new UsersModels(); $userModel->logout(); }