本文整理汇总了PHP中get_entries函数的典型用法代码示例。如果您正苦于以下问题:PHP get_entries函数的具体用法?PHP get_entries怎么用?PHP get_entries使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_entries函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 . '"> </td>
</tr>' : '');
}
开发者ID:rhertzog,项目名称:lcs,代码行数:28,代码来源:view_t.php
示例2: 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
示例3: ws_log_message
if ($WS_DEBUG) {
ws_log_message($debug);
}
return $out;
}
$out .= '
<!-- ' . str_replace('XXX', array($user, $login), translate('Reminders for user XXX, login XXX.')) . ' -->
';
$startdate = time();
// today
for ($d = 0; $d < $DAYS_IN_ADVANCE; $d++) {
$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;
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:get_reminders.php
示例4: send_reminder
send_reminder($id, $event_date);
// now update the db...
log_reminder($id, $extra_name, $event_date);
}
}
}
}
}
$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;
开发者ID:rohcehlam,项目名称:rflow,代码行数:31,代码来源:send_reminders.php
示例5: date
?>
"><?php
echo date("l, \\t\\h dS", strtotime("{$year}-{$month}-{$day}"));
?>
</a></li>
<?php
}
?>
</ul>
</li>
<?php
}
?>
</ul>
</li>
<?php
}
?>
</ul>
</div>
<div id="entries">
<?php
echo get_entries($_GET['date']);
?>
</div>
</div><!--end #main-->
<div id="footer">
</div><!--end #footer-->
</div><!--end #wrapper-->
</body>
</html>
开发者ID:postpostmodern,项目名称:logbook,代码行数:31,代码来源:index.php
示例6: read_events
/* 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);
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: 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']) {
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:fhnreposit,代码行数:101,代码来源:view_d.php
示例8: isset
<?php
/* Copyright (c) 2014 Freeder
* Released under a MIT License.
* See the file LICENSE at the root of this repo for copying permission.
*/
require_once 'inc/init.php';
require_once 'inc/entries.php';
require_once 'inc/feeds.php';
$view = isset($_GET['view']) ? $_GET['view'] : '_home';
$page = isset($_GET['p']) ? (int) $_GET['p'] : 0;
$tpl->assign('view', $view);
$tpl->assign('entries', get_entries($view, $page), RainTPL::RAINTPL_XSS_SANITIZE);
$nb_entries = get_entries_count($view, $page);
$tpl->assign('nb_entries', intval($nb_entries));
$tpl->assign('nb_pages', intval($nb_entries / $config->entries_per_page) + 1, RainTPL::RAINTPL_XSS_SANITIZE);
$tpl->assign('feeds', get_feeds(), RainTPL::RAINTPL_XSS_SANITIZE);
$tpl->draw('index');
开发者ID:qwertygc,项目名称:Freeder,代码行数:18,代码来源:index.php
示例9: display_people
function display_people($project_id, $startdate)
{
$entries = get_entries($project_id, $startdate);
if (sizeOf($entries) > 0) {
foreach ($entries as $key => $entry) {
?>
<div id="<?php
echo $entry['entry_id'];
?>
" tb:entry_id="<?php
echo $entry['entry_id'];
?>
" class="person person-<?php
echo $entry['person_role'];
?>
person-<?php
echo $entry['person_id'];
?>
" tb:person_id="<?php
echo $entry['person_id'];
?>
" title="<?php
echo $entry['person_long_name'];
?>
"><?php
echo $entry['person_name'];
?>
</div>
<?php
}
}
}
开发者ID:nickgrossman,项目名称:TheBoard,代码行数:32,代码来源:functions.php
示例10: 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
示例11: translate
}
if ($showTitle) {
echo '<h3 class="cal_upcoming_title">' . translate($upcoming_title) . '</h3>';
}
?>
<div class="vcalendar">
<?php
echo "<dl>\n";
echo "<!-- \nstartTime: {$startDate}\nendTime: {$endDate}\nstartDate: " . "{$date}\nnumDays: {$numDays}\nuser: {$username}\nevents: " . count($events) . "\nrepeated_events: " . count($repeated_events) . " -->\n";
$eventinfo = '';
$numEvents = 0;
$endDateYmd = date('Ymd', $endDate);
for ($i = $startDate; date('Ymd', $i) <= $endDateYmd && $numEvents < $maxEvents; $i += ONE_DAY) {
$d = date('Ymd', $i);
$entries = get_entries($d, $get_unapproved);
$rentries = get_repeating_entries($username, $d, $get_unapproved);
$ev = combine_and_sort_events($entries, $rentries);
$tentries = get_tasks($d, $get_unapproved);
$ev = combine_and_sort_events($ev, $tentries);
$ev_cnt = count($ev);
echo "<!-- {$d} " . count($ev) . " -->\n";
if ($ev_cnt > 0) {
echo "<!-- XXX -->\n";
//print "<dt>" . date_to_str ( $d, translate ( '__month__ __dd__' ), true, true ) . "</dt>\n<dd>";
echo '<dt>' . date_to_str($d) . "</dt>\n<dd>";
for ($j = 0; $j < $ev_cnt && $numEvents < $maxEvents; $j++) {
print_upcoming_event($ev[$j], $d);
$numEvents++;
}
echo "</dd>\n";
开发者ID:GetInTheGo,项目名称:JohnsonFinancialService,代码行数:31,代码来源:upcoming.php
示例12: date
<description><![CDATA[' . $appStr . ']]></description>
<language>' . $lang . '</language>
<generator>:"http://www.k5n.us/webcalendar.php?v=' . $PROGRAM_VERSION . '"</generator>
<image>
<title><![CDATA[' . $appStr . ']]></title>
<link>' . $SERVER_URL . '</link>
<url>http://www.k5n.us/k5n_small.gif</url>
</image>';
$endtimeYmd = date('Ymd', $endTime);
$numEvents = 0;
$reventIds = array();
for ($i = $startTime; date('Ymd', $i) <= $endtimeYmd && $numEvents < $maxEvents; $i += 86400) {
$d = date('Ymd', $i);
$eventIds = array();
$pubDate = gmdate('D, d M Y', $i);
$entries = get_entries($d, false);
$rentries = get_repeating_entries($username, $d);
$entrycnt = count($entries);
$rentrycnt = count($rentries);
if ($debug) {
echo '
countentries==' . $entrycnt . ' ' . $rentrycnt . '
';
}
if ($entrycnt > 0 || $rentrycnt > 0) {
for ($j = 0; $j < $entrycnt && $numEvents < $maxEvents; $j++) {
// Prevent non-Public events from feeding
if (in_array($entries[$j]->getAccess(), $allow_access)) {
$eventIds[] = $entries[$j]->getID();
开发者ID:GetInTheGo,项目名称:JohnsonFinancialService,代码行数:31,代码来源:rss.php
示例13: array
}
}
}
}
for ($d = $start_ind; $d <= $end_ind; $d++) {
for ($u = 0; $u < $viewusercnt; $u++) {
$untimed = array();
$user = $viewusers[$u];
$events = $e_save[$u];
$repeated_events = $re_save[$u];
// get all the repeating events for this date and store in array $rep
$dateYmd = date('Ymd', $days[$d]);
$rep = get_repeating_entries($user, $dateYmd);
$cur_rep = 0;
// Get static non-repeating events
$ev = get_entries($dateYmd, $get_unapproved, 1, 1);
$hour_arr = array();
$rowspan_arr = array();
$evcnt = count($ev);
$repcnt = count($rep);
for ($i = 0; $i < $evcnt; $i++) {
// print out any repeating events that are before this one...
while ($cur_rep < $repcnt && $rep[$cur_rep]->getTime() < $ev[$i]->getTime()) {
if ($get_unapproved || $rep[$cur_rep]->getStatus() == 'A') {
if ($rep[$cur_rep]->getDuration() == 1440) {
$all_day[$d] = 1;
}
html_for_event_week_at_a_glance($rep[$cur_rep], $dateYmd, 'small', $show_time);
}
$cur_rep++;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:view_r.php
示例14: 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"> </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 : ' ');
} 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
示例15: 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
示例16: array
$interval = 24 * 60 / $TIME_SLOTS;
$first_slot = (int) (($WORK_DAY_START_HOUR - $TZ_OFFSET) * 60 / $interval);
$last_slot = (int) (($WORK_DAY_END_HOUR - $TZ_OFFSET) * 60 / $interval);
$untimed_found = false;
$get_unapproved = $GLOBALS["DISPLAY_UNAPPROVED"] == "Y";
if ($login == "__public__") {
$get_unapproved = false;
}
$all_day = array();
for ($d = $start_ind; $d < $end_ind; $d++) {
// get all the repeating events for this date and store in array $rep
$date = date("Ymd", $days[$d]);
$rep = get_repeating_entries($user, $date);
$cur_rep = 0;
// Get static non-repeating events
$ev = get_entries($user, $date);
$hour_arr = array();
$rowspan_arr = array();
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'];
}
if ($rep['cal_duration'] == 24 * 60) {
$all_day[$d] = 1;
开发者ID:neuroidss,项目名称:virtuoso-opensource,代码行数:31,代码来源:week.php
示例17: session_start
<?php
include 'functions.php';
session_start();
check_valid_user();
do_html_header('Blog', array('ajax_functions.js'));
$_SESSION['author_id'] = get_authorid($_SESSION['author']);
$result = get_entries($_SESSION['author_id']);
display_entries($result);
do_html_url('blog/write_post.php', 'Write post');
do_html_url('blog/logout.php', 'logout');
do_html_footer();
开发者ID:pyhale,项目名称:PHPblog,代码行数:12,代码来源:index.php
示例18: substr
$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
示例19: 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
示例20: header
if ($_SERVER['PHP_AUTH_USER'] !== USERNAME || $_SERVER['PHP_AUTH_PW'] !== PASSWORD) {
header('WWW-Authenticate: Basic realm="Cloud Notes"');
header('HTTP/1.0 401 Unauthorized');
exit;
}
header('Content-type: application/json; charset=utf-8');
// Parse incoming data
$remote_index = (array) json_decode(stripslashes($_POST['index']), true);
unset($_POST['index']);
$remote_entries = $_POST;
// Process
$local_index = get_entry('_index');
$diff_index = array_diff_key($local_index, $remote_index);
$debug = array();
$debug['new entries'] = $remote_entries;
$debug['old entries'] = get_entries();
foreach ($remote_index as $id => $item) {
if (array_key_exists($id, $local_index)) {
if ($item['timestamp'] == 0) {
// Remote entry has been deleted, remove the local too
$local_index[$id] = $item;
delete_entry($id);
unset($remote_index[$id]);
unset($remote_entries[$id]);
} elseif ($local_index[$id]['timestamp'] == 0) {
// Local entry has been deleted, remove local entry too
$remote_index[$id] = $local_index[$id];
delete_entry($id);
unset($remote_index[$id]);
unset($remote_entries[$id]);
} elseif ($item['timestamp'] > $local_index[$id]['timestamp']) {
开发者ID:pemiu01,项目名称:HTML5-Notepad-with-Sync,代码行数:31,代码来源:sync.php
注:本文中的get_entries函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论