load->model('custom_values/mdl_custom_values', 'cv'); $el = $CI->cv->get_by_id($txt)->row(); return $el->custom_values_value; } /** * @param $txt * @return string */ function format_multiplechoice($txt) { if ($txt == null) { return ''; } $CI = get_instance(); $CI->load->model('custom_values/mdl_custom_values', 'cv'); $values = explode(',', $txt); $values = $CI->cv->where_in('custom_values_id', $values)->get()->result(); $values_text = []; foreach ($values as $value) { $values_text[] = $value->custom_values_value; } return implode("\n", $values_text); } function format_boolean($txt) { if ($txt == null) { return ''; } if ($txt == '1') { return trans('true'); } else if ($txt == '0') { return trans('false'); } return ''; } function format_avs($txt) { if (!preg_match('/(\d{3})(\d{4})(\d{4})(\d{2})/', $txt, $matches)) { return $txt; } return $matches[1] . "." . $matches[2] . "." . $matches[3] . "." . $matches[4]; } /** * @param $txt * @return string */ function format_fallback($txt) { return format_text($txt); } /** * Print a custom form field based on the type * @param $module * @param $custom_field * @param $cv * @param string $class_top * @param string $class_bottom * @param string $label_class */ function print_field($module, $custom_field, $cv, $class_top = '', $class_bottom = 'controls', $label_class = '') { ?>
for="custom[custom_field_id; ?>]"> custom_field_label); ?>
form_value('custom[' . $custom_field->custom_field_id . ']'); ?>
custom_field_type) { case 'DATE': $dateValue = ($fieldValue == "" ? "" : date_from_mysql($fieldValue)); ?> custom_field_id]; ?> custom_field_id]; $selChoices = explode(',', $fieldValue); ?>