require_once 'utils.php'; require_once 'email.php'; $filter = null; $error = null; $message = null; $user = null; $person = null; $top = false; $top_unique_ids = null; $dal = new DAL($opts['hn'], $opts['db'], $opts['un'], $opts['pw']); try { $dal->beginTransaction(); $user = $dal->selectUser(); if (isset($_GET['pending'])) { $filter = 'Pending'; $top_unique_ids = $dal->selectUnapprovedUniqueIds(); } else { if (isset($_GET['person_id'])) { $person = $dal->selectPersonById($_GET['person_id']); if ($person === null) { throw new UserException('Profile not found.'); } $filter = formatPersonName($person); $top_unique_ids = $dal->selectUniqueIdsByPerdonId($_GET['person_id']); } else { $top = true; $top_unique_ids = $dal->selectTopUniqueIds(); } } $dal->commit(); } catch (UserException $e) {