Exemple #1
0
function getListOptionsArray($list_id)
{
    $optionsArray = array();
    foreach (getListOptions($list_id) as $option) {
        $optionsArray[] = array("id" => $option->id, "label" => $option->label);
    }
    return $optionsArray;
}
Exemple #2
0
        echo "<script language='JavaScript'>{$qoe_init_javascript}</script>";
    }
    ?>
   </div>
  </td>
 </tr>
<?php 
    ++$i;
}
?>

</table>

<p>
<?php 
$procedure_order_type = getListOptions('order_type', array('option_id', 'title'));
?>
<select name="procedure_type_names" id="procedure_type_names">
	<?php 
foreach ($procedure_order_type as $ordered_types) {
    ?>
	<option value="<?php 
    echo attr($ordered_types['option_id']);
    ?>
" ><?php 
    echo text(xl_list_label($ordered_types['title']));
    ?>
</option>
	<?php 
}
?>
function getListLabels($tableName, $fieldName, $fieldValue)
{
    $values = getListValues($tableName, $fieldName, $fieldValue);
    // load values to labels
    static $valuesToLabels;
    if (!@$valuesToLabels[$tableName][$fieldName]) {
        $valuesToLabels[$tableName][$fieldName] = getListOptions($tableName, $fieldName);
    }
    //
    $labels = array();
    foreach ($values as $value) {
        if (@$valuesToLabels[$tableName][$fieldName][$value]) {
            array_push($labels, $valuesToLabels[$tableName][$fieldName][$value]);
        } else {
            array_push($labels, $value);
        }
    }
    return $labels;
}