$username = "peopledbuser";
$password = "userpeoplepassdb";
$server = "127.0.0.1";
$db_name = "people";
$con = mysqli_connect($server,$username,$password,$db_name);
#@mysql_select_db("people") or die ("Unable to select database \"people\"");
function mysqli_result($result,$row,$field=0) {
if ($result===false) return false;
if ($row>=mysqli_num_rows($result)) return false;
if (is_string($field) && !(strpos($field,".")===false)) {
$t_field=explode(".",$field);
$field=-1;
$t_fields=mysqli_fetch_fields($result);
for ($id=0;$id
table==$t_field[0] && $t_fields[$id]->name==$t_field[1]) {
$field=$id;
break;
}
}
if ($field==-1) return false;
}
mysqli_data_seek($result,$row);
$line=mysqli_fetch_array($result);
return isset($line[$field])?$line[$field]:false;
}
function mysqli_result1($search, $row, $field){
$i=0; while($results=mysqli_fetch_array($search)){
if ($i==$row){$result=$results[$field];}
$i++;}
return $result;}
?>
Department of
Atmospheric and Oceanic Science
Browse the department directory:
Academic and Research Faculty
Name | Title | Office | Email | Phone |
$query = "select * from faculty order by lName, fName asc";
$result = mysqli_query($con,$query);
$num = mysqli_num_rows($result);
$facList = $_GET['facList'];
if ($facList=='') {$facList="All";}
for ($i = 0; $i < $num; $i++)
{
$firstName = mysqli_result($result, $i,2);
$lastName = mysqli_result($result, $i, 1);
$email = mysqli_result($result, $i, "email");
$phone = mysqli_result($result, $i, "phone");
$office = mysqli_result($result, $i, "office");
$id = mysqli_result($result, $i, "id");
$title = mysqli_result($result, $i, "title");
$email = preg_replace_callback("/[-_a-z0-9]+(\.[-_a-z0-9]+)*@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]{2,6}/i", email, $email);
if ($facList == "Academic"){
if(preg_match('/Professor/',$title) && !preg_match('/ritus|Adjunct|Affiliate|Visiting|Research/', $title)){
print "$lastName, $firstName | \n";
print "$title | $office | $email | $phone |
\n";
}
}elseif ($facList == "Adjunct"){
if(preg_match('/Adjunct|Affiliate|ritus|Visit/',$title)){
print "$lastName, $firstName | \n";
print "$title | $office | $email | $phone |
\n";
}
}elseif ($facList == "Research"){
if(preg_match('/Research/',$title)){
print "$lastName, $firstName | \n";
print "$title | $office | $email | $phone |
\n";
}
}elseif ($facList == "All"){
print "$lastName, $firstName | \n";
print "$title | $office | $email | $phone |
\n";
}else if($facList == "Academic and Research"){
if(preg_match('/Research/',$title) || (preg_match('/Professor/',$title) || (preg_match('/Specialist/',$title)) && !preg_match('/ritus|Adjunct|Affiliate|Visiting/', $title))){
print "$lastName, $firstName | \n";
print "$title | $office | $email | $phone |
\n";
}
}else{
if((preg_match('/Research/',$title) && !preg_match('/Assistant|Affiliate|Visiting/',$title) && !preg_match('/^Research/', $title)) ||
(preg_match('/Professor/',$title) && !preg_match('/ritus|Adjunct|Affiliate|Visiting/', $title)) || preg_match('/^Assistant/',$title)){
print "$lastName, $firstName | \n";
print "$title | $office | $email | $phone |
\n";
}
}
}
?>
Students
Name | Office | Email | Advisor |
$query = "select * from students order by lName, fName asc";
$result = mysqli_query($con,$query);
$num = mysqli_num_rows($result);
for ($i = 0; $i < $num; $i++)
{
$firstName = mysqli_result($result, $i, 2);
$lastName = mysqli_result($result, $i, 1);
$email = mysqli_result($result, $i, "email");
$advisor = mysqli_result($result, $i, "advisor");
$office = mysqli_result($result, $i, "office");
$id = mysqli_result($result, $i, "id");
$email = preg_replace_callback("/[-_a-z0-9]+(\.[-_a-z0-9]+)*@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]{2,6}/i", email, $email);
print "$lastName, $firstName | \n";
print "$office | $email | $advisor |
\n";
}
?>
Staff
Name | Job Title | Office | Email | Phone |
$query = "select * from staff order by email,lName, fName asc";
$result = mysqli_query($con,$query);
$num = mysqli_num_rows($result);
for ($i = 0; $i < $num; $i++)
{
$firstName = mysqli_result($result, $i, 2);
print $firstName;
#print mysqli_result($result, $i, "fName");
$lastName = mysqli_result($result, $i, 1);
$email = mysqli_result($result, $i, "email");
#print $email;
$phone = mysqli_result($result, $i, "phone");
$office = mysqli_result($result, $i, "office");
$id = mysqli_result($result, $i, "id");
$title = mysqli_result($result, $i, "title");
$email = preg_replace_callback("/[-_a-z0-9]+(\.[-_a-z0-9]+)*@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]{2,6}/i", email, $email);
#print $email;
print "$firstName $lastName | \n";
print "$title | $office | $email | $phone |
\n";
}
?>
include('includes/people_footer.php'); ?>