Location: PHPKode > projects > GPDE > gpde_1.1.4/gpde/simple_search/module-simple_search.php
<?php
/*
	GPDE (Griss Proteomics Database Engine) 
	>> A biological view on PRIDE
    Copyright (C) 2008, 2009  Johannes Griss - hide@address.com

    This file is part of GPDE.
    For license see notice in /LICENSE.txt and <http://www.griss.co.at/?gpde:License>.
*/

	require_once("config.php");
	require("module.php");
	require("backend_visual". DIRECTORY_SEPARATOR ."database_search.php");
	
	class Module_simple_search extends Module {
		private $_template;
		
		function __construct() {
			$this->_template = "simple_search". DIRECTORY_SEPARATOR ."module-simple_search.template";
		}
		
		function render() {
			// check if the database if online
			if ($this->DbIsOffline()) {
				$this->SendOfflineMessage();
			}
			else {
				$db = new Protdb_search();
				
				// connect to the database
				if (!$db->Connect(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT, DB_SOCKET) ) {
					$this->Send500();
					return;
				}
				
				// get the statistics as well as the news
				$statistics = $db->GetStatistics();
				
				// get the customizations
				$news = $db->GetCustomizations(CUSTOM_NEWS);
				$header = $db->GetCustomizations(CUSTOM_HEADER);
				
				// make sure the query was successfull
				if (!$statistics) {
					$this->Send500();
					return;
				}
				
				require_once($this->_template);
			}
		}
	}
?>
Return current item: GPDE