function showEventDates($lEventID, $event, &$eventDates, $lNumDates) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $genumDateFormat; $attributes = new stdClass(); $attributes->lTableWidth = 900; $attributes->divID = 'volEDates'; $attributes->divImageID = 'volEDatesDivImg'; openBlock('Event Dates', strLinkAdd_VolEventDate($lEventID, 'Add date to this event', true) . ' ' . strLinkAdd_VolEventDate($lEventID, 'Add date', false) . ' ' . strLinkView_VolEventAssignments($lEventID, 'View volunteer assignements', true) . ' ' . strLinkView_VolEventAssignments($lEventID, 'View volunteer assignements', false), $attributes); if ($lNumDates == 0) { echoT('<i>No dates scheduled for this event</i>'); } else { echoT('<table border="0"> <tr> <td style="font-weight: bold; width: 40pt;"> </td> <td style="font-weight: bold; width: 50pt; text-align: center;"> Date ID </td> <td style="font-weight: bold; width: 90pt;"> Date </td> <td style="font-weight: bold;"> Shifts </td> <td style="font-weight: bold;"> </td> </tr>'); foreach ($eventDates as $eDate) { $lEdateID = $eDate->lKeyID; echoT(' <tr> <td style="text-align: center; vertical-align: top;">' . strLinkView_VolEventDate($lEdateID, 'View date', true) . ' ' . strLinkRem_VolEventDate($lEventID, $lEdateID, 'Remove this event date', true, true, '', true) . ' </td> <td style="vertical-align: top; text-align: center;">' . str_pad($lEdateID, 5, '0', STR_PAD_LEFT) . ' </td> <td style="text-align: left; vertical-align: top;">' . date($genumDateFormat . ' (D)', $eDate->dteEvent) . ' </td> <td style="text-align: center; vertical-align: top; padding-right: 10px;">' . $eDate->lNumShifts . ' </td> <td style="text-align: left; vertical-align: top;">' . showShiftInfo($eDate, $lEventID) . ' </td> </tr> '); } echoT('</table>'); } $attributes = new stdClass(); $attributes->bCloseDiv = true; closeBlock($attributes); }
function strShiftJobCodesDetailsViaMonth($strMoYr, $sRpt, $bAllJobCodes) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $genumDateFormat; $strOut = ' <table class="enpRptC" style="width: 600pt;"> <tr> <td colspan="6" class="enpRptTitle"> Job Code Details for Scheduled Shifts: ' . $strMoYr . ' </td> </tr> <tr> <td class="enpRptLabel"> Event </td> <td class="enpRptLabel"> Shift/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 vs_lJobCode=' . $sRpt->lJobCodeID . ' '; } $sqlStr = 'SELECT vs_lJobCode, ved_dteEvent, vsa_dHoursWorked, vsa_lVolID, vem_lKeyID, ved_lKeyID, jc.lgen_strListItem AS strJobCode, vem_strEventName, vs_strShiftName, pe_strFName, pe_strLName FROM vol_events_dates INNER JOIN vol_events_dates_shifts ON vs_lEventDateID = ved_lKeyID INNER JOIN vol_events_dates_shifts_assign ON vsa_lEventDateShiftID = vs_lKeyID INNER JOIN vol_events ON ved_lVolEventID = vem_lKeyID INNER JOIN volunteers ON vol_lKeyID = vsa_lVolID INNER JOIN people_names ON vol_lPeopleID = pe_lKeyID LEFT JOIN lists_generic AS jc ON vs_lJobCode = jc.lgen_lKeyID WHERE NOT vs_bRetired AND NOT vsa_bRetired AND YEAR (ved_dteEvent)=' . $sRpt->lYear . ' AND MONTH(ved_dteEvent)=' . $sRpt->lMonth . ' AND vsa_dHoursWorked > 0 ' . $strWhereJC . ' ORDER BY vem_strEventName, strJobCode, ved_dteEvent, 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) { $dteEvent = dteMySQLDate2Unix($row->ved_dteEvent); $strJobCode = $row->strJobCode . '' == '' ? '(not set)' : htmlspecialchars($row->strJobCode); $strOut .= ' <tr class="makeStripe"> <td class="enpRpt" style="width: 150pt;">' . strLinkView_VolEvent($row->vem_lKeyID, 'View event', true) . ' ' . htmlspecialchars($row->vem_strEventName) . ' </td> <td class="enpRpt" style="width: 130pt;">' . strLinkView_VolEventDate($row->ved_lKeyID, 'View event date and shifts', true) . ' ' . htmlspecialchars($row->vs_strShiftName) . '<br> ' . date($genumDateFormat, $dteEvent) . ' </td> <td class="enpRpt" style="width: 130pt;">' . strLinkView_Volunteer($row->vsa_lVolID, 'Volunteer Record', true) . ' ' . 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="4"><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; }
<?php $lIndent = 15; foreach ($events as $event) { echoT('<font style="font-size: 12pt;"><b><u>' . htmlspecialchars($event->strEventName) . '</u></b></font><br>'); echoT('<table>'); foreach ($event->dates as $oneDate) { echoT(' <tr> <td colspan="5" style="font-size: 11pt;">' . date('l, F jS, Y', $oneDate->dteEvent) . ' ' . strLinkView_VolEventDate($oneDate->lKeyID, 'View event date', true) . ' </td> </tr>'); if ($oneDate->lNumShifts == 0) { echoT('<tr> <td style="width: ' . $lIndent . 'pt;"> </td> <td colspan="4"> <i>No shifts</i> </td> </tr>'); } else { foreach ($oneDate->shifts as $shift) { echoT('<tr> <td style="width: ' . $lIndent . 'pt;"> </td> <td colspan="4" style="font-size: 10pt;"> Shift: <b>' . htmlspecialchars($shift->strShiftName) . '</b> <font style="font-size: 9pt;">(' . date('g:i A', $shift->dteEventStartTime) . ' / ' . $shift->enumDuration . ')</font> </td> </tr>'); if ($shift->lNumVols == 0) { echoT('<tr> <td style="width: ' . $lIndent . 'pt;"> </td> <td style="width: ' . $lIndent . 'pt;"> </td>
private function strVolScheduleRptHTML(&$query, $strLabel, $strSafeNameFL, $lVolID) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $genumDateFormat; $strOut = '<table class="enpRptC"> <tr> <td class="enpRptTitle" colspan="7">' . $strLabel . ' Volunteer Schedule for ' . $strSafeNameFL . ' ' . 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 strVolHoursDetailReport(&$sRpt, $lStartRec, $lRecsPerPage) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $genumDateFormat; $this->hrsSumOpts($sRpt, $bUseYear, $lYear, $bUseMon, $lMon, $bUseVolID, $lVolID); $strLimit = " LIMIT {$lStartRec}, {$lRecsPerPage} "; $strTab = 'tmp_vol_hrs'; $this->buildPopHrsTmp($strTab, $lYear, $lMon, $lVolID); $strWhere = '1'; $strTitle = 'Volunteer Details for '; $strFail = 'There are no volunteer hours for '; if ($bUseVolID) { $cVol = new mvol(); $cVol->loadVolRecsViaVolID($lVolID, true); $vRec =& $cVol->volRecs[0]; $strSafeName = $vRec->strSafeName; $strTitle .= $strSafeName . ' '; $strFail .= $strSafeName . ' '; } if ($bUseMon) { $strMonth = strXlateMonth($lMon); $strTitle .= $strMonth . ' ' . $lYear; $strFail .= $strMonth . ' ' . $lYear; } else { $strTitle .= $lYear; $strFail .= $lYear; } $sqlStr = "SELECT\n vsa_lKeyID, tmphr_dteVolActivity,\n tmphr_lVolID, vsa_dHoursWorked, vsa_lEventDateShiftID,\n lgen_strListItem,\n vs_strShiftName, vs_lEventDateID, vem_lKeyID, vem_strEventName,\n pe_strFName, pe_strLName\n\n FROM {$strTab}\n INNER JOIN vol_events_dates_shifts_assign ON vsa_lKeyID = tmphr_lEventAssignID\n INNER JOIN volunteers ON tmphr_lVolID = vol_lKeyID\n INNER JOIN people_names ON vol_lPeopleID = pe_lKeyID\n LEFT JOIN vol_events_dates_shifts ON vsa_lEventDateShiftID = vs_lKeyID\n LEFT JOIN vol_events_dates ON vs_lEventDateID = ved_lKeyID\n LEFT JOIN vol_events ON ved_lVolEventID = vem_lKeyID\n LEFT JOIN lists_generic ON vsa_lActivityID=lgen_lKeyID\n\n ORDER BY tmphr_dteVolActivity, vsa_lKeyID\n {$strLimit};"; $query = $this->db->query($sqlStr); $lNumRows = $query->num_rows(); if ($lNumRows == 0) { return '<br><i>' . $strFail . '.</i><br>'; } $strOut = ' <table class="enpRptC"> <tr> <td colspan="7" class="enpRptTitle">' . $strTitle . ' </td> </tr>'; $strOut .= ' <tr> <td class="enpRptLabel"> Date </td> <td class="enpRptLabel"> Vol ID </td> <td class="enpRptLabel"> Volunteer </td> <td class="enpRptLabel"> Event </td> <td class="enpRptLabel"> Shift/Activity </td> <td class="enpRptLabel"> Hours </td> </tr>'; foreach ($query->result() as $row) { $lVolID = $row->tmphr_lVolID; if (is_null($row->vsa_lEventDateShiftID)) { $strEvent = '<i>(unscheduled)</i>'; $strActivity = strLinkEdit_VolUnschedHrs($lVolID, $row->vsa_lKeyID, 'Edit activity', true, '', 12) . ' ' . htmlspecialchars($row->lgen_strListItem); } else { $strEvent = strLinkView_VolEvent($row->vem_lKeyID, 'View event', true) . ' ' . htmlspecialchars($row->vem_strEventName); $strActivity = strLinkView_VolEventDate($row->vs_lEventDateID, 'View event date/shifts', true) . ' ' . htmlspecialchars($row->vs_strShiftName); } $strOut .= ' <tr class="makeStripe"> <td class="enpRpt">' . date($genumDateFormat, dteMySQLDate2Unix($row->tmphr_dteVolActivity)) . ' </td> <td class="enpRpt">' . str_pad($lVolID, 5, '0', STR_PAD_LEFT) . ' ' . strLinkView_Volunteer($lVolID, 'View volunteer record', true) . ' </td> <td class="enpRpt">' . htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName) . ' </td> <td class="enpRpt">' . $strEvent . ' </td> <td class="enpRpt">' . $strActivity . ' </td> <td class="enpRpt" style="text-align: right; padding-right: 3px;">' . number_format($row->vsa_dHoursWorked, 2) . ' </td> </tr>'; } $strOut .= '</table><br>'; return $strOut; }
} $dteGroup = $dteEvent; 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) . ' ' . 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>'); }