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