|
$arTotals = false;
if($sType == 'P') {
$arProjects = $objTblEntity->getOrgProjectHistoryProjects($ixEntityOrg, $bCorporation, $arTeams, 'P', false);
}
elseif($sType == 'C') {
$arProjects = $objTblEntity->getOrgProjectHistoryProjects($ixEntityOrg, $bCorporation, $arTeams, 'C', false);
}
else {
$arProjects = $objTblEntity->getOrgProjectHistoryProjects($ixEntityOrg, $bCorporation, $arTeams, false, true);
}
// Remove any values that are not numbers
$arIxProjects = oneDimensionalize($arProjects, 'ixactivity');
for ($i = 0; $i < count($arIxProjects); $i++)
{
if (!is_numeric($arIxProjects[$i]))
{
unset($arIxProjects[$i]);
}
}
// Get the occurrences for these projects
$arAllOccurrences = $objTblEntity->getActivityAttendanceDetails($arIxProjects, $ixEntityOrg, $bCorporation, $arTeams, true);
$arAllOccurrenceActivityIX = oneDimensionalize($arAllOccurrences, 'ixactivity');
while($arProject = each($arProjects))
{
$arProject = $arProject['value'];
// in the case of special events, we will sometimes display a special event with no corresponding projects
if($bCorporation && $sType == 'S') {
if(!$arProject['ixactivity']) {
// this is potentially a special event with no corresponding projects
// check the next project
$arNextProject = current($arProjects);
if($arNextProject['ixspecialevent'] == $arProject['ixspecialevent']) {
// we are all set -- this SE will be displayed by the next iteration of the loop
continue;
}
// If we get here, we should display the blank SE row with no projects message
?>
 |
 |
 |
 |
 |
= $arProject[sname] . " " . DisplayDateTime(SHORT_DATE,$arProject['dteventfrom']) . "-" . DisplayDateTime(SHORT_DATE,$arProject['dteventto']) ?> |
 |
 |
 |
 |
No Projects |
 |
 |
continue;
}
}
$bFirst = true;
// get the occurrences and associated hours for this activity
$arKeys = array_keys($arAllOccurrenceActivityIX, $arProject['ixactivity']);
$arOccurrences = array();
foreach($arKeys as $key => $value) {
$arOccurrences[] = $arAllOccurrences[$value];
}
while($arOccurrence = each($arOccurrences)) {
$arOccurrence = $arOccurrence['value'];
$arNextOccurrence = current($arOccurrences);
if(!$arNextOccurrence) {
$arNextOccurrence = array();
}
if($arOccurrence['ixspecialevent'] && ($arOccurrence['ixspecialevent'] != $lastIxSpecialEvent)) {
?>
 |
 |
 |
 |
 |
= $arOccurrence[sname] . " " . DisplayDateTime(SHORT_DATE,$arOccurrence['dteventfrom']) . "-" . DisplayDateTime(SHORT_DATE,$arOccurrence['dteventto']) ?> |
 |
 |
}
if($bFirst) {
if(!($arOccurrence['ixspecialevent'] && ($arOccurrence['ixspecialevent'] != $lastIxSpecialEvent))) {
?>
 |
 |
 |
}
?>
 |
 |
= $arOccurrence[stitle] ?> |
 |
 |
 |
 |
 |
Date |
= ($bCorporation)?'Individual Employee Volunteering':'Hours'; ?> |
= ($bCorporation)?'Affiliated Teams':''; ?> |
= ($bCorporation)?'Sponsored Projects':''; ?> |
 |
 |
$bFirst = false;
}
?>
 |
 |
 |
= DisplayDateTime(SHORT_DATE,$arOccurrence[dtbegin]) ?> |
= ($bCorporation)?number_format($arOccurrence[individualhours],2):number_format($arOccurrence[totalhours],2) ?> |
= ($bCorporation)?number_format($arOccurrence[teamhours],2):'' ?> |
= ($bCorporation)?number_format($arOccurrence[sponsoredprojecthours],2):''?> |
 |
 |
$lastIxSpecialEvent = $arOccurrence['ixspecialevent'];
if(!is_array($arTotals)) {
$arTotals = array('totalhours' => 0, 'individualhours' => 0, 'teamhours' => 0, 'sponsoredprojecthours' => 0);
}
$arTotals['totalhours'] += $arOccurrence[totalhours];
$arTotals['individualhours'] += $arOccurrence[individualhours];
$arTotals['teamhours'] += $arOccurrence[teamhours];
$arTotals['sponsoredprojecthours'] += $arOccurrence[sponsoredprojecthours];
}
if ($arTotals):
?>
 |
 |
 |
Total |
= ($bCorporation)?number_format($arTotals['individualhours'],2):number_format($arTotals['totalhours'],2); ?> |
= ($bCorporation)?number_format($arTotals['teamhours'],2):''; ?> |
= ($bCorporation)?number_format($arTotals['sponsoredprojecthours'],2):''; ?> |
 |
 |
endif;
$arTotals = false;
}
?>
 |
 |
 |
 |
 |
 |
 |
|