$searchType = $_POST["searchType"]; $searchText = trim($_POST["searchText"]); # remove redundant whitespace $searchText = preg_replace('/\\s+/', " ", $searchText); #**************************************************************************** #* Search database #**************************************************************************** $sclQ = new SchoolQuery(); $sclQ->setItemsPerPage(OBIB_ITEMS_PER_PAGE); $sclQ->connect(); $sclQ->execSearch($searchType, $searchText, $currentPageNmbr); #************************************************************************** #* Show member view screen if only one result from barcode query #************************************************************************** if ($searchType == "schoolCode" && $sclQ->getRowCount() == 1) { $scl = $sclQ->fetchMember(); $sclQ->close(); header("Location: ../circ/scl_view.php?sclid=" . U($scl->getSchoolid()) . "&reset=Y"); exit; } #************************************************************************** #* Show search results #************************************************************************** require_once "../shared/header.php"; # Display no results message if no results returned from search. if ($sclQ->getRowCount() == 0) { $sclQ->close(); echo $loc->getText("sclsearchNoResults"); require_once "../shared/footer.php"; exit; }