$username = "peopledbuser";
$password = "userpeoplepassdb";
$server = "127.0.0.1";
mysql_connect($server,$username,$password);
@mysql_select_db("people") or die ("Unable to select database \"people\"");
// if there's a variable passed in, let's grab it.
$user_id = $_GET['view'];
$have_user_info = false;
// get the person's information if available
if($user_id != "") {
// the almighty input validation
if(ctype_digit($user_id)) {
// do query
$query = "select * from faculty where id='$user_id'";
$result = mysql_query($query);
$num = mysql_numrows($result);
// should only be 1 so verify
if($num != 1) {
$have_user_info = false;
} else {
// store the information for later
$have_user_info = true;
$firstName = mysql_result($result, 0, "fName");
$lastName = mysql_result($result, 0, "lName");
$title = mysql_result($result, 0, "title");
$office = mysql_result($result, 0, "office");
$phone = mysql_result($result, 0, "phone");
$email = mysql_result($result, 0, "email");
$section = mysql_result($result, 0, "section");
$email = preg_replace_callback("/[-_a-z0-9]+(\.[-_a-z0-9]+)*@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]{2,6}/i", email, $email);
$weburl = mysql_result($result, 0, "weburl");
$type = mysql_result($result, 0, "type");
}
} else {
// just ignore it and show the normal list
$have_user_info = false;
}
}
else {
$have_user_info = false;
}
echo "\n";
?>
if($have_user_info) {
?>
echo "$firstName $lastName"; ?>
echo "$title"; ?>
echo "$office"; ?> echo " | $phone"; ?>
echo "$email"; ?>
echo "$section"; ?>
}
else {
?>
Resident Faculty
Name | Title |
$query = "select * from faculty where type='0' order by lName asc";
$result = mysql_query($query);
$num = mysql_numrows($result);
for ($i = 0; $i < $num; $i++) {
$firstName = mysql_result($result, $i, "fName");
$lastName = mysql_result($result, $i, "lName");
$title = mysql_result($result, $i, "title");
$id = mysql_result($result, $i, "id");
print "$lastName, $firstName | $title |
\n";
}
?>
Adjunct / Affiliate Faculty
Name | Title |
$query = "select * from faculty where type='1' order by lName asc";
$result = mysql_query($query);
$num = mysql_numrows($result);
for ($i = 0; $i < $num; $i++) {
$firstName = mysql_result($result, $i, "fName");
$lastName = mysql_result($result, $i, "lName");
$title = mysql_result($result, $i, "title");
$id = mysql_result($result, $i, "id");
print "$lastName, $firstName | $title |
\n";
}
?>
Research Associates
Name | Title |
$query = "select * from faculty where type='2' order by lName asc";
$result = mysql_query($query);
$num = mysql_numrows($result);
for ($i = 0; $i < $num; $i++) {
$firstName = mysql_result($result, $i, "fName");
$lastName = mysql_result($result, $i, "lName");
$title = mysql_result($result, $i, "title");
$id = mysql_result($result, $i, "id");
print "$lastName, $firstName | $title |
\n";
}
?>
Support Scientists
Name | Title |
$query = "select * from faculty where type='3' order by lName asc";
$result = mysql_query($query);
$num = mysql_numrows($result);
for ($i = 0; $i < $num; $i++) {
$firstName = mysql_result($result, $i, "fName");
$lastName = mysql_result($result, $i, "lName");
$title = mysql_result($result, $i, "title");
$id = mysql_result($result, $i, "id");
print "$lastName, $firstName | $title |
\n";
}
?>
} // if($have_user_info)
?>
include('includes/people_menu.html'); ?>
include('includes/people_footer.php'); ?>