示例#1
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;
     }
 }
echoT('<table>');
if ($lNumVols == 0) {
    echoT('<br><br><i>There are no volunteers scheduled for this shift.</i>');
} else {
    foreach ($vols as $vol) {
        $lVolID = $vol->lVolID;
        $lVolAssignID = $vol->lVolShiftAssignID;
        $strField = 'txtHR_' . $lVolAssignID;
        if (form_error($strField) == '') {
            $strVA = 'middle';
        } else {
            $strVA = 'top';
        }
        echoT('
            <tr>
               <td style="width: 50px; vertical-align: ' . $strVA . ';">' . strLinkView_Volunteer($lVolID, 'View volunteer record', true) . str_pad($lVolID, 5, '0', STR_PAD_LEFT) . '
               </td>
               <td style="width: 170px; vertical-align: ' . $strVA . ';">' . htmlspecialchars($vol->strLName . ', ' . $vol->strFName) . '
               </td>
               <td style="width: 90px; vertical-align: ' . $strVA . ';">&nbsp;hours logged:</td>
               <td style="text-align: left; vertical-align: ' . $strVA . ';">
                  <input type="text" name="' . $strField . '" 
                     size="5" maxlength="10"
                     value="' . $vol->strHours . '" />' . form_error($strField) . '
               </td>
            </tr>');
    }
    echoT('</table>      
                <input type="submit" name="cmdSubmit" value="Update Volunteer Hours"
                    onclick="this.disabled=1; this.form.submit();"
                    style=""
function strVolsForShift($lShiftID, $shift, $lEventDateID, $lNumVolsTot)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $strTable = strLinkAdd_VolEventDateShiftVol($lEventDateID, $lShiftID, 'Add volunteer to this shift', true) . '&nbsp;' . strLinkAdd_VolEventDateShiftVol($lEventDateID, $lShiftID, 'Add volunteer to this shift', false);
    if ($shift->lNumVols == 0) {
        $strTable .= '<br><i>No assigned volunteers</i>';
    } else {
        $strTable .= '<br><table>';
        foreach ($shift->vols as $clsV) {
            $lVolAssignID = $clsV->lKeyID;
            $lVolID = $clsV->lVolID;
            $strTable .= '
            <tr>
               <td>' . strLinkView_Volunteer($lVolID, 'View volunteer record', true) . '
               </td>
               <td>' . strLinkRem_VolEventDateShiftVol($lVolAssignID, $lEventDateID, $lShiftID, 'Remove volunteer from shift', true, true) . '
               </td>
               <td>' . $clsV->strSafeNameFL . '
               </td>
            </tr>';
        }
        $strTable .= '</table>';
    }
    return $strTable;
}
 private function strVolScheduleRptHTML(&$query, $strLabel, $strSafeNameFL, $lVolID)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $genumDateFormat;
     $strOut = '<table class="enpRptC">
         <tr>
            <td class="enpRptTitle" colspan="7">' . $strLabel . ' Volunteer Schedule for ' . $strSafeNameFL . '&nbsp;' . strLinkView_Volunteer($lVolID, 'View volunteer record', true) . '
            </td>
         <tr>';
     $strOut .= '
         <tr>
            <td class="enpRptLabel" style="vertical-align: bottom;">
               Date
            </td>
            <td class="enpRptLabel" style="vertical-align: bottom;">
               Event
            </td>
            <td class="enpRptLabel" style="vertical-align: bottom;">
               Shift
            </td>
            <td class="enpRptLabel" style="vertical-align: bottom;">
               Start
            </td>
            <td class="enpRptLabel" style="vertical-align: bottom;">
               Duration
            </td>
            <td class="enpRptLabel" style="vertical-align: bottom;">
               Hours Logged
            </td>
         <tr>';
     foreach ($query->result() as $row) {
         $lEventID = $row->ved_lVolEventID;
         $lEdateID = $row->vs_lEventDateID;
         $strOut .= '
          <tr class="makeStripe">
             <td class="enpRpt" style="text-align: center; width: 80pt;">' . date($genumDateFormat, dteMySQLDate2Unix($row->ved_dteEvent)) . '
             </td>
             <td class="enpRpt" style="text-align: left; width: 200pt;">' . strLinkView_VolEvent($lEventID, 'View Event', true) . htmlspecialchars($row->vem_strEventName) . '
             </td>
             <td class="enpRpt" style="text-align: left; width: 120pt;">' . strLinkView_VolEventDate($lEdateID, 'View shifts for this date', true) . htmlspecialchars($row->vs_strShiftName) . '
             </td>
             <td class="enpRpt" style="text-align: left; width: 50pt;">' . $row->dteStartTime . '
             </td>
             <td class="enpRpt" style="text-align: left; width: 100pt;">' . $row->strDuration . '
             </td>
             <td class="enpRpt" style="text-align: right; padding-right: 10px;; width: 30pt;">' . number_format($row->vsa_dHoursWorked, 2) . '
             </td>
          </tr>';
     }
     $strOut .= '</table>';
     return $strOut;
 }
function showPeopleInfo(&$clsRpt, $lPID, &$people, $vol, &$clsDateTime)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gbDateFormatUS, $glclsDTDateFormat, $genumDateFormat, $gbVolLogin;
    if (!$gbVolLogin) {
        if ($vol->bVol) {
            $strVol = strLinkView_Volunteer($vol->lVolID, 'View volunteer record', true) . ' ';
            if ($vol->bInactive) {
                $strVol .= '<i>Inactive since ' . date($genumDateFormat, $vol->dteInactive);
            } else {
                $strVol .= 'Active ' . strLinkView_Volunteer($vol->lVolID, '(view)', false);
            }
        } else {
            $strVol = 'Not a volunteer&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkAdd_VolFromPeople($lPID, 'Add as volunteer', true) . '&nbsp;' . strLinkAdd_VolFromPeople($lPID, 'Add as volunteer', false);
        }
    }
    if ($people->strPreferredName != $people->strFName && $people->strPreferredName != '') {
        $strPreferred = ' (' . $people->strPreferredName . ')';
    } else {
        $strPreferred = '';
    }
    $strName = strBuildName(false, $people->strTitle, $people->strPreferredName, $people->strFName, $people->strLName, $people->strMName);
    if ($gbVolLogin) {
        openBlock('Contact Info', strLinkEdit_PeopleContact('', 'Edit your contact information', true) . '&nbsp;' . strLinkEdit_PeopleContact('', 'Edit your contact information', false));
    } else {
        openBlock('Contact Info', strLinkEdit_PeopleContact($lPID, 'Edit this person\'s contact information', true) . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkRem_People($lPID, 'Remove this person\'s record', true, true));
    }
    echoT($clsRpt->openReport(600));
    //------------------------
    // People ID
    //------------------------
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('People ID:') . $clsRpt->writeCell(str_pad($lPID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow());
    //------------------------
    // Name
    //------------------------
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Name:') . $clsRpt->writeCell(htmlspecialchars($strName)) . $clsRpt->closeRow());
    //------------------------
    // Household
    //------------------------
    if (!$gbVolLogin) {
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Household:') . $clsRpt->writeCell(strLinkView_Household($people->lHouseholdID, $lPID, 'View Household', true) . ' ' . htmlspecialchars($people->strHouseholdName)) . $clsRpt->closeRow());
    }
    //------------------------
    // Birthdate
    //------------------------
    if (is_null($people->dteMysqlBirthDate)) {
        $strBDay = '&nbsp;';
    } else {
        $strBDay = $clsDateTime->strPeopleAge(0, $people->dteMysqlBirthDate, $lAgeYears, $glclsDTDateFormat);
    }
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Birthdate:') . $clsRpt->writeCell($strBDay) . $clsRpt->closeRow());
    //------------------------
    // Gender
    //------------------------
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Gender:') . $clsRpt->writeCell($people->enumGender) . $clsRpt->closeRow());
    //------------------------
    // Address
    //------------------------
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Address:') . $clsRpt->writeCell($people->strAddress) . $clsRpt->closeRow());
    //------------------------
    // Phone
    //------------------------
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Phone:') . $clsRpt->writeCell(htmlspecialchars(strPhoneCell($people->strPhone, $people->strCell))) . $clsRpt->closeRow());
    //------------------------
    // Accounting Country
    //------------------------
    if (!$gbVolLogin) {
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Accounting Country:') . $clsRpt->writeCell($people->strFlagImage . ' ' . $people->strCurSymbol) . $clsRpt->closeRow());
    }
    //------------------------
    // Email
    //------------------------
    if ($gbVolLogin) {
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Email:') . $clsRpt->writeCell(htmlspecialchars($people->strEmail)) . $clsRpt->closeRow());
    } else {
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Email:') . $clsRpt->writeCell($people->strEmailFormatted) . $clsRpt->closeRow());
    }
    //------------------------
    // Volunteer Status
    //------------------------
    if (!$gbVolLogin) {
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Volunteer Status:') . $clsRpt->writeCell($strVol) . $clsRpt->closeRow());
    }
    //------------------
    // Attributed To
    //------------------
    if (!$gbVolLogin) {
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Attributed To:') . $clsRpt->writeCell(htmlspecialchars($people->strAttrib)) . $clsRpt->closeRow());
    }
    //------------------
    // Notes
    //------------------
    if (!$gbVolLogin) {
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Notes:') . $clsRpt->writeCell(nl2br(htmlspecialchars($people->strNotes))) . $clsRpt->closeRow());
    }
    echoT($clsRpt->closeReport());
    closeBlock();
}
 if ($lNumVols == 0) {
     echoT($clsRpt->openRow(true));
     echoT($clsRpt->writeCell('<i>No volunteers match your search criteria</i>', '', '', $lNumCols));
 } else {
     foreach ($vols as $vol) {
         $bInactive = $vol->bInactive;
         $lVolID = $vol->lKeyID;
         $lPID = $vol->lPeopleID;
         if ($bInactive) {
             $strColor = ' color: #888;';
         } else {
             $strColor = '';
         }
         echoT($clsRpt->openRow(true));
         if ($showFields->bVolID) {
             echoT($clsRpt->writeCell(strLinkView_Volunteer($lVolID, 'View volunteer record', true) . '&nbsp;' . str_pad($lVolID, 5, '0', STR_PAD_LEFT), 60, 'text-align: center;' . $strColor));
         }
         if ($showFields->bPeopleID) {
             echoT($clsRpt->writeCell(strLinkView_PeopleRecord($lPID, 'View people record', true) . '&nbsp;' . str_pad($lPID, 5, '0', STR_PAD_LEFT), 60, 'text-align: center;' . $strColor));
         }
         if ($showFields->bActiveInactive) {
             echoT($clsRpt->writeCell($vol->bInactive ? 'No' : 'Yes', 60, 'text-align: center;' . $strColor));
         }
         if ($showFields->bName) {
             echoT($clsRpt->writeCell($vol->strSafeNameLF . '<br>' . strLinkView_Household($vol->lHouseholdID, $lPID, 'View household', true) . '<i>' . htmlspecialchars($vol->strHouseholdName) . '</i>', 240, $strColor));
         }
         if ($showFields->bAddress) {
             echoT($clsRpt->writeCell($vol->strAddress, 160, $strColor));
         }
         if ($showFields->bPhoneEmail) {
             echoT($clsRpt->writeCell(strPhoneCell($vol->strPhone, $vol->strCell, true, true) . '<br>' . $vol->strEmailFormatted, 100, $strColor));
 function strVolHoursTFSumReport($sRpt, $lStartRec, $lRecsPerPage)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $strOut = '<b>Time Frame: ' . $sRpt->strDateRange . '</b><br><br>';
     $strLimit = " LIMIT {$lStartRec}, {$lRecsPerPage} ";
     $sqlStr = "SELECT pe_strLName, pe_strFName, tmp_lVolID,\n              tmp_dHoursScheduled, tmp_dHoursUnscheduled\n           FROM {$sRpt->tmpTable}\n              INNER JOIN volunteers   ON tmp_lVolID    = vol_lKeyID\n              INNER JOIN people_names ON vol_lPeopleID = pe_lKeyID\n           ORDER BY pe_strLName, pe_strFName, pe_strMName, pe_lKeyID\n           {$strLimit};";
     $query = $this->db->query($sqlStr);
     $lNumRows = $query->num_rows();
     if ($lNumRows == 0) {
         $strOut .= '<i>There are no records that meet your search criteria.</i>';
     } else {
         $strOut .= '<table class="enpRptC" style="width: 450pt;">
            <tr>
               <td class="enpRptTitle" colspan="5">
                  Volunteer Hours
               </td>
            </tr>
            <tr>
               <td class="enpRptLabel">
                  vol ID
               </td>
               <td class="enpRptLabel">
                  Volunteer
               </td>
               <td class="enpRptLabel">
                  Scheduled<br>Hours
               </td>
               <td class="enpRptLabel">
                  Unscheduled<br>Hours
               </td>
               <td class="enpRptLabel">
                  Total
               </td>
            </tr>';
         $sngTotS = $sngTotU = 0.0;
         foreach ($query->result() as $row) {
             $lVolID = (int) $row->tmp_lVolID;
             $strOut .= '
               <tr class="makeStripe">
                  <td class="enpRpt" style="text-align: center; width: 40pt;">' . str_pad($lVolID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_Volunteer($lVolID, 'View volunteer record', true, ' id="vrec' . $lVolID . '" ') . '
                  </td>
                  <td class="enpRpt">' . htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName) . '
                  </td>
                  <td class="enpRpt" style="text-align: right; width: 40pt;">' . number_format($row->tmp_dHoursScheduled, 2) . '&nbsp;' . strLinkView_VolHrsViaVolID($lVolID, true, 'View details', true) . '
                  </td>
                  <td class="enpRpt" style="text-align: right; width: 40pt;">' . number_format($row->tmp_dHoursUnscheduled, 2) . '&nbsp;' . strLinkView_VolHrsViaVolID($lVolID, false, 'View details', true) . '
                  </td>
                  <td class="enpRpt" style="text-align: right; width: 40pt;">' . number_format($row->tmp_dHoursScheduled + $row->tmp_dHoursUnscheduled, 2) . '
                  </td>
               </tr>';
             $sngTotS += $row->tmp_dHoursScheduled;
             $sngTotU += $row->tmp_dHoursUnscheduled;
         }
         $strOut .= '
               <tr >
                  <td class="enpRptLabel" colspan="2">
                     Total
                  </td>
                  <td class="enpRpt" style="text-align: right; padding-right: 15pt;"><b>' . number_format($sngTotS, 2) . '</b>
                  </td>
                  <td class="enpRpt" style="text-align: right; padding-right: 15pt;"><b>' . number_format($sngTotU, 2) . '</b>
                  </td>
                  <td class="enpRpt" style="text-align: right;"><b>' . number_format($sngTotS + $sngTotU, 2) . '</b>
                  </td>
               </tr>';
         $strOut .= '</table>';
     }
     return $strOut;
 }
function contextNameLink($enumType, $lForeignID, &$strContextName, &$strContextLink)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $CI =& get_instance();
    $strContextLink = str_pad($lForeignID, 5, '0', STR_PAD_LEFT);
    switch ($enumType) {
        case CENUM_CONTEXT_PEOPLE:
            $CI->clsPeople->loadPeopleViaPIDs($lForeignID, false, false);
            $strContextName = $CI->clsPeople->people[0]->strFName . ' ' . $CI->clsPeople->people[0]->strLName;
            $strContextLink .= strLinkView_PeopleRecord($lForeignID, 'View people record', true);
            break;
        case CENUM_CONTEXT_CLIENT:
            $CI->clsClients->loadClientsViaClientID($lForeignID);
            $strContextName = $CI->clsClients->clients[0]->strFName . ' ' . $CI->clsClients->clients[0]->strLName;
            $strContextLink .= strLinkView_ClientRecord($lForeignID, 'View client record', true);
            break;
        case CENUM_CONTEXT_GIFT:
            $CI->clsGifts->loadGiftViaGID($lForeignID);
            $strContextName = 'Donation by ' . $CI->clsGifts->gifts[0]->strSafeName;
            $strContextLink .= strLinkView_GiftsRecord($lForeignID, 'View gift record', true);
            break;
        case CENUM_CONTEXT_BIZ:
            $CI->clsBiz->loadBizRecsViaBID($lForeignID);
            $strContextName = $CI->clsBiz->bizRecs[0]->strSafeName;
            $strContextLink .= strLinkView_BizRecord($lForeignID, 'View business record', true);
            break;
        case CENUM_CONTEXT_SPONSORSHIP:
            $CI->clsSpon->sponsorInfoViaID($lForeignID);
            $strContextName = 'Sponsor ' . $CI->clsSpon->sponInfo[0]->strSponSafeNameFL;
            $strContextLink .= strLinkView_Sponsorship($lForeignID, 'View sponsorship record', true);
            break;
        case CENUM_CONTEXT_VOLUNTEER:
            $CI->clsVol->loadVolRecsViaVolID($lForeignID, true);
            $strContextName = $CI->clsVol->volRecs[0]->strSafeNameFL;
            $strContextLink .= strLinkView_Volunteer($lForeignID, 'View volunteer record', true);
            break;
        case CENUM_CONTEXT_LOCATION:
            $CI->clsLoc->loadLocationRec($lForeignID);
            $strContextName = $CI->clsLoc->strLocation;
            $strContextLink .= strLinkView_ClientLocation($lForeignID, 'View client location record', true);
            break;
        case CENUM_CONTEXT_ORGANIZATION:
            $CI->clsLoc->loadLocationRec($lForeignID);
            $strContextName = $CI->clsChapter->chapterRec->strSafeChapterName;
            $strContextLink .= strLinkView_OrganizationRecord($lForeignID, 'View your organization record', true);
            break;
        default:
            screamForHelp($enumType . ': feature not available yet<br>error on line ' . __LINE__ . ',<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__);
            break;
    }
}
示例#9
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;
 }
示例#10
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;
 }
 private function loadVolunteerContext()
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $this->clsVol = new mvol();
     $this->clsVol->loadVolRecsViaVolID($this->lForeignID, true);
     $this->strContextLabel = 'volunteer record';
     $this->strContextName = $this->clsVol->volRecs[0]->strSafeNameFL;
     $this->strContextViewLink = strLinkView_Volunteer($this->lForeignID, 'view volunteer record', true);
 }
        $strUTabLinks = '<i>(no personalized tables)</i>';
    } else {
        $strUTabLinks = '<ul style="margin-top: 0px; margin-bottom: 0px;">';
        foreach ($utables as $ut) {
            // hook 'em
            $strUTabLinks .= '<li style="margin-left: -14pt;">' . strLinkView_UFMFRecordsViaFID(CENUM_CONTEXT_VOLUNTEER, $ut->lTableID, $lVolID, 'View record', true) . '&nbsp;' . htmlspecialchars($ut->strUserTableName) . '</li>';
        }
        $strUTabLinks .= '</ul>';
    }
    echoT('
         <tr class="makeStripe">
            <td class="enpRpt" style="text-align: center;">' . number_format($idx) . '
            </td>
            <td class="enpRpt" style="text-align: center;">' . str_pad($lPeopleID, 6, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_PeopleRecord($lPeopleID, 'View people record', true) . '
            </td>
            <td class="enpRpt" style="text-align: center;">' . str_pad($lVolID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_Volunteer($lVolID, 'View volunteer record', true) . '
            </td>
            <td class="enpRpt">' . $vol->strSafeNameLF . '
            </td>
            <td class="enpRpt">' . $vol->strAddress . '<br>' . $vol->strEmailFormatted . '<br>
               phone: ' . htmlspecialchars($vol->strPhone) . '<br>
               cell: ' . htmlspecialchars($vol->strCell) . '
            </td>
            <td class="enpRpt">' . date($genumDateFormat . ' H:i:s', $vol->dteOrigin) . '
            </td>
            <td class="enpRpt">' . $strUTabLinks . '
            </td>
         </tr>');
    ++$idx;
}
echoT('</table>');
                   Address
                </td>
                <td class="enpRptLabel">
                   Skills
                </td>
             </tr>
         ');
 foreach ($volsA as $clsVA) {
     if ($clsVA->bEligible) {
         $lVolID = $clsVA->lVolID;
         echoT('
            <tr>
               <td class="enpRpt" style="width: 10px; vertical-align:top;">
                  <input type="checkbox" name="chkVol[]" value="' . $clsVA->lVolID . '">
               </td>
               <td class="enpRpt" style="vertical-align:top; width: 180px;">' . strLinkView_Volunteer($lVolID, 'View volunteer record', true) . '&nbsp;' . $clsVA->strSafeNameFL . '
               </td>
               <td class="enpRpt" style="vertical-align:top;">' . $clsVA->strAddr . '
               </td>
               <td class="enpRpt" style="vertical-align:top;">');
         if ($clsVA->lNumVolSkills > 0) {
             foreach ($clsVA->volSkills as $skill) {
                 echoT(htmlspecialchars($skill->strSkill) . "<br>\n");
             }
         } else {
             echoT('<i>No skill assigned</i>');
         }
         echoT('
               </td>
            </tr>');
     }
示例#14
0
 public function volHTMLSummary($idx)
 {
     //-----------------------------------------------------------------------
     // assumes user has called $clsVol->loadVolRecs(...
     //-----------------------------------------------------------------------
     global $gdteNow, $genumDateFormat;
     $strOut = '';
     $params = array('enumStyle' => 'terse');
     $clsRpt = new generic_rpt($params);
     $clsRpt->setEntrySummary();
     $lVolID = $this->volRecs[$idx]->lKeyID;
     $volRec =& $this->volRecs[$idx];
     $lPID = $volRec->lPeopleID;
     $strOut .= $clsRpt->openReport('', '') . $clsRpt->openRow(false) . $clsRpt->writeLabel('Name:') . $clsRpt->writeCell($volRec->strSafeName . '&nbsp;&nbsp;&nbsp;(people ID ' . str_pad($lPID, 5, '0', STR_PAD_LEFT) . strLinkView_PeopleRecord($lPID, 'View People Record', true) . ')') . $clsRpt->closeRow() . $clsRpt->openRow(false) . $clsRpt->writeLabel('Volunteer ID:') . $clsRpt->writeCell(str_pad($lVolID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_Volunteer($lVolID, 'View Volunteer Record', true)) . $clsRpt->closeRow();
     if ($volRec->bInactive) {
         $strVol = '<i>Inactive since ' . date($genumDateFormat, $volRec->dteInactive);
     } else {
         $strVol = 'Active';
     }
     $strOut .= $clsRpt->openRow(false) . $clsRpt->writeLabel('Volunteer Status:') . $clsRpt->writeCell($strVol) . $clsRpt->closeRow() . $clsRpt->openRow(false) . $clsRpt->writeLabel('Address:') . $clsRpt->writeCell($volRec->strAddress) . $clsRpt->closeRow() . $clsRpt->closeReport('');
     return $strOut;
 }
 $lShiftID = $shift->lKeyID;
 if ($shift->lNumVolsInShift > 0) {
     $strBlockLink = strLinkEdit_VolEventHrs($lEventID, $lShiftID, 'Edit hours for this shift', true);
 } else {
     $strBlockLink = '';
 }
 openBlock(date('F j Y', $shift->dteEvent) . '&nbsp&nbsp;' . date('g:i a', $shift->dteEventStartTime) . ': ' . '<b>' . htmlspecialchars($shift->strShiftName) . '</b> (' . $shift->enumDuration . ')', $strBlockLink);
 echoT('<table>');
 if ($shift->lNumVolsInShift > 0) {
     $dTotHrs = 0.0;
     foreach ($shift->vols as $vol) {
         $lVolID = $vol->lVolID;
         $dTotHrs += $vol->dHoursWorked;
         echoT('
        <tr>
           <td style="width: 50px;">' . strLinkView_Volunteer($lVolID, 'View volunteer record', true) . str_pad($lVolID, 5, '0', STR_PAD_LEFT) . '
           </td>
           <td style="width: 250px;">' . htmlspecialchars($vol->strLName . ', ' . $vol->strFName) . '
           </td>
           <td style="width: 90px;">&nbsp;hours logged:</td>
           <td style="width: 50px; text-align: right;">' . number_format($vol->dHoursWorked, 2) . '
           </td>
        </tr>');
     }
     echoT('
     <tr>
        <td style="width: 50px;" >&nbsp;</td>
        <td style="width: 250px;">&nbsp;</td>
        <td style="width: 90px;"><b>Total:</b</td>
        <td style="width: 50px; text-align: right;"><b>' . number_format($dTotHrs, 2) . '
        </td>
 function strUnJobCodesDetailsViaMonth($strMoYr, $sRpt, $bAllJobCodes)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $genumDateFormat;
     $strOut = '<br><br>
         <table class="enpRptC" style="width: 600pt;">
             <tr>
                <td colspan="4" class="enpRptTitle">
                   Job Code Details for Unschedule Volunteers: ' . $strMoYr . '
                </td>
             </tr>
             <tr>
                <td class="enpRptLabel">
                   Date
                </td>
                <td class="enpRptLabel">
                   Volunteer
                </td>
                <td class="enpRptLabel">
                   Job Code
                </td>
                <td class="enpRptLabel">
                   Hours
                </td>
             </tr>
             ';
     if ($bAllJobCodes) {
         $strWhereJC = '';
     } else {
         $strWhereJC = ' AND vsa_lJobCode=' . $sRpt->lJobCodeID . ' ';
     }
     $sqlStr = 'SELECT vsa_lJobCode, vsa_dHoursWorked, vsa_lVolID,
         jc.lgen_strListItem AS strJobCode, vsa_dteActivityDate,
         pe_strFName, pe_strLName
      FROM vol_events_dates_shifts_assign
         INNER JOIN volunteers                     ON vol_lKeyID            = vsa_lVolID
         INNER JOIN people_names                   ON vol_lPeopleID         = pe_lKeyID
         LEFT  JOIN lists_generic   AS jc          ON vsa_lJobCode          = jc.lgen_lKeyID
      WHERE NOT vsa_bRetired
         AND YEAR (vsa_dteActivityDate)=' . $sRpt->lYear . '
         AND MONTH(vsa_dteActivityDate)=' . $sRpt->lMonth . '
         AND vsa_dHoursWorked > 0
         ' . $strWhereJC . '
      ORDER BY strJobCode, vsa_dteActivityDate, pe_strLName, pe_strFName, pe_lKeyID;';
     $query = $this->db->query($sqlStr);
     $numRows = $query->num_rows();
     $idx = 0;
     $sngTotHrs = 0.0;
     if ($numRows > 0) {
         foreach ($query->result() as $row) {
             $dteActivity = dteMySQLDate2Unix($row->vsa_dteActivityDate);
             $strJobCode = $row->strJobCode . '' == '' ? '(not set)' : htmlspecialchars($row->strJobCode);
             $strOut .= '
             <tr class="makeStripe">
                <td class="enpRpt" style="width: 130pt;">' . date($genumDateFormat, $dteActivity) . '
                </td>
                <td class="enpRpt" style="width: 130pt;">' . strLinkView_Volunteer($row->vsa_lVolID, 'Volunteer Record', true) . '&nbsp;' . htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName) . '
                </td>
                <td class="enpRpt" style="width: 100pt;">' . $strJobCode . '
                </td>
                <td class="enpRpt" style="width: 35pt; padding-right: 10px; text-align: right;">' . number_format($row->vsa_dHoursWorked, 2) . '
                </td>
             </tr>';
             $sngTotHrs += $row->vsa_dHoursWorked;
         }
     }
     $strOut .= '
       <tr>
          <td class="enpRpt" colspan="3"><b>
             Total:</b>
          </td>
          <td class="enpRpt" style="width: 35pt; padding-right: 10px; text-align: right;"><b>' . number_format($sngTotHrs, 2) . '</b>
          </td>
       </tr>';
     $strOut .= '</table>' . "\n";
     return $strOut;
 }
                echoT('
                         <li><b>' . date('l \\t\\h\\e jS \\o\\f F, Y', $edate->dteEvent) . '</b>
                         <ul style="
                                 margin-left:-20px; 
                                 margin-right:0px; 
                                 list-style:none; 
                             ">');
            }
            echoT('<li>' . htmlspecialchars($edate->strEventName) . '&nbsp;' . strLinkView_VolEvent($edate->lVolEventID, 'View event', true) . '<ul style="list-style-type: none; margin-left:-20px; ">');
            if ($edate->lNumShifts == 0) {
                echoT('<li><i>No shifts associated with this event for this date</i><br><br></li></ul>');
            } else {
                foreach ($edate->shifts as $shift) {
                    echoT('<li>' . htmlspecialchars($shift->strShiftName) . ' (' . $shift->dteStartTime . ' / ' . $shift->enumDuration . ')' . strLinkView_VolEventDate($lDateID, 'View shifts', true) . '<br>Volunteers:<ul>');
                    if ($shift->lNumVols == 0) {
                        echoT('<li><i>No volunteers assigned</i><br><br></li>');
                    } else {
                        foreach ($shift->vols as $vol) {
                            $lVolID = $vol->lVolID;
                            echoT('<li>' . htmlspecialchars($vol->strFName . ' ' . $vol->strLName) . strLinkView_Volunteer($lVolID, 'View volunteer record', true) . '</li>');
                        }
                    }
                    echoT('</ul><br></li>');
                }
                echoT('</ul><br>');
            }
        }
        echoT('</ul>');
    }
    closeblock();
}