header('Location: ' . redirect()); exit; } // This page has no function without a valid dept id if (!isset($_REQUEST['personid'])) { echo "How'd you get here without a referral?"; exit; } $dept = new Department(); $person = new People(); $person->PersonID = isset($_POST['personid']) ? $_POST['personid'] : $_GET['personid']; $person->GetPerson(); // Update if form was submitted and action is set if (isset($_POST['action']) && $_POST['action'] == "Submit") { $grpMembers = $_POST['chosen']; $person->AssignDepartments($grpMembers); } $deptList = $person->GetDeptsByPerson(); $departmentList = $dept->GetDepartmentList(); $possibleList = array_obj_diff($departmentList, $deptList); function array_obj_diff($array1, $array2) { foreach ($array1 as $key => $value) { $array1[$key] = serialize($value); } foreach ($array2 as $key => $value) { $array2[$key] = serialize($value); } $array_diff = array_diff($array1, $array2); foreach ($array_diff as $key => $value) { $array_diff[$key] = unserialize($value);