<?php

echoT(strLinkAdd_VolEvent('Add Event', true) . '&nbsp;' . strLinkAdd_VolEvent('Add Event', false) . '<br><br>');
echoT($strAltView);
if ($lNumEvents == 0) {
    echoT('<i>There are no events to display</i><br><br>');
} else {
    openVolEventTable();
    foreach ($events as $event) {
        writeVolEventRow($event);
    }
    closeVolEventTable();
}
function writeVolEventRow(&$event)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $genumDateFormat;
    $lEventID = $event->lKeyID;
    echoT('
      <tr>
         <td class="enpRpt" style="text-align: center;">' . strLinkView_VolEvent($lEventID, 'View event', true) . '&nbsp;' . str_pad($lEventID, 5, '0', STR_PAD_LEFT) . '
         </td>
         <td class="enpRpt" style="width: 150pt;">' . htmlspecialchars($event->strEventName) . '
         </td>
         <td class="enpRpt">' . date($genumDateFormat . ' (D)', $event->dteEventStart) . '
         </td>
         <td class="enpRpt">' . date($genumDateFormat . ' (D)', $event->dteEventEnd) . '
         </td>
         <td class="enpRpt" style="text-align: center;">' . $event->lNumShifts . '
<?php

$params = array('enumStyle' => 'terse');
$clsRpt = new generic_rpt($params);
$clsRpt->strWidthLabel = 80;
echoT(strLinkAdd_VolEvent('Add new volunteer event', true) . '&nbsp;' . strLinkAdd_VolEvent('Add new volunteer event', false) . '<br>');
showEventInfo($clsRpt, $lEventID, $event);
showEventVolHours($clsRpt, $lEventID, $event, $dNumHrs);
showEventDates($lEventID, $event, $eventDates, $lNumDates);
showEventENPStats($clsRpt, $event);
function showEventVolHours($clsRpt, $lEventID, &$event, $dNumHrs)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $attributes = new stdClass();
    $attributes->lTableWidth = 900;
    $attributes->divID = 'volHrs';
    $attributes->divImageID = 'volHrsDivImg';
    openBlock('Volunteer Hours', strLinkView_VolEventHrs($lEventID, 'View volunteer hours for this event', true) . '&nbsp;' . strLinkView_VolEventHrs($lEventID, 'View volunteer hours for this event', false), $attributes);
    echoT('Total volunteer hours worked: ' . number_format($dNumHrs, 2) . '<br />');
    $attributes = new stdClass();
    $attributes->bCloseDiv = true;
    closeBlock($attributes);
}
function showEventInfo($clsRpt, $lEventID, &$event)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $genumDateFormat;