function build_roles_list($onclick = "", $page = "", $selected_client = "", $style = "", $exeption = REQULAR_USER_ROLE_ID) { $db_functions_obj = new DbFunctions(); $helper_obj = new Helper(); $roles = $db_functions_obj->get_roles(); $output = '<div class="control-group"> <label class="control-label" for="select">Roles</label> <div class="controls">'; $output .= "<select data-rule-required='true' {$style} {$onclick} id='{$page}" . "_role' name='{$page}" . "_role'>"; $output .= "<option value=''>" . $helper_obj->t("Select...") . "</option>"; foreach ($roles as $key => $value) { if ($exeption == $value['id']) { continue; } if ($selected_client != "") { $output .= "<option "; if ($selected_client == $value['id']) { $output .= " selected='selected' "; } $output .= "value='{$value['id']}'>{$value['name']}</option>"; } else { $output .= "<option value='{$value['id']}'>{$value['name']}</option>"; } } $output .= "</select>"; $output .= "</div>"; $output .= "</div>"; return $output; }