// Address
 //--------------------
 if ($showFields->bAddress) {
     echoT($clsRpt->writeCell($person->strAddress, 160));
 }
 //--------------------
 // Phone/Email
 //--------------------
 if ($showFields->bPhoneEmail) {
     echoT($clsRpt->writeCell(strPhoneCell($person->strPhone, $person->strCell, true, true) . '<br>' . $person->strEmailFormatted));
 }
 //--------------------
 // Gift Summary
 //--------------------
 if ($showFields->bGiftSummary) {
     $strLinkAddNew = strLinkAdd_Gift($lPID, 'New&nbsp;gift', true) . '&nbsp;' . strLinkAdd_Gift($lPID, 'New&nbsp;gift', false) . '<br>' . strLinkAdd_Pledge($lPID, 'New&nbsp;pledge', true) . '&nbsp;' . strLinkAdd_Pledge($lPID, 'New&nbsp;pledge', false);
     if ($person->lNumACODonationGroups_hard + $person->lNumACODonationGroups_soft > 0) {
         $strLinkGiftHistory = '<br>' . strLinkView_GiftsHistory($lPID, 'History', true) . '&nbsp;' . strLinkView_GiftsHistory($lPID, 'History', false) . '<br>' . $strLinkAddNew;
     } else {
         $strLinkGiftHistory = $strLinkAddNew;
     }
     echoT($clsRpt->writeCell(strBuildCumlativeTable($person->lNumACODonationGroups_hard, $person->donationsViaACO_hard, 140) . $strLinkGiftHistory));
     echoT($clsRpt->writeCell(strBuildCumlativeTable($person->lNumACODonationGroups_soft, $person->donationsViaACO_soft, 140)));
 }
 //--------------------
 // Sponsorship
 //--------------------
 if ($showFields->bSponsor) {
     $strLinkAddNew = strLinkAdd_Sponsorship($lPID, 'Add new sponsorship', true, 'id="addSponI_' . $lPID . '"') . '&nbsp;' . strLinkAdd_Sponsorship($lPID, 'Add new', false, 'id="addSponL_' . $lPID . '"');
     $strSponSum = $clsSpon->strSponsorSumLiteViaPID($lPID);
     if ($strSponSum == 'n/a') {
function showGifts($lFID, $bBiz, $strCumGiftsNonSoftMon, $strCumGiftsNonSoftInKind, $strCumGiftsSoft, $strCumSpon, $lNumPledges, $lTotHard, $lTotSoft, $lTotInKind, $lNumSponPay)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gstrCurrency;
    $attributes = new stdClass();
    $attributes->lTableWidth = 900;
    $attributes->divID = 'giftSumDiv';
    $attributes->divImageID = 'giftSumDivImg';
    $attributes->bStartOpen = false;
    openBlock('Donations <span style="font-size: 9pt;">(' . $lTotHard . ' hard / ' . $lTotSoft . ' soft / ' . $lTotInKind . ' in-kind / ' . $lNumSponPay . ' spon pay)</span><br>', strLinkView_GiftsHistory($lFID, 'Gift history', true) . '&nbsp;' . strLinkView_GiftsHistory($lFID, 'Gift history', false) . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkAdd_Gift($lFID, 'New donation', true) . '&nbsp;' . strLinkAdd_Gift($lFID, 'New donation', false) . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkAdd_Pledge($lFID, 'New pledge', true) . '&nbsp;' . strLinkAdd_Pledge($lFID, 'New pledge', false), $attributes);
    if (bAllowAccess('showGiftHistory')) {
        echoT('
         <table border="0">
            <tr>
               <td class="enpView" style="width: 120pt;">
                  Total Monetary Gifts:
               </td>
               <td class="enpView" style="text-align: right; 
                  vertical-align: top; width: 70pt;" nowrap>' . $gstrCurrency . $strCumGiftsNonSoftMon . '
               </td>
               <td class="enpView">&nbsp;</td>
            </tr>');
        echoT('
            <tr>
               <td class="enpView">
                  Total In-Kind Gifts:
               </td>
               <td class="enpView" style="text-align: right;">' . $gstrCurrency . ' ' . $strCumGiftsNonSoftInKind . '
               </td>
               <td class="enpView">&nbsp;</td>
            </tr>');
        echoT('
            <tr>
               <td class="enpView">
                  Sponsorship Payments:<br>
                  <i>included in monetary gifts</i>
               </td>
               <td class="enpView" style="text-align: right;">' . $gstrCurrency . ' ' . $strCumSpon . '
               </td>
               <td class="enpView">&nbsp;</td>
            </tr>');
        echoT('
            <tr>
               <td class="enpView">
                  Total Soft Donations:
               </td>
               <td class="enpView" style="text-align: right;">' . $gstrCurrency . ' ' . $strCumGiftsSoft . '
               </td>
               <td class="enpView">&nbsp;</td>
            </tr>');
        if ($lNumPledges > 0) {
            $strLinkPledges = strLinkView_PledgeViaFID($lFID, 'View pledges', true);
        } else {
            $strLinkPledges = '';
        }
        echoT('
            <tr>
               <td class="enpView">
                  Pledges:
               </td>
               <td class="enpView" style="text-align: center;">' . $lNumPledges . '&nbsp;' . $strLinkPledges . '
               </td>
               <td class="enpView">&nbsp;</td>
            </tr>');
        echoT('
         </table>');
    }
    $attributes = new stdClass();
    $attributes->bCloseDiv = true;
    closeBlock($attributes);
}
<?php

echoT(strLinkAdd_Gift($lFID, 'Add new gift', true) . ' ' . strLinkAdd_Gift($lFID, 'Add new gift', false) . '<br>');
// Donations
$attributes = new stdClass();
$attributes->lTableWidth = 1400;
$attributes->lUnderscoreWidth = 500;
$attributes->divID = 'groupGiftDiv';
$attributes->divImageID = 'groupGiftDivImg';
$attributes->bStartOpen = true;
$attributes->bAddTopBreak = true;
echoT(openBlock('Gifts', '', $attributes));
if (!$bAnyGifts) {
    echoT('<i>There are no donations recorded for ' . $strName . '</i><br><br>');
} else {
    $idx = 0;
    foreach ($giftHistory as $gh) {
        if (count($gh) > 0) {
            echoT('
               <table class="enpRpt">
                  <tr>
                     <td colspan="9" class="enpRptTitle">' . $ghACO[$idx]->strFlag . ' ' . $ghACO[$idx]->strCountry . ' Gift History for ' . $strName . '
                     </td>
                  </tr>
                  <tr>
                     <td class="enpRptLabel" style="width: 15pt;">
                        &nbsp;
                     </td>
                     <td class="enpRptLabel" style="width: 50pt;">
                        Gift ID
                     </td>
function showGiftInfo(&$clsRpt, $lGID, $lFID, $bBiz, &$gifts, $people, $biz, $bSponPayment)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $genumDateFormat;
    // deposit info
    $lDepositID = $gifts->lDepositLogID;
    if (is_null($lDepositID)) {
        $strDeposit = 'n/a';
    } else {
        $strDeposit = strLinkView_DepositEntry($lDepositID, 'View deposit', true) . str_pad($lDepositID, 5, '0', STR_PAD_LEFT) . '&nbsp;&nbsp;';
        if ($gifts->strDepositBank . '' != '') {
            $strDeposit .= $gifts->strDepositBank;
        }
        if ($gifts->strDepositAccount . '' != '') {
            if ($gifts->strDepositBank . '' != '') {
                $strDeposit .= ' / ';
            }
            $strDeposit .= $gifts->strDepositAccount;
        }
        $strDeposit .= ' (created ' . date($genumDateFormat, $gifts->dteDeposit) . ')';
    }
    // pledge info
    if (is_null($gifts->lPledgeID)) {
        $strPledge = 'n/a';
    } else {
        $strPledge = 'pledgeID ' . str_pad($gifts->lPledgeID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_Pledge($gifts->lPledgeID, 'View pledge record', true);
    }
    openBlock(($bSponPayment ? 'Sponsorship Payment' : 'Gift') . "\n", strLinkEdit_GiftRecord($lGID, 'Edit gift record', true) . "\n" . '&nbsp;&nbsp;&nbsp;' . "\n" . strLinkAdd_Gift($lFID, 'Add new gift', true) . "\n" . '&nbsp;&nbsp;&nbsp;' . "\n" . strLinkView_GiftsHistory($lFID, 'View donor\'s gift history', true) . '&nbsp;' . strLinkView_GiftsHistory($lFID, 'Donor\'s gift history', false) . "\n" . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . "\n" . strLinkRem_Gift($lGID, 'Remove this gift record', true, true) . "\n\n");
    echoT($clsRpt->openReport());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Gift ID:') . $clsRpt->writeCell(str_pad($lGID, 5, '0', STR_PAD_LEFT), '', '', 1, 1, ' id="gift_id" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Amount:') . $clsRpt->writeCell($gifts->strFormattedAmnt, '', '', 1, 1, ' id="gift_amount" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Date:') . $clsRpt->writeCell(date($genumDateFormat, $gifts->gi_dteDonation), '', '', 1, 1, ' id="gift_date" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Account:') . $clsRpt->writeCell(htmlspecialchars($gifts->ga_strAccount), '', '', 1, 1, ' id="gift_acct" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Campaign:') . $clsRpt->writeCell(htmlspecialchars($gifts->gc_strCampaign), '', '', 1, 1, ' id="gift_camp" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Check #:') . $clsRpt->writeCell(htmlspecialchars($gifts->gi_strCheckNum), '', '', 1, 1, ' id="gift_cn" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Pledge:') . $clsRpt->writeCell($strPledge, '', '', 1, 1, ' id="gift_pledge" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Payment Type:') . $clsRpt->writeCell(htmlspecialchars($gifts->strPaymentType), '', '', 1, 1, ' id="gift_pt" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Deposit:') . $clsRpt->writeCell($strDeposit, '', '', 1, 1, ' id="gift_dep" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Gift Category:') . $clsRpt->writeCell(htmlspecialchars($gifts->strMajorGiftCat), '', '', 1, 1, ' id="gift_cat" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Attributed To:') . $clsRpt->writeCell(htmlspecialchars($gifts->strAttribTo), '', '', 1, 1, ' id="gift_attrib" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Notes:') . $clsRpt->writeCell(nl2br(htmlspecialchars($gifts->strNotes)), '', '', 1, 1, ' id="gift_notes" ') . $clsRpt->closeRow());
    //--------------------
    // in-kind
    //--------------------
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('In-Kind?:'));
    if ($gifts->gi_bGIK) {
        echoT($clsRpt->writeCell('Yes - ' . htmlspecialchars($gifts->strInKind), '', '', 1, 1, ' id="gift_ik" '));
    } else {
        echoT($clsRpt->writeCell('No', '', '', 1, 1, ' id="gift_ik" '));
    }
    echoT($clsRpt->closeRow());
    //--------------------
    // Acknowledged?
    //--------------------
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Acknowledged?:', '', 'padding-top: 8px;'));
    if ($gifts->bAck) {
        echoT($clsRpt->writeCell('Yes - ' . date($genumDateFormat, $gifts->dteAck) . ' ' . strLinkSpecial_GiftChangeAck($lGID, false, 'Set to unacknowledged', true), '', 'padding-top: 8px;', 1, 1, ' id="gift_ack" '));
    } else {
        echoT($clsRpt->writeCell('No ' . strLinkSpecial_GiftChangeAck($lGID, true, 'Set to acknowledged', true), '', 'padding-top: 8px;', 1, 1, ' id="gift_ack" '));
    }
    echoT($clsRpt->closeRow());
    echoT($clsRpt->closeReport(''));
    closeBlock();
}
                 $strOut .= '<td><img src="' . IMGLINK_DOLLAR . '" border="0" title="Soft cash relationship"></td>';
             } else {
                 $strOut .= '<td>&nbsp;</td>';
             }
             $strOut .= '                          
             </tr>' . "\n";
         }
         $strOut .= '</table>' . "\n";
     }
     echoT($clsRpt->writeCell($strOut, 300));
 }
 //--------------------
 // Gift Summary
 //--------------------
 if ($showFields->bGiftSummary) {
     $strLinkAddNew = strLinkAdd_Gift($lBID, 'New&nbsp;gift', true) . '&nbsp;' . strLinkAdd_Gift($lBID, 'New&nbsp;gift', false);
     if ($biz->lNumACODonationGroups_hard + $biz->lNumACODonationGroups_soft > 0) {
         $strLinkGiftHistory = '<br>' . strLinkView_GiftsHistory($lBID, 'Gift history', true) . '&nbsp;' . strLinkView_GiftsHistory($lBID, 'Gift history', false) . '<br>' . $strLinkAddNew;
     } else {
         $strLinkGiftHistory = $strLinkAddNew;
     }
     echoT($clsRpt->writeCell(strBuildCumlativeTable($biz->lNumACODonationGroups_hard, $biz->donationsViaACO_hard, 130) . $strLinkGiftHistory));
     echoT($clsRpt->writeCell(strBuildCumlativeTable($biz->lNumACODonationGroups_soft, $biz->donationsViaACO_soft, 130)));
 }
 //--------------------
 // Sponsorship
 //--------------------
 if ($showFields->bSponsor) {
     $strLinkAddNew = strLinkAdd_Sponsorship($lBID, 'Add new sponsorship', true) . '&nbsp;' . strLinkAdd_Sponsorship($lBID, 'Add new', false);
     $strSponSum = $clsSpon->strSponsorSumLiteViaPID($lBID);
     if ($strSponSum == 'n/a') {