function showVolClientAssoc($clsRpt, $volRec, $lVolID)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $attributes = new stdClass();
    $attributes->lTableWidth = 900;
    $attributes->divID = 'volClient';
    $attributes->divImageID = 'volClientImg';
    openBlock('Volunteer-Client Associations  <span style="font-size: 9pt;">(' . $volRec->lNumVolClientAssoc . ')</span>', strLinkAdd_VolClientAssoc($lVolID, 'Add new volunteer/client association', true, 'id="vcaImg"') . '&nbsp;' . strLinkAdd_VolClientAssoc($lVolID, 'Add new association', false, 'id="vcaImgLnk"'), $attributes);
    if ($volRec->lNumVolClientAssoc == 0) {
        echoT('<i>There are no volunteer/client associations for this volunteer.</i>');
    } else {
        echoT('
         <table class="enpRpt">
            <tr>
               <td class="enpRptLabel">
                  clientID
               </td>
               <td class="enpRptLabel">
                  &nbsp;
               </td>
               <td class="enpRptLabel">
                  Name
               </td>
               <td class="enpRptLabel">
                  Address
               </td>
               <td class="enpRptLabel">
                  Phone
               </td>
            </tr>');
        foreach ($volRec->vca as $va) {
            $lClientID = $va->lClientID;
            echoT('
               <tr class="makeStripe">
                  <td class="enpRpt" style="text-align: center;">' . str_pad($lClientID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_ClientRecord($lClientID, 'View client record', true, 'id="cr' . $lClientID . '"') . '
                  </td>
                  <td class="enpRpt" style="text-align: center;">' . strLinkRem_VolClientAssoc($va->lKeyID, $lVolID, 'Remove association', true, true) . '
                  </td>
                  <td class="enpRpt">' . htmlspecialchars($va->strLName . ', ' . $va->strFName) . '
                  </td>
                  <td class="enpRpt">' . strBuildAddress($va->strAddr1, $va->strAddr2, $va->strCity, $va->strState, $va->strCountry, $va->strZip, true) . '
                  </td>
                  <td class="enpRpt">' . strPhoneCell($va->strPhone, $va->strCell, true) . '
                  </td>
               </tr>');
        }
        echoT('
         </table>');
    }
    $attributes = new stdClass();
    $attributes->bCloseDiv = true;
    closeBlock($attributes);
}
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 showClientInfo($clsDateTime, $clsRpt, $client)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gbDateFormatUS, $genumDateFormat, $glclsDTDateFormat;
    // Client ID
    $lClientID = $client->lKeyID;
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Client ID:') . $clsRpt->writeCell(strLinkView_ClientRecord($lClientID, 'View client record', true) . '&nbsp;' . str_pad($lClientID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow());
    // Name
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Name:') . $clsRpt->writeCell($client->strSafeName) . $clsRpt->closeRow());
    // Address
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Address:') . $clsRpt->writeCell($client->strAddress) . $clsRpt->closeRow());
    // birthday
    $mdteBirth = $client->dteBirth;
    $clsDateTime->setDateViaMySQL(0, $mdteBirth);
    $strAgeBDay = $clsDateTime->strPeopleAge(0, $mdteBirth, $lAgeYears, $glclsDTDateFormat);
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Birth Date:') . $clsRpt->writeCell($strAgeBDay) . $clsRpt->closeRow());
    // Phone
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Phone:') . $clsRpt->writeCell(htmlspecialchars(strPhoneCell($client->strPhone, $client->strCell))) . $clsRpt->closeRow());
}
function showGiftSponsorInfo(&$clsRpt, $lGiftID, $lFID, $gifts, &$spon)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $bMismo = $lFID == $spon->lForeignID;
    $lSponID = $spon->lKeyID;
    $lClientID = $spon->lClientID;
    if (is_null($lClientID)) {
        $strClientID = '<i>not set</i>';
    } else {
        $strClientID = str_pad($lClientID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_ClientRecord($lClientID, 'View client record', true) . '&nbsp;' . $spon->strClientSafeNameFL;
    }
    openBlock('Sponsorship' . "\n", strLinkView_Sponsorship($lSponID, 'View sponsorship', true) . '&nbsp;' . strLinkView_Sponsorship($lSponID, 'View sponsorship', false) . "\n");
    echoT($clsRpt->openReport());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Sponsor ID:') . $clsRpt->writeCell(str_pad($spon->lKeyID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Sponsor:') . $clsRpt->writeCell($spon->strSponSafeNameLF . ($bMismo ? ' (same as donor)' : '')) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Sponsorship program:') . $clsRpt->writeCell(htmlspecialchars($spon->strSponProgram)) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Client:') . $clsRpt->writeCell($strClientID) . $clsRpt->closeRow());
    echoT($clsRpt->closeReport(''));
    closeBlock();
}
 function strClientDupWarning(&$cprograms, $strCheckBoxName, $lNumMatches, $matches)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $strWarning = '';
     $cprograms->loadClientPrograms(true);
     $bTestCProgs = $cprograms->lNumCProgs > 0;
     $strWarning = '<br><div class="formError" style="width: 400pt;">
          <b><i>Delightful Labor</i></b> has detected ' . $lNumMatches . ' client' . ($lNumMatches == 1 ? '' : 's') . ' with similar names to your new client.<br><br>
             To prevent duplicate client entry, please verify that your
             new client <b><i>is not</i></b> in the database.<br>
         <table style="border:2px solid #ff0000; border-collapse:collapse;">
            <tr>
               <td class="enpRptTitle" colspan="4" style="background-color: #ffd3d3;">
                  Clients already in the database
               </td>
            </tr>
            <tr>
               <td class="enpRptLabel" style="background-color: #ffd3d3;">
                  Client ID
               </td>
               <td class="enpRptLabel" style="background-color: #ffd3d3;">
                  Name
               </td>
               <td class="enpRptLabel" style="background-color: #ffd3d3;">
                  Address
               </td>';
     if ($bTestCProgs) {
         $strWarning .= '
            <td class="enpRptLabel" style="background-color: #ffd3d3;">
               Enrolled In
            </td>';
     }
     $strWarning .= '</tr>';
     foreach ($matches as $match) {
         $lClientID = $match->lKeyID;
         $strWarning .= '
            <tr>
               <td class="enpRpt" style="text-align: center;background-color: #fff5f5;">' . str_pad($lClientID, 6, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_ClientRecord($lClientID, 'View client record', true) . '
               </td>
               <td class="enpRpt" style="background-color: #fff5f5;">' . $match->strSafeNameLF . '
               </td>
               <td class="enpRpt" style="background-color: #fff5f5;">' . $match->strAddress . '
               </td>';
         if ($bTestCProgs) {
             $cprograms->cprogramEnrollmentsViaClientID($lClientID, $lNumEnrolls, $enrollments);
             if ($lNumEnrolls == 0) {
                 $strEs = 'n/a';
             } else {
                 $strEs = '<ul style="margin: 0px;">';
                 foreach ($enrollments as $enroll) {
                     $strEs .= '<li style="margin-left: -20pt;">' . htmlspecialchars($enroll->strCProgName) . '</li>';
                 }
                 $strEs .= '</ul>';
             }
             $strWarning .= '
               <td class="enpRpt" style="background-color: #fff5f5;">' . $strEs . '
               </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;
 }
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();
}
$clsForm->strExtraFieldText = form_error('txtADate');
echoT($clsForm->strGenericDatePicker('Attendance Date', 'txtADate', true, $formData->txtADate, 'frmCloneAttendance', 'datepicker1'));
//----------------------
// skip duplicates
//----------------------
$clsForm->strStyleExtraLabel = 'padding-top: 4px;';
$clsForm->strExtraFieldText = '<br><i>If checked, skip clients who already
                have attendance records<br>for the specified date.</i>';
