本文整理汇总了PHP中read_events函数的典型用法代码示例。如果您正苦于以下问题:PHP read_events函数的具体用法?PHP read_events怎么用?PHP read_events使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了read_events函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: substr
$thisday = substr($date, 6, 2);
$startTime = mktime(3, 0, 0, $thismonth, $thisday, $thisyear);
$x = getIntValue("days", true);
if (!empty($x)) {
$numDays = $x;
}
// Don't let a malicious user specify more than 365 days
if ($numDays > 365) {
$numDays = 365;
}
$endTime = mktime(3, 0, 0, $thismonth, $thisday + $numDays, $thisyear);
$endDate = date("Ymd", $endTime);
/* Pre-Load the repeated events for quckier access */
$repeated_events = read_repeated_events($username, $cat_id, $date);
/* Pre-load the non-repeating events for quicker access */
$events = read_events($username, $date, $endDate, $cat_id);
// Print header without custom header and no style sheet
?>
<html>
<head>
<title>Upcoming Events</title>
</head>
<body>
<?php
print "<dl>\n";
print "<!-- \nstartTime: {$startTime}\nendTime: {$endTime}\nstartDate: {$date}\nnumDays: {$numDays}\nuser: {$username}\nevents: " . count($events) . "\nrevents: " . count($revents) . " -->\n";
$numEvents = 0;
for ($i = $startTime; date("Ymd", $i) <= date("Ymd", $endTime) && $numEvents < $maxEvents; $i += 24 * 3600) {
$d = date("Ymd", $i);
$entries = get_entries($username, $d);
$rentries = get_repeating_entries($username, $d);
示例2: substr
$thisday = substr($date, 6, 2);
} else {
$thisday = empty($day) || $day == 0 ? date('d', $today) : $day;
$thismonth = empty($month) || $month == 0 ? date('m', $today) : $month;
$thisyear = empty($year) || $year == 0 ? date('Y', $today) : $year;
}
$next = mktime(0, 0, 0, $thismonth, $thisday + 7, $thisyear);
$prev = mktime(0, 0, 0, $thismonth, $thisday - 7, $thisyear);
$wkstart = get_weekday_before($thisyear, $thismonth, $thisday + 1);
$wkend = $wkstart + 86400 * 6;
$startdate = date('Ymd', $wkstart);
$enddate = date('Ymd', $wkend);
/* Pre-Load the repeated events for quckier access */
$repeated_events = read_repeated_events($login, $startdate, $enddate, '');
/* Pre-load the non-repeating events for quicker access */
$events = read_events($login, $startdate, $enddate);
$first_hour = $WORK_DAY_START_HOUR;
$last_hour = $WORK_DAY_END_HOUR;
$untimed_found = false;
$tmpOut1 = $tmpOut2 = '';
for ($i = 0; $i < 7; $i++) {
$days[$i] = $wkstart + 86400 * $i;
$date = date('Ymd', $days[$i]);
$tmpOut1 .= '
<th style="width: 13%; background: ' . (date('Ymd', $days[$i]) == date('Ymd', $today) ? $TODAYCELLBG : $THBG) . ';">' . weekday_name(($i + $WEEK_START) % 7, $DISPLAY_LONG_DAYS) . '<br />' . month_name(date('m', $days[$i]) - 1, 'M') . ' ' . date('d', $days[$i]) . '</th>';
$tmpOut2 .= '
<td style="vertical-align: top; width: 75px; height: 75px; ' . 'background: ' . ($date == date('Ymd') ? $TODAYCELLBG : $CELLBG) . print_date_entries($date, $login, true, true) . ' </td>';
}
echo '
<table width="100%">
<tr>
示例3: time
}
if (empty($GENERAL_USE_GMT) || $GENERAL_USE_GMT != 'Y') {
$def_tz = $SERVER_TIMEZONE;
}
$startdateTS = time(0, 0, 0);
$enddateTS = $startdateTS + $DAYS_IN_ADVANCE * 86400;
$startdate = date('Ymd', $startdateTS);
$enddate = date('Ymd', $enddateTS);
// Now read all the repeating events (for all users).
$repeated_events = query_events('', true, 'AND ( wer.cal_end >= ' . $startdate . ' OR wer.cal_end IS NULL ) ');
$repcnt = count($repeated_events);
// Read non-repeating events (for all users).
if ($debug) {
echo "Checking for events from date {$startdate} to date {$enddate}.<br />\n";
}
$events = read_events('', $startdateTS, $enddateTS);
$eventcnt = count($events);
if ($debug) {
echo "Checking for tasks from date {$startdate} to date {$enddate}.<br />\n";
}
$tasks = read_tasks('', $enddateTS);
$taskcnt = count($tasks);
if ($debug) {
echo 'Found ' . 0 + $eventcnt + $taskcnt + $repcnt . " events in time range.<br />\n";
}
$is_task = false;
for ($d = 0; $d < $DAYS_IN_ADVANCE; $d++) {
$dateTS = time() + $d * 86400;
$date = date('Ymd', $dateTS);
// Get non-repeating events for this date.
// An event will be included one time for each participant.
示例4: get_user_id
<?php
$private = true;
$alive = false;
$quickstat = false;
$page_title = "Events";
include SERVER_ROOT . "interface/header.php";
$user_id = get_user_id();
$events = get_events($user_id);
read_events($user_id);
// mark events as viewed.
$event_list = '';
if (!empty($events)) {
foreach ($events as $loop_event) {
$loop_event['message'] = out($loop_event['message']);
$event_list .= render_template('single_event.tpl', array('event' => $loop_event));
}
}
if (!$event_list) {
$event_list = 'You have not been attacked recently.';
}
$parts = get_certain_vars(get_defined_vars());
echo render_template('events.tpl', $parts);
include SERVER_ROOT . "interface/footer.php";
示例5: str_replace
$out .= '
<!-- ' . str_replace('XXX ', '', translate('Allowing XXX user to view other users calendar.')) . ' -->';
}
// Make sure this user has enabled email reminders.
// if ( $EMAIL_REMINDER == 'N' ) {
// $out .= str_replace ('XXX', $user,
// translate ( 'Error Email reminders disabled for user XXX.' ) );
// dbi_close ( $c );
// exit;
// }
$startdate = mktime();
$enddate = $startdate + $DAYS_IN_ADVANCE * 86400;
// Now read all the repeating events.
$repeated_events = query_events($user, true, 'AND ( wer.cal_end > ' . $startdate . ' OR wer.cal_end IS NULL ) ');
// Read non-repeating events.
$events = read_events($user, $startdate, $enddate);
if ($WS_DEBUG) {
ws_log_message(str_replace('XXX', count($events), translate('Found XXX events in time range.')));
}
/* Send a reminder for a single event for a single day.
*/
function process_reminder($id, $event_date, $remind_time)
{
global $DISABLE_ACCESS_FIELD, $DISABLE_PARTICIPANTS_FIELD, $DISABLE_PRIORITY_FIELD, $SERVER_URL, $single_user, $single_user_login, $site_extras, $WS_DEBUG;
return '
<reminder>
<remindDate>' . date('Ymd', $remind_time) . '</remindDate>
<remindTime>' . date('Hi', $remind_time) . '</remindTime>
<untilRemind>' . ($remind_time - time()) . '</untilRemind>
' . ws_print_event_xml($id, $event_date) . '
</reminder>
示例6: translate
if ($viewusercnt == 0) {
// This could happen if user_sees_only_his_groups = Y and
// this user is not a member of any group assigned to this view.
$error = translate('No users for this view');
}
if (!empty($error)) {
echo print_error($error) . print_trailer();
exit;
}
$e_save = $re_save = array();
for ($i = 0; $i < $viewusercnt; $i++) {
/* Pre-Load the repeated events for quicker access */
$re_save[$i] = read_repeated_events($viewusers[$i], $wkstart, $wkend, '');
/* Pre-load the non-repeating events for quicker access
subtracting ONE_WEEK to allow cross-dat events to display*/
$e_save[$i] = read_events($viewusers[$i], $wkstart - 604800, $wkend);
}
for ($j = 0; $j < 7; $j += $DAYS_PER_TABLE) {
// Since print_date_entries is rather stupid, we can swap the event data
// around for users by changing what $events points to.
// .
$tdw = 12;
// Column width percent.
echo '
<table class="main">
<tr>
<th class="empty"> </th>';
$body = $header = '';
$todayYmd = date('Ymd', $today);
for ($i = 0; $i < $viewusercnt; $i++) {
$events = $e_save[$i];
示例7: get_weekday_before
$untimed_found = false;
$get_unapproved = $DISPLAY_UNAPPROVED == 'Y';
// .
// Make sure all days with events are bold if mini cal is displayed.
if ($DISPLAY_SM_MONTH == 'Y' && $BOLD_DAYS_IN_YEAR == 'Y') {
$evStart = get_weekday_before($thisyear, $thismonth);
$evEnd = mktime(23, 59, 59, $thismonth + 2, 0, $thisyear);
} else {
$evStart = $wkstart;
$evEnd = $wkend;
}
/* Pre-Load the repeated events for quickier access. */
$repeated_events = read_repeated_events(strlen($user) ? $user : $login, $evStart, $evEnd, $cat_id);
/* Pre-load the non-repeating events for quicker access. */
// Start the search ONE_WEEK early to account for cross-day events.
$events = read_events(strlen($user) ? $user : $login, $evStart - 604800, $evEnd, $cat_id);
if (empty($DISPLAY_TASKS_IN_GRID) || $DISPLAY_TASKS_IN_GRID == 'Y') {
/* Pre-load tasks for quicker access. */
$tasks = read_tasks(!empty($user) && strlen($user) && $is_assistant ? $user : $login, $wkend, $cat_id);
}
$eventsStr = $filler = $headerStr = $minical_tasks = $untimedStr = '';
$navStr = display_navigation('week');
for ($i = $start_ind; $i <= $end_ind; $i++) {
$days[$i] = $wkstart + 86400 * $i + 43200;
$weekdays[$i] = weekday_name(($i + $WEEK_START) % 7, $DISPLAY_LONG_DAYS);
$dateYmd = date('Ymd', $days[$i]);
$header[$i] = $weekdays[$i] . '<br />' . date_to_str($dateYmd, $DATE_FORMAT_MD, false, true);
// .
// Generate header row.
$class = $dateYmd == date('Ymd', $today) ? ' class="today"' : (is_weekend($days[$i]) ? ' class="weekend"' : '');
$headerStr .= '
示例8: array
} else {
$start_ind = 0;
$end_ind = 7;
}
$HeadX = '';
if ($auto_refresh == "Y" && !empty($auto_refresh_time)) {
$refresh = $auto_refresh_time * 60;
// convert to seconds
$HeadX = "<meta http-equiv=\"refresh\" content=\"{$refresh}; url=week_details.php?{$u_url}" . "date={$startdate}{$caturl}\" />\n";
}
$INC = array('js/popups.php');
print_header($INC, $HeadX);
/* Pre-Load the repeated events for quckier access */
$repeated_events = read_repeated_events(strlen($user) ? $user : $login, $cat_id, $startdate);
/* Pre-load the non-repeating events for quicker access */
$events = read_events(strlen($user) ? $user : $login, $startdate, $enddate, $cat_id);
for ($i = 0; $i < 7; $i++) {
$days[$i] = $wkstart + 24 * 3600 * $i;
$weekdays[$i] = weekday_short_name(($i + $WEEK_START) % 7);
$header[$i] = $weekdays[$i] . " " . date_to_str(date("Ymd", $days[$i]), $DATE_FORMAT_MD, false);
}
?>
<div class="title">
<a title="Previous" class="prev" href="week_details.php?<?php
echo $u_url;
?>
date=<?php
echo date("Ymd", $prev) . $caturl;
?>
"><img src="leftarrow.gif" alt="Previous" /></a>
示例9: TimeMatrix
function TimeMatrix($date, $participants)
{
global $CELLBG, $TODAYCELLBG, $THFG, $THBG, $TABLEBG;
global $user_fullname, $nowYmd, $repeated_events, $events;
global $thismonth, $thisday, $thisyear;
$increment = 15;
$interval = 4;
$cell_pix = 6;
$participant_pix = '170';
//$interval = (int)(60 / $increment);
$first_hour = $GLOBALS["WORK_DAY_START_HOUR"];
$last_hour = $GLOBALS["WORK_DAY_END_HOUR"];
$hours = $last_hour - $first_hour;
$cols = $hours * $interval + 1;
$total_pix = (int) ($cell_pix * $interval * $hours + $participant_pix);
?>
<br />
<table class="matrixd" style="width:<?php
echo $total_pix;
?>
px;" cellspacing="0" cellpadding="0">
<tr><td class="matrix" colspan="<?php
echo $cols;
?>
">
<img src="pix.gif" alt="spacer" />
</td></tr>
<tr><th style="width:<?php
echo $participant_pix;
?>
px;">
<?php
etranslate("Participants");
?>
</th>
<?php
$str = '';
$MouseOut = "onmouseout=\"window.status=''; this.style.backgroundColor='" . $CELLBG . "';\"";
$CC = 1;
for ($i = $first_hour; $i < $last_hour; $i++) {
for ($j = 0; $j < $interval; $j++) {
$str .= ' <td style="width:' . $cell_pix . 'px;" id="C' . $CC . '" class="dailymatrix" ';
switch ($j) {
case 0:
if ($interval == 4) {
$k = $i <= 9 ? '0' : substr($i, 0, 1);
}
$str .= 'onmousedown="schedule_event(' . $i . ',' . $increment * $j . ");\" onmouseover=\"window.status='Schedule a " . $i . ':' . ($increment * $j <= 9 ? '0' : '') . $increment * $j . " appointment.'; this.style.backgroundColor='#CCFFCC'; return true;\" " . $MouseOut . " title=\"Schedule an appointment for " . $i . ':' . ($increment * $j <= 9 ? '0' : '') . $increment * $j . ".\">";
$str .= $k . "</td>\n";
break;
case 1:
if ($interval == 4) {
$k = $i <= 9 ? substr($i, 0, 1) : substr($i, 1, 2);
}
$str .= 'onmousedown="schedule_event(' . $i . ',' . $increment * $j . ");\" onmouseover=\"window.status='Schedule a " . $i . ':' . $increment * $j . " appointment.'; this.style.backgroundColor='#CCFFCC'; return true;\" " . $MouseOut . " title=\"Schedule an appointment for " . $i . ':' . ($increment * $j <= 9 ? '0' : '') . $increment * $j . ".\">";
$str .= $k . "</td>\n";
break;
default:
$str .= 'onmousedown="schedule_event(' . $i . ',' . $increment * $j . ");\" onmouseover=\"window.status='Schedule a " . $i . ':' . $increment * $j . " appointment.'; this.style.backgroundColor='#CCFFCC'; return true;\" " . $MouseOut . " title=\"Schedule an appointment for " . $i . ':' . ($increment * $j <= 9 ? '0' : '') . $increment * $j . ".\">";
$str .= " </td>\n";
break;
}
$CC++;
}
}
echo $str . "</tr>\n<tr><td class=\"matrix\" colspan=\"{$cols}\">\n<img src=\"pix.gif\" alt=\"spacer\" />\n</td></tr>\n";
// Display each participant
for ($i = 0; $i < count($participants); $i++) {
user_load_variables($participants[$i], "user_");
/* Pre-Load the repeated events for quckier access */
$repeated_events = read_repeated_events($participants[$i], "", $nowYmd);
/* Pre-load the non-repeating events for quicker access */
$events = read_events($participants[$i], $nowYmd, $nowYmd);
// get all the repeating events for this date and store in array $rep
$rep = get_repeating_entries($participants[$i], $nowYmd);
// get all the non-repeating events for this date and store in $ev
$ev = get_entries($participants[$i], $nowYmd);
// combine into a single array for easy processing
$ALL = array_merge($rep, $ev);
$all_events = array();
// exchange space for to keep from breaking
$user_nospace = preg_replace('/\\s/', ' ', $user_fullname);
foreach ($ALL as $E) {
$E['cal_time'] = sprintf("%06d", $E['cal_time']);
$Tmp['START'] = mktime(substr($E['cal_time'], 0, 2), substr($E['cal_time'], 2, 2), 0, $thismonth, $thisday, $thisyear);
$Tmp['END'] = $Tmp['START'] + $E['cal_duration'] * 60;
$Tmp['ID'] = $E['cal_id'];
$all_events[] = $Tmp;
}
echo "<tr>\n<th class=\"row\" style=\"width:{$participant_pix}px;\">" . $user_nospace . "</th>\n";
$col = 1;
for ($j = $first_hour; $j < $last_hour; $j++) {
for ($k = 0; $k < $interval; $k++) {
$border = $k == '0' ? ' border-left: 1px solid #000000;' : "";
$RC = $CELLBG;
$TIME = mktime(sprintf("%02d", $j), $increment * $k, 0, $thismonth, $thisday, $thisyear);
$space = " ";
foreach ($all_events as $ET) {
if ($TIME >= $ET['START'] && $TIME < $ET['END']) {
//.........这里部分代码省略.........
示例10: read_repeated_events
$refresh = $auto_refresh_time * 60;
// convert to seconds
echo "<META HTTP-EQUIV=\"refresh\" content=\"{$refresh}; URL=day.php?{$u_url}" . "date={$nowYmd}{$caturl}\" TARGET=\"_self\">\n";
}
?>
</HEAD>
<BODY BGCOLOR=<?php
echo "\"{$BGCOLOR}\"";
?>
CLASS="defaulttext">
<?php
/* Pre-Load the repeated events for quckier access */
$repeated_events = read_repeated_events(empty($user) ? $login : $user, $cat_id);
/* Pre-load the non-repeating events for quicker access */
$events = read_events(empty($user) ? $login : $user, $nowYmd, $nowYmd, $cat_id);
?>
<TABLE BORDER="0" WIDTH="100%">
<TR><TD VALIGN="top" WIDTH="70%"><TR><TD>
<TABLE BORDER="0" WIDTH="100%">
<TR>
<?php
if (empty($friendly)) {
?>
<TD VALIGN="left"><A HREF="day.php?<?php
echo $u_url;
?>
date=<?php
echo $prevYmd . $caturl;
?>
示例11: getValue
}
$x = getValue('repeats', '-?[0-9]+', true);
if (!empty($x)) {
$allow_repeats = $x;
if ($x == 2) {
$show_daily_events_only_once = true;
}
}
$endTime = mktime(0, 0, 0, $thismonth, $thisday + $numDays - 1, $thisyear);
$endDate = date('Ymd', $endTime);
/* Pre-Load the repeated events for quicker access */
if ($allow_repeats == true) {
$repeated_events = read_repeated_events($username, $startTime, $endTime, $cat_id);
}
/* Pre-load the non-repeating events for quicker access */
$events = read_events($username, $startTime, $endTime, $cat_id);
$charset = empty($LANGUAGE) ? 'iso-8859-1' : translate('charset');
// This should work ok with RSS, may need to hardcode fallback value.
$lang = languageToAbbrev($LANGUAGE == 'Browser-defined' || $LANGUAGE == 'none' ? $lang : $LANGUAGE);
if ($lang == 'en') {
$lang = 'en-us';
}
//the RSS 2.0 default.
$appStr = generate_application_name();
ob_start();
// header ( 'Content-type: application/rss+xml');
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="' . $charset . '"?>
<rss version="2.0" xml:lang="' . $lang . '">
<channel>
<title><![CDATA[' . $appStr . ']]></title>
示例12: array
// Store in $e_save[] (normal events) and $re_save[] (repeating events).
$e_save = array();
$re_save = array();
if (!$fit_to_window) {
$uwf = $col_pixels . 'px';
} else {
$uwf = sprintf("%0.2f", $tdw / $viewusercnt) . '%';
}
$uheader = '';
for ($i = 0; $i < $viewusercnt; $i++) {
/* Pre-Load the repeated events for quckier access */
$repeated_events = read_repeated_events($viewusers[$i], $wkstart, $wkend, '');
$re_save[$i] = $repeated_events;
/* Pre-load the non-repeating events for quicker access
subtracting ONE_WEEK to allow cross-day events to display*/
$events = read_events($viewusers[$i], $wkstart - ONE_WEEK, $wkend);
$e_save[$i] = $events;
user_load_variables($viewusers[$i], 'temp');
$uheader .= "<th class=\"small\" width=\"{$uwf}\" style=\"width:{$uwf};\">" . $tempfullname . "</th>\n";
//echo "$viewusers[$i]: loaded " . count ( $events ) . " events<br />\n";
}
$num_users = $viewusercnt;
// $TIME_SLOTS is set in both admin system settings and user preferences.
if (empty($TIME_SLOTS)) {
$TIME_SLOTS = 24;
}
$interval = 1440 / $TIME_SLOTS;
$first_slot = (int) ($WORK_DAY_START_HOUR * 60 / $interval);
$last_slot = (int) ($WORK_DAY_END_HOUR * 60 / $interval);
?>
示例13: generate_printer_friendly
$wkend = $wkstart + 86400 * ($DISPLAY_WEEKENDS == 'N' ? 5 : 7);
if ($DISPLAY_WEEKENDS == 'N') {
if ($WEEK_START == 1) {
$end_ind = 4;
} else {
$start_ind = 1;
$end_ind = 5;
}
} else {
$end_ind = 6;
}
$printerStr = generate_printer_friendly('week_details.php');
/* Pre-Load the repeated events for quckier access. */
$repeated_events = read_repeated_events(strlen($user) ? $user : $login, $wkstart, $wkend, $cat_id);
/* Pre-load the non-repeating events for quicker access. */
$events = read_events(strlen($user) ? $user : $login, $wkstart, $wkend, $cat_id);
if ($WEEK_START == 0 && $DISPLAY_WEEKENDS == 'N') {
$wkstart = $wkstart - 86400;
}
for ($i = 0; $i < 7; $i++) {
$days[$i] = $wkstart + 86400 * $i + 43200;
$weekdays[$i] = weekday_name(($i + $WEEK_START) % 7, $DISPLAY_LONG_DAYS);
$header[$i] = $weekdays[$i] . ' ' . date_to_str(date('Ymd', $days[$i]), $DATE_FORMAT_MD, false);
}
$nextStr = translate('Next');
$newEntryStr = translate('New Entry');
$prevStr = translate('Previous');
print_header(array('js/popups.php/true'), generate_refresh_meta());
ob_start();
echo '
<div class="title">
示例14: read_repeated_events
}
if ($year > "1903") {
$prevYear = $year - 1;
} else {
$prevYear = $year;
}
$nextYear = $year + 1;
if ($allow_view_other != "Y" && !$is_admin) {
$user = "";
}
$boldDays = false;
if (!empty($bold_days_in_year) && $bold_days_in_year == 'Y') {
/* Pre-Load the repeated events for quckier access */
$repeated_events = read_repeated_events(!empty($user) && strlen($user) ? $user : $login, $cat_id, $year . "0101");
/* Pre-load the non-repeating events for quicker access */
$events = read_events(!empty($user) && strlen($user) ? $user : $login, $year . "0101", $year . "1231", $cat_id);
$boldDays = true;
}
// Include unapproved events?
$get_unapproved = $DISPLAY_UNAPPROVED == 'Y';
if ($user == "__public__") {
$get_unapproved = false;
}
print_header();
?>
<div class="title">
<a title="<?php
etranslate("Previous");
?>
" class="prev" href="year.php?year=<?php
示例15: daily_matrix
/**
* Draws a daily outlook style availability grid showing events that are
* approved and awaiting approval.
*
* @param string $date Date to show the grid for
* @param array $participants Which users should be included in the grid
* @param string $popup Not used
*/
function daily_matrix($date, $participants, $popup = '')
{
global $CELLBG, $TODAYCELLBG, $THFG, $THBG, $TABLEBG;
global $user_fullname, $repeated_events, $events;
global $WORK_DAY_START_HOUR, $WORK_DAY_END_HOUR, $TZ_OFFSET, $ignore_offset;
$increment = 15;
$interval = 4;
$participant_pct = '20%';
//use percentage
$first_hour = $WORK_DAY_START_HOUR;
$last_hour = $WORK_DAY_END_HOUR;
$hours = $last_hour - $first_hour;
$cols = $hours * $interval + 1;
$total_pct = '80%';
$cell_pct = 80 / ($hours * $interval);
$master = array();
// Build a master array containing all events for $participants
for ($i = 0; $i < count($participants); $i++) {
/* Pre-Load the repeated events for quckier access */
$repeated_events = read_repeated_events($participants[$i], "", $date);
/* Pre-load the non-repeating events for quicker access */
$events = read_events($participants[$i], $date, $date);
// get all the repeating events for this date and store in array $rep
$rep = get_repeating_entries($participants[$i], $date);
// get all the non-repeating events for this date and store in $ev
$ev = get_entries($participants[$i], $date);
// combine into a single array for easy processing
$ALL = array_merge($rep, $ev);
foreach ($ALL as $E) {
if ($E['cal_time'] == 0) {
$E['cal_time'] = $first_hour . "0000";
$E['cal_duration'] = 60 * ($last_hour - $first_hour);
} else {
$E['cal_time'] = sprintf("%06d", $E['cal_time']);
}
$hour = substr($E['cal_time'], 0, 2);
$mins = substr($E['cal_time'], 2, 2);
// Timezone Offset
if (!$ignore_offset) {
$hour += $TZ_OFFSET;
}
while ($hour < 0) {
$hour += 24;
}
while ($hour > 23) {
$hour -= 24;
}
// Make sure hour is 2 digits
$hour = sprintf("%02d", $hour);
// convert cal_time to slot
if ($mins < 15) {
$slot = $hour . '';
} elseif ($mins >= 15 && $mins < 30) {
$slot = $hour . '.25';
} elseif ($mins >= 30 && $mins < 45) {
$slot = $hour . '.5';
} elseif ($mins >= 45) {
$slot = $hour . '.75';
}
// convert cal_duration to bars
$bars = $E['cal_duration'] / $increment;
// never replace 'A' with 'W'
for ($q = 0; $bars > $q; $q++) {
$slot = sprintf("%02.2f", $slot);
if (strlen($slot) == 4) {
$slot = '0' . $slot;
}
// add leading zeros
$slot = $slot . '';
// convert to a string
if (empty($master['_all_'][$slot]) || $master['_all_'][$slot]['stat'] != 'A') {
$master['_all_'][$slot]['stat'] = $E['cal_status'];
}
if (empty($master[$participants[$i]][$slot]) || $master[$participants[$i]][$slot]['stat'] != 'A') {
$master[$participants[$i]][$slot]['stat'] = $E['cal_status'];
$master[$participants[$i]][$slot]['ID'] = $E['cal_id'];
}
$slot = $slot + '0.25';
}
}
}
?>
<br />
<table align="center" class="matrixd" style="width:<?php
echo $total_pct;
?>
;" cellspacing="0" cellpadding="0">
<tr><td class="matrix" colspan="<?php
echo $cols;
?>
"></td></tr>
<tr><th style="width:<?php
//.........这里部分代码省略.........