header('Content-type: text/html; charset=utf-8'); require 'config.php'; require 'global_functions.php'; require 'dbi.php'; require 'app_controller.php'; error_reporting(DEBUG_MODE ? (E_ERROR | E_WARNING | E_PARSE) : 0); define('MSG_OFFLINE', 'Site-ul nostru nu este accesibil în acest moment. Ne cerem scuze şi vă rugăm să reveniţi mai târziu.'); mysql_connect(DB_HOST, DB_USER, DB_PASS) or exit(MSG_OFFLINE); mysql_select_db(DB_NAME) or exit(MSG_OFFLINE); mysql_query('SET NAMES "utf8"'); if (empty($_GET['c'])) $_GET['c'] = DEFAULT_CONTROLLER; if (empty($_GET['a'])) $_GET['a'] = DEFAULT_ACTION; $ctrl_class = ucfirst($_GET['c']) . 'Controller'; $ctrl_file = strtolower($_GET['c']) . '_controller.php'; if (!file_exists($ctrl_file)) { $ctrl = new AppController(); $ctrl->page_not_found(); } else { require $ctrl_file; $ctrl = new $ctrl_class(); $action = method_exists($ctrl, $_GET['a']) ? $_GET['a'] : 'page_not_found'; $ctrl->$act