echoT($clsForm->strGenericCheckEntry('Skip duplicates', 'chkSkipDups', 'true', false, $bSkipDups));
// the client list
$clsForm->strStyleExtraLabel = 'padding-top: 8px;';
$strClientChk = strHTMLSetClearAllButton(true, 'frmCloneAttendance', 'chkClient[]', 'Select All') . '&nbsp;&nbsp;' . strHTMLSetClearAllButton(false, 'frmCloneAttendance', 'chkClient[]', 'Clear All') . '<br>' . "\n";
foreach ($clients as $client) {
    if ($client->lNumERecs > 0) {
        $lClientID = $client->lClientID;
        foreach ($client->erecs as $erec) {
            $strEDates = ' <i>(enrollment: ' . date('m/d/Y', $erec->dteStart) . ' - ';
            if (is_null($erec->dteEnd) || $erec->dteEnd == 0) {
                $strEDates .= 'ongoing)</i>';
            } else {
                $strEDates .= date('m/d/Y', $erec->dteEnd) . ')</i>';
            }
            $strClientChk .= '<div><input type="checkbox" name="chkClient[]" ' . ($client->bSelected ? 'checked' : '') . ' value="' . $client->lClientID . '_' . $erec->lKeyID . '">' . strLinkView_ClientRecord($lClientID, 'View client record', true) . '&nbsp;' . htmlspecialchars($client->strClientLName . ', ' . $client->strClientFName) . ' ' . $strEDates . '</div>' . "\n";
        }
    }
}
echoT($clsForm->strLabelRow('Clone to', $strClientChk, 1));
echoT($clsForm->strSubmitEntry('Clone', 2, 'cmdSubmit', 'text-align: center; width: 150px;', 'return(verifyBoxChecked(\'frmCloneAttendance\', \'chkClient[]\', \' (Clients)\'))'));
echoT('</table>' . form_close('<br>'));
echoT('<script type="text/javascript">frmAddEdit.addEditEntry.focus();</script>');
closeBlock();
Exemplo n.º 8
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;
 }
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();
        }
    }
}
         <tr>
            <td class="enpRptLabel" style="width: 50pt;">
               Client ID
            </td>
            <td class="enpRptLabel">
               Client
            </td>
            <td class="enpRptLabel">
               Program/Enrollment
            </td>
         </tr>');
