Пример #1
0
$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
0
    $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) . '&nbsp;</td>';
}
echo '
    <table width="100%">
      <tr>
}
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
0
<?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
0
    $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
0
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">&nbsp;</th>';
    $body = $header = '';
    $todayYmd = date('Ymd', $today);
    for ($i = 0; $i < $viewusercnt; $i++) {
        $events = $e_save[$i];
Пример #7
0
$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
0
} 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
0
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 .= "&nbsp;&nbsp;</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 &nbsp; to keep from breaking
        $user_nospace = preg_replace('/\\s/', '&nbsp;', $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 = "&nbsp;";
                foreach ($all_events as $ET) {
                    if ($TIME >= $ET['START'] && $TIME < $ET['END']) {
                        $space = "<a class=\"matrix\" href=\"view_entry.php?id={$ET['ID']}\"><img src=\"pix.gif\" alt=\"spacer\" /></a>";
                    }
                }
                echo "\t<td class=\"matrixappts\" style=\"width:{$cell_pix}px;{$border}\">{$space}</td>\n";
                $col++;
            }
        }
        echo "</tr><tr>\n<td class=\"matrix\" colspan=\"{$cols}\"><img src=\"pix.gif\" alt=\"spacer\" /></td></tr>\n";
    }
    // End foreach participant
    echo "</table>\n";
}
Пример #10
0
    $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
