require_once 'usertypes.php';
 $id = request_isset("id");
 $user_type = request_isset("user_type");
 $username = request_isset("username");
 $new_password = request_isset("new_password");
 $password = request_isset("password");
 $userManager = new UserManager();
 $authManager = new AuthManager();
 switch ($page_action) {
     case 'update_by_id':
         //$db_update_success = $userManager->updateRecord ($id, $user_type, $username, $password);
         $db_update_success = $authManager->updateRecord($id, $user_type, $username, $new_password);
         break;
     case "add_user":
         //$userManager->addRecord($user_type, $username, $password);
         $db_add_success = $authManager->addUser($user_type, $username, $password);
         break;
     case "delete_by_id":
         //$userManager->deleteRecord ($id);
         $db_delete_success = $authManager->deleteUser($id);
         break;
 }
 $users_data = $userManager->getAllRecords();
 $page_title = 'Manage users';
 $alt_menu = '<a href="#" class="add">Add</a>';
 $addView = new AddView('Add', 'add_user');
 $addView->addOptionBox('user_type', 'User type', $usertype_options);
 $addView->addRow('username', 'Username', null, 'eg. Neil');
 $addView->addRow('password', 'Password', null, 'eg. Sm4rtH0uSe');
 $tableView = new TableView(array('View', ''));
 while (($users_row = mysql_fetch_array($users_data)) != null) {