function showSponFinancialInfo(&$clsRpt, $lSponID, &$sponRec, &$financialSummary) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- $attributes = new stdClass(); $attributes->lTableWidth = 900; $attributes->divID = 'sponFin'; $attributes->divImageID = 'sponFinDivImg'; openBlock('Financials', strLinkView_SponsorFinancials($lSponID, 'View sponsorship financials', true) . ' ' . strLinkView_SponsorFinancials($lSponID, 'View sponsorship financials', false), $attributes); echoT($financialSummary); $attributes = new stdClass(); $attributes->bCloseDiv = true; closeBlock($attributes); }
//--------------------------- // client //--------------------------- if ($showFields->bClient) { $lClientID = $sponRec->lClientID; if (is_null($lClientID)) { if ($sponRec->bInactive) { $strClientInfo = '<i>Client not set</i>'; } else { $strClientInfo = '<i>Client not set</i><br>' . strLinkAdd_ClientToSpon($lSponsorID, 'Add client to sponsorship', false); } } else { $strClientInfo = '<b>' . $sponRec->strClientSafeNameLF . '</b><br>' . 'client ID: ' . strLinkView_ClientRecord($lClientID, 'View client record', true) . str_pad($lClientID, 5, '0', STR_PAD_LEFT) . '<br>' . htmlspecialchars($sponRec->strLocation) . '<br>' . 'birth/age: ' . $sponRec->strClientAgeBDay; if ($showFields->bProgram) { $strClientInfo .= '<br>' . htmlspecialchars($sponRec->strLocation); } } echoT(' <td class="enpRpt" style="width: 130pt;' . $strIStyle . '">' . $strClientInfo . ' </td>'); } //--------------------------- // financial commitment //--------------------------- if ($showFields->bCommitment) { echoT(' <td class="enpRpt" style="width: 80pt; text-align: right;' . $strIStyle . '">' . $sponRec->strCommitACOCurSym . ' ' . number_format($sponRec->curCommitment, 2) . ' ' . $sponRec->strCommitACOFlagImg . '<br>' . strLinkView_SponsorFinancials($lSponsorID, 'View sponsorship financials', true) . strLinkView_SponsorFinancials($lSponsorID, 'View financials', false) . ' </td>'); } } echoT('</table><br>');
private function strAttribRptSponsor(&$sRpt, $strLimit, $strAttrib, $strLabel) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $genumDateFormat; $this->load->model('sponsorship/msponsorship', 'clsSpon'); $params = array('enumStyle' => 'enpRptC'); $clsRpt = new generic_rpt($params); // $this->load->helper('dl_util/email_web'); $this->clsSpon->sponsorInfoGenericViaWhere(" AND sp_lAttributedTo {$strAttrib} ", $strLimit); $strOut = '<br>' . $clsRpt->openReport(); $strOut .= $clsRpt->writeTitle('Sponsorships ' . $strLabel, '', '', 7); $strOut .= $clsRpt->openRow(true); $strOut .= $clsRpt->writeLabel('SponsorID', 60) . $clsRpt->writeLabel('Active', 90) . $clsRpt->writeLabel('Sponsor', 150) . $clsRpt->writeLabel('Address') . $clsRpt->writeLabel('Client') . $clsRpt->writeLabel('Commitment') . $clsRpt->closeRow(); foreach ($this->clsSpon->sponInfo as $sponRec) { $lSponID = $sponRec->lKeyID; $lFID = $sponRec->lForeignID; if ($sponRec->bInactive) { $strIStyle = 'color: #999;'; $strActiveDates = 'sponsor dates: ' . date($genumDateFormat, $sponRec->dteStart) . ' - ' . date($genumDateFormat, $sponRec->dteInactive); } else { $strIStyle = ''; $strActiveDates = 'sponsor since: ' . date($genumDateFormat, $sponRec->dteStart); } $strOut .= $clsRpt->openRow(true); $strOut .= $clsRpt->writeCell(strLinkView_Sponsorship($lSponID, 'View sponsorship record', true) . ' ' . str_pad($lSponID, 5, '0', STR_PAD_LEFT), 60, $strIStyle); //--------------------------- // active state //--------------------------- $strOut .= $clsRpt->writeCell($strActiveDates, '', $strIStyle); if ($sponRec->bSponBiz) { $strLinkFID = 'business ID: ' . strLinkView_BizRecord($lFID, 'View business record', true); } else { $strLinkFID = 'people ID: ' . strLinkView_PeopleRecord($lFID, 'View people record', true); } $strLinkFID .= str_pad($lFID, 5, '0', STR_PAD_LEFT); //--------------------------- // sponsor name //--------------------------- $strHonoree = ''; if ($sponRec->bHonoree) { $lHFID = $sponRec->lHonoreeID; if ($sponRec->bHonBiz) { $strLinkHFID = 'business ID: ' . strLinkView_BizRecord($lHFID, 'View business record', true); } else { $strLinkHFID = 'people ID: ' . strLinkView_PeopleRecord($lHFID, 'View people record', true); } $strLinkHFID .= str_pad($lHFID, 5, '0', STR_PAD_LEFT); $strHonoree = '<br><br>Honoree: ' . $sponRec->strHonSafeNameLF . '<br>' . $strLinkHFID; } $strContact = '<b>' . $sponRec->strSponSafeNameLF . '</b>' . '<br>' . $strLinkFID . $strHonoree . '<br> program: ' . htmlspecialchars($sponRec->strSponProgram); $strOut .= $clsRpt->writeCell($strContact, '', $strIStyle); //--------------------------- // address / contact //--------------------------- $strAddr = strBuildAddress($sponRec->strSponAddr1, $sponRec->strSponAddr2, $sponRec->strSponCity, $sponRec->strSponState, $sponRec->strSponCountry, $sponRec->strSponZip, true); if ($sponRec->strSponEmail . '' != '') { $strAddr .= strBuildEmailLink($sponRec->strSponEmail, '<br>', false, ' style="' . $strIStyle . '"'); } $strPhone = strPhoneCell($sponRec->strSponPhone, $sponRec->strSponPhone, true, true); if ($strPhone != '') { $strAddr .= '<br>' . $strPhone; } $strOut .= $clsRpt->writeCell($strAddr, '', $strIStyle); //--------------------------- // client //--------------------------- $lClientID = $sponRec->lClientID; if (is_null($lClientID)) { if ($sponRec->bInactive) { $strClientInfo = '<i>Client not set</i>'; } else { $strClientInfo = '<i>Client not set</i><br>' . strLinkAdd_ClientToSpon($lSponID, 'Add client to sponsorship', false); } } else { $strClientInfo = '<b>' . $sponRec->strClientSafeNameLF . '</b><br>' . 'client ID: ' . strLinkView_ClientRecord($lClientID, 'View client record', true) . str_pad($lClientID, 5, '0', STR_PAD_LEFT) . '<br>' . htmlspecialchars($sponRec->strLocation) . '<br>' . 'birth/age: ' . $sponRec->strClientAgeBDay; $strClientInfo .= '<br>' . htmlspecialchars($sponRec->strLocation); } $strOut .= $clsRpt->writeCell($strClientInfo, '', $strIStyle); //--------------------------- // financial commitment //--------------------------- $strOut .= $clsRpt->writeCell($sponRec->strCommitACOCurSym . ' ' . number_format($sponRec->curCommitment, 2) . ' ' . $sponRec->strCommitACOFlagImg . '<br>' . strLinkView_SponsorFinancials($lSponID, 'View sponsorship financials', true) . strLinkView_SponsorFinancials($lSponID, 'View financials', false), '', $strIStyle); $strOut .= $clsRpt->closeRow(); } $strOut .= $clsRpt->closeReport(); return $strOut; }