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);
}
Example #2
0
 function loadLocationInfo($sqlWhere, &$lNumLocs, &$lNumActive, &$locations)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $locations = array();
     $lNumActive = 0;
     $sqlStr = "SELECT\n             ch_lKeyID, ch_bActive,\n             ch_strChapterName, ch_strAddress1, ch_strAddress2,\n             ch_strCity, ch_strState, ch_strCountry, ch_strZip,\n             ch_strFax, ch_strPhone, ch_strBannerTagLine, ch_strNotes,\n             ch_strEmail, ch_strWebSite,\n             ch_strDefAreaCode, ch_strDefState, ch_strDefCountry,\n             ch_lPW_MinLen, ch_bPW_UpperLower, ch_bPW_Number,\n             ch_bRetired,\n\n             ch_lOrigID, ch_lLastUpdateID,\n\n             usersC.us_strFirstName AS strCFName, usersC.us_strLastName AS strCLName,\n             usersL.us_strFirstName AS strLFName, usersL.us_strLastName AS strLLName,\n             UNIX_TIMESTAMP(ch_dteOrigin) AS dteOrigin,\n             UNIX_TIMESTAMP(ch_dteLastUpdate) AS dteLastUpdate\n\n          FROM admin_chapters\n            INNER JOIN admin_users AS usersC ON ch_lOrigID       = usersC.us_lKeyID\n            INNER JOIN admin_users AS usersL ON ch_lLastUpdateID = usersL.us_lKeyID\n\n          WHERE NOT ch_bRetired {$sqlWhere}\n          ORDER BY ch_strChapterName, ch_lKeyID;";
     $query = $this->db->query($sqlStr);
     $lNumLocs = $query->num_rows();
     if ($lNumLocs == 0) {
         $locations[0] = new stdClass();
         $loc =& $locations[0];
         $loc->lKeyID = $loc->bActive = $loc->strLocationName = $loc->strSafeLocationName = $loc->strBannerTagLine = $loc->strNotes = $loc->strAddress1 = $loc->strAddress2 = $loc->strCity = $loc->strState = $loc->strCountry = $loc->strZip = $loc->strAddress = null;
         $loc->strFax = $loc->strPhone = $loc->strEmail = $loc->strEmailCalDistLists = $loc->strWebSite = $loc->bRetired = $loc->strStaffCFName = $loc->strStaffCLName = $loc->strStaffLFName = $loc->strStaffLLName = $loc->dteOrigin = $loc->dteLastUpdate = null;
     } else {
         $idx = 0;
         foreach ($query->result() as $row) {
             $locations[$idx] = new stdClass();
             $loc =& $locations[$idx];
             $loc->lKeyID = (int) $row->ch_lKeyID;
             $loc->bActive = $bActive = (bool) $row->ch_bActive;
             if ($bActive) {
                 ++$lNumActive;
             }
             $loc->strLocationName = $row->ch_strChapterName;
             $loc->strSafeLocationName = htmlspecialchars($row->ch_strChapterName);
             $loc->strBannerTagLine = $row->ch_strBannerTagLine;
             $loc->strNotes = $row->ch_strNotes;
             $loc->strAddress1 = $row->ch_strAddress1;
             $loc->strAddress2 = $row->ch_strAddress2;
             $loc->strCity = $row->ch_strCity;
             $loc->strState = $row->ch_strState;
             $loc->strCountry = $row->ch_strCountry;
             $loc->strZip = $row->ch_strZip;
             $loc->strAddress = strBuildAddress($loc->strAddress1, $loc->strAddress2, $loc->strCity, $loc->strState, $loc->strCountry, $loc->strZip, true);
             $loc->strFax = $row->ch_strFax;
             $loc->strPhone = $row->ch_strPhone;
             $loc->strEmail = $row->ch_strEmail;
             $loc->strWebSite = $row->ch_strWebSite;
             $loc->bRetired = (bool) $row->ch_bRetired;
             $loc->strStaffCFName = $row->strCFName;
             $loc->strStaffCLName = $row->strCLName;
             $loc->strStaffLFName = $row->strLFName;
             $loc->strStaffLLName = $row->strLLName;
             $loc->dteOrigin = $row->dteOrigin;
             $loc->dteLastUpdate = $row->dteLastUpdate;
             ++$idx;
         }
     }
 }
