//$lst = CourseDefn::ListAllStartingWithTitle($val); $lst = CourseDefn::ListAllContainingTitle($val); foreach ($lst as $elem) { // id, code, title, descr, university $arr[] = array($elem['id'], $elem['title'], $elem['code']); } $lst = CourseDefn::ListAllStartingWithCode($val); foreach ($lst as $elem) { // id, code, title, descr, university $arr[] = array($elem['id'], $elem['code'], $elem['title']); } break; // TODO: decide if it's okay to do this, especially without auth // TODO: decide if it's okay to do this, especially without auth case 'users': $lst = User::ListAllStartingWithName($val); $arr = array(); foreach ($lst as $k => $v) { $usr = User::GetAttribs($v['id']); foreach ($usr as $l => $w) { $usr[$w[0]] = $w[1]; } $arr[] = array($v['id'], $usr['NAME'], "{$usr['UNIVERSITY']}, {$usr['GRADYEAR']}"); } $invert_validation = true; break; default: die(''); } header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");