|
\n";
}
}
function build_search_clause($keyword_str, $search_type) {
$retval = "1 = 0";
if($search_type == "abstitle") {
$keyword_arr = preg_split("/\s+/", $keyword_str);
if(count($keyword_arr) > 0) {
$retval = "";
foreach($keyword_arr as $kw) {
$retval = add_clause($retval, "UPPER(p.title || ' ' || p.abstract_text) LIKE UPPER('%$kw%')", " AND ");
}
}
}
else {
$keyword_arr = preg_split("/,/", $keyword_str);
if($search_type == "keywords") {
if(count($keyword_arr) > 0) {
$retval = "";
foreach($keyword_arr as $kw) {
$retval = add_clause($retval, "UPPER(pk.keywords) LIKE UPPER('%" . trim($kw) . "%')", " OR ");
}
}
}
else {
if(count($keyword_arr) > 0) {
$retval = "";
foreach($keyword_arr as $kw) {
$kw = trim($kw);
$name_parts = preg_split("/\s+/", $kw);
$last_name = "";
if(count($name_parts) > 1) {
$last_name = array_pop($name_parts);
$first_name = implode(" ", $name_parts);
}
else {
$first_name = array_pop($name_parts);
}
if(strlen($last_name) < 1) {
$last_name = $first_name;
$retval = add_clause($retval, "(UPPER(a.givenname) LIKE UPPER('%$first_name%') OR UPPER(a.familyname) LIKE UPPER('%$last_name%'))", " OR ");
explode_high_ascii($last_name);
}
else {
$retval = add_clause($retval, "(UPPER(a.givenname) LIKE UPPER('%$first_name%') AND UPPER(a.familyname) LIKE UPPER('%$last_name%'))", " OR ");
explode_high_ascii($last_name);
}
}
}
}
}
return "($retval)";
}
function process_results($resultarr) {
global $CONN;
$result_count = 0;
foreach($resultarr as $result) {
$ses_id = $result["ses_id"];
$paper_id = $result["paperid"];
$sesinfo["ses_id"] = $result["ses_id"];
$sesinfo["ses_room"] = $result["ses_room"];
$sesinfo["ses_type"] = $result["ses_type"];
$sesinfo["ses_title"] = $result["ses_title"];
$sesinfo["chair1"] = $result["chair1"];
$sesinfo["chair2"] = $result["chair2"];
$sesinfo["date"] = $result["date"];
$sesinfo["time"] = $result["time"];
$sesinfo["room"] = $result["room"];
$date = preg_replace('/\s+,/',',',$sesinfo["date"]);
$starttime = $sesinfo["time"];
list($hour,$min) = explode(":", $starttime);
$endhour = $hour+2;
$endtime = implode(":", array($endhour,$min));
$min_inc = 20;
$ses_no = $result["ses_no"];
$result_count++;
?>
" valign="top">
= $result["ses_title"]; ?>
|
" valign="top" width="15%">
Session: -
Date: = $result["abbr_date"]; ?>
= 60) {
$hour_add = (int)(($min+$min_add) / 60);
$min_add = -$min + ($min+$min_add) % 60;
}
$ptime = sprintf("%02d:%02d", $hour + $hour_add, $min + $min_add);
echo "Time: $ptime ";
}
else
echo "Time: $starttime - $endtime ";
?>
Room: = $sesinfo["room"]; ?>
Type: = ucfirst($result["ses_type"]); ?>
if(strtolower($result["ses_type"]) == "poster")
echo "Poster #: $result[ses_order] \n";
?>
.PDF">View paper
| ">
";
e($a_row["affiliation"]);
print " ";
}
?>
Keywords:
0) ? $result["keywords"] : "";
e($paper_keywords);
?>
|
}
if($result_count == 0) {
global $f_keywords;
global $f_abstitle;
global $f_authors;
$search = trim($f_keywords . " " . $f_abstitle . " " . $f_authors);
echo "No matches for \"$search\". ";
}
}
$f_keywords = isset($_GET["keywords"]) ? $_GET["keywords"] : "";
$f_abstitle = isset($_GET["abstitle"]) ? $_GET["abstitle"] : "";
$f_authors = isset($_GET["authors"]) ? $_GET["authors"] : "";
?>
INTERSPEECH 2006 PAPER SEARCH
|
if((isset($_GET["sub_keywords"]) && !empty($f_keywords)) || (isset($_GET["sub_abstitle"]) && !empty($f_abstitle)) || (isset($_GET["sub_authors"]) && !empty($f_authors))) {
global $CONN;
$search_terms = "";
$search_type = "";
if(isset($_GET["sub_keywords"])) {
$search_terms = $f_keywords;
$search_type = "keywords";
}
else {
if(isset($_GET["sub_abstitle"])) {
$search_terms = $f_abstitle;
$search_type = "abstitle";
}
else {
$search_terms = $f_authors;
$search_type = "authors";
}
}
$search_clause = build_search_clause($search_terms, $search_type);
$q = "SELECT DISTINCT p.*, pk.keywords, s.*, r.*,
to_char(s.ses_date, 'Day, Month DD, YYYY') AS date,
to_char(s.ses_date, 'Dy, Mon DD') AS abbr_date,
to_char(s.ses_time, 'HH24:MI') AS time,
r.name AS room
FROM paper_keywords pk
RIGHT JOIN papers p ON p.paperid = pk.paperid
JOIN sessions s ON p.ses_id = s.ses_id
JOIN authors a ON a.paperid = p.paperid
JOIN rooms r ON r.room_id = ses_room
WHERE p.status = 'Accepted' AND $search_clause
ORDER BY s.ses_date, s.ses_time, p.ses_order ";
echo "";
$results = dbQueryGet($q, $CONN);
?>
|
}
?>
|
|