function build_operator_list($page = 'add', $selected_client = "", $onclick = "", $style = "") { $db_functions_obj = new DbFunctions(); $helper_obj = new Helper(); $operators = $db_functions_obj->get_all_operator(); $output = "<div class='control-group'> \n <label class='control-label' for='client_name'>Operator</label>\n <div class='controls'>"; $output .= "<select class='input-xlarge' data-rule-required='true' {$style} {$onclick} id='{$page}" . "_operator' name='{$page}" . "_operator'>"; $output .= "<option value=''>" . $helper_obj->t("Select...") . "</option>"; foreach ($operators as $key => $value) { 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; }