public function getUser($c, $p) { $data = array(); if (empty($p["id"])) { $temp = Router::exec("/ip/hotspot/user/getall"); foreach ($temp as $r) { if ($r[".id"] != "*0") { $data[] = $r; } } } else { if ($p["query"]) { $data = array(); if ($p["isAdmin"] == "false") { $rows = g::db()->getRows("SELECT * FROM `authenuser` WHERE `u_id` = ? ORDER by `a_id` DESC limit {$p['limit_mac']} ", array($p['id'])); /* $data[] = $data.push($xxxx); */ foreach ($rows as $r) { //$c->log($r["authen_user"]); $tmp = Router::comm("/ip/hotspot/user/print", array("?name" => $r["authen_user"]), false); if (!empty($tmp)) { foreach ($tmp as $trow) { $trow["a_id"] = $r["a_id"]; $trow["_name"] = $trow["name"]; $data[] = $trow; } } } Router::disconnect(); } else { if ($p["isAdmin"] == "true") { $c->log("4"); $data = g::db()->getRows("SELECT * FROM `authenuser` "); Router::open(); $data = Router::comm("/ip/hotspot/user/getall"); } } } else { //edit $data = Router::comm("/ip/hotspot/user/print", array("?.id" => "*" . $p["id"])); } } if ($data != null) { //$c->log($data); $c->data(array("rows" => $data)); $c->send(true); } else { $c->send(false); } }
define('view_path', './app/view/'); define('controller_path', './app/controller/'); define('model_path', './app/model/'); define('upload_path', './upload/'); // ini_set('memory_limit', '2048M'); // uncomment to allow a huge memory use /* * configura o sistema de root * [url][classe do controtlador][endereco do arquivo do controlador][nome da funcao] * */ include_once core_path . "router.class.php"; // ativa o controle de rotas $router = new Router(); $pagina = !isset($_GET['p']) ? isset($_POST['p']) && debbug ? $_POST['p'] : '' : $_GET['p']; // p = url cortada via htaccess require_once inc_path . "config.class.php"; // inclui as configurações gerais do sistema /* * inclusão do core * */ include_once core_path . "db.class.php"; // ativa o controle do bando de dados include_once core_path . "dic.class.php"; // ativa dicionarios include_once core_path . "render.class.php"; // ativa o renderizador de retorno if (!$router->open($pagina)) { http_response_code(403); echo 'You cannot pass!'; }