foreach ($enrollees as $erec) {
    $lClientID = $erec->lClientID;
    echoT('
         <tr class="makeStripe">
            <td class="enpRpt" style="width: 50pt; text-align: center;">' . strLinkView_ClientRecord($lClientID, 'View Client Record', true) . str_pad($lClientID, 5, '0', STR_PAD_LEFT) . '
            </td>
            <td class="enpRpt" style="width: 160pt;">' . htmlspecialchars($erec->strCLName . ', ' . $erec->strCFName) . '
            </td>
            <td class="enpRpt">' . strProgramTable($lClientID, $erec->programs) . '
            </td>
         </tr>');
}
echoT('</table><br><br>');
function strProgramTable($lClientID, $programs)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $genumDateFormat;
    $strOut = '<table class="enpRpt" width="100%">';
Exemplo n.º 11
0
function strLinkView_ViaRecType($enumSearchType, $lFKey01 = null, $lFKey02 = null)
{
    //-----------------------------------------------------------------
    //
    //-----------------------------------------------------------------
    switch ($enumSearchType) {
        case CENUM_CONTEXT_HOUSEHOLD:
            return strLinkView_Household($lFKey01, $lFKey02, 'View household', true);
            break;
        case CENUM_CONTEXT_PEOPLE:
            return strLinkView_PeopleRecord($lFKey01, 'View people record', true);
            break;
        case CENUM_CONTEXT_BIZ:
            return strLinkView_BizRecord($lFKey01, 'View business/prganization record', true);
            break;
        case CENUM_CONTEXT_CLIENT:
            return strLinkView_ClientRecord($lFKey01, 'View client record', true);
            break;
        case CENUM_CONTEXT_SPONSORSHIP:
            return strLinkView_Sponsorship($lFKey01, 'View sponsor record', true);
            break;
        default:
            screamForHelp($enumSearchType . ': invalid link type<br>error on <b>line:</b> ' . __LINE__ . '<br><b>file: </b>' . __FILE__ . '<br><b>function: </b>' . __FUNCTION__);
            break;
    }
}
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;
}
Exemplo n.º 13
0
 public function sponsorshipHTMLSummary()
 {
     //-----------------------------------------------------------------------
     // assumes user has called $clsSpon->sponsorInfoViaID($lSID);
     //-----------------------------------------------------------------------
     global $gdteNow, $genumDateFormat;
     $params = array('enumStyle' => 'terse');
     $clsRpt = new generic_rpt($params);
     $clsRpt->setEntrySummary();
     $sponRec = $this->sponInfo[0];
     $bBiz = $sponRec->bSponBiz;
     if ($bBiz) {
         $strLinkPeopleBiz = strLinkView_BizRecord($sponRec->lForeignID, 'View business record', true);
         $strLabel = '(business ID: ';
     } else {
         $strLinkPeopleBiz = strLinkView_PeopleRecord($sponRec->lForeignID, 'View people record', true);
         $strLabel = '(people ID: ';
     }
     $lSponID = $sponRec->lKeyID;
     $strOut = $clsRpt->openReport('', '') . $clsRpt->openRow(false) . $clsRpt->writeLabel(' Sponsor:') . $clsRpt->writeCell($strLinkPeopleBiz . '&nbsp;' . $sponRec->strSponSafeNameFL . '&nbsp;&nbsp;' . $strLabel . str_pad($sponRec->lForeignID, 5, '0', STR_PAD_LEFT) . ')') . $clsRpt->closeRow() . $clsRpt->openRow(false) . $clsRpt->writeLabel('Sponsorship:') . $clsRpt->writeCell(strLinkView_Sponsorship($lSponID, 'View sponsorship', true) . '&nbsp;' . htmlspecialchars($sponRec->strSponProgram) . '&nbsp;&nbsp;(sponsor ID: ' . str_pad($lSponID, 5, '0', STR_PAD_LEFT) . ')') . $clsRpt->closeRow();
     if (is_null($sponRec->lClientID)) {
         $strClient = '<i>not set</i>';
     } else {
         $strClient = strLinkView_ClientRecord($sponRec->lClientID, 'View client record', true) . '&nbsp;' . $sponRec->strClientSafeNameFL . '&nbsp;(client ID: ' . str_pad($sponRec->lClientID, 5, '0', STR_PAD_LEFT) . ')';
     }
     $strOut .= $clsRpt->openRow(false) . $clsRpt->writeLabel('Client:') . $clsRpt->writeCell($strClient) . $clsRpt->closeRow() . $clsRpt->openRow(false) . $clsRpt->writeLabel('Status:') . $clsRpt->writeCell($sponRec->bInactive ? 'Inactive since ' . date($genumDateFormat, $sponRec->dteInactive) : 'Active') . $clsRpt->closeRow() . $clsRpt->closeReport('<br>');
     return $strOut;
 }
     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('
          <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>');
Exemplo n.º 15
0
 private function strClientBasedGroupRptHTML()
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $glclsDTDateFormat;
     $clsDateTime = new dl_date_time();
     $strOut = '<table class="enpRptC">
              <tr>
                 <td class="enpRptLabel">clientID</td>
                 <td class="enpRptLabel">Name</td>
                 <td class="enpRptLabel">Location</td>
                 <td class="enpRptLabel">Age/Gender</td>
                 <td class="enpRptLabel">Group Membership</td>
              </tr>' . "\n";
     $sqlStr = "SELECT\n            cr_lKeyID, cr_strFName, cr_strLName,\n            cr_dteBirth, cr_enumGender, cr_lLocationID,\n            cl_strLocation\n          FROM tmpGroupMatch\n            INNER JOIN client_records ON cr_lKeyID=gm_lForeignID\n            INNER JOIN client_location ON cr_lLocationID=cl_lKeyID\n          ORDER BY gm_lKeyID;";
     $query = $this->db->query($sqlStr);
     foreach ($query->result() as $row) {
         $lFID = $row->cr_lKeyID;
         $this->groupMembershipViaFID(CENUM_CONTEXT_CLIENT, $lFID);
         $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>';
         $strAgeBDay = $clsDateTime->strPeopleAge(0, $row->cr_dteBirth, $lAgeYears, $glclsDTDateFormat);
         $strOut .= '<tr>
               <td class="enpRpt" style="width: 65px;">' . strLinkView_ClientRecord($lFID, 'View client record', true) . '&nbsp;' . str_pad($lFID, 5, '0', STR_PAD_LEFT) . '
               </td>
               <td class="enpRpt" style="width: 160px;">' . htmlspecialchars($row->cr_strLName . ', ' . $row->cr_strFName) . '
               </td>
               <td class="enpRpt" style="width: 200px;">' . htmlspecialchars($row->cl_strLocation) . '
               </td>
               <td class="enpRpt" style="width: 150px;">' . $strAgeBDay . '<br>' . $row->cr_enumGender . '
               </td>
               <td class="enpRpt" style="width: 200px;">' . $strGroupList . '
               </td>
            </tr>' . "\n";
         $strOut .= '</tr>' . "\n";
     }
     $strOut .= '</table>' . "\n";
     return $strOut;
 }
Exemplo n.º 16
0
 private function loadClientContext()
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $this->clsClient = new mclients();
     $this->clsClient->lClientID = $this->lForeignID;
     $this->clsClient->loadClientsViaClientID($this->lForeignID);
     $clsC = $this->clsClient->clients[0];
     $this->strContextLabel = 'client record';
     $this->strContextName = $clsC->strSafeName;
     $this->strContextViewLink = strLinkView_ClientRecord($this->lForeignID, 'View client record', true);
 }
<?php

echoT('You have requested to transfer the client to the new location <b>' . $strLocName . '</b>.<br><br>
       The client is currently sponsored by ' . ($bOneProblemo ? 'a' : $lNumProblemos) . ' sponsorship program' . ($bOneProblemo ? '' : 's') . '<br>
       that ' . ($bOneProblemo ? 'is' : 'are') . ' not supported by the new location:<br><ul>');
foreach ($sponProgs as $prog) {
    if ($prog->bOldLoc && !$prog->bNewLoc) {
        echoT('<li style="margin-left: 10pt;">' . htmlspecialchars($prog->strProg) . '</li>');
    }
}
echoT('</ul><br>');
echoT('Please select one of the following options:
      <ul>
         <li style="margin-left: 10pt;">To add ' . ($bOneProblemo ? 'this' : 'these') . ' sponsorship program' . ($bOneProblemo ? '' : 's') . ' to location <b>' . $strLocName . '</b> ' . anchor('clients/client_record/xfer3/' . $lClientID . '/' . $lNewLocID . '/' . $lStatCatID . '/' . $lVocID . '/' . $dteEDate, 'click here') . '.
         </li>
         <li style="margin-left: 10pt;">To <b>cancel</b> the transfer, ' . strLinkView_ClientRecord($lClientID, 'click here', false) . '.
         </li>
      </ul>');
echoT('<table class="enpRpt">
      <tr>
         <td class="enpRptTitle" colspan="5">
            Clients with missing status categories
         </td>
      </tr>');
echoT('
      <tr>
         <td class="enpRptLabel">
            clientID
         </td>
         <td class="enpRptLabel">
            Name
         </td>
         <td class="enpRptLabel">
            Status Category
         </td>
      </tr>');
foreach ($badStatus as $bad) {
    $lClientID = $bad->lKeyID;
    echoT('
         <tr>
            <td class="enpRpt" style="text-align: center;">' . str_pad($lClientID, 6, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_ClientRecord($lClientID, 'View client record', true) . '
            </td>
            <td class="enpRpt">' . htmlspecialchars($bad->strLName . ', ' . $bad->strFName) . '
            </td>
            <td class="enpRpt">' . htmlspecialchars($bad->strCatName) . '
            </td>
         </tr>');
}
echoT('</table>');
function strAttendanceTable(&$cprog, $attrib)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $lMaxDays = lDaysInMonth($attrib->lMonth, $attrib->lYear);
    $lNumERecs = $cprog->lNumERecs;
    if ($lNumERecs > 0) {
        $lATableID = $cprog->lAttendanceTableID;
        $strATable = $cprog->strAttendanceTable;
        $strAFNPrefix = $cprog->strATableFNPrefix;
        $lETableID = $cprog->lEnrollmentTableID;
        $attend = array();
        $idx = 0;
        foreach ($cprog->erecs as $erec) {
            $lERecID = $erec->lKeyID;
            $lClientID = $erec->lClientID;
            // load the enrollees
            $attend[$idx] = array();
            $attend[$idx][0] = strLinkView_ClientRecord($lClientID, 'View client record', true) . '&nbsp;' . str_pad($lClientID, 5, '0', STR_PAD_LEFT) . '&nbsp;&nbsp;' . '<b>' . htmlspecialchars($erec->strClientLName) . '</b>, ' . htmlspecialchars($erec->strClientFName);
            // enrollment link
            $attend[$idx][1] = strLinkView_CProgEnrollRec($lETableID, $lClientID, $lERecID, 'View Enrollment', true) . '&nbsp;' . str_pad($lERecID, 5, '0', STR_PAD_LEFT);
            // populate the attendance cells
            $strCheckImg = '<div style="display:inline-block; width: 100%; text-align: center;"><img src="' . DL_IMAGEPATH . '/misc/check06.gif"></div>';
            for ($jidx = 2; $jidx <= $lMaxDays + 1; ++$jidx) {
                if (bEnrolleeInAttendance($erec, $attrib->lMonth, $jidx - 1, $attrib->lYear)) {
                    $attend[$idx][$jidx] = $strCheckImg;
                    $strEntry = '';
                    arecIDXsViaERecDate($erec, $attrib->lMonth, $jidx - 1, $attrib->lYear, $lNumARecs, $arecIDX);
                    $lCnt = 1;
                    foreach ($arecIDX as $aIDX) {
                        $arecCurrent = $erec->arecs[$aIDX];
                        $lARecID = $arecCurrent->lKeyID;
                        if ($lNumARecs > 1) {
                            $strEntry .= '(' . $lCnt . ')<br>';
                            ++$lCnt;
                        }
                        if ($attrib->bALink) {
                            $strEntry .= strLinkView_CProgAttendRec($lATableID, $lClientID, $lARecID, 'View attendance record', true) . str_pad($lARecID, 5, '0', STR_PAD_LEFT) . '<br>';
                        }
                        if ($attrib->bDuration) {
                            $strEntry .= '<b>duration:</b> ' . number_format($arecCurrent->dDuration, 2) . 'hr<br>';
                        }
                        if ($attrib->bActivity) {
                            $strEntry .= '<b>activity:</b> ' . strShortenString($arecCurrent->strActivity, 25, true) . '<br>';
                        }
                        if ($attrib->bCNotes) {
                            $strEntry .= '<b>case notes:</b> ' . strShortenString($arecCurrent->strCaseNotes, 25, true) . '<br>';
                        }
                    }
                    if ($strEntry != '') {
                        $attend[$idx][$jidx] .= '<br>' . $strEntry;
                    }
                } else {
                    $attend[$idx][$jidx] = '&nbsp;';
                }
            }
            ++$idx;
        }
    }
    // build the html table
    $strOut = '
          <div id="attendTable" style="width: 100%; overflow: auto; ">
          <table class="enpRpt">
             <tr>
                <td class="enpRptTitle" colspan="' . ($lMaxDays + 2) . '">' . htmlspecialchars($cprog->strSafeAttendLabel) . ': ' . htmlspecialchars($cprog->strProgramName) . '
                </td>
             </tr>
             <tr>
                <td class="enpRptLabel" rowspan="2" style="vertical-align: bottom;">Enrollee</td>
                <td class="enpRptLabel" rowspan="2" style="vertical-align: bottom;">Enrollment<br>Record</td>
                <td class="enpRptLabel" colspan="' . $lMaxDays . '" style="text-align: center; vertical-align: middle; font-size: 12pt;">' . $attrib->strLinkPrev . strXlateMonth($attrib->lMonth) . ' ' . $attrib->lYear . $attrib->strLinkNext . '</td></tr><tr>' . "\n";
    for ($jidx = 1; $jidx <= $lMaxDays; ++$jidx) {
        $strOut .= '<td class="enpRptLabel" style="text-align: center;">&nbsp;' . $jidx . '&nbsp;</td>' . "\n";
    }
    $strOut .= '</tr>' . "\n";
    for ($idx = 0; $idx < $lNumERecs; ++$idx) {
        $strOut .= '<tr class="makeStripe">' . "\n";
        $strOut .= '<td class="enpRpt" style="width: 170pt;" nowrap>' . $attend[$idx][0] . '</td>' . "\n";
        for ($jidx = 1; $jidx <= $lMaxDays + 1; ++$jidx) {
            $strOut .= '<td class="enpRpt" style="font-size: 8pt;" nowrap>' . $attend[$idx][$jidx] . '</td>' . "\n";
        }
        $strOut .= '</tr">' . "\n";
    }
    $strOut .= '</table></div>';
    return $strOut;
}
Exemplo n.º 20
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 strPrePostClientDirReport($lPPTestID, &$sRpt, $lStartRec, $lRecsPerPage)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $pptest =& $this->pptests[0];
     $strTestSafeName = htmlspecialchars($pptest->strTestName);
     $strLimit = " LIMIT {$lStartRec}, {$lRecsPerPage} ";
     $strTT = 'tmpCPPDir';
     $sqlStr = "DROP TABLE IF EXISTS {$strTT};";
     $query = $this->db->query($sqlStr);
     $sqlStr = "CREATE TEMPORARY TABLE IF NOT EXISTS {$strTT} (\n         -- CREATE TABLE IF NOT EXISTS {$strTT} (\n           tmp_lKeyID      int(11) NOT NULL AUTO_INCREMENT,\n           tmp_lClientID   int(11) NOT NULL DEFAULT '0' COMMENT 'Foreign key to client table',\n\n           PRIMARY KEY (tmp_lKeyID),\n           KEY tmp_lClientID  (tmp_lClientID)\n         ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;";
     $query = $this->db->query($sqlStr);
     $sqlStr = "INSERT INTO {$strTT}\n           (tmp_lClientID)\n            SELECT DISTINCT cptl_lClientID\n            FROM cpp_test_log\n            WHERE NOT cptl_bRetired\n               AND cptl_lPrePostID={$lPPTestID}\n            ORDER BY cptl_lClientID\n            {$strLimit};";
     $query = $this->db->query($sqlStr);
     $sqlStr = "SELECT cr_lKeyID, cr_strFName, cr_strLName\n          FROM client_records\n             INNER JOIN {$strTT} ON tmp_lClientID=cr_lKeyID\n          ORDER BY cr_strLName, cr_strFName, cr_lKeyID;";
     $query = $this->db->query($sqlStr);
     $lNumRows = $query->num_rows();
     if ($lNumRows == 0) {
         return '<br><i>There are no clients in your database who have taken test <b>' . $strTestSafeName . '</b>.</i><br><br>';
     }
     $strOut = '<table class="enpRptC">
          <tr>
             <td colspan="3" class="enpRptTitle">' . $strTestSafeName . '
             </td>
          </tr>
          <tr>
             <td class="enpRptLabel">
                &nbsp;
             </td>
             <td class="enpRptLabel">
                &nbsp;
             </td>
             <td class="enpRptLabel">
                Name
             </td>
          </tr>';
     $idx = 1;
     foreach ($query->result() as $row) {
         $lClientID = $row->cr_lKeyID;
         $strOut .= '<tr class="makeStripe">
            <td class="enpRpt" style="text-align: center;">' . $idx . '
            </td>
            <td class="enpRpt" style="text-align: center;">' . str_pad($lClientID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_ClientRecord($lClientID, 'View client record', true) . '
            </td>
            <td class="enpRpt">' . htmlspecialchars($row->cr_strLName . ', ' . $row->cr_strFName) . '
            </td>
          </tr>';
         ++$idx;
     }
     $strOut .= '</table>';
     return $strOut;
 }
 $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) . '
            </td>               
            <td class="enpRpt">' . $payrec->strDonorSafeNameLF . '
            </td>
            <td class="enpRpt" style="text-align: right;">' . number_format($payrec->curPaymentAmnt, 2) . '&nbsp;' . $payrec->strFlagImage . '
            </td>
function displayMRField(&$clsRpt, &$ufield, &$mRec, $bCollapseHeadings, $bCollapseDefaultHide, $clientNames)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gbDateFormatUS;
    $enumType = $ufield->enumFieldType;
    $strFN = $ufield->strFieldNameInternal;
    if ($enumType == CS_FT_HEADING) {
        echoT($clsRpt->openDivBlock(htmlspecialchars($ufield->pff_strFieldNameUser), $bCollapseHeadings, $bCollapseDefaultHide, $strFN, $strFN . 'Img', null));
        return;
    }
    $vValue = @$mRec->{$strFN};
    $strCell = '';
    switch ($enumType) {
        case CS_FT_CHECKBOX:
            $strCell = '<img src="' . ($vValue ? IMGLINK_CHECKON : IMGLINK_CHECKOFF) . '">';
            break;
        case CS_FT_DATE:
            if ($vValue == '') {
                $strCell = 'n/a';
            } else {
                $strCell = strNumericDateViaMysqlDate($vValue, $gbDateFormatUS);
            }
            break;
        case CS_FT_TEXTLONG:
            $strCell = nl2br(htmlspecialchars($vValue));
            break;
        case CS_FT_TEXT255:
        case CS_FT_TEXT80:
        case CS_FT_TEXT20:
            $strCell = htmlspecialchars($vValue);
            break;
        case CS_FT_CLIENTID:
            if ($vValue == '') {
                $strCell = '&nbsp;';
            } else {
                $lClientID = (int) $vValue;
                if ($lClientID > 0) {
                    $strCell = number_format($vValue) . '&nbsp;' . strLinkView_ClientRecord($lClientID, 'View client record', true) . '&nbsp;' . htmlspecialchars($clientNames[$lClientID]);
                } else {
                    $strCell = '&nbsp;';
                }
            }
            break;
        case CS_FT_INTEGER:
            if ($vValue == '') {
                $strCell = '&nbsp;';
            } else {
                $strCell = number_format($vValue);
            }
            break;
        case CS_FT_HEADING:
            break;
        case CS_FT_CURRENCY:
            if ($vValue == '') {
                $strCell = '&nbsp;';
            } else {
                $strCell = number_format($vValue, 2);
            }
            break;
        case CS_FT_DDL:
            $strFNDDL = $strFN . '_ddlText';
            $strCell = htmlspecialchars($mRec->{$strFNDDL});
            break;
        case CS_FT_DDLMULTI:
            $strDDLTextFN = $strFN . '_ddlMulti';
            $md = $mRec->{$strDDLTextFN};
            $strCell = $md->strUL;
            break;
        case CS_FT_LOG:
            $strCell = nl2br(htmlspecialchars($vValue));
            break;
        default:
            screamForHelp($enumType . ': invalid field type<br>error on line ' . __LINE__ . ',<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__);
            break;
    }
    echoT($clsRpt->openRow() . $clsRpt->writeLabel(htmlspecialchars($ufield->pff_strFieldNameUser) . ':') . $clsRpt->writeCell($strCell) . $clsRpt->closeRow());
}
Exemplo n.º 24
0
function contextNameLink($enumType, $lForeignID, &$strContextName, &$strContextLink)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $CI =& get_instance();
    $strContextLink = str_pad($lForeignID, 5, '0', STR_PAD_LEFT);
    switch ($enumType) {
        case CENUM_CONTEXT_PEOPLE:
            $CI->clsPeople->loadPeopleViaPIDs($lForeignID, false, false);
            $strContextName = $CI->clsPeople->people[0]->strFName . ' ' . $CI->clsPeople->people[0]->strLName;
            $strContextLink .= strLinkView_PeopleRecord($lForeignID, 'View people record', true);
            break;
        case CENUM_CONTEXT_CLIENT:
            $CI->clsClients->loadClientsViaClientID($lForeignID);
            $strContextName = $CI->clsClients->clients[0]->strFName . ' ' . $CI->clsClients->clients[0]->strLName;
            $strContextLink .= strLinkView_ClientRecord($lForeignID, 'View client record', true);
            break;
        case CENUM_CONTEXT_GIFT:
            $CI->clsGifts->loadGiftViaGID($lForeignID);
            $strContextName = 'Donation by ' . $CI->clsGifts->gifts[0]->strSafeName;
            $strContextLink .= strLinkView_GiftsRecord($lForeignID, 'View gift record', true);
            break;
        case CENUM_CONTEXT_BIZ:
            $CI->clsBiz->loadBizRecsViaBID($lForeignID);
            $strContextName = $CI->clsBiz->bizRecs[0]->strSafeName;
            $strContextLink .= strLinkView_BizRecord($lForeignID, 'View business record', true);
            break;
        case CENUM_CONTEXT_SPONSORSHIP:
            $CI->clsSpon->sponsorInfoViaID($lForeignID);
            $strContextName = 'Sponsor ' . $CI->clsSpon->sponInfo[0]->strSponSafeNameFL;
            $strContextLink .= strLinkView_Sponsorship($lForeignID, 'View sponsorship record', true);
            break;
        case CENUM_CONTEXT_VOLUNTEER:
            $CI->clsVol->loadVolRecsViaVolID($lForeignID, true);
            $strContextName = $CI->clsVol->volRecs[0]->strSafeNameFL;
            $strContextLink .= strLinkView_Volunteer($lForeignID, 'View volunteer record', true);
            break;
        case CENUM_CONTEXT_LOCATION:
            $CI->clsLoc->loadLocationRec($lForeignID);
            $strContextName = $CI->clsLoc->strLocation;
            $strContextLink .= strLinkView_ClientLocation($lForeignID, 'View client location record', true);
            break;
        case CENUM_CONTEXT_ORGANIZATION:
            $CI->clsLoc->loadLocationRec($lForeignID);
            $strContextName = $CI->clsChapter->chapterRec->strSafeChapterName;
            $strContextLink .= strLinkView_OrganizationRecord($lForeignID, 'View your organization record', true);
            break;
        default:
            screamForHelp($enumType . ': feature not available yet<br>error on line ' . __LINE__ . ',<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__);
            break;
    }
}
Exemplo n.º 25
0
 private function writeDirectoryRowCol($clsSponProg, $lClientID, $client, $col)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $strStyle = '';
     if ($col->width != '') {
         $strStyle .= 'width: ' . $col->width . ';';
     }
     $strOut = '<td ' . $col->tdClass . ' style="' . $strStyle . '">' . "\n";
     switch ($col->label) {
         case 'Client ID':
             $strCell = strLinkView_ClientRecord($client->lKeyID, 'View client record', true) . ' ' . str_pad($client->lKeyID, 5, '0', STR_PAD_LEFT);
             break;
         case 'Name':
             $strCell = $client->strSafeNameLF;
             break;
         case 'Location':
             $strCell = htmlspecialchars($client->strLocation);
             break;
         case 'Birthday/Age':
             $strCell = $client->strClientAgeBDay;
             break;
         case 'Gender':
             $strCell = $client->enumGender;
             break;
         case 'Sponsorship Program':
             $clsSponProg->loadSponProgsViaClientID($lClientID);
             if ($clsSponProg->lNumSponPrograms <= 0) {
                 $strCell = '<i>None</i>';
             } else {
                 $strCell = '';
                 foreach ($clsSponProg->sponProgs as $clsProg) {
                     $strCell .= htmlspecialchars($clsProg->strProg) . '<br>';
                 }
             }
             break;
         case 'Select Link':
             $strCell = strImageLink($this->dir->clsSelLink->strLinkPath . '/' . $client->lKeyID, $this->dir->clsSelLink->strAnchorExtra . ' id="selCID_' . $client->lKeyID . '" ', $this->dir->clsSelLink->bShowImage, $this->dir->clsSelLink->bShowText, $this->dir->clsSelLink->enumImage, $this->dir->clsSelLink->strLinkText);
             break;
         default:
             screamForHelp($col->label . ': column not recognized<br>error on <b>line:</b> ' . __LINE__ . '<br><b>file: </b>' . __FILE__ . '<br><b>function: </b>' . __FUNCTION__);
             break;
     }
     return $strOut . $strCell . '</td>' . "\n";
 }
Exemplo n.º 26
0
 private function clientStatusSearch(&$results)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $genumDateFormat;
     $results->strLabel = 'Client Status';
     $results->lNumResults = 0;
     $sqlStr = 'SELECT csh_lKeyID, csh_lClientID, csh_lStatusID,
            csh_dteStatusDate,
            csh_strStatusTxt,
            cr_strFName, cr_strLName, cr_lLocationID, cl_strLocation
         FROM client_status
            INNER JOIN client_records  ON cr_lKeyID      = csh_lClientID
            INNER JOIN client_location ON cr_lLocationID = cl_lKeyID
         WHERE NOT csh_bRetired AND ' . $this->textSearchWhere('csh_strStatusTxt') . '
         ORDER BY csh_dteStatusDate, csh_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();
             $lClientID = $row->csh_lClientID;
             $match =& $results->matches[$idx];
             $match->links = 'Client ID ' . str_pad($lClientID, 5, '0', STR_PAD_LEFT) . strLinkView_ClientRecord($lClientID, 'View client record', true) . '&nbsp;&nbsp;' . 'Client Status ID: ' . str_pad($row->csh_lKeyID, 5, '0', STR_PAD_LEFT) . strLinkView_ClientStatusHistory($lClientID, 'View client status', true);
             $match->searchInfo = 'Client status record for ' . htmlspecialchars($row->cr_strFName . ' ' . $row->cr_strLName) . '
                         (' . htmlspecialchars($row->cl_strLocation) . ') of ' . date($genumDateFormat, dteMySQLDate2Unix($row->csh_dteStatusDate));
             $match->text = $row->csh_strStatusTxt;
             $match->textHighlighted = $this->highlightMatchedText($row->csh_strStatusTxt);
             ++$idx;
         }
     }
 }
