echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . JText::_('DATE') . ':' . str_replace("d", substr($row->date, 8, 2), str_replace("m", substr($row->date, 5, 2), str_replace("y", substr($row->date, 0, 4), $date_format1))) . ' ' . $row->time . '</div>'; } else { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $font_weight . '; ' . $font_style . ' ">' . $row->time . '</div>'; } } if ($show_repeat == 1) { if ($row->repeat_method == 'daily') { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . JText::_('REPEAT_EVERY') . ' ' . $repeat . ' ' . JText::_('DAY') . '</div>'; } if ($row->repeat_method == 'weekly') { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . JText::_('REPEAT_EVERY') . ' ' . $repeat . ' ' . JText::_('WEEK') . ' : '; for ($i = 0; $i < count($weekdays); $i++) { if ($weekdays[$i] != '') { if ($i != count($weekdays) - 2) { echo week_convert($weekdays[$i]) . ','; } else { echo week_convert($weekdays[$i]); } } } echo '</div>'; } if ($row->repeat_method == 'monthly' and $row->month_type == 1) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . JText::_('REPEAT_EVERY') . ' ' . $repeat . ' ' . JText::_('MONTH') . ' ' . $row->month . '</div>'; } if ($row->repeat_method == 'monthly' and $row->month_type == 2) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . JText::_('REPEAT_EVERY') . ' ' . $repeat . ' ' . JText::_('MONTH') . ' ' . week_number($row->monthly_list) . ' ' . week_convert($row->month_week) . '</div>'; } if ($row->repeat_method == 'yearly' and $row->month_type == 1) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . JText::_('REPEAT_EVERY') . ' ' . $repeat . ' ' . JText::_('YEAR') . ' ' . date('F', mktime(0, 0, 0, $row->year_month + 1, 0, 0)) . ' ' . JText::_('ON_THE') . ' ' . $row->month . '</div>'; }
function spiderbigcalendar() { require_once "front_end/frontend_functions.php"; $calendar_id = isset($_GET['calendar_id']) ? (int) $_GET['calendar_id'] : 0; $date = isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date'])) ? esc_html($_GET['date']) : date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d"); $ev_ids_inline = isset($_GET['ev_ids']) ? esc_html($_GET['ev_ids']) : ''; $eventID = isset($_GET['eventID']) ? (int) $_GET['eventID'] : ''; $widget = isset($_GET['widget']) && (int) $_GET['widget'] ? (int) $_GET['widget'] : 0; $theme_id = isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 1; global $wpdb; if ($widget) { $theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id)); } else { $theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id)); } $title_color = '#' . str_replace('#', '', $theme->title_color); $title_size = $theme->title_font_size; $title_font = $theme->title_font; $title_style = $theme->title_style; $date_color = '#' . str_replace('#', '', $theme->date_color); $date_size = $theme->date_size; $date_font = $theme->date_font; $date_style = $theme->date_style; $next_prev_event_bgcolor = '#' . str_replace('#', '', $theme->next_prev_event_bgcolor); $next_prev_event_arrowcolor = '#' . str_replace('#', '', $theme->next_prev_event_arrowcolor); $show_event_bgcolor = '#' . str_replace('#', '', $theme->show_event_bgcolor); $popup_width = $theme->popup_width; $popup_height = $theme->popup_height; $date_format = $theme->date_format; $show_repeat = $theme->show_repeat; $date_format_array = explode('/', $date_format); for ($i = 0; $i < count($date_format_array); $i++) { if ($date_format_array[$i] == 'w') { $date_format_array[$i] = 'l'; } if ($date_format_array[$i] == 'm') { $date_format_array[$i] = 'F'; } if ($date_format_array[$i] == 'y') { $date_format_array[$i] = 'Y'; } } $all_files_cal = php_showevent($calendar_id, $date, $eventID); $row = $all_files_cal[0]['row']; $datte = isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date'])) ? esc_html($_GET['date']) : date("Y-m-d"); $activedate = explode('-', $datte); $activedatetimestamp = mktime(0, 0, 0, $activedate[1], $activedate[2], $activedate[0]); $activedatestr = ''; for ($i = 0; $i < count($date_format_array); $i++) { $activedatestr .= __(date("" . $date_format_array[$i] . "", $activedatetimestamp), 'sp_calendar') . ' '; } $date = $datte; $day = substr($date, 8); $ev_id = explode(',', $ev_ids_inline); ?> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script> function next(day_events, ev_id, theme_id, calendar_id, date, day, ev_ids) { var p = 0; for (var key in day_events) { p = p + 1; if (day_events[key] == ev_id && day_events[parseInt(key) + 1]) { window.location = '<?php echo admin_url('admin-ajax.php?action=spidercalendarbig'); ?> &theme_id=' + theme_id + '&calendar_id=' + calendar_id + '&ev_ids=' + ev_ids + '&eventID=' + day_events[parseInt(key) + 1] + '&date=' + date + '&day=' + day + '&widget=<?php echo $widget; ?> '; } } } function change() { jQuery('#dayevent').ready(function () { jQuery('#dayevent').animate({ opacity:1, marginLeft:"0in" }, 1000, function () { }); }); } jQuery(document).ready(function() { change(); }); // window.onload = change(); function prev(array1, ev_id, theme_id, calendar_id, date, day, ev_ids) { var day_events = array1; for (var key in day_events) { if (day_events[key] == ev_id && day_events[parseInt(key) - 1]) { window.location = '<?php echo admin_url('admin-ajax.php?action=spidercalendarbig'); ?> &theme_id=' + theme_id + '&calendar_id=' + calendar_id + '&ev_ids=' + ev_ids + '&eventID=' + day_events[parseInt(key) - 1] + '&date=' + date + '&day=' + day + '&widget=<?php echo $widget; ?> '; } } } document.onkeydown = function (evt) { evt = evt || window.event; if (evt.keyCode == 27) { window.parent.document.getElementById('sbox-window').close(); } }; </script> <?php $color = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.* , " . $wpdb->prefix . "spidercalendar_event_category.color\r\nFROM " . $wpdb->prefix . "spidercalendar_event\r\nJOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category = " . $wpdb->prefix . "spidercalendar_event_category.id\r\nWHERE " . $wpdb->prefix . "spidercalendar_event_category.published=1 AND " . $wpdb->prefix . "spidercalendar_event.id='" . $row->id . "'"); ?> <style> #dayevent { opacity: 0; } #previous, #next { cursor: pointer; height: <?php echo $popup_height - 51; ?> px; width: 5%; } .arrow { color: <?php echo $next_prev_event_arrowcolor; ?> ; font-size: 50px; text-decoration: none; } body{ margin:0px; padding:0px; } </style> <table style="height:100%;width:100%;background-color:<?php echo $show_event_bgcolor; ?> ; border-spacing:0" align="center" id="pop_table"> <tr> <td id="previous" onClick="prev([<?php echo $ev_ids_inline; ?> ],<?php echo $eventID; ?> ,<?php echo $theme_id; ?> ,<?php echo $calendar_id; ?> ,'<?php echo $date; ?> ',<?php echo $day; ?> ,'<?php echo $ev_ids_inline; ?> ')" style="<?php if (count($ev_id) == 1 or $eventID == $ev_id[0]) { echo 'display:none'; } ?> ;text-align:center" onMouseOver="document.getElementById('previous').style.backgroundColor='<?php echo $next_prev_event_bgcolor; ?> '" onMouseOut="document.getElementById('previous').style.backgroundColor=''"> <span class="arrow"><</span> </td> <td style="vertical-align:top; width:45%"> <?php echo '<div id="dayevent" style="padding:0px 0px 0px 7px ;line-height:30px; padding-top:0px;"> '; if ($date_style == "bold" or $date_style == "bold/italic") { $date_font_weight = "font-weight:bold"; } else { $date_font_weight = "font-weight:normal"; } if ($date_style == "italic" or $date_style == "bold/italic") { $date_font_style = "font-style:italic"; } else { $date_font_style = ""; } echo '<div style="text-align:center;border-bottom:1px solid #F3F3F3;color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . $activedatestr . '</div>'; if ($title_style == "bold" or $title_style == "bold/italic") { $font_weight = "font-weight:bold"; } else { $font_weight = "font-weight:normal"; } if ($title_style == "italic" or $title_style == "bold/italic") { $font_style = "font-style:italic"; } else { $font_style = ""; } $weekdays = explode(',', $row->week); $date_format1 = 'd/m/y'; if ($row->repeat == '1') { $repeat = ''; } else { $repeat = $row->repeat; } if ($row->date_end == '2035-12-12') { $row->date_end = ''; } if ($row->date_end and $row->date_end != '0000-00-00') { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Date', 'sp_calendar') . ':' . str_replace("d", substr($row->date, 8, 2), str_replace("m", substr($row->date, 5, 2), str_replace("y", substr($row->date, 0, 4), $date_format1))) . ' - ' . str_replace("d", substr($row->date_end, 8, 2), str_replace("m", substr($row->date_end, 5, 2), str_replace("y", substr($row->date_end, 0, 4), $date_format1))) . ' ' . $row->time . '</div>'; } else { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $font_weight . '; ' . $font_style . ' ">' . $row->time . '</div>'; } if ($show_repeat == 1) { if ($row->repeat_method == 'daily') { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Day', 'sp_calendar') . '</div>'; } if ($row->repeat_method == 'weekly') { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Week(s) on', 'sp_calendar') . ' : '; for ($i = 0; $i < count($weekdays); $i++) { if ($weekdays[$i] != '') { if ($i != count($weekdays) - 2) { echo week_convert($weekdays[$i]) . ', '; } else { echo week_convert($weekdays[$i]); } } } echo '</div>'; } if ($row->repeat_method == 'monthly' and $row->month_type == 1) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Month(s) on the', 'sp_calendar') . ' ' . $row->month . '</div>'; } if ($row->repeat_method == 'monthly' and $row->month_type == 2) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Month(s) on the', 'sp_calendar') . ' ' . week_number($row->monthly_list) . ' ' . week_convert($row->month_week) . '</div>'; } if ($row->repeat_method == 'yearly' and $row->month_type == 1) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Year(s) in', 'sp_calendar') . ' ' . date('F', mktime(0, 0, 0, $row->year_month + 1, 0, 0)) . ' ' . __('on the', 'sp_calendar') . ' ' . $row->month . '</div>'; } if ($row->repeat_method == 'yearly' and $row->month_type == 2) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Year(s) in', 'sp_calendar') . ' ' . date('F', mktime(0, 0, 0, $row->year_month + 1, 0, 0)) . ' ' . __('on the', 'sp_calendar') . ' ' . week_number($row->monthly_list) . ' ' . week_convert($row->month_week) . '</div>'; } } if (isset($row->title)) { $row_title = $row->title; } else { $row_title = ""; } if (isset($color[0]->color)) { $row_color = $color[0]->color; } else { $row_color = ""; } echo '<div style="border-left: 7px solid #' . str_replace('#', '', $row_color) . ';color:' . $title_color . ';font-size:' . $title_size . 'px; font-family:' . $title_font . '; ' . $font_weight . '; ' . $font_style . ' ">' . $row_title . '</div>'; if ($row->text_for_date != '') { echo '<div style="line-height:20px">' . wpautop($row->text_for_date) . '</div>'; } else { echo '<p style="text-align:center">' . __('There Is No Text For This Event', 'sp_calendar') . '</p>'; } echo '</div>'; ?> <div style="height:50px;width:98%;text-align:right;<?php if (count($ev_id) == 1) { echo 'display:none;'; } ?> "> <a class="back_cal" style="color:<?php echo $title_color; ?> ;font-size:15px; font-family:<?php echo $title_font; ?> ;<?php echo $font_weight; ?> ;<?php echo $font_style; ?> ;" href="<?php echo add_query_arg(array('action' => 'spiderseemore', 'theme_id' => $theme_id, 'calendar_id' => $calendar_id, 'ev_ids' => $ev_ids_inline, 'date' => $date, 'widget' => $widget, 'TB_iframe' => 1, 'tbWidth' => $popup_width, 'tbHeight' => $popup_height), admin_url('admin-ajax.php')); ?> "><?php echo __('Back to event list', 'sp_calendar'); ?> </a> </div><br> <br> </td> <td id="next" onclick="next([<?php echo $ev_ids_inline; ?> ],<?php echo $eventID; ?> ,<?php echo $theme_id; ?> ,<?php echo $calendar_id; ?> ,'<?php echo $date; ?> ',<?php echo $day; ?> ,'<?php echo $ev_ids_inline; ?> ')" style="<?php if (count($ev_id) == 1 or $eventID == end($ev_id)) { echo 'display:none'; } ?> ;text-align:center" onMouseOver="document.getElementById('next').style.backgroundColor='<?php echo $next_prev_event_bgcolor; ?> '" onMouseOut="document.getElementById('next').style.backgroundColor=''"> <span class="arrow">></span> </td> </tr> </table> <?php //////////////// $url_for_page = isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : ''; $url_for_page_de = urldecode($url_for_page); if (!strpos($url_for_page_de, '?')) { $cuery_string = '?' . $_SERVER['QUERY_STRING']; } else { $cuery_string = '&' . $_SERVER['QUERY_STRING']; } $url_for_page_de .= $cuery_string; $url_for_page_de = str_replace('theme_id=', 'frst_theme_id=\'', $url_for_page_de); $url_for_page_de = str_replace('calendar_id=', 'frst_calendar_id=\'', $url_for_page_de); $url_for_page_de = str_replace('ev_ids=', 'frst_ev_ids=\'', $url_for_page_de); $url_for_page_de = str_replace('eventID=', 'frst_eventID=\'', $url_for_page_de); $url_for_page_de = str_replace('date=', 'frst_date=\'', $url_for_page_de); $url_for_page_de = str_replace('day=', 'frst_day=\'', $url_for_page_de); if (substr($url_for_page_de, -1) == '&') { $url_for_page_de = substr_replace($url_for_page_de, "", -1); } $zzzzzzzzz = 0; if ($zzzzzzzzz == 1) { ?> <iframe src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode($url_for_page_de); ?> " scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe> <?php } die; }
$color = ''; } if ($row->id == $ev_id[$i]) { echo '<div ><div style="display: table-cell;background-color: #E8E8E8;border-right:1px solid #' . $color . ';width: 30px;text-align:center;border-top:1px solid white;font-size: 34px;font-weight: bold;color: white;">' . ($i + 1) . '</div> <div style="display: table-cell;vertical-align: middle;padding-left:10px;width: 96%;"><a style="font-size:' . $title_size . 'px;color:' . $title_color . '; line-height:30px;text-decoration:none" href="index.php?option=com_spidercalendar&view=spidercalendarbig&theme_id=' . $theme_id . '&calendar_id=' . $calendar_id . '&ev_ids=' . $ev_ids . '&eventID=' . $row->id . '&date=' . $date . '&day=' . $day . '&tmpl=component"><p style="font-size: 20px;"> ' . $row->title . '</p></a>'; if ($row->repeat_method == 'daily') { echo '<div style="color:#6B696A;font-size:' . $date_size . 'px; font-family:' . $date_font . ';width: 100%;padding: 3px;background-color: #F8F8F8; "><div style="display:table-cell"><img src="administrator/components/com_spidercalendar/elements/calendar.png" /></div><div style="display:table-cell;vertical-align:middle;padding-left:5px">Date: ' . $row->date . $d_end . ' (' . JText::_('REPEAT_EVERY') . ' ' . $repeat . ' ' . JText::_('DAY') . ')</div></div>'; } if ($row->repeat_method == 'weekly') { echo '<div style="color:#6B696A;font-size:' . $date_size . 'px; font-family:' . $date_font . ';width: 100%;padding: 3px;background-color: #F8F8F8; "><div style="display:table-cell"><img src="administrator/components/com_spidercalendar/elements/calendar.png" /></div> <div style="display:table-cell;vertical-align:middle;padding-left:5px">Date: ' . $row->date . $d_end . ' (' . JText::_('REPEAT_EVERY') . ' ' . $repeat . ' ' . JText::_('WEEK') . ' : '; for ($i = 0; $i < count($weekdays); $i++) { if ($weekdays[$i] != '') { if ($i != count($weekdays) - 2) { echo week_convert($weekdays[$i]) . ','; } else { echo week_convert($weekdays[$i]); } } } echo ')</div>'; } if ($row->repeat_method == 'monthly' and $row->month_type == 1) { echo '<div style="color:#6B696A;font-size:' . $date_size . 'px; font-family:' . $date_font . ';width: 100%;padding: 3px;background-color: #F8F8F8; "><div style="display:table-cell"><img src="administrator/components/com_spidercalendar/elements/calendar.png" /></div> <div style="display:table-cell;vertical-align:middle;padding-left:5px">Date: ' . $row->date . $d_end . ' (' . JText::_('REPEAT_EVERY') . ' ' . $repeat . ' ' . JText::_('MONTH') . ' ' . $row->month . ')</div></div>'; } if ($row->repeat_method == 'monthly' and $row->month_type == 2) { echo '<div style="color:#6B696A;font-size:' . $date_size . 'px; font-family:' . $date_font . ';width: 100%;padding: 3px;background-color: #F8F8F8; "><div style="display:table-cell"><img src="administrator/components/com_spidercalendar/elements/calendar.png" /></div> <div style="display:table-cell;vertical-align:middle;padding-left:5px">Date: ' . $row->date . $d_end . ' (' . JText::_('REPEAT_EVERY') . ' ' . $repeat . ' ' . JText::_('MONTH') . ' ' . week_number($row->monthly_list) . ' ' . week_convert($row->month_week) . ')</div></div>'; } if ($row->repeat_method == 'yearly' and $row->month_type == 1) { echo '<div style="color:#6B696A;font-size:' . $date_size . 'px; font-family:' . $date_font . ';width: 100%; padding: 3px; background-color: #F8F8F8; "><div style="display:table-cell"><img src="administrator/components/com_spidercalendar/elements/calendar.png" /></div> <div style="display:table-cell;vertical-align:middle;padding-left:5px">Date: ' . $row->date . $d_end . ' (' . JText::_('REPEAT_EVERY') . ' ' . $repeat . ' ' . JText::_('YEAR') . ' ' . date('F', mktime(0, 0, 0, $row->year_month + 1, 0, 0)) . ' ' . JText::_('ON_THE') . ' ' . $row->month . ')</div></div>'; } if ($row->repeat_method == 'yearly' and $row->month_type == 2) { echo '<div style="color:#6B696A;font-size:' . $date_size . 'px; font-family:' . $date_font . ';width: 100%;padding: 3px;background-color: #F8F8F8; "><div style="display:table-cell"><img src="administrator/components/com_spidercalendar/elements/calendar.png" /></div> <div style="display:table-cell;vertical-align:middle;padding-left:5px">Date: ' . $row->date . $d_end . ' (' . JText::_('REPEAT_EVERY') . ' ' . $repeat . ' ' . JText::_('YEAR') . ' ' . date('F', mktime(0, 0, 0, $row->year_month + 1, 0, 0)) . ' ' . JText::_('ON_THE') . ' ' . week_number($row->monthly_list) . ' ' . week_convert($row->month_week) . ')</div></div>';
function print_date_entries($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 ($user == "__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" && $user == "__public__") { $can_add = false; } if (!$hide_icons && !$ssi && $can_add) { print "<A HREF=\"edit_entry.php?"; if (strcmp($user, $GLOBALS["login"])) { print "user={$user}&"; } print "date={$date}\">" . "<IMG SRC=\"new.gif\" WIDTH=\"10\" HEIGHT=\"10\" ALT=\"" . translate("New Entry") . "\" BORDER=\"0\" ALIGN=\"right\">" . "</A>"; $cnt++; } if (!$ssi) { echo "<FONT SIZE=\"-1\"><A CLASS=\"dayofmonth\" HREF=\"day.php?"; if (strcmp($user, $GLOBALS["login"])) { echo "user={$user}&"; } echo "date={$date}\">{$day}</A></FONT>"; if ($GLOBALS["DISPLAY_WEEKNUMBER"] == "Y" && date("w", $dateu) == $GLOBALS["WEEK_START"]) { echo "<A HREF=\"week.php?date={$date}"; if (strcmp($user, $GLOBALS["login"])) { echo "&user={$user}"; } echo "\" CLASS=\"weeknumber\">"; echo "<FONT SIZE=\"-2\" CLASS=\"weeknumber\">(" . translate("Week") . " " . week_number($dateu) . ")</FONT></A>"; } print "<BR>\n"; $cnt++; } // 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 ($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']; } print_entry($viewid, $date, $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'], $hide_icons); $cnt++; } $cur_rep++; } if ($get_unapproved || $ev[$i]['cal_status'] == 'A') { if (!empty($ev[$i]['cal_ext_for_id'])) { $viewid = $ev[$i]['cal_ext_for_id']; $viewname = $ev[$i]['cal_name'] . " (" . translate("cont.") . ")"; } else { $viewid = $ev[$i]['cal_id']; $viewname = $ev[$i]['cal_name']; } print_entry($viewid, $date, $ev[$i]['cal_time'], $ev[$i]['cal_duration'], $viewname, $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') { 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']; } print_entry($viewid, $date, $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'], $hide_icons); $cnt++; } $cur_rep++; } if ($cnt == 0) { echo " "; } // so the table cell has at least something }
?> "><img src="leftarrow.gif" alt="Previous" /></a> <a title="Next" class="next" href="week_details.php?<?php echo $u_url; ?> date=<?php echo date("Ymd", $next) . $caturl; ?> "><img src="rightarrow.gif" alt="Next" /></a> <span class="date"><?php echo date_to_str(date("Ymd", $wkstart), "", false) . " - " . date_to_str(date("Ymd", $wkend), "", false); ?> </span> <?php if ($GLOBALS["DISPLAY_WEEKNUMBER"] == "Y") { echo "<br />\n<span class=\"weeknumber\">(" . translate("Week") . " " . week_number($wkstart) . ")</span>"; } ?> <span class="user"><?php if ($single_user == "N") { echo "<br />{$user_fullname}\n"; } if ($is_nonuser_admin) { echo "<br />-- " . translate("Admin mode") . " --"; } if ($is_assistant) { echo "<br />-- " . translate("Assistant mode") . " --"; } ?> </span> <?php
} $d_time = mktime(3, 0, 0, $m, $d, $y); $thisdate = date("Ymd", $d_time); $wday = date("w", $d_time); // $WEEK_START equals 1 or 0 $wkstart = mktime(3, 0, 0, $m, $d - ($wday - $WEEK_START), $y); for ($i = -7; $i <= 7; $i++) { $twkstart = $wkstart + 3600 * 24 * 7 * $i; $twkend = $twkstart + 3600 * 24 * 6; echo "<option value=\"" . date("Ymd", $twkstart) . "\""; if (date("Ymd", $twkstart) <= $thisdate && date("Ymd", $twkend) >= $thisdate) { echo " selected=\"selected\""; } echo ">"; if (!empty($GLOBALS['PULLDOWN_WEEKNUMBER']) && ($GLOBALS['PULLDOWN_WEEKNUMBER'] = "Y")) { echo "(" . week_number($twkstart) . ") "; } printf("%s - %s", date_to_str(date("Ymd", $twkstart), $DATE_FORMAT_MD, false, true), date_to_str(date("Ymd", $twkend), $DATE_FORMAT_MD, false, true)); echo "</option>\n"; } ?> </select> <input type="submit" value="<?php etranslate("Go"); ?> " /> </form> <form action="year.php" method="get" name="SelectYear" id="yearform"> <?php if (!empty($user) && $user != $login) {
?> "><IMG SRC="leftarrow.gif" WIDTH="36" HEIGHT="32" BORDER="0"></A></TD> <?php } ?> <TD ALIGN="middle"><FONT SIZE="+2" COLOR="<?php echo $H2COLOR; ?> "><B CLASS="pagetitle"> <?php echo date_to_str(date("Ymd", $wkstart), "", false) . " - " . date_to_str(date("Ymd", $wkend), "", false); ?> </B></FONT> <?php if ($GLOBALS["DISPLAY_WEEKNUMBER"] == "Y") { echo "<BR>\n<FONT SIZE=\"-2\" COLOR=\"{$H2COLOR}\">(" . translate("Week") . " " . week_number($wkstart) . ")</FONT>"; } ?> <FONT SIZE="+1" COLOR="<?php echo $H2COLOR; ?> "> <?php if ($single_user == "N") { echo "<BR>{$user_fullname}\n"; } if ($is_assistant) { echo "<B><BR>-- " . translate("Assistant mode") . " --</B>"; } if ($categories_enabled == "Y") { echo "<BR>\n<BR>\n";
echo $make_booking_link; ?> "><?php echo $count; ?> </a></span></td> <?php if (weekday_short_name($wday_ind) == $wdays['0']) { // if start of the week, add week link ?> <td align="center" nowrap="nowrap" width="100%"><span class="FontSoftSmall"><a href="<?php echo href_link(FILENAME_WEEK_VIEW, 'date=' . $date . '&view=week&' . make_hidden_fields_workstring(array('loc')), 'NONSSL'); ?> "> (Week <?php echo week_number(SELECTED_DATE_YEAR, SELECTED_DATE_MONTH, $count); ?> )</a></span></td> <?php } ?> <td align="right" nowrap="nowrap"><span class="FontSoftSmall"><a href="<?php //Modified by MJ on 10/03/05 - commented out the original line below and replaced it with the following one. //this change forces the user to go to the day view to select a time slot rather than just take the 7:00am slot on this day as the orig link did //echo href_link(FILENAME_ADD_EVENT, 'date='.$date.'&view=week&'.make_hidden_fields_workstring(array('loc')), 'NONSSL') ; echo $make_booking_link; ?> ">(+)</a></span></td> </td></tr></table></td> <?php } else {
function spiderbigcalendar() { function php_Month_num($month_name) { for ($month_num = 1; $month_num <= 12; $month_num++) { if (date("F", mktime(0, 0, 0, $month_num, 1, 0)) == $month_name) { return $month_num; } } } function php_showevent() { global $wpdb; if (isset($_GET['date'])) { if (IsDate_inputed($_GET['date'])) { $date = $_GET['date']; } else { $date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d"); } } else { $date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d"); } if (isset($_GET['calendar_id'])) { $calendar = (int) $_GET['calendar_id']; } else { $calendar = 0; } $year = substr($date, 0, 4); $month = substr($date, 5, 2); $eventID = (int) $_GET['eventID']; $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE id=%d', $eventID)); $all_files_spider_cal['row'] = $row; $all_files_spider_cal['option'] = $option; return array($all_files_spider_cal); } global $wpdb; function IsDate_inputed($str) { if (is_array($str)) { return; } $stamp = strtotime($str); if (!is_numeric($stamp)) { return FALSE; } $month = date('m', $stamp); $day = date('d', $stamp); $year = date('Y', $stamp); if (checkdate($month, $day, $year)) { return TRUE; } return FALSE; } if (isset($_GET['widget'])) { $widget = 1; } else { $widget = 0; } $theme_id = (int) $_GET['theme_id']; if ($widget) { $theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id)); } else { $theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id)); } function week_number($x) { if ($x == 1) { return __('First', 'sp_calendar'); } if ($x == 7) { return __('Second', 'sp_calendar'); } if ($x == 14) { return __('Third', 'sp_calendar'); } if ($x == 21) { return __('Fourth', 'sp_calendar'); } if ($x == 'last') { return __('Last', 'sp_calendar'); } } function week_convert($x) { if ($x == 'Mon') { return __('Monday', 'sp_calendar'); } if ($x == 'Tue') { return __('Tuesday', 'sp_calendar'); } if ($x == 'Wed') { return __('Wednesday', 'sp_calendar'); } if ($x == 'Thu') { return __('Thursday', 'sp_calendar'); } if ($x == 'Fri') { return __('Friday', 'sp_calendar'); } if ($x == 'Sat') { return __('Saturday', 'sp_calendar'); } if ($x == 'Sun') { return __('Sunday', 'sp_calendar'); } } function do_nothing() { return false; } $title_color = '#' . $theme->title_color; $title_size = $theme->title_font_size; $title_font = $theme->title_font; $title_style = $theme->title_style; $date_color = '#' . $theme->date_color; $date_size = $theme->date_size; $date_font = $theme->date_font; $date_style = $theme->date_style; $next_prev_event_bgcolor = '#' . $theme->next_prev_event_bgcolor; $next_prev_event_arrowcolor = '#' . $theme->next_prev_event_arrowcolor; $show_event_bgcolor = '#' . $theme->show_event_bgcolor; $popup_width = $theme->popup_width; $popup_height = $theme->popup_height; $date_format = $theme->date_format; $show_repeat = $theme->show_repeat; $date_format_array = explode('/', $date_format); for ($i = 0; $i < count($date_format_array); $i++) { if ($date_format_array[$i] == 'w') { $date_format_array[$i] = 'l'; } if ($date_format_array[$i] == 'm') { $date_format_array[$i] = 'F'; } if ($date_format_array[$i] == 'y') { $date_format_array[$i] = 'Y'; } } $all_files_cal = php_showevent(); $row = $all_files_cal[0]['row']; $option = $all_files_cal[0]['option']; if (isset($_GET['date'])) { if (IsDate_inputed($_GET['date'])) { $datte = $_GET['date']; } else { $datte = date("Y-m-d"); } } else { $datte = date("Y-m-d"); } $activedate = explode('-', $datte); $activedatetimestamp = mktime(0, 0, 0, $activedate[1], $activedate[2], $activedate[0]); $activedatestr = ''; for ($i = 0; $i < count($date_format_array); $i++) { $activedatestr .= __(date("" . $date_format_array[$i] . "", $activedatetimestamp)) . ' '; } //$activedatestr=__(date("".$date_format_array[0]."",$activedatetimestamp)).' '.__(date("".$date_format_array[1]."",$activedatetimestamp)).' '.__(date("".$date_format_array[2]."",$activedatetimestamp)).' '.__(date("".$date_format_array[3]."",$activedatetimestamp)); $date = $datte; $day = substr($date, 8); if (isset($_GET['calendar_id'])) { $calendar_id = (int) $_GET['calendar_id']; } else { $calendar_id = 0; } //$ev_ids =$session->get('ev_ids'); $ev_ids_inline = esc_html($_GET['ev_ids']); $ev_id = explode(',', $ev_ids_inline); $eventID = (int) $_GET['eventID']; ?> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script> function next(day_events,ev_id,theme_id,calendar_id,date,day,ev_ids) { var p=0; for (var key in day_events) { p=p+1; if(day_events[key]==ev_id && day_events[parseInt(key) +1]) { window.location='<?php echo admin_url('admin-ajax.php?action=spiderbigcalendarrr'); ?> &theme_id='+theme_id+'&calendar_id='+calendar_id+'&eventID='+day_events[parseInt(key) +1]+'&date='+date+'&day='+day+'&ev_ids='+ev_ids<?php if ($widget) { echo "+'&widget=1'"; } ?> ; } } } function change() { jQuery('#dayevent').ready(function() { jQuery('#dayevent').animate({ opacity: 1, marginLeft: "0in", }, 1000, function() { }); }); } window.onload=change(); function prev(array1,ev_id,theme_id,calendar_id,date,day,ev_ids) { var day_events = array1; for (var key in day_events) { if(day_events[key]==ev_id && day_events[parseInt(key) -1] ) { window.location='<?php echo admin_url('admin-ajax.php?action=spiderbigcalendarrr'); ?> &theme_id='+theme_id+'&calendar_id='+calendar_id+'&eventID='+day_events[parseInt(key) -1]+'&date='+date+'&ev_ids='+ev_ids+'&day='+day<?php if ($widget) { echo "+'&widget=1'"; } ?> ; } } } document.onkeydown = function(evt) { evt = evt || window.event; if (evt.keyCode == 27) { window.parent.document.getElementById('sbox-window').close(); } }; </script> <?php ?> <style> #dayevent { opacity:0; } #previous , #next { width:5%; height:<?php echo $popup_height - 6; ?> px; cursor:pointer; } .arrow { font-size:50px; color:<?php echo $next_prev_event_arrowcolor; ?> ; text-decoration:none; } </style> <table style="height:<?php echo $popup_height; ?> px;width:100%;background-color:<?php echo $show_event_bgcolor; ?> ; border-spacing:0" align="center"> <tr> <td id="previous" onClick="prev([<?php echo $ev_ids_inline; ?> ],<?php echo $eventID; ?> ,<?php echo $theme_id; ?> ,<?php echo $calendar_id; ?> ,'<?php echo $date; ?> ',<?php echo $day; ?> ,'<?php echo $ev_ids_inline; ?> ')" style="<?php if (count($ev_id) == 1 or $eventID == $ev_id[0]) { echo 'display:none'; } ?> ;text-align:center" onMouseOver="document.getElementById('previous').style.backgroundColor='<?php echo $next_prev_event_bgcolor; ?> '" onMouseOut="document.getElementById('previous').style.backgroundColor=''" > <span class="arrow" ><</span> </td> <td style="vertical-align:top; width:90%"> <?php echo '<div id="dayevent" style="padding:0px 0px 0px 7px ;line-height:30px; padding-top:0px;">'; if ($date_style == "bold" or $date_style == "bold/italic") { $date_font_weight = "font-weight:bold"; } else { $date_font_weight = "font-weight:normal"; } if ($date_style == "italic" or $date_style == "bold/italic") { $date_font_style = "font-style:italic"; } else { $date_font_style = ""; } echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . $activedatestr . '</div>'; if ($title_style == "bold" or $title_style == "bold/italic") { $font_weight = "font-weight:bold"; } else { $font_weight = "font-weight:normal"; } if ($title_style == "italic" or $title_style == "bold/italic") { $font_style = "font-style:italic"; } else { $font_style = ""; } $weekdays = explode(',', $row->week); $date_format1 = 'd/m/y'; if ($row->repeat == '1') { $repeat = ''; } else { $repeat = $row->repeat; } if ($row->text_for_date != '') { if ($row->date_end and $row->date_end != '0000-00-00') { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Date', 'sp_calendar') . ':' . str_replace("d", substr($row->date, 8, 2), str_replace("m", substr($row->date, 5, 2), str_replace("y", substr($row->date, 0, 4), $date_format1))) . ' - ' . str_replace("d", substr($row->date_end, 8, 2), str_replace("m", substr($row->date_end, 5, 2), str_replace("y", substr($row->date_end, 0, 4), $date_format1))) . ' ' . $row->time . '</div>'; } else { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $font_weight . '; ' . $font_style . ' ">' . $row->time . '</div>'; } if ($show_repeat == 1) { if ($row->repeat_method == 'daily') { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Day', 'sp_calendar') . '</div>'; } if ($row->repeat_method == 'weekly') { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Week(s) on', 'sp_calendar') . ' : '; for ($i = 0; $i < count($weekdays); $i++) { if ($weekdays[$i] != '') { if ($i != count($weekdays) - 2) { echo week_convert($weekdays[$i]) . ','; } else { echo week_convert($weekdays[$i]); } } } echo '</div>'; } if ($row->repeat_method == 'monthly' and $row->month_type == 1) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Month(s) on the', 'sp_calendar') . ' ' . $row->month . '</div>'; } if ($row->repeat_method == 'monthly' and $row->month_type == 2) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Month(s) on the', 'sp_calendar') . ' ' . week_number($row->monthly_list) . ' ' . week_convert($row->month_week) . '</div>'; } if ($row->repeat_method == 'yearly' and $row->month_type == 1) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Year(s) in', 'sp_calendar') . ' ' . date('F', mktime(0, 0, 0, $row->year_month + 1, 0, 0)) . ' ' . __('on the', 'sp_calendar') . ' ' . $row->month . '</div>'; } if ($row->repeat_method == 'yearly' and $row->month_type == 2) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Year(s) in', 'sp_calendar') . ' ' . date('F', mktime(0, 0, 0, $row->year_month + 1, 0, 0)) . ' ' . __('on the', 'sp_calendar') . ' ' . week_number($row->monthly_list) . ' ' . week_convert($row->month_week) . '</div>'; } } echo '<div style="color:' . $title_color . ';font-size:' . $title_size . 'px; font-family:' . $title_font . '; ' . $font_weight . '; ' . $font_style . ' ">' . $row->title . '</div>'; echo '<div style="line-height:20px">' . $row->text_for_date . '</div>'; } else { echo '<div style="color:' . $title_color . ';font-size:' . $title_size . 'px; font-family:' . $title_font . '; ' . $font_weight . '; ' . $font_style . ' ">' . $row->title . '</div>'; echo '<h1 style="text-align:center">There Is No Text For This Event</h1>'; } echo '</div>'; ?> <div style="width:98%;text-align:right; display:<?php if (count($ev_id) == 1) { echo 'none'; } ?> "><a style="color:<?php echo $title_color; ?> ;font-size:15px; font-family:<?php echo $title_font; ?> ; <?php echo $font_weight; ?> ; <?php echo $font_style; ?> " href="<?php echo admin_url('admin-ajax.php?action=spiderseemore') . '&theme_id=' . $theme_id . '&ev_ids=' . $ev_ids_inline . '&calendar_id=' . $calendar_id . '&date=' . $date . '' . ($widget ? '&widget=1' : ''); ?> ">Back to event list</a></div> </td> <td id="next" onclick="next([<?php echo $ev_ids_inline; ?> ],<?php echo $eventID; ?> ,<?php echo $theme_id; ?> ,<?php echo $calendar_id; ?> ,'<?php echo $date; ?> ',<?php echo $day; ?> ,'<?php echo $ev_ids_inline; ?> ')" style="<?php if (count($ev_id) == 1 or $eventID == end($ev_id)) { echo 'display:none'; } ?> ;text-align:center" onMouseOver="document.getElementById('next').style.backgroundColor='<?php echo $next_prev_event_bgcolor; ?> '" onMouseOut="document.getElementById('next').style.backgroundColor=''" > <span class="arrow" >></span> </td> </tr> </table> <?php //////////////// $url_for_page = $_GET['cur_page_url']; $url_for_page_de = urldecode($url_for_page); if (!strpos($url_for_page_de, '?')) { $cuery_string = '?' . $_SERVER['QUERY_STRING']; } else { $cuery_string = '&' . $_SERVER['QUERY_STRING']; } $url_for_page_de .= $cuery_string; $url_for_page_de = str_replace('theme_id=', 'frst_theme_id=\'', $url_for_page_de); $url_for_page_de = str_replace('calendar_id=', 'frst_calendar_id=\'', $url_for_page_de); $url_for_page_de = str_replace('ev_ids=', 'frst_ev_ids=\'', $url_for_page_de); $url_for_page_de = str_replace('eventID=', 'frst_eventID=\'', $url_for_page_de); $url_for_page_de = str_replace('date=', 'frst_date=\'', $url_for_page_de); $url_for_page_de = str_replace('day=', 'frst_day=\'', $url_for_page_de); if (substr($url_for_page_de, -1) == '&') { $url_for_page_de = substr_replace($url_for_page_de, "", -1); } $zzzzzzzzz = 0; if ($zzzzzzzzz == 1) { ?> <iframe src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode($url_for_page_de); ?> " scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe> <?php } die; }
/** * Prints all the calendar entries for the specified user for the specified date. * * If we are displaying data from someone other than * the logged in user, then check the access permission of the entry. * * @param string $date Date in YYYYMMDD format * @param string $user Username * @param bool $ssi Is this being called from week_ssi.php? */ function print_date_entries($date, $user, $ssi) { global $events, $readonly, $is_admin, $login, $public_access, $public_access_can_add, $cat_id; $cnt = 0; $get_unapproved = $GLOBALS["DISPLAY_UNAPPROVED"] == "Y"; // public access events always must be approved before being displayed if ($user == "__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" && $login == "__public__") { $can_add = false; } if ($readonly == 'Y') { $can_add = false; } if (!$ssi && $can_add) { print "<a title=\"" . translate("New Entry") . "\" href=\"edit_entry.php?"; if (strcmp($user, $GLOBALS["login"])) { print "user={$user}&"; } if (!empty($cat_id)) { print "cat_id={$cat_id}&"; } print "date={$date}\"><img src=\"new.gif\" alt=\"" . translate("New Entry") . "\" class=\"new\" /></a>"; $cnt++; } if (!$ssi) { echo "<a class=\"dayofmonth\" href=\"day.php?"; if (strcmp($user, $GLOBALS["login"])) { echo "user={$user}&"; } if (!empty($cat_id)) { echo "cat_id={$cat_id}&"; } echo "date={$date}\">{$day}</a>"; if ($GLOBALS["DISPLAY_WEEKNUMBER"] == "Y" && date("w", $dateu) == $GLOBALS["WEEK_START"]) { echo " <a title=\"" . translate("Week") . " " . week_number($dateu) . "\" href=\"week.php?date={$date}"; if (strcmp($user, $GLOBALS["login"])) { echo "&user={$user}"; } if (!empty($cat_id)) { echo "&cat_id={$cat_id}"; } echo "\" class=\"weeknumber\">"; echo "(" . translate("Week") . " " . week_number($dateu) . ")</a>"; } print "<br />\n"; $cnt++; } // get all the repeating events for this date and store in array $rep $rep = get_repeating_entries($user, $date, $get_unapproved); $cur_rep = 0; // get all the non-repeating events for this date and store in $ev $ev = get_entries($user, $date, $get_unapproved); 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']; } print_entry($viewid, $date, $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'], $rep[$cur_rep]['cal_category']); $cnt++; } $cur_rep++; } if ($get_unapproved || $ev[$i]['cal_status'] == 'A') { if (!empty($ev[$i]['cal_ext_for_id'])) { $viewid = $ev[$i]['cal_ext_for_id']; $viewname = $ev[$i]['cal_name'] . " (" . translate("cont.") . ")"; } else { $viewid = $ev[$i]['cal_id']; $viewname = $ev[$i]['cal_name']; } print_entry($viewid, $date, $ev[$i]['cal_time'], $ev[$i]['cal_duration'], $viewname, $ev[$i]['cal_description'], $ev[$i]['cal_status'], $ev[$i]['cal_priority'], $ev[$i]['cal_access'], $ev[$i]['cal_login'], $ev[$i]['cal_category']); $cnt++; } } // print out any remaining repeating events while ($cur_rep < count($rep)) { 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']; } print_entry($viewid, $date, $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'], $rep[$cur_rep]['cal_category']); $cnt++; } $cur_rep++; } if ($cnt == 0) { echo " "; } // so the table cell has at least something }
etranslate("Previous"); ?> " class="prev" href="week.php?<?php echo $u_url; ?> date=<?php echo date("Ymd", $prev) . $caturl; ?> "><img src="leftarrow.gif" alt="<?php etranslate("Previous"); ?> " /></a> <span class="date"> Du <?php echo date_to_str(date("Ymd", $wkstart), "", false) . " au " . date_to_str(date("Ymd", $wkend), "", false); echo "</span> <span class=\"weeknumber\">(" . translate("Week") . " " . week_number($wkstart) . ")</span>"; ?> <a title="<?php etranslate("Next"); ?> " class="next" href="week.php?<?php echo $u_url; ?> date=<?php echo date("Ymd", $next) . $caturl; ?> "><img src="rightarrow.gif" alt="<?php etranslate("Next"); ?> " /></a>
<td colspan="2"> <div class="msg msg-info"><p><?php echo __('There is no day without bookings'); ?> </p></div> </td> </tr> <?php } else { ?> <?php foreach ($no_bookings_pager->getResults() as $booking) { ?> <tr> <td class="tl"><a href="<?php echo url_for('timesheet/index?week=' . week_number($booking->day) . '&year=' . date('Y', strtotime($booking->day))); ?> "><?php echo format_date($booking->day, 'P'); ?> </a></td> <td class="tl"><?php echo $booking->User; ?> </td> </tr> <?php } ?> <?php }
} } } echo '</div>'; } if ($row->repeat_method == 'monthly' and $row->month_type == 1) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Month(s) on the', 'sp_calendar') . ' ' . $row->month . '</div>'; } if ($row->repeat_method == 'monthly' and $row->month_type == 2) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Month(s) on the', 'sp_calendar') . ' ' . week_number($row->monthly_list) . ' ' . week_convert($row->month_week) . '</div>'; } if ($row->repeat_method == 'yearly' and $row->month_type == 1) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Year(s) in', 'sp_calendar') . ' ' . date('F', mktime(0, 0, 0, $row->year_month + 1, 0, 0)) . ' ' . __('on the', 'sp_calendar') . ' ' . $row->month . '</div>'; } if ($row->repeat_method == 'yearly' and $row->month_type == 2) { echo '<div style="color:' . $date_color . ';font-size:' . $date_size . 'px; font-family:' . $date_font . '; ' . $date_font_weight . '; ' . $date_font_style . ' ">' . __('Repeat Every', 'sp_calendar') . ' ' . $repeat . ' ' . __('Year(s) in', 'sp_calendar') . ' ' . date('F', mktime(0, 0, 0, $row->year_month + 1, 0, 0)) . ' ' . __('on the', 'sp_calendar') . ' ' . week_number($row->monthly_list) . ' ' . week_convert($row->month_week) . '</div>'; } } echo '<div style="color:' . $title_color . ';font-size:' . $title_size . 'px; font-family:' . $title_font . '; ' . $font_weight . '; ' . $font_style . ' ">' . $row->title . '</div>'; echo '<div style="line-height:20px">' . $row->text_for_date . '</div>'; } else { echo '<div style="color:' . $title_color . ';font-size:' . $title_size . 'px; font-family:' . $title_font . '; ' . $font_weight . '; ' . $font_style . ' ">' . $row->title . '</div>'; echo '<h1 style="text-align:center">There Is No Text For This Event</h1>'; } echo '</div>'; ?> <div style="width:98%;text-align:right; display:<?php if (count($ev_id) == 1) { echo 'none'; } ?>
month_name ( date ( "m", $wkend ) - 1 ), date ( "d", $wkend ), $thisyear ); } else { printf ( "%s %d, %d - %s %d, %d", month_name ( date ( "m", $wkstart ) - 1 ), date ( "d", $wkstart ), date ( "Y", $wkstart ), month_name ( date ( "m", $wkend ) - 1 ), date ( "d", $wkend ), date ( "Y", $wkend ) ); } } */ ?> </b></font> <?php if ($GLOBALS["DISPLAY_WEEKNUMBER"] == "Y") { echo "<br>\n<font size=\"-2\" color=\"{$H2COLOR}\">(" . translate("Week") . " " . week_number($wkstart) . ")</font>"; } ?> <font size="+1" color="<?php echo $H2COLOR; ?> "> <?php if ($single_user == "N") { echo "<br>{$user_fullname}\n"; } if ($categories_enabled == "Y") { echo "<br>\n<br>\n"; print_category_menu('week', sprintf("%04d%02d%02d", $thisyear, $thismonth, $thisday), $cat_id, $friendly); } ?>
/** * Due to php version change older format is no longer valid. So, this function is added as adapter to return value valid for new version * Returns a string representation of the day in the particular week. Example, first Monday. * * @access public * @param date * @return string */ function week_in_the_month_new($date) { $week = week_number($date); $weekday = date("l", strtotime($date)); $date_year = date("Y", strtotime($date)); $month = date("m", strtotime($date)); /* * Find the number of weeks that are in the month and year of the given date */ $num_weeks = num_weeks($date_year, $date_month, 0); switch ($week) { case 1: $week_in_the_month = "this " . $weekday; break; case $num_weeks: $week_in_the_month = "last " . $weekday; break; case 2: $week_in_the_month = "first " . $weekday; break; case 3: $week_in_the_month = "second " . $weekday; break; case 4: $week_in_the_month = "third " . $weekday; break; case 5: $week_in_the_month = "fourth " . $weekday; break; default: break; } return $week_in_the_month; }