$lRowIDX = 1;
 foreach ($clientInfo as $client) {
     $bActive = $client->curStat_bShowInDir;
     if ($bActive) {
         $strStyleActive = '';
     } else {
         $strStyleActive = 'color: #999;';
     }
     $lClientID = $client->lKeyID;
     echoT($clsRpt->openRow(true));
     echoT($clsRpt->writeCell($lRowIDX, '', 'text-align: center;'));
     if ($showFields->bClientID) {
         echoT($clsRpt->writeCell(strLinkView_ClientRecord($lClientID, 'View client record', true, ' id="dirCID_' . $lClientID . '" ') . ' ' . str_pad($lClientID, 5, '0', STR_PAD_LEFT), 60, $strStyleActive));
     }
     if ($showFields->bRemClient) {
         echoT($clsRpt->writeCell(strLinkRem_Client($lClientID, 'Remove this client\'s record', true, true)));
     }
     if ($showFields->bName) {
         echoT($clsRpt->writeCell($client->strSafeNameLF, 150, $strStyleActive));
     }
     if ($showFields->bAgeGender) {
         echoT($clsRpt->writeCell($client->strClientAgeBDay . '<br>' . $client->enumGender, 200, $strStyleActive));
     }
     if ($showFields->bLocation) {
         echoT($clsRpt->writeCell(htmlspecialchars($client->strLocation) . '<br>' . $client->strAddress, 170, $strStyleActive));
     }
     if ($showFields->bStatus) {
         echoT($clsRpt->writeCell(htmlspecialchars($client->curStat_strStatus), '', $strStyleActive));
     }
     if ($showFields->bSponsors) {
         echoT($clsRpt->writeCell(strSponsorSummaryViaCID(true, $client), '', $strStyleActive));
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();
        }
    }
}
Пример #3
0
 private function strAttribRptClient(&$sRpt, $strLimit, $strAttrib, $strLabel)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $this->load->helper('clients/client_sponsor');
     $this->load->model('clients/mclients', 'clsClients');
     $params = array('enumStyle' => 'enpRptC');
     $clsRpt = new generic_rpt($params);
     $this->clsClients->loadClientsViaAttribID($strAttrib, true, $strLimit);
     $strOut = '<br>' . $clsRpt->openReport();
     $strOut .= $clsRpt->writeTitle('Clients ' . $strLabel, '', '', 7);
     $strOut .= $clsRpt->openRow(true);
     $strOut .= $clsRpt->writeLabel('ClientID', 60) . $clsRpt->writeLabel('&nbsp;', 20) . $clsRpt->writeLabel('Name', 150) . $clsRpt->writeLabel('Birthday/Gender') . $clsRpt->writeLabel('Location') . $clsRpt->writeLabel('Status') . $clsRpt->writeLabel('Sponsors') . $clsRpt->closeRow();
     foreach ($this->clsClients->clients as $client) {
         $lClientID = $client->lKeyID;
         $strOut .= $clsRpt->openRow(true);
         $strOut .= $clsRpt->writeCell(strLinkView_ClientRecord($lClientID, 'View client record', true) . '&nbsp;' . str_pad($lClientID, 5, '0', STR_PAD_LEFT), 60);
         $strOut .= $clsRpt->writeCell(strLinkRem_Client($lClientID, 'Remove this client\'s record', true, true));
         $strOut .= $clsRpt->writeCell($client->strSafeNameLF, 150);
         $strOut .= $clsRpt->writeCell($client->strClientAgeBDay . '<br>' . $client->enumGender, 200);
         $strOut .= $clsRpt->writeCell(htmlspecialchars($client->strLocation) . '<br>' . htmlspecialchars($client->strLocCountry), 130);
         $strOut .= $clsRpt->writeCell(htmlspecialchars($client->curStat_strStatus), '');
         $strOut .= $clsRpt->writeCell(strSponsorSummaryViaCID(true, $client));
         $strOut .= $clsRpt->closeRow();
     }
     $strOut .= $clsRpt->closeReport();
     return $strOut;
 }