<?php

echoT('
    You have successfully enrolled <b>' . $client->strSafeName . '</b> in <b>' . htmlspecialchars($cprog->strProgramName) . '</b>.<br><br>');
echoT(strLinkAdd_CProgAttendance(false, $lClientID, $lCProgID, $lEnrollRecID, 'Add ' . $cprog->strSafeAttendLabel . ' Record', true) . '&nbsp;' . strLinkAdd_CProgAttendance(false, $lClientID, $lCProgID, $lEnrollRecID, 'Add ' . $cprog->strSafeAttendLabel . ' Record', false) . '<br><br>');
echoT(strLinkView_CProgEnrollRec($lTableID, $lClientID, $lEnrollRecID, 'View ' . $cprog->strSafeEnrollLabel . ' record', true) . '&nbsp;' . strLinkView_CProgEnrollRec($lTableID, $lClientID, $lEnrollRecID, 'View ' . $cprog->strSafeEnrollLabel . ' record', false) . '<br><br>');
echoT(strLinkView_ClientRecord($lClientID, 'View client record', true) . '&nbsp;' . strLinkView_ClientRecord($lClientID, 'View client record', false) . '<br><br>');
/*
*/
     echoT($clsRpt->openRow(true));
     echoT($clsRpt->writeCell('<i>No clients match your search criteria</i>', '', '', $lNumCols));
 } else {
     $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 . '" ') . '&nbsp;' . 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));
            }
            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));
        }
        if ($showFields->bClient) {
            if (is_null($lClientID)) {
                $strLinkClient = '';
                $strClientName = '&nbsp;';
                $strLocation = '&nbsp;';
            } else {
                $strLinkClient = '<br>' . strLinkView_ClientRecord($lClientID, 'View client record', true) . '&nbsp;' . str_pad($lClientID, 5, '0', STR_PAD_LEFT);
                $strClientName = $sponsor->strClientSafeNameFL;
                if ($showFields->bLocation) {
                    $strLocation = '<br>' . htmlspecialchars($sponsor->strLocation) . '<br>' . htmlspecialchars($sponsor->strLocationCountry);
                } else {
                    $strLocation = '';
                }
            }
            echoT($clsRpt->writeCell($strSpanInactive . $strClientName . $strLinkClient . $strLocation . $strStopSpan));
        }
        echoT($clsRpt->closeRow());
    }
    echoT($clsRpt->closeReport());
}
Exemplo n.º 30
0
 public function strHTMLOneLineLink($clsSingleRem)
 {
     /*---------------------------------------------------------------------
           sample call:
           $clsRem->loadReminders();
     
           if ($clsRem->lNumReminders > 0){
              foreach ($clsRem->reminders as $clsSingleRem){
                 $strRemLink = $clsRem->strHTMLOneLineLink($clsSingleRem);
              }
           }
        ---------------------------------------------------------------------*/
     global $genumDateFormat;
     $enumRemType = $clsSingleRem->enumSource;
     $lFID = $clsSingleRem->lForeignID;
     switch ($enumRemType) {
         case CENUM_CONTEXT_PEOPLE:
             $people = new mpeople();
             $people->lPeopleID = $lFID;
             $people->peopleInfoLight();
             $strRemLink = 'people reminder for ' . $people->strSafeName . strLinkView_PeopleRecord($lFID, 'View people record', true);
             break;
         case CENUM_CONTEXT_BIZ:
             $clsBiz = new mbiz();
             $clsBiz->lBID = $lFID;
             $clsBiz->bizInfoLight();
             $strRemLink = 'business reminder for ' . $clsBiz->strSafeName . strLinkView_BizRecord($lFID, 'View business record', true);
             break;
         case CENUM_CONTEXT_CLIENT:
             $clsClient = new mclients();
             $clsClient->loadClientsViaClientID($lFID);
             $strRemLink = 'client reminder for ' . $clsClient->clients[0]->strSafeName . ' ' . strLinkView_ClientRecord($lFID, 'View client record', true);
             break;
         case CENUM_CONTEXT_GIFT:
             $clsGifts = new mdonations();
             $clsGifts->loadGiftViaGID($lFID);
             $gift = $clsGifts->gifts[0];
             $strRemLink = 'gift reminder for ' . $gift->strACOCurSymbol . number_format($gift->gi_curAmnt, 2) . ' ' . $gift->strSafeName . ' of ' . date($genumDateFormat, $gift->gi_dteDonation) . ' ' . strLinkView_GiftsRecord($lFID, 'View gift record', true);
             break;
         case CENUM_CONTEXT_USER:
             $clsUser = new muser_accts();
             $clsUser->loadSingleUserRecord($lFID);
             $user =& $clsUser->userRec[0];
             $strRemLink = 'user reminder for ' . $user->strSafeName . ' ' . strLinkView_User($lFID, 'View user record', true);
             break;
         case CENUM_CONTEXT_SPONSORSHIP:
             $cSpon = new msponsorship();
             $cSpon->sponsorInfoViaID($lFID);
             $strRemLink = 'sponsorship reminder for sponsor ' . $cSpon->sponInfo[0]->strSponSafeNameFL . ' ' . strLinkView_Sponsorship($lFID, 'View sponsorship record', true);
             break;
         case CENUM_CONTEXT_LOCATION:
         case CENUM_CONTEXT_VOLUNTEER:
         default:
             screamForHelp($enumRemType . ': Switch type not implemented</b><br>error on <b>line:</b> ' . __LINE__ . '<br><b>file:</b> ' . __FILE__ . '<br><b>function:</b> ' . __FUNCTION__);
             break;
     }
     return $strRemLink;
 }