english/administrator/components/com_aicontactsafe/models/default.php
// function to read the records to display
function to read the records to display
function to read the records to display
function readRows() {
		if(!$this->rowlist) {
			$db = &JFactory::getDBO();
			$where = $this->getWhere();
			$query = $this->count_select_sql . $where;
			$db->setQuery( $query );
			$total = $db->loadResult();
			jimport('joomla.html.pagination');
			if ($this->withPagNav) {
				$this->pageNav = new JPagination( $total, $this->limitstart, $this->limit );
			} else {
				$this->pageNav = new JPagination( 0, 0, 0 );
			}
			$query = $this->select_sql . $where;
			if (strlen($this->filter_order) > 0) {
				$query .= ' ORDER BY ' . $this->filter_order . ' ' . (is_null($this->filter_order_Dir)?'':$this->filter_order_Dir);
			}
			if ($this->withPagNav) {
				$this->rowlist = $this->_getList($query, $this->pageNav->limitstart, $this->pageNav->limit);
			} else {
				$this->rowlist = $this->_getList($query, 0, 0);
			}
			$this->setRowValues($this->rowlist);
			if (!is_array($this->rowlist)) {
				$this->rowlist = array();
			}
		}
		return $this->rowlist;
	}
function readRows ( ) { if ( ! $ this -> rowlist ) { $ db = & JFactory :: getDBO ( ) ; $ where = $ this -> getWhere ( ) ; $ query = $ this -> count_select_sql . $ where ; $ db -> setQuery ( $ query ) ; $ total = $ db -> loadResult ( ) ; jimport ( 'joomla.html.pagination' ) ; if ( $ this -> withPagNav ) { $ this -> pageNav = new JPagination ( $ total , $ this -> limitstart , $ this -> limit ) ; } else { $ this -> pageNav = new JPagination ( 0 , 0 , 0 ) ; } $ query = $ this -> select_sql . $ where ; if ( strlen ( $ this -> filter_order ) > 0 ) { $ query .= ' ORDER BY ' . $ this -> filter_order . ' ' . ( is_null ( $ this -> filter_order_Dir ) ? '' : $ this -> filter_order_Dir ) ; } if ( $ this -> withPagNav ) { $ this -> rowlist = $ this -> _getList ( $ query , $ this -> pageNav -> limitstart , $ this -> pageNav -> limit ) ; } else { $ this -> rowlist = $ this -> _getList ( $ query , 0 , 0 ) ; } $ this -> setRowValues ( $ this -> rowlist ) ; if ( ! is_array ( $ this -> rowlist ) ) { $ this -> rowlist = array ( ) ; } } return $ this -> rowlist ; }
function to read the records to display
function to read the records to display
// initialize the database // get the condition for the sql command // count the records to display // import the pagination class // generate the pagination object // pagination can be disabled by modifying the variable withPagNav // get the records to display // add/modify values from the list