function is_market_closed($date) { $year = $date->format('Y'); // federal holidays $federal_holidays = [adjust_fixed_holiday($year . '-01-01'), date('Y-m-d', strtotime("third Monday of January {$year}")), date('Y-m-d', strtotime("third Monday of February {$year}")), date("Y-m-d", strtotime("+" . (easter_days($year) - 2) . " days", strtotime("{$year}-03-21 12:00:00"))), date('Y-m-d', strtotime("last Monday of May {$year}")), adjust_fixed_holiday($year . '-07-04', 'last friday'), date('Y-m-d', strtotime("first Monday of September {$year}")), date('Y-m-d', strtotime("last Thursday of November {$year}")), adjust_fixed_holiday($year . '-12-25')]; if (in_array($date->format('Y-m-d'), $federal_holidays)) { $date->modify('next day'); } // saturday or sunday if (is_weekend($date)) { $date->modify('next monday'); } return $date->format('Y-m-d'); }
echo ' <table class="main"> <tr> <th class="empty"> </th>'; $body = $header = ''; $todayYmd = date('Ymd', $today); for ($i = 0; $i < $viewusercnt; $i++) { $events = $e_save[$i]; $repeated_events = $re_save[$i]; $user = $viewusers[$i]; user_load_variables($user, 'temp'); $body .= ' <tr> <th class="row" style="width:' . $tdw . '%;">' . $tempfullname . '</th>'; for ($date = $wkstart; $date < $wkend; $date += 86400) { $is_weekend = is_weekend($date); if ($is_weekend && $DISPLAY_WEEKENDS == 'N') { continue; } $dateYmd = date('Ymd', $date); $entryStr = print_date_entries($dateYmd, $user, true); $class = ($dateYmd == $todayYmd ? ' class="today"' : (!empty($entryStr) && $entryStr != ' ' ? ' class="hasevents"' : ($is_weekend ? ' class="weekend"' : ''))) . ' style="width:' . $tdw . '%;">'; // . // Build header row. if ($i == 0) { $header .= ' <th' . $class . weekday_name(date('w', $date), $DISPLAY_LONG_DAYS) . ' ' . date('d', $date) . '</th>'; } $body .= ' <td' . $class . (empty($ADD_LINK_IN_VIEWS) || $ADD_LINK_IN_VIEWS != 'N' ? html_for_add_icon($dateYmd, '', '', $user) . "\n" : '') . $entryStr . ' </td>';
function display_small_month($thismonth, $thisyear, $showyear, $show_weeknums = false, $minical_id = '', $month_link = 'month.php?') { global $boldDays, $caturl, $DATE_FORMAT_MY, $DISPLAY_ALL_DAYS_IN_MONTH, $DISPLAY_TASKS, $DISPLAY_WEEKNUMBER, $get_unapproved, $login, $MINI_TARGET, $SCRIPT, $SHOW_EMPTY_WEEKENDS, $thisday, $today, $use_http_auth, $user, $WEEK_START; $nextStr = translate('Next'); $prevStr = translate('Previous'); $u_url = $user != $login && !empty($user) ? 'user='******'&' : ''; $weekStr = translate('Week'); // Start the minical table for each month. $ret = ' <table class="minical"' . ($minical_id != '' ? ' id="' . $minical_id . '"' : '') . '>'; $monthstart = date('Ymd', mktime(0, 0, 0, $thismonth, 1, $thisyear)); $monthend = date('Ymd', mktime(0, 0, 0, $thismonth + 1, 0, $thisyear)); // Determine if the week starts on Sunday or Monday. // TODO: We need to be able to start a week on ANY day. $wkstart = get_weekday_before($thisyear, $thismonth); if ($SCRIPT == 'day.php') { $month_ago = date('Ymd', mktime(0, 0, 0, $thismonth - 1, 1, $thisyear)); $month_ahead = date('Ymd', mktime(0, 0, 0, $thismonth + 1, 1, $thisyear)); $ret .= '<caption>' . $thisday . '</caption> <thead> <tr class="monthnav"> <th colspan="' . ($DISPLAY_WEEKNUMBER == true ? 8 : 7) . '"> <a title="' . $prevStr . '" class="prev" href="day.php?' . $u_url . 'date=' . $month_ago . $caturl . '"><img src="images/leftarrowsmall.gif" alt="' . $prevStr . '" /></a> <a title="' . $nextStr . '" class="next" href="day.php?' . $u_url . 'date=' . $month_ahead . $caturl . '"><img src="images/rightarrowsmall.gif" alt="' . $nextStr . '" /></a>' . date_to_str(sprintf("%04d%02d%02d", $thisyear, $thismonth, 1), $showyear != '' ? $DATE_FORMAT_MY : '__month__', false) . ' </th> </tr>'; } elseif ($SCRIPT == 'minical.php') { $month_ago = date('Ymd', mktime(0, 0, 0, $thismonth - 1, $thisday, $thisyear)); $month_ahead = date('Ymd', mktime(0, 0, 0, $thismonth + 1, $thisday, $thisyear)); $ret .= ' <thead> <tr class="monthnav"> <th colspan="7"> <a title="' . $prevStr . '" class="prev" href="minical.php?' . $u_url . 'date=' . $month_ago . '"><img src="images/leftarrowsmall.gif" alt="' . $prevStr . '" /></a> <a title="' . $nextStr . '" class="next" href="minical.php?' . $u_url . 'date=' . $month_ahead . '"><img src="images/rightarrowsmall.gif" alt="' . $nextStr . '" /></a>' . date_to_str(sprintf("%04d%02d%02d", $thisyear, $thismonth, 1), $showyear != '' ? $DATE_FORMAT_MY : '__month__', false) . ' </th> </tr>'; } else { // Not day or minical script. Print the month name. $ret .= ' <caption><a href="' . $month_link . $u_url . 'year=' . $thisyear . '&month=' . $thismonth . '">' . date_to_str(sprintf("%04d%02d%02d", $thisyear, $thismonth, 1), $showyear != '' ? $DATE_FORMAT_MY : '__month__', false) . '</a></caption> <thead>'; } $ret .= ' <tr>' . ($show_weeknums && $DISPLAY_WEEKNUMBER == 'Y' ? ' <th class="empty"> </th>' : ''); for ($i = 0; $i < 7; $i++) { $thday = ($i + $WEEK_START) % 7; $ret .= ' <th' . (is_weekend($thday) ? ' class="weekend"' : '') . '>' . weekday_name($thday, 'D') . '</th>'; } // End the header row. $ret .= ' </tr> </thead> <tbody>'; for ($i = $wkstart; date('Ymd', $i) <= $monthend; $i += 604800) { $tmp = $i + 172800; // 48 hours. $ret .= ' <tr>' . ($show_weeknums && $DISPLAY_WEEKNUMBER == 'Y' ? ' <td><a class="weeknumber" ' . 'title="' . $weekStr . ' ' . date('W', $i + 86400) . '" ' . 'href="week.php?' . $u_url . 'date=' . date('Ymd', $tmp) . '">(' . date('W', $tmp) . ')</a></td>' : ''); for ($j = 0; $j < 7; $j++) { // Add 12 hours just so we don't have DST problems. $date = $i + ($j * 86400 + 43200); $dateYmd = date('Ymd', $date); $hasEvents = false; $title = ''; $ret .= ' <td'; if ($boldDays) { $ev = get_entries($dateYmd, $get_unapproved, true, true); if (count($ev) > 0) { $hasEvents = true; $title = $ev[0]->getName(); } else { $rep = get_repeating_entries($user, $dateYmd, $get_unapproved); if (count($rep) > 0) { $hasEvents = true; $title = $rep[0]->getName(); } } } if ($dateYmd >= $monthstart && $dateYmd <= $monthend || !empty($DISPLAY_ALL_DAYS_IN_MONTH) && $DISPLAY_ALL_DAYS_IN_MONTH == 'Y') { $class = (is_weekend($date) ? 'weekend' : '') . ($dateYmd == $thisyear . $thismonth . $thisday && $SCRIPT == 'day.php' ? ' selectedday' : '') . ($hasEvents ? ' hasevents' : ''); $ret .= ($class != '' ? ' class="' . $class . '"' : '') . ($dateYmd == date('Ymd', $today) ? ' id="today"' : '') . '><a href="'; if ($SCRIPT == 'minical.php') { $ret .= ($use_http_auth ? 'day.php?user='******'nulogin.php?login='******'&return_path=day.php') . '&date=' . $dateYmd . '"' . (empty($MINI_TARGET) ? '' : ' target="' . $MINI_TARGET . '"') . (empty($title) ? '' : ' title="' . $title . '"'); } else { $ret .= 'day.php?' . $u_url . 'date=' . $dateYmd . '"'; } $ret .= '>' . date('j', $date) . '</a></td>'; } else { $ret .= ' class="empty' . (!empty($SHOW_EMPTY_WEEKENDS) && is_weekend($date) ? ' weekend' : '') . '"> </td>'; } } // end for $j $ret .= ' </tr>'; } // end for $i return $ret . ' </tbody> </table>'; }
<tr> <th class="empty"> </th>' . $untimedStr . ' </tr>' : ''; for ($i = $first_slot; $i <= $last_slot; $i++) { $time_h = intval($i * $interval / 60); $time_m = $i * $interval % 60; // Do not apply TZ offset. $eventsStr .= ' <tr> <th class="row">' . display_time(($time_h * 100 + $time_m) * 100, 1) . '</th>'; for ($d = $start_ind; $d <= $end_ind; $d++) { $dateYmd = date('Ymd', $days[$d]); // Class "hasevents" overrides both "today" and "weekend". // And class "today" overrides "weekend". // So, no need to list them all. $class = !empty($save_hour_arr[$d][$i]) && strlen($save_hour_arr[$d][$i]) ? ' class="hasevents"' : ($dateYmd == date('Ymd', $today) ? ' class="today"' : (is_weekend($days[$d]) ? ' class="weekend"' : '')); if ($rowspan_day[$d] > 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($save_hour_arr[$d][$i])) { $eventsStr .= ' <td' . $class . '>' . $save_hour_arr[$d][$i] . '</td>'; } $rowspan_day[$d]--; } else { $eventsStr .= ' <td' . $class; if (empty($save_hour_arr[$d][$i])) { $eventsStr .= '>' . ($can_add ? html_for_add_icon($dateYmd, $time_h, $time_m, $user) : '') . ' '; } else { $rowspan_day[$d] = $save_rowspan_arr[$d][$i];
<tr id="rptbydayextended" style="visibility:hidden;" title="' . tooltip('repeat-bydayextended-help') . '"> <td class="tooltip"><label>' . translate('ByDay') . ':</label></td> <td colspan="2" class="boxall"> <input type="hidden" name="bydayList" value="' . (empty($bydayStr) ? '' : $bydayStr) . '" /> <input type="hidden" name="bymonthdayList" value="' . (empty($bymonthdayStr) ? '' : $bymonthdayStr) . '" /> <input type="hidden" name="bysetposList" value="' . (empty($bysetposStr) ? '' : $bysetposStr) . '" /> <table class="byxxx" cellpadding="2" cellspacing="2" ' . 'border="1" summary=""> <tr> <td></td>'; // Display byday extended selection. // We use BUTTONS in a triple state configuration, and store the values in // a javascript array until form submission. We then set the hidden field // bydayList to the string value of the array. for ($rpt_byday_label = $WEEK_START; $rpt_byday_label <= $WEEK_START + 6; $rpt_byday_label++) { $rpt_byday_mod = $rpt_byday_label % 7; $class = is_weekend($rpt_byday_mod) ? ' class="weekend" ' : ''; echo ' <th width="50px"' . $class . '><label>' . translate($weekday_names[$rpt_byday_mod]) . '</label></th>'; } echo ' </tr> <tr> <th>' . translate('All') . '</th>'; for ($rpt_byday_single = $WEEK_START; $rpt_byday_single <= $WEEK_START + 6; $rpt_byday_single++) { $rpt_byday_mod = $rpt_byday_single % 7; echo ' <td><input type="checkbox" name="bydayAll[]" id="' . $byday_names[$rpt_byday_mod] . '" value="' . "{$byday_names[$rpt_byday_mod]}\"" . (in_array($byday_names[$rpt_byday_mod], $byday) ? $checked : '') . ' /></td>'; } echo ' </tr> <tr id="rptbydayln" style="visibility:hidden;">';
for ($d = $start_ind; $d <= $end_ind; $d++) { $rowspan_day[$u][$d] = 0; } } for ($i = $first_slot; $i <= $last_slot; $i++) { $time_h = (int) ($i * $interval / 60); $time_m = $i * $interval % 60; $time = display_time(($time_h * 100 + $time_m) * 100, 1); echo "<tr>\n<th valign=\"top\" class=\"row\" width=\"{$time_w}" . '">' . $time . "</th>\n"; //echo "<tr>\n<th valign=\"top\">" . $time . "</th>\n"; for ($d = $start_ind; $d <= $end_ind; $d++) { $dateYmd = date('Ymd', $days[$d]); for ($u = 0; $u < $viewusercnt; $u++) { $hour_arr = $save_hour_arr[$u][$d]; $rowspan_arr = $save_rowspan_arr[$u][$d]; $is_weekend = is_weekend($days[$d]); if ($dateYmd == $todayYmd) { $class .= 'class="today"'; } else { if ($is_weekend) { $class .= 'class="weekend"'; } else { $class = ''; } } // Use the class 'hasevents' for any hour block that has events // in it. if (!empty($hour_arr[$i]) && strlen($hour_arr[$i])) { $class = 'class="hasevents"'; } if ($rowspan_day[$u][$d] > 1) {
?> <div id="boire" class="entryscreen"> <img src="medias/interface/backgrounds/bien-boire.jpg" alt="Restaurant L'Échaudé - Bien boire." /> <div class="circle"> <img src="medias/interface/home/pastille-bien-boire.png" alt="Restaurant L'Échaudé - Bien Boire"> </div> </div> <div id="manger" class="entryscreen"> <img src="medias/interface/backgrounds/bien-manger.jpg" alt="Restaurant L'Échaudé - Bien manger." /> <div class="circle"> <img src="medias/interface/home/pastille-bien-manger.png" alt="Restaurant L'Échaudé - Bien Manger"> </div> </div> <?php if (is_weekend()) { ?> <div id="menu" class="entryscreen"> <img src="medias/interface/backgrounds/menu.jpg" alt="Restaurant L'Échaudé - Menu" /> <div class="circle"> <a href="menus#menu-brunch"><img width="477" src="medias/interface/home/pastille-bien-bruncher-<?php echo $locale->current_language; ?> .png" alt="Restaurant L'Échaudé - Bien Bruncher" /></a> </div> </div> <?php } else { $date = new DateTime(); $hour = intval($date->format('H')); if ($hour >= 11 && $hour < 14) {