0
}
$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
0
// 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
0
$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
0
}
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
0
/**
 * 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 
    echo $participant_pct;
    ?>
;">
    <?php 
    etranslate("Participants");
    ?>
</th>
<?php 
    $str = '';
    $MouseOut = "onmouseout=\"window.status=''; this.style.backgroundColor='" . $THBG . "';\"";
    $CC = 1;
    for ($i = $first_hour; $i < $last_hour; $i++) {
        $hour = $i;
        if ($GLOBALS["TIME_FORMAT"] == "12") {
            $hour %= 12;
            if ($hour == 0) {
                $hour = 12;
            }
        }
        for ($j = 0; $j < $interval; $j++) {
            $str .= ' <td  id="C' . $CC . '" class="dailymatrix" ';
            $MouseDown = 'onmousedown="schedule_event(' . $i . ',' . sprintf("%02d", $increment * $j) . ');"';
            switch ($j) {
                case 1:
                    if ($interval == 4) {
                        $k = $hour <= 9 ? '0' : substr($hour, 0, 1);
                    }
                    $str .= 'style="width:' . $cell_pct . '%; text-align:right;"  ' . $MouseDown . " onmouseover=\"window.status='Schedule a " . $hour . ':' . ($increment * $j <= 9 ? '0' : '') . $increment * $j . " appointment.'; this.style.backgroundColor='#CCFFCC'; return true;\" " . $MouseOut . " title=\"Schedule an appointment for " . $hour . ':' . ($increment * $j <= 9 ? '0' : '') . $increment * $j . ".\">";
                    $str .= $k . "</td>\n";
                    break;
                case 2:
                    if ($interval == 4) {
                        $k = $hour <= 9 ? substr($hour, 0, 1) : substr($hour, 1, 2);
                    }
                    $str .= 'style="width:' . $cell_pct . '%; text-align:left;" ' . $MouseDown . " onmouseover=\"window.status='Schedule a " . $hour . ':' . $increment * $j . " appointment.'; this.style.backgroundColor='#CCFFCC'; return true;\" " . $MouseOut . " title=\"Schedule an appointment for " . $hour . ':' . ($increment * $j <= 9 ? '0' : '') . $increment * $j . ".\">";
                    $str .= $k . "</td>\n";
                    break;
                default:
                    $str .= 'style="width:' . $cell_pct . '%;" ' . $MouseDown . " onmouseover=\"window.status='Schedule a " . $hour . ':' . ($increment * $j <= 9 ? '0' : '') . $increment * $j . " appointment.'; this.style.backgroundColor='#CCFFCC'; return true;\" " . $MouseOut . " title=\"Schedule an appointment for " . $hour . ':' . ($increment * $j <= 9 ? '0' : '') . $increment * $j . ".\">";
                    $str .= "&nbsp;&nbsp;</td>\n";
                    break;
            }
            $CC++;
        }
    }
    echo $str . "</tr>\n<tr><td class=\"matrix\" colspan=\"{$cols}\"></td></tr>\n";
    // Add user _all_ to beginning of $participants array
    array_unshift($participants, '_all_');
    // Javascript for cells
    $MouseOver = "onmouseover=\"this.style.backgroundColor='#CCFFCC';\"";
    $MouseOut = "onmouseout=\"this.style.backgroundColor='" . $CELLBG . "';\"";
    // Display each participant
    for ($i = 0; $i < count($participants); $i++) {
        if ($participants[$i] != '_all_') {
            // Load full name of user
            user_load_variables($participants[$i], "user_");
            // exchange space for &nbsp; to keep from breaking
            $user_nospace = preg_replace('/\\s/', '&nbsp;', $user_fullname);
        } else {
            $user_nospace = translate("All Attendees");
            $user_nospace = preg_replace('/\\s/', '&nbsp;', $user_nospace);
        }
        echo "<tr>\n<th class=\"row\" style=\"width:{$participant_pct};\">" . $user_nospace . "</th>\n";
        $col = 1;
        $viewMsg = translate("View this entry");
        // check each timebar
        for ($j = $first_hour; $j < $last_hour; $j++) {
            for ($k = 0; $k < $interval; $k++) {
                $border = $k == '0' ? ' border-left: 1px solid #000000;' : "";
                $MouseDown = 'onmousedown="schedule_event(' . $j . ',' . sprintf("%02d", $increment * $k) . ');"';
                $RC = $CELLBG;
                //$space = '';
                $space = "&nbsp;";
                $r = sprintf("%02d", $j) . '.' . sprintf("%02d", 25 * $k) . '';
                if (empty($master[$participants[$i]][$r])) {
                    // ignore this..
                } else {
                    if (empty($master[$participants[$i]][$r]['ID'])) {
                        // This is the first line for 'all' users.  No event here.
                        $space = "<span class=\"matrix\"><img src=\"pix.gif\" alt=\"\" style=\"height: 8px\" /></span>";
                    } else {
                        if ($master[$participants[$i]][$r]['stat'] == "A") {
                            $space = "<a class=\"matrix\" href=\"view_entry.php?id={$master[$participants[$i]][$r]['ID']}\"><img src=\"pix.gif\" title=\"{$viewMsg}\" alt=\"{$viewMsg}\" /></a>";
                        } else {
                            if ($master[$participants[$i]][$r]['stat'] == "W") {
                                $space = "<a class=\"matrix\" href=\"view_entry.php?id={$master[$participants[$i]][$r]['ID']}\"><img src=\"pixb.gif\" title=\"{$viewMsg}\" alt=\"{$viewMsg}\" /></a>";
                            }
                        }
                    }
                }
                echo "<td class=\"matrixappts\" style=\"width:{$cell_pct}%;{$border}\" ";
                if ($space == "&nbsp;") {
                    echo "{$MouseDown} {$MouseOver} {$MouseOut}";
                }
                echo ">{$space}</td>\n";
                $col++;
            }
        }
        echo "</tr><tr>\n<td class=\"matrix\" colspan=\"{$cols}\">" . "<img src=\"pix.gif\" alt=\"-\" /></td></tr>\n";
    }
    // End foreach participant
    echo "</table><br />\n";
    $busy = translate("Busy");
    $tentative = translate("Tentative");
    echo "<table align=\"center\"><tr><td class=\"matrixlegend\" >\n";
    echo "<img src=\"pix.gif\" title=\"{$busy}\" alt=\"{$busy}\" /> {$busy} &nbsp; &nbsp; &nbsp;\n";
    echo "<img src=\"pixb.gif\" title=\"{$tentative}\" alt=\"{$tentative}\" /> {$tentative}\n";
    echo "</td></tr></table>\n";
}
<?php

include 'connect.php';
$conect = connect_acc();
$user_num = $_POST['USER_NUM'];
$name = "";
if ($_POST['call'] == 0) {
    read_events($user_num, $conect);
} else {
    $name = $_POST['name'];
    delete_event($user_num, $name, $conect);
}
function read_events($user_num, $conect)
{
    if ($result = $conect->query("SELECT * FROM `event` WHERE `USER_#`='{$user_num}'")) {
        if ($result->num_rows > 0) {
            while ($row = $result->fetch_assoc()) {
                echo $row["EVENT_NAME"] . "!" . $row["PRIORTY"] . "!" . $row["TIME_END"] . "!" . $row["TIME_BEGIN"] . "!" . $row["DAY"] . "!" . $row["BUFF_BEGIN"] . "!" . $row["BUFF_END"] . "~";
            }
        }
    } else {
        die('Error: Failed to Connect');
    }
}
function delete_event($user_num, $name, $conect)
{
    $day = $_POST['day'];
    if ($conect->query("DELETE FROM `event` WHERE `USER_#`='{$user_num}' AND `EVENT_NAME`=\"{$name}\" AND `DAY`=\"{$day}\"")) {
        echo "Succesfully Deleted Entry.";
    } else {
        echo "Error occurred when deleting entry.";
function daily_matrix($date, $participants, $popup = '')
{
    global $CELLBG, $ENTRY_SLOTS, $events, $repeated_events, $TABLEBG, $THBG, $THFG, $thismonth, $thisyear, $TIME_FORMAT, $TODAYCELLBG, $user_fullname, $WORK_DAY_END_HOUR, $WORK_DAY_START_HOUR;
    $allAttendeesStr = translate('All Attendees');
    $busy = translate('Busy');
    $cnt = count($participants);
    $dateTS = date_to_epoch($date);
    $first_hour = $WORK_DAY_START_HOUR;
    $increment = intval(1440 / ($ENTRY_SLOTS > 288 ? 288 : ($ENTRY_SLOTS < 72 ? 72 : $ENTRY_SLOTS)));
    $last_hour = $WORK_DAY_END_HOUR;
    $master = array();
    $MouseOut = $MouseOver = $str = '';
    $participant_pct = '20%';
    //Use percentage.
    $tentative = translate('Tentative');
    // translate ( 'Schedule an appointment for' )
    $titleStr = ' title="' . translate('Schedule an appointment for XXX.') . '">';
    $viewMsg = translate('View this entry');
    $hours = $last_hour - $first_hour;
    $interval = intval(60 / $increment);
    $cell_pct = intval(80 / ($hours * $interval));
    $style_width = $cell_pct > 0 ? 'style="width:' . $cell_pct . '%;"' : '';
    $thismonth = date('m', $dateTS);
    $thisyear = date('Y', $dateTS);
    $cols = $hours * $interval + 1;
    $ret = <<<EOT
    <br />
    <table align="center" class="matrixd" style="width:'80%';" cellspacing="0"
      cellpadding="0">
      <tr>
        <td class="matrix" colspan="{$cols}"></td>
      </tr>
      <tr>
        <th style="width:{$participant_pct};">
EOT;
    $ret .= translate('Participants') . '</th>';
    $tentative = translate('Tentative');
    // translate ( 'Schedule an appointment for' )
    $titleStr = ' title="' . translate('Schedule an appointment for XXX.') . '">';
    $viewMsg = translate('View this entry');
    $hours = $last_hour - $first_hour;
    $interval = intval(60 / $increment);
    $cell_pct = intval(80 / ($hours * $interval));
    $cols = $hours * $interval + 1;
    $style_width = $cell_pct > 0 ? 'style="width:' . $cell_pct . '%;"' : '';
    $thismonth = date('m', $dateTS);
    $thisyear = date('Y', $dateTS);
    // Build a master array containing all events for $participants.
    for ($i = 0; $i < $cnt; $i++) {
        /* Pre-Load the repeated events for quckier access. */
        $repeated_events = read_repeated_events($participants[$i], $dateTS, $dateTS, '');
        /* Pre-load the non-repeating events for quicker access. */
        $events = read_events($participants[$i], $dateTS, $dateTS);
        // Combine events for this date into a single array for easy processing.
        $ALL = array_merge(get_repeating_entries($participants[$i], $date), get_entries($date));
        foreach ($ALL as $E) {
            if ($E->getTime() == 0) {
                $duration = 60 * $hours;
                $time = $first_hour . '0000';
            } else {
                $duration = $E->getDuration();
                $time = date('His', $E->getDateTimeTS());
            }
            $hour = substr($time, 0, 2);
            $mins = substr($time, 2, 2);
            // Convert cal_time to slot.
            $slot = $hour + substr($mins, 0, 1);
            // Convert cal_duration to bars.
            $bars = $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->getStatus();
                }
                if (empty($master[$participants[$i]][$slot]) || $master[$participants[$i]][$slot]['stat'] != 'A') {
                    $master[$participants[$i]][$slot]['stat'] = $E->getStatus();
                    $master[$participants[$i]][$slot]['ID'] = $E->getID();
                }
                $slot = $slot + $increment * 0.01;
                if ($slot - (int) $slot >= 0.59) {
                    $slot = (int) $slot + 1;
                }
            }
        }
    }
    for ($i = $first_hour; $i < $last_hour; $i++) {
        $hour = $i;
        if ($TIME_FORMAT == '12') {
            $hour %= 12;
            if ($hour == 0) {
                $hour = 12;
            }
            $hourfmt = '%d';
        } else {
            $hourfmt = '%02d';
        }
        $halfway = intval($interval / 2 - 1);
        for ($j = 0; $j < $interval; $j++) {
            $inc_x_j = $increment * $j;
            $str .= '
        <td id="C' . ($j + 1) . '" class="dailymatrix" ';
            $tmpTitle = 'onmousedown="schedule_event( ' . $i . ',' . sprintf("%02d", $inc_x_j) . ' );"' . $MouseOver . $MouseOut . str_replace('XXX', sprintf($hourfmt, $hour) . ':' . ($inc_x_j <= 9 ? '0' : '') . $inc_x_j, $titleStr);
            switch ($j) {
                case $halfway:
                    $k = $hour <= 9 ? '0' : substr($hour, 0, 1);
                    $str .= 'style="width:' . $cell_pct . '%; text-align:right;" ' . $tmpTitle . $k . '</td>';
                    break;
                case $halfway + 1:
                    $k = $hour <= 9 ? substr($hour, 0, 1) : substr($hour, 1, 2);
                    $str .= 'style="width:' . $cell_pct . '%; text-align:left;" ' . $tmpTitle . $k . '</td>';
                    break;
                default:
                    $str .= $style_width . $tmpTitle . '&nbsp;&nbsp;</td>';
            }
        }
    }
    $ret .= $str . '
      </tr>
      <tr>
        <td class="matrix" colspan="' . $cols . '"></td>
      </tr>';
    // Add user _all_ to beginning of $participants array.
    array_unshift($participants, '_all_');
    // Javascript for cells.
    // Display each participant.
    for ($i = 0; $i <= $cnt; $i++) {
        if ($participants[$i] != '_all_') {
            // Load full name of user.
            user_load_variables($participants[$i], 'user_');
            // Exchange space for &nbsp; to keep from breaking.
            $user_nospace = preg_replace('/\\s/', '&nbsp;', $user_fullname);
        } else {
            $user_nospace = preg_replace('/\\s/', '&nbsp;', $allAttendeesStr);
        }
        $ret .= '
      <tr>
        <th class="row" style="width:' . $participant_pct . ';">' . $user_nospace . '</th>';
        $col = 1;
        // Check each timebar.
        for ($j = $first_hour; $j < $last_hour; $j++) {
            for ($k = 0; $k < $interval; $k++) {
                $r = sprintf("%02d", $j) . '.' . sprintf("%02d", $increment * $k) . '';
                $space = '&nbsp;';
                if (empty($master[$participants[$i]][$r])) {
                    // Ignore this..
                } else {
                    if (empty($master[$participants[$i]][$r]['ID'])) {
                        // This is the first line for 'all' users. No event here.
                        $space = '
          <span class="matrix"><img src="images/pix.gif" alt="" /></span>';
                    } else {
                        $tmpMast = $master[$participants[$i]][$r]['stat'];
                        if (strpos('AW', $tmpMast) !== false) {
                            $space = '
          <a class="matrix" href="view_entry.php?id=' . $master[$participants[$i]][$r]['ID'] . '&friendly=1"><img src="images/pix' . ($tmpMast = 'A' ? '' : 'b') . '.gif" title="' . $viewMsg . '" alt="' . $viewMsg . '" /></a>';
                        }
                    }
                }
                $ret .= '
        <td class="matrixappts' . ($k == '0' ? ' matrixledge' : '') . '" ' . $style_width . ($space == '&nbsp;' ? ' ' . 'onmousedown="schedule_event( ' . $j . ',' . sprintf("%02d", $increment * $k) . ' );"' . " {$MouseOver} {$MouseOut}" : '') . '>' . $space . '</td>';
                $col++;
            }
        }
        $ret .= '
      </tr>
      <tr>
        <td class="matrix" colspan="' . $cols . '"><img src="images/pix.gif" alt="-" /></td>
      </tr>';
    }
    // End foreach participant.
    return $ret . <<<EOT
    </table><br />
    <table align="center">
      <tr>
        <td class="matrixlegend" ><img src="images/pix.gif" title="{$busy}"
          alt="{$busy}" />{$busy}&nbsp;&nbsp;&nbsp;<img src="images/pixb.gif"
          title="{$tentative}" alt="{$tentative}" />{$tentative}</td>
      </tr>
    </table>
