public function showPage($selected = '') { if (!FUTURI_Session::isUserAdmin()) { $this->load->view("nopermission_admin"); } $this->load->view("admin_header", array('selected' => $selected)); switch ($selected) { case "usuarios": include "application/controllers/User.php"; define_constants(); $userController = new User(); $userController->showListPage('', 10, false); break; case "estatisticas": break; case "backups": include "application/controllers/Backup.php"; define_constants(); $backupController = new Backup(); $backupController->showListPage('', 10, false); break; case "configs": $this->load->view("admin_configs", array("object_handler" => $this)); break; case "relatorios": include "application/controllers/Report.php"; define_constants(); $reportController = new Report(); $reportController->showListPage('', 10, false); break; case "graficos": include "application/controllers/Chart.php"; define_constants(); $chartController = new Chart(); $chartController->showListPage('', 10, false); break; } }
function define_class($class) { global $output, $net; $name = $class['name']; $desc = idx_string($class, 'desc'); if ((empty($desc) || $net == 1) && $net != -1) { $desc = phpnet_get_class_desc($name); } $output .= "////////////////////////////////////////" . "///////////////////////////////////////\n\n"; begin_function('BeginClass'); begin_array(); out_str('name', $name, true); out_str('parent', $class['parent']); out_fmt('ifaces', idx_array($class, 'ifaces')); out_fmt('bases', idx_array($class, 'bases')); out_str('desc', $desc); out_fmt('flags', idx_flags($class, 'flags', false)); out_str('note', idx_string($class, 'note')); out_doc('footer', idx_string($class, 'footer')); end_array(false); end_function(); define_constants($class['consts']); foreach ($class['methods'] as $func) { define_function($func, $name); } define_properties($class['properties']); begin_function('EndClass'); end_function(); }
define("ERROR_USERNAME_MISSING", "missing username"); define("ERROR_PASSWORD_MISSING", "missing password"); define("ERROR_HTTP_ERROR", "HTTP error"); define("ERROR_SOCKET_ERROR", "connection error"); define("ERROR_SOCKET_TIMEOUT", "connection timed out"); define("ERROR_SOCKET_EOF", "remote server disconnected (EOF)"); define("ERROR_CONNECT_RETRY_TOP", "maximum backoff time reached"); define("ERROR_CONNECT_RETRY", "connection error, waiting for reconnect"); define("ERROR_DNS_HOST_NOT_FOUND", "host not found"); define("ERROR_OUT_OF_TIME", "maximum execution time reached"); define("ERROR_OUT_OF_TWEETS", "maximum tweet count reached"); // verbosity (for debugging) define("SCRIPT_VERBOSITY", 0); // Define non-configurable constants // (constant definitions can be found at the end of the script) define_constants(); //----------------------------------------------------------------------------// // Exception & Error Handlers //----------------------------------------------------------------------------// function exception_handler($objException) { switch (get_class($objException)) { case "OptionHelpException": error_log(SCRIPT_HELP); die(0); break; case "OptionMissingException": error_log(SCRIPT_NAME . ": " . $objException->getMessage() . "\n" . "Try '" . SCRIPT_NAME . " --help' for more information."); break; case "NetworkRetryException": error_log(SCRIPT_NAME . " reached the maximum retry limit while" . " trying to reconnect after a connection error : (" . $objException->getCode() . ") " . $objException->getMessage());