Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 139

Přidáno uživatelem Michal Kliment před více než 15 roky(ů)

Opraveno vyhledavani clenu, nyni pri vyhledavani ignoruje diakritiku.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/vendors/phpgacl/gacl.class.php
var $_db_host = 'localhost';
/** @var string The database user name */
var $_db_user = 'root';
var $_db_user = 'freenetis';
/** @var string The database user password */
var $_db_password = '';
var $_db_password = 'bcac568614812719';
/** @var string The database name */
var $_db_name = 'freenetis';
......
return false;
}
}
?>
?>
freenetis/trunk/kohana/application/models/member.php
}
public function get_all_members($limit_results, $min)
public function get_all_members($limit_from = 0, $limit_results = 50, $order_by = 'devices.id', $order_by_direction = 'ASC', $filter_values = array())
{
return self::$db->query('select m.id, m.registration, concat(u.surname,\' \',u.name) as name, ifnull(m.street,\'-\') as street,
ifnull(m.street_number,\'-\') as street_number,ifnull(m.town,\'-\') as town from members m
left join users u on m.id = u.member_id group by m.id order by name limit '.$min.','.$limit_results);
//return self::$db->query('select m.id, m.registration, concat(u.surname,\' \',u.name) as name, ifnull(m.street,\'-\') as street,
// ifnull(m.street_number,\'-\') as street_number,ifnull(m.town,\'-\') as town from members m
// left join users u on m.id = u.member_id group by m.id order by name limit '.$min.','.$limit_results);
$where = '';
if(count($filter_values)>0) $where .= 'WHERE ';
foreach($filter_values as $key => $value)
{
if($key!='submit')
{
if($where!='WHERE ') $where .= ' AND ';
$where .= $key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
}
}
return self::$db->query('select m.id, m.registration, m.name, m.street, m.street_number, m.town from members m '.$where.' order by '.$order_by.' '.$order_by_direction.' LIMIT '.$limit_from.','.$limit_results);
}
freenetis/trunk/kohana/application/controllers/members.php
$dotaz = $model_members
-> like($filter->values())
-> orderby($order_by, $order_by_direction)
-> limit($limit_results, $sql_offset)
-> find_all();
// $dotaz = $model_members
// -> like($filter->values())
// -> orderby($order_by, $order_by_direction)
// -> limit($limit_results, $sql_offset)
// -> find_all();
// $dotaz = $model_members->get_all_members($sql_offset, (int)$limit_results, $order_by, $order_by_direction); // get all members from database
$dotaz = $model_members->get_all_members($sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter->values());
// $dotaz = $model_members->get_all_members();
$grid = new Grid(url_lang::base().'members', url_lang::lang('texts.List of all members'),array(

Také k dispozici: Unified diff