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 showEventDateInfo($clsRpt, $lEventDateID, $lEventID, $clsED, $lNumEventDates, &$shifts, $lNumShifts, $lNumVolsTot) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $genumDateFormat; $bShowClone = $lNumEventDates > 1; openBlock('Event Date', strLinkEdit_VolEventDate($lEventID, $lEventDateID, 'Edit event date', true) . ' ' . strLinkRem_VolEventDate($lEventID, $lEventDateID, 'Remove this date from the event', true, true)); echoT($clsRpt->openReport() . $clsRpt->openRow() . $clsRpt->writeLabel('Event Date ID:') . $clsRpt->writeCell(str_pad($lEventDateID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Event Date:') . $clsRpt->writeCell(date($genumDateFormat . ' (l)', $clsED->dteEvent)) . $clsRpt->closeRow()); echoT($clsRpt->openRow() . $clsRpt->writeLabel('# Shifts:') . $clsRpt->writeCell(' <table border="0" cellpadding="0" cellspacing="0"> <tr> <td style="vertical-align: top;">' . $lNumShifts . ' </td> <td>' . strLinkAdd_VolEventDateShift($lEventDateID, 'Add new shift', true) . ' </td> <td style="vertical-align: top;">' . strLinkAdd_VolEventDateShift($lEventDateID, 'Add new shift', false) . ' </td> </tr> </table>', '') . $clsRpt->closeRow() . $clsRpt->closeReport()); if ($lNumShifts > 0) { echoT(' <table border="0"> <tr> <td style="font-weight: bold;"> </td> <td style="font-weight: bold; width: 60pt; text-decoration:underline; vertical-align: bottom;"> Shift ID </td> <td style="font-weight: bold; width: 90pt; text-decoration:underline; vertical-align: bottom;"> Start Time </td> <td style="font-weight: bold; width: 110pt; text-decoration:underline; vertical-align: bottom;"> Duration </td> <td style="font-weight: bold; width: 50pt; text-decoration:underline; text-align: center;"> Vols Needed </td> <td style="font-weight: bold; width: 220pt; text-decoration:underline; vertical-align: bottom;"> Vols Assigned </td> <td style="font-weight: bold; width: 220pt; text-decoration:underline; vertical-align: bottom;"> Shift Info </td> <td style="font-weight: bold; text-decoration:underline; vertical-align: bottom; padding-right: 20px;"> Hours Logged </td> </tr>'); foreach ($shifts as $shift) { $lShiftID = $shift->lKeyID; if ($bShowClone) { $strClone = ' ' . strLinkClone_VolShift($lEventDateID, $lShiftID, 'Clone this shift', true); } else { $strClone = ''; } $strJobCode = $shift->strJobCode . ''; if ($strJobCode == '') { $strJobCode = '<i>(not set)</i>'; } else { $strJobCode = htmlspecialchars($strJobCode); } if ($shift->lNumVols == 0) { $strLinkVolEditHrs = ' '; } else { $strLinkVolEditHrs = strLinkEdit_VolEventHrsViaShift($lEventID, $lShiftID, 'eventDate', 'Edit volunteer hours', true); } echoT(' <tr> <td style="vertical-align: top;" nowrap>' . strLinkEdit_VolEventDateShift($lEventDateID, $lShiftID, 'Edit shift', true) . $strClone . ' ' . strLinkRem_VolEventDateShift($lEventDateID, $lShiftID, 'Remove shift', true, true) . ' </td> <td style="vertical-align: top; width: 50pt; text-align: center;">' . str_pad($lShiftID, 5, '0', STR_PAD_LEFT) . ' </td> <td style="vertical-align: top;">' . date('g:i:s A', $shift->dteEventStartTime) . ' </td> <td style="vertical-align: top;">' . $shift->enumDuration . ' </td> <td style="vertical-align: top; text-align: center;">' . $shift->lNumVolsNeeded . ' </td> <td style="vertical-align: top;">' . strVolsForShift($lShiftID, $shift, $lEventDateID, $lNumVolsTot) . ' </td> <td style="vertical-align: top; width: 220pt;"><b>' . htmlspecialchars($shift->strShiftName) . '</b><br>' . '<b>Job code:</b> ' . $strJobCode . '<br>' . nl2br(htmlspecialchars($shift->strDescription)) . ' </td> <td style="vertical-align: top; text-align: right; padding-right: 20px;" nowrap>' . number_format($shift->hoursLogged, 2) . $strLinkVolEditHrs . ' </td> </tr>'); } echoT(' </table>'); } closeBlock(); }