Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| info:joomla:modellivress [2014/02/19 15:19] – modification externe 127.0.0.1 | info:joomla:modellivress [2025/10/22 07:02] (Version actuelle) – supprimée radeff | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Changements dans le model livress (liste) ====== | ||
| - | ===== à la fin, ajouter ===== | ||
| - | |||
| - | < | ||
| - | function getTotal() | ||
| - | { | ||
| - | // Load the content if it doesn' | ||
| - | if (empty($this-> | ||
| - | $query = $this-> | ||
| - | $this-> | ||
| - | } | ||
| - | return $this-> | ||
| - | } | ||
| - | | ||
| - | { | ||
| - | // Load the content if it doesn' | ||
| - | if (empty($this-> | ||
| - | jimport(' | ||
| - | |||
| - | | ||
| - | $limitstart = $this-> | ||
| - | $limit = $this-> | ||
| - | |||
| - | // create the pagination object | ||
| - | $this-> | ||
| - | } | ||
| - | return $this-> | ||
| - | } | ||
| - | | ||
| - | /** | ||
| - | * Items total | ||
| - | * @var integer | ||
| - | */ | ||
| - | var $_total = null; | ||
| - | |||
| - | /** | ||
| - | * Pagination object | ||
| - | * @var object | ||
| - | */ | ||
| - | var $_pagination = null; | ||
| - | |||
| - | | ||
| - | { | ||
| - | parent:: | ||
| - | |||
| - | global $mainframe, $option; | ||
| - | |||
| - | // Get pagination request variables | ||
| - | $limit = $mainframe-> | ||
| - | $limitstart = JRequest:: | ||
| - | |||
| - | // In case limit has been changed, adjust it | ||
| - | $limitstart = ($limit != 0 ? (floor($limitstart / $limit) * $limit) : 0); | ||
| - | |||
| - | $this-> | ||
| - | $this-> | ||
| - | } | ||
| - | | ||
| - | //end main model class | ||
| - | </ | ||
| - | |||
| - | |||
| - | ===== function getData() ===== | ||
| - | |||
| - | | ||
| - | { | ||
| - | // Lets load the data if it doesn' | ||
| - | if (empty( $this-> | ||
| - | { | ||
| - | | ||
| - | | ||
| - | } | ||
| - | return $this-> | ||
| - | } | ||
| - | |||
| - | ===== corrections fines ===== | ||
| - | attention, ici c'est plus délicat: | ||
| - | |||
| - | avant getData, changer | ||
| - | < | ||
| - | function _buildQuery() | ||
| - | { | ||
| - | $query = ' SELECT * ' | ||
| - | . ' FROM #__livres ' | ||
| - | ; | ||
| - | |||
| - | return $query; | ||
| - | } | ||
| - | </ | ||
| - | pour | ||
| - | < | ||
| - | |||
| - | | ||
| - | { | ||
| - | #echo " | ||
| - | | ||
| - | $query = ' SELECT * ' | ||
| - | . ' FROM #__livres ' | ||
| - | . $this-> | ||
| - | . ' ORDER BY auteur, | ||
| - | ; | ||
| - | #echo "< | ||
| - | return $query; | ||
| - | } | ||
| - | |||
| - | /** | ||
| - | * Builds the WHERE part of a query | ||
| - | * | ||
| - | * @return string Part of an SQL query | ||
| - | */ | ||
| - | function _buildQueryWhere() | ||
| - | { | ||
| - | global $mainframe, $option; | ||
| - | |||
| - | // get the filter values | ||
| - | | ||
| - | |||
| - | // prepare the WHERE clause | ||
| - | $where = array(); | ||
| - | // Determine search terms | ||
| - | if ($filter_search = trim($filter_search)) | ||
| - | { | ||
| - | $filter_search = JString:: | ||
| - | $db =& $this-> | ||
| - | $filter_search = $db-> | ||
| - | #$where[] = 'NOM1 LIKE " | ||
| - | |||
| - | $where[] = ' | ||
| - | auteur LIKE " | ||
| - | titre LIKE " | ||
| - | support LIKE " | ||
| - | localisation LIKE " | ||
| - | groupe_carton LIKE " | ||
| - | type LIKE " | ||
| - | date LIKE " | ||
| - | remarques LIKE " | ||
| - | owner LIKE " | ||
| - | datein LIKE " | ||
| - | user_id LIKE " | ||
| - | '; | ||
| - | } | ||
| - | |||
| - | // return the WHERE clause | ||
| - | return (count($where)) ? ' WHERE ' | ||
| - | } | ||
| - | /** | ||
| - | * Retrieves the hello data | ||
| - | * @return array Array of objects containing the data from the database | ||
| - | */ | ||
| - | | ||
| - | { | ||
| - | // Lets load the data if it doesn' | ||
| - | if (empty( $this-> | ||
| - | { | ||
| - | $query = $this-> | ||
| - | $limitstart = $this-> | ||
| - | $limit = $this-> | ||
| - | $this-> | ||
| - | } | ||
| - | |||
| - | return $this-> | ||
| - | } | ||
| - | |||
| - | </ | ||
| - | |||