Пример #1
0
function printoutcome($arr, $ind)
{
    global $outcomeinfo, $outcomeassoc, $n, $catnames, $cnt;
    foreach ($arr as $oi) {
        if ($cnt % 2 == 0) {
            $class = "even";
        } else {
            $class = "odd";
        }
        $cnt++;
        if (is_array($oi)) {
            //is outcome group
            echo '<tr class="' . $class . '" colspan="' . $n . '"><td><span class="ind' . $ind . '"><b>' . $oi['name'] . '</b></span></td></tr>';
            printoutcome($oi['outcomes'], $ind + 1);
        } else {
            echo '<tr class="' . $class . '">';
            echo '<td><span class="ind' . $ind . '">' . $outcomeinfo[$oi] . '</span></td><td>';
            if (isset($outcomeassoc[$oi]['UG'])) {
                printitems($outcomeassoc[$oi]['UG']);
            }
            echo '</td>';
            foreach ($catnames as $id => $cn) {
                echo '<td>';
                if (isset($outcomeassoc[$oi][$id])) {
                    printitems($outcomeassoc[$oi][$id]);
                }
                echo '</td>';
            }
            echo '</tr>';
        }
    }
}
Пример #2
0
function printoutcome($arr)
{
    global $outcomeinfo, $cnt;
    foreach ($arr as $item) {
        if (is_array($item)) {
            //is outcome group
            echo '<li class="blockli" id="grp' . $cnt . '"><span class=icon style="background-color:#66f">G</span> ';
            echo '<input class="outcome" type="text" size="60" id="g' . $cnt . '" value="' . htmlentities($item['name']) . '" onkeyup="txtchg()"> ';
            echo '<a href="#" onclick="removeoutcomegrp(this);return false">' . _("Delete") . '</a>';
            $cnt++;
            if (count($item['outcomes']) > 0) {
                echo '<ul class="qview">';
                printoutcome($item['outcomes']);
                echo '</ul>';
            }
            echo '</li>';
        } else {
            //individual outcome
            echo '<li id="' . $item . '"><span class=icon style="background-color:#0f0">O</span> ';
            echo '<input class="outcome" type="text" size="60" id="o' . $item . '" value="' . htmlentities($outcomeinfo[$item]) . '" onkeyup="txtchg()"> ';
            echo '<a href="#" onclick="removeoutcome(this);return false">' . _("Delete") . '</a></li>';
        }
    }
}