예제 #1
0
파일: users.php 프로젝트: hypnomez/opir.org
            if (isset($user_data['reg_ip'])) {
                $user_data['reg_ip'] = hex2ip($user_data['reg_ip'], 10);
                if ($user_data['reg_ip'][1]) {
                    $user_data['reg_ip'] = $user_data['reg_ip'][0] . h::br() . $user_data['reg_ip'][1];
                } else {
                    $user_data['reg_ip'] = $user_data['reg_ip'][0];
                }
            }
            if (isset($user_data['last_ip'])) {
                $user_data['last_ip'] = hex2ip($user_data['last_ip'], 10);
                if ($user_data['last_ip'][1]) {
                    $user_data['last_ip'] = $user_data['last_ip'][0] . h::br() . $user_data['last_ip'][1];
                } else {
                    $user_data['last_ip'] = $user_data['last_ip'][0];
                }
            }
            if (in_array(User::ADMIN_GROUP_ID, $groups)) {
                $type = h::info('a');
            } elseif (in_array(User::USER_GROUP_ID, $groups)) {
                $type = h::info('u');
            } elseif ($is_bot) {
                $type = h::info('b');
            } else {
                $type = h::info('g');
            }
            $users_list[] = array_values([$buttons, $type] + $user_data);
        }
    }
    unset($id, $buttons, $user_data, $users_ids, $is_guest, $is_root, $is_bot);
    $a->content(h::{'ul.cs-tabs li'}($L->search, h::info('show_columns')) . h::div(h::div(h::select(['in' => array_merge([$L->all_columns], $search_columns), 'value' => array_merge([''], $search_columns)], ['selected' => $search_column ?: '', 'name' => 'search_column']) . $L->search_mode . ' ' . h::select($search_modes, ['selected' => $search_mode ?: 'LIKE', 'name' => 'search_mode']) . h::{'input.uk-form-width-medium'}(['value' => $search_text, 'name' => 'search_text', 'placeholder' => $L->search_text]) . $L->page . ' ' . h::{'input[type=number]'}(['value' => $start + 1, 'min' => 1, 'name' => 'search_start']) . $L->items . ' ' . h::{'input[type=number]'}(['value' => $limit, 'min' => 1, 'name' => 'search_limit']), ['style' => 'text-align: left;']) . h::{'ul#cs-users-search-columns.uk-padding-remove'}($columns_list)) . h::{'input#cs-users-search-selected-columns[name=columns][type=hidden]'}() . h::hr() . h::{'p.cs-left'}(h::{'button[type=submit]'}($L->search), $L->found_users($results_count) . ($results_count > $limit ? ' / ' . $L->page_from($start + 1, ceil($results_count / $limit)) : '')) . h::{'table.cs-table.cs-center-all'}(h::{'thead tr th'}(array_merge([$L->action, ''], $columns)) . h::{'tbody tr| td'}($users_list)) . h::{'p.cs-left'}($L->found_users($results_count) . ($results_count > $limit ? ' / ' . $L->page_from($start + 1, ceil($results_count / $limit)) : ''), h::{'a.cs-button'}($L->add_user, ['href' => 'admin/System/users/users/add/0']) . h::{'a.cs-button'}($L->add_bot, ['href' => 'admin/System/users/users/add_bot/0'])));
}