SSG Publications


Search

Order publications by within the years to .
Containing in author(s) and in title or abstract.
'); $orderby = $_POST["orderby"]; $yearMin = $_POST["yearMin"]; $yearMax = $_POST["yearMax"]; $findAuth = $_POST["findAuth"]; $findTitle = $_POST["findTitle"]; echo "


"; if (!$orderby || $orderby == "method") { $orderby = "author";} if (!$yearMin || $yearMin == "") $yearMin = "0000"; if (!$yearMax || $yearMax == "") $yearMax = date("Y"); if ($yearMin > $yearMax) {$tmp=$yearMin; $yearMin=$yearMax; $yearMax=$tmp; } if ($findAuth.$findTitle != "") { echo "You searched for"; if ($findAuth != "") echo " Author=\"$findAuth\""; if ($findTitle!= "") echo " Title=\"$findTitle\""; echo ".
"; } echo "Entries are ordered by $orderby, from years $yearMin to $yearMax. "; $db_link = mysql_connect("localhost", "nobody", "shinji") OR DIE("ERROR CONNECTING TO MySQL-SERVER!!!"); $sqlFind = ""; // default: find all $sqlFind = "WHERE ((authors LIKE '%$findAuth%' ) && ((title LIKE '%$findTitle%' ) || (abstract LIKE '%$findTitle%' )) && (date >= '$yearMin-00-00') && (date <= '$yearMax-12-31') )"; if ($orderby == 'date') { $sqlOrder = "ORDER BY date DESC"; } elseif ($orderby == 'author') { $sqlOrder = "ORDER BY authors"; } elseif ($orderby == 'title') { $sqlOrder = "ORDER BY title"; } $sql = "SELECT * FROM pubs ".$sqlFind." ".$sqlOrder; $result = mysql_db_query("SSG", $sql, $db_link); $nrows = mysql_num_rows($result); echo " $nrows entries matching; $nrows displayed.\n"; echo ""; while ($row = mysql_fetch_array($result)) { echo ""; } echo "
"; printPaper($row); echo " "; if (isEditable($row)) renderButton("Edit","/private/pub_edit.php?pub=".$row["pubID"]); echo "
"; include '../nav.inc'; ?>