"; }else { }*/ } } // Create an array to track employees by their email addresses $uniqueEmployees = []; // Iterate through the merged data and eliminate duplicates $filteredData = []; foreach ($merged_data as $employee) { $email = strtolower(trim($employee['email'])); // Check if this email has already been added to $uniqueEmployees if (!isset($uniqueEmployees[$email])) { // Update department names based on $customDepartmentNames $departments = array_map('trim', explode(',', $employee["department"])); // Split department names by comma and trim spaces foreach ($departments as &$department) { // Check if the department name needs updating if ($department === "Emergency Medicine" || $department === "Surgery" || $department === "Medicine" || $department === "Women's and Children's Health" || $department === "Biomedical Science" || $department === "Population Health & Social Medicine" || $department === "Clinical Neurosciences") { $department = "Department of " . $department; } } $employee["department"] = implode(', ', $departments); // Add the employee to the filtered data $filteredData[] = $employee; // Mark this email as added to avoid duplicates $uniqueEmployees[$email] = true; } } // Define custom department names $customDepartmentNames = [ "Emergency Medicine" => "Department of Emergency Medicine", "Surgery" => "Department of Surgery", "Medicine" => "Department of Medicine", "Women's and Children's Health" => "Department of Women's and Children's Health", "Biomedical Science" => "Department of Biomedical Science", "Population Health & Social Medicine" => "Department of Population Health & Social Medicine", "Clinical Neurosciences" => "Department of Clinical Neurosciences", ]; // Extract and organize unique department names $uniqueDepartments = []; foreach ($filteredData as $f) { $departments = array_map('trim', explode(',', $f["department"])); // Split department names by comma and trim spaces // Update department names based on $customDepartmentNames $departments = array_map(function ($department) use ($customDepartmentNames) { return isset($customDepartmentNames[$department]) ? $customDepartmentNames[$department] : $department; }, $departments); foreach ($departments as $department) { if (!in_array($department, $uniqueDepartments)) { $uniqueDepartments[] = $department; } } } // Extract "Office of the Dean" from $uniqueDepartments $officeOfTheDean = array_filter($uniqueDepartments, function ($department) { return $department === "Office of the Dean"; }); // Remove "Office of the Dean" from $uniqueDepartments $uniqueDepartments = array_filter($uniqueDepartments, function ($department) { return $department !== "Office of the Dean"; }); // Sort the remaining department names sort($uniqueDepartments); // Merge "Office of the Dean" back to the sorted list array_unshift($uniqueDepartments, reset($officeOfTheDean)); // Generate the select menu echo '
'; echo '
'; // $filteredData contains the merged data without duplicates // ADD static employees $Employee1 = [ 'name' => 'Casey, Robert, M.D.', 'description' => 'Clinical Affiliate Assistant Professor and Pediatrics Clerkship Director', 'department' => 'Department of Women\'s and Children\'s Health', 'email' => 'caseyr@fau.edu', 'phone' => '', 'url' => 'https://www.fau.edu/medicine/directory/robert-casey/' ]; $Employee2 = [ 'name' => 'Chaudhry, Saima, M.D., MSHS, FACP', 'description' => 'Clinical Affiliate Professor of Medicine and Associate Dean for Academic Affairs/Memorial Healthcare System (MHS)', 'department' => 'Department of Medicine', 'email' => '', 'phone' => '' ]; $Employee3 = [ 'name' => 'Fahmy, Samer, M.D.', 'description' => 'Clinical Affiliate Associate Professor of Medicine and Associate Dean for Academic Affairs/Boca Raton Regional Hospital (BRRH)', 'department' => 'Department of Medicine', 'email' => '', 'phone' => '' ]; $Employee5 = [ 'name' => 'Harari, Jack L., M.D., J.D. ', 'description' => 'Clinical Affiliate Professor of Emergency Medicine and Associate Dean for Academic Affairs, West Boca Medical Center', 'department' => 'Department of Emergency Medicine', 'email' => 'jharari@health.fau.edu', 'phone' => '561-297-2219', 'url' => 'https://www.fau.edu/medicine/directory/jack-harari/' ]; $Employee8 = [ 'name' => 'Dardano, Sr., Anthony, M.D.', 'description' => 'Clinical Professor of Obstetrics and Gynecology and Associate Dean for Academic Affairs, Delray Medical Center (DMC)', 'department' => 'Department of Women\'s and Children\'s Health', 'email' => 'adardan1@health.fau.edu', 'phone' => '', 'url' => 'https://www.fau.edu/medicine/directory/anthony-dardano/' ]; // Add to filtered data array $filteredData[] = $Employee1; $filteredData[] = $Employee2; $filteredData[] = $Employee3; $filteredData[] = $Employee5; $filteredData[] = $Employee8; // Sort the filtered data by last name usort($filteredData, function ($a, $b) { return strcasecmp($a['name'], $b['name']); }); // Process the filtered data foreach ($filteredData as $f) { // Define an array of email addresses to exclude $emailsToExclude = [ 'davidgreen@fau.edu','ademner@health.fau.edu','sgografe@fau.edu','cwhitehair@health.fau.edu','yua@fau.edu','doctor@neiledisonmd.com' // Add the email addresses you want to exclude here ]; $email = strtolower(trim($f['email'])); // Skip employees with email addresses in the exclusion list if (in_array($email, $emailsToExclude)) { continue; } // Remove "Dr. " from the name field, if it's present $name = preg_replace('/\bDr\. \s*/i', '', CollegeDirectory_customName($f)); $nameDr = preg_replace('/\bDr\., \s*/i', ', ', $name); $namePhDPhD = preg_replace('/,\s*Ph\.D\.\s*,\s*Ph\.D\.\s*/i', ', Ph.D.', $nameDr); $name = preg_replace('/\s*,/', ',', $namePhDPhD); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } echo '
Name Title Phone
'; if(isset($f["url"]) && !empty($f["url"]) && strpos($f["url"], 'https://www.fau.edu') !== false) { echo ''; }elseif (isset($f["url"]) && !empty($f["url"]) && strpos($f["url"], 'https://www.fau.edu') !== true) { echo ''; }else { } echo $name; echo CollegeDirectory_customCreds($f); if(isset($f["url"]) && !empty($f["url"]) && strpos($f["url"], 'https://www.fau.edu') !== false) { echo ' '; }elseif (isset($f["url"]) && !empty($f["url"]) && strpos($f["url"], 'https://www.fau.edu') !== true) { echo ' '; }else { } echo ''. CollegeDirectory_customTitle($f) .''. CollegeDirectory_customPhone($f) .'
No faculty or staff matches your search.

Try changing filters above or  click here  to see all the results.

'; ?>