<?
# searchAlbums.php
#
# Searchs the database and displays Albums instead of every song
#
$phpgw_info["flags"] = array ("currentapp" => "musiclib",
"enable_nextmatchs_class" => True);
$GLOBALS['phpgw_info']['cursor_focus'] = "document.defaultsearch.searchFor.focus();document.defaultsearch.searchFor.select();";
include ("../header.inc.php"); #PHP Groupware header
include ("inc/config.inc.php");
include ("inc/functions.inc.php");
include ("inc/sidebar.inc.php");
$title = "Search Results";
include ("inc/header.inc.php");
# This truncates strings containing an apostrophee so that mysql doesn't choke
# Please report if any other special characters cause trouble
$searchFor = stripslashes($searchFor);
unset ($pos);
if (substr_count($searchFor,"'") > 0) {$pos = strpos($searchFor,"'");}
if (isset($pos)) {$searchFor = substr($searchFor,0,$pos);}
if ($action=="doSearch")
{
echo "<BR><b>Following Albums found containing \"$searchFor\"...</b><BR><BR>";
$kweerie="SELECT * FROM ".$musiclib['tables']['albums']
." WHERE artist LIKE '%$searchFor%'
OR songtitle LIKE '%$searchFor%'
OR album LIKE '%$searchFor%'
ORDER BY artist, album";
listAlbums ($kweerie, "nee", "ja");
}
include("inc/footer.inc.php");
?>