Esempio n. 1
0
 function showRows()
 {
     $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 prices.*,apps.name AS app' . ' FROM ' . $this->table->_tbl . ' LEFT JOIN apps ON prices.appid=apps.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);
     } else {
         $this->assign('noRows', Text::_('No Data Found'));
     }
     $this->display('prices.tpl');
 }
Esempio n. 2
0
 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);
         $this->assign('orderDis', $orderDis);
         $this->assign('html', $html);
     } else {
         $this->assign('noRows', Text::_('No Data Found'));
     }
     $this->display('reports.tpl');
 }
Esempio n. 3
0
 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');
 }
Esempio n. 4
0
 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');
 }
Esempio n. 5
0
 function showRows()
 {
     $order = !$_GET['order'] ? 'id' : $_GET['order'];
     $orderdir = strtoupper($_GET['orderdir']) == 'DESC' ? 'DESC' : 'ASC';
     $ordering = ' ORDER BY ' . $order . ' ' . $orderdir;
     $where = '';
     if (!$this->user->admin) {
         if (!empty($this->user->permissions['groups'])) {
             $where[] = 'EXISTS (SELECT expenses_groups.expenseid FROM expenses_groups WHERE expenses_groups.groupid IN (' . implode(',', $this->user->permissions['groups']) . ')' . ' AND expenses.id=expenses_groups.expenseid AND expenses_groups.share>0)';
         } else {
             $where[] = '0';
         }
         if (!empty($this->user->permissions['markets'])) {
             $where[] = 'EXISTS (SELECT expenses_markets.expenseid FROM expenses_markets WHERE expenses_markets.marketid IN (' . implode(',', $this->user->permissions['markets']) . ')' . ' AND expenses.id=expenses_markets.expenseid)';
         } else {
             $where[] = '0';
         }
     }
     if (!empty($where)) {
         $where = ' WHERE ' . implode(' AND ', $where);
     }
     $query = 'SELECT count(*) AS count FROM expenses' . $where;
     $this->db->setQuery($query);
     $row = $this->db->LoadObject();
     if ($row->count > 0) {
         $query = 'SELECT expenses.*' . ' FROM expenses' . $join4where . $where . $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('expenses.tpl');
 }