EECS
EECS
\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 = sanitize($match); $match = preg_replace("/[^a-zA-Z_-]/", "", $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); $resno = isset($_GET['resno']) ? $_GET['resno'] : 0; $resno = preg_replace("/[^0-9]/", "", $resno); $resno = sanitize($resno); //SQLS $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 "; //Get Postdocs by uniqname if($uniqname) { $sql = $allfac_sql . "WHERE person.uniqname = " . "\"" . $uniqname . "\" "; $pagetitle = "$div Postdocs Profiles"; } //Main page list if(!$match && !$uniqname) { $sql = $allfac_sql . "WHERE status.status_type = \"Postdoc\" "; $pagetitle = "All $div Postdocs"; } //Get postdocs by type if($match == "All") { $sql = $allfac_sql . "WHERE status.status_type = \"Postdoc\" "; $pagetitle = "All $div Postdocs"; } /* Deprecated //Convert resno to unit value $id2unit = array( "1" => "ae", "2" => "ai", "5" => "comm", "52" => "celab", "55" => "celab", "10" => "systems", "47" => "power", "44" => "vlsi", "19" => "interactive_sys", "20" => "mems", "26" => "optics", "46" => "mipse", "48" => "power", "31" => "cuos", "45" => "robotics", "59" => "robotics", "36" => "sigproc", "53" => "ssrl", "54" => "ssrl", "56" => "ssrl", "57" => "ssrl", "38" => "ssel", "40" => "theory"); //Missing: 49,58,51,50 */ //Search by Research Area $RESareas = array( "1" => "Applied Electromagnetics and RF Circuits", "2" => "Artificial Intelligence", "55" => "Chip Design, Architecture, and Emerging Devices", "5" => "Network, Communication, and Information Systems", "49" => "Computer Vision", "10" => "Control Systems", "56" => "Databases and Data Mining", "58" => "Embedded and Mobile Systems", "51" => "Embedded Systems", "47" => "Energy Science and Engineering", "50" => "Engineering Education Research", "19" => "Human-Computer Interaction", "44" => "Integrated Circuits and VLSI", "54" => "Languages, Compilers, and Runtime Systems", "20" => "MEMS and Microsystems", "57" => "Networking, Operating Systems,and Distributed Systems", "26" => "Optics and Photonics", "46" => "Plasma Science and Engineering", "48" => "Power and Energy", "31" => "Quantum Science and Technology", "45" => "Robotics and Autonomous Systems", "59" => "Robotics in CSE", "53" => "Secure, Trustworthy, and Reliable Systems", "36" => "Signal & Image Processing and Machine Learning", "38" => "Solid-State Devices and Nanotechnology", "40" => "Theory of Computation", "52" => "Warehouse-Scale and Parallel Systems"); /* Deprecated //Units and research tables searched if($resno) { foreach($RESareas as $r_num => $r_name) { $this_unit = $id2unit[$resno]; if($resno == $r_num) { $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 " . "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 = $r_num OR unit.unit_name = \"$this_unit\") "; $pagetitle = "$r_name Postdocs"; break; } } } */ //Search by research table only if($resno) { foreach($RESareas as $r_num => $r_name) { if($resno == $r_num) { $sql = "SELECT * FROM person " . "INNER JOIN location ON person.person_id=location.person_id " . "INNER JOIN area2 ON person.person_id=area2.person_id " . "INNER JOIN status ON person.person_id=status.person_id " . "INNER JOIN division ON person.person_id=division.person_id " . "WHERE status.status_type = \"Postdoc\" " . "AND area2.research_id = " . $r_num . " "; $pagetitle = "$r_name Postdocs"; break; } } } //No SQL found? if($sql == '') { //$location = "/eecs/etc/postdocs/" . $div . "postdocs.html"; //header("Location: $location"); exit; printerr("Sorry - no records found."); } 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&resno=$resno&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"; //printerr($sql); getresults($sql); ?>