EOT;
}
Пример #18
0
        $tzoffset[$user] = $user_tzoffset;
        if ($debug) {
            echo "TZ OFFSET for {$user} is \"{$user_tzoffset}\" <br />\n";
        }
    }
    dbi_free_result($res);
}
$startdate = date("Ymd");
$enddate = date("Ymd", time() + $DAYS_IN_ADVANCE * 24 * 3600);
// Now read events all the repeating events (for all users)
$repeated_events = query_events("", true, "AND (webcal_entry_repeats.cal_end > {$startdate} OR webcal_entry_repeats.cal_end IS NULL) ");
// Read non-repeating events (for all users)
if ($debug) {
    echo "Checking for events from date {$startdate} to date {$enddate} <br />\n";
}
$events = read_events("", $startdate, $enddate);
if ($debug) {
    echo "Found " . count($events) . " events in time range. <br />\n";
}
function indent($str)
{
    return "  " . str_replace("\n", "\n  ", $str);
}
// Send a reminder for a single event for a single day to all
// participants in the event.
// Send to participants who have accepted as well as those who have not yet
// approved.  But, don't send to users how rejected (cal_status='R').
function send_reminder($id, $event_date)
{
    global $names, $emails, $site_extras, $debug, $only_testing, $server_url, $languages, $tzoffset, $application_name;
    global $EXTRA_TEXT, $EXTRA_MULTILINETEXT, $EXTRA_URL, $EXTRA_DATE, $EXTRA_EMAIL, $EXTRA_USER, $EXTRA_REMINDER, $LANGUAGE, $LOG_REMINDER;
Пример #19
0
$enddate = getValue('enddate');
if (empty($startdate)) {
    $startdate = date('Ymd');
}
if (empty($enddate)) {
    $enddate = $startdate;
}
// Now read all the repeating events (for all users).
$repeated_events = query_events($user, true, 'AND ( wer.cal_end > ' . $startdate . ' OR wer.cal_end IS NULL ) ');
// Read non-repeating events (for all users).
if ($WS_DEBUG) {
    $out .= '
<!-- ' . str_replace('XXX', array($user, $startdate, $enddate), translate('Checking for events for XXX from date XXX to date XXX.')) . ' -->
';
}
$events = read_events($user, date_to_epoch($startdate), date_to_epoch($enddate));
if ($WS_DEBUG) {
    $out .= '
<!-- ' . str_replace('XXX', count($events), translate('Found XXX events in time range.')) . ' -->
';
}
/* Process an event for a single day. Check to see if it has a reminder,
 * when it needs to be sent and when the last time it was sent.
 */
function process_event($id, $name, $event_date, $event_time)
{
    global $out, $WS_DEBUG;
    if ($WS_DEBUG) {
        ws_log_message(str_replace('XXX', array($id, $name, $event_time, $event_date), translate('Event id=XXX XXX at XXX on XXX.')));
    }
    return ws_print_event_xml($id, $event_date);
Пример #20
0
$enddate = sprintf("%04d%02d31", $thisyear, $thismonth);
$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=day.php?{$u_url}" . "date={$nowYmd}{$caturl}" . (!empty($friendly) ? "&amp;friendly=1" : "") . "\" />\n";
}
$INC = array('js/popups.php');
print_header($INC, $HeadX);
?>

<?php 
/* Pre-Load the repeated events for quckier access */
$repeated_events = read_repeated_events(empty($user) ? $login : $user, $cat_id, $startdate);
/* Pre-load the non-repeating events for quicker access */
$events = read_events(empty($user) ? $login : $user, $startdate, $enddate, $cat_id);
?>

<table>
<tr><td style="vertical-align:top; width:82%;">
<div style="border-width:0px;">
<a title="<?php 
etranslate("Next");
?>
" class="next" href="day.php?<?php 
echo $u_url;
?>
date=<?php 
echo $nextYmd . $caturl;
?>
"><img src="rightarrow.gif" alt="<?php 
Пример #21
0
                            $end_date = date("Ymd", $end);
                        } else {
                            // Programmer's bug (no translation needed)
                            echo "Invalid cal_time_range setting for report id {$report_id}";
                            exit;
                        }
                    }
                }
            }
        }
    }
}
if (empty($error) && empty($list)) {
    $cat_id = empty($report_cat_id) ? "" : $report_cat_id;
    $repeated_events = read_repeated_events($report_user, $cat_id, $start_date);
    $events = read_events($report_user, $start_date, $end_date, $cat_id);
    $get_unapproved = $DISPLAY_UNAPPROVED == 'Y';
    if ($report_user == "__public__") {
        $get_unapproved = false;
    }
    //echo "User: $report_user <br />\n";
    //echo "Date Range: $start_date - $end_date <br /><br />\n";
    $start_year = substr($start_date, 0, 4);
    $start_month = substr($start_date, 4, 2);
    $start_day = substr($start_date, 6, 2);
    $start_time = mktime(3, 0, 0, $start_month, $start_day, $start_year);
    $end_year = substr($end_date, 0, 4);
    $end_month = substr($end_date, 4, 2);
    $end_day = substr($end_date, 6, 2);
    $end_time = mktime(3, 0, 0, $end_month, $end_day, $end_year);
    $day_str = '';
Пример #22
0
    // this user is not a member of any  group assigned to this view
    $error = translate("No users for this view");
}
if (!empty($error)) {
    echo "<h2>" . translate("Error") . "</h2>\n" . $error;
    print_trailer();
    exit;
}
$e_save = array();
$re_save = array();
for ($i = 0; $i < count($viewusers); $i++) {
    /* Pre-Load the repeated events for quckier access */
    $repeated_events = read_repeated_events($viewusers[$i], "", $startdate);
    $re_save[$i] = $repeated_events;
    /* Pre-load the non-repeating events for quicker access */
    $events = read_events($viewusers[$i], $startdate, $enddate);
    $e_save[$i] = $events;
}
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
    ?>

