function showItemInfo(&$clsRpt, &$item, &$auction, $lPackageID, $lItemID)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $genumDateFormat;
    openBlock('Silent Auction Item', strLinkEdit_AuctionItem($lPackageID, $lItemID, 'Edit item information', true) . '  ' . '       ' . strLinkRem_AuctionItem($lPackageID, $lItemID, 'Remove this item record', true, true));
    echoT($clsRpt->openReport());
    // Item ID
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Item ID:') . $clsRpt->writeCell(str_pad($lItemID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow());
    // Item Name
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Name:') . $clsRpt->writeCell($item->strSafeItemName) . $clsRpt->closeRow());
    // Date Obtained
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Date Obtained:') . $clsRpt->writeCell(date($genumDateFormat, $item->dteObtained)) . $clsRpt->closeRow());
    // Item Donor
    if ($item->itemDonor_bBiz) {
        $strNameLink = ' <i>(business)</i> ' . strLinkView_BizRecord($item->lItemDonorID, 'View business record', true);
    } else {
        $strNameLink = ' ' . strLinkView_PeopleRecord($item->lItemDonorID, 'View people record', true);
    }
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Item Donor:') . $clsRpt->writeCell($item->itemDonor_safeName . $strNameLink) . $clsRpt->closeRow());
    // Donor Acknowledgement
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Donor Ack.:') . $clsRpt->writeCell(htmlspecialchars($item->strDonorAck)) . $clsRpt->closeRow());
    // Est. Value
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Est. Value:') . $clsRpt->writeCell($auction->strCurrencySymbol . ' ' . number_format($item->curEstAmnt, 2)) . $clsRpt->closeRow());
    // Out-of-Pocket
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Out-of-Pocket:') . $clsRpt->writeCell($auction->strCurrencySymbol . ' ' . number_format($item->curOutOfPocket, 2)) . $clsRpt->closeRow());
    // Public Notes
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Public Notes:') . $clsRpt->writeCell(nl2br(htmlspecialchars($item->strDescription))) . $clsRpt->closeRow());
    // Private Notes
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Private Notes:') . $clsRpt->writeCell(nl2br(htmlspecialchars($item->strInternalNotes))) . $clsRpt->closeRow());
    echoT($clsRpt->closeReport());
    closeBlock();
}
function writeAutoChargeRow($clsACInfo)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $lCID = $clsACInfo->lKeyID;
    $lSponID = $clsACInfo->lSponsorshipID;
    $bBiz = $clsACInfo->bBiz;
    $lFID = $clsACInfo->lForeignID;
    $lClientID = $clsACInfo->lClientID;
    if (is_null($lClientID)) {
        $strClientRow = 'n/a';
    } else {
        $strClientRow = strLinkView_ClientRecord($lClientID, 'View Client', true) . ' ' . str_pad($lClientID, 5, '0', STR_PAD_LEFT) . ' ' . $clsACInfo->strClientSafeNameFL . ' / ' . htmlspecialchars($clsACInfo->strLocation);
    }
    if ($bBiz) {
        $strFLink = strLinkView_BizRecord($lFID, 'View business record', true);
    } else {
        $strFLink = strLinkView_PeopleRecord($lFID, 'View people record', true);
    }
    echoT('
      <tr>
         <td class="enpRpt" style="text-align:center">' . strLinkView_SponsorCharge($lCID, 'View charge record', true) . '&nbsp;' . str_pad($lCID, 5, '0', STR_PAD_LEFT) . '
         </td>');
    echoT('
         <td class="enpRpt" style="text-align:center">' . strLinkView_Sponsorship($lSponID, 'View sponsorship record', true) . '&nbsp;' . str_pad($lSponID, 5, '0', STR_PAD_LEFT) . '
         </td>');
    //------------------------------
    // sponsor
    //------------------------------
    echoT('
         <td class="enpRpt">' . $strFLink . '&nbsp;' . $clsACInfo->strSponSafeNameFL . '
         </td>');
    //------------------------------
    // charge
    //------------------------------
    echoT('
         <td class="enpRpt" style="text-align: right;">' . $clsACInfo->strCurSymbol . '&nbsp;' . number_format($clsACInfo->curChargeAmnt, 2) . '&nbsp;' . $clsACInfo->strFlagImage . '
         </td>');
    //------------------------------
    // client
    //------------------------------
    echoT('
         <td class="enpRpt">' . $strClientRow . '
         </td>');
    echoT('
      </tr>');
}
function showPeopleInfo($clsDateTime, $clsRpt, $people, $dupIDs)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gbDateFormatUS, $genumDateFormat, $glclsDTDateFormat;
    // People ID
    $lPeopleID = $people->lKeyID;
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('People ID:') . $clsRpt->writeCell(strLinkView_PeopleRecord($lPeopleID, 'View people record', true) . '&nbsp;' . str_pad($lPeopleID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow());
    // Name
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Name:') . $clsRpt->writeCell($people->strSafeNameLF) . $clsRpt->closeRow());
    // Address
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Address:') . $clsRpt->writeCell($people->strAddress) . $clsRpt->closeRow());
    // Phone
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Phone:') . $clsRpt->writeCell(htmlspecialchars(strPhoneCell($people->strPhone, $people->strCell))) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Consolidated With:') . $clsRpt->writeCell('People IDs: ' . implode(', ', $dupIDs)) . $clsRpt->closeRow());
}
function showSingleSponsorshipInfo($clsRpt, $strTitle, $clsSpon)
{
    //---------------------------------------------------------------------
    // use for single sponsorship
    //---------------------------------------------------------------------
    $attributes = new stdClass();
    $attributes->lTableWidth = 900;
    $attributes->divID = 'ssponDiv';
    $attributes->divImageID = 'ssponDivImg';
    openBlock($strTitle, '', $attributes);
    $clsRpt->openReport();
    if ($clsSpon->lNumSponsors == 0) {
        echoT('<i>(no sponsorships)</i><br>');
    } else {
        foreach ($clsSpon->sponInfo as $idx => $spon) {
            echoT($clsRpt->openRow() . $clsRpt->writeLabel('Sponsor ID:') . $clsRpt->writeCell(strLinkView_Sponsorship($spon->lKeyID, 'view sponsorship', true) . ' ' . str_pad($spon->lKeyID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow());
            $lFID = $spon->lForeignID;
            if ($spon->bSponBiz) {
                $strLinkFID = strLinkView_Biz($lFID, 'View business record', true);
            } else {
                $strLinkFID = strLinkView_PeopleRecord($lFID, 'View people record', true);
            }
            echoT($clsRpt->openRow() . $clsRpt->writeLabel('Sponsor:') . $clsRpt->writeCell($strLinkFID . ' ' . str_pad($lFID, 5, '0', STR_PAD_LEFT) . ' ' . $spon->strSponSafeNameFL) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Sponsorship Program:') . $clsRpt->writeCell(htmlspecialchars($spon->strSponProgram)) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Client:'));
            if (is_null($spon->lClientID)) {
                echoT($clsRpt->writeCell('<i>Client not set</i>'));
            } else {
                echoT($clsRpt->writeCell(strLinkView_Client($spon->lClientID, 'View client record', true) . ' ' . $spon->strClientSafeNameFL . ' (' . htmlspecialchars($spon->strLocation) . ')'));
            }
            echoT($clsRpt->closeRow());
        }
    }
    echoT($clsRpt->closeReport());
    $attributes = new stdClass();
    $attributes->bCloseDiv = true;
    closeBlock($attributes);
}
function showPayRec($clsRpt, &$pRec, $lSponID, $lFPayerID, $lPayID)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $genumDateFormat;
    openBlock('Sponsor payment record ', strLinkEdit_SponsorPayment($lSponID, $lFPayerID, $lPayID, 'Edit payment record', true) . '&nbsp;&nbsp;' . strLinkAdd_SponsorPayment($lSponID, 'Add new payment', true) . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkRem_SponsorPayment($lSponID, $lPayID, 'Remove payment', true, true));
    echoT($clsRpt->openReport() . $clsRpt->openRow() . $clsRpt->writeLabel('Payment ID:') . $clsRpt->writeCell(str_pad($lPayID, 5, '0', STR_PAD_LEFT), '', '', 1, 1, 'id="sponPayID"') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Amount:') . $clsRpt->writeCell($pRec->strCurSymbol . ' ' . number_format($pRec->curPaymentAmnt, 2) . ' ' . $pRec->strFlagImage) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Date of payment:') . $clsRpt->writeCell(date($genumDateFormat, $pRec->dtePayment)) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Payment type:') . $clsRpt->writeCell(htmlspecialchars($pRec->strPaymentType)) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Check #:') . $clsRpt->writeCell(htmlspecialchars($pRec->strCheckNum)) . $clsRpt->closeRow());
    if ($pRec->lSponPeopleID == $pRec->lDonorID) {
        $strPayer = $pRec->strSponSafeNameFL . ' (sponsor)';
    } else {
        if ($pRec->bDonorBiz) {
            $strPayer = strLinkView_BizRecord($pRec->lDonorID, 'View business record', true) . ' ';
        } else {
            $strPayer = strLinkView_PeopleRecord($pRec->lDonorID, 'View people record', true) . ' ';
        }
        $strPayer .= $pRec->strDonorSafeNameFL . ' <b>(THIRD PARTY PAYER)</b>';
    }
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Payer:') . $clsRpt->writeCell($strPayer) . $clsRpt->closeRow() . $clsRpt->closeReport());
}
function showBizContactInfo($clsRpt, $lBID, $clsBiz, $lNumContacts, &$contacts)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $attributes = new stdClass();
    $attributes->lTableWidth = 900;
    $attributes->divID = 'bizCon';
    $attributes->divImageID = 'bizConDivImg';
    openBlock('Associated Contacts <span style="font-size: 9pt;"> (' . $lNumContacts . ')</span>', strLinkView_BizContacts($lBID, 'View contacts', true, '') . ' ' . strLinkView_BizContacts($lBID, 'View', false, '') . '&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkAdd_BizContact($lBID, 'Add new business contact', true, '') . '&nbsp;' . strLinkAdd_BizContact($lBID, 'Add new contact', false, ''), $attributes);
    if ($lNumContacts == 0) {
        echoT('<i>There are no contacts associated with this business/organization</i><br>');
    } else {
        echoT("\n\n" . $clsRpt->openReport());
        foreach ($contacts as $clsCon) {
            $lContactID = $clsCon->lBizConRecID;
            $lPID = $clsCon->lPeopleID;
            echoT($clsRpt->openRow() . $clsRpt->writeCell(strLinkView_PeopleRecord($clsCon->lPeopleID, 'View people record', true)) . $clsRpt->writeCell(strLinkEdit_BizContact($lBID, $lContactID, $lPID, 'Edit business contact', true)) . $clsRpt->writeCell(strLinkRem_BizContact($lBID, $lContactID, 'Remove business contact', true, true)) . $clsRpt->writeCell($clsCon->strSafeNameLF));
            if ($clsCon->strRelationship . '' == '') {
                echoT($clsRpt->writeCell('&nbsp;'));
            } else {
                echoT($clsRpt->writeCell('(' . htmlspecialchars($clsCon->strRelationship) . ')'));
            }
            if ($clsCon->bSoftCash) {
                echoT($clsRpt->writeCell('<img src="' . DL_IMAGEPATH . '/misc/dollar.gif" border="0" title="soft cash relationship">'));
            } else {
                echoT($clsRpt->writeCell('&nbsp;'));
            }
            echoT($clsRpt->closeRow());
        }
        echoT($clsRpt->closeReport());
    }
    $attributes = new stdClass();
    $attributes->bCloseDiv = true;
    closeBlock($attributes);
}
         </td>
         <td class="enpRptLabel">
            Account
         </td>
         <td class="enpRptLabel">
            Campaign
         </td>
      </tr>');
foreach ($gifts as $gift) {
    $lGiftID = $gift->gi_lKeyID;
    $lDonorID = $gift->gi_lForeignID;
    $bBizGift = $gift->pe_bBiz;
    if ($bBizGift) {
        $strLinkDonor = strLinkView_BizRecord($lDonorID, 'View business record', true);
    } else {
        $strLinkDonor = strLinkView_PeopleRecord($lDonorID, 'View people record', true);
    }
    echoT('
            <tr class="makeStripe">
               <td class="enpRpt">' . strLinkView_GiftsRecord($lGiftID, 'View gift record', true) . '&nbsp;' . str_pad($lGiftID, 5, '0', STR_PAD_LEFT) . '
               </td>
               <td class="enpRpt">' . $strLinkDonor . '&nbsp;' . str_pad($lDonorID, 5, '0', STR_PAD_LEFT) . '
               </td>
               <td class="enpRpt">' . htmlspecialchars($gift->strImportID) . '
               </td>
               <td class="enpRpt">' . $gift->strSafeNameLF . '
               </td>
               <td class="enpRpt" style="text-align: right;">' . $gift->strFormattedAmnt . '
               </td>
               <td class="enpRpt" style="text-align: center;">' . date($genumDateFormat, $gift->gi_dteDonation) . '
               </td>
 private function strPeopleBasedGroupRptHTML($enumContext)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     switch ($enumContext) {
         case CENUM_CONTEXT_PEOPLE:
             $strIDLabel = 'PeopleID';
             $strInner = ' INNER JOIN people_names ON pe_lKeyID=gm_lForeignID ';
             $strFID = ' pe_lKeyID AS lFID ';
             break;
         case CENUM_CONTEXT_BIZ:
             $strIDLabel = 'businessID';
             $strInner = ' INNER JOIN people_names ON pe_lKeyID=gm_lForeignID ';
             $strFID = ' pe_lKeyID AS lFID ';
             break;
         case CENUM_CONTEXT_VOLUNTEER:
             $strIDLabel = 'volunteerID';
             $strInner = ' INNER JOIN volunteers   ON vol_lKeyID    = gm_lForeignID ' . ' INNER JOIN people_names ON vol_lPeopleID = pe_lKeyID ';
             $strFID = ' pe_lKeyID, vol_lKeyID AS lFID ';
             break;
         case CENUM_CONTEXT_SPONSORSHIP:
             $strIDLabel = 'sponsorID';
             $strInner = ' INNER JOIN sponsor   ON sp_lKeyID        = gm_lForeignID ' . ' INNER JOIN people_names ON sp_lForeignID = pe_lKeyID ';
             $strFID = ' pe_lKeyID, sp_lKeyID AS lFID ';
             break;
         default:
             screamForHelp($enumContext . ': group type not yet available<br>error on <b>line:</b> ' . __LINE__ . '<br><b>file: </b>' . __FILE__ . '<br><b>function: </b>' . __FUNCTION__);
             break;
     }
     $strOut = '<table class="enpRptC">
              <tr>
                 <td class="enpRptLabel">' . $strIDLabel . '
                 </td>
                 <td class="enpRptLabel">
                    Name
                 </td>
                 <td class="enpRptLabel">
                    Address
                 </td>
                 <td class="enpRptLabel">
                    Phone/Email
                 </td>
                 <td class="enpRptLabel">
                    Group Membership
                 </td>
              </tr>' . "\n";
     $sqlStr = "SELECT\n             {$strFID},\n             pe_strLName, pe_strFName, pe_strAddr1, pe_strAddr2,\n             pe_strCity, pe_strState, pe_strCountry, pe_strZip, pe_strPhone, pe_strCell, pe_strEmail\n          FROM tmpGroupMatch\n             {$strInner}\n          ORDER BY gm_lKeyID;";
     $query = $this->db->query($sqlStr);
     foreach ($query->result() as $row) {
         $lFID = $row->lFID;
         if ($row->pe_strEmail . '' == '') {
             $strEmail = '';
         } else {
             $strEmail = '<br>' . mailto($row->pe_strEmail, $row->pe_strEmail);
         }
         $this->groupMembershipViaFID($enumContext, $lFID);
         /*
            tip for preventing that pesky line break before a list
            http://stackoverflow.com/questions/1682873/how-do-i-prevent-a-line-break-occurring-before-an-unordered-list
            ul.errorlist {list-style-type: none; display:inline; margin-left: 0; padding-left: 0;}
            ul.errorlist li {display: inline; color:red; font-size: 0.8em; margin-left: 0px; padding-left: 10px;}
         */
         $strGroupList = '<ul style="list-style-type: square; display:inline; margin-left: 0; padding-left: 0;">';
         foreach ($this->arrMemberInGroups as $grpMember) {
             $strGroupList .= '<li style="margin-left: 20px; padding-left: 3px;">' . htmlspecialchars($grpMember->strGroupName) . '</li>';
         }
         $strGroupList .= '</ul>';
         switch ($enumContext) {
             case CENUM_CONTEXT_PEOPLE:
                 $strLink = strLinkView_PeopleRecord($lFID, 'View people record', true) . '&nbsp;';
                 break;
             case CENUM_CONTEXT_BIZ:
                 $strLink = strLinkView_BizRecord($lFID, 'View people record', true) . '&nbsp;';
                 break;
             case CENUM_CONTEXT_VOLUNTEER:
                 $strLink = strLinkView_Volunteer($lFID, 'View volunteer record', true) . '&nbsp;';
                 break;
             case CENUM_CONTEXT_SPONSORSHIP:
                 $strLink = strLinkView_Sponsorship($lFID, 'View sponsor record', true) . '&nbsp;';
                 break;
             default:
                 screamForHelp($enumContext . ': group type not yet available<br>error on <b>line:</b> ' . __LINE__ . '<br><b>file: </b>' . __FILE__ . '<br><b>function: </b>' . __FUNCTION__);
                 break;
         }
         $bBiz = $enumContext == CENUM_CONTEXT_BIZ;
         $strOut .= '<tr class="makeStripe">
               <td class="enpRpt" style="width: 65px;">' . $strLink . str_pad($lFID, 5, '0', STR_PAD_LEFT) . '
               </td>
               <td class="enpRpt" style="width: 160px;">' . htmlspecialchars($row->pe_strLName . ($bBiz ? '' : ', ' . $row->pe_strFName)) . '
               </td>
               <td class="enpRpt" style="width: 200px;">' . strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true) . '
               </td>
               <td class="enpRpt" style="width: 120px;">' . htmlspecialchars(strPhoneCell($row->pe_strPhone, $row->pe_strCell)) . $strEmail . '
               </td>
               <td class="enpRpt" style="width: 200px;">' . $strGroupList . '
               </td>
            </tr>' . "\n";
         $strOut .= '</tr>' . "\n";
     }
     $strOut .= '</table>' . "\n";
     return $strOut;
 }
 function strPeopleBizDupWarning($bPeople, $strCheckBoxName, $lNumMatches, $matches)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $strWarning = '';
     $strLabel1 = $bPeople ? 'people' : 'business/organization';
     $strLabel2 = $bPeople ? 'People' : 'Biz/Org';
     $strWarning = '<br><div class="formError" style="width: 400pt;">
          <b><i>Delightful Labor</i></b> has detected ' . $lNumMatches . ' ' . $strLabel1 . '
             records with similar names to your new entry.<br><br>
             To prevent duplicate records, please verify that your
             new ' . $strLabel1 . ' record <b><i>is not</i></b> in the database.<br>
         <table style="border:2px solid #ff0000; border-collapse:collapse;">
            <tr>
               <td class="enpRptTitle" colspan="3" style="background-color: #ffd3d3;">
                  ' . $strLabel2 . ' records in the database
               </td>
            </tr>
            <tr>
               <td class="enpRptLabel" style="background-color: #ffd3d3;">
                  ' . $strLabel2 . ' ID
               </td>
               <td class="enpRptLabel" style="background-color: #ffd3d3;">
                  Name
               </td>
               <td class="enpRptLabel" style="background-color: #ffd3d3;">
                  Address
               </td>';
     $strWarning .= '</tr>';
     foreach ($matches as $match) {
         $lKeyID = $match->lKeyID;
         if ($bPeople) {
             $strLink = strLinkView_PeopleRecord($lKeyID, 'View people record', true);
         } else {
             $strLink = strLinkView_BizRecord($lKeyID, 'View business/organization record', true);
         }
         $strWarning .= '
            <tr>
               <td class="enpRpt" style="text-align: center;background-color: #fff5f5;">' . str_pad($lKeyID, 6, '0', STR_PAD_LEFT) . '&nbsp;' . $strLink . '
               </td>
               <td class="enpRpt" style="background-color: #fff5f5;">' . $match->strSafeNameLF . '
               </td>
               <td class="enpRpt" style="background-color: #fff5f5;">' . $match->strAddress . '
               </td>';
         $strWarning .= '</tr>';
     }
     $strWarning .= '
         </table><br>
         <div style="width: 300pt; border: 1px solid black; padding: 3px 3px 6px 3px;
             background-color: #fff; vertical-align: middle;">
         <input type="checkbox" name="' . $strCheckBoxName . '" value="true">
         I have verified that this <b>IS NOT</b> a duplicate entry<br>
         </div>
        </div>';
     return $strWarning;
 }
                     </table>';
             }
         }
     }
     if ($person->lNumFromRels > 0) {
         $strRels .= '<br>';
     }
     if ($person->lNumToRels > 0) {
         foreach ($person->toRels as $b2a) {
             if ($b2a->bSoftDonations) {
                 $strSoftImg = '&nbsp;<img src="' . IMGLINK_DOLLAR . ' " border="0">';
             } else {
                 $strSoftImg = '';
             }
             $lPIDLink = $a2b->lPerson_A_ID;
             $strRels .= strLinkView_PeopleRecord($lPIDLink, 'View record', true) . ' ' . htmlspecialchars($b2a->strAFName . ' ' . $b2a->strALName) . ' is <b>' . $b2a->strRelationship . '</b> to ' . htmlspecialchars($b2a->strBFName . ' ' . $b2a->strBLName) . $strSoftImg . '<br>' . "\n";
             if ($b2a->strNotes != '') {
                 $strRels .= '
                     <table>
                        <tr>
                           <td style="width: 15pt;">&nbsp;</td>
                           <td>' . nl2br(htmlspecialchars($b2a->strNotes)) . '</td>
                        </tr>
                     </table>';
             }
         }
     }
 } else {
     $strRels = '&nbsp;';
 }
 echoT($clsRpt->writeCell($strRels, 520, ' vertical-align: middle;  '));
 $lPayID = $payrec->lKeyID;
 $lSponID = $payrec->lSponsorshipID;
 $lClientID = $payrec->lClientID;
 $lDonorID = $payrec->lDonorID;
 $lSponFID = $payrec->lSponPeopleID;
 $bBizDonor = $payrec->bDonorBiz;
 $bBizSponsor = $payrec->bSponBiz;
 if ($bBizDonor) {
     $strLinkDonor = strLinkView_BizRecord($lDonorID, 'View business record of payer', true);
 } else {
     $strLinkDonor = strLinkView_PeopleRecord($lDonorID, 'View people record of payer', true);
 }
 if ($bBizSponsor) {
     $strLinkSpon = strLinkView_BizRecord($lSponFID, 'View business record of sponsor', true);
 } else {
     $strLinkSpon = strLinkView_PeopleRecord($lSponFID, 'View people record of sponsor', true);
 }
 if (is_null($lClientID)) {
     $strClientLink = '&nbsp;';
 } else {
     $strClientLink = strLinkView_ClientRecord($lClientID, 'View client record', true) . '&nbsp;';
 }
 echoT('
         <tr class="makeStripe">
            <td class="enpRpt" style="text-align: center;">' . strLinkView_SponsorPayment($lPayID, 'View payment record', true) . '&nbsp;' . str_pad($lPayID, 5, '0', STR_PAD_LEFT) . '
            </td>
            <td class="enpRpt" style="text-align: center;">' . strLinkView_Sponsorship($lSponID, 'View sponsorship record', true) . '&nbsp;' . str_pad($lSponID, 5, '0', STR_PAD_LEFT) . '
            </td>
            <td class="enpRpt" style="text-align: center;">' . $strLinkDonor . '&nbsp;' . str_pad($lDonorID, 5, '0', STR_PAD_LEFT) . '
            </td>
            <td class="enpRpt">' . htmlspecialchars($payrec->strImportID) . '
function writeHonMemGiftsTable($lGiftID, $clsRpt, $honMemTable)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gbAdmin;
    echoT($clsRpt->openReport());
    foreach ($honMemTable as $clsHM) {
        echoT($clsRpt->openRow());
        $bHon = $clsHM->ghm_bHon;
        $strCell = strLinkView_PeopleRecord($clsHM->ghm_lFID, 'View people record', true) . ' ' . strLinkRem_HonMemLink($clsHM->lHMLinkID, $lGiftID, $bHon, 'Remove ' . ($bHon ? 'honorarium' : 'memorial'), true, true) . ' ' . $clsHM->honorMem->strSafeNameFL;
        if ($bHon) {
            echoT($clsRpt->writeLabel('Honorarium:'));
            echoT($clsRpt->writeCell($strCell));
        } else {
            $lMCID = $clsHM->ghm_lMailContactID;
            if (is_null($lMCID)) {
                $strCell .= ' <font color="red"><i>(Mail contact not set!';
                if ($gbAdmin) {
                    $strCell .= ' Click ' . strLinkView_ListHonMem(false, 'here', false) . ' to work with memorials.';
                }
                $strCell .= ')</i></font>';
            } else {
                $strCell .= ' (mail contact: ' . $clsHM->mailContact->strSafeNameFL . strLinkView_PeopleRecord($lMCID, 'View people record for the mail contact', true) . ' ' . ')';
            }
            echoT($clsRpt->writeLabel('Memorial:'));
            echoT($clsRpt->writeCell($strCell, '', 'vertical-align: text-top;'));
        }
        echoT($clsRpt->closeRow());
    }
    echoT($clsRpt->closeReport('<br>'));
}
Beispiel #13
0
 private function loadImgDocInfoViaContext($enumContext, $imgDoc, $row)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $genumDateFormat, $glChapterID;
     $lFID = (int) $imgDoc->lForeignID;
     switch ($enumContext) {
         case CENUM_CONTEXT_CLIENT:
             $imgDoc->strNameLabel = 'Client';
             $imgDoc->strName = strLinkView_ClientRecord($lFID, 'View Client Record', true) . '&nbsp;' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . '&nbsp;&nbsp;<b>' . htmlspecialchars($row->cr_strLName . ', ' . $row->cr_strFName) . '</b>';
             $imgDoc->strAddressLabel = 'Address';
             $imgDoc->strAddr = strBuildAddress($row->cr_strAddr1, $row->cr_strAddr2, $row->cr_strCity, $row->cr_strState, $row->cr_strCountry, $row->cr_strZip, true);
             $strPhone = strPhoneCell($row->cr_strPhone, $row->cr_strCell);
             if ($strPhone != '') {
                 $imgDoc->strAddr .= '<br>' . $strPhone;
             }
             break;
         case CENUM_CONTEXT_PEOPLE:
             $imgDoc->strNameLabel = 'Name';
             $imgDoc->strName = strLinkView_PeopleRecord($lFID, 'View People Record', true) . '&nbsp;' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . '&nbsp;&nbsp;<b>' . htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName) . '</b>';
             $imgDoc->strAddressLabel = 'Address';
             $imgDoc->strAddr = strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true);
             $strPhone = strPhoneCell($row->pe_strPhone, $row->pe_strCell);
             if ($strPhone != '') {
                 $imgDoc->strAddr .= '<br>' . $strPhone;
             }
             break;
         case CENUM_CONTEXT_LOCATION:
             $imgDoc->strNameLabel = 'Client Location';
             $imgDoc->strName = strLinkView_ClientLocation($lFID, 'View client location', true) . '&nbsp;' . htmlspecialchars($row->cl_strLocation);
             break;
         case CENUM_CONTEXT_GRANTPROVIDER:
             $imgDoc->strNameLabel = 'Funder/Provider';
             $imgDoc->strName = strLinkView_GrantProvider($lFID, 'View funder/provider', true) . '&nbsp;' . htmlspecialchars($row->gpr_strGrantOrg);
             break;
         case CENUM_CONTEXT_INVITEM:
             $imgDoc->strNameLabel = 'Inventory Item';
             $imgDoc->strName = strLinkView_InventoryItem($lFID, 'View inventory item', true) . '&nbsp;' . htmlspecialchars($row->ivi_strItemName);
             break;
         case CENUM_CONTEXT_AUCTION:
             $imgDoc->strNameLabel = 'Silent Auction';
             $imgDoc->strName = strLinkView_AuctionRecord($lFID, 'View Auction', true) . '&nbsp;' . htmlspecialchars($row->auc_strAuctionName) . ' (' . date($genumDateFormat, dteMySQLDate2Unix($row->auc_dteAuctionDate)) . ')';
             break;
         case CENUM_CONTEXT_AUCTIONITEM:
             $imgDoc->strNameLabel = 'Auction Item';
             $imgDoc->strName = strLinkView_AuctionItem($lFID, 'View Auction Item', true) . '&nbsp;' . 'item: ' . htmlspecialchars($row->ait_strItemName) . '<br>package: ' . htmlspecialchars($row->ap_strPackageName) . '<br>auction: ' . htmlspecialchars($row->auc_strAuctionName);
             break;
         case CENUM_CONTEXT_AUCTIONPACKAGE:
             $imgDoc->strNameLabel = 'Auction Package';
             $imgDoc->strName = strLinkView_AuctionPackageRecord($lFID, 'View Auction Package', true) . '&nbsp;' . 'package: ' . htmlspecialchars($row->ap_strPackageName) . '<br>auction: ' . htmlspecialchars($row->auc_strAuctionName);
             break;
         case CENUM_CONTEXT_BIZ:
             $imgDoc->strNameLabel = 'Business/Organization Name';
             $imgDoc->strName = strLinkView_BizRecord($lFID, 'View Business/Organization Record', true) . '&nbsp;' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . '&nbsp;&nbsp;<b>' . htmlspecialchars($row->pe_strLName) . '</b>';
             $imgDoc->strAddressLabel = 'Address';
             $imgDoc->strAddr = strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true);
             $strPhone = strPhoneCell($row->pe_strPhone, $row->pe_strCell);
             if ($strPhone != '') {
                 $imgDoc->strAddr .= '<br>' . $strPhone;
             }
             break;
         case CENUM_CONTEXT_SPONSORSHIP:
             $bBiz = (bool) $row->pe_bBiz;
             if ($bBiz) {
                 $imgDoc->strNameLabel = 'Sponsor (Business/organization)';
                 $imgDoc->strName = strLinkView_PeopleRecord($lFID, 'View People Record', true) . '&nbsp;' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . '&nbsp;&nbsp;<b>' . htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName) . '</b>';
             } else {
                 $imgDoc->strNameLabel = 'Sponsor (Individual)';
                 $imgDoc->strName = strLinkView_BizRecord($lFID, 'View Business/Organization Record', true) . '&nbsp;' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . '&nbsp;&nbsp;<b>' . htmlspecialchars($row->pe_strLName) . '</b>';
             }
             $imgDoc->strAddressLabel = 'Address';
             $imgDoc->strAddr = strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true);
             $strPhone = strPhoneCell($row->pe_strPhone, $row->pe_strCell);
             if ($strPhone != '') {
                 $imgDoc->strAddr .= '<br>' . $strPhone;
             }
             break;
         case CENUM_CONTEXT_ORGANIZATION:
             $imgDoc->strNameLabel = 'Your organization';
             $imgDoc->strName = strLinkView_OrganizationRecord($lFID, 'View organization record', true) . '&nbsp;' . htmlspecialchars($row->ch_strChapterName);
             break;
         case CENUM_CONTEXT_STAFF:
             $imgDoc->strNameLabel = 'Staff Member';
             $imgDoc->strName = strLinkView_User($lFID, 'View staff member record', true) . '&nbsp;' . htmlspecialchars($row->strFirstName . ' ' . $row->strLastName);
             break;
         case CENUM_CONTEXT_VOLUNTEER:
             $imgDoc->strNameLabel = 'Name';
             $imgDoc->strName = strLinkView_Volunteer($lFID, 'View Volunteer Record', true) . '&nbsp;' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . '&nbsp;&nbsp;<b>' . htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName) . '</b>';
             $imgDoc->strAddressLabel = 'Address';
             $imgDoc->strAddr = strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true);
             $strPhone = strPhoneCell($row->pe_strPhone, $row->pe_strCell);
             if ($strPhone != '') {
                 $imgDoc->strAddr .= '<br>' . $strPhone;
             }
             break;
         default:
             screamForHelp($enumContext . ': image context not currently implemented<br>error on line  <b> -- ' . __LINE__ . ' --</b>,<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__);
             break;
     }
 }
