• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_repeating_entries函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_repeating_entries函数的典型用法代码示例。如果您正苦于以下问题:PHP get_repeating_entries函数的具体用法?PHP get_repeating_entries怎么用?PHP get_repeating_entries使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_repeating_entries函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: print_date_entries_timebar

function print_date_entries_timebar($date, $user, $ssi)
{
    global $DISPLAY_UNAPPROVED, $events, $is_admin, $PUBLIC_ACCESS, $PUBLIC_ACCESS_CAN_ADD, $readonly, $totalSlots;
    $ret = '';
    $cnt = 0;
    $get_unapproved = $DISPLAY_UNAPPROVED == 'Y';
    $year = substr($date, 0, 4);
    $month = substr($date, 4, 2);
    $day = substr($date, 6, 2);
    $can_add = $readonly == 'N' || $is_admin;
    if ($PUBLIC_ACCESS == 'Y' && $PUBLIC_ACCESS_CAN_ADD != 'Y' && $GLOBALS['login'] == '__public__') {
        $can_add = false;
    }
    $cur_rep = 0;
    // Combine and sort the event arrays.
    $ev = combine_and_sort_events(get_entries($date, $get_unapproved), get_repeating_entries($user, $date));
    $evcnt = count($ev);
    for ($i = 0; $i < $evcnt; $i++) {
        if ($get_unapproved || $ev[$i]->getStatus() == 'A') {
            $ret .= print_entry_timebar($ev[$i], $date);
            $cnt++;
        }
    }
    return $ret . ($cnt == 0 ? '
            <tr>
              <td colspan="' . $totalSlots . '">&nbsp;</td>
            </tr>' : '');
}
开发者ID:rhertzog,项目名称:lcs,代码行数:28,代码来源:view_t.php


示例2: print_date_entries_timebar

function print_date_entries_timebar($date, $user, $hide_icons, $ssi)
{
    global $events, $readonly, $is_admin, $public_access, $public_access_can_add;
    $cnt = 0;
    $get_unapproved = $GLOBALS["DISPLAY_UNAPPROVED"] == "Y";
    // public access events always must be approved before being displayed
    if ($GLOBALS["login"] == "__public__") {
        $get_unapproved = false;
    }
    $year = substr($date, 0, 4);
    $month = substr($date, 4, 2);
    $day = substr($date, 6, 2);
    $dateu = mktime(3, 0, 0, $month, $day, $year);
    $can_add = $readonly == "N" || $is_admin;
    if ($public_access == "Y" && $public_access_can_add != "Y" && $GLOBALS["login"] == "__public__") {
        $can_add = false;
    }
    // get all the repeating events for this date and store in array $rep
    $rep = get_repeating_entries($users[$i], $date);
    $cur_rep = 0;
    // get all the non-repeating events for this date and store in $ev
    $ev = get_entries($users[$i], $date);
    for ($i = 0; $i < count($ev); $i++) {
        // print out any repeating events that are before this one...
        while ($cur_rep < count($rep) && $rep[$cur_rep]['cal_time'] < $ev[$i]['cal_time']) {
            if ($get_unapproved || $rep[$cur_rep]['cal_status'] == 'A') {
                print_entry_timebar($rep[$cur_rep]['cal_id'], $date, $rep[$cur_rep]['cal_time'], $rep[$cur_rep]['cal_duration'], $rep[$cur_rep]['cal_name'], $rep[$cur_rep]['cal_description'], $rep[$cur_rep]['cal_status'], $rep[$cur_rep]['cal_priority'], $rep[$cur_rep]['cal_access'], $rep[$cur_rep]['cal_login'], $hide_icons);
                $cnt++;
            }
            $cur_rep++;
        }
        if ($get_unapproved || $ev[$i]['cal_status'] == 'A') {
            print_entry_timebar($ev[$i]['cal_id'], $date, $ev[$i]['cal_time'], $ev[$i]['cal_duration'], $ev[$i]['cal_name'], $ev[$i]['cal_description'], $ev[$i]['cal_status'], $ev[$i]['cal_priority'], $ev[$i]['cal_access'], $ev[$i]['cal_login'], $hide_icons);
            $cnt++;
        }
    }
    // print out any remaining repeating events
    while ($cur_rep < count($rep)) {
        if ($get_unapproved || $rep[$cur_rep]['cal_status'] == 'A') {
            print_entry_timebar($rep[$cur_rep]['cal_id'], $date, $rep[$cur_rep]['cal_time'], $rep[$cur_rep]['cal_duration'], $rep[$cur_rep]['cal_name'], $rep[$cur_rep]['cal_description'], $rep[$cur_rep]['cal_status'], $rep[$cur_rep]['cal_priority'], $rep[$cur_rep]['cal_access'], $rep[$cur_rep]['cal_login'], $hide_icons);
            $cnt++;
        }
        $cur_rep++;
    }
    if ($cnt == 0) {
        echo "&nbsp;";
    }
    // so the table cell has at least something
}
开发者ID:neuroidss,项目名称:virtuoso-opensource,代码行数:49,代码来源:functions.php


示例3: date

    $date = date('Ymd', time() + $d * 86400);
    // echo "Date: $date\n";
    // Get non-repeating events for this date.
    // An event will be included one time for each participant.
    $ev = get_entries($date);
    // Keep track of duplicates.
    $completed_ids = array();
    for ($i = 0, $evCnt = count($ev); $i < $evCnt; $i++) {
        $id = $ev[$i]->getID();
        if (!empty($completed_ids[$id])) {
            continue;
        }
        $completed_ids[$id] = 1;
        $out .= process_event($id, $ev[$i]->getName(), $date, $ev[$i]->getTime());
    }
    $rep = get_repeating_entries($user, $date);
    for ($i = 0, $repCnt = count($rep); $i < $repCnt; $i++) {
        $id = $rep[$i]->getID();
        if (!empty($completed_ids[$id])) {
            continue;
        }
        $completed_ids[$id] = 1;
        $out .= process_event($id, $rep[$i]->getName(), $date, $rep[$i]->getTime());
    }
}
$out .= '
</reminders>
';
// If web service debugging is on...
if (!empty($WS_DEBUG) && $WS_DEBUG) {
    ws_log_message($out);
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:get_reminders.php


示例4: time

$startdate = time();
// today
for ($d = 0; $d < $DAYS_IN_ADVANCE; $d++) {
    $date = date("Ymd", time() + $d * 24 * 3600);
    //echo "Date: $date\n";
    // Get non-repeating events for this date.
    // An event will be included one time for each participant.
    $ev = get_entries("", $date);
    // Keep track of duplicates
    $completed_ids = array();
    for ($i = 0; $i < count($ev); $i++) {
        $id = $ev[$i]['cal_id'];
        if (!empty($completed_ids[$id])) {
            continue;
        }
        $completed_ids[$id] = 1;
        process_event($id, $ev[$i]['cal_name'], $date, $ev[$i]['cal_time']);
    }
    $rep = get_repeating_entries("", $date);
    for ($i = 0; $i < count($rep); $i++) {
        $id = $rep[$i]['cal_id'];
        if (!empty($completed_ids[$id])) {
            continue;
        }
        $completed_ids[$id] = 1;
        process_event($id, $rep[$i]['cal_name'], $date, $rep[$i]['cal_time']);
    }
}
if ($debug) {
    echo "Done.<br />\n";
}
开发者ID:rohcehlam,项目名称:rflow,代码行数:31,代码来源:send_reminders.php


示例5: print_det_date_entries

function print_det_date_entries($date, $user, $ssi)
{
    global $events, $readonly, $is_admin;
    $year = substr($date, 0, 4);
    $month = substr($date, 4, 2);
    $day = substr($date, 6, 2);
    $dateu = mktime(2, 0, 0, $month, $day, $year);
    // get all the repeating events for this date and store in array $rep
    $rep = get_repeating_entries($user, $date);
    $cur_rep = 0;
    // get all the non-repeating events for this date and store in $ev
    $ev = get_entries($user, $date);
    for ($i = 0; $i < count($ev); $i++) {
        // print out any repeating events that are before this one...
        while ($cur_rep < count($rep) && $rep[$cur_rep]['cal_time'] < $ev[$i]['cal_time']) {
            if ($GLOBALS["DISPLAY_UNAPPROVED"] != "N" || $rep[$cur_rep]['cal_status'] == 'A') {
                print_detailed_entry($rep[$cur_rep]['cal_id'], $date, $rep[$cur_rep]['cal_time'], $rep[$cur_rep]['cal_duration'], $rep[$cur_rep]['cal_name'], $rep[$cur_rep]['cal_description'], $rep[$cur_rep]['cal_status'], $rep[$cur_rep]['cal_priority'], $rep[$cur_rep]['cal_access'], $rep[$cur_rep]['cal_login']);
            }
            $cur_rep++;
        }
        if ($GLOBALS["DISPLAY_UNAPPROVED"] != "N" || $ev[$i]['cal_status'] == 'A') {
            print_detailed_entry($ev[$i]['cal_id'], $date, $ev[$i]['cal_time'], $ev[$i]['cal_duration'], $ev[$i]['cal_name'], $ev[$i]['cal_description'], $ev[$i]['cal_status'], $ev[$i]['cal_priority'], $ev[$i]['cal_access'], $ev[$i]['cal_login']);
        }
    }
    // print out any remaining repeating events
    while ($cur_rep < count($rep)) {
        if ($GLOBALS["DISPLAY_UNAPPROVED"] != "N" || $rep[$cur_rep]['cal_status'] == 'A') {
            print_detailed_entry($rep[$cur_rep]['cal_id'], $date, $rep[$cur_rep]['cal_time'], $rep[$cur_rep]['cal_duration'], $rep[$cur_rep]['cal_name'], $rep[$cur_rep]['cal_description'], $rep[$cur_rep]['cal_status'], $rep[$cur_rep]['cal_priority'], $rep[$cur_rep]['cal_access'], $rep[$cur_rep]['cal_login']);
        }
        $cur_rep++;
    }
}
开发者ID:BackupTheBerlios,项目名称:fhnreposit,代码行数:32,代码来源:week_details.php


示例6: read_events

$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);
    print "<!-- {$d} " . count($entries) . "/" . count($rentries) . " -->\n";
    if (count($entries) > 0 || count($rentries) > 0) {
        print "<!-- XXX -->\n";
        print "<dt>" . date_to_str($d) . "</dt>\n<dd>";
        for ($j = 0; $j < count($entries) && $numEvents < $maxEvents; $j++) {
            print_upcoming_event($entries[$j]);
            $numEvents++;
        }
        for ($j = 0; $j < count($rentries) && $numEvents < $maxEvents; $j++) {
            print_upcoming_event($rentries[$j]);
            $numEvents++;
        }
        print "</dd>\n";
    }
}
开发者ID:BackupTheBerlios,项目名称:fhnreposit,代码行数:31,代码来源:upcoming.php


