コード例 #1
0
                    $value = $arrTotals[1][$k];
                    break;
                case 'Month total':
                    $color = true;
                    $value = $arrTotals[2][$k];
                    break;
                case 'YTD total':
                    $color = false;
                    $value = 0;
                    for ($x = 0; $x <= $k; $x++) {
                        $value = $value + $arrTotals[2][$x];
                    }
                    break;
            }
        }
        $level = colorLookup($value);
        if (!($value === $empty || $value === $noValue)) {
            $value = round($value, $round);
            $value = sprintf($numFormat, $value);
        }
        echo '<td class="' . $level . '" colspan="' . $valuesMonth . '">' . $value . '</td>';
    }
    echo '</tr>' . PHP_EOL;
}
echo '</table>';
#
#  legenda
#
echo '<table id="legend" class="genericTable" style="width: 100%;">' . PHP_EOL;
echo '<tr class="separator"><td colspan="' . ($increments + 1) . '">&nbsp;</td></tr>' . PHP_EOL;
$text = wsReporttransstr($trans . 'Color key');
コード例 #2
0
function tdGenerate($value)
{
    global $numFormat, $round, $noValue, $empty;
    $level = colorLookup($value);
    if (!($value === $empty || $value === $noValue)) {
        $value = round($value, $round);
        $value = sprintf($numFormat, $value);
    }
    return '<td class="' . $level . '">' . $value . '</td>';
}