public function prepUI() { $tablesA = _ControllerFront::$session->getNavigation(); $this->view(array('container' => 'ui_nav', 'view' => '/_modules/ui_nav', 'data' => array('tableA' => $tablesA))); //do something here if (isset($this->route['table'])) { $table = $this->route['table']; $tablename = _ControllerFront::getTableName($table); } else { $table = ''; $tablename = ''; } $this->view(array('container' => 'ui_breadcrumb', 'view' => '/_modules/ui_breadcrumb', 'data' => array('table' => $table, 'tablename' => $tablename))); $this->view(array('container' => 'ui_session', 'view' => '/_modules/ui_session', 'data' => '')); }
public function getChartTables($id = '') { $where = ''; if ($id != '') { $where = " WHERE user_id = '{$id}' "; } else { $where = " WHERE user_id != '' "; } $q_tot = $this->db->queryRow("SELECT count(*) AS total FROM " . BLACKBIRD_TABLE_PREFIX . "history " . $where); if ($q = $this->db->query("SELECT count(*) AS total,table_name FROM " . BLACKBIRD_TABLE_PREFIX . "history " . $where . " GROUP BY table_name")) { $dataA = array(); foreach ($q as $row) { $perc = $row['total'] / $q_tot['total']; $dataA[] = array('name' => _ControllerFront::getTableName($row['table_name']), 'total' => $row['total'], 'percent' => floor(100 * $perc), 'percent_actual' => round($perc * 100, 2)); } return $this->formatChartData(Utils::arraySort($dataA, 'percent')); } }