function showClientInfo($clsRpt, $lCID, $clsClient, $clsDateTime, $bShowAddNew, $lSponID, $bViewOnly, $strClientPreLabel = '')
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gbDateFormatUS, $genumDateFormat, $glclsDTDateFormat;
    if (is_null($lCID)) {
        if ($bViewOnly) {
            $attributes = new stdClass();
            $attributes->lTableWidth = 900;
            $attributes->divID = 'clientA';
            $attributes->divImageID = 'clientADivImg';
            openBlock('Client Information', '', $attributes);
        } else {
            openBlock('Client Information', '');
        }
        echoT('<i>No client has been linked to this sponsorship.</i>');
        if ($bShowAddNew) {
            echoT('&nbsp;&nbsp;&nbsp;' . strLinkAdd_ClientToSpon($lSponID, 'Add client to this sponsorship', true) . '&nbsp' . strLinkAdd_ClientToSpon($lSponID, 'Add client to this sponsorship', false) . '&nbsp');
        }
        if ($bViewOnly) {
            $attributes = new stdClass();
            $attributes->bCloseDiv = true;
            closeBlock($attributes);
        } else {
            closeBlock();
        }
    } else {
        $clsC = $clsClient->clients[0];
        if ($bShowAddNew) {
            echoT(strLinkAdd_Client('Add new client', true) . ' ' . strLinkAdd_Client('Add new client', false) . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkSpecial_SearchClient('Search clients', true) . '&nbsp;' . strLinkSpecial_SearchClient('Search clients', false) . '<br>');
        }
        if (isset($clsC->strFlagsTable)) {
            $strCFlags = '&nbsp;' . $clsC->strFlagsTable;
        } else {
            $strCFlags = '';
        }
        if ($bViewOnly) {
            $strBlockLink = strLinkView_ClientRecord($lCID, 'View client record', true) . '&nbsp;' . strLinkView_ClientRecord($lCID, 'View client record', false);
            $strVocLink = '';
            $strLinkLocation = '';
            $strLinkStatCat = '';
            $strLinkStatHist = '';
            $strLinkRem = '';
            $attributes = new stdClass();
            $attributes->lTableWidth = 900;
            $attributes->divID = 'clientB';
            $attributes->divImageID = 'clientBDivImg';
            openBlock($strClientPreLabel . $clsClient->clients[0]->cv_strVocClientS, $strBlockLink . $strCFlags, $attributes);
        } else {
            /*
                     $strBlockLink    = strLinkEdit_Client       ($lCID, 'Edit client record', true ).'&nbsp;'
                                       .strLinkEdit_Client       ($lCID, 'Edit client record', false).'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
                                       .strLinkView_ClientAssessmentViaCID($lCID, 'Client Assessments', true ).'&nbsp;'
                                       .strLinkView_ClientAssessmentViaCID($lCID, 'Client Assessments', false);
            */
            $strBlockLink = strLinkEdit_Client($lCID, 'Edit client record', true) . '&nbsp;' . strLinkEdit_Client($lCID, 'Edit client record', false);
            $strVocLink = strLinkEdit_ClientRecVoc($lCID, 'Edit this client\'s vocabulary', true) . '&nbsp;';
            $strLinkLocation = strLinkView_ClientsViaLocation($clsC->lLocationID, 'View this location\'s directory', true);
            $strLinkStatCat = strLinkEdit_ClientRecStatCat($lCID, 'Edit this client\'s status category', true) . '&nbsp;';
            $strLinkStatHist = strLinkView_ClientStatusHistory($lCID, 'status history', true);
            $strLinkRem = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkRem_Client($lCID, 'Remove client record', true, true);
            openBlock($strClientPreLabel . $clsClient->clients[0]->cv_strVocClientS, $strBlockLink . $strCFlags . $strLinkRem);
        }
        echoT($clsRpt->openReport() . $clsRpt->openRow() . $clsRpt->writeLabel('Client ID:') . $clsRpt->writeCell(str_pad($lCID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Name:') . $clsRpt->writeCell(htmlspecialchars($clsC->strFName . ' ' . $clsC->strMName . ' ' . $clsC->strLName . ' (' . $clsC->enumGender . ')')) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Enrollment Date:') . $clsRpt->writeCell(date($genumDateFormat, $clsC->dteEnrollment)) . $clsRpt->closeRow());
        //---------------
        // birthday
        //---------------
        $mdteBirth = $clsC->dteBirth;
        $clsDateTime->setDateViaMySQL(0, $mdteBirth);
        $strAgeBDay = $clsDateTime->strPeopleAge(0, $mdteBirth, $lAgeYears, $glclsDTDateFormat);
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Birth Date:') . $clsRpt->writeCell($strAgeBDay) . $clsRpt->closeRow());
        //---------------
        // location
        //---------------
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Location:') . $clsRpt->writeCell($strLinkLocation . htmlspecialchars($clsC->strLocation)) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Max # of Sponsors:') . $clsRpt->writeCell($clsC->lMaxSponsors) . $clsRpt->closeRow());
        //------------------------
        // Address
        //------------------------
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Address:') . $clsRpt->writeCell($clsC->strAddress) . $clsRpt->closeRow());
        //------------------------
        // Email
        //------------------------
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Email:') . $clsRpt->writeCell($clsC->strEmailFormatted) . $clsRpt->closeRow());
        //------------------------
        // Phone
        //------------------------
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Phone:') . $clsRpt->writeCell(htmlspecialchars(strPhoneCell($clsC->strPhone, $clsC->strCell))) . $clsRpt->closeRow());
        //---------------
        // Vocabulary
        //---------------
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Vocabulary:') . $clsRpt->writeCell($strVocLink . $clsC->cv_strVocTitle) . $clsRpt->closeRow());
        //------------------
        // Status Category
        //------------------
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Status Category:') . $clsRpt->writeCell($strLinkStatCat . $clsC->strStatusCatName) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Current Status:') . $clsRpt->writeCell($strLinkStatHist . $clsC->curStat_strStatus . ' <small>(set on ' . date($genumDateFormat, $clsC->curStat_dteStatus) . ')</small>') . $clsRpt->closeRow());
        //------------------
        // Attributed To
        //------------------
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Attributed To:') . $clsRpt->writeCell(htmlspecialchars($clsC->strAttrib)) . $clsRpt->closeRow());
        //------------------
        // Bio
        //------------------
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Bio:') . $clsRpt->writeCell(nl2br(htmlspecialchars($clsC->strBio))) . $clsRpt->closeRow());
        echoT($clsRpt->closeReport());
        if ($bViewOnly) {
            $attributes = new stdClass();
            $attributes->bCloseDiv = true;
            closeBlock($attributes);
        } else {
            closeBlock();
        }
    }
}
Beispiel #2
0
 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) . '&nbsp;' . 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;
 }
             echoT('<br>' . $strPhone);
         }
     }
     echoT('
          </td>');
 }
 //---------------------------
 // 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($clsRpt->closeRow());
 if ($lNumSpon == 0) {
     echoT($clsRpt->openRow(true));
     echoT($clsRpt->writeCell('<i>There are no sponsors that meet your search criteria</i>', '', '', $lNumCols));
     echoT($clsRpt->closeRow());
 } else {
     foreach ($sponInfo as $sponsor) {
         $lSponID = $sponsor->lKeyID;
         $bBiz = $sponsor->bSponBiz;
         $lForeignID = $sponsor->lForeignID;
         $lClientID = $sponsor->lClientID;
         $bInactive = $sponsor->bInactive;
         $strColorInactive = $bInactive ? 'color: #999;' : '';
         if (is_null($lClientID) && !$bInactive) {
             $strLinkAddClient = '<br><br>' . strLinkAdd_ClientToSpon($lSponID, 'Add client to this sponsorship', true) . '&nbsp;' . strLinkAdd_ClientToSpon($lSponID, 'Add client to this sponsorship', false);
         } else {
             $strLinkAddClient = '';
         }
         echoT($clsRpt->openRow(true));
         if ($showFields->bSponsorID) {
             echoT($clsRpt->writeCell(strLinkView_Sponsorship($lSponID, 'View sponsorship record', true) . '&nbsp;' . str_pad($lSponID, 5, '0', STR_PAD_LEFT), '40', 'text-align: center;' . $strColorInactive));
         }
         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);
             }