username, "@") == true ? substr($data->username, 0, strpos($data->username, "@")) : $data->username;
if (file_exists($fileurl . $username . ".jpg")){
return $baseurl . $username . ".jpg";
} else {
return $data->picture;
}
}
if (isset($_GET['dept']) && $_GET['dept'] != "all"){
echo "
" . htmlentities(urldecode($_GET['dept'])) . "
";
$url = 'https://east.iu.edu/people/ajax_getbydept.php?apikey=8d55aaffdb598280d34b1effbf85517e&dept='.urlencode($_GET['dept']);
//$url = 'https://iueweb3.sitehost-test.iu.edu/people/ajax_getbydept.php?apikey=8d55aaffdb598280d34b1effbf85517e&dept='.urlencode($_GET['dept']);
$json = file_get_contents($url);
$people = json_decode($json);
if(!isset($people->result)){
//$html = ""; // Build a html object to return
foreach($people as $data){ // Each person has their own data
$data->showPhone = 'external';
// override picture if one exists
$data->picture = get_picture($data);
include($template);
}
}
} elseif (isset($_GET['q'])) {
echo "
Search results for: " . htmlentities(urldecode($_GET['q'])) . "
";
$url = 'https://east.iu.edu/people/ajax_search.php?apikey=8d55aaffdb598280d34b1effbf85517e&q='.urlencode($_GET['q']);
//$url = 'https://iueweb3.sitehost-test.iu.edu/people/ajax_search.php?apikey=8d55aaffdb598280d34b1effbf85517e&q='.urlencode($_GET['q']);
$json = file_get_contents($url);
$people = json_decode($json);
if(!isset($people->result)){
//$html = ""; // Build a html object to return
foreach($people as $data){ // Each person has their own data
$data->showPhone = 'external';
// override picture if one exists
$data->picture = get_picture($data);
include($template);
}
}
} else {
//echo get_employees($dept, false, $search);
$url = 'https://east.iu.edu/people/ajax_deptlist.php?apikey=8d55aaffdb598280d34b1effbf85517e';
//$url = 'https://iueweb3.sitehost-test.iu.edu/people/ajax_deptlist.php?apikey=8d55aaffdb598280d34b1effbf85517e';
$json = file_get_contents($url);
$depts = json_decode($json);
if(!isset($depts->result)){
$html = ""; // Build a html object to return
foreach($depts as $data){ // Each
$groupEnc = urlencode($data->group);
if($data->group == "Athletics"){
$html .= "
" . htmlentities($data->group) . "";
} else {
$html .= "
" . htmlentities($data->group) . "";
}
}
echo $html;
}
}
?>