示例7: print_day_at_a_glance

function print_day_at_a_glance($date, $user, $can_add = 0)
{
    global $CELLBG, $DISPLAY_TASKS_IN_GRID, $DISPLAY_UNAPPROVED, $first_slot, $hour_arr, $last_slot, $rowspan, $rowspan_arr, $TABLEBG, $THBG, $THFG, $TIME_SLOTS, $today, $TODAYCELLBG, $WORK_DAY_END_HOUR, $WORK_DAY_START_HOUR;
    if (empty($TIME_SLOTS)) {
        return translate('Error TIME_SLOTS undefined!') . "<br />\n";
    }
    $get_unapproved = $DISPLAY_UNAPPROVED == 'Y';
    // Get, combine and sort the events for this date.
    $ev = combine_and_sort_events(get_entries($date, $get_unapproved), get_repeating_entries($user, $date));
    if ($date >= date('Ymd') && (empty($DISPLAY_TASKS_IN_GRID) || $DISPLAY_TASKS_IN_GRID == 'Y')) {
        $ev = combine_and_sort_events($ev, get_tasks($date, $get_unapproved));
    }
    $hour_arr = $rowspan_arr = array();
    $interval = 1440 / $TIME_SLOTS;
    // Number of minutes per slot
    $first_slot = intval($WORK_DAY_START_HOUR * 60 / $interval);
    $last_slot = intval($WORK_DAY_END_HOUR * 60 / $interval);
    for ($i = 0, $cnt = count($ev); $i < $cnt; $i++) {
        if ($get_unapproved || $ev[$i]->getStatus() == 'A') {
            html_for_event_day_at_a_glance($ev[$i], $date);
        }
    }
    $last_row = -1;
    $ret = '';
    $rowspan = 0;
    // Squish events that use the same cell into the same cell.
    // For example, an event from 8:00-9:15 and another from 9:30-9:45 both
    // want to show up in the 8:00-9:59 cell.
    for ($i = $first_slot < 0 ? $first_slot : 0; $i < $TIME_SLOTS; $i++) {
        if ($rowspan > 1) {
            if (!empty($hour_arr[$i])) {
                $diff_start_time = $i - $last_row;
                if (!empty($rowspan_arr[$i])) {
                    if ($rowspan_arr[$i] > 1 && $rowspan_arr[$i] + $diff_start_time > $rowspan_arr[$last_row]) {
                        $rowspan_arr[$last_row] = $rowspan_arr[$i] + $diff_start_time;
                    }
                    $rowspan += $rowspan_arr[$i] - 1;
                } else {
                    $rowspan_arr[$last_row] += $rowspan_arr[$i];
                }
                // This will move entries apart that appear in one field,
                // yet start on different hours.
                for ($u = $diff_start_time; $u > 0; $u--) {
                    $hour_arr[$last_row] .= "<br />\n";
                }
                $hour_arr[$last_row] .= $hour_arr[$i];
                $hour_arr[$i] = '';
                $rowspan_arr[$i] = 0;
            }
            $rowspan--;
        } else {
            if (!empty($rowspan_arr[$i]) && $rowspan_arr[$i] > 1) {
                $last_row = $i;
                $rowspan = $rowspan_arr[$i];
            }
        }
    }
    $ret .= '
    <table class="main glance" cellspacing="0" cellpadding="0">' . (empty($hour_arr[9999]) ? '' : '
      <tr>
        <th class="empty">&nbsp;</th>
        <td class="hasevents">' . $hour_arr[9999] . '</td>
      </tr>');
    $rowspan = 0;
    for ($i = $first_slot; $i <= $last_slot; $i++) {
        $time_h = intval($i * $interval / 60);
        $time_m = $i * $interval % 60;
        $addIcon = $can_add ? html_for_add_icon($date, $time_h, $time_m, $user) : '';
        $ret .= '
      <tr>
        <th class="row">' . display_time(($time_h * 100 + $time_m) * 100) . '</th>';
        if ($rowspan > 1) {
            // This might mean there's an overlap, or it could mean one event
            // ends at 11:15 and another starts at 11:30.
            if (!empty($hour_arr[$i])) {
                $ret .= '
        <td class="hasevents">' . $addIcon . $hour_arr[$i] . '</td>';
            }
            $rowspan--;
        } else {
            $ret .= '
        <td ';
            if (empty($hour_arr[$i])) {
                $ret .= ($date == date('Ymd', $today) ? ' class="today"' : '') . '>' . ($can_add ? $addIcon : '&nbsp;');
            } else {
                $rowspan = empty($rowspan_arr[$i]) ? '' : $rowspan_arr[$i];
                $ret .= ($rowspan > 1 ? 'rowspan="' . $rowspan . '"' : '') . 'class="hasevents">' . $addIcon . $hour_arr[$i];
            }
            $ret .= '</td>';
        }
        $ret .= '
      </tr>';
    }
    return $ret . '
    </table>';
}
开发者ID:GetInTheGo,项目名称:JohnsonFinancialService,代码行数:96,代码来源:functions.php


