$path = ""; if (!file_exists("bin/conf.php")) { $path = "../"; } require_once $path . "bin/conf.php"; require_once $path . "bin/functions.php"; require_once $path . "class/db.php"; require_once $path . "class/templ.php"; require_once $path . "class/user.php"; require_once $path . "class/operationreply.php"; require_once $path . "class/message.php"; // --- TMPLATE $template = new template_class(); $template->rootpath = ROOTPATH; // --- db $db = new DB_class(); if (isset($_POST)) { foreach ($_POST as $key => $value) { $_POST[$key] = $db->filter($value); } } //--- user $user = new user_class(); //--- user $message = new message_class(); // --- Get user details $query = 'SELECT id, name, email, status FROM user WHERE sessid LIKE "' . session_id() . '"'; if ($db->num_rows($query) > 0) { list($USER['id'], $USER['name'], $USER['email'], $USER['status']) = $db->get_row($query); $template->username = $USER['name']; $template->userid = $USER['id'];
/** * Singleton function * * Example usage: * $database = DB::getInstance(); * * @access private * @return self */ static function getInstance() { if (self::$inst == null) { self::$inst = new DB(); } return self::$inst; }