exec("SELECT * FROM mission WHERE groupName='espresso'"); echo "
MISSION STATEMENT
" .$result_mission[0]->missionStatement. "
 

\"Espresso
The Espresso Research Model  (Click to zoom in)
"; } function obfuscate($orig) { $obfus = ''; for ($i = 0; $i < strlen($orig); $i++) { $obfus .= '&#' . ord($orig{$i}) . ';'; } return $obfus; } function email_link($email) { return ''.obfuscate($email).''; } //=================================================================== // DISPLAY_GROUP_MEMBERS //=================================================================== function display_group_members($int_ext) { /* Receives the button name as a parameter. Gets the link Name from the links database * to display on top of the page. Gets the key from the links database and uses it to * search the members database. */ global $sql, $img_dir; $result_title = $sql->exec("SELECT * FROM links WHERE button='$int_ext'"); $int_ext = $result_title[0]->keyField; $result_members = $sql->exec("SELECT * FROM members WHERE intExtMember='$int_ext' ORDER BY mid ASC"); insert_page_header($result_title[0]->linkName); if (sizeof($result_members) != 0) { for ($i = 0; $i < sizeof($result_members); $i++) { echo "
 
"; if ($result_members[$i]->picName == "") $img_src = "default.jpg"; else $img_src = $result_members[$i]->picName; echo " Name ".$result_members[$i]->title." ".$result_members[$i]->firstName." ".$result_members[$i]->lastName."
Field Title ".$result_members[$i]->fieldTitle."
Degree Obtained ".$result_members[$i]->degreeObtained."
Current Degree ".$result_members[$i]->degreeCurrent."
email ".email_link($result_members[$i]->email)."
\n"; if(strlen($result_members[$i]->abstract) > 0) { echo "
mid."')\">(show/hide) Abstract
mid."_0\" COLSPAN=\"3\" STYLE=\"display:".(($int_ext !== "internal")?"none":"").";\"> ".$result_members[$i]->abstract."

"; }else{ echo "
\n"; } } } } function display_polls(){ if ($_GET["espresso_soft"] != "true"){ $return_path = "http://espresso.cs.up.ac.za/main.php"; }else{ $return_path = "http://www.espresso-soft.org/main.php"; } ?>
Polls

The following polls are currently active or have closed within the last month:
    = TO_DAYS('".date('Y-m-d')."') as isActive, SUM(poll_publications.votes) as totalVotes, MAX(poll_publications.votes) as maxVotes FROM poll_publications LEFT JOIN polls ON (polls.id=poll_publications.poll_ref ) WHERE TO_DAYS(startDate) <= TO_DAYS('".date('Y-m-d')."') AND TO_DAYS(endDate) >= TO_DAYS('".date('Y-m-d',strtotime('1 month ago'))."') AND id IS NOT NULL GROUP BY poll_ref"; $rs = mysql_query($sql); if (mysql_num_rows($rs) == 0){ echo "There are currently no active polls"; }else while ($row = mysql_fetch_array($rs)){ echo "
  • ".$row["title"]." (running from ".$row["startDate"]." to ".$row["endDate"].")
  • "; } ?>



[ Show Abstract ]
0 %
This poll has closed.
You have all ready voted in this poll.

exec("SELECT * FROM projects WHERE alias='$proj_name'"); insert_page_header("Projects"); echo "
 
Project Title " .$result_projects[0]->title. "
Project Members " .$result_projects[0]->members. "
Abstract
" .$result_projects[0]->abstract. "
"; } //=================================================================== // DISPLAY_PUBLICATIONS //=================================================================== function display_publications() { /* Displays all the publications. */ global $sql, $pub_dir; $result_publications = $sql->exec("SELECT publications.*, publications_types.description FROM publications LEFT JOIN publications_types ON publications.type=publications_types.pid ORDER BY date DESC"); insert_page_header("Publications"); for ($i = 0; $i < sizeof($result_publications); $i++) { echo " "; if ($result_publications[$i]->reference != "") { echo ""; } if(strlen($result_publications[$i]->abstract) > 0) { echo "
"; if($result_publications[$i]->fileName != NULL) { echo " fileName."\"> download "; } else { echo " "; } echo "
" .$result_publications[$i]->title. "
" .$result_publications[$i]->author."
".date("Y",strtotime($result_publications[$i]->date))." - ".$result_publications[$i]->description. "
" .$result_publications[$i]->reference. "
pid."')\"> (show/hide) Abstract
pid."_0\" STYLE=\"display:none;\">" .$result_publications[$i]->abstract. "

