function showClientPrograms($lClientID, $lNumCProgs, $cProgs)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $genumDateFormat;
    $attributes = new stdClass();
    $attributes->divID = 'clientProgs';
    $attributes->divImageID = 'clientProgsDivImg';
    $attributes->bStartOpen = false;
    $attributes->lTableWidth = 1100;
    $attributes->lUnderscoreWidth = 350;
    openBlock('Programs <span style="font-size: 9pt;">(' . $lNumCProgs . ')</span>', '', $attributes);
    $attributes->lTableWidth = 900;
    $attributes->lUnderscoreWidth = 373;
    $attributes->lTitleFontSize = 10;
    foreach ($cProgs as $cprog) {
        if ($cprog->bShowCProgLink) {
            $lCProgID = $cprog->lKeyID;
            // set up link to utility that allows the user to
            // reassign an attendance to a different enrollment
            $strLinkMoveAttend = '';
            $lNumEnroll = $cprog->lNumEnrollments;
            if ($lNumEnroll > 1) {
                if ($cprog->lTotAttend > 0) {
                    $strLinkMoveAttend = strLinkUtil_CProgMoveAttend($lClientID, $lCProgID, 'Transfer attendance between enrollments', true) . '&nbsp;' . strLinkUtil_CProgMoveAttend($lClientID, $lCProgID, 'Transfer attendance between enrollments', false);
                }
            }
            $strOut = '';
            $strProgSafeName = htmlspecialchars($cprog->strProgramName);
            $attributes->divID = 'clientProg' . $lCProgID;
            $attributes->divImageID = 'clientProg' . $lCProgID . 'DivImg';
            $attributes->bCloseDiv = false;
            // it's the little things that make a house a home
            openBlock($strProgSafeName . ' <span style="font-size: 9pt;">(' . $lNumEnroll . ' enrollment' . ($lNumEnroll == 1 ? '' : 's') . ')</span>', '', $attributes);
            $strOut .= '<b><span style="vertical-align: bottom;"> ' . $strProgSafeName . '</b>' . "\n";
            if ($cprog->bEnrolled) {
                $strOut .= '<br>Currently enrolled:<br>
                         <ul style="margin-top: 0px;">';
                $lETableID = $cprog->lEnrollmentTableID;
                $lATableID = $cprog->lAttendanceTableID;
                $bAnyActiveEnrollment = false;
                foreach ($cprog->erecs as $erec) {
                    $lERecID = $erec->lKeyID;
                    $bCurrentlyEnrolled = $erec->bCurrentlyEnrolled;
                    if ($bCurrentlyEnrolled) {
                        $bAnyActiveEnrollment = true;
                    }
                    $strOut .= '<li style="margin-bottom: 6px;">' . ($bCurrentlyEnrolled ? '<font>' : '<font style="color: #999;">') . strLinkView_UFMFRecordViaRecID($lETableID, $lClientID, $lERecID, 'View enrollment record', true) . '&nbsp;' . date($genumDateFormat, $erec->dteStart) . ' - ';
                    if (is_null($erec->dteMysqlEnd)) {
                        $strOut .= '<i>ongoing</i>' . "\n";
                    } else {
                        $strOut .= date($genumDateFormat, $erec->dteEnd);
                    }
                    if (!$bCurrentlyEnrolled) {
                        $strOut .= ' <i>(inactive)</i>';
                    }
                    if ($erec->lNumAttend > 0) {
                        $strViewA = '&nbsp;' . strLinkView_UFMFRecordsViaFID(CENUM_CONTEXT_CLIENT, $lATableID, $lClientID, 'View attendance records', true, '', $lERecID) . '&nbsp;&nbsp;&nbsp;';
                    } else {
                        $strViewA = '';
                    }
                    $strOut .= '<br>Attendance records: ' . $erec->lNumAttend . $strViewA . '&nbsp;&nbsp;&nbsp;&nbsp;';
                    if ($bCurrentlyEnrolled) {
                        $strOut .= strLinkAdd_CProgAttendance(false, $lClientID, $lCProgID, $lERecID, 'Add attendance record', true) . '&nbsp;' . strLinkAdd_CProgAttendance(false, $lClientID, $lCProgID, $lERecID, 'Add attendance record', false);
                    }
                    $strOut .= '</li>' . "\n";
                    $strOut .= '</font>';
                }
                if (!$bAnyActiveEnrollment) {
                    $strOut .= '<li style="list-style-type: none;"><br>' . strLinkAdd_CProgEnrollment($lClientID, $lCProgID, 'Add additional enrollment', true) . '&nbsp;' . strLinkAdd_CProgEnrollment($lClientID, $lCProgID, 'Add additional enrollment', false) . '
                       </li>
                         </ul></span>';
                }
            } else {
                $strOut .= '<span style="text-align: bottom;">: Not enrolled. ' . strLinkAdd_CProgEnrollment($lClientID, $lCProgID, 'Enroll this client', true) . '&nbsp;' . strLinkAdd_CProgEnrollment($lClientID, $lCProgID, 'Enroll this client', false) . '</span><br>';
            }
            $strOut .= $strLinkMoveAttend;
            echoT($strOut);
            $attributes->bCloseDiv = true;
            closeBlock($attributes);
        }
    }
    $attributes->bCloseDiv = true;
    closeBlock($attributes);
}
function strLinkView_CProgAttendanceViaCID($lATableID, $lEnrollID, $lClientID, $strTitle, $bShowIcon, $strAnchorExtra = '')
{
    //---------------------------------------------------------------
    //
    //---------------------------------------------------------------
    return strLinkView_UFMFRecordsViaFID(CENUM_CONTEXT_CPROGATTEND, $lATableID, $lClientID, $strTitle, $bShowIcon, $strAnchorExtra, $lEnrollID);
    //   return(strImageLink('cprograms/attendance/view/'.$lCProgID.'/'.$lEnrollID.'/'.$lClientID, $strAnchorExtra, $bShowIcon,
    //                  !$bShowIcon, IMGLINK_VIEW, $strTitle));
}
 function strDisplayUserTableMulti(&$uTable)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $strOut = '';
     $lTableID = $uTable->lKeyID;
     $strTable = $uTable->strDataTableName;
     $lFID = $this->lForeignID;
     $bCollapsibleHeadings = $uTable->bCollapsibleHeadings;
     $bCollapseDefaultHide = $uTable->bCollapseDefaultHide;
     $strSafeTableName = htmlspecialchars($uTable->strUserTableName);
     $strOut .= $this->strBeginCollapsibleHeading($lTableID, $strSafeTableName, false);
     $strOut .= '<b><i>' . htmlspecialchars($uTable->strUserTableName) . '</b> (multi-record table)</i> ';
     $lNumRecs = $this->lNumMultiRecsViaFID($uTable, $lFID);
     // it's the little things that make a house a home.
     $strOut .= '&nbsp;&nbsp;&nbsp;<b>' . $lNumRecs . '</b> record' . ($lNumRecs == 1 ? '' : 's');
     if ($lNumRecs > 0) {
         $strOut .= '&nbsp;' . strLinkView_UFMFRecordsViaFID($uTable->enumTType, $lTableID, $lFID, 'View', true) . '&nbsp;' . strLinkView_UFMFRecordsViaFID($uTable->enumTType, $lTableID, $lFID, 'View', false);
     }
     $strOut .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkAdd_UFMultiRecEntry($uTable->enumTType, $lTableID, $lFID, true, 'Add record', ' id="mptabAddRec_' . $lTableID . '" ') . '&nbsp;' . strLinkAdd_UFMultiRecEntry($uTable->enumTType, $lTableID, $lFID, false, 'Add record', ' id="mptabAddRec1_' . $lTableID . '" ') . '&nbsp;';
     $strOut .= $this->strEndCollapsibleHeading();
     return $strOut;
 }
         <td class="enpRptLabel">
            Vol. Registration Records
         </td>
      </tr>');
