示例#1
0
    $options_list = $_REQUEST['option'];
    $count = 0;
    foreach ($options_list as $option) {
        if ($option == "") {
            $count++;
            continue;
        }
        $options_csv .= trim($option);
        $count++;
        if ($count != count($options_list)) {
            $options_csv .= "/";
        }
    }
} else {
    if (isset($_REQUEST['range_lower'])) {
        $range_lower = trim($_REQUEST['range_lower']);
        $range_upper = trim($_REQUEST['range_upper']);
        $unit = trim($_REQUEST['unit']);
        $options_csv = $range_lower . ":" . $range_upper . ":" . $unit;
    }
}
$updated_entry = new CustomField();
$updated_entry->id = $field_id;
$updated_entry->fieldName = $field_name;
$updated_entry->fieldOptions = $options_csv;
if ($del == "Delete") {
    CustomField::deleteById($updated_entry, $lab_config_id, $type);
    FieldOrdering::deleteFieldOrderEntry($lab_config_id, 1);
} else {
    CustomField::updateById($updated_entry, $lab_config_id, $type, $offset);
}