// 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: ./library_search.php // Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/library_search.php $ // Author(s): Matthias Steffens // // Created: 29-Jul-02, 16:39 // Modified: $Date: 2008-11-05 21:54:22 +0000 (Wed, 05 Nov 2008) $ // $Author: msteffens $ // $Revision: 1297 $ // Search form providing the main fields. // Searches will be restricted to records belonging // to the IPOE library. // TODO: I18n // 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 // -------------------------------------------------------------------- // (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 = "Search the $hostInstitutionAbbrevName library:"; // 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) . " -- Library Search", "index,follow", "Search the " . encodeHTML($officialDatabaseName), "", false, "", $viewType, array()); showPageHeader($HeaderString); // (2b) Start
and holding the form elements: echo "\n"; echo "\n" . "\n"; echo "\n
" . "\n" . "\n\t\n\t\n\t\n\t\n\t" . "\n" . "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n"; echo "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n"; // (4) Complete the form: echo "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n\n\t\n\t\n\t\n\t\n\t" . "\n" . "\n" . "\n\t" . "\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t\n\t\n\t\n\t\n\t" . "\n" . "\n" . "\n\t\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n" . "\n\t\n\t\n\t" . "\n\t" . "\n\t" . "\n" . "\n
ShowField That...Search String
Author: \n\t\t\n\t
Title: \n\t\t\n\t
Year: \n\t\t\n\t
Editor: \n\t\t\n\t
Series:\n\t\t\n\t"; // (3) Run the query on the literature database through the connection: // (here by use of the 'selectDistinct' function) // Produce the select list // Parameters: // 1: Database connection // 2. Table that contains values // 3. The field name of the table's primary key // 4. Table name of the user data table // 5. The field name within the user data table that corresponds to the field in 3. // 6. The field name of the user ID field within the user data table // 7. The user ID of the currently logged in user (which must be provided as a session variable) // 8. Attribute that contains values // 9.
 or:\n\t\t\n\t
Volume: \n\t\t\n\t
Pages: \n\t\t\n\t
Publisher: \n\t\t\n\t
Place: \n\t\t\n\t
Signature: \n\t\t\n\t
Keywords: \n\t\t\n\t
Notes: \n\t\t\n\t
     
 Display Options:    Display LinksShow      records per page" . "              
     
 1st sort by: \n\t\t\n\t\n\t\t   ascending      " . "\n\t\t   descending\n\t
 2nd sort by: \n\t\t\n\t\n\t\t   ascending      " . "\n\t\t   descending\n\t
 3rd sort by: \n\t\t\n\t\n\t\t   ascending      " . "\n\t\t   descending\n\t
" . "\n
"; // (5) Close the database connection: disconnectFromMySQLDatabase(); // function 'disconnectFromMySQLDatabase()' is defined in 'include.inc.php' // -------------------------------------------------------------------- // DISPLAY THE HTML FOOTER: // call the 'showPageFooter()' and 'displayHTMLfoot()' functions (which are defined in 'footer.inc.php') showPageFooter($HeaderString); displayHTMLfoot(); // -------------------------------------------------------------------- ?>