function showRows() { $html =& Factory::getHtml(); $order = !$_GET['order'] ? 'id' : $_GET['order']; $orderdir = strtoupper($_GET['orderdir']) == 'DESC' ? 'DESC' : 'ASC'; $ordering = ' ORDER BY ' . $order . ' ' . $orderdir; $query = 'SELECT count(*) AS count FROM ' . $this->table->_tbl; $this->db->setQuery($query); $row = $this->db->LoadObject(); if ($row->count > 0) { $query = 'SELECT *' . ' FROM ' . $this->table->_tbl . $ordering; $pagination =& Factory::getPagination(); $pagination->pager($row->count, 20, 6); $this->db->setQuery($query, $pagination->limiStart, $pagination->pageRows); $rows = $this->db->LoadObjectList(); $this->assign('pagination', $pagination); $this->assign('rows', $rows); } else { $this->assign('noRows', Text::_('No Data Found')); } $this->display('groups.tpl'); }
function showRows() { $html =& Factory::getHtml(); $order = !$_GET['order'] ? 'id' : $_GET['order']; $orderdir = strtoupper($_GET['orderdir']) == 'DESC' ? 'DESC' : 'ASC'; $ordering = ' ORDER BY ' . $order . ' ' . $orderdir; $query = 'SELECT count(*) AS count FROM ' . $this->table->_tbl; $this->db->setQuery($query); $row = $this->db->LoadObject(); if ($row->count > 0) { $query = 'SELECT apps.*,' . '(SELECT GROUP_CONCAT(platforms.name," ") FROM platforms INNER JOIN app_platforms ON platforms.id=app_platforms.platformid WHERE app_platforms.appid=apps.id) AS platforms,' . '(SELECT GROUP_CONCAT(apptypes.name," ") FROM apptypes INNER JOIN app_types ON apptypes.id=app_types.typeid WHERE app_types.appid=apps.id) AS apptypes,' . '(SELECT GROUP_CONCAT(groups.name," ") FROM groups INNER JOIN app_groups ON groups.id=app_groups.groupid WHERE app_groups.appid=apps.id) AS groups,' . '(SELECT GROUP_CONCAT(markets.name," ") FROM markets INNER JOIN app_markets ON markets.id=app_markets.marketid WHERE app_markets.appid=apps.id) AS markets' . ' FROM ' . $this->table->_tbl . $ordering; $pagination =& Factory::getPagination(); $pagination->pager($row->count, 20, 6); $this->db->setQuery($query, $pagination->limiStart, $pagination->pageRows); $rows = $this->db->LoadObjectList(); $this->assign('pagination', $pagination); $this->assign('rows', $rows); $this->assign('orderDis', $orderDis); $this->assign('html', $html); } else { $this->assign('noRows', Text::_('No Data Found')); } $this->display('apps.tpl'); }
function showRows() { $html =& Factory::getHtml(); $order = @(!$_GET['order']) ? 'id' : $_GET['order']; $orderDis = isset($order) && strtolower($order) != 'ordering' ? 'disabled="true"' : ''; $orderdir = @strtoupper($_GET['orderdir']) == 'DESC' ? 'DESC' : 'ASC'; $ordering = ' ORDER BY ' . $order . ' ' . $orderdir; $query = 'SELECT count(*) AS count FROM ' . $this->table->_tbl; $this->db->setQuery($query); $row = $this->db->LoadObject(); if ($row->count > 0) { $query = 'SELECT fields.id, fields.name, fields.ordering,fields.tabid,tabs.name AS tab' . ' FROM ' . $this->table->_tbl . ' LEFT JOIN tabs ON fields.tabid=tabs.id' . $ordering; $pagination =& Factory::getPagination(); $pagination->pager($row->count, 20, 6); $this->db->setQuery($query, $pagination->limiStart, $pagination->pageRows); $rows = $this->db->LoadObjectList(); $this->assign('pagination', $pagination); $this->assign('rows', $rows); $this->assign('orderDis', $orderDis); $this->assign('html', $html); } else { $this->assign('noRows', Text::_('No Data Now')); } $this->display('fields.tpl'); }