CSE
CSE
CSE CSE
\n"; require_once 'change/db.php'; require_once '/w/web/eecs/etc/common/MyG.php'; MyG::dbconnect('spacedb'); include("/w/web/eecs/etc/postdocs/getfunctions.php"); $match = isset($_GET['match']) ? $_GET['match'] : ''; $match = preg_replace("/[^a-zA-Z_-]/", "", $match); $match = sanitize($match); $uniqname = isset($_GET['uniqname']) ? $_GET['uniqname'] : ''; $uniqname = preg_replace("/[^a-zA-Z]/", "", $uniqname); $shortview = isset($_GET['view']) ? $_GET['view'] : ''; if($shortview != 'list') { $shortview = ''; } $alpha = isset($_GET['alpha']) ? $_GET['alpha'] : ''; $alpha = preg_replace("/[^A-Z]/", "", $alpha); //SQLS //Get Postdocs by uniqname $allfac_sql = "SELECT * FROM person " . "INNER JOIN location ON person.person_id=location.person_id " . "INNER JOIN status ON person.person_id=status.person_id " . "INNER JOIN division ON person.person_id=division.person_id " . "WHERE division.division_name = \"CSE\" "; if($uniqname) { $sql = $allfac_sql . "AND person.uniqname = " . "\"" . $uniqname . "\" "; $pagetitle = "$div Postdocs Profiles"; } //Main page list if(!$match && !$uniqname) { $sql = $allfac_sql . "AND status.status_type = \"Postdoc\" "; $pagetitle = "All $div Postdocs"; } //Get postdocs by type if($match == "All") { $sql = $allfac_sql . "AND status.status_type = \"Postdoc\" "; $pagetitle = "All $div Postdocs"; } //Search by Research Area $match2 = preg_replace('/_/', ' ', $match); $RESareas = array( "Applied Electromagnetics and RF Circuits" => "ae", "Artificial_Intelligence" => "ai", "Communications" => "comm", "Computer_Architecture" => "celab", "Computer-Aided_Design_and_VLSI" => "vlsi", "Control_Systems" => "systems", "Energy_Science_and_Engineering" => "power", "Integrated_Circuits_and_VLSI" => "vlsi", "Interactive_Systems" => "interactive_sys", "MEMS_and_Microsystems" => "mems", "Optics_and_Photonics" => "optics", "Plasma_Science_and_Engineering" => "mipse", "Power_and_Energy" => "power", "Quantum_Science_and_Technology" => "cuos", "Robotics" => "robotics", "Signal_and_Image_Processing" => "sigproc", "Software_Systems" => "systems", "Solid-State_Devices_and_Nanotechnology" => "ssel", "Theory_of_Computation" => "theory"); foreach($RESareas as $r_area => $this_unit) { if($match == $r_area) { $this_id = get_area_id($match2); if($this_id) { $sql = "SELECT * FROM person " . "INNER JOIN location ON person.person_id=location.person_id " . "INNER JOIN status ON person.person_id=status.person_id " . "LEFT JOIN area2 ON person.person_id=area2.person_id " . "LEFT JOIN unit ON person.person_id=unit.person_id " . "WHERE status.status_type = \"Postdoc\" " . "AND (area2.research_id = $this_id OR unit.unit_name = \"$this_unit\") "; $pagetitle = "$match2 Postdocs"; break; } } } //No SQL found? if(!$sql) { $location = "/eecs/etc/postdocs/" . $div . "postdocs.html"; header("Location: $location"); exit; } print "

$pagetitle

\n"; //Print Alpha List $alpha1 = $alpha; $alpha = ''; $lnameT = array(); $lnameA = $lnameL = ''; $result = mysql_query($sql) or die (mysql_error()); while ($row = mysql_fetch_array($result)) { $lname = $row["lastname"]; $lnameA = substr($lname, 0, 1); $lnameA = strtoupper($lnameA); if($lnameA != $lnameL) { array_push($lnameT, $lnameA); $lnameL = $lnameA; } } print "
\n"; print "\n"; print "\n"; print "
"; $azRange = range('A','Z'); $baseB = "/eecs/etc/postdocs/" . $div . "postdocs.html?match=$match&view=$shortview"; foreach ($azRange as $letter) { $baseA = "/eecs/etc/postdocs/" . $div . "postdocs.html?match=$match&view=$shortview&alpha=$letter"; $flag = ''; foreach ($lnameT as $mletter) { if($letter == $mletter) { $flag = 1; } } if($flag) { print "$letter "; } else { print "$letter "; } } print "
\n"; print "

\n"; $alpha = $alpha1; if($alpha) { $sql .= " AND lastname RLIKE " . "\"^" . $alpha . "\" "; } $sql .= " ORDER BY person.lastname, person.firstname, person.middlename"; getresults($sql); ?>