示例8: substr

 $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 = '';
 // Loop through each day
 // Get events for each day (both normal and repeating).
 // (Most of this code was copied from week.php)
 for ($cur_time = $start_time; $cur_time <= $end_time; $cur_time += $ONE_DAY) {
     $event_str = '';
     $dateYmd = date("Ymd", $cur_time);
     $rep = get_repeating_entries(empty($user) ? $login : $user, $dateYmd);
     $ev = get_entries(empty($user) ? $login : $user, $dateYmd);
     $cur_rep = 0;
     //echo "DATE: $dateYmd <br />\n";
     for ($i = 0; $i < count($ev); $i++) {
         // print out any repeating events that are before this one...
         while ($cur_rep < count($rep) && $rep[$cur_rep]['cal_time'] < $ev[$i]['cal_time']) {
             if ($get_unapproved || $rep[$cur_rep]['cal_status'] == 'A') {
                 if (!empty($rep[$cur_rep]['cal_ext_for_id'])) {
                     $viewid = $rep[$cur_rep]['cal_ext_for_id'];
                     $viewname = $rep[$cur_rep]['cal_name'] . " (" . translate("cont.") . ")";
                 } else {
                     $viewid = $rep[$cur_rep]['cal_id'];
                     $viewname = $rep[$cur_rep]['cal_name'];
                 }
                 $event_str .= event_to_text($viewid, $dateYmd, $rep[$cur_rep]['cal_time'], $rep[$cur_rep]['cal_duration'], $viewname, $rep[$cur_rep]['cal_description'], $rep[$cur_rep]['cal_status'], $rep[$cur_rep]['cal_priority'], $rep[$cur_rep]['cal_access'], $rep[$cur_rep]['cal_login']);
开发者ID:neymanna,项目名称:fusionforge,代码行数:31,代码来源:report.php


示例9: translate

?>
</head>
<body>
<?php 
if (!empty($error)) {
    echo "<h2>" . translate("Error") . "</h2>\n" . $error;
    echo "\n<br /><br />\n</body></html>";
    exit;
}
print "<dl>\n";
print "<!-- \nstartTime: {$startTime}\nendTime: {$endTime}\nstartDate: " . "{$date}\nnumDays: {$numDays}\nuser: {$username}\nevents: " . count($events) . "\nrepeated_events: " . count($repeated_events) . " -->\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, $get_unapproved);
    $rentries = get_repeating_entries($username, $d, $get_unapproved);
    print "<!-- {$d} " . count($entries) . "/" . count($rentries) . " -->\n";
    if (count($entries) > 0 || count($rentries) > 0) {
        print "<!-- XXX -->\n";
        print "<dt>" . date_to_str($d) . "</dt>\n<dd>";
        for ($j = 0; $j < count($entries) && $numEvents < $maxEvents; $j++) {
            print_upcoming_event($entries[$j]);
            $numEvents++;
        }
        for ($j = 0; $j < count($rentries) && $numEvents < $maxEvents; $j++) {
            print_upcoming_event($rentries[$j]);
            $numEvents++;
        }
        print "</dd>\n";
    }
}
开发者ID:rohcehlam,项目名称:rflow,代码行数:31,代码来源:upcoming.php


示例10: 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 
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:owaspbwa,代码行数:101,代码来源:functions.php


示例11: display_navigation

$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 .= '
              <th ' . $class . '>' . ($can_add ? html_for_add_icon($dateYmd, '', '', $user) : '') . '<p style="margin:.75em 0 0 0"><a href="day.php?' . $u_url . 'date=' . $dateYmd . $caturl . '">' . $header[$i] . '</a></p></th>';
    $date = date('Ymd', $days[$i]);
    $hour_arr = $rowspan_arr = $tk = array();
    // .
    // Get, combine and sort, static and repeating events for this date.
    $ev = combine_and_sort_events(get_entries($date, $get_unapproved), get_repeating_entries($user, $date));
    // .
    // Then sort in any tasks due for this day and before.
    $ev = combine_and_sort_events($ev, $date >= date('Ymd') ? get_tasks($date, $get_unapproved) : $tk);
    for ($j = 0, $cnt = count($ev); $j < $cnt; $j++) {
        if ($get_unapproved || $ev[$j]->getStatus() == 'A') {
            html_for_event_week_at_a_glance($ev[$j], $date);
        }
    }
    // .
    // Squish events that use the same cell into the same cell.
    // For example, an event from 8:00-9:15 and another from 9:30-9:45
    // both want to show up in the 8:00-9:59 cell.
    $last_row = -1;
    $rowspan = 0;
    for ($j = 0; $j < $TIME_SLOTS; $j++) {
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:week.php


示例12: date

if (!empty($end_date)) {
    $thismonth = date('m', $end_date);
    $thisyear = date('Y', $end_date);
}
if (empty($error) && empty($list)) {
    $cat_id = empty($report_cat_id) ? '' : $report_cat_id;
    $repeated_events = read_repeated_events($report_user, $start_date, $end_date, $cat_id);
    $events = read_events($report_user, $start_date, $end_date, $cat_id);
    $get_unapproved = $DISPLAY_UNAPPROVED == 'Y';
    // Loop through each day.
    // Get events for each day (both normal and repeating).
    // (Most of this code was copied from week.php.)
    for ($cur_time = $start_date; $cur_time <= $end_date; $cur_time += 86400) {
        $event_str = '';
        $dateYmd = date('Ymd', $cur_time);
        $ev = combine_and_sort_events(get_entries($dateYmd), get_repeating_entries($report_user, $dateYmd));
        for ($i = 0, $cnt = count($ev); $i < $cnt; $i++) {
            if ($get_unapproved || $ev[$i]->getStatus() == 'A') {
                $event_str .= event_to_text($ev[$i], $dateYmd);
            }
        }
        if (!empty($event_str) || $report_include_empty == 'Y' || $report_time_range < 10) {
            $date_str = date_to_str($dateYmd, '', false);
            $date_full_str = date_to_str($dateYmd);
            $day_str .= str_replace(array('${date}', '${events}', '${fulldate}', '${report_id}'), array($date_str, $event_str, $date_full_str, $report_id), $day_template);
        }
    }
}
if (!empty($error)) {
    echo print_error($error) . print_trailer();
    exit;
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:report.php


示例13: 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 .= "&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']) {
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:fhnreposit,代码行数:101,代码来源:view_d.php


示例14: date

$get_unapproved = false;
$datem = date('m');
$dateY = date('Y');
// Start date is beginning of this month.
$startdate = mktime(0, 0, 0, $datem, 0, $dateY);
// End date is one year from now.
// Seems kind of arbitrary, eh?
$enddate = mktime(0, 0, 0, $datem, 1, $dateY + 1);
/* Pre-Load the repeated events for quicker access. */
$repeated_events = read_repeated_events($user, $startdate, $enddate, '');
/* Pre-load the non-repeating events for quicker access. */
$events = read_events($user, $startdate, $enddate);
// Loop from start date until we reach end date...
$event_text = '';
for ($d = $startdate; $d <= $enddate; $d += 86400) {
    $dYmd = date('Ymd', $d);
    $ev = get_entries($dYmd, $get_unapproved);
    $evcnt = count($ev);
    for ($i = 0; $i < $evcnt; $i++) {
        $event_text .= fb_export_time($dYmd, $ev[$i]->getDuration(), $ev[$i]->getTime(), 'ical');
    }
    $revents = get_repeating_entries($user, $dYmd, $get_unapproved);
    $recnt = count($revents);
    for ($i = 0; $i < $recnt; $i++) {
        $event_text .= fb_export_time($dYmd, $revents[$i]->getDuration(), $revents[$i]->getTime(), 'ical');
    }
}
header('Content-Type: text/calendar');
header('Content-Disposition: attachment; filename="' . $login . '.ifb"');
echo 'BEGIN:VCALENDAR' . "\r\n" . 'X-WR-CALNAME;VALUE=TEXT:' . str_replace(',', '\\,', empty($publish_fullname) ? $user : translate($publish_fullname)) . "\r\n" . generate_prodid() . 'VERSION:2.0' . "\r\n" . 'METHOD:PUBLISH' . "\r\n" . 'BEGIN:VFREEBUSY' . "\r\n" . 'DTSTART:' . export_get_utc_date(date('Ymd', $startdate), 0) . "\r\n" . 'DTEND:' . export_get_utc_date(date('Ymd', $enddate), '235959') . "\r\n" . $event_text . 'URL:' . $GLOBALS['SERVER_URL'] . 'freebusy.php/' . $user . '.ifb' . "\r\n" . 'END:VFREEBUSY' . "\r\n" . 'END:VCALENDAR' . "\r\n";
exit;
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:freebusy.php


示例15: print_det_date_entries

function print_det_date_entries($date, $user, $ssi)
{
    global $events, $is_admin, $readonly;
    $date = mktime(0, 0, 0, substr($date, 4, 2), substr($date, 6, 2), substr($date, 0, 4));
    // .
    // Get and sort all the repeating and non-repeating events for this date.
    $ev = combine_and_sort_events(get_entries($date), get_repeating_entries($user, $date));
    for ($i = 0, $cnt = count($ev); $i < $cnt; $i++) {
        if (!empty($DISPLAY_UNAPPROVED) && $DISPLAY_UNAPPROVED != 'N' || $ev[$i]->getStatus() == 'A') {
            print_detailed_entry($ev[$i], $date);
        }
    }
}
开发者ID:rhertzog,项目名称:lcs,代码行数:13,代码来源:week_details.php



注:本文中的get_repeating_entries函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_reportico_session_param函数代码示例发布时间:2022-05-15
下一篇:
PHP get_remote_file函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap