Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 190

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

Trochu upraveno vyhledavani u uzivatelu a u clenu.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/controllers/members.php
$url_array = explode('/', trim(url::current(), '/'));
$sql_offset = (isset($url_array[7])) ? (int) ($url_array[7] - 1) * $limit_results : 0;
$dotaz = $model_members->get_all_members($sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter->values());
$query = $model_members->get_all_members($sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter->values());
$total_members = $query->count();
if ($total_members==1)
{
$member = $query->current();
url::redirect(url_lang::base().'members/show/'.$member->id);
die();
}
$total_members = $model_members->count_all_members($filter->values());// count all members in database
//$total_members = $model_members->count_all_members($filter->values());// count all members in database
unset($url_array);
$sql_offset = ($sql_offset>$total_members) ? 0 : $sql_offset;
......
foreach ($this->input->get() as $key=>$value) $arr_gets[] = $key.'='.$value;
$query_string = '?'.implode('&',$arr_gets);
// $dotaz = $model_members
// $query = $model_members
// -> like($filter->values())
// -> orderby($order_by, $order_by_direction)
// -> limit($limit_results, $sql_offset)
......
// $dotaz = $model_members->get_all_members();
// $query = $model_members->get_all_members();
$grid = new Grid(url_lang::base().'members', url_lang::lang('texts.List of all members'),array(
//'separator' => '<br />-----------',
......
// if ($this->acl_check_2D('freenetis', 'delete_all'))
// $grid->action_field('member_id') ->label(url_lang::lang('texts.Delete')) ->url(url_lang::base().'members/delete') ->action(url_lang::lang('texts.Delete'))->script('onclick="return potvrd(\''.url_lang::lang('texts.delete_member').'\');"');
$grid->datasource( $dotaz );
$grid->datasource( $query );
$view = new View('template');
freenetis/trunk/kohana/application/controllers/users.php
new Table_Form_Item('submit','submit','Filter')
)
);
);
//$dotaz=$model_users
// -> like($filter->values())
// -> orderby($order_by,$order_by_direction)
// -> limit($limit_results,$sql_offset)
// -> find_all();
$total_users = $model_users->count_all_users($filter->values()); // count all members in database
//$total_users = $model_users->count_all_users($filter->values()); // count all members in database
$url_array = explode('/', trim(url::current(), '/'));
$sql_offset = (isset($url_array[7])) ? (int) ($url_array[7] - 1) * $limit_results : 0;
unset($url_array);
$sql_offset = ($sql_offset>$total_users) ? 0 : $sql_offset;
$dotaz = $model_users->get_all_users($sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter->values());
$total_users = $dotaz->count();
if($total_users==1)
{
$user = $dotaz->current();
url::redirect(url_lang::base().'users/show/'.$user->id);
die();
}
$sql_offset = ($sql_offset>$total_users) ? 0 : $sql_offset;
$arr_gets = array();
foreach ($this->input->get() as $key=>$value) $arr_gets[] = $key.'='.$value;

Také k dispozici: Unified diff