'Biography', 'research' => 'Research & Scholarship', 'publications' => 'Research Outputs', 'supervision' => 'Areas for Research Supervision'); $conn = mysqli_connect( $dbhost, $dbuser, $dbpass, $dbname ) ; if (mysqli_connect_errno( $conn )) { echo "Can't connect to database: ".mysqli_connect_error(); } if ( $conn ) { $field = ''; $id = ''; if ( $staffid != "" ) { $field = 'id'; $id = $staffid; } elseif ($staffuid != "") { if ( $staffuid == 'sbusjsns') { exit; } # hack to disable malicious link to profile, requested by HR $field = 'uid'; $id = $staffuid; $redirst = mysqli_prepare($conn, "SELECT id, uid from staffdata where uid = ?"); mysqli_stmt_bind_param( $redirst, 's', $id); mysqli_stmt_execute($redirst); $rediresult = mysqli_stmt_get_result($redirst); $staffdata = mysqli_fetch_object( $rediresult ); $url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; $url = strtok($url, '?'); # hack for odd google search for andrew ball leading to empty profile for an SMUS username if ( $staffuid == 'smusame' ) { $staffdata->id = '465'; } header("Status: 301 Moved Permanently"); header("Location:$url?staffid=".$staffdata->id); exit; } else { echo(""); } $statement = "SELECT staffdata.*, schoolnames.schoolname, schoolnames.url schoolurl FROM staffdata, schoolnames WHERE staffdata.id = ? AND staffdata.school = schoolnames.id and staffdata.visible = 'yes'"; # echo "

$statement

"; $sdst = mysqli_prepare( $conn, $statement ); mysqli_stmt_bind_param( $sdst, 's', $id ); mysqli_stmt_execute($sdst); # mysqli_stmt_store_result($sdst); $result = mysqli_stmt_get_result($sdst); $staffdata = mysqli_fetch_object( $result ); if (mysqli_error($conn)) { echo "

".mysqli_error($conn)."

"; } # look to see if they have any research supervision projects $rpLinkList = ''; $rpScrollButton = ''; $rpst = mysqli_prepare( $conn, "SELECT coursefinder.courses_project.pid, coursefinder.courses_project.ipp_code, coursefinder.courses_project.year, coursefinder.courses_project.title, courses_course.title AS coursetitle, courses_course.study_mode FROM coursefinder.courses_supervisor INNER JOIN coursefinder.courses_projectsupervision ON coursefinder.courses_supervisor.ad_username = coursefinder.courses_projectsupervision.supervisor_id INNER JOIN coursefinder.courses_project ON coursefinder.courses_project.id = coursefinder.courses_projectsupervision.project_id INNER JOIN coursefinder.courses_course ON coursefinder.courses_course.ipp_code_year = coursefinder.courses_project.course_id WHERE coursefinder.courses_supervisor.ad_username = ? AND coursefinder.courses_projectsupervision.add_to_profile = 1 ORDER BY year, title"); mysqli_stmt_bind_param($rpst, 's', $staffdata->uid); mysqli_stmt_execute($rpst); $rpres = mysqli_stmt_get_result($rpst); #echo "

user: ".$staffdata->uid."

"; #print_r($rpres); if (mysqli_error($conn)) { echo "

".mysqli_error($conn)."

"; $rpLinkList .= "

".mysqli_error($conn)."

"; } if ( mysqli_num_rows($rpres) > 0 ) { $rpScrollButton = <<View research degree topics that {$staffdata->title} {$staffdata->name} might supervise HEREDOC; $rpLinkList .= "

Postgraduate research opportunities with ".$staffdata->title." ".$staffdata->name."

\n\n"; $curyear = ''; $curtype = ''; $degreeLists = array(); #$rplinklist .= "'; if ( array_key_exists($curyear, $degreeLists)) { foreach ( $degreeLists[$curyear] as $dt => $dtlist ) { $rpLinkList .= "
$dt
\n\n"; } } } $curyear = $rp->year; $curtype = $degreeType; $rpLinkList .= "

$curyear

"; //$degreeLists = array(); // $rpLinkList .= "

$curyear

\n
$degreeType
\n\n
$curtype
\n