$idx = 1;
//   $lNumUTables = count($utables);
foreach ($vols as $vol) {
    $lPeopleID = $vol->lPeopleID;
    $lVolID = $vol->lKeyID;
    if ($lNumUTables == 0) {
        $strUTabLinks = '<i>(no personalized tables)</i>';
    } else {
        $strUTabLinks = '<ul style="margin-top: 0px; margin-bottom: 0px;">';
        foreach ($utables as $ut) {
            // hook 'em
            $strUTabLinks .= '<li style="margin-left: -14pt;">' . strLinkView_UFMFRecordsViaFID(CENUM_CONTEXT_VOLUNTEER, $ut->lTableID, $lVolID, 'View record', true) . '&nbsp;' . htmlspecialchars($ut->strUserTableName) . '</li>';
        }
        $strUTabLinks .= '</ul>';
    }
    echoT('
         <tr class="makeStripe">
            <td class="enpRpt" style="text-align: center;">' . number_format($idx) . '
            </td>
            <td class="enpRpt" style="text-align: center;">' . str_pad($lPeopleID, 6, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_PeopleRecord($lPeopleID, 'View people record', true) . '
            </td>
            <td class="enpRpt" style="text-align: center;">' . str_pad($lVolID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_Volunteer($lVolID, 'View volunteer record', true) . '
            </td>
            <td class="enpRpt">' . $vol->strSafeNameLF . '
            </td>
            <td class="enpRpt">' . $vol->strAddress . '<br>' . $vol->strEmailFormatted . '<br>
               phone: ' . htmlspecialchars($vol->strPhone) . '<br>