Revize 8f55a2a5
Přidáno uživatelem Michal Kliment před více než 9 roky(ů)
application/models/iface.php | ||
---|---|---|
* Gets array of ifaces grouped by device for dropdown
|
||
*
|
||
* @param integer $device_id Only iface of one device?
|
||
* @param array $restrict_types Array of allowed types
|
||
* @author Ondřej fibich
|
||
* @return array
|
||
*/
|
||
public function select_list_grouped_by_device($device_id = NULL)
|
||
public function select_list_grouped_by_device($device_id = NULL,
|
||
$restrict_types = array())
|
||
{
|
||
$where = '';
|
||
|
||
... | ... | |
$where = 'WHERE d.id = ' . intval($device_id);
|
||
}
|
||
|
||
if (is_array($restrict_types) && count($restrict_types))
|
||
{
|
||
$where .= empty($where) ? 'WHERE ' : ' AND ';
|
||
$where .= ' i.type IN (' . implode(',', $restrict_types) . ')';
|
||
}
|
||
|
||
$ifaces = $this->db->query("
|
||
SELECT i.id, COALESCE(d.name, '') AS device_name,
|
||
CONCAT(u.surname, ' ', u.name, ' - ', u.login) AS user_name,
|
Také k dispozici: Unified diff
Release 1.1.6