$keyword = $_POST['search_keyword']; $jobResult = dbSelect(JOB_TABLE, "WHERE job_title LIKE '%" . $keyword . "%' or job_keyword LIKE '%" . $keyword . "%' or job_description LIKE '%" . $keyword . "%'"); $num_rows = mysql_num_rows($jobResult); if ($num_rows == 0) { echoNoResult(); } else { echoDiv($jobResult); } } else { if (strrpos($location, "jobPortal.php")) { $jobResult = dbSelect(JOB_TABLE, "ORDER BY job_id DESC"); $num_rows = mysql_num_rows($jobResult); if ($num_rows == 0) { echoNoResult(); } else { echoDiv($jobResult); } } } function echoDiv($jobResult) { echo "<div class=\"jobList\">\r\n <table class=\"jobTable\" style=\"width:100%;\">\r\n <tr class=\"tableLabel\">\r\n <td class=\"jobTitle\">POSITION</td>\r\n <td class=\"jobCompany\">COMPANY</td>\r\n <td class=\"jobDescription\">DESCRIPTION</td>\r\n <td class=\"jobStatus\">CLOSE DATE</td>\r\n </tr>"; $count = 0; while ($row = mysql_fetch_assoc($jobResult)) { $today = date("Y-m-d"); $today = intval(str_replace('-', '', $today)); $dueDate = intval(str_replace('-', '', $row['job_duedate'])); if ($today <= $dueDate) { if ($count % 2 == 0) { // oddLine echo "<tr class=\"jobEntry oddLine\">";
function getVIVOPersonData($search) { include_once "arc2/ARC2.php"; $identifier = getURI($search); $personURI = $search; //What's the VIVO URI for this person? $site = getSite($search); $personRDF = "http://" . $site . "/individual/" . $identifier . "/" . $identifier . ".rdf"; //Where is the raw RDF? $personSubject = "http://" . $site . "/individual/" . $identifier; $parser = ARC2::getRDFParser(); $parser->parse($personRDF); $index = $parser->getSimpleIndex(); //Get the person's name, this should be checking for foaf:firstName, but it doesn't exist anywhere I've seen. //First, let's try for an active directory name. This only exists on the UF VIVO ontology extension $personName = $index[$personSubject]["http://vivo.ufl.edu/ontology/vivo-ufl/activeDirName"][0]; //If we don't find it.. if (strlen($personName) < 1) { //Fallback to rdfs:label $personName = $index[$personSubject]["http://www.w3.org/2000/01/rdf-schema#label"][0]; } //End getting person's name //Get person's title //Try the default location $position = $index[$personSubject]["http://vivoweb.org/ontology/core#preferredTitle"][0]; // echo "Preferred Title of: ".$position."<br>"; //We're going to set the initial position URL here so we can use it later $positionURL = $index[$personSubject]["http://vivoweb.org/ontology/core#personInPosition"][0]; $positionIdentifier = getURI($positionURL); $positionRDF = "http://" . $site . "/individual/" . $positionIdentifier . "/" . $positionIdentifier . ".rdf"; $positionSubject = "http://" . $site . "/individual/" . $positionIdentifier; //If we don't find it there, try in the position //First, we need to find out which is their current position //To do that, we need to loop through all of their positions $round = 0; $startYear = 0; if (strlen($index[$personSubject]["http://vivoweb.org/ontology/core#personInPosition"]) > 0) { foreach ($index[$personSubject]["http://vivoweb.org/ontology/core#personInPosition"] as $value) { $positionURL = $index[$personSubject]["http://vivoweb.org/ontology/core#personInPosition"][$round]; // echo "Current highest year is ".$startYear." For position ".$positionURL."<br>"; $positionIdentifier = getURI($positionURL); $positionRDF = "http://" . $site . "/individual/" . $positionIdentifier . "/" . $positionIdentifier . ".rdf"; $positionSubject = "http://" . $site . "/individual/" . $positionIdentifier; $startParser = ARC2::getRDFParser(); $startParser->parse($positionRDF); $startIndex = $startParser->getSimpleIndex(); // print_r($startIndex); $newYear = $startIndex[$positionSubject]["http://vivoweb.org/ontology/core#startYear"][0]; // echo "Start year for that position is:".$newYear."<br>"; if ($newYear > $startYear) { $startYear = $newYear; $positionURLFinal = $positionURL; } // echo "Current final URL is ".$positionURLFinal."<br>"; $round = $round + 1; } } // echo "Newest position is: ".$positionURLFinal.". With a start year of ".$startYear; //Then let the next bit of code run if (strlen($position) < 1) { // echo "Trying to pull position data from ".$positionURLFinal."<br>"; // $positionURL = $index[$personSubject]["http://vivoweb.org/ontology/core#personInPosition"][0]; if (isURLValid($positionURLFinal)) { // echo "URL was Valid<br>"; $positionParser = ARC2::getRDFParser(); $positionIdentifier = getURI($positionURLFinal); $positionRDF = "http://" . $site . "/individual/" . $positionIdentifier . "/" . $positionIdentifier . ".rdf"; $positionSubject = "http://" . $site . "/individual/" . $positionIdentifier; $positionParser->parse($positionRDF); $positionIndex = $positionParser->getSimpleIndex(); //Let's check for an HR job title first $position = $positionIndex[$positionSubject]["http://vivoweb.org/ontology/core#hrJobTitle"][0]; //If we don't find one if (strlen($position) < 1) { //Fallback to the label $position = $positionIndex[$positionSubject]["http://www.w3.org/2000/01/rdf-schema#label"][0]; } } else { //If the first position link is bad, try the second one. $positionURL = $index[$personSubject]["http://vivoweb.org/ontology/core#personInPosition"][1]; $positionIdentifier = getURI($positionURL); $positionRDF = "http://" . $site . "/individual/" . $positionIdentifier . "/" . $positionIdentifier . ".rdf"; $positionSubject = "http://" . $site . "/individual/" . $positionIdentifier; $positionParser = ARC2::getRDFParser(); $positionParser->parse($positionRDF); $positionIndex = $positionParser->getSimpleIndex(); //Let's check for an HR job title first $position = $positionIndex[$positionSubject]["http://vivoweb.org/ontology/core#hrJobTitle"][0]; //If we don't find one if (strlen($position) < 1) { //Fallback to the label $position = $positionIndex[$positionSubject]["http://www.w3.org/2000/01/rdf-schema#label"][0]; } } } //End getting title //Begin getting Email $personEmail = $index[$personSubject]["http://vivoweb.org/ontology/core#workEmail"][0]; //End getting email //Begin getting phone $personPhone = $index[$personSubject]["http://vivoweb.org/ontology/core#workPhone"][0]; //End Getting phone //Begin getting Fax $personFax = $index[$personSubject]["http://vivoweb.org/ontology/core#workFax"][0]; //End Getting Fax //Begin getting department $positionParser = ARC2::getRDFParser(); $positionIdentifier = getURI($positionURLFinal); $positionRDF = "http://" . $site . "/individual/" . $positionIdentifier . "/" . $positionIdentifier . ".rdf"; $positionParser->parse($positionRDF); $positionIndex = $positionParser->getSimpleIndex(); $positionSubject = "http://" . $site . "/individual/" . $positionIdentifier; $departmentURL = $positionIndex[$positionSubject]["http://vivoweb.org/ontology/core#positionInOrganization"][0]; $departmentIdentifier = getURI($departmentURL); $departmentRDF = "http://" . $site . "/individual/" . $departmentIdentifier . "/" . $departmentIdentifier . ".rdf"; $departmentSubject = "http://" . $site . "/individual/" . $departmentIdentifier; $departmentParser = ARC2::getRDFParser(); $departmentParser->parse($departmentRDF); $departmentIndex = $departmentParser->getSimpleIndex(); $department = $departmentIndex[$departmentSubject]["http://www.w3.org/2000/01/rdf-schema#label"][0]; //End getting department //Begin getting image //End getting image $imageURL = $index[$personSubject]["http://vitro.mannlib.cornell.edu/ns/vitro/public#mainImage"][0]; $imageIdentifier = getURI($imageURL); $imageRDF = "http://" . $site . "/individual/" . $imageIdentifier . "/" . $imageIdentifier . ".rdf"; $imageSubject = "http://" . $site . "/individual/" . $imageIdentifier; $imageParser = ARC2::getRDFParser(); $imageParser->parse($imageRDF); $imageIndex = $imageParser->getSimpleIndex(); $filename = $imageIndex[$imageSubject]["http://vitro.mannlib.cornell.edu/ns/vitro/public#filename"][0]; $downloadLocation = $imageIndex[$imageSubject]["http://vitro.mannlib.cornell.edu/ns/vitro/public#downloadLocation"][0]; $fullsizeURI = getURI($downloadLocation); $fullsizeURL = "http://" . $site . "/file/" . $fullsizeURI . "/" . $filename; //End getting image $vivoName = strip_tags($personName); $vivoTitle = strip_tags($position); $vivoEmail = strip_tags($personEmail); $vivoLink = strip_tags($personURI); $vivoPhone = strip_tags($personPhone); $vivoFax = strip_tags($personFax); $vivoDepartment = strip_tags($department); $vivoImage = strip_tags($fullsizeURL); //Now let's output the data. echo "<div id=\"vivoPerson\">\n"; if (strlen($imageURL) > 0) { echoImageDiv("vivoImage", $vivoImage, $vivoName); } else { echoImageDiv("vivoImage", "noimage.jpg", $vivoName); } echoDiv("vivoName", $vivoName); //Done echoDiv("vivoTitle", $vivoTitle); //Done echoDiv("vivoDepartment", $vivoDepartment); echoDiv("vivoPhone", $vivoPhone); //Done echoDiv("vivoFax", $vivoFax); //Done echoEmailDiv("vivoEmail", $vivoEmail); //Done echoLinkDiv("vivoLink", $vivoLink); //Done echo "</div>"; //TODO: Write a method to clear up some of that repetitive code }