function lbf_report($pid, $encounter, $cols, $id, $formname) { require_once $GLOBALS["srcdir"] . "/options.inc.php"; $arr = array(); $shrow = getHistoryData($pid); $fres = sqlStatement("SELECT * FROM layout_options " . "WHERE form_id = ? AND uor > 0 " . "ORDER BY group_name, seq", array($formname)); while ($frow = sqlFetchArray($fres)) { $field_id = $frow['field_id']; $currvalue = ''; if ($frow['edit_options'] == 'H') { if (isset($shrow[$field_id])) { $currvalue = $shrow[$field_id]; } } else { $currvalue = lbf_current_value($frow, $id, $encounter); if ($currvalue === FALSE) { continue; } // should not happen } // For brevity, skip fields without a value. if ($currvalue === '') { continue; } // $arr[$field_id] = $currvalue; // A previous change did this instead of the above, not sure if desirable? -- Rod $arr[$field_id] = wordwrap($currvalue, 30, "\n", true); } echo "<table>\n"; display_layout_rows($formname, $arr); echo "</table>\n"; }
$historical_ids[$key] .= "<td valign='top' align='right' colspan='" . attr($datacols) . "' class='text'>"; } $cell_count += $datacols; } ++$item_count; // Skip current-value fields for the display-only case. if (empty($is_lbf)) { if ($frow['edit_options'] == 'H') { echo generate_display_field($frow, $currvalue); } else { generate_form_field($frow, $currvalue); } } // Append to historical data of other dates for this item. foreach ($historical_ids as $key => $dummy) { $value = lbf_current_value($frow, $key, 0); $historical_ids[$key] .= generate_display_field($frow, $value); } } end_group(); ?> <p style='text-align:center'> <?php if (empty($is_lbf)) { ?> <input type='submit' name='bn_save' value='<?php echo xla('Save'); ?> ' /> <?php