"Administrative Staff", "computing"=>"Computing Staff", "sustainability"=>"Sustainability Staff", "intern"=>"Student Interns"); foreach($type as $where=>$head){ $query = "SELECT * FROM people WHERE type='$where' ORDER BY last ASC"; $result = mysql_query($query); if(mysql_num_rows($result))echo "
\n

$head

\n"; for($i = 0; $row = mysql_fetch_assoc($result); $i++){ $title = $row['title']?"{$row['title']}
\n":""; $p_text = strpos($row['phone'],'-')?$row['phone']:"(805)893-{$row['phone']}"; $phone = $row['phone']?"phone: $p_text
\n":""; $room = $row['room']?"room: {$row['room']}
\n":""; $website = $row['url']?"{$row['url']}
\n":""; $e_text = strpos($row['email'],'@')?$row['email']:$row['email']."@geog.ucsb.edu"; $e_text = obfuscate($e_text); $email = $row['email']?"$e_text
\n":''; echo "
\n
{$row['first']} {$row['last']}
\n\"Photo
$title$phone$room$website$email
\n"; echo $i%2?"
\n":'',""; } } include "../../common/footer.php"; ?>