<table class="main" cellspacing="0" cellpadding="0">
<tr><th class="empty">&nbsp;</th>
<?php 
    for ($date = $wkstart, $h = 0; date("Ymd", $date) <= date("Ymd", $wkend); $date += 24 * 3600, $h++) {
        $wday = strftime("%w", $date);
        $weekday = weekday_short_name($wday);
Пример #23
0
}
load_user_preferences();
user_load_variables($login, 'minical_');
if ($user != '__public__' && !nonuser_load_variables($login, 'minica_')) {
    die_miserable_death(str_replace('XXX', $login, translate('No such nonuser calendar XXX.')));
}
if ($user != '__public__' && (empty($minical_is_public) || $minical_is_public != 'Y')) {
    die_miserable_death(translate('This Calendar is not Public.'));
}
$next = mktime(0, 0, 0, $thismonth + 1, 1, $thisyear);
$nextmonth = date('m', $next);
$nextyear = date('Y', $next);
$prev = mktime(0, 0, 0, $thismonth - 1, 1, $thisyear);
$prevmonth = date('m', $prev);
$prevyear = date('Y', $prev);
$boldDays = true;
$startdate = mktime(0, 0, 0, $thismonth, 0, $thisyear);
$enddate = mktime(23, 59, 59, $thismonth + 1, 0, $thisyear);
// Don't display custom header.
print_header('', generate_refresh_meta(), '', true);
/* Pre-Load the repeated events for quicker access. */
$repeated_events = read_repeated_events($user, $startdate, $enddate, $cat_id);
/* Pre-load the non-repeating events for quicker access. */
$events = read_events($user, $startdate, $enddate, $cat_id);
echo display_small_month($thismonth, $thisyear, true, false);
// Reset...just in case.
$login = '';
?>
  </body>
</html>