Hakim Weatherspoon

Publications


$year \n"; $query = "SELECT * FROM Publications WHERE year=$year ORDER BY year DESC, month DESC"; $q2 = mysql_query($query) or die('Error, selection failed'); printPapers($q2); echo "
\n"; } } function printByType($q) { while($row = mysql_fetch_array($q)) { $type = $row['Type']; printType($type); $query = "SELECT * FROM Publications WHERE type=$type ORDER BY year DESC, month DESC"; $q2 = mysql_query($query) or die('Error, selection failed'); printPapers($q2); echo "
\n"; } } function printByProject($q) { while($row = mysql_fetch_array($q)) { $category=$row['Name']; $subarea=$row['Subareas']; echo "

$category

\n"; if ($subarea != '') { $tok = strtok($subarea, ","); while( $tok !== false) { echo "

   $tok

\n"; printPapersByProject(trim($tok)); $tok = strtok(","); } } else printPapersByProject($category); echo "
"; // $prj = $row['Project']; // echo "

$prj

"; // $query = "SELECT * FROM Publications WHERE Project='$prj' ORDER BY Title"; // $q2 = mysql_query($query) or die('Error, selection failed'); // printPapers($q2); // echo "
\n"; } } function printPapersByProject($category) { $query = "SELECT * FROM Projects, Publications WHERE Projects.Name = Publications.Project AND Projects.Category='$category' ORDER BY Publications.Year DESC"; $q = mysql_query($query) or die('Error, selection failed'); printPapers($q); } function printPapers($q) { echo ""; } function printType($p) { if($p == 1) echo "

Journal Papers

\n"; else if($p == 2) echo "

Referred Papers

\n"; else if($p == 3) echo "

Technical Report

\n"; else if($p == 4) echo "

Thesis

\n"; } function genQuery($r) { switch ($r) { case 0: return "SELECT DISTINCT year FROM Publications ORDER BY year DESC"; case 1: return "SELECT * FROM Publications ORDER BY Title"; case 2: return "SELECT DISTINCT Type FROM Publications ORDER BY Type, year DESC"; case 3: // return "SELECT DISTINCT Project FROM Publications WHERE Project IS NOT NULL ORDER BY Year DESC, Project"; return "SELECT * FROM ResearchArea where Active=1 order by ord"; default: exit(); } } ?>