<td><u><?php echo LangUtil::$generalTerms['VALUES']; ?> </u><?php $page_elems->getAsterisk(); ?> </td> <td><u><?php echo LangUtil::$generalTerms['UNIT']; ?> /Default Value</u>[<a href='#unit_help' rel='facebox'>?</a>]</td> </tr> <?php $max_num_measures = count($measure_list); for ($i = 1; $i <= $max_num_measures; $i += 1) { $curr_measure = GlobalMeasure::getById($measure_list[$i - 1]); if ($curr_measure != NULL) { $ref_ranges = $curr_measure->getReferenceRanges($_SESSION['user_id']); ?> <input type='hidden' name='m_id[]' value='<?php echo $measure_list[$i - 1]; ?> '></input> <?php echo "<tr valign='top' id='mrow_{$i}' "; echo ">"; echo "<td align='center'>"; echo "<input type=checkbox name='delete_" . $curr_measure->measureId . "' />"; echo "</td><td>"; echo "<input type='text' name='measure[]' value='{$curr_measure->name}' />"; echo "</td>";
$range_string .= "_"; } } if ($options_entered === false) { # Error: Autocomplete values not entered properly. # TODO: } # Truncate trailing "_" $range_string = substr($range_string, 0, -1); } } } $unit = $units[$i]; # Existing measure # Update measure to DB $measure = GlobalMeasure::getById($measure_ids[$i]); $measure->name = $measure_name; $measure->range = $range_string; $measure->unit = $unit; # Update measure entry DB $measure->updateToDb(); $measures_to_retain[] = $measure_ids[$i]; } # Non-panel test. Collect all newly added measures $count_ref = count($reference_ranges_list); $new_measures_list = array(); $measure_names = $_REQUEST['new_measure']; $measure_types = $_REQUEST['new_mtype']; $measuere_del = $_REQUEST['new_measure_del']; $units = $_REQUEST['new_unit']; for ($i = 0; $i < count($measure_names); $i++) {
public function getMeasures() { # Returns list of measures included in a test type $saved_db = DbUtil::switchToGlobal(); $query_string = "SELECT measure_id FROM global_measures " . "WHERE test_id={$this->testId}"; $resultset = query_associative_all($query_string, $row_count); $retval = array(); foreach ($resultset as $record) { $measure_obj = GlobalMeasure::getById($record['measure_id']); $retval[] = $measure_obj; } DbUtil::switchRestore($saved_db); return $retval; }