Esempio n. 1
0
function end_row()
{
    global $cell_count, $CPR;
    end_cell();
    if ($cell_count > 0) {
        for (; $cell_count < $CPR; ++$cell_count) {
            echo "<td></td>";
        }
        echo "</tr>\n";
        $cell_count = 0;
    }
}
Esempio n. 2
0
function end_row()
{
    global $cell_count, $CPR, $historical_ids;
    end_cell();
    if ($cell_count > 0) {
        for (; $cell_count < $CPR; ++$cell_count) {
            echo "<td></td>";
            foreach ($historical_ids as $key => $dummy) {
                $historical_ids[$key] .= "<td></td>";
            }
        }
        foreach ($historical_ids as $key => $dummy) {
            echo $historical_ids[$key];
        }
        echo "</tr>\n";
        $cell_count = 0;
    }
}
Esempio n. 3
0
function issue_ippf_con_form($issue, $thispid)
{
    global $pprow, $item_count, $cell_count, $last_group;
    $shrow = getHistoryData($thispid);
    if ($issue) {
        $pprow = sqlQuery("SELECT * FROM lists_ippf_con WHERE id = '{$issue}'");
    } else {
        $pprow = array();
    }
    echo "<div id='ippf_con' style='display:none'>\n";
    $fres = sqlStatement("SELECT * FROM layout_options " . "WHERE form_id = 'CON' AND uor > 0 " . "ORDER BY group_name, seq");
    $last_group = '';
    $cell_count = 0;
    $item_count = 0;
    $display_style = 'block';
    while ($frow = sqlFetchArray($fres)) {
        $this_group = $frow['group_name'];
        $titlecols = $frow['titlecols'];
        $datacols = $frow['datacols'];
        $data_type = $frow['data_type'];
        $field_id = $frow['field_id'];
        $list_id = $frow['list_id'];
        $currvalue = '';
        if ($frow['edit_options'] == 'H') {
            // This data comes from static history
            if (isset($shrow[$field_id])) {
                $currvalue = $shrow[$field_id];
            }
        } else {
            if (isset($pprow[$field_id])) {
                $currvalue = $pprow[$field_id];
            }
        }
        // Handle a data category (group) change.
        if (strcmp($this_group, $last_group) != 0) {
            end_group();
            $group_seq = 'con' . substr($this_group, 0, 1);
            $group_name = substr($this_group, 1);
            $last_group = $this_group;
            echo "<br /><span class='bold'><input type='checkbox' name='form_cb_{$group_seq}' value='1' " . "onclick='return divclick(this,\"div_{$group_seq}\");'";
            if ($display_style == 'block') {
                echo " checked";
            }
            echo " /><b>{$group_name}</b></span>\n";
            echo "<div id='div_{$group_seq}' class='section' style='display:{$display_style};'>\n";
            echo " <table border='0' cellpadding='0' width='100%'>\n";
            $display_style = 'none';
        }
        // Handle starting of a new row.
        if ($titlecols > 0 && $cell_count >= $CPR || $cell_count == 0) {
            end_row();
            echo " <tr>";
        }
        if ($item_count == 0 && $titlecols == 0) {
            $titlecols = 1;
        }
        // Handle starting of a new label cell.
        if ($titlecols > 0) {
            end_cell();
            echo "<td valign='top' colspan='{$titlecols}' width='1%' nowrap";
            echo $frow['uor'] == 2 ? " class='required'" : " class='bold'";
            if ($cell_count == 2) {
                echo " style='padding-left:10pt'";
            }
            echo ">";
            $cell_count += $titlecols;
        }
        ++$item_count;
        echo "<b>";
        if ($frow['title']) {
            echo $frow['title'] . ":";
        } else {
            echo "&nbsp;";
        }
        echo "</b>";
        // Handle starting of a new data cell.
        if ($datacols > 0) {
            end_cell();
            echo "<td valign='top' colspan='{$datacols}' class='text'";
            if ($cell_count > 0) {
                echo " style='padding-left:5pt'";
            }
            echo ">";
            $cell_count += $datacols;
        }
        ++$item_count;
        if ($frow['edit_options'] == 'H') {
            echo generate_display_field($frow, $currvalue);
        } else {
            generate_form_field($frow, $currvalue);
        }
    }
    end_group();
    echo "</div>\n";
}