Example #3
0
    function loadVolClientAssoc($sqlWhere, &$volClient)
    {
        //---------------------------------------------------------------------
        //
        //---------------------------------------------------------------------
        global $gstrPassPhrase;
        $volClient = array();
        $strOrder = '
           AES_DECRYPT(cr_strLName, SHA2(' . strPrepStr($gstrPassPhrase) . ',256)),
           AES_DECRYPT(cr_strFName, SHA2(' . strPrepStr($gstrPassPhrase) . ',256)),
           AES_DECRYPT(cr_strMName, SHA2(' . strPrepStr($gstrPassPhrase) . ',256)),
           cr_lKeyID ';
        $sqlStr = 'SELECT
            vca_lKeyID, vca_lVolID, vca_lClientID, vca_strNotes,
            vca_bActive, vca_dteInactive, vca_bRetired,
            vca_lOriginID, vca_lLastUpdateID, vca_dteOrigin, vca_dteLastUpdate,

            vol_strLName, vol_strFName, vol_strMName, vol_bRetired,
            vol_strPreferredName, vol_strTitle,
            vol_strAddr1, vol_strAddr2, vol_strCity,  vol_strState,
            vol_strZip,   vol_strCountry, vol_strEmail, vol_strPhone, vol_strCell,
            vol_dteBirthDate,

            AES_DECRYPT(cr_dteBirth,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS dtePBirth,
            AES_DECRYPT(cr_dteDeath,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS dtePDeath,
            AES_DECRYPT(cr_strTitle,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPTitle,
            AES_DECRYPT(cr_strFName,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPFName,
            AES_DECRYPT(cr_strMName,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPMName,
            AES_DECRYPT(cr_strLName,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPLName,
            AES_DECRYPT(cr_strAddr1,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPAddr1,
            AES_DECRYPT(cr_strAddr2,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPAddr2,
            AES_DECRYPT(cr_strCity,      SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPCity,
            AES_DECRYPT(cr_strState,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPState,
            AES_DECRYPT(cr_strCountry,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPCountry,
            AES_DECRYPT(cr_strZip,       SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPZip,
            AES_DECRYPT(cr_strPhone,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPPhone,
            AES_DECRYPT(cr_strCell,      SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPCell,
            AES_DECRYPT(cr_strEmail,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPEmail,
            AES_DECRYPT(cr_strBio,       SHA2(' . strPrepStr($gstrPassPhrase) . ",256)) AS strPBio,\n            cr_enumGender\n         FROM vol_client_association\n            INNER JOIN patient_records ON vca_lClientID = cr_lKeyID\n            INNER JOIN volunteers      ON vca_lVolID    = vol_lKeyID\n\n         WHERE NOT vca_bRetired\n            {$sqlWhere}\n            AND NOT cr_bRetired\n         ORDER BY {$strOrder};";
        $query = $this->db->query($sqlStr);
        $numRows = $query->num_rows();
        if ($numRows > 0) {
            $idx = 0;
            foreach ($query->result() as $row) {
                $volClient[$idx] = new stdClass();
                $vca =& $volClient[$idx];
                $vca->lKeyID = (int) $row->vca_lKeyID;
                $vca->lVolID = (int) $row->vca_lVolID;
                $vca->lPatientID = (int) $row->vca_lClientID;
                $vca->strNotes = $row->vca_strNotes;
                $vca->bActive = (bool) $row->vca_bActive;
                $vca->dteInactive = $row->vca_dteInactive;
                $vca->bRetired = (bool) $row->vca_bRetired;
                $vca->lOriginID = (int) $row->vca_lOriginID;
                $vca->lLastUpdateID = (int) $row->vca_lLastUpdateID;
                $vca->dteOrigin = $row->vca_dteOrigin;
                $vca->dteLastUpdate = $row->vca_dteLastUpdate;
                $vca->vol = new stdClass();
                $vca->vol->strFName = $row->vol_strFName;
                $vca->vol->strMName = $row->vol_strMName;
                $vca->vol->strLName = $row->vol_strLName;
                $vca->vol->dteBirth = $row->vol_dteBirthDate;
                //            $vca->vol->enumGender            = $row->vol_enumGender;
                $vca->vol->strAddr1 = $row->vol_strAddr1;
                $vca->vol->strAddr2 = $row->vol_strAddr2;
                $vca->vol->strCity = $row->vol_strCity;
                $vca->vol->strState = $row->vol_strState;
                $vca->vol->strCountry = $row->vol_strCountry;
                $vca->vol->strZip = $row->vol_strZip;
                $vca->vol->strPhone = $row->vol_strPhone;
                $vca->vol->strCell = $row->vol_strCell;
                $vca->vol->strEmail = $row->vol_strEmail;
                $vca->vol->strAddress = strBuildAddress($vca->vol->strAddr1, $vca->vol->strAddr2, $vca->vol->strCity, $vca->vol->strState, $vca->vol->strCountry, $vca->vol->strZip, true);
                $vca->patient = new stdClass();
                $vca->patient->strFName = $row->strPFName;
                $vca->patient->strMName = $row->strPMName;
                $vca->patient->strLName = $row->strPLName;
                $vca->patient->dteBirth = $row->dtePBirth;
                $vca->patient->enumGender = $row->cr_enumGender;
                $vca->patient->strAddr1 = $row->strPAddr1;
                $vca->patient->strAddr2 = $row->strPAddr2;
                $vca->patient->strCity = $row->strPCity;
                $vca->patient->strState = $row->strPState;
                $vca->patient->strCountry = $row->strPCountry;
                $vca->patient->strZip = $row->strPZip;
                $vca->patient->strPhone = $row->strPPhone;
                $vca->patient->strCell = $row->strPCell;
                $vca->patient->strEmail = $row->strPEmail;
                ++$idx;
            }
        }
    }
    echoT('
              <tr class="makeStripe">
                 <td class="enpRpt" style="text-align: center; width: 60pt;">' . strLinkView_ClientLocation($lCLID, 'View client location', true, 'id="cLocView_' . $lCLID . '"') . ' ' . str_pad($lCLID, 5, '0', STR_PAD_LEFT) . '
                 </td>
                 <td class="enpRpt" style="text-align: center; width: 18pt;">' . $strLinkRemove . '
                 </td>
                 <td class="enpRpt" style=" width: 160pt;"><b>' . htmlspecialchars($clsLoc->strLocation) . '</b><br>');
    echoT($clsLoc->strSponProg);
    $lNumSponsors = $clsLoc->lNumSponsors;
    if ($lNumSponsors > 0) {
        $strLinkSpon = strLinkView_SponsorsViaLocProg($lCLID, 'View sponsors for this location', true);
    } else {
        $strLinkSpon = '&nbsp;&nbsp;';
    }
    echoT('
                 </td>
                 <td class="enpRpt" style=" width: 160pt;">' . strBuildAddress($clsLoc->strAddress1, $clsLoc->strAddress2, $clsLoc->strCity, $clsLoc->strState, $clsLoc->strCountry, $clsLoc->strPostalCode, true) . '
                 </td>
                 <td class="enpRpt" style=" width: 70pt;">' . htmlspecialchars($clsLoc->strCountry) . '
                 </td>
                 <td class="enpRpt" style="text-align: center; width: 70pt;">' . number_format($clsLoc->lNumberClients) . ' ' . strLinkView_ClientsViaLocation($lCLID, 'View Clients at this Location', true) . '
                 </td>
                 <td class="enpRpt" style="text-align: center;">' . number_format($clsLoc->lNumSponsors) . '&nbsp;' . $strLinkSpon . '
                 </td>
                 <td class="enpRpt" style="text-align: center;">' . ($clsLoc->bEnableEMR ? 'Yes' : 'No') . '
                 </td>
              </tr>');
}
?>
     
</table><br>
Example #5
0
 function loadContactNameDirectoryPage($strWhereExtra, $lStartRec, $lRecsPerPage)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $sqlLimitExtra = " LIMIT {$lStartRec}, {$lRecsPerPage} ";
     $this->sqlWhereExtra = $strWhereExtra;
     $sqlStr = "SELECT\n               pe_lKeyID, pe_strLName, pe_strFName, pe_strMName,\n               pe_strTitle, pe_strPreferredName,\n               pe_strAddr1,\n               pe_strAddr2,\n               pe_strCity,\n               pe_strState,\n               pe_strCountry,\n               pe_strZip,\n               pe_strPhone,\n               pe_strCell,\n               pe_strEmail\n            FROM biz_contacts\n               INNER JOIN people_names ON bc_lContactID=pe_lKeyID\n            WHERE NOT pe_bBiz\n               AND NOT pe_bRetired\n               AND NOT bc_bRetired\n               {$strWhereExtra}\n            GROUP BY pe_lKeyID\n            ORDER BY\n               pe_strLName, pe_strFName, pe_strMName, pe_lKeyID\n            {$sqlLimitExtra};";
     $query = $this->db->query($sqlStr);
     $this->lNumContactsNames = $numRows = $query->num_rows();
     $this->contactsNames = array();
     if ($numRows > 0) {
         $idx = 0;
         foreach ($query->result() as $row) {
             $this->contactsNames[$idx] = new stdClass();
             $cRec =& $this->contactsNames[$idx];
             $cRec->lPeopleID = $row->pe_lKeyID;
             $cRec->strFName = $strFName = $row->pe_strFName;
             $cRec->strLName = $strLName = $row->pe_strLName;
             $cRec->strMName = $strMName = $row->pe_strMName;
             $cRec->strTitle = $strTitle = $row->pe_strTitle;
             $cRec->strPreferred = $strPreferred = $row->pe_strPreferredName;
             $cRec->strSafeName = htmlspecialchars(strBuildName(false, $strTitle, $strPreferred, $strFName, $strLName, $strMName));
             $cRec->strSafeNameLF = htmlspecialchars(strBuildName(true, $strTitle, $strPreferred, $strFName, $strLName, $strMName));
             $cRec->strAddr1 = $row->pe_strAddr1;
             $cRec->strAddr2 = $row->pe_strAddr2;
             $cRec->strCity = $row->pe_strCity;
             $cRec->strState = $row->pe_strState;
             $cRec->strCountry = $row->pe_strCountry;
             $cRec->strZip = $row->pe_strZip;
             $cRec->strPhone = $row->pe_strPhone;
             $cRec->strCell = $row->pe_strCell;
             $cRec->strEmail = $row->pe_strEmail;
             $cRec->strEmailFormatted = strBuildEmailLink($cRec->strEmail, '', false, '');
             $cRec->strAddress = strBuildAddress($cRec->strAddr1, $cRec->strAddr2, $cRec->strCity, $cRec->strState, $cRec->strCountry, $cRec->strZip, true);
             $cRec->biz = $this->bizViaContactPID($cRec->lPeopleID, $cRec->lNumBiz);
             ++$idx;
         }
     }
 }
Example #6
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;
     }
 }
 public function loadClientsGeneric()
 {
     //-----------------------------------------------------------------------
     //
     //-----------------------------------------------------------------------
     global $glclsDTDateFormat;
     customClient_AAYHF_01($strInnerAAYHF, $strFieldsAAYHF, $bAAYHF_Beacon);
     $strOrder = $this->strClientOrder;
     if ($strOrder == '') {
         $strOrder = ' cl_strLocation, cr_strLName, cr_strFName, cr_strMName, cr_lKeyID ';
     }
     $clsDateTime = new dl_date_time();
     $sqlStr = "SELECT\n               cr_lKeyID, cr_strFName, cr_strMName, cr_strLName,\n               cr_dteEnrollment,\n               cr_dteBirth, cr_dteDeath, cr_enumGender,\n               cr_lLocationID, cl_strCountry, cr_lStatusCatID, cr_lVocID,\n               cr_lMaxSponsors, cr_strBio, cr_bNoLongerAtLocation,\n               cr_bRetired, cr_lOriginID, cr_lLastUpdateID,\n               UNIX_TIMESTAMP(cr_dteOrigin)     AS dteOrigin,\n               UNIX_TIMESTAMP(cr_dteLastUpdate) AS dteLastUpdate,\n               cl_strLocation, cl_bEnableEMR,\n               cr_lAttributedTo, lgen_strListItem,\n\n               cr_strAddr1,      cr_strAddr2,\n               cr_strCity,       cr_strState,      cr_strCountry,\n               cr_strZip,        cr_strPhone,      cr_strCell, cr_strEmail,\n\n               -- ------------------------\n               -- vocabulary\n               -- ------------------------\n               cv_strVocTitle,\n               cv_strVocClientS, cv_strVocClientP,\n               cv_strVocSponsorS, cv_strVocSponsorP,\n               cv_strVocLocS, cv_strVocLocP,\n               cv_strVocSubLocS, cv_strVocSubLocP,\n\n               -- ------------------------\n               -- current status\n               -- ------------------------\n               csh_lKeyID, csh_lStatusID,\n               csh_dteStatusDate,\n               csh_bIncludeNotesInPacket, csh_strStatusTxt,\n\n               cst_lClientStatusCatID, cst_strStatus, cst_bAllowSponsorship,\n               cst_bShowInDir, cst_bDefault,\n               curStatSCat.csc_strCatName     AS curStat_strCatName,\n               defSCat.csc_strCatName         AS defStat_strCatName,\n\n               uc.us_strFirstName AS strUCFName, uc.us_strLastName AS strUCLName,\n               ul.us_strFirstName AS strULFName, ul.us_strLastName AS strULLName\n\n               {$strFieldsAAYHF}\n\n            FROM client_records\n               {$this->strInnerExtra}\n               {$strInnerAAYHF}\n               LEFT JOIN client_location                    ON cr_lLocationID = cl_lKeyID\n               LEFT JOIN lists_client_vocab                 ON cr_lVocID      = cv_lKeyID\n\n               LEFT JOIN client_status                      ON csh_lClientID   = cr_lKeyID\n               LEFT JOIN lists_client_status_entries        ON csh_lStatusID   = cst_lKeyID\n               LEFT JOIN client_status_cats AS curStatSCat  ON cst_lClientStatusCatID = curStatSCat.csc_lKeyID\n               LEFT JOIN client_status_cats AS defSCat      ON cr_lStatusCatID        = defSCat.csc_lKeyID\n\n               INNER JOIN admin_users  AS uc ON uc.us_lKeyID=cr_lOriginID\n               INNER JOIN admin_users  AS ul ON ul.us_lKeyID=cr_lLastUpdateID\n\n               LEFT  JOIN lists_generic      ON cr_lAttributedTo=lgen_lKeyID\n            WHERE 1\n               AND NOT cr_bRetired\n\n                 -- ---------------------------------------\n                 -- subquery to find most current status\n                 -- ---------------------------------------\n               AND csh_lKeyID=(SELECT csh_lKeyID\n                               FROM client_status\n                               WHERE csh_lClientID=cr_lKeyID\n                                  AND NOT csh_bRetired\n                               ORDER BY csh_dteStatusDate DESC, csh_lKeyID DESC\n                               LIMIT 0,1)\n\n               {$this->strExtraClientWhere}\n            ORDER BY {$strOrder}\n            {$this->strClientLimit};";
     $query = $this->db->query($sqlStr);
     $this->lNumClients = $numRows = $query->num_rows();
     $this->clients = array();
     if ($numRows == 0) {
         $this->clients[0] = new stdClass();
         $client =& $this->clients[0];
         $client->lKeyID = $client->strFName = $client->strMName = $client->strLName = $client->dteEnrollment = $client->dteBirth = $client->dteDeath = $client->enumGender = $client->lLocationID = $client->lStatusCatID = $client->lVocID = $client->lMaxSponsors = $client->strBio = $client->lAttribID = $client->strAttrib = $client->bRetired = $client->lOriginID = $client->lLastUpdateID = $client->dteOrigin = $client->dteLastUpdate = $client->strLocation = $client->strLocCountry = $client->strAddr1 = $client->strAddr2 = $client->strCity = $client->strState = $client->strCountry = $client->strZip = $client->strPhone = $client->strCell = $client->strEmail = $client->strAddress = $client->cv_strVocTitle = $client->cv_strVocClientS = $client->cv_strVocClientP = $client->cv_strVocSponsorS = $client->cv_strVocSponsorP = $client->cv_strVocLocS = $client->cv_strVocLocP = $client->cv_strVocSubLocS = $client->cv_strVocSubLocP = $client->curStat_lStatRecKeyID = $client->curStat_lStatusID = $client->curStat_dteStatus = $client->curStat_bIncludeNotesInPacket = $client->curStat_strStatusNotes = $client->curStat_lClientStatusCatID = $client->curStat_strStatus = $client->curStat_bAllowSponsorship = $client->curStat_bShowInDir = $client->curStat_bDefaultStatus = $client->curStat_strStatusCatName = null;
     } else {
         $idx = 0;
         foreach ($query->result() as $row) {
             $this->clients[$idx] = new stdClass();
             $client =& $this->clients[$idx];
             $client->lKeyID = (int) $row->cr_lKeyID;
             $client->strFName = $row->cr_strFName;
             $client->strMName = $row->cr_strMName;
             $client->strLName = $row->cr_strLName;
             $client->strSafeName = htmlspecialchars($row->cr_strFName . ' ' . $row->cr_strLName);
             $client->strSafeNameLF = htmlspecialchars($row->cr_strLName . ', ' . $row->cr_strFName);
             $client->dteEnrollment = dteMySQLDate2Unix($row->cr_dteEnrollment);
             $client->dteBirth = $mySQLdteBirth = $row->cr_dteBirth;
             $client->dteDeath = $row->cr_dteDeath;
             $client->enumGender = $row->cr_enumGender;
             $client->lLocationID = $row->cr_lLocationID;
             $client->lStatusCatID = $row->cr_lStatusCatID;
             $client->strStatusCatName = $row->defStat_strCatName;
             //------------------------------
             // client address/contact
             //------------------------------
             $client->strAddr1 = $row->cr_strAddr1;
             $client->strAddr2 = $row->cr_strAddr2;
             $client->strCity = $row->cr_strCity;
             $client->strState = $row->cr_strState;
             $client->strCountry = $row->cr_strCountry;
             $client->strZip = $row->cr_strZip;
             $client->strPhone = $row->cr_strPhone;
             $client->strCell = $row->cr_strCell;
             $client->strEmail = $row->cr_strEmail;
             $client->strEmailFormatted = strBuildEmailLink($client->strEmail, '', false, '');
             $client->strAddress = strBuildAddress($client->strAddr1, $client->strAddr2, $client->strCity, $client->strState, $client->strCountry, $client->strZip, true);
             //------------------------------
             // client age/birth day info
             //------------------------------
             if (is_null($mySQLdteBirth)) {
                 $client->objClientBirth = null;
                 $client->lAgeYears = null;
                 $client->strClientAgeBDay = '(age n/a)';
             } else {
                 $client->objClientBirth = new dl_date_time();
                 $client->objClientBirth->setDateViaMySQL(0, $mySQLdteBirth);
                 $client->strClientAgeBDay = $client->objClientBirth->strPeopleAge(0, $mySQLdteBirth, $client->lAgeYears, $glclsDTDateFormat);
             }
             $client->lVocID = $row->cr_lVocID;
             $client->lMaxSponsors = $row->cr_lMaxSponsors;
             $client->strBio = $row->cr_strBio;
             $client->bRetired = $row->cr_bRetired;
             $client->lOriginID = $row->cr_lOriginID;
             $client->lLastUpdateID = $row->cr_lLastUpdateID;
             $client->strLocation = $row->cl_strLocation;
             $client->strLocCountry = $row->cl_strCountry;
             $client->bEnableEMR = $row->cl_bEnableEMR;
             $client->cv_strVocTitle = $row->cv_strVocTitle;
             $client->cv_strVocClientS = $row->cv_strVocClientS;
             $client->cv_strVocClientP = $row->cv_strVocClientP;
             $client->cv_strVocSponsorS = $row->cv_strVocSponsorS;
             $client->cv_strVocSponsorP = $row->cv_strVocSponsorP;
             $client->cv_strVocLocS = $row->cv_strVocLocS;
             $client->cv_strVocLocP = $row->cv_strVocLocP;
             $client->cv_strVocSubLocS = $row->cv_strVocSubLocS;
             $client->cv_strVocSubLocP = $row->cv_strVocSubLocP;
             //---------------------------------
             // status fields - current status
             //---------------------------------
             $client->curStat_lStatRecKeyID = $row->csh_lKeyID;
             $client->curStat_lStatusID = $row->csh_lStatusID;
             $client->curStat_dteStatus = dteMySQLDate2Unix($row->csh_dteStatusDate);
             $client->curStat_bIncludeNotesInPacket = $row->csh_bIncludeNotesInPacket;
             $client->curStat_strStatusNotes = $row->csh_strStatusTxt;
             $client->curStat_lClientStatusCatID = $row->cst_lClientStatusCatID;
             $client->curStat_strStatus = $row->cst_strStatus;
             $client->curStat_bAllowSponsorship = $row->cst_bAllowSponsorship;
             $client->curStat_bShowInDir = $row->cst_bShowInDir;
             $client->curStat_bDefaultStatus = $row->cst_bDefault;
             $client->curStat_strStatusCatName = $row->curStat_strCatName;
             $client->lAttribID = $row->cr_lAttributedTo;
             $client->strAttrib = $row->lgen_strListItem;
             $client->dteOrigin = $row->dteOrigin;
             $client->dteLastUpdate = $row->dteLastUpdate;
             $client->ucstrFName = $row->strUCFName;
             $client->ucstrLName = $row->strUCLName;
             $client->ulstrFName = $row->strULFName;
             $client->ulstrLName = $row->strULLName;
             $client->strFlagsTable = '';
             //------------------
             // sponsors
             //------------------
             $this->loadSponsorshipInfo($client->lKeyID, true, $client->lNumSponsors, $client->sponsors);
             //------------------
             // custom fields
             //------------------
             addClientFields_AAYHF_Beacon($bAAYHF_Beacon, $client, $row);
             ++$idx;
         }
     }
     if ($this->bDebug) {
         $this->dumpClientRecs();
     }
 }
 public function loadLocationRec($id)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $sqlStr = "SELECT\n            cl_lKeyID,        cl_strLocation, cl_strDescription,\n            cl_strCountry,    cl_strWebLink,  cl_strAddress1,\n            cl_strAddress2,   cl_strCity,     cl_strState,\n            cl_strPostalCode, cl_strNotes,    cl_bEnableEMR, cl_bRetired,\n            cl_lOriginID,     cl_lLastUpdateID,\n            UNIX_TIMESTAMP(cl_dteOrigin)     AS dteOrigin,\n            UNIX_TIMESTAMP(cl_dteLastUpdate) AS dteLastUpdate,\n            uc.us_strFirstName AS strUCFName, uc.us_strLastName AS strUCLName,\n            ul.us_strFirstName AS strULFName, ul.us_strLastName AS strULLName\n\n         FROM client_location\n               INNER JOIN admin_users  AS uc ON uc.us_lKeyID=cl_lOriginID\n               INNER JOIN admin_users  AS ul ON ul.us_lKeyID=cl_lLastUpdateID\n\n         WHERE cl_lKeyID={$id};";
     $query = $this->db->query($sqlStr);
     $numRows = $query->num_rows();
     //      $result = mysql_query($sqlStr);
     //      if (bSQLError('SQL error on line '.__LINE__.', file '.__FILE__.', function '.__FUNCTION__, $sqlStr) ) {
     //         screamForHelp('Unexpected SQL error');
     //      }else{
     //         $numRows = mysql_num_rows($result);
     if ($numRows == 0) {
         $this->lKeyID = $this->strLocation = $this->strDescription = $this->strCountry = $this->strWebLink = $this->strAddress1 = $this->strAddress2 = $this->strCity = $this->strState = $this->strPostalCode = $this->strNotes = $this->bEnableEMR = $this->bRetired = $this->lOriginID = $this->lLastUpdateID = $this->dteOrigin = $this->dteLastUpdate = null;
     } else {
         $row = $query->row();
         //            $row = mysql_fetch_array($result);
         $this->lKeyID = (int) $row->cl_lKeyID;
         $this->strLocation = $row->cl_strLocation;
         $this->strDescription = $row->cl_strDescription;
         $this->strCountry = $row->cl_strCountry;
         $this->strWebLink = $row->cl_strWebLink;
         $this->strAddress1 = $row->cl_strAddress1;
         $this->strAddress2 = $row->cl_strAddress2;
         $this->strCity = $row->cl_strCity;
         $this->strState = $row->cl_strState;
         $this->strPostalCode = $row->cl_strPostalCode;
         $this->strAddress = strBuildAddress($this->strAddress1, $this->strAddress2, $this->strCity, $this->strState, $this->strCountry, $this->strPostalCode, true);
         $this->strNotes = $row->cl_strNotes;
         $this->bEnableEMR = $row->cl_bEnableEMR;
         $this->bRetired = (bool) $row->cl_bRetired;
         $this->lOriginID = (int) $row->cl_lOriginID;
         $this->lLastUpdateID = (int) $row->cl_lLastUpdateID;
         $this->dteOrigin = (int) $row->dteOrigin;
         $this->dteLastUpdate = (int) $row->dteLastUpdate;
         $this->strUCFName = $row->strUCFName;
         $this->strUCLName = $row->strUCLName;
         $this->strULFName = $row->strULFName;
         $this->strULLName = $row->strULLName;
     }
     //      }
 }
 function loadChapterInfo()
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $clsACO = new madmin_aco();
     if (is_null($this->lChapterID)) {
         screamForHelp('CHAPTER ID NOT SET<br>error on <b>line:</b> ' . __LINE__ . '<br><b>file: </b>' . __FILE__ . '<br><b>function: </b>' . __FUNCTION__);
     }
     $sqlStr = "SELECT\n             ch_lKeyID,\n             ch_strChapterName, ch_strAddress1, ch_strAddress2,\n             ch_strCity, ch_strState, ch_strCountry, ch_strZip,\n             ch_strFax, ch_strPhone, ch_strBannerTagLine,\n             ch_strEmail, ch_strEmailCalDistr, ch_strWebSite,\n             ch_strDefAreaCode, ch_strDefState, ch_strDefCountry,\n             ch_lPW_MinLen, ch_bPW_UpperLower, ch_bPW_Number,\n             ch_bUS_DateFormat, ch_lDefaultACO, ch_lTimeZone,\n             ch_vocZip, ch_vocState, ch_vocJobSkills,\n             aco_strFlag, aco_strCurrencySymbol, aco_strName,\n             ch_bRetired,\n\n             ch_lOrigID, ch_lLastUpdateID,\n             UNIX_TIMESTAMP(ch_dteOrigin) AS dteOrigin,\n             UNIX_TIMESTAMP(ch_dteLastUpdate) AS dteLastUpdate,\n\n             tz_strTimeZone,\n\n             usersC.us_strFirstName AS strCFName, usersC.us_strLastName AS strCLName,\n             usersL.us_strFirstName AS strLFName, usersL.us_strLastName AS strLLName,\n             UNIX_TIMESTAMP(ch_dteOrigin) AS dteOrigin,\n             UNIX_TIMESTAMP(ch_dteLastUpdate) AS dteLastUpdate\n\n          FROM admin_chapters\n            INNER JOIN admin_users AS usersC ON ch_lOrigID       = usersC.us_lKeyID\n            INNER JOIN admin_users AS usersL ON ch_lLastUpdateID = usersL.us_lKeyID\n            INNER JOIN admin_aco             ON ch_lDefaultACO   = aco_lKeyID\n            INNER JOIN lists_tz              ON ch_lTimeZone     = tz_lKeyID\n\n          WHERE ch_lKeyID={$this->lChapterID};";
     $query = $this->db->query($sqlStr);
     $numRows = $query->num_rows();
     if ($numRows == 0) {
         echo "<br><br>{$sqlStr}<br><br>";
         screamForHelp('EOF error on line ' . __LINE__ . ', file ' . __FILE__ . ', function ' . __FUNCTION__);
     } else {
         $row = $query->row();
         $this->chapterRec = new stdClass();
         $this->chapterRec->lKeyID = (int) $row->ch_lKeyID;
         $this->chapterRec->strChapterName = $row->ch_strChapterName;
         $this->chapterRec->strSafeChapterName = htmlspecialchars($row->ch_strChapterName);
         $this->chapterRec->strBannerTagLine = $row->ch_strBannerTagLine;
         $this->chapterRec->strAddress1 = $row->ch_strAddress1;
         $this->chapterRec->strAddress2 = $row->ch_strAddress2;
         $this->chapterRec->strCity = $row->ch_strCity;
         $this->chapterRec->strState = $row->ch_strState;
         $this->chapterRec->strCountry = $row->ch_strCountry;
         $this->chapterRec->strZip = $row->ch_strZip;
         $this->chapterRec->strAddress = strBuildAddress($this->chapterRec->strAddress1, $this->chapterRec->strAddress2, $this->chapterRec->strCity, $this->chapterRec->strState, $this->chapterRec->strCountry, $this->chapterRec->strZip, true);
         $this->chapterRec->strFax = $row->ch_strFax;
         $this->chapterRec->strPhone = $row->ch_strPhone;
         $this->chapterRec->strEmail = $row->ch_strEmail;
         $this->chapterRec->strEmailCalDistLists = $row->ch_strEmailCalDistr;
         $this->chapterRec->strWebSite = $row->ch_strWebSite;
         $this->chapterRec->lTimeZoneID = (int) $row->ch_lTimeZone;
         $this->chapterRec->strTimeZone = $row->tz_strTimeZone;
         $this->chapterRec->strDefAreaCode = $row->ch_strDefAreaCode;
         $this->chapterRec->strDefState = $row->ch_strDefState;
         $this->chapterRec->strDefCountry = $row->ch_strDefCountry;
         $this->chapterRec->bUS_DateFormat = (bool) $row->ch_bUS_DateFormat;
         $this->chapterRec->lDefaultACO = (int) $row->ch_lDefaultACO;
         $this->chapterRec->strFlag = $row->aco_strFlag;
         $this->chapterRec->strFlagImg = $clsACO->strFlagImage($row->aco_strFlag, $row->aco_strName);
         $this->chapterRec->strCurrencySymbol = $row->aco_strCurrencySymbol;
         $this->chapterRec->strCountryName = $row->aco_strName;
         $this->chapterRec->lPW_MinLen = $row->ch_lPW_MinLen;
         $this->chapterRec->bPW_UpperLower = (bool) $row->ch_bPW_UpperLower;
         $this->chapterRec->bPW_Number = (bool) $row->ch_bPW_Number;
         $this->chapterRec->bRetired = (bool) $row->ch_bRetired;
         $this->chapterRec->strStaffCFName = $row->strCFName;
         $this->chapterRec->strStaffCLName = $row->strCLName;
         $this->chapterRec->strStaffLFName = $row->strLFName;
         $this->chapterRec->strStaffLLName = $row->strLLName;
         $this->chapterRec->vocabulary = new stdClass();
         $this->chapterRec->vocabulary->vocZip = $row->ch_vocZip;
         $this->chapterRec->vocabulary->vocState = $row->ch_vocState;
         $this->chapterRec->vocabulary->vocJobSkills = $row->ch_vocJobSkills;
         $this->chapterRec->dteOrigin = $row->dteOrigin;
         $this->chapterRec->dteLastUpdate = $row->dteLastUpdate;
     }
 }
    public function loadPContactsPatientTree($sqlWhereExtra, $sqlOrder, &$lNumPatients, &$pContacts)
    {
        //---------------------------------------------------------------------
        //
        //---------------------------------------------------------------------
        global $gstrPassPhrase;
        $lNumPatients = 0;
        $pContacts = array();
        if ($sqlOrder == '') {
            $sqlOrder = ' cr_strLName, cr_strFName, cr_lKeyID,  cc_strLName, cc_strFName, cc_lKeyID ';
        }
        $sqlStr = 'SELECT
            cr_lKeyID,
            cc_lKeyID, cc_lPatientID,
            lgRel.lgen_strListItem AS strRelationship,
            cc_lRelationshipID, cc_enumGender,

            AES_DECRYPT(cr_strFName,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPatientFName,
            AES_DECRYPT(cr_strMName,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPatientMName,
            AES_DECRYPT(cr_strLName,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPatientLName,
            AES_DECRYPT(cc_strTitle,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPConTitle,
            AES_DECRYPT(cc_strFName,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPConFName,
            AES_DECRYPT(cc_strMName,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPConMName,
            AES_DECRYPT(cc_strLName,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPConLName,
            AES_DECRYPT(cc_strAddr1,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strAddr1,
            AES_DECRYPT(cc_strAddr2,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strAddr2,
            AES_DECRYPT(cc_strCity,    SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strCity,
            AES_DECRYPT(cc_strState,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strState,
            AES_DECRYPT(cc_strCountry, SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strCountry,
            AES_DECRYPT(cc_strZip,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strZip,
            AES_DECRYPT(cc_strPhone,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPhone,
            AES_DECRYPT(cc_strCell,    SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strCell,
            AES_DECRYPT(cc_strEmail,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strEmail,
            AES_DECRYPT(cc_strNotes,   SHA2(' . strPrepStr($gstrPassPhrase) . ",256)) AS strNotes,\n\n            cc_lOriginID, cc_lLastUpdateID, cc_dteOrigin, cc_dteLastUpdate\n         FROM patient_records\n            INNER JOIN patient_contacts       ON cc_lPatientID     = cr_lKeyID\n            INNER JOIN lists_generic AS lgRel ON lgRel.lgen_lKeyID = cc_lRelationshipID\n         WHERE NOT cr_bRetired AND NOT cc_bRetired\n            {$sqlWhereExtra}\n         ORDER BY {$sqlOrder};";
        $query = $this->db->query($sqlStr);
        $numRows = $query->num_rows();
        if ($numRows > 0) {
            $patientIDs = array();
            $idx = 0;
            foreach ($query->result() as $row) {
                $lPID = (int) $row->cr_lKeyID;
                if (!isset($patientIDs[$lPID])) {
                    $patientIDs[$lPID] = $idx;
                    $pIDX = $idx;
                    ++$idx;
                    ++$lNumPatients;
                    $pContacts[$pIDX] = new stdClass();
                    $pc =& $pContacts[$pIDX];
                    $pc->lNumContacts = 0;
                    $pc->contacts = array();
                    $pc->lPatientID = (int) $row->cr_lKeyID;
                    $pc->strPatientFName = $row->strPatientFName;
                    $pc->strPatientMName = $row->strPatientMName;
                    $pc->strPatientLName = $row->strPatientLName;
                } else {
                    $pIDX = $patientIDs[$lPID];
                }
                $pc->contacts[$pc->lNumContacts] = new stdClass();
                $pcc =& $pc->contacts[$pc->lNumContacts];
                $pcc->lContactID = $row->cc_lKeyID;
                $pcc->lPatientID = $row->cc_lPatientID;
                $pcc->lRelationshipID = $row->cc_lRelationshipID;
                $pcc->enumGender = $row->cc_enumGender;
                $pcc->strPConTitle = $row->strPConTitle;
                $pcc->strFName = $row->strPConFName;
                $pcc->strMName = $row->strPConMName;
                $pcc->strLName = $row->strPConLName;
                $pcc->strAddr1 = $row->strAddr1;
                $pcc->strAddr2 = $row->strAddr2;
                $pcc->strCity = $row->strCity;
                $pcc->strState = $row->strState;
                $pcc->strCountry = $row->strCountry;
                $pcc->strZip = $row->strZip;
                $pcc->strPhone = $row->strPhone;
                $pcc->strCell = $row->strCell;
                $pcc->strEmail = $row->strEmail;
                $pcc->strNotes = $row->strNotes;
                $pcc->strAddress = strBuildAddress($pcc->strAddr1, $pcc->strAddr2, $pcc->strCity, $pcc->strState, $pcc->strCountry, $pcc->strZip, true);
                $pcc->lOriginID = $row->cc_lOriginID;
                $pcc->lLastUpdateID = $row->cc_lLastUpdateID;
                $pcc->dteOrigin = $row->cc_dteOrigin;
                $pcc->dteLastUpdate = $row->cc_dteLastUpdate;
                $pcc->strRelationship = $row->strRelationship;
                ++$pc->lNumContacts;
            }
        }
    }
 private function searchPeopleTableGeneric($bHofH, $bBiz, $enumSearchType, $bNewVol)
 {
     //-----------------------------------------------------------------------
     //
     //-----------------------------------------------------------------------
     $clsPeople = new mpeople();
     if ($bHofH) {
         $strWhereHofH = ' AND pe_lKeyID=pe_lHouseholdID ';
     } else {
         $strWhereHofH = '';
     }
     $strWhereVol = $strSelectVol = '';
     if ($enumSearchType == CENUM_CONTEXT_VOLUNTEER) {
         $strSelectVol = ', vol_lKeyID, vol_bInactive ';
         if ($bNewVol) {
             $strInnerVol = ' LEFT JOIN volunteers ON pe_lKeyID=vol_lPeopleID ';
             $strWhereVol = ' AND ((vol_lKeyID IS NULL) OR (vol_bInactive)) ';
         } else {
             $strInnerVol = ' INNER JOIN volunteers ON pe_lKeyID=vol_lPeopleID ';
         }
     } else {
         $strInnerVol = '';
     }
     $strWhereBiz = ' AND ' . ($bBiz ? '' : ' NOT ') . ' pe_bBiz ';
     $sqlStr = "SELECT\n            pe_lKeyID, pe_strFName, pe_strLName, pe_strMName,\n            pe_strPreferredName, pe_strTitle, pe_lHouseholdID,\n            pe_strAddr1, pe_strAddr2, pe_strCity, pe_strState,\n            pe_strCountry, pe_strZip\n            {$strSelectVol}\n         FROM people_names\n            {$strInnerVol}\n         WHERE 1\n            AND NOT pe_bRetired\n            {$strWhereHofH}\n            {$strWhereBiz}\n            {$strWhereVol}\n            {$this->strWhereExtra}\n         ORDER BY pe_strLName, pe_strFName, pe_lKeyID;";
     $query = $this->db->query($sqlStr);
     $numRows = $query->num_rows();
     if ($numRows > 0) {
         $idx = 0;
         foreach ($query->result() as $row) {
             $this->searchResults[$this->lNumSearchResults] = new stdClass();
             $clsResult = $this->searchResults[$this->lNumSearchResults];
             if ($enumSearchType == CENUM_CONTEXT_VOLUNTEER && !$bNewVol) {
                 $clsResult->lKeyID = $row->vol_lKeyID;
             } else {
                 $clsResult->lKeyID = $row->pe_lKeyID;
             }
             $clsResult->enumSearchType = $enumSearchType;
             switch ($enumSearchType) {
                 case CENUM_CONTEXT_HOUSEHOLD:
                     $clsResult->strResult = '<b>The ' . htmlspecialchars($row->pe_strFName . ' ' . $row->pe_strLName) . ' Household</b><br>' . strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true, true);
                     break;
                 case CENUM_CONTEXT_VOLUNTEER:
                     $strSafeNameLF = htmlspecialchars(strBuildName(true, $row->pe_strTitle, $row->pe_strPreferredName, $row->pe_strFName, $row->pe_strLName, $row->pe_strMName));
                     $strFont = $strFontEnd = '';
                     if (!is_null($row->vol_lKeyID) && $row->vol_bInactive) {
                         $strFont = '<font style="color: #777777"><i>';
                         $strFontEnd = '<br>(inactive volunteer)</i></font> ';
                     }
                     $clsResult->strResult = $strFont . '<b>' . $strSafeNameLF . "</b><br>\n" . strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true, true) . $strFontEnd;
                     break;
                 case CENUM_CONTEXT_PEOPLE:
                     $strHousehold = $clsPeople->strHouseholdNameViaHID($row->pe_lHouseholdID);
                     $strSafeNameLF = htmlspecialchars(strBuildName(true, $row->pe_strTitle, $row->pe_strPreferredName, $row->pe_strFName, $row->pe_strLName, $row->pe_strMName));
                     $clsResult->strResult = '<b>' . $strSafeNameLF . "</b><br>\n" . '<i>' . htmlspecialchars($strHousehold) . '</i><br>' . strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true, true);
                     break;
                 case CENUM_CONTEXT_BIZ:
                     $clsResult->strResult = '<b>' . htmlspecialchars($row->pe_strLName) . '</b><br>' . strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true, true);
                     break;
                 default:
                     screamForHelp($enumSearchType . ': invalid switch type<br>error on <b>line:</b> ' . __LINE__ . '<br><b>file: </b>' . __FILE__ . '<br><b>function: </b>' . __FUNCTION__);
                     break;
             }
             ++$this->lNumSearchResults;
             ++$idx;
         }
     }
 }
 public function searchSponsors(&$local)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $strDateFormat = strMysqlDateFormat(false);
     $sqlStr = "SELECT sp_lKeyID,\n            sp_lClientID, sp_lSponsorProgramID, sp_bInactive,\n            pe_lKeyID, pe_bBiz, pe_strFName, pe_strMName,\n            pe_strLName, pe_strAddr1, pe_strAddr2, pe_strCity,\n            pe_strState, pe_strCountry, pe_strZip,\n            DATE_FORMAT(cr_dteBirth, {$strDateFormat}) AS strClientBDate, cr_enumGender,\n            cr_strFName, cr_strLName, cl_strLocation, cl_strCountry,\n            sc_strProgram\n         FROM sponsor\n            INNER JOIN people_names               ON pe_lKeyID      = sp_lForeignID\n            INNER JOIN lists_sponsorship_programs ON sc_lKeyID      = sp_lSponsorProgramID\n            LEFT  JOIN client_records             ON cr_lKeyID      = sp_lClientID\n            LEFT  JOIN client_location            ON cr_lLocationID = cl_lKeyID\n         WHERE NOT pe_bRetired AND NOT sp_bRetired\n            {$this->strWhereExtra}\n         ORDER BY pe_strLName, pe_strFName, pe_strMName, pe_lKeyID;";
     $query = $local->db->query($sqlStr);
     $numRows = $query->num_rows();
     $clsResult = new stdClass();
     $clsResult->strResult = "\n\n\n\n";
     if ($numRows > 0) {
         foreach ($query->result() as $row) {
             $bBiz = $row->pe_bBiz;
             $lSponID = $row->sp_lKeyID;
             $bInactive = $row->sp_bInactive;
             $this->searchResults[$this->lNumSearchResults] = new stdClass();
             $clsResult = $this->searchResults[$this->lNumSearchResults];
             $clsResult->lKeyID = $row->sp_lKeyID;
             if ($bInactive) {
                 $strStart = '<span style="color: #999;">';
                 $strStop = '</span>';
             } else {
                 $strStart = $strStop = '';
             }
             $clsResult->strResult .= $strStart;
             if ($bBiz) {
                 $clsResult->strResult .= '<b>' . htmlspecialchars($row->pe_strLName) . '</b><br>';
             } else {
                 $clsResult->strResult .= '<b>' . htmlspecialchars($row->pe_strLName) . '</b>, ' . htmlspecialchars($row->pe_strFName) . "<br>\n";
             }
             $clsResult->strResult .= strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true, true) . '<br>' . '<b>program:</b> ' . htmlspecialchars($row->sc_strProgram);
             if (is_null($row->sp_lClientID)) {
                 $clsResult->strResult .= '<br>Client not set';
             } else {
                 $clsResult->strResult .= '<br><br>' . '<b>client:</b> ' . htmlspecialchars($row->cr_strLName . ', ' . $row->cr_strFName) . '<br>' . '<b>birthdate:</b> ' . $row->strClientBDate . '<br>' . '<b>gender:</b> ' . $row->cr_enumGender . '<br>' . '<b>location:</b> ' . htmlspecialchars($row->cl_strLocation . ' / ' . $row->cl_strCountry) . '<br>' . '<b>status:</b> ' . ($bInactive ? 'Inactive' : 'Active');
             }
             $clsResult->strResult .= $strStop;
             ++$this->lNumSearchResults;
         }
     }
 }
Example #13
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;
 }
Example #14
0
 function loadPeople($bIncludeSpon, $bIncludeGiftSum, $bPeople)
 {
     //------------------------------------------------------------------------------
     //
     //------------------------------------------------------------------------------
     $clsACO = new madmin_aco();
     $this->people = array();
     if ($bIncludeSpon) {
         $clsSpon = new msponsorship();
     }
     $sqlStr = "SELECT\n            pe_lKeyID,\n            pe_lHouseholdID,   pe_strTitle,      pe_strFName,\n            pe_strMName,       pe_strLName,      pe_strPreferredName,\n            pe_strSalutation,  pe_strAddr1,      pe_strAddr2,\n            pe_strCity,        pe_strState,      pe_strCountry,\n            pe_strZip,         pe_strPhone,      pe_strCell, pe_strEmail,\n            pe_enumGender,     pe_strNotes,      pe_bNoGiftAcknowledge,\n            pe_lAttributedTo,  pe_strImportID,\n            pe_lOriginID,      pe_lLastUpdateID,\n            tblAttrib.lgen_strListItem AS strAttrib,\n\n            pe_lACO, aco_strFlag, aco_strName, aco_strCurrencySymbol,\n\n            pe_dteBirthDate,\n            pe_dteDeathDate,\n            usersC.us_strFirstName AS strCFName, usersC.us_strLastName AS strCLName,\n            usersL.us_strFirstName AS strLFName, usersL.us_strLastName AS strLLName,\n            pe_dteExpire,\n            UNIX_TIMESTAMP(pe_dteOrigin)     AS dteOrigin,\n            UNIX_TIMESTAMP(pe_dteLastUpdate) AS dteLastUpdate\n         FROM people_names\n            INNER JOIN admin_users AS usersC ON pe_lOriginID    = usersC.us_lKeyID\n            INNER JOIN admin_users AS usersL ON pe_lLastUpdateID= usersL.us_lKeyID\n            INNER JOIN admin_aco             ON pe_lACO         = aco_lKeyID\n            {$this->sqlInnerExtra}\n            LEFT  JOIN lists_generic AS tblAttrib ON pe_lAttributedTo=tblAttrib.lgen_lKeyID\n\n         WHERE 1\n            {$this->sqlWhereExtra}\n            AND " . ($bPeople ? 'NOT ' : '') . "pe_bBiz\n            AND NOT pe_bRetired\n         {$this->sqlOrderExtra}\n         {$this->sqlLimitExtra};";
     $query = $this->db->query($sqlStr);
     $this->lNumPeople = $query->num_rows();
     if ($this->lNumPeople == 0) {
         $this->people[0] = new stdClass();
         $pRec =& $this->people[0];
         $pRec->lKeyID = $pRec->lHouseholdID = $pRec->bHOH = $pRec->strHouseholdName = $pRec->strTitle = $pRec->strFName = $pRec->strMName = $pRec->strLName = $pRec->strPreferredName = $pRec->strSafeName = $pRec->strSafeNameLF = null;
         $pRec->strSalutation = $pRec->strAddr1 = $pRec->strAddr2 = $pRec->strCity = $pRec->strState = $pRec->strCountry = $pRec->strZip = $pRec->strPhone = $pRec->strCell = $pRec->strAddress = null;
         $pRec->strEmail = $pRec->strEmailFormatted = $pRec->enumGender = $pRec->lACO = $pRec->strACO = $pRec->strCurSymbol = $pRec->strFlag = $pRec->strFlagImage = $pRec->bNoGiftAcknowledge = $pRec->lAttributedTo = $pRec->strAttrib = $pRec->lImportID = $pRec->strImportRecID = $pRec->dteExpire = $pRec->lOriginID = $pRec->lLastUpdateID = $pRec->dteMysqlBirthDate = $pRec->dteMysqlDeath = $pRec->dteOrigin = $pRec->dteLastUpdate = $pRec->strStaffCFName = $pRec->strStaffCLName = $pRec->strStaffLFName = $pRec->strStaffLLName = null;
     } else {
         $idx = 0;
         if ($bIncludeGiftSum) {
             $clsGifts = new mdonations();
             $clsGifts->bUseDateRange = false;
             $clsGifts->cumulativeOpts = new stdClass();
             $clsGifts->cumulativeOpts->enumCumulativeSource = 'people';
         }
         foreach ($query->result() as $row) {
             $this->people[$idx] = new stdClass();
             $pRec =& $this->people[$idx];
             $pRec->lKeyID = $lPID = $row->pe_lKeyID;
             $pRec->lHouseholdID = $lHID = $row->pe_lHouseholdID;
             $pRec->bHOH = $lHID == $lPID;
             $pRec->strHouseholdName = $this->strHouseholdNameViaHID($lHID);
             $pRec->strTitle = $strTitle = $row->pe_strTitle;
             $pRec->strFName = $strFName = $row->pe_strFName;
             $pRec->strMName = $strMName = $row->pe_strMName;
             $pRec->strLName = $strLName = $row->pe_strLName;
             $pRec->strPreferredName = $strPreferred = $row->pe_strPreferredName;
             $pRec->strSafeName = htmlspecialchars(strBuildName(false, $strTitle, $strPreferred, $strFName, $strLName, $strMName));
             $pRec->strSafeNameLF = htmlspecialchars(strBuildName(true, $strTitle, $strPreferred, $strFName, $strLName, $strMName));
             $pRec->strSalutation = $row->pe_strSalutation;
             $pRec->strAddr1 = $row->pe_strAddr1;
             $pRec->strAddr2 = $row->pe_strAddr2;
             $pRec->strCity = $row->pe_strCity;
             $pRec->strState = $row->pe_strState;
             $pRec->strCountry = $row->pe_strCountry;
             $pRec->strZip = $row->pe_strZip;
             $pRec->strPhone = $row->pe_strPhone;
             $pRec->strCell = $row->pe_strCell;
             $pRec->strAddress = strBuildAddress($pRec->strAddr1, $pRec->strAddr2, $pRec->strCity, $pRec->strState, $pRec->strCountry, $pRec->strZip, true);
             $pRec->strEmail = $row->pe_strEmail;
             $pRec->strEmailFormatted = strBuildEmailLink($pRec->strEmail, '', false, '');
             $pRec->enumGender = $row->pe_enumGender;
             $pRec->lACO = $row->pe_lACO;
             $pRec->strACO = $row->aco_strName;
             $pRec->strCurSymbol = $row->aco_strCurrencySymbol;
             $pRec->strFlag = $row->aco_strFlag;
             $pRec->strFlagImage = $clsACO->strFlagImage($pRec->strFlag, $pRec->strACO);
             $pRec->bNoGiftAcknowledge = $row->pe_bNoGiftAcknowledge;
             $pRec->lAttributedTo = $row->pe_lAttributedTo;
             $pRec->strAttrib = $row->strAttrib;
             $pRec->lImportID = $row->pe_strImportID;
             $pRec->strImportRecID = $row->pe_strImportID;
             $pRec->dteExpire = dteMySQLDate2Unix($row->pe_dteExpire);
             $pRec->lOriginID = $row->pe_lOriginID;
             $pRec->lLastUpdateID = $row->pe_lLastUpdateID;
             $pRec->dteMysqlBirthDate = $row->pe_dteBirthDate;
             $pRec->dteMysqlDeath = $row->pe_dteDeathDate;
             $pRec->strNotes = $row->pe_strNotes;
             $pRec->dteOrigin = $row->dteOrigin;
             $pRec->dteLastUpdate = $row->dteLastUpdate;
             $pRec->strStaffCFName = $row->strCFName;
             $pRec->strStaffCLName = $row->strCLName;
             $pRec->strStaffLFName = $row->strLFName;
             $pRec->strStaffLLName = $row->strLLName;
             //-------------------
             // sponsorship
             //-------------------
             if ($bIncludeSpon) {
                 $clsSpon->sponsorshipInfoViaPID($lPID);
                 $pRec->lNumSponsorship = $lNumSpons = $clsSpon->lNumSponsors;
                 if ($lNumSpons == 0) {
                     $pRec->sponInfo = null;
                 } else {
                     $pRec->sponInfo = $clsSpon->sponInfo;
                 }
             }
             //-------------------
             // cumulative gifts
             //-------------------
             if ($bIncludeGiftSum) {
                 $clsGifts->lPeopleID = $lPID;
                 $clsGifts->cumulativeOpts->enumMoneySet = 'all';
                 $clsGifts->cumulativeOpts->bSoft = false;
                 $clsGifts->cumulativeDonation($clsACO, $pRec->lTotHardGifts);
                 $pRec->lNumACODonationGroups_hard = $clsGifts->lNumCumulative;
                 $pRec->donationsViaACO_hard = $clsGifts->cumulative;
                 $clsGifts->cumulativeOpts->bSoft = true;
                 $clsGifts->cumulativeDonation($clsACO, $pRec->lTotSoftGifts);
                 $pRec->lNumACODonationGroups_soft = $clsGifts->lNumCumulative;
                 $pRec->donationsViaACO_soft = $clsGifts->cumulative;
             } else {
                 $pRec->lNumACODonationGroups_hard = $pRec->donationsViaACO_hard = $pRec->lNumACODonationGroups_soft = $pRec->donationsViaACO_soft = null;
             }
             ++$idx;
         }
     }
 }
 public function loadVolAssignmentsGeneric($strWhere)
 {
     //-----------------------------------------------------------------------
     //
     //-----------------------------------------------------------------------
     $this->vols = array();
     $sqlStr = "SELECT\r\n            vsa_lKeyID, vsa_lEventDateShiftID, vsa_lVolID,\r\n            vsa_strNotes, vsa_dHoursWorked,\r\n            vol_lPeopleID,\r\n            pe_lHouseholdID, pe_strFName, pe_strLName,\r\n            pe_strAddr1, pe_strAddr2, pe_strCity, pe_strState, pe_strCountry, pe_strZip,\r\n            pe_strPhone, pe_strCell, pe_strEmail\r\n\r\n         FROM vol_events_dates_shifts_assign\r\n            INNER JOIN volunteers   ON vsa_lVolID    = vol_lKeyID\r\n            INNER JOIN people_names ON vol_lPeopleID = pe_lKeyID\r\n         WHERE\r\n            NOT vsa_bRetired\r\n            {$strWhere}\r\n         ORDER BY pe_strLName, pe_strFName, vsa_lKeyID;";
     $query = $this->db->query($sqlStr);
     $this->lNumVols = $numRows = $query->num_rows();
     if ($numRows == 0) {
         $this->vols[0] = new stdClass();
         $vol =& $this->vols[0];
         $vol->lKeyID = $vol->lEventDateShiftID = $vol->lVolID = $vol->strNotes = $vol->dHoursWorked = $vol->lPeopleID = $vol->lHouseholdID = $vol->strFName = $vol->strLName = $vol->strSafeNameFL = $vol->strAddr1 = $vol->strAddr2 = $vol->strCity = $vol->strState = $vol->strCountry = $vol->strZip = $vol->strAddr = $vol->strPhone = $vol->strCell = $vol->strEmail = null;
     } else {
         $idx = 0;
         foreach ($query->result() as $row) {
             $this->vols[$idx] = new stdClass();
             $vol =& $this->vols[$idx];
             $vol->lKeyID = $row->vsa_lKeyID;
             $vol->lEventDateShiftID = $row->vsa_lEventDateShiftID;
             $vol->lVolID = $row->vsa_lVolID;
             $vol->strNotes = $row->vsa_strNotes;
             $vol->dHoursWorked = $row->vsa_dHoursWorked;
             $vol->lPeopleID = $row->vol_lPeopleID;
             $vol->lHouseholdID = $row->pe_lHouseholdID;
             $vol->strFName = $row->pe_strFName;
             $vol->strLName = $row->pe_strLName;
             $vol->strSafeNameFL = htmlspecialchars($row->pe_strFName . ' ' . $row->pe_strLName);
             $vol->strAddr1 = $row->pe_strAddr1;
             $vol->strAddr2 = $row->pe_strAddr2;
             $vol->strCity = $row->pe_strCity;
             $vol->strState = $row->pe_strState;
             $vol->strCountry = $row->pe_strCountry;
             $vol->strZip = $row->pe_strZip;
             $vol->strAddr = strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true);
             $vol->strPhone = $row->pe_strPhone;
             $vol->strCell = $row->pe_strCell;
             $vol->strEmail = $row->pe_strEmail;
             ++$idx;
         }
     }
 }
             }
             $strLinkHFID .= str_pad($lHFID, 5, '0', STR_PAD_LEFT);
             $strHonoree = '<br><br>Honoree: ' . $sponRec->strHonSafeNameLF . '<br>' . $strLinkHFID;
         }
     }
     echoT('
           <td class="enpRpt" style="width: 130pt;' . $strIStyle . '">' . '<b>' . $sponRec->strSponSafeNameLF . '</b>' . '<br>' . $strLinkFID . $strHonoree . '<br>
             program: ' . htmlspecialchars($sponRec->strSponProgram) . '
          </td>');
 }
 //---------------------------
 // address / contact
 //---------------------------
 if ($showFields->bAddress) {
     echoT('
          <td class="enpRpt" style="width: 130pt;' . $strIStyle . '">' . strBuildAddress($sponRec->strSponAddr1, $sponRec->strSponAddr2, $sponRec->strSponCity, $sponRec->strSponState, $sponRec->strSponCountry, $sponRec->strSponZip, true));
     if ($showFields->bPhoneEmail) {
         if ($sponRec->strSponEmail . '' != '') {
             echoT(strBuildEmailLink($sponRec->strSponEmail, '<br>', false, ' style="' . $strIStyle . '"'));
         }
         $strPhone = strPhoneCell($sponRec->strSponPhone, $sponRec->strSponPhone, true, true);
         if ($strPhone != '') {
             echoT('<br>' . $strPhone);
         }
     }
     echoT('
          </td>');
 }
 //---------------------------
 // client
 //---------------------------
Example #17
0
    public function loadPatientsGeneric()
    {
        //-----------------------------------------------------------------------
        //
        //-----------------------------------------------------------------------
        global $glclsDTDateFormat, $gstrPassPhrase;
        $strOrder = $this->strClientOrder;
        if ($strOrder == '') {
            $strOrder = ' 
              AES_DECRYPT(cr_strLName, SHA2(' . strPrepStr($gstrPassPhrase) . ',256)), 
              AES_DECRYPT(cr_strFName, SHA2(' . strPrepStr($gstrPassPhrase) . ',256)), 
              AES_DECRYPT(cr_strMName, SHA2(' . strPrepStr($gstrPassPhrase) . ',256)), 
              cr_lKeyID ';
        }
        $sqlStr = 'SELECT
               cr_lKeyID,
               cr_bActive, cr_dteInactive, cr_dteEnrollment,
               cr_enumGender,

               AES_DECRYPT(cr_dteBirth,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS dteBirth,
               AES_DECRYPT(cr_dteDeath,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS dteDeath,
               AES_DECRYPT(cr_strTitle,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strTitle,
               AES_DECRYPT(cr_strFName,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strFName,
               AES_DECRYPT(cr_strMName,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strMName,
               AES_DECRYPT(cr_strLName,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strLName,
               AES_DECRYPT(cr_strAddr1,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strAddr1,
               AES_DECRYPT(cr_strAddr2,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strAddr2,
               AES_DECRYPT(cr_strCity,      SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strCity,
               AES_DECRYPT(cr_strState,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strState,
               AES_DECRYPT(cr_strCountry,   SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strCountry,
               AES_DECRYPT(cr_strZip,       SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strZip,
               AES_DECRYPT(cr_strPhone,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strPhone,
               AES_DECRYPT(cr_strCell,      SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strCell,
               AES_DECRYPT(cr_strEmail,     SHA2(' . strPrepStr($gstrPassPhrase) . ',256)) AS strEmail,
               AES_DECRYPT(cr_strBio,       SHA2(' . strPrepStr($gstrPassPhrase) . ",256)) AS strBio,\n\n               cr_bRetired, cr_lOriginID, cr_lLastUpdateID,\n               UNIX_TIMESTAMP(cr_dteOrigin)     AS dteOrigin,\n               UNIX_TIMESTAMP(cr_dteLastUpdate) AS dteLastUpdate,\n\n               uc.us_strFirstName AS strUCFName, uc.us_strLastName AS strUCLName,\n               ul.us_strFirstName AS strULFName, ul.us_strLastName AS strULLName\n\n            FROM patient_records\n               {$this->strInnerExtra}\n\n               INNER JOIN admin_users  AS uc ON uc.us_lKeyID=cr_lOriginID\n               INNER JOIN admin_users  AS ul ON ul.us_lKeyID=cr_lLastUpdateID\n\n            WHERE 1\n               AND NOT cr_bRetired\n\n               {$this->strExtraClientWhere}\n            ORDER BY {$strOrder}\n            {$this->strClientLimit};";
        $query = $this->db->query($sqlStr);
        $this->lNumPatients = $numRows = $query->num_rows();
        $this->patients = array();
        if ($numRows == 0) {
            $this->patients[0] = new stdClass();
            $patient =& $this->patients[0];
            $patient->lKeyID = $patient->strTitle = $patient->strFName = $patient->strMName = $patient->strLName = $patient->dteEnrollment = $patient->dteBirth = $patient->dteDeath = $patient->enumGender = $patient->strBio = $patient->bRetired = $patient->lOriginID = $patient->lLastUpdateID = $patient->dteOrigin = $patient->dteLastUpdate = $patient->strAddr1 = $patient->strAddr2 = $patient->strCity = $patient->strState = $patient->strCountry = $patient->strZip = $patient->strPhone = $patient->strCell = $patient->strEmail = $patient->strAddress = null;
        } else {
            $idx = 0;
            foreach ($query->result() as $row) {
                $this->patients[$idx] = new stdClass();
                $patient =& $this->patients[$idx];
                $patient->lKeyID = (int) $row->cr_lKeyID;
                $patient->strTitle = $row->strTitle;
                $patient->strFName = $row->strFName;
                $patient->strMName = $row->strMName;
                $patient->strLName = $row->strLName;
                $patient->strSafeName = htmlspecialchars($row->strFName . ' ' . $row->strMName . ' ' . $row->strLName);
                $patient->strSafeNameLF = htmlspecialchars($row->strLName . ', ' . $row->strFName . ' ' . $row->strMName);
                $patient->dteEnrollment = dteMySQLDate2Unix($row->cr_dteEnrollment);
                $patient->dteBirth = $mySQLdteBirth = $row->dteBirth;
                $patient->dteDeath = $row->dteDeath;
                $patient->enumGender = $row->cr_enumGender;
                $patient->bActive = (bool) $row->cr_bActive;
                $patient->mdteInactive = $row->cr_dteInactive;
                //------------------------------
                // client address/contact
                //------------------------------
                $patient->strAddr1 = $row->strAddr1;
                $patient->strAddr2 = $row->strAddr2;
                $patient->strCity = $row->strCity;
                $patient->strState = $row->strState;
                $patient->strCountry = $row->strCountry;
                $patient->strZip = $row->strZip;
                $patient->strPhone = $row->strPhone;
                $patient->strCell = $row->strCell;
                $patient->strEmail = $row->strEmail;
                $patient->strEmailFormatted = strBuildEmailLink($patient->strEmail, '', false, '');
                $patient->strAddress = strBuildAddress($patient->strAddr1, $patient->strAddr2, $patient->strCity, $patient->strState, $patient->strCountry, $patient->strZip, true);
                /*
                               //------------------------------
                               // client age/birth day info
                               //------------------------------
                            if (is_null($mySQLdteBirth)){
                               $patient->objClientBirth = null;
                               $patient->lAgeYears      = null;
                               $patient->strClientAgeBDay = '(age n/a)';
                            }else {
                               $patient->objClientBirth = new dl_date_time;
                               $patient->objClientBirth->setDateViaMySQL(0, $mySQLdteBirth);
                               $patient->strClientAgeBDay =
                                          $patient->objClientBirth->strPeopleAge(0, $mySQLdteBirth,
                                               $patient->lAgeYears, $glclsDTDateFormat);
                            }
                */
                $patient->strBio = $row->strBio;
                $patient->bRetired = $row->cr_bRetired;
                $patient->lOriginID = $row->cr_lOriginID;
                $patient->lLastUpdateID = $row->cr_lLastUpdateID;
                $patient->dteOrigin = $row->dteOrigin;
                $patient->dteLastUpdate = $row->dteLastUpdate;
                $patient->ucstrFName = $row->strUCFName;
                $patient->ucstrLName = $row->strUCLName;
                $patient->ulstrFName = $row->strULFName;
                $patient->ulstrLName = $row->strULLName;
                ++$idx;
            }
        }
        if ($this->bDebug) {
            $this->dumpClientRecs();
        }
    }
Example #18
0
 private function strJobSkillsRptHTML()
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $strOut = '<table class="enpRptC">
              <tr>
                 <td class="enpRptLabel">
                    volunteerID
                 </td>
                 <td class="enpRptLabel">
                    peopleID
                 </td>
                 <td class="enpRptLabel">
                    Name
                 </td>
                 <td class="enpRptLabel">
                    Address
                 </td>
                 <td class="enpRptLabel">
                    Phone/Email
                 </td>
                 <td class="enpRptLabel">
                    Job Skills
                 </td>
              </tr>' . "\n";
     $sqlStr = "SELECT\n             vol_lKeyID, pe_lKeyID, vol_bInactive,\n             pe_strLName, pe_strFName, pe_strAddr1, pe_strAddr2,\n             pe_strCity, pe_strState, pe_strCountry, pe_strZip, pe_strPhone, pe_strCell, pe_strEmail\n          FROM tmpGroupMatch\n             INNER JOIN volunteers   ON vol_lKeyID    = gm_lForeignID\n             INNER JOIN people_names ON vol_lPeopleID = pe_lKeyID\n          ORDER BY gm_lKeyID;";
     $query = $this->db->query($sqlStr);
     foreach ($query->result() as $row) {
         $lVolID = $this->lVolID = $row->vol_lKeyID;
         $lPID = $row->pe_lKeyID;
         $this->loadVolSkills(false);
         if ($row->vol_bInactive) {
             $strInactive = '<br>(inactive)';
         } else {
             $strInactive = '';
         }
         if ($row->pe_strEmail . '' == '') {
             $strEmail = '';
         } else {
             $strEmail = '<br>' . mailto($row->pe_strEmail, $row->pe_strEmail);
         }
         /*
            tip for preventing that pesky line break before a list
            http://stackoverflow.com/questions/1682873/how-do-i-prevent-a-line-break-occurring-before-an-unordered-list
            ul.errorlist {list-style-type: none; display:inline; margin-left: 0; padding-left: 0;}
            ul.errorlist li {display: inline; color:red; font-size: 0.8em; margin-left: 0px; padding-left: 10px;}
         */
         $strSkillList = '<ul style="list-style-type: square; display:inline; margin-left: 0; padding-left: 0;">';
         foreach ($this->singleVolSkills as $skill) {
             $strSkillList .= '<li style="margin-left: 20px; padding-left: 3px;">' . htmlspecialchars($skill->strSkill) . '</li>';
         }
         $strSkillList .= '</ul>';
         $strOut .= '<tr>
               <td class="enpRpt" style="width: 65px;">' . strLinkView_Volunteer($lVolID, 'View volunteer record', true) . '&nbsp;' . str_pad($lVolID, 5, '0', STR_PAD_LEFT) . $strInactive . '
               </td>
               <td class="enpRpt" style="width: 65px;">' . strLinkView_PeopleRecord($lPID, 'View people record', true) . '&nbsp;' . str_pad($lPID, 5, '0', STR_PAD_LEFT) . '
               </td>
               <td class="enpRpt" style="width: 160px;">' . htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName) . '
               </td>
               <td class="enpRpt" style="width: 200px;">' . strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true) . '
               </td>
               <td class="enpRpt" style="width: 120px;">' . htmlspecialchars(strPhoneCell($row->pe_strPhone, $row->pe_strCell)) . $strEmail . '
               </td>
               <td class="enpRpt" style="width: 200px;">' . $strSkillList . '
               </td>
            </tr>' . "\n";
         $strOut .= '</tr>' . "\n";
     }
     $strOut .= '</table>' . "\n";
     return $strOut;
 }
 public function sponsorInfoGenericViaWhere($strWhere, $strLimit)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     if ($this->strOrderBy == '') {
         $strOrder = 'tblPeopleSpon.pe_strLName, tblPeopleSpon.pe_strFName, tblPeopleSpon.pe_lKeyID,
         cr_strLName, cr_strFName, sp_lClientID,
         sp_lKeyID ';
     } else {
         $strOrder = $this->strOrderBy;
     }
     $sqlStr = "SELECT\n             sp_lKeyID, sp_lClientID,\n             sp_lForeignID, sp_lHonoreeID, sp_bInactive,\n             sp_lSponsorProgramID, sp_lDefPayType, sp_curCommitment, sp_lCommitmentACO,\n             aco_strFlag, aco_strCurrencySymbol, aco_strName,\n\n             sp_dteStartMoYr, sp_dteInactive, sp_lInactiveCatID,\n\n             sp_strTerminationNote, sp_bInactiveDueToXfer,\n             listInactive.lgen_strListItem AS strSponTermType,\n\n             tblPeopleSpon.pe_strLName AS strLName_Spon, tblPeopleSpon.pe_strFName   AS strFName_Spon,\n             tblPeopleSpon.pe_strMName AS strMName_Spon, tblPeopleSpon.pe_bRetired   AS bSponRetired,\n             tblPeopleSpon.pe_strAddr1 AS strSponAddr1,  tblPeopleSpon.pe_strAddr2   AS strSponAddr2,\n             tblPeopleSpon.pe_strCity  AS strSponCity,   tblPeopleSpon.pe_strState   AS strSponState,\n             tblPeopleSpon.pe_strZip   AS strSponZip,    tblPeopleSpon.pe_strCountry AS strSponCountry,\n             tblPeopleSpon.pe_strEmail AS strSponEmail,\n             tblPeopleSpon.pe_strPhone AS strSponPhone,\n             tblPeopleSpon.pe_strCell  AS strSponCell,\n             tblPeopleSpon.pe_strPreferredName AS strSponPName, tblPeopleSpon.pe_strTitle AS strSponTitle,\n\n             tblPeopleSpon.pe_bBiz     AS bSponBiz,\n\n             tblPeopleHon.pe_strLName  AS strLName_Hon,  tblPeopleHon.pe_strFName   AS strFName_Hon,\n             tblPeopleHon.pe_strMName  AS strMName_Hon,  tblPeopleHon.pe_bRetired   AS bHonRetired,\n             tblPeopleHon.pe_strAddr1  AS strHonAddr1,   tblPeopleHon.pe_strAddr2   AS strHonAddr2,\n             tblPeopleHon.pe_strCity   AS strHonCity,    tblPeopleHon.pe_strState   AS strHonState,\n             tblPeopleHon.pe_strZip    AS strHonZip,     tblPeopleHon.pe_strCountry AS strHonCountry,\n             tblPeopleHon.pe_strEmail  AS strHonEmail,\n             tblPeopleHon.pe_strPhone  AS strHonPhone,\n             tblPeopleHon.pe_strCell   AS strHonCell,\n             tblPeopleHon.pe_strPreferredName AS strHonPName, tblPeopleHon.pe_strTitle AS strHonTitle,\n\n             tblPeopleHon.pe_bBiz      AS bHonBiz,\n\n             sp_lAttributedTo,\n             listAttrib.lgen_strListItem AS strAttributedTo,\n\n             cr_strFName, cr_strLName, cr_dteBirth, cr_lLocationID,\n             cr_enumGender,\n             cl_strLocation, cl_strCountry,\n             cr_bRetired,\n             sc_strProgram,\n\n             UNIX_TIMESTAMP(sp_dteOrigin)     AS dteOrigin,\n             UNIX_TIMESTAMP(sp_dteLastUpdate) AS dteLastUpdate,\n             uc.us_strFirstName AS strUCFName, uc.us_strLastName AS strUCLName,\n             ul.us_strFirstName AS strULFName, ul.us_strLastName AS strULLName\n\n         FROM sponsor\n            INNER JOIN people_names  AS tblPeopleSpon ON sp_lForeignID     = tblPeopleSpon.pe_lKeyID\n            INNER JOIN admin_users   AS uc ON uc.us_lKeyID=sp_lOriginID\n            INNER JOIN admin_users   AS ul ON ul.us_lKeyID=sp_lLastUpdateID\n            INNER JOIN admin_aco           ON aco_lKeyID  = sp_lCommitmentACO\n            LEFT  JOIN people_names  AS tblPeopleHon  ON sp_lHonoreeID        = tblPeopleHon.pe_lKeyID\n            LEFT  JOIN client_records                 ON cr_lKeyID            = sp_lClientID\n            LEFT  JOIN client_location                ON cr_lLocationID       = cl_lKeyID\n            LEFT  JOIN lists_sponsorship_programs     ON sp_lSponsorProgramID = sc_lKeyID\n            LEFT  JOIN lists_generic AS listInactive  ON sp_lInactiveCatID    = listInactive.lgen_lKeyID\n            LEFT  JOIN lists_generic AS listAttrib    ON sp_lAttributedTo     = listAttrib.lgen_lKeyID\n\n         WHERE NOT sp_bRetired\n            {$strWhere}\n         ORDER BY {$strOrder}\n         {$strLimit};";
     $query = $this->db->query($sqlStr);
     $this->lNumSponsors = $numRows = $query->num_rows();
     if ($numRows == 0) {
         $this->sponInfo[0] = new stdClass();
         $sRec =& $this->sponInfo[0];
         $sRec->lKeyID = $sRec->lForeignID = $sRec->strSponsorFName = $sRec->strSponsorMName = $sRec->strSponsorLName = $sRec->bSponBiz = $sRec->strSponSafeNameFL = $sRec->strSponSafeNameLF = $sRec->bPersonRetired = $sRec->bClientRetired = $sRec->bHonoreeRetired = $sRec->lHonoreeID = $sRec->strSponsorFNameHon = $sRec->strSponsorMNameHon = $sRec->strSponsorLNameHon = $sRec->bHonBiz = $sRec->strHonSafeNameFL = $sRec->strHonSafeNameLF = $sRec->strSFConID_Spon = $sRec->strSFConID_Hon = $sRec->lClientID = $sRec->lItemID = $sRec->lSponsorProgID = $sRec->strSponProgram = $sRec->lAttributedTo = $sRec->strAttributedTo = $sRec->strClientFName = $sRec->strClientLName = $sRec->strClientSafeNameFL = $sRec->strClientSafeNameLF = $sRec->dteClientBDayMySQL = $sRec->strGender = $sRec->strLocationName = $sRec->strLocationCountry = $sRec->dteStart = $sRec->bInactive = $sRec->dteInactive = $sRec->lInactiveCatID = $sRec->strInactiveCat = $sRec->bInactiveViaXfer = $sRec->lDefPaymentType = $sRec->curCommitment = $sRec->lCommitACO = $sRec->objClientBirth = $sRec->strAgeBDay = $sRec->dteOrigin = $sRec->dteLastUpdate = $sRec->ucstrFName = $sRec->ucstrLName = $sRec->ulstrFName = $sRec->ulstrLName = null;
     } else {
         $idx = 0;
         foreach ($query->result() as $row) {
             $this->sponInfo[$idx] = new stdClass();
             $sRec =& $this->sponInfo[$idx];
             $sRec->lKeyID = $row->sp_lKeyID;
             $sRec->lForeignID = $row->sp_lForeignID;
             $sRec->strSponsorFName = $row->strFName_Spon;
             $sRec->strSponsorMName = $row->strMName_Spon;
             $sRec->strSponsorLName = $row->strLName_Spon;
             $sRec->strSponsorPName = $row->strSponPName;
             $sRec->strSponTitle = $row->strSponTitle;
             $sRec->bSponBiz = $row->bSponBiz;
             if ($row->bSponBiz) {
                 $sRec->strSponSafeNameFL = $sRec->strSponSafeNameLF = htmlspecialchars($sRec->strSponsorLName);
             } else {
                 $sRec->strSponSafeNameFL = htmlspecialchars(strBuildName(false, $sRec->strSponTitle, $sRec->strSponsorPName, $sRec->strSponsorFName, $sRec->strSponsorLName, $sRec->strSponsorMName));
                 $sRec->strSponSafeNameLF = htmlspecialchars(strBuildName(true, $sRec->strSponTitle, $sRec->strSponsorPName, $sRec->strSponsorFName, $sRec->strSponsorLName, $sRec->strSponsorMName));
             }
             $sRec->bPersonRetired = (bool) $row->bSponRetired;
             $sRec->bClientRetired = (bool) $row->cr_bRetired;
             $sRec->bHonoreeRetired = (bool) $row->bHonRetired;
             $sRec->lHonoreeID = $row->sp_lHonoreeID;
             $sRec->bHonoree = !is_null($row->sp_lHonoreeID);
             $sRec->strSponsorFNameHon = $row->strFName_Hon;
             $sRec->strSponsorMNameHon = $row->strMName_Hon;
             $sRec->strSponsorLNameHon = $row->strLName_Hon;
             $sRec->bHonBiz = $row->bHonBiz;
             $sRec->strHonPName = $row->strHonPName;
             $sRec->strHonTitle = $row->strHonTitle;
             if ($row->bHonBiz) {
                 $sRec->strHonSafeNameFL = $sRec->strHonSafeNameLF = htmlspecialchars($sRec->strSponsorLName);
             } else {
                 $sRec->strHonSafeNameFL = htmlspecialchars(strBuildName(false, $sRec->strHonTitle, $sRec->strHonPName, $sRec->strSponsorFNameHon, $sRec->strSponsorLNameHon, $sRec->strSponsorMNameHon));
                 //                      htmlspecialchars($sRec->strSponsorFNameHon.' ' .$sRec->strSponsorLNameHon);
                 $sRec->strHonSafeNameLF = htmlspecialchars(strBuildName(true, $sRec->strHonTitle, $sRec->strHonPName, $sRec->strSponsorFNameHon, $sRec->strSponsorLNameHon, $sRec->strSponsorMNameHon));
                 //                      htmlspecialchars($sRec->strSponsorLNameHon.', '.$sRec->strSponsorFNameHon);
             }
             //------------------------------
             // sponsor contact info
             //------------------------------
             $sRec->strSponAddr1 = $row->strSponAddr1;
             $sRec->strSponAddr2 = $row->strSponAddr2;
             $sRec->strSponCity = $row->strSponCity;
             $sRec->strSponState = $row->strSponState;
             $sRec->strSponZip = $row->strSponZip;
             $sRec->strSponCountry = $row->strSponCountry;
             $sRec->strSponEmail = $row->strSponEmail;
             $sRec->strSponPhone = $row->strSponPhone;
             $sRec->strAddr = strBuildAddress($row->strSponAddr1, $row->strSponAddr2, $row->strSponCity, $row->strSponState, $row->strSponCountry, $row->strSponZip, true);
             //------------------------------
             // honoree contact info
             //------------------------------
             $sRec->strHonAddr1 = $row->strHonAddr1;
             $sRec->strHonAddr2 = $row->strHonAddr2;
             $sRec->strHonCity = $row->strHonCity;
             $sRec->strHonState = $row->strHonState;
             $sRec->strHonZip = $row->strHonZip;
             $sRec->strHonCountry = $row->strHonCountry;
             $sRec->strHonEmail = $row->strHonEmail;
             $sRec->strHonPhone = $row->strHonPhone;
             $sRec->lClientID = $row->sp_lClientID;
             $sRec->lSponsorProgID = $row->sp_lSponsorProgramID;
             $sRec->strSponProgram = $row->sc_strProgram;
             $sRec->lAttributedTo = $row->sp_lAttributedTo;
             $sRec->strAttributedTo = $row->strAttributedTo;
             $sRec->strClientFName = $row->cr_strFName . '';
             $sRec->strClientLName = $row->cr_strLName . '';
             if (is_null($sRec->lClientID)) {
                 $sRec->strClientSafeNameFL = $sRec->strClientSafeNameLF = null;
             } else {
                 $sRec->strClientSafeNameFL = htmlspecialchars($row->cr_strFName . ' ' . $row->cr_strLName);
                 $sRec->strClientSafeNameLF = htmlspecialchars($row->cr_strLName . ', ' . $row->cr_strFName);
             }
             $sRec->dteClientBDayMySQL = $row->cr_dteBirth;
             $sRec->enumGender = $row->cr_enumGender;
             $sRec->strLocation = $row->cl_strLocation . '';
             $sRec->strLocationCountry = $row->cl_strCountry . '';
             $sRec->dteStart = dteMySQLDate2Unix($row->sp_dteStartMoYr);
             $sRec->bInactive = (bool) $row->sp_bInactive;
             $sRec->dteInactive = dteMySQLDate2Unix($row->sp_dteInactive);
             $sRec->lInactiveCatID = $row->sp_lInactiveCatID;
             $sRec->strSponTermType = $row->strSponTermType;
             $sRec->bInactiveViaXfer = (bool) $row->sp_bInactiveDueToXfer;
             $sRec->lDefPaymentType = $row->sp_lDefPayType;
             $sRec->curCommitment = $row->sp_curCommitment;
             $sRec->lCommitACO = $row->sp_lCommitmentACO;
             $sRec->strCommitACOFlagImg = '<img src="' . DL_IMAGEPATH . '/flags/' . $row->aco_strFlag . '" alt="flag icon" title="' . $row->aco_strName . '">';
             $sRec->strCommitACOCurSym = $row->aco_strCurrencySymbol;
             $sRec->strCommitACOName = $row->aco_strName;
             //------------------------------
             // client age/birth day info
             //------------------------------
             if (is_null($sRec->dteClientBDayMySQL)) {
                 $sRec->objClientBirth = null;
                 $sRec->strClientAgeBDay = 'n/a';
             } else {
                 $sRec->objClientBirth = new dl_date_time();
                 $sRec->objClientBirth->setDateViaMySQL(0, $sRec->dteClientBDayMySQL);
                 $sRec->strClientAgeBDay = $sRec->objClientBirth->strPeopleAge(0, $sRec->dteClientBDayMySQL, $lAgeYears);
             }
             $sRec->dteOrigin = $row->dteOrigin;
             $sRec->dteLastUpdate = $row->dteLastUpdate;
             $sRec->ucstrFName = $row->strUCFName;
             $sRec->ucstrLName = $row->strUCLName;
             $sRec->ulstrFName = $row->strULFName;
             $sRec->ulstrLName = $row->strULLName;
             ++$idx;
         }
     }
 }
function showSponHonInfo(&$clsRpt, $lSponID, &$sponRec, $bInactive)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    if ($bInactive) {
        $strLink = '';
    } else {
        if ($sponRec->bHonoree) {
            $strLink = strLinkRem_SponsorHonoree($lSponID, 'Remove honoree', true, true) . '&nbsp;' . strLinkRem_SponsorHonoree($lSponID, 'Remove honoree', false, true);
        } else {
            $strLink = strLinkAdd_SponHonoree($lSponID, 'Add sponsorship honoree', true) . '&nbsp;' . strLinkAdd_SponHonoree($lSponID, 'Add sponsorship honoree', false);
        }
    }
    $attributes = new stdClass();
    $attributes->lTableWidth = 900;
    $attributes->divID = 'sponHon';
    $attributes->divImageID = 'sponHonDivImg';
    openBlock('Honoree Info', $strLink, $attributes);
    if ($sponRec->bHonoree) {
        $lHonFID = $sponRec->lHonoreeID;
        if ($sponRec->bHonBiz) {
            $strLinkHon = strLinkView_Biz($lHonFID, 'View business record', true);
        } else {
            $strLinkHon = strLinkView_PeopleRecord($lHonFID, 'View people record', true);
        }
        echoT($clsRpt->openReport());
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Honoree:') . $clsRpt->writeCell($strLinkHon . $sponRec->strHonSafeNameFL) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Address:') . $clsRpt->writeCell(strBuildAddress($sponRec->strHonAddr1, $sponRec->strHonAddr2, $sponRec->strHonCity, $sponRec->strHonState, $sponRec->strHonCountry, $sponRec->strHonZip, true)) . $clsRpt->closeRow());
        echoT($clsRpt->closeReport(''));
    } else {
        echoT('<i>There is no honoree associated with this sponsorship</i>');
    }
    $attributes = new stdClass();
    $attributes->bCloseDiv = true;
    closeBlock($attributes);
}
Example #21
0
 function loadGrantProviders($sqlWhere, $sqlOrder, &$lNumProviders, &$providers)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $providers = array();
     $strOrder = $sqlOrder;
     if ($strOrder == '') {
         $strOrder = ' gpr_strGrantOrg, gpr_lKeyID ';
     }
     $sqlStr = "SELECT\n               gpr_lKeyID, gpr_strGrantOrg, gpr_strAddr1, gpr_strAddr2, gpr_strCity,\n               gpr_strState, gpr_strCountry, gpr_strZip, gpr_strPhone, gpr_strCell,\n               gpr_strFax, gpr_strWebSite, gpr_strEmail, gpr_strNotes,\n\n               gpr_lAttributedTo, lgen_strListItem AS strAttributedTo,\n\n               -- gpr_lACO, aco_strFlag, aco_strName, aco_strCurrencySymbol,\n\n               gpr_bHidden, gpr_lOriginID, gpr_lLastUpdateID,\n               UNIX_TIMESTAMP(gpr_dteOrigin) AS dteOrigin,\n               UNIX_TIMESTAMP(gpr_dteLastUpdate) AS dteLastUpdate,\n\n               uc.us_strFirstName AS strCFName, uc.us_strLastName AS strCLName,\n               ul.us_strFirstName AS strLFName, ul.us_strLastName AS strLLName\n\n            FROM grant_providers\n               INNER JOIN admin_users  AS uc ON uc.us_lKeyID=gpr_lOriginID\n               INNER JOIN admin_users  AS ul ON ul.us_lKeyID=gpr_lLastUpdateID\n               -- INNER JOIN admin_aco          ON gpr_lACO         = aco_lKeyID\n\n               LEFT  JOIN lists_generic      ON gpr_lAttributedTo=lgen_lKeyID\n            WHERE NOT gpr_bRetired {$sqlWhere}\n            ORDER BY {$strOrder} ";
     $query = $this->db->query($sqlStr);
     $lNumProviders = $query->num_rows();
     if ($lNumProviders == 0) {
         $providers[0] = new stdClass();
         $pr =& $providers[0];
         $pr->lKeyID = $pr->strGrantOrg = $pr->strAddr1 = $pr->strAddr2 = $pr->strCity = $pr->strState = $pr->strCountry = $pr->strZip = $pr->strPhone = $pr->strCell = $pr->strFax = $pr->strWebSite = $pr->strEmail = $pr->strNotes = $pr->lAttributedTo = $pr->strAttributedTo = $pr->strACOFlag = $pr->strACOName = $pr->strCurrencySymbol = $pr->gpr_bHidden = $pr->lOriginID = $pr->lLastUpdateID = $pr->ucstrFName = $pr->ucstrLName = $pr->ulstrFName = $pr->ulstrLName = $pr->dteOrigin = $pr->dteLastUpdate = $pr->strAddress = null;
     } else {
         $idx = 0;
         foreach ($query->result() as $row) {
             $providers[$idx] = new stdClass();
             $pr =& $providers[$idx];
             $pr->lKeyID = (int) $row->gpr_lKeyID;
             $pr->strGrantOrg = $row->gpr_strGrantOrg;
             $pr->strAddr1 = $row->gpr_strAddr1;
             $pr->strAddr2 = $row->gpr_strAddr2;
             $pr->strCity = $row->gpr_strCity;
             $pr->strState = $row->gpr_strState;
             $pr->strCountry = $row->gpr_strCountry;
             $pr->strZip = $row->gpr_strZip;
             $pr->strPhone = $row->gpr_strPhone;
             $pr->strCell = $row->gpr_strCell;
             $pr->strFax = $row->gpr_strFax;
             $pr->strWebSite = $row->gpr_strWebSite;
             $pr->strEmail = $row->gpr_strEmail;
             $pr->strNotes = $row->gpr_strNotes;
             $pr->lAttributedTo = $row->gpr_lAttributedTo;
             $pr->strAttributedTo = $row->strAttributedTo;
             $pr->bHidden = (bool) $row->gpr_bHidden;
             $pr->lOriginID = (int) $row->gpr_lOriginID;
             $pr->lLastUpdateID = (int) $row->gpr_lLastUpdateID;
             $pr->ucstrFName = $row->strCFName;
             $pr->ucstrLName = $row->strCLName;
             $pr->ulstrFName = $row->strLFName;
             $pr->ulstrLName = $row->strLLName;
             $pr->dteOrigin = (int) $row->dteOrigin;
             $pr->dteLastUpdate = (int) $row->dteLastUpdate;
             $pr->strAddress = strBuildAddress($pr->strAddr1, $pr->strAddr2, $pr->strCity, $pr->strState, $pr->strCountry, $pr->strZip, true);
             ++$idx;
         }
     }
 }
Example #22
0
 private function strPeopleBasedGroupRptHTML($enumContext)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     switch ($enumContext) {
         case CENUM_CONTEXT_PEOPLE:
             $strIDLabel = 'PeopleID';
             $strInner = ' INNER JOIN people_names ON pe_lKeyID=gm_lForeignID ';
             $strFID = ' pe_lKeyID AS lFID ';
             break;
         case CENUM_CONTEXT_BIZ:
             $strIDLabel = 'businessID';
             $strInner = ' INNER JOIN people_names ON pe_lKeyID=gm_lForeignID ';
             $strFID = ' pe_lKeyID AS lFID ';
             break;
         case CENUM_CONTEXT_VOLUNTEER:
             $strIDLabel = 'volunteerID';
             $strInner = ' INNER JOIN volunteers   ON vol_lKeyID    = gm_lForeignID ' . ' INNER JOIN people_names ON vol_lPeopleID = pe_lKeyID ';
             $strFID = ' pe_lKeyID, vol_lKeyID AS lFID ';
             break;
         case CENUM_CONTEXT_SPONSORSHIP:
             $strIDLabel = 'sponsorID';
             $strInner = ' INNER JOIN sponsor   ON sp_lKeyID        = gm_lForeignID ' . ' INNER JOIN people_names ON sp_lForeignID = pe_lKeyID ';
             $strFID = ' pe_lKeyID, sp_lKeyID AS lFID ';
             break;
         default:
             screamForHelp($enumContext . ': group type not yet available<br>error on <b>line:</b> ' . __LINE__ . '<br><b>file: </b>' . __FILE__ . '<br><b>function: </b>' . __FUNCTION__);
             break;
     }
     $strOut = '<table class="enpRptC">
              <tr>
                 <td class="enpRptLabel">' . $strIDLabel . '
                 </td>
                 <td class="enpRptLabel">
                    Name
                 </td>
                 <td class="enpRptLabel">
                    Address
                 </td>
                 <td class="enpRptLabel">
                    Phone/Email
                 </td>
                 <td class="enpRptLabel">
                    Group Membership
                 </td>
              </tr>' . "\n";
     $sqlStr = "SELECT\n             {$strFID},\n             pe_strLName, pe_strFName, pe_strAddr1, pe_strAddr2,\n             pe_strCity, pe_strState, pe_strCountry, pe_strZip, pe_strPhone, pe_strCell, pe_strEmail\n          FROM tmpGroupMatch\n             {$strInner}\n          ORDER BY gm_lKeyID;";
     $query = $this->db->query($sqlStr);
     foreach ($query->result() as $row) {
         $lFID = $row->lFID;
         if ($row->pe_strEmail . '' == '') {
             $strEmail = '';
         } else {
             $strEmail = '<br>' . mailto($row->pe_strEmail, $row->pe_strEmail);
         }
         $this->groupMembershipViaFID($enumContext, $lFID);
         /*
            tip for preventing that pesky line break before a list
            http://stackoverflow.com/questions/1682873/how-do-i-prevent-a-line-break-occurring-before-an-unordered-list
            ul.errorlist {list-style-type: none; display:inline; margin-left: 0; padding-left: 0;}
            ul.errorlist li {display: inline; color:red; font-size: 0.8em; margin-left: 0px; padding-left: 10px;}
         */
         $strGroupList = '<ul style="list-style-type: square; display:inline; margin-left: 0; padding-left: 0;">';
         foreach ($this->arrMemberInGroups as $grpMember) {
             $strGroupList .= '<li style="margin-left: 20px; padding-left: 3px;">' . htmlspecialchars($grpMember->strGroupName) . '</li>';
         }
         $strGroupList .= '</ul>';
         switch ($enumContext) {
             case CENUM_CONTEXT_PEOPLE:
                 $strLink = strLinkView_PeopleRecord($lFID, 'View people record', true) . '&nbsp;';
                 break;
             case CENUM_CONTEXT_BIZ:
                 $strLink = strLinkView_BizRecord($lFID, 'View people record', true) . '&nbsp;';
                 break;
             case CENUM_CONTEXT_VOLUNTEER:
                 $strLink = strLinkView_Volunteer($lFID, 'View volunteer record', true) . '&nbsp;';
                 break;
             case CENUM_CONTEXT_SPONSORSHIP:
                 $strLink = strLinkView_Sponsorship($lFID, 'View sponsor record', true) . '&nbsp;';
                 break;
             default:
                 screamForHelp($enumContext . ': group type not yet available<br>error on <b>line:</b> ' . __LINE__ . '<br><b>file: </b>' . __FILE__ . '<br><b>function: </b>' . __FUNCTION__);
                 break;
         }
         $bBiz = $enumContext == CENUM_CONTEXT_BIZ;
         $strOut .= '<tr class="makeStripe">
               <td class="enpRpt" style="width: 65px;">' . $strLink . str_pad($lFID, 5, '0', STR_PAD_LEFT) . '
               </td>
               <td class="enpRpt" style="width: 160px;">' . htmlspecialchars($row->pe_strLName . ($bBiz ? '' : ', ' . $row->pe_strFName)) . '
               </td>
               <td class="enpRpt" style="width: 200px;">' . strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true) . '
               </td>
               <td class="enpRpt" style="width: 120px;">' . htmlspecialchars(strPhoneCell($row->pe_strPhone, $row->pe_strCell)) . $strEmail . '
               </td>
               <td class="enpRpt" style="width: 200px;">' . $strGroupList . '
               </td>
            </tr>' . "\n";
         $strOut .= '</tr>' . "\n";
     }
     $strOut .= '</table>' . "\n";
     return $strOut;
 }
Example #23
0
 public function loadUserRec()
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     if (is_null($this->us_lKeyID)) {
         screamForHelp('Uninitialized class!</b><br>error on <b>line:</b> ' . __LINE__ . '<br><b>file:</b> ' . __FILE__ . '<br><b>function:</b> ' . __FUNCTION__);
     }
     $sqlStr = "SELECT\n            userBase.us_lKeyID,       userBase.us_bInactive,\n            userBase.us_lOriginID,    userBase.us_lLastUpdateID, userBase.us_strUserName,\n            userBase.us_bAdmin,       userBase.us_bVolAccount,\n\n            userBase.us_bVolEditContact, userBase.us_bVolPassReset,\n            userBase.us_bVolViewGiftHistory,\n            userBase.us_bVolEditJobSkills, userBase.us_bVolViewHrsHistory,\n            userBase.us_bVolAddVolHours,   userBase.us_bVolShiftSignup,\n\n            userBase.us_bUserAllowSponsorship, userBase.us_bUserAllowSponFinancial,\n            userBase.us_bUserAllowClient, userBase.us_bUserAllowAuctions, userBase.us_bUserAllowGrants,\n            userBase.us_bUserAllowInventory, userBase.us_bUserVolManager,\n\n            userBase.us_bUserDataEntryPeople,\n            userBase.us_bUserDataEntryGifts,\n            userBase.us_bUserEditPeople,\n            userBase.us_bUserEditGifts,\n            userBase.us_bUserViewPeople,\n            userBase.us_bUserViewGiftHistory,\n            userBase.us_bUserViewReports,\n            userBase.us_bUserAllowExports,\n\n            userBase.us_lVolID,\n\n            userBase.us_bDebugger,\n\n            userBase.us_strFirstName,\n            userBase.us_strLastName,  userBase.us_strTitle,      userBase.us_strPhone,\n            userBase.us_strCell,      userBase.us_strEmail,      userBase.us_strAddr1,\n            userBase.us_strAddr2,     userBase.us_strCity,       userBase.us_strState,\n            userBase.us_strCountry,   userBase.us_strZip,\n\n            userBase.us_enumDateFormat, userBase.us_enumMeasurePref,\n\n            usersC.us_strFirstName AS strCFName, usersC.us_strLastName AS strCLName,\n            usersL.us_strFirstName AS strLFName, usersL.us_strLastName AS strLLName,\n            UNIX_TIMESTAMP(userBase.us_dteOrigin)     AS dteOrigin,\n            UNIX_TIMESTAMP(userBase.us_dteLastUpdate) AS dteLastUpdate\n\n         FROM admin_users AS userBase\n            INNER JOIN admin_users AS usersC ON userBase.us_lOriginID    = usersC.us_lKeyID\n            INNER JOIN admin_users AS usersL ON userBase.us_lLastUpdateID= usersL.us_lKeyID\n         WHERE userBase.us_lKeyID={$this->us_lKeyID};";
     $query = $this->db->query($sqlStr);
     $numRows = $query->num_rows();
     if ($numRows == 0) {
     } else {
         $row = $query->row();
         $this->userRec = new stdClass();
         $this->userRec->us_lKeyID = $row->us_lKeyID;
         $this->userRec->us_bInactive = $row->us_bInactive;
         $this->userRec->dteOrigin = $row->dteOrigin;
         $this->userRec->dteLastUpdate = $row->dteLastUpdate;
         $this->userRec->us_lOriginID = $row->us_lOriginID;
         $this->userRec->us_lLastUpdateID = $row->us_lLastUpdateID;
         $this->userRec->us_strUserName = $row->us_strUserName;
         $this->userRec->us_bAdmin = $row->us_bAdmin;
         $this->userRec->us_bVolAccount = $row->us_bVolAccount;
         $this->userRec->us_bVolEditContact = $row->us_bVolEditContact;
         $this->userRec->us_bVolPassReset = $row->us_bVolPassReset;
         $this->userRec->us_bVolViewGiftHistory = $row->us_bVolViewGiftHistory;
         $this->userRec->us_bVolEditJobSkills = $row->us_bVolEditJobSkills;
         $this->userRec->us_bVolViewHrsHistory = $row->us_bVolViewHrsHistory;
         $this->userRec->us_bVolAddVolHours = $row->us_bVolAddVolHours;
         $this->userRec->us_bVolShiftSignup = $row->us_bVolShiftSignup;
         $this->userRec->bStandardUser = !$this->userRec->us_bVolAccount && !$this->userRec->us_bAdmin;
         $this->userRec->us_bUserDataEntryPeople = (bool) $row->us_bUserDataEntryPeople;
         $this->userRec->us_bUserDataEntryGifts = (bool) $row->us_bUserDataEntryGifts;
         $this->userRec->us_bUserEditPeople = (bool) $row->us_bUserEditPeople;
         $this->userRec->us_bUserEditGifts = (bool) $row->us_bUserEditGifts;
         $this->userRec->us_bUserViewPeople = (bool) $row->us_bUserViewPeople;
         $this->userRec->us_bUserViewGiftHistory = (bool) $row->us_bUserViewGiftHistory;
         $this->userRec->us_bUserViewReports = (bool) $row->us_bUserViewReports;
         $this->userRec->us_bUserAllowExports = (bool) $row->us_bUserAllowExports;
         $this->userRec->us_bUserVolManager = (bool) $row->us_bUserVolManager;
         $this->userRec->us_bUserAllowSponsorship = (bool) $row->us_bUserAllowSponsorship;
         $this->userRec->us_bUserAllowSponFinancial = (bool) $row->us_bUserAllowSponFinancial;
         $this->userRec->us_bUserAllowClient = (bool) $row->us_bUserAllowClient;
         $this->userRec->us_bUserAllowAuctions = (bool) $row->us_bUserAllowAuctions;
         $this->userRec->us_bUserAllowGrants = (bool) $row->us_bUserAllowGrants;
         $this->userRec->us_bUserAllowInventory = (bool) $row->us_bUserAllowInventory;
         $this->userRec->us_bUserAllowInventory = (bool) $row->us_bUserAllowInventory;
         $this->userRec->us_lVolID = $row->us_lVolID;
         $this->userRec->us_bDebugger = $row->us_bDebugger;
         $this->userRec->us_strFirstName = $row->us_strFirstName;
         $this->userRec->us_strLastName = $row->us_strLastName;
         $this->userRec->strSafeName = htmlspecialchars($row->us_strFirstName . ' ' . $row->us_strLastName);
         $this->userRec->us_strTitle = $row->us_strTitle;
         $this->userRec->us_strPhone = $row->us_strPhone;
         $this->userRec->us_strCell = $row->us_strCell;
         $this->userRec->us_strEmail = $row->us_strEmail;
         $this->userRec->us_strAddr1 = $row->us_strAddr1;
         $this->userRec->us_strAddr2 = $row->us_strAddr2;
         $this->userRec->us_strCity = $row->us_strCity;
         $this->userRec->us_strState = $row->us_strState;
         $this->userRec->us_strCountry = $row->us_strCountry;
         $this->userRec->us_strZip = $row->us_strZip;
         $this->userRec->strAddress = strBuildAddress($this->userRec->us_strAddr1, $this->userRec->us_strAddr2, $this->userRec->us_strCity, $this->userRec->us_strState, $this->userRec->us_strCountry, $this->userRec->us_strZip, true);
         $this->userRec->us_enumDateFormat = $row->us_enumDateFormat;
         $this->userRec->us_enumMeasurePref = $row->us_enumMeasurePref;
         $this->userRec->us_strUserPWord = null;
         $this->userRec->strStaffCFName = $row->strCFName;
         $this->userRec->strStaffCLName = $row->strCLName;
         $this->userRec->strStaffLFName = $row->strLFName;
         $this->userRec->strStaffLLName = $row->strLLName;
     }
 }
function showBizInfo($clsRpt, $lBID, &$clsBiz)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gbDateFormatUS, $glclsDTDateFormat;
    $clsDateTime = new dl_date_time();
    echoT(strLinkAdd_Biz('Add new business/organization', true) . '&nbsp;' . strLinkAdd_Biz('Add new business/organization', false) . '<br>');
    openBlock('Business', strLinkEdit_Biz($lBID, 'Edit business/organization information', true) . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkRem_Biz($lBID, 'Remove this business record', true, true));
    echoT($clsRpt->openReport() . $clsRpt->openRow() . $clsRpt->writeLabel('Business ID:') . $clsRpt->writeCell(str_pad($lBID, 5, '0', STR_PAD_LEFT), '', '', 1, 1, ' id="bID" ') . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Name:') . $clsRpt->writeCell($clsBiz->strSafeName, '', '', 1, 1, ' id="safeBizName" ') . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Category:') . $clsRpt->writeCell($clsBiz->strIndustry) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Address:') . $clsRpt->writeCell(strBuildAddress($clsBiz->strAddr1, $clsBiz->strAddr2, $clsBiz->strCity, $clsBiz->strState, $clsBiz->strCountry, $clsBiz->strZip, true, true)) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Phone:') . $clsRpt->writeCell(htmlspecialchars(strPhoneCell($clsBiz->strPhone, $clsBiz->strCell)), '', '', 1, 1, ' id="phone" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Fax:') . $clsRpt->writeCell(htmlspecialchars($clsBiz->strFax), '', '', 1, 1, ' id="fax" ') . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Web Site:') . $clsRpt->writeCell(htmlspecialchars($clsBiz->strWebSite)) . $clsRpt->closeRow());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Email:') . $clsRpt->writeCell($clsBiz->strEmailFormatted) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('ACO:') . $clsRpt->writeCell($clsBiz->strFlagImage . ' ' . $clsBiz->strCurSymbol) . $clsRpt->closeRow());
    //------------------
    // Notes
    //------------------
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Notes:') . $clsRpt->writeCell(nl2br(htmlspecialchars($clsBiz->strNotes))) . $clsRpt->closeRow());
    //------------------
    // Attributed To
    //------------------
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Attributed To:') . $clsRpt->writeCell(htmlspecialchars($clsBiz->strAttrib)) . $clsRpt->closeRow());
    echoT($clsRpt->closeReport());
    closeBlock();
}
Example #25
0
 public function loadVolRecs()
 {
     //-----------------------------------------------------------------------
     //
     //-----------------------------------------------------------------------
     $this->volRecs = array();
     $clsPeople = new mpeople();
     if ($this->strOrderExtra . '' == '') {
         $this->strOrderExtra = ' ORDER BY pe_strLName, pe_strFName, pe_strMName, vol_lKeyID ';
     }
     $sqlStr = "SELECT\n            vol_lKeyID, vol_lPeopleID, vol_bInactive, vol_lRegFormID,\n            vol_Notes, vol_bRetired, vol_lOriginID, vol_lLastUpdateID,\n            UNIX_TIMESTAMP(vol_dteInactive) AS dteInactive,\n\n            vreg_strFormName, vreg_strURLHash,\n\n            pe_strLName, pe_strFName,\n            pe_strMName, pe_bRetired,\n            pe_strPreferredName, pe_strTitle,\n            pe_strAddr1, pe_strAddr2,\n            pe_strCity,  pe_strState,\n            pe_strZip,   pe_strCountry,\n            pe_strEmail, pe_strPhone, pe_strCell,\n            pe_lHouseholdID,\n\n            UNIX_TIMESTAMP(vol_dteOrigin)     AS dteOrigin,\n            UNIX_TIMESTAMP(vol_dteLastUpdate) AS dteLastUpdate,\n            uc.us_strFirstName AS strUCFName, uc.us_strLastName AS strUCLName,\n            ul.us_strFirstName AS strULFName, ul.us_strLastName AS strULLName\n\n         FROM volunteers\n            INNER JOIN people_names        ON vol_lPeopleID  = pe_lKeyID\n            INNER JOIN admin_users   AS uc ON uc.us_lKeyID   = vol_lOriginID\n            INNER JOIN admin_users   AS ul ON ul.us_lKeyID   = vol_lLastUpdateID\n            LEFT  JOIN vol_reg             ON vol_lRegFormID = vreg_lKeyID\n\n         WHERE\n            NOT vol_bRetired AND NOT pe_bRetired\n            {$this->strWhereExtra}\n         {$this->strOrderExtra}\n         {$this->sqlLimitExtra};";
     $query = $this->db->query($sqlStr);
     $this->lNumVolRecs = $numRows = $query->num_rows();
     if ($numRows == 0) {
         $this->volRecs[0] = new stdClass();
         $vRec =& $this->volRecs[0];
         $vRec->lKeyID = $vRec->lPeopleID = $vRec->lHouseholdID = $vRec->bInactive = $vRec->Notes = $vRec->bRetired = $vRec->dteInactive = $vRec->strLName = $vRec->strFName = $vRec->strMName = $vRec->strSafeNameFL = $vRec->bRetired = $vRec->strAddr1 = $vRec->strAddr2 = $vRec->strCity = $vRec->strState = $vRec->strZip = $vRec->strCountry = $vRec->strEmail = $vRec->strPhone = $vRec->strCell = $vRec->lOriginID = $vRec->lLastUpdateID = $vRec->dteOrigin = $vRec->dteLastUpdate = $vRec->strUCFName = $vRec->strUCLName = $vRec->strULFName = $vRec->strULLName = null;
     } else {
         $idx = 0;
         foreach ($query->result() as $row) {
             $this->volRecs[$idx] = new stdClass();
             $vRec =& $this->volRecs[$idx];
             $vRec->lKeyID = (int) $row->vol_lKeyID;
             $vRec->lPeopleID = (int) $row->vol_lPeopleID;
             $vRec->lHouseholdID = $lHID = (int) $row->pe_lHouseholdID;
             $vRec->strHouseholdName = $clsPeople->strHouseholdNameViaHID($lHID);
             $vRec->bInactive = $row->vol_bInactive;
             $vRec->Notes = $row->vol_Notes;
             $vRec->bRetired = $row->vol_bRetired;
             $vRec->dteInactive = $row->dteInactive;
             $vRec->strLName = $strLName = $row->pe_strLName;
             $vRec->strFName = $strFName = $row->pe_strFName;
             $vRec->strMName = $strMName = $row->pe_strMName;
             $vRec->strTitle = $strTitle = $row->pe_strTitle;
             $vRec->strPreferred = $strPreferred = $row->pe_strPreferredName;
             $vRec->lRegFormID = (int) $row->vol_lRegFormID;
             $vRec->strFormName = $row->vreg_strFormName;
             $vRec->strURLHash = $row->vreg_strURLHash;
             $vRec->strSafeName = $vRec->strSafeNameFL = htmlspecialchars(strBuildName(false, $strTitle, $strPreferred, $strFName, $strLName, $strMName));
             $vRec->strSafeNameLF = htmlspecialchars(strBuildName(true, $strTitle, $strPreferred, $strFName, $strLName, $strMName));
             $vRec->bRetired = $row->pe_bRetired;
             $vRec->strAddr1 = $row->pe_strAddr1;
             $vRec->strAddr2 = $row->pe_strAddr2;
             $vRec->strCity = $row->pe_strCity;
             $vRec->strState = $row->pe_strState;
             $vRec->strZip = $row->pe_strZip;
             $vRec->strCountry = $row->pe_strCountry;
             $vRec->strEmail = $strEmail = $row->pe_strEmail;
             $vRec->strEmailFormatted = strBuildEmailLink($strEmail, '', false, '');
             $vRec->strPhone = $row->pe_strPhone;
             $vRec->strCell = $row->pe_strCell;
             $vRec->strAddress = strBuildAddress($vRec->strAddr1, $vRec->strAddr2, $vRec->strCity, $vRec->strState, $vRec->strCountry, $vRec->strZip, true);
             $vRec->lOriginID = $row->vol_lOriginID;
             $vRec->lLastUpdateID = $row->vol_lLastUpdateID;
             $vRec->dteOrigin = $row->dteOrigin;
             $vRec->dteLastUpdate = $row->dteLastUpdate;
             $vRec->strUCFName = $row->strUCFName;
             $vRec->strUCLName = $row->strUCLName;
             $vRec->strULFName = $row->strULFName;
             $vRec->strULLName = $row->strULLName;
             ++$idx;
         }
     }
 }
    function findSimilarPeopleBizNames($bPeople, $strFName, $strLName, &$lNumMatches, &$matches)
    {
        //---------------------------------------------------------------------
        //
        //---------------------------------------------------------------------
        if ($bPeople) {
            $strWhereExtra = ' AND pe_strFName SOUNDS LIKE ' . strPrepStr($strFName) . ' AND NOT pe_bBiz ';
        } else {
            $strWhereExtra = ' AND pe_bBiz ';
        }
        $lNumMatches = 0;
        $matches = array();
        $sqlStr = 'SELECT
            pe_lKeyID, pe_strFName, pe_strLName, pe_enumGender,
            pe_strAddr1, pe_strAddr2, pe_strCity, pe_strState, pe_strCountry,
            pe_strZip, pe_strPhone, pe_strCell, pe_strEmail,

            UNIX_TIMESTAMP(pe_dteOrigin) AS dteOrigin,
            UNIX_TIMESTAMP(pe_dteLastUpdate) AS dteLastUpdate,
            uc.us_strFirstName AS strUCFName, uc.us_strLastName AS strUCLName,
            ul.us_strFirstName AS strULFName, ul.us_strLastName AS strULLName

         FROM people_names
            INNER JOIN admin_users  AS uc ON uc.us_lKeyID=pe_lOriginID
            INNER JOIN admin_users  AS ul ON ul.us_lKeyID=pe_lLastUpdateID

         WHERE  pe_strLName SOUNDS LIKE ' . strPrepStr($strLName) . ' ' . $strWhereExtra . '               
            AND NOT pe_bRetired
         ORDER BY pe_strLName, pe_strFName, pe_lKeyID;';
        $query = $this->db->query($sqlStr);
        $lNumMatches = $query->num_rows();
        if ($lNumMatches > 0) {
            $idx = 0;
            foreach ($query->result() as $row) {
                $matches[$idx] = new stdClass();
                $match =& $matches[$idx];
                $match->lKeyID = (int) $row->pe_lKeyID;
                $match->strFName = $row->pe_strFName;
                $match->strLName = $row->pe_strLName;
                $match->strSafeName = htmlspecialchars($row->pe_strFName . ' ' . $row->pe_strLName);
                $match->strSafeNameLF = htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName);
                $match->strAddr1 = $row->pe_strAddr1;
                $match->strAddr2 = $row->pe_strAddr2;
                $match->strCity = $row->pe_strCity;
                $match->strState = $row->pe_strState;
                $match->strCountry = $row->pe_strCountry;
                $match->strZip = $row->pe_strZip;
                $match->strPhone = $row->pe_strPhone;
                $match->strCell = $row->pe_strCell;
                $match->strEmail = $row->pe_strEmail;
                $match->strEmailFormatted = strBuildEmailLink($match->strEmail, '', false, '');
                $match->strAddress = strBuildAddress($match->strAddr1, $match->strAddr2, $match->strCity, $match->strState, $match->strCountry, $match->strZip, true);
                $match->dteOrigin = $row->dteOrigin;
                $match->dteLastUpdate = $row->dteLastUpdate;
                $match->ucstrFName = $row->strUCFName;
                $match->ucstrLName = $row->strUCLName;
                $match->ulstrFName = $row->strULFName;
                $match->ulstrLName = $row->strULLName;
                ++$idx;
            }
        }
    }
 private function loadHonoree(&$clsHMCon, &$row, $strPrefix)
 {
     //-----------------------------------------------------------------
     // honoree / mail contact info
     //-----------------------------------------------------------------
     $strMember = $strPrefix . '_FName';
     $clsHMCon->strFName = $row->{$strMember};
     //($strPrefix.'_FName');
     $strMember = $strPrefix . '_LName';
     $clsHMCon->strLName = $row->{$strMember};
     //[$strPrefix.'_LName'];
     $strMember = $strPrefix . '_Addr1';
     $clsHMCon->strAddr1 = $row->{$strMember};
     //[$strPrefix.'_Addr1'];
     $strMember = $strPrefix . '_Addr2';
     $clsHMCon->strAddr2 = $row->{$strMember};
     //[$strPrefix.'_Addr2'];
     $strMember = $strPrefix . '_City';
     $clsHMCon->strCity = $row->{$strMember};
     //[$strPrefix.'_City'];
     $strMember = $strPrefix . '_State';
     $clsHMCon->strState = $row->{$strMember};
     //[$strPrefix.'_State'];
     $strMember = $strPrefix . '_Country';
     $clsHMCon->strCountry = $row->{$strMember};
     //[$strPrefix.'_Country'];
     $strMember = $strPrefix . '_Zip';
     $clsHMCon->strZip = $row->{$strMember};
     //[$strPrefix.'_Zip'];
     $strMember = $strPrefix . '_Phone';
     $clsHMCon->strPhone = $row->{$strMember};
     //[$strPrefix.'_Phone'];
     $clsHMCon->strSafeNameLF = htmlspecialchars($clsHMCon->strLName . ', ' . $clsHMCon->strFName);
     $clsHMCon->strSafeNameFL = htmlspecialchars($clsHMCon->strFName . ' ' . $clsHMCon->strLName);
     $clsHMCon->strAddress = strBuildAddress($clsHMCon->strAddr1, $clsHMCon->strAddr2, $clsHMCon->strCity, $clsHMCon->strState, $clsHMCon->strCountry, $clsHMCon->strZip, true);
 }
 if (bAllowAccess('showSponsors')) {
     echoT($clsRpt->writeLabel('Sponsorship', 160));
 }
 $bHOH = true;
 foreach ($households as $contact) {
     $strLinkGiftHistory = '';
     $lPID = $contact->PID;
     if ($bHOH) {
         $strHOH = '<b>';
         $strEndHOH = '</b> <span class="smaller">(head)</span>';
         $bHOH = false;
     } else {
         $strHOH = strLinkSpecial_MakeHOH($lPID, $lHouseholdID, 'Make head-of-household', true) . ' ' . strLinkRem_PersonFromHousehold($lPID, $lHouseholdID, 'Remove from household', true, true, '');
         $strEndHOH = '';
     }
     $strAddr = strBuildAddress($contact->strAddr1, $contact->strAddr2, $contact->strCity, $contact->strState, $contact->strCountry, $contact->strZip, true);
     if ($strAddr != '') {
         $strAddr .= '<br><br>';
     }
     $strEmail = $contact->strEmail;
     if ($strEmail != '') {
         $strAddr .= strBuildEmailLink($strEmail, '', false, '') . '<br>';
     }
     $strPhone = $contact->strPhone;
     if ($strPhone != '') {
         $strAddr .= $strPhone;
     }
     if (bAllowAccess('showGiftHistory')) {
         if ($contact->lNumACODonationGroups_hard + $contact->lNumACODonationGroups_soft > 0) {
             $strLinkGiftHistory = '<br>' . strLinkView_GiftsHistory($lPID, 'Gift history', true) . ' ' . strLinkView_GiftsHistory($lPID, 'Gift history', false);
         }