// Copyright: Matthias Steffens and the file's // original author(s). // // This code is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY. Please see the GNU General Public // License for more details. // // File: ./advanced_search.php // Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/advanced_search.php $ // Author(s): Matthias Steffens // // Created: 29-Jul-02, 16:39 // Modified: $Date: 2013-09-25 13:52:53 +0000 (Wed, 25 Sep 2013) $ // $Author: pnault $ // $Revision: 1380 $ // Search form providing access to all fields of the database. // It offers some output options (like how many records to display per page) // and let's you specify the output sort order (up to three levels deep). // Incorporate some include files: include 'initialize/db.inc.php'; // 'db.inc.php' is included to hide username and password include 'includes/header.inc.php'; // include header include 'includes/footer.inc.php'; // include footer include 'includes/include.inc.php'; // include common functions include 'initialize/ini.inc.php'; // include common variables // -------------------------------------------------------------------- // START A SESSION: // call the 'start_session()' function (from 'include.inc.php') which will also read out available session variables: start_session(true); // -------------------------------------------------------------------- // Initialize preferred display language: // (note that 'locales.inc.php' has to be included *after* the call to the 'start_session()' function) include 'includes/locales.inc.php'; // include the locales // -------------------------------------------------------------------- if (!isset($_SESSION['loginEmail'])) // if NO user is logged in $loginUserID = ""; // set '$loginUserID' to "" so that 'selectDistinct()' function can be executed without problems // -------------------------------------------------------------------- // (1) Open the database connection and use the literature database: connectToMySQLDatabase(); // function 'connectToMySQLDatabase()' is defined in 'include.inc.php' // If there's no stored message available: if (!isset($_SESSION['HeaderString'])) $HeaderString = $loc["SearchAll"].":"; // Provide the default message else { $HeaderString = $_SESSION['HeaderString']; // extract 'HeaderString' session variable (only necessary if register globals is OFF!) // Note: though we clear the session variable, the current message is still available to this script via '$HeaderString': deleteSessionVariable("HeaderString"); // function 'deleteSessionVariable()' is defined in 'include.inc.php' } // Extract the view type requested by the user (either 'Mobile', 'Print', 'Web' or ''): // ('' will produce the default 'Web' output style) if (isset($_REQUEST['viewType'])) $viewType = $_REQUEST['viewType']; else $viewType = ""; // Get the default number of records per page preferred by the current user: $showRows = $_SESSION['userRecordsPerPage']; // Get the user's preference for displaying auto-completions: $showAutoCompletions = $_SESSION['userAutoCompletions']; // Show the login status: showLogin(); // (function 'showLogin()' is defined in 'include.inc.php') // (2a) Display header: // call the 'displayHTMLhead()' and 'showPageHeader()' functions (which are defined in 'header.inc.php'): displayHTMLhead(encodeHTML($officialDatabaseName) . " -- " . $loc["AdvancedSearch"], "index,follow", "Search the " . encodeHTML($officialDatabaseName), "", false, "", $viewType, array()); showPageHeader($HeaderString); // Define variables holding common drop-down elements, i.e. build properly formatted