function test_retrieve_all_UserProfile_byRole($userCategory) { $users = retrieve_all_UserProfile_byRole($userCategory); if ($users == false) { echo "</br>" . "No user were found"; } else { echo "</br>" . "found records" . "</br>"; foreach ($users as $user) { display_all_user($user); } } }
case 'rmhstaff': $allUsers['RMH Staff Approvers'] = retrieve_all_UserProfile_byRole('RMH Staff Approver'); break; case 'socialworkers': $allUsers['Social Workers'] = retrieve_all_UserProfile_byRole('Social Worker'); break; default: $allUsers['RMH Administrators'] = retrieve_all_UserProfile_byRole('RMH Administrator'); $allUsers['RMH Staff Approvers'] = retrieve_all_UserProfile_byRole('RMH Staff Approver'); $allUsers['Social Workers'] = retrieve_all_UserProfile_byRole('Social Worker'); break; } } else { $allUsers['RMH Administrators'] = retrieve_all_UserProfile_byRole('RMH Administrator'); $allUsers['RMH Staff Approvers'] = retrieve_all_UserProfile_byRole('RMH Staff Approver'); $allUsers['Social Workers'] = retrieve_all_UserProfile_byRole('Social Worker'); } function displayUsersTable($allUsers) { foreach ($allUsers as $title => $userGroup) { echo '<h2>' . $title . '</h2>'; echo '<table border = "2" cellspacing = "10" cellpadding = "10" style="width:500px; margin-bottom: 10px;">'; echo '<thead> <tr> <th>Username</th> <th colspan="3">Actions</th> </tr> </thead>'; foreach ($userGroup as $user) { echo '<tr>'; echo '<td>' . $user->get_usernameId() . '</td>';
function NewFamilyProfile($profileID) { $approvers = retrieve_all_UserProfile_byRole('RMH Staff Approver'); foreach ($approvers as $user) { $to[] = $user->get_userEmail(); } $to = implode(",", $to); //changes $to into a string $subject = "There is a Request for a New Family Profile"; $message = "There is a request for a new family profile. Its Profile Activity ID is {$profileID}."; email($to, $subject, $message); }