<?php

global $gbVolMgr;
$params = array('enumStyle' => 'terse', 'clsRpt');
$clsRpt = new generic_rpt($params);
$clsRpt->strWidthLabel = '130pt';
$attributes = new stdClass();
$attributes->lTableWidth = 900;
$attributes->bStartOpen = true;
showVolunteerRec($clsRpt, $volRec, $lVolID);
if ($gbVolMgr) {
    showPatientAssoc($attributes, $clsRpt, $volRec, $lVolID, $volClient);
}
showVolTraining($attributes, $clsRpt, $lVolID, $lNumTraining, $training);
showVolStats($attributes, $clsRpt, $lVolID, $volStats);
if ($gbVolMgr) {
    showVolRecStats($attributes, $clsRpt, $volRec);
}
function showVolTraining($attributes, $clsRpt, $lVolID, $lNumTraining, $training)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gbVolMgr, $genumDateFormat;
    $attributes->bCloseDiv = false;
    $attributes->divID = 'vTrain';
    $attributes->divImageID = 'vTrainDivImg';
    $attributes->lUnderscoreWidth = 400;
    if ($gbVolMgr) {
        openBlock('Volunteer Training', strLinkAdd_VolTraining($lVolID, 'Add training record', true, ' id="newVT_' . $lVolID . '" ') . '&nbsp;' . strLinkAdd_VolTraining($lVolID, 'Add training record', false) . '&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkView_VMgrViewVolTraining($lVolID, 'View training log', true) . '&nbsp;' . strLinkView_VMgrViewVolTraining($lVolID, 'View training log', false), $attributes);
    } else {
<?php

$attributes = new stdClass();
$attributes->lTableWidth = 900;
$attributes->lUnderscoreWidth = 350;
$attributes->bStartOpen = false;
$params = array('enumStyle' => 'terse', 'clsRpt');
$clsRpt = new generic_rpt($params);
$clsRpt->strWidthLabel = '130pt';
showVolStats($clsRpt, 'For the year ' . $lYear, $yearStats, false, $attributes, null);
for ($idx = 1; $idx <= 12; ++$idx) {
    showVolStats($clsRpt, strXlateMonth($idx) . ' ' . $lYear, $volMonth[$idx], true, $attributes, $idx);
}
function showVolStats($clsRpt, $strLabel, $volStats, $bUseAtts, $attributes, $lMonth)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    if ($bUseAtts) {
        $attributes->bCloseDiv = false;
        $attributes->divID = 'group_' . $lMonth . '_Div';
        $attributes->divImageID = 'group_' . $lMonth . '_DivImg';
        openBlock($strLabel, '', $attributes);
    } else {
        openBlock($strLabel, '');
    }
    echoT($clsRpt->openReport());
    // new volunteers
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('# New Volunteers:') . $clsRpt->writeCell(number_format($volStats->lNewVols)) . $clsRpt->closeRow());
    // inactive volunteers
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('# Inactive Volunteers:') . $clsRpt->writeCell(number_format($volStats->lInactiveVols) . ' <i>(volunteers who became inactive in this time period)</i>') . $clsRpt->closeRow());