University of Wisconsin–Madison

Official Page

“;
$sqlselectidcode = “select * from personnel where id = ‘$id'”;
$result = mysqli_query($conn,$sqlselectidcode);
}

if ($name != “”) {
if ($debug) echo “executing name search
“;
$sqlselectnamecode = “select lastname, firstname, middleinit, id from personnel
where lastname rlike (“”.$name.””)
or firstname rlike (“”.$name.””)
order by lastname, firstname, middleinit”;
$result = mysqli_query($conn,$sqlselectnamecode);
}

if ($result <= 0) echo "Query Failed
“;
if ($result != 0) {
$nrows = mysqli_num_rows($result) ;
if ($nrows == 0) { echo “No Data returned
“; }
else {
if($nrows > 1) {
echo “Select an Individual“;
echo “

“;
}
while($row = mysqli_fetch_array($result)) {
$id = $row[“id”];
$firstname = $row[“firstname”];
$lastname = $row[“lastname”];
$firstname = $row[“firstname”];
$mi = $row[“middleinit”];
$name = $firstname . ” ” . (($mi == ”)? $lastname:$mi . “. ” . $lastname);
$classification = $row[“classification”];
$category = $row[“category”];
$title = $row[“title”];
$phone = $row[“phone”];
$field = $row[“field”];
$degree = $row[“degree”];
$status = $row[“status”];
$email = $row[“email”];
$homepage = $row[“homepage”];
$office = $row[“office”];
$photo = $row[“photo”];
$links = explode(“|”,stripslashes($row[“links”]));
$linknames = explode(“|”,stripslashes($row[“linknames”]));
$research = stripslashes($row[“research”]);
$teaching = stripslashes($row[“teaching”]);
$service = stripslashes($row[“service”]);
$pubs = stripslashes($row[“pubs”]);
$wp_page = $row[“wp_personal”];
if (preg_match(“#([0-9]{3})-([0-9]{3})-([0-9]{4})#”,$phone,$matches))
$phone = sprintf(“(%s)%s-%s”,$matches[1], $matches[2], $matches[3]);
else if (preg_match(“#([0-9]{3})-([0-9]{4})#”,$phone,$matches))
$phone = sprintf(“(608) %s-%s”,$matches[1], $matches[2]);
else if (preg_match(“#([0-9])-([0-9]{4})#”,$phone,$matches))
$phone = sprintf(“(608) 26%s-%s”,$matches[1], $matches[2]);
if ($phone == ” && (($category == ‘Postdoctoral Student’) || ($category == ‘Graduate Student’) || ($category == ‘Undergraduate Student’))) {
$phone = $DEF_PHONE;
}

($title == “”) ? $title = $classification : $title = $title . ‘
‘. $classification;
if ($photo == “”) $photo = “/images/people/geobucky.gif”;
if ($nrows > 1) {
echo “$name
“;
}
else {
?>

$name
“;
if ($title != ”) echo “ $title
“;
if ($field != ”) echo “ $field
“;
if ($phone != ”) echo “ $phone
“;
if ($email != ”) echo “Email: $email
“;
if ($office != ”) echo “Office: $office
“;
if (isset($linknames)) {
$link_cnt = count($linknames);
}

if (($linknames[0] != ”) || ($homepage != ”)) {
echo “

“;
echo “Useful Links
“;
if ($homepage != “”) {
echo “ Personal Home Page “;
if ($linknames[0] != ”) echo “ | “;
}
for ($i = 0; $i < $link_cnt; $i++ ) { echo "
$linknames[$i]“;
if ($i != $link_cnt – 1) echo “ | “;
}
}

?>