function showRelEntry($lPID, &$clsRel, $bA2B)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    if ($bA2B) {
        $strLinkPeopleA = '';
        $strLinkPeopleB = strLinkView_PeopleRecord($clsRel->lPerson_B_ID, 'View people record', true) . '&nbsp;';
    } else {
        $strLinkPeopleA = strLinkView_PeopleRecord($clsRel->lPerson_A_ID, 'View people record', true) . '&nbsp;';
        $strLinkPeopleB = '';
    }
    echoT('
         <tr>');
    echoT('
            <td>' . strLinkEdit_Relationship($clsRel->lRelID, $bA2B, 'Edit relationship', true) . '
            </td>
            <td>' . strLinkRem_Relationship($clsRel->lRelID, $lPID, 'Remove relationship', true, true) . '
            </td>');
    if ($clsRel->bSoftDonations) {
        echoT('<td><img src="' . IMGLINK_DOLLAR . '" border="0" title="Soft cash relationship"></td>');
    } else {
        echoT('<td>&nbsp;</td>');
    }
    echoT('
            <td>' . $strLinkPeopleA . htmlspecialchars($clsRel->strAFName . ' ' . $clsRel->strALName) . ' is <b>' . htmlspecialchars($clsRel->strRelationship) . '</b> to ' . $strLinkPeopleB . htmlspecialchars($clsRel->strBFName . ' ' . $clsRel->strBLName) . '
             </td>');
    echoT('</tr>');
}
 private function strVolHoursRptViaEventHTML($reportID, &$query, $newReportID)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $lEventBase = -999;
     $strOut = '';
     foreach ($query->result() as $row) {
         $lEventID = $row->ved_lVolEventID;
         if ($lEventBase != $lEventID) {
             if ($lEventBase > 0) {
                 $strOut .= '
                 <tr>
                    <td class="enpRpt" style="text-align: left; font-weight: bold;" colspan="3">
                       Total Hours
                    </td>
                    <td class="enpRpt" style="width: 50px; text-align: right; font-weight: bold;">' . number_format($dSumHours, 2) . '
                    </td>
                 </tr>';
                 $strOut .= '</table><br><br>';
             }
             $lEventBase = $lEventID;
             $dSumHours = 0;
             $strOut .= '<table class="enpRptC" style="width: 500px;">
                       <tr>
                          <td class="enpRptTitle" colspan="6">
                             Event: ' . htmlspecialchars($row->vem_strEventName) . '&nbsp;' . strLinkView_VolEvent($lEventID, 'View Event', true) . '
                          </td>
                       </tr>
                       <tr>
                          <td class="enpRptLabel" style="width: 60px;">
                             vol ID
                          </td>
                          <td class="enpRptLabel" style="width: 70px;">
                             people ID
                          </td>
                          <td class="enpRptLabel">
                             Name
                          </td>
                          <td class="enpRptLabel" style="width: 50px;">
                             Hours
                          </td>
                       </tr>';
         }
         $lVolID = $row->vsa_lVolID;
         $lPID = $row->pe_lKeyID;
         $dHours = $row->dHours;
         $dSumHours += $dHours;
         $fIDs = array($lVolID, $lEventID);
         $strOut .= '
           <tr class="makeStripe">
              <td class="enpRpt" style="width: 60px; text-align: center;">' . strLinkView_Volunteer($lVolID, 'View Volunteer Record', true) . '&nbsp;' . str_pad($lVolID, 5, '0', STR_PAD_LEFT) . '
              </td>
              <td class="enpRpt" style="width: 70px; text-align: center;">' . strLinkView_PeopleRecord($lPID, 'View People Record', true) . '&nbsp;' . str_pad($lPID, 5, '0', STR_PAD_LEFT) . '
              </td>
              <td class="enpRpt">' . htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName) . '
              </td>
              <td class="enpRpt" style="width: 50px; text-align: right;">' . number_format($dHours, 2) . '&nbsp;' . strLinkView_RptDetailGeneric($newReportID, $fIDs, 'View details', true) . '
              </td>
           </tr>';
     }
     $strOut .= '
        <tr>
           <td class="enpRpt" style="text-align: left; font-weight: bold;" colspan="3">
              Total Hours
           </td>
           <td class="enpRpt" style="width: 50px; text-align: right; font-weight: bold;">' . number_format($dSumHours, 2) . '
           </td>
        </tr>';
     $strOut .= '</table><br><br>';
     return $strOut;
 }
function showItemInfo(&$clsRpt, $lNumItems, &$items, $lPackageID)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $attributes = new stdClass();
    $attributes->divID = 'aucENPItems';
    $attributes->divImageID = 'aucENPItemsDivImg';
    openBlock('Items', strLinkView_AuctionItemsViaPID($lPackageID, 'View package items', true) . '&nbsp;' . strLinkView_AuctionItemsViaPID($lPackageID, 'View package items', false) . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkAdd_AuctionItem($lPackageID, 'Add new item', true) . '&nbsp;' . strLinkAdd_AuctionItem($lPackageID, 'Add new item', false), $attributes);
    if ($lNumItems == 0) {
        echoT('<i>There are no items assigned to this package.</i>');
    } else {
        echoT('
            <table class="enpRpt">
               <tr>
                  <td class="enpRptLabel">
                     Item ID
                  </td>
                  <td class="enpRptLabel">
                     Est. Value
                  </td>
                  <td class="enpRptLabel">
                     Out-of-Pocket
                  </td>
                  <td class="enpRptLabel">
                     Name
                  </td>
                  <td class="enpRptLabel">
                     Provided By
                  </td>
               </tr>');
        $curTotOOP = $curTotEst = 0.0;
        foreach ($items as $item) {
            $lItemID = $item->lKeyID;
            $bBiz = $item->itemDonor_bBiz;
            $lDonorID = $item->lItemDonorID;
            $curTotOOP += $item->curOutOfPocket;
            $curTotEst += $item->curEstAmnt;
            if ($bBiz) {
                $strName = strLinkView_BizRecord($lDonorID, 'View business record', true) . '&nbsp;' . $item->itemDonor_safeName . ' (business)';
            } else {
                $strName = strLinkView_PeopleRecord($lDonorID, 'View people record', true) . '&nbsp;' . $item->itemDonor_safeName;
            }
            echoT('
                  <tr>
                     <td class="enpRpt" style="text-align: center;">' . str_pad($lItemID, 6, '0', STR_PAD_LEFT) . '&nbsp' . strLinkView_AuctionItem($lItemID, 'View auction item', true) . '
                     </td>
                     <td class="enpRpt" style="text-align: right;">' . number_format($item->curEstAmnt, 2) . '
                     </td>
                     <td class="enpRpt" style="text-align: right;">' . number_format($item->curOutOfPocket, 2) . '
                     </td>
                     <td class="enpRpt">' . $item->strSafeItemName . '
                     </td>
                     <td class="enpRpt">' . $strName . '
                     </td>
                  </tr>');
        }
        echoT('
                  <tr>
                     <td class="enpRpt"><b>
                        Total:</b>
                     </td>
                     <td class="enpRpt" style="text-align: right;"><b>' . number_format($curTotEst, 2) . '</b>
                     </td>
                     <td class="enpRpt" style="text-align: right;"><b>' . number_format($curTotOOP, 2) . '</b>
                     </td>
                     <td class="enpRpt">
                        &nbsp;
                     </td>
                     <td class="enpRpt">
                        &nbsp;
                     </td>
                  </tr>');
        echoT('</table>');
    }
    $attributes = new stdClass();
    $attributes->bCloseDiv = true;
    closeBlock($attributes);
}
 private function giftNotesSearch(&$results)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $genumDateFormat;
     $results->strLabel = 'Gift notes';
     $results->lNumResults = 0;
     $cACO = new madmin_aco();
     $sqlStr = 'SELECT
            gi_lKeyID, gi_lForeignID, gi_curAmnt, gi_lACOID,
            gi_dteDonation,
            gi_strNotes,
            pe_strLName, pe_strFName, pe_bBiz, gi_lSponsorID
         FROM gifts
            INNER JOIN people_names ON pe_lKeyID=gi_lForeignID
         WHERE NOT gi_bRetired
            AND NOT pe_bRetired AND ' . $this->textSearchWhere('gi_strNotes') . '
         ORDER BY pe_strLName, pe_strFName, gi_lKeyID;';
     $query = $this->db->query($sqlStr);
     $results->lNumResults = $lNumRows = $query->num_rows();
     if ($lNumRows > 0) {
         $idx = 0;
         $results->matches = array();
         foreach ($query->result() as $row) {
             $results->matches[$idx] = new stdClass();
             $match =& $results->matches[$idx];
             $lGiftID = $row->gi_lKeyID;
             $lFID = $row->gi_lForeignID;
             $strFID = str_pad($lFID, 5, '0', STR_PAD_LEFT);
             $bBiz = $row->pe_bBiz;
             $lACOID = $row->gi_lACOID;
             $bSponPay = !is_null($row->gi_lSponsorID);
             $cACO->loadCountries(false, false, true, $lACOID);
             $giftACO =& $cACO->countries[0];
             if ($bSponPay) {
                 $match->links = 'Sponsor Payment ID ' . str_pad($lGiftID, 5, '0', STR_PAD_LEFT) . strLinkView_SponsorPayment($lGiftID, 'View payment record', true) . '&nbsp;&nbsp;&nbsp;';
             } else {
                 $match->links = 'Gift ID ' . str_pad($lGiftID, 5, '0', STR_PAD_LEFT) . strLinkView_GiftsRecord($lGiftID, 'View gift record', true) . '&nbsp;&nbsp;&nbsp;';
             }
             $match->searchInfo = 'Donation record of ' . $giftACO->strCurrencySymbol . ' ' . number_format($row->gi_curAmnt, 2) . ' ' . $giftACO->strFlagImg . ' of ' . date($genumDateFormat, dteMySQLDate2Unix($row->gi_dteDonation)) . ' by ';
             if ($bBiz) {
                 $match->links .= 'Business ID: ' . $strFID . strLinkView_BizRecord($lFID, 'View business record', true);
                 $match->searchInfo .= htmlspecialchars($row->pe_strLName);
             } else {
                 $match->links .= 'People ID: ' . $strFID . strLinkView_PeopleRecord($lFID, 'View people record', true);
                 $match->searchInfo .= htmlspecialchars($row->pe_strFName . ' ' . $row->pe_strLName);
             }
             $match->text = $row->gi_strNotes;
             $match->textHighlighted = $this->highlightMatchedText($row->gi_strNotes);
             ++$idx;
         }
     }
 }
function writeGiftHistoryRow($idx, $lPID, $clsGH, &$curTotal)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $genumDateFormat;
    $lGiftID = $clsGH->gi_lKeyID;
    $lDonorID = $clsGH->gi_lForeignID;
    $lSponsorID = $clsGH->gi_lSponsorID;
    $bSoft = $lDonorID != $lPID;
    $bBiz = $clsGH->pe_bBiz;
    if ($bSoft) {
        if ($bBiz) {
            $strLink = strLinkView_BizRecord($lDonorID, 'View business record ' . str_pad($lDonorID, 5, '0', STR_PAD_LEFT), true) . ' ';
        } else {
            $strLink = strLinkView_PeopleRecord($lDonorID, 'View people record ' . str_pad($lDonorID, 5, '0', STR_PAD_LEFT), true) . ' ';
        }
        $strFontStyle = 'font-style:italic; color: #666;';
    } else {
        $strLink = '';
        $strFontStyle = '';
    }
    if ($bBiz) {
        $strDonor = htmlspecialchars($clsGH->pe_strLName);
    } else {
        $strDonor = htmlspecialchars($clsGH->pe_strLName . ', ' . $clsGH->pe_strFName);
    }
    if ($clsGH->gi_bGIK) {
        $strGH = '<br><small>in-kind: ' . $clsGH->strGIK . '</small>';
    } else {
        $strGH = '';
    }
    if (is_null($lSponsorID)) {
        $strSponID = '&nbsp;';
        $strGiftLink = strLinkView_GiftsRecord($lGiftID, 'View gift record', true);
    } else {
        if (bAllowAccess('showSponsors')) {
            $strSponID = strLinkView_Sponsorship($lSponsorID, 'view sponsorship', true) . ' ' . str_pad($lSponsorID, 5, '0', STR_PAD_LEFT);
        } else {
            $strSponID = '&nbsp;';
        }
        $strGiftLink = strLinkView_SponsorPayment($lGiftID, 'View sponsorship payment record', true);
    }
    $strFlags = '';
    if ($clsGH->bHon) {
        $strFlags .= ' H';
    }
    if ($clsGH->bMem) {
        $strFlags .= ' M';
    }
    $strFlags = trim($strFlags);
    if ($strFlags == '') {
        $strFlags = '&nbsp;';
    }
    $curTotal += $clsGH->gi_curAmnt;
    echoT('
         <tr class="makeStripe">
            <td class="enpRpt" style="' . $strFontStyle . ' text-align:center; width: 15pt;">' . $idx . '
            </td>
            <td class="enpRpt" style="' . $strFontStyle . ' width: 50pt;">' . $strGiftLink . ' ' . str_pad($lGiftID, 5, '0', STR_PAD_LEFT) . '
            </td>
            <td class="enpRpt" style="text-align: right;' . $strFontStyle . ' width: 60pt;">' . number_format($clsGH->gi_curAmnt, 2) . '
            </td>
            <td class="enpRpt" style="text-align: center;' . $strFontStyle . ' width: 60pt;">' . date($genumDateFormat, $clsGH->gi_dteDonation) . '
            </td>
            <td class="enpRpt" style="' . $strFontStyle . ' width: 140pt;">' . $strLink . $strDonor . '
            </td>
            <td class="enpRpt" style="' . $strFontStyle . ' width: 70pt;">' . htmlspecialchars($clsGH->ga_strAccount) . '
            </td>
            <td class="enpRpt" style="' . $strFontStyle . ' width: 130pt;">' . htmlspecialchars($clsGH->gc_strCampaign) . $strGH . '
            </td>');
    if (bAllowAccess('showSponsors')) {
        echoT('
            <td class="enpRpt" style="text-align: center;' . $strFontStyle . ' width: 50pt;">' . $strSponID . '
            </td>');
    }
    echoT('
            <td class="enpRpt" style="text-align: center;' . $strFontStyle . ' width: 30pt;">' . $strFlags . '
            </td>
         </tr>');
}
 function strSponMonthIncomeReport(&$sRpt, &$displayData, $lStartRec, $lRecsPerPage)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $genumDateFormat;
     $strOut = '';
     $strLimit = " LIMIT {$lStartRec}, {$lRecsPerPage} ";
     $this->sponIncomeViaMonthVars($sRpt, $lYear, $lMonth, $lACOID);
     $cACO = new madmin_aco();
     $cACO->loadCountries(false, true, true, $lACOID);
     $cCountry = $cACO->countries[0];
     $strOut = '<table class="enpView">
         <tr>
            <td class="enpViewLabel" colspan="2" style="text-align: left; font-size: 13pt;">
               Sponsorship Income
            </td>
         </tr>
         <tr>
            <td class="enpViewLabel">
               Accounting Country:
            </td>
            <td class="enpView">' . $cCountry->strName . ' ' . $cCountry->strCurrencySymbol . ' ' . $cCountry->strFlagImg . '
            </td>
         </tr>
         <tr>
            <td class="enpViewLabel">
               Month:
            </td>
            <td class="enpView">' . strXlateMonth($lMonth) . ' ' . $lYear . '
            </td>
         </tr>
      </table>';
     $sqlStr = "SELECT\n            gi_lKeyID, gi_lSponsorID,\n            gi_dteDonation,\n            gi_curAmnt, gi_lForeignID, sp_lForeignID,\n            payer.pe_bBiz AS bPayerBiz, payer.pe_strLName AS strPayerLName, payer.pe_strFName AS strPayerFName,\n            payer.pe_strAddr1, payer.pe_strAddr2, payer.pe_strCity, payer.pe_strState, payer.pe_strZip, payer.pe_strCountry,\n            spon.pe_bBiz AS bSponBiz, spon.pe_strLName AS strSponLName, spon.pe_strFName AS strSponFName\n         FROM gifts\n            INNER JOIN people_names AS payer ON gi_lForeignID=payer.pe_lKeyID\n            INNER JOIN sponsor               ON gi_lSponsorID=sp_lKeyID\n            INNER JOIN people_names AS spon  ON sp_lForeignID=spon.pe_lKeyID\n\n         WHERE NOT gi_bRetired\n            AND gi_lACOID={$lACOID}\n            AND MONTH(gi_dteDonation)={$lMonth}\n            AND YEAR (gi_dteDonation)={$lYear}\n            AND gi_lSponsorID IS NOT NULL\n         ORDER BY gi_dteDonation, gi_lKeyID\n         {$strLimit};";
     $query = $this->db->query($sqlStr);
     $lNumRows = $query->num_rows();
     if ($lNumRows > 0) {
         $strOut .= '
         <table class="enpRptC">
            <tr>
               <td class="enpRptLabel">
                  Payment ID
               </td>
               <td class="enpRptLabel">
                  Sponsor ID
               </td>
               <td class="enpRptLabel">
                  Amount
               </td>
               <td class="enpRptLabel">
                  Date
               </td>
               <td class="enpRptLabel">
                  Payer
               </td>
               <td class="enpRptLabel">
                  Sponsor
               </td>
            </tr>';
         foreach ($query->result() as $row) {
             $lPayID = $row->gi_lKeyID;
             $lSponsorID = $row->gi_lSponsorID;
             $lSponsorFID = $row->sp_lForeignID;
             $lPayerID = $row->gi_lForeignID;
             // gift ID
             $strOut .= '
             <tr>
                <td class="enpRpt" style="text-align: center;">' . strLinkView_SponsorPayment($lPayID, 'View payment record', true) . '&nbsp;' . str_pad($lPayID, 5, '0', STR_PAD_LEFT) . '
                </td>';
             // sponsor ID
             $strOut .= '
                <td class="enpRpt" style="text-align: center;">' . strLinkView_Sponsorship($lSponsorID, 'View sponsorship record', true) . '&nbsp;' . str_pad($lSponsorID, 5, '0', STR_PAD_LEFT) . '
                </td>';
             // Amount
             $strOut .= '
                <td class="enpRpt" style="text-align: right; padding-left: 14px;">' . number_format($row->gi_curAmnt, 2) . '
                </td>';
             // Date
             $strOut .= '
                <td class="enpRpt" style="text-align: right;">' . date($genumDateFormat, dteMySQLDate2Unix($row->gi_dteDonation)) . '
                </td>';
             // Payer
             if ($row->bPayerBiz) {
                 $strName = strLinkView_BizRecord($lPayerID, 'View business record', true) . '&nbsp;' . str_pad($lPayerID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . htmlspecialchars($row->strPayerLName) . ' (business)';
             } else {
                 $strName = strLinkView_PeopleRecord($lPayerID, 'View people record', true) . '&nbsp;' . str_pad($lPayerID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . htmlspecialchars($row->strPayerLName . ', ' . $row->strPayerFName);
             }
             $strOut .= '
                <td class="enpRpt" >' . $strName . '
                </td>';
             // Sponsor
             if ($lPayerID == $lSponsorFID) {
                 $strName = '<span style="color: #999; font-style: italic;">(same as payer)';
             } else {
                 if ($row->bSponBiz) {
                     $strName = strLinkView_BizRecord($lSponsorFID, 'View business record', true) . '&nbsp;' . str_pad($lSponsorFID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . htmlspecialchars($row->strSponLName) . ' (business)';
                 } else {
                     $strName = strLinkView_PeopleRecord($lSponsorFID, 'View people record', true) . '&nbsp;' . str_pad($lSponsorFID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . htmlspecialchars($row->strSponLName . ', ' . $row->strSponFName);
                 }
             }
             $strOut .= '
                <td class="enpRpt" >' . $strName . '
                </td>';
             $strOut . '
             </tr>';
         }
         $strOut .= '</table>';
     } else {
         $strOut .= '<br><br><i>There are no records that match your search criteria</i><br>';
     }
     return $strOut;
 }
 } else {
     foreach ($vols as $vol) {
         $bInactive = $vol->bInactive;
         $lVolID = $vol->lKeyID;
         $lPID = $vol->lPeopleID;
         if ($bInactive) {
             $strColor = ' color: #888;';
         } else {
             $strColor = '';
         }
         echoT($clsRpt->openRow(true));
         if ($showFields->bVolID) {
             echoT($clsRpt->writeCell(strLinkView_Volunteer($lVolID, 'View volunteer record', true) . '&nbsp;' . str_pad($lVolID, 5, '0', STR_PAD_LEFT), 60, 'text-align: center;' . $strColor));
         }
         if ($showFields->bPeopleID) {
             echoT($clsRpt->writeCell(strLinkView_PeopleRecord($lPID, 'View people record', true) . '&nbsp;' . str_pad($lPID, 5, '0', STR_PAD_LEFT), 60, 'text-align: center;' . $strColor));
         }
         if ($showFields->bActiveInactive) {
             echoT($clsRpt->writeCell($vol->bInactive ? 'No' : 'Yes', 60, 'text-align: center;' . $strColor));
         }
         if ($showFields->bName) {
             echoT($clsRpt->writeCell($vol->strSafeNameLF . '<br>' . strLinkView_Household($vol->lHouseholdID, $lPID, 'View household', true) . '<i>' . htmlspecialchars($vol->strHouseholdName) . '</i>', 240, $strColor));
         }
         if ($showFields->bAddress) {
             echoT($clsRpt->writeCell($vol->strAddress, 160, $strColor));
         }
         if ($showFields->bPhoneEmail) {
             echoT($clsRpt->writeCell(strPhoneCell($vol->strPhone, $vol->strCell, true, true) . '<br>' . $vol->strEmailFormatted, 100, $strColor));
         }
         if ($showFields->bSkills) {
             if ($vol->lNumJobSkills == 0) {
function showHonMemList($honMemTable, $bHon, $strLabel, $numGifts)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    echoT('<table class="enpRptC">');
    if ($bHon) {
        echoT('
         <tr>
            <td class="enpRptLabel">
               HonMemID
            </td>
            <td class="enpRptLabel">
               &nbsp;
            </td>
            <td class="enpRptLabel">
               &nbsp;
            </td>
            <td class="enpRptLabel">
               Person being honored
            </td>
            <td class="enpRptLabel">
               Gifts
            </td>
         </tr>');
    } else {
        echoT('
         <tr>
            <td class="enpRptLabel">
               HonMemID
            </td>
            <td class="enpRptLabel">
               &nbsp;
            </td>
            <td class="enpRptLabel">
               &nbsp;
            </td>
            <td class="enpRptLabel">
               Person being memorialized
            </td>
            <td class="enpRptLabel">
               Contact for memorials
            </td>
            <td class="enpRptLabel">
               Gifts
            </td>
         </tr>');
    }
    $idx = 0;
    foreach ($honMemTable as $clsHM) {
        $bHidden = $clsHM->ghm_bHidden;
        $lHMID = $clsHM->ghm_lKeyID;
        if ($bHidden) {
            $strStyle = 'color: #aaa; font-style:italic;';
        } else {
            $strStyle = '';
        }
        echoT('
         <tr class="makeStripe">
            <td class="enpRpt" style="text-align: center; ' . $strStyle . '">' . str_pad($clsHM->ghm_lKeyID, 5, '0', STR_PAD_LEFT) . '
            </td>
            <td class="enpRpt" style="' . $strStyle . '">' . strLinkHideUnhide_HonMem($lHMID, !$bHidden, $bHon, $bHidden ? 'Un-hide entry' : 'Hide entry', true) . '
            </td>
            <td class="enpRpt" style="' . $strStyle . '">' . strLinkRem_HonMem($lHMID, $bHon, 'Remove this ' . $strLabel, true, true) . '
            </td>
            <td class="enpRpt" style="' . $strStyle . '">' . strLinkView_PeopleRecord($clsHM->ghm_lFID, 'View people record', true) . $clsHM->honorMem->strSafeNameLF . '<br>' . $clsHM->honorMem->strAddress . '
            </td>');
        if (!$bHon) {
            $lMCID = $clsHM->ghm_lMailContactID;
            if (is_null($lMCID)) {
                $strMCEntry = '<font color="red">NOT SET</font> ' . strLinkAdd_HonMem(false, true, $lHMID, 'Add mail contact for this memorial', true);
            } else {
                $strMCEntry = $clsHM->mailContact->strSafeNameLF . ' ' . strLinkView_PeopleRecord($lMCID, 'View mail contact\'s people record', true) . strLinkRem_HonMemMailCon($lHMID, 'Remove this mail contact', true, true) . '<br>' . $clsHM->mailContact->strAddress;
            }
            echoT('
            <td class="enpRpt" style="' . $strStyle . '">' . $strMCEntry . '
            </td>');
        }
        $lNumGifts = $numGifts[$idx];
        if ($lNumGifts > 0) {
            $strLinkGifts = strLinkView_GiftsViaHM($lHMID, 'View gifts', true);
        } else {
            $strLinkGifts = '';
        }
        echoT('
            <td class="enpRpt" style="text-align: center; ' . $strStyle . '">' . number_format($lNumGifts) . ' ' . $strLinkGifts . '
            </td>
         </tr>');
        ++$idx;
    }
    echoT('</table>');
}
$params = array('enumStyle' => 'enpRptC');
$clsRpt = new generic_rpt($params);
echoT('<br>' . $clsRpt->openReport());
echoT($clsRpt->writeTitle($strRptTitle, '', '', 6));
echoT($clsRpt->openRow(true));
echoT($clsRpt->writeLabel('PeopleID', 60));
//   echoT($clsRpt->writeLabel('&nbsp;',     20));
echoT($clsRpt->writeLabel('Name', 150));
echoT($clsRpt->writeLabel('Address'));
echoT($clsRpt->writeLabel('Phone/Email'));
echoT($clsRpt->writeLabel('Business Relationships'));
echoT($clsRpt->closeRow());
foreach ($bizRecs as $bz) {
    $lPID = $bz->lPeopleID;
    echoT($clsRpt->openRow(true));
    echoT($clsRpt->writeCell(strLinkView_PeopleRecord($lPID, 'View people record', true) . '&nbsp;' . str_pad($lPID, 5, '0', STR_PAD_LEFT), 60));
    echoT($clsRpt->writeCell($bz->strSafeNameLF, 210));
    echoT($clsRpt->writeCell($bz->strAddress, 160));
    echoT($clsRpt->writeCell(strPhoneCell($bz->strPhone, $bz->strCell, true, true) . '<br>' . $bz->strEmailFormatted));
    if ($bz->lNumBiz == 0) {
        echoT($clsRpt->writeCell('<i>none</i>', 260));
    } else {
        $strOut = '<table width="100%">' . "\n";
        foreach ($bz->biz as $biz) {
            if ($biz->bSoftCash) {
                $strSoft = '<img src="' . IMGLINK_DOLLAR . '" border="0" title="Soft cash relationship">';
            } else {
                $strSoft = '';
            }
            if ($biz->strRelationship . '' == '') {
                $strRel = '&nbsp;';
                      Shift: <b>' . htmlspecialchars($shift->strShiftName) . '</b> <font style="font-size: 9pt;">(' . date('g:i A', $shift->dteEventStartTime) . '&nbsp;/&nbsp;' . $shift->enumDuration . ')</font>
                   </td>
                </tr>');
                if ($shift->lNumVols == 0) {
                    echoT('<tr>
                         <td style="width: ' . $lIndent . 'pt;">&nbsp;</td>
                         <td style="width: ' . $lIndent . 'pt;">&nbsp;</td>
                         <td colspan="3" style="font-size: 9pt;">
                            <i>No volunteers</i>
                         </td>
                      </tr>');
                } else {
                    foreach ($shift->vols as $vol) {
                        echoT('<tr>
                         <td style="width: ' . $lIndent . 'pt;">&nbsp;</td>
                         <td style="width: ' . $lIndent . 'pt;">&nbsp;</td>
                         <td colspan="3" style="font-size: 9pt;">' . $vol->strSafeNameFL . '&nbsp;' . strLinkView_PeopleRecord($vol->lPeopleID, 'View people record', true) . '
                         </td>
                      </tr>');
                    }
                }
            }
        }
        echoT('<tr><td colspan="5">&nbsp;</td></tr>');
    }
    echoT('</table>');
}
/*
echo('<font class="debug">'.substr(__FILE__, strrpos(__FILE__, '\\'))
   .': '.__LINE__.'<pre>'); print_r($dates); echo('</pre></font><br>');    
*/
function writeAuctionItemsTable(&$package, &$items, $bDescriptions)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $lPackageID = $package->lKeyID;
    echoT('
         <table class="enpRpt">
            <tr>
               <td class="enpRptTitle" colspan="8">
                  Items in the package <b>"' . $package->strPackageSafeName . '"</b>
               </td>
            </tr>');
    echoT('
         <tr>
            <td class="enpRptLabel">
               item ID
            </td>
            <td class="enpRptLabel">
               &nbsp;
            </td>
            <td class="enpRptLabel">
               &nbsp;
            </td>
            <td class="enpRptLabel">
               Name
            </td>
            <td class="enpRptLabel">
               Est. Value
            </td>
            <td class="enpRptLabel">
               Out of Pocket
            </td>
            <td class="enpRptLabel">
               From
            </td>
         </tr>');
    $curTotVal = $curTotOOP = 0.0;
    foreach ($items as $item) {
        $lItemID = $item->lKeyID;
        if ($item->itemDonor_bBiz) {
            $strNameLink = ' <i>(business)</i> ' . strLinkView_BizRecord($item->lItemDonorID, 'View business record', true);
        } else {
            $strNameLink = ' ' . strLinkView_PeopleRecord($item->lItemDonorID, 'View people record', true);
        }
        echoT('
            <tr class="makeStripe">
               <td class="enpRpt" style="text-align: center; width: 20pt;">' . str_pad($lItemID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_AuctionItem($lItemID, 'View auction item', true) . '
               </td>
               <td class="enpRpt" style="text-align: center;">' . strLinkEdit_AuctionItem($lPackageID, $lItemID, 'Edit Item', true) . '
               </td>
               <td class="enpRpt" style="text-align: center; width: 20pt;">' . strLinkRem_AuctionItem($lPackageID, $lItemID, 'Remove auction item', true, true) . '
               </td>
               <td class="enpRpt" style="width: 140pt;">' . $item->strSafeItemName . '
               </td>
               <td class="enpRpt" style="width: 40pt; text-align: right;">' . number_format($item->curEstAmnt, 2) . '
               </td>
               <td class="enpRpt" style="width: 40pt; text-align: right;">' . number_format($item->curOutOfPocket, 2) . '
               </td>
               <td class="enpRpt" style="width: 110pt;">' . $item->itemDonor_safeName . $strNameLink . '
               </td>
            </tr>');
        $curTotVal += $item->curEstAmnt;
        $curTotOOP += $item->curOutOfPocket;
    }
    echoT('
         <tr class="makeStripe">
            <td class="enpRpt" colspan="4">
               <b>Total:</b>
            </td>
            <td class="enpRpt" style="width: 40pt; text-align: right;"><b>' . number_format($curTotVal, 2) . '</b>
            </td>
            <td class="enpRpt" style="width: 40pt; text-align: right;"><b>' . number_format($curTotOOP, 2) . '</b>
            </td>
            <td colspan="2">
               &nbsp;
            </td>
         </tr>');
    echoT('
         </table><br>');
}
function showSponHonInfo(&$clsRpt, $lSponID, &$sponRec, $bInactive)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    if ($bInactive) {
        $strLink = '';
    } else {
        if ($sponRec->bHonoree) {
            $strLink = strLinkRem_SponsorHonoree($lSponID, 'Remove honoree', true, true) . '&nbsp;' . strLinkRem_SponsorHonoree($lSponID, 'Remove honoree', false, true);
        } else {
            $strLink = strLinkAdd_SponHonoree($lSponID, 'Add sponsorship honoree', true) . '&nbsp;' . strLinkAdd_SponHonoree($lSponID, 'Add sponsorship honoree', false);
        }
    }
    $attributes = new stdClass();
    $attributes->lTableWidth = 900;
    $attributes->divID = 'sponHon';
    $attributes->divImageID = 'sponHonDivImg';
    openBlock('Honoree Info', $strLink, $attributes);
    if ($sponRec->bHonoree) {
        $lHonFID = $sponRec->lHonoreeID;
        if ($sponRec->bHonBiz) {
            $strLinkHon = strLinkView_Biz($lHonFID, 'View business record', true);
        } else {
            $strLinkHon = strLinkView_PeopleRecord($lHonFID, 'View people record', true);
        }
        echoT($clsRpt->openReport());
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Honoree:') . $clsRpt->writeCell($strLinkHon . $sponRec->strHonSafeNameFL) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Address:') . $clsRpt->writeCell(strBuildAddress($sponRec->strHonAddr1, $sponRec->strHonAddr2, $sponRec->strHonCity, $sponRec->strHonState, $sponRec->strHonCountry, $sponRec->strHonZip, true)) . $clsRpt->closeRow());
        echoT($clsRpt->closeReport(''));
    } else {
        echoT('<i>There is no honoree associated with this sponsorship</i>');
    }
    $attributes = new stdClass();
    $attributes->bCloseDiv = true;
    closeBlock($attributes);
}
function showPeopleInfo($clsDateTime, $clsRpt, $person)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $lPID = $person->lKeyID;
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('People ID:') . $clsRpt->writeCell(strLinkView_PeopleRecord($lPID, 'View people record', true) . '&nbsp;' . str_pad($lPID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow());
    // Name
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Name:') . $clsRpt->writeCell($person->strSafeNameLF) . $clsRpt->closeRow());
    // Address
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Address:') . $clsRpt->writeCell($person->strAddress) . $clsRpt->closeRow());
    // Phone
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Phone:') . $clsRpt->writeCell(htmlspecialchars(strPhoneCell($person->strPhone, $person->strCell))) . $clsRpt->closeRow());
}
Beispiel #27
0
 public function volHTMLSummary($idx)
 {
     //-----------------------------------------------------------------------
     // assumes user has called $clsVol->loadVolRecs(...
     //-----------------------------------------------------------------------
     global $gdteNow, $genumDateFormat;
     $strOut = '';
     $params = array('enumStyle' => 'terse');
     $clsRpt = new generic_rpt($params);
     $clsRpt->setEntrySummary();
     $lVolID = $this->volRecs[$idx]->lKeyID;
     $volRec =& $this->volRecs[$idx];
     $lPID = $volRec->lPeopleID;
     $strOut .= $clsRpt->openReport('', '') . $clsRpt->openRow(false) . $clsRpt->writeLabel('Name:') . $clsRpt->writeCell($volRec->strSafeName . '&nbsp;&nbsp;&nbsp;(people ID ' . str_pad($lPID, 5, '0', STR_PAD_LEFT) . strLinkView_PeopleRecord($lPID, 'View People Record', true) . ')') . $clsRpt->closeRow() . $clsRpt->openRow(false) . $clsRpt->writeLabel('Volunteer ID:') . $clsRpt->writeCell(str_pad($lVolID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_Volunteer($lVolID, 'View Volunteer Record', true)) . $clsRpt->closeRow();
     if ($volRec->bInactive) {
         $strVol = '<i>Inactive since ' . date($genumDateFormat, $volRec->dteInactive);
     } else {
         $strVol = 'Active';
     }
     $strOut .= $clsRpt->openRow(false) . $clsRpt->writeLabel('Volunteer Status:') . $clsRpt->writeCell($strVol) . $clsRpt->closeRow() . $clsRpt->openRow(false) . $clsRpt->writeLabel('Address:') . $clsRpt->writeCell($volRec->strAddress) . $clsRpt->closeRow() . $clsRpt->closeReport('');
     return $strOut;
 }
function strDisplayValueViaType($vVal, $enumType, $lTableID, $bAsTableRow, $lWidth = 0, $strClass = 'enpRpt', $strStyleExtra = '')
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gbDateFormatUS;
    $strAlign = 'left';
    switch ($enumType) {
        case CS_FT_HEADING:
            $strOut = $vVal;
            break;
        case CS_FT_LOG:
            $strOut = $vVal;
            break;
        case CS_FT_CHECKBOX:
            $strOut = $vVal ? 'Yes' : 'No';
            break;
        case CS_FT_DATE:
            $strAlign = 'center';
            if ($vVal . '' == '') {
                $strOut = '&nbsp;';
            } else {
                $strOut = strNumericDateViaMysqlDate($vVal, $gbDateFormatUS);
            }
            break;
        case CS_FT_DDL:
        case CS_FT_DDL_SPECIAL:
        case CS_FT_DDLMULTI:
        case CS_FT_TEXT80:
        case CS_FT_TEXT255:
        case CS_FT_TEXT20:
            $strOut = htmlspecialchars($vVal);
            break;
        case CS_FT_TEXT:
        case CS_FT_TEXTLONG:
            $strOut = nl2br(htmlspecialchars($vVal));
            break;
        case CS_FT_ID:
            $strAlign = 'center';
            $strOut = str_pad($vVal, 5, '0', STR_PAD_LEFT);
            switch ($lTableID) {
                case CL_STID_CLIENT:
                    $strOut .= '&nbsp;' . strLinkView_ClientRecord($vVal, 'View client record', true);
                    break;
                case CL_STID_GIFTS:
                    $strOut .= '&nbsp;' . strLinkView_GiftsRecord($vVal, 'View gift record', true);
                    break;
                case CL_STID_PEOPLEBIZ:
                    break;
                case CL_STID_PEOPLE:
                    $strOut .= '&nbsp;' . strLinkView_PeopleRecord($vVal, 'View people record', true);
                    break;
                case CL_STID_BIZ:
                    $strOut .= '&nbsp;' . strLinkView_BizRecord($vVal, 'View business/organization record', true);
                    break;
            }
            break;
        case CS_FT_INTEGER:
            $strAlign = 'right';
            if ($vVal . '' == '') {
                $strOut = '&nbsp;';
            } else {
                $strOut = number_format($vVal, 0);
            }
            break;
        case CS_FT_CURRENCY:
            $strAlign = 'right';
            if ($vVal . '' == '') {
                $strOut = '&nbsp;';
            } else {
                $strOut = number_format($vVal, 2);
            }
            break;
        default:
            screamForHelp($enumType . ': unexpected field type<br>error on line <b> -- ' . __LINE__ . ' --</b>,<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__);
            break;
    }
    if ($bAsTableRow) {
        if ($lWidth > 0) {
            $strStyle = ' style="width: ' . $lWidth . 'pt; ' . $strStyleExtra . ' text-align: ' . $strAlign . ';" ';
        } else {
            $strStyle = ' style="' . $strStyleExtra . ' text-align: ' . $strAlign . ';" ';
        }
        $strOut = '<td class="' . $strClass . '" ' . $strStyle . '>' . $strOut . '</td>';
    }
    return $strOut;
}
 if ($bInactive) {
     $strSpanInactive = '<span style="color: #999;">';
     $strStopSpan = '</span>';
 } else {
     $strSpanInactive = $strStopSpan = '';
 }
 echoT($clsRpt->openRow(true));
 if ($showFields->bSponsorID) {
     echoT($clsRpt->writeCell(strLinkView_Sponsorship($lSponID, 'View sponsorship record', true) . '&nbsp;' . $strSpanInactive . str_pad($lSponID, 5, '0', STR_PAD_LEFT) . $strStopSpan, '40', $strStyleExtra = 'text-align: center;'));
 }
 if ($showFields->bName) {
     if ($bBiz) {
         $strLink = strLinkView_BizRecord($lForeignID, 'View Business Record', true);
         $strName = htmlspecialchars($sponsor->strSponsorLName) . ' <i>(business)</i>';
     } else {
         $strLink = strLinkView_PeopleRecord($lForeignID, 'View People Record', true);
         $strName = htmlspecialchars($sponsor->strSponsorLName . ', ' . $sponsor->strSponsorFName);
     }
     $strName .= '<br>' . $strLink . '&nbsp;' . str_pad($lForeignID, 5, '0', STR_PAD_LEFT);
     if ($showFields->bSponAddr) {
         $strName .= '<br>' . $sponsor->strAddr;
     }
     echoT($clsRpt->writeCell($strSpanInactive . $strName . $strStopSpan, 175));
 }
 if ($showFields->bSponsorInfo) {
     if ($sponsor->bInactive) {
         $strDates = date($genumDateFormat, $sponsor->dteStart) . ' - ' . date($genumDateFormat, $sponsor->dteInactive) . '<br>Inactive';
     } else {
         $strDates = date($genumDateFormat, $sponsor->dteStart) . ' - now ';
     }
     echoT($clsRpt->writeCell($strSpanInactive . $strDates . '<br>program: ' . htmlspecialchars($sponsor->strSponProgram) . $strStopSpan));
function showSponsorsPayments(&$sponInfo, &$clsForm, &$linkOpts, &$validation)
{
    //                 $strSort, $lSponProgID, $lStartRec, $lRecsPerPage){
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    openSponsorPaymentTable($clsForm, $linkOpts);
    foreach ($sponInfo as $spon) {
        $lSponID = $spon->lKeyID;
        $lFID = $spon->lForeignID;
        echoT('<input type="hidden" name="hdnAOCID[' . $lSponID . ']" value="' . $spon->lCommitACO . '">' . "\n");
        echoT('<input type="hidden" name="hdnFID[' . $lSponID . ']"   value="' . $spon->lForeignID . '">' . "\n");
        if ($spon->bSponBiz) {
            $strFLink = 'bizID: ' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_BizRecord($lFID, 'View business record (new window)', true, 'target="_blank"');
        } else {
            $strFLink = 'peopleID: ' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_PeopleRecord($lFID, 'View people record (new window)', true, 'target="_blank"');
        }
        $strRadioName = 'rdoPayType' . $lSponID;
        $lClientID = $spon->lClientID;
        if (is_null($lClientID)) {
            $strClient = 'client: n/a';
        } else {
            $strClient = 'client: ' . str_pad($lClientID, 6, '0', STR_PAD_LEFT) . strLinkView_ClientRecord($lClientID, 'View client record (new window)', true, 'target="_blank"') . '&nbsp;' . $spon->strClientSafeNameFL;
        }
        echoT('
         <tr class="makeStripe">
            <td class="enpRpt" style="text-align: center;">' . str_pad($lSponID, 6, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_Sponsorship($lSponID, 'View sponsorship (new window)', true, 'target="_blank"') . '
            </td>');
        echoT('
            <td class="enpRpt" style="width: 230pt;"><b>' . $spon->strSponSafeNameLF . '</b><br>' . $strFLink . '<br>' . $strClient . '<br>
               program: ' . htmlspecialchars($spon->strSponProgram) . '
            </td>');
        echoT('
            <td class="enpRpt" style="text-align: right;">' . $spon->strCommitACOCurSym . '&nbsp;' . number_format($spon->curCommitment, 2) . '&nbsp;' . $spon->strCommitACOFlagImg . '
            </td>');
        echoT('
            <td class="enpRpt" style="vertical-align: top;">' . $spon->strCommitACOCurSym . '&nbsp;' . '<input type="text"
                     name="' . $spon->strAmountFN . '" style="width: 60pt; text-align: right;"
                     onChange="bUserDataEntered = true;"
                     value="' . $spon->txtAmount . '">' . $validation->amount[$lSponID] . '<br><span style="font-size: 8pt;">' . $spon->strLastPay . '</span>
            </td>');
        echoT('
            <td class="enpRpt">
               <table cellpadding="0" cellspacing="0">
                  <tr>
                     <td style="text-align: right; font-size: 8pt;">
                        check #:
                     </td>
                     <td>
                        <input type="text" style="width: 60pt;"
                           onChange="bUserDataEntered = true;"
                           name="' . $spon->strCheckFN . '"
                           value="' . $spon->txtCheckNum . '">
                     </tr>');
        echoT('     <tr>
                     <td style="text-align: right; vertical-align: top; font-size: 8pt; padding-top: 4px;">
                        payment type:
                     </td>
                     <td>' . $spon->strDDLPayType . $validation->paymentType[$lSponID] . '
                     </td>
                  </tr>');
        //----------------------
        // Payment Date
        //----------------------
        echoT('     <tr>
                     <td style="text-align: right; vertical-align: top; font-size: 8pt; padding-top: 6px;">
                        payment date:
                     </td>
                     <td>' . $clsForm->strGenericDatePicker('', 'txtPayDate' . $lSponID, true, $spon->txtPayDate, 'frmBatchPayments', 'datepicker' . $lSponID, '', true) . $validation->paymentDate[$lSponID] . '
                     </td>
                  </tr>');
        echoT('
               </table>
            </td>');
        echoT('
         </tr>');
        echoT(strDatePicker('datepicker' . $lSponID, true));
    }
    closeSponsorPaymentTable();
}