{$chBox}";
}
if ($set['evtTemplPop']) {
$popText = "{$chBox} {$time} {$evt['tix']}
";
if ($eDetails or $evt['mayE']) {
$popText .= makeE($evt,$set['evtTemplPop'],'br','
');
}
$popText = htmlspecialchars(addslashes($popText));
$popClass = ($evt['pri'] ? 'private' : 'normal').(($evt['mde'] or $evt['r_t']) ? ' repeat' : '');
$popAttr = " onmouseover=\"pop(this,'{$popText}','{$popClass}')\"";
} else {
$popAttr = '';
}
$bgColor = $set['eventColor'] ? $evt['cbg'] : $evt['uco'];
$style = $bgColor ? " style='background-color:{$bgColor};'" : '';
$class = $evt['sym'] ? 'symbol' : 'square';
$class .= ($evt['app'] and !$evt['apd']) ? ' aBorder' : '';
$click = ($evt['mayE'] ? 'editE' : 'showE')."({$evt['eid']},'{$date}')";
$onClick = ($eDetails or $evt['mayE']) ? "class='{$class} point'{$style} onclick=\"{$click};\"" : "class='{$class} arrow'{$style}";
echo "{$evt['sym']}\n";
}
}
//sanity check
if (empty($lcV)) { exit('not permitted ('.substr(basename(__FILE__),0,-4).')'); } //launch via script only
//initialize
$evtList = array();
$daysToShow = $set['XvWeeksToShow'] * 7;
$uxTime = strtotime($opt['cD'].' 12:00:00'); //Unix time of cD
$dayNr = date('w',$uxTime); //0:Su - 6:Sa
//set the start and end date of the calendar period to show
$sTime = $uxTime - ((($dayNr - $set['weekStart'] + 7) % 7) * 86400); //calendar start time
$sDate = date('Y-m-d',$sTime); //cal start date
$eDate = date('Y-m-d',$sTime + (($daysToShow - 1) * 86400)); //cal end date
$prevDate = date("Y-m-d",$sTime - (($daysToShow - 14) * 86400));
$nextDate = date("Y-m-d",$sTime + (($daysToShow) * 86400));
//get users
$filter = ''; //user filter
if (count($opt['cU']) > 0 and $opt['cU'][0] != 0) {
$filter .= "u.`ID` IN (".implode(",",$opt['cU']).") AND ";
}
if (count($opt['cG']) > 0 and $opt['cG'][0] != 0) {
$filter .= "g.`ID` IN (".implode(",",$opt['cG']).") AND ";
}
$stH = dbQuery("SELECT u.`ID`, u.`name`, g.`color`
FROM `users` AS u
INNER JOIN `groups` AS g ON g.`ID` = u.`groupID`
WHERE {$filter}u.`status` >= 0
ORDER BY u.`name`");
$users = $stH->fetchAll(PDO::FETCH_ASSOC); //2-dim array
if (count($users) == 0) {
echo "
{$xx['vws_no_users']}
";
goto end;
}
//retrieve events
retrieve($sDate,$eDate,'guc');
//display header
$dateHdr = ''.makeD($sDate,3)." - ".makeD($eDate,3).'';
$arrowL = "◀";
$arrowR = "▶";
echo "\n
{$arrowL}{$dateHdr}{$arrowR}
\n";
//display matrix - users
echo '\n";
end:
?>