Пример #1
0
        array_push($columns, $colname);
    }
}
# Put columns we never want to show in this array:
$do_not_show = array("athlete_id", "session_id", "parent_session");
# Get an array of previously selected details
$query = "SELECT detail from athlete_log_preferences where athlete_id={$athlete_id}";
$result = do_sql($query) or die('Query failed: ' . pg_last_error());
# pg_fetch_array returns the next whole row as an array at each iteration
while ($row = pg_fetch_array($result, null, PGSQL_ASSOC)) {
    foreach ($row as $prev_detail) {
        array_push($previous_details, $prev_detail);
    }
}
// Get column nice names
$col_info = get_col_info($columns);
$col_shnames = $col_info['col_shnames'];
$col_lnames = $col_info['col_lnames'];
$col_descriptions = $col_info['col_descriptions'];
// Start Form and Table
echo <<<ENDHTML
  <h2>Select fields for data entry</h2>
  Select the fields you want to be able to enter data into when you add a log entry<br><br>
  <FORM action=configure_log_entry2.php method=post >
  <input type=submit value='Submit selection'>
  <br><table class=fieldselect >
        <TR>
        <TH class=fieldselect >&nbsp;</TH>
        <TH class=fieldselect > Field </TH>
        <TH class=fieldselect > Column name </TH>
        <TH class=fieldselect > Description </TH>
Пример #2
0
function display_column_headers($details_to_view)
{
    // Only used for subsession (split) tables
    $headers = get_column_names();
    $col_info = get_col_info($details_to_view);
    $col_widths = $col_info['col_widths'];
    $col_shnames = $col_info['col_shnames'];
    // Set column widths for table column Header
    echo "<TABLE class=subtable cellspacing=0 >\n";
    echo "<COL WIDTH=0 > <COL WIDTH=0>\n";
    foreach ($details_to_view as $detail) {
        $width = $col_widths[$detail];
        echo "<COL WIDTH={$width} >\n";
    }
    echo "<COL WIDTH=50>\n";
    echo <<<ENDHTML
  <tr>
  <td class=colheader >&nbsp;</td>
  <td class=colheader >&nbsp;</td>
ENDHTML;
    foreach ($details_to_view as $detail) {
        $width = $col_widths[$detail];
        $name = $col_shnames[$detail];
        echo " <td class=colheader >{$name}</td>\n  ";
    }
    echo "<td class=colheader >&nbsp;</td>\n";
    echo "</tr>";
}