Esempio n. 1
0
/**
 * GForge Survey Facility
 *
 * Portions Copyright 1999-2001 (c) VA Linux Systems
 * The rest Copyright 2002-2004 (c) GForge Team
 * http://gforge.org/
 *
 * @version   $Id$
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
function ShowResultsEditSurvey($result)
{
    global $group_id;
    $rows = db_NumRows($result);
    $cols = db_NumFields($result);
    echo "<h3>" . sprintf(ngettext('%1$s survey found', '%1$s surveys found', $rows), $rows) . "</h3>";
    if ($rows > 0) {
        echo "<table border=\"0\">\n";
        /*  Create  the  headers  */
        echo "<tr class=\"tableheading\">\n";
        for ($i = 0; $i < $cols; $i++) {
            echo "<th>" . db_fieldname($result, $i) . "</th>\n";
        }
        echo "</tr>";
        for ($j = 0; $j < $rows; $j++) {
            echo "<tr class=\".{$HTML->boxGetAltRowStyle}({$j})\">\n";
            echo "<td><a href=\"edit_survey.php?group_id={$group_id}&amp;survey_id=" . db_result($result, $j, 0) . "\">" . db_result($result, $j, 0) . "</a></td>";
            for ($i = 1; $i < $cols; $i++) {
                echo "<td>" . db_result($result, $j, $i) . "</td>\n";
            }
            echo "</tr>";
        }
        echo "</table>";
    }
}
Esempio n. 2
0
function ShowResultsEditSurvey($result)
{
    global $group_id, $PHP_SELF;
    $rows = db_NumRows($result);
    $cols = db_NumFields($result);
    echo "<h3>{$rows} Found</h3>";
    $title_arr = array();
    $title_arr[] = 'Survey ID';
    $title_arr[] = 'Group ID';
    $title_arr[] = 'Survey Title';
    $title_arr[] = 'Survey Questions';
    $title_arr[] = 'Is Active';
    echo html_build_list_table_top($title_arr);
    for ($j = 0; $j < $rows; $j++) {
        echo "<tr BGCOLOR=\"" . html_get_alt_row_color($j) . "\">\n";
        echo "<TD><A HREF=\"edit_survey.php?group_id={$group_id}&survey_id\n=" . db_result($result, $j, 0) . "\">" . sprintf("%06d", db_result($result, $j, 0)) . "</A></TD>";
        for ($i = 1; $i < $cols; $i++) {
            printf("<TD>%s</TD>\n", db_result($result, $j, $i));
        }
        echo "</tr>";
    }
    echo "</table>";
    //</TD></TR></TABLE>";
}