"; }else { echo "\n
\n"; } } } //=================================================================== // DISPLAY_COLLABORATIONS //=================================================================== function display_collaborations() { insert_page_header("Collaborations"); } //=================================================================== // DISPLAY_ORGANIZATIONAL_CHART //=================================================================== function display_organizational_chart() { /* displays the organizational chart. */ global $files_dir; $filename = "interactions.pdf"; insert_page_header("Organizational Chart"); echo "
  download
"; } //=================================================================== // INSERT_PAGE_HEADER //=================================================================== function insert_page_header($heading) { /* Displays the page header on top of the page. */ echo "
$heading

"; } //=================================================================== // DISPLAY_NEWS //=================================================================== function display_news() { /* Displays all the news. */ global $sql, $pub_dir; $result_news = $sql->exec("SELECT * FROM news ORDER BY date DESC"); insert_page_header("News"); for ($i = 0; $i < sizeof($result_news); $i++) { echo "
".$result_news[$i]->date."   ".$result_news[$i]->title."
" .$result_news[$i]->message. "

"; } } function display_project_proposals(){ $sql = "SELECT * FROM project_proposals WHERE active=1 ORDER BY subject_code desc"; $rs = mysql_query($sql); echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "
Project Proposals
\n"; while($row = mysql_fetch_array($rs)){ echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "
".$row["subject_code"]."
\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
Research Question".$row["question"]."
Abstract".$row["abstract"]."
Outcomes\n"; echo $row["outcomes"]; echo "
Skills required".$row["skills"]."

\n"; } } function display_associate_members($int_ext) { /* Receives the button name as a parameter. Gets the link Name from the links database * to display on top of the page. Gets the key from the links database and uses it to * search the members database. */ global $sql, $img_dir; $result_title = $sql->exec("SELECT * FROM links WHERE button='$int_ext'"); $int_ext = $result_title[0]->keyField; $result_members = $sql->exec("SELECT * FROM members WHERE intExtMember='$int_ext' ORDER BY mid ASC"); insert_page_header($result_title[0]->linkName); if (sizeof($result_members) != 0) { for ($i = 0; $i < sizeof($result_members); $i++) { echo " "; } else { echo ""; } echo "
".$result_members[$i]->title." ".$result_members[$i]->firstName." ".$result_members[$i]->lastName." "; if(strlen($result_members[$i]->abstract) > 0) { echo "mid."')\">(show/hide) Abstract
mid."_0\" COLSPAN=\"2\" STYLE=\"colspan:2;display:;\"> ".$result_members[$i]->abstract."

"; } } } //=================================================================== // MAIN //=================================================================== /* Entry point. * Determines which button is pressed and calls the appropriate * function. */ global $sql; require_once("sql_conn.php"); $btn = $_GET['button']; echo " "; SWITCH ($btn) { CASE "home" : display_home_page();break; CASE "supervisors" : display_group_members($btn);break; CASE "internal_members" : display_group_members($btn);break; CASE "external_members" : display_associate_members($btn);break; CASE "alumni" : display_group_members($btn);break; CASE "spare_time" : display_projects($btn);break; CASE "new_taxonomy" : display_projects($btn);break; CASE "poll": display_polls();break; CASE "publications" : display_publications();break; CASE "project_proposals" : display_project_proposals();break; CASE "collaborations" : display_collaborations();break; CASE "chart" : display_organizational_chart();break; CASE "news" : display_news();break; default : display_home_page();break; } echo " "; ?>