Version Description
Changed: Event popup design
Fixed: Generate shortcode popup styles
Download this release
Release Info
Developer | webdorado |
Plugin | Calendar by WD – Responsive Event Calendar |
Version | 1.5.53 |
Comparing to | |
See all releases |
Code changes from version 1.5.52 to 1.5.53
- Theme_functions.php +487 -487
- calendar.php +9 -82
- calendar_functions.html.php +2445 -2445
- calendar_functions.php +723 -723
- elements/calendar-jos.css +114 -0
- front_end/bigcalendarday.php +1046 -1046
- front_end/bigcalendarday_widget.php +722 -722
- front_end/bigcalendarlist.php +989 -989
- front_end/bigcalendarlist_widget.php +680 -680
- front_end/bigcalendarmonth.php +1419 -1419
- front_end/bigcalendarmonth_widget.php +978 -978
- front_end/bigcalendarweek.php +1069 -1069
- front_end/bigcalendarweek_widget.php +746 -746
- front_end/frontend_functions.php +0 -469
Theme_functions.php
CHANGED
@@ -1,488 +1,488 @@
|
|
1 |
-
<?php
|
2 |
-
if (!current_user_can('manage_options')) {
|
3 |
-
die('Access Denied');
|
4 |
-
}
|
5 |
-
// function add_theme_calendar() {
|
6 |
-
// global $wpdb;
|
7 |
-
// html_add_theme();
|
8 |
-
// }
|
9 |
-
|
10 |
-
function show_theme_calendar() {
|
11 |
-
global $wpdb;
|
12 |
-
$order = "title";
|
13 |
-
$asc_desc = "ASC";
|
14 |
-
$order_by = "";
|
15 |
-
$sort["default_style"] = "manage-column column-autor sortable desc";
|
16 |
-
$sort["sortid_by"] = "title";
|
17 |
-
$sort["custom_style"] = "manage-column column-title sorted asc";
|
18 |
-
$sort["1_or_2"] = "2";
|
19 |
-
if (isset($_POST['page_number'])) {
|
20 |
-
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
21 |
-
$sort["sortid_by"] = esc_sql(esc_html(stripslashes($_POST['order_by'])));
|
22 |
-
}
|
23 |
-
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
24 |
-
$sort["custom_style"] = "manage-column column-title sorted asc";
|
25 |
-
$sort["1_or_2"] = "2";
|
26 |
-
$order = esc_sql(esc_html($sort["sortid_by"]));
|
27 |
-
$asc_desc = "ASC";
|
28 |
-
}
|
29 |
-
else {
|
30 |
-
$sort["custom_style"] = "manage-column column-title sorted desc";
|
31 |
-
$sort["1_or_2"] = "1";
|
32 |
-
$order = esc_sql(esc_html($sort["sortid_by"]));
|
33 |
-
$asc_desc = "DESC";
|
34 |
-
}
|
35 |
-
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
36 |
-
$limit = (esc_sql(esc_html(stripslashes($_POST['page_number']))) - 1) * 20;
|
37 |
-
}
|
38 |
-
else {
|
39 |
-
$limit = 0;
|
40 |
-
}
|
41 |
-
}
|
42 |
-
else {
|
43 |
-
$limit = 0;
|
44 |
-
}
|
45 |
-
if (isset($_POST['search_events_by_title'])) {
|
46 |
-
$search_tag = esc_sql(esc_html(stripslashes($_POST['search_events_by_title'])));
|
47 |
-
}
|
48 |
-
else {
|
49 |
-
$search_tag = "";
|
50 |
-
}
|
51 |
-
if ($search_tag) {
|
52 |
-
$where = ' WHERE title LIKE "%%' . esc_sql(esc_html($search_tag)) . '%%"';
|
53 |
-
}
|
54 |
-
else {
|
55 |
-
$where = '';
|
56 |
-
}
|
57 |
-
// get the total number of records
|
58 |
-
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_theme" . str_replace('%%','%',$where);
|
59 |
-
$total = $wpdb->get_var($query);
|
60 |
-
$pageNav['total'] = $total;
|
61 |
-
$pageNav['limit'] = $limit / 20 + 1;
|
62 |
-
if( $order == "id" || $order == "title" ) $order_by = " ORDER BY " . $order . " " . $asc_desc;
|
63 |
-
$query = $wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_theme" . $where . " " . $order . " " . " LIMIT %d,20",$limit);
|
64 |
-
$rows = $wpdb->get_results( $query);
|
65 |
-
html_show_theme_calendar($rows, $pageNav, $sort);
|
66 |
-
}
|
67 |
-
|
68 |
-
function apply_theme_calendar($id) {
|
69 |
-
global $wpdb;
|
70 |
-
$title = ((isset($_POST["title"])) ? esc_sql(esc_html(stripslashes($_POST["title"]))) : '');
|
71 |
-
$width = ((isset($_POST["width"])) ? esc_sql(esc_html(stripslashes($_POST["width"]))) : '');
|
72 |
-
$week_start_day = ((isset($_POST["week_start_day"])) ? esc_sql(esc_html(stripslashes($_POST["week_start_day"]))) : '');
|
73 |
-
$border_color = ((isset($_POST["border_color"])) ? esc_sql(esc_html(stripslashes($_POST["border_color"]))) : '');
|
74 |
-
$border_radius = ((isset($_POST["border_radius"])) ? esc_sql(esc_html(stripslashes($_POST["border_radius"]))) : '');
|
75 |
-
$border_width = ((isset($_POST["border_width"])) ? esc_sql(esc_html(stripslashes($_POST["border_width"]))) : '');
|
76 |
-
$show_cat = ((isset($_POST["show_cat"])) ? esc_sql(esc_html(stripslashes($_POST["show_cat"]))) : '');
|
77 |
-
$top_height = ((isset($_POST["top_height"])) ? esc_sql(esc_html(stripslashes($_POST["top_height"]))) : '');
|
78 |
-
$bg_top = ((isset($_POST["bg_top"])) ? esc_sql(esc_html(stripslashes($_POST["bg_top"]))) : '');
|
79 |
-
$year_font_size = ((isset($_POST["year_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["year_font_size"]))) : '');
|
80 |
-
$text_color_year = ((isset($_POST["text_color_year"])) ? esc_sql(esc_html(stripslashes($_POST["text_color_year"]))) : '');
|
81 |
-
$arrow_color_year = ((isset($_POST["arrow_color_year"])) ? esc_sql(esc_html(stripslashes($_POST["arrow_color_year"]))) : '');
|
82 |
-
$month_type = ((isset($_POST["month_type"])) ? esc_sql(esc_html(stripslashes($_POST["month_type"]))) : '');
|
83 |
-
$month_font_size = ((isset($_POST["month_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["month_font_size"]))) : '');
|
84 |
-
$text_color_month = ((isset($_POST["text_color_month"])) ? esc_sql(esc_html(stripslashes($_POST["text_color_month"]))) : '');
|
85 |
-
$date_font = ((isset($_POST["date_font"])) ? esc_sql(esc_html(stripslashes($_POST["date_font"]))) : '');
|
86 |
-
$date_style = ((isset($_POST["date_style"])) ? esc_sql(esc_html(stripslashes($_POST["date_style"]))) : '');
|
87 |
-
$next_prev_event_bgcolor = ((isset($_POST["next_prev_event_bgcolor"])) ? esc_sql(esc_html(stripslashes($_POST["next_prev_event_bgcolor"]))) : '');
|
88 |
-
$next_prev_event_arrowcolor = ((isset($_POST["next_prev_event_arrowcolor"])) ? esc_sql(esc_html(stripslashes($_POST["next_prev_event_arrowcolor"]))) : '');
|
89 |
-
$show_event_bgcolor = ((isset($_POST["show_event_bgcolor"])) ? esc_sql(esc_html(stripslashes($_POST["show_event_bgcolor"]))) : '');
|
90 |
-
$popup_width = ((isset($_POST["popup_width"])) ? esc_sql(esc_html(stripslashes($_POST["popup_width"]))) : '');
|
91 |
-
$popup_height = ((isset($_POST["popup_height"])) ? esc_sql(esc_html(stripslashes($_POST["popup_height"]))) : '');
|
92 |
-
$number_of_shown_evetns = ((isset($_POST["number_of_shown_evetns"])) ? esc_sql(esc_html(stripslashes($_POST["number_of_shown_evetns"]))) : '');
|
93 |
-
$show_repeat = ((isset($_POST["show_repeat"])) ? esc_sql(esc_html(stripslashes($_POST["show_repeat"]))) : '');
|
94 |
-
$day_start = ((isset($_POST["show_event"])) ? esc_sql(esc_html(stripslashes($_POST["show_event"]))) : '');
|
95 |
-
$views_tabs_font_size = ((isset($_POST["views_tabs_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["views_tabs_font_size"]))) : '');
|
96 |
-
$views_tabs_text_color = ((isset($_POST["views_tabs_text_color"])) ? esc_sql(esc_html(stripslashes($_POST["views_tabs_text_color"]))) : '');
|
97 |
-
$views_tabs_bg_color = ((isset($_POST["views_tabs_bg_color"])) ? esc_sql(esc_html(stripslashes($_POST["views_tabs_bg_color"]))) : '');
|
98 |
-
$day_month_font_color = ((isset($_POST["day_month_font_color"])) ? esc_sql(esc_html(stripslashes($_POST["day_month_font_color"]))) : '');
|
99 |
-
$week_font_color = ((isset($_POST["week_font_color"])) ? esc_sql(esc_html(stripslashes($_POST["week_font_color"]))) : '');
|
100 |
-
$day_month_font_size = ((isset($_POST["day_month_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["day_month_font_size"]))) : '');
|
101 |
-
$week_font_size = ((isset($_POST["week_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["week_font_size"]))) : '');
|
102 |
-
$ev_title_bg_color = ((isset($_POST["ev_title_bg_color"])) ? esc_sql(esc_html(stripslashes($_POST["ev_title_bg_color"]))) : '');
|
103 |
-
$date_height = ((isset($_POST["date_height"])) ? esc_sql(esc_html(stripslashes($_POST["date_height"]))) : '');
|
104 |
-
$event_table_height = ((isset($_POST["event_table_height"])) ? esc_sql(esc_html(stripslashes($_POST["event_table_height"]))) : '');
|
105 |
-
$event_num_font_size = ((isset($_POST["event_num_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["event_num_font_size"]))) : '');
|
106 |
-
$date_font_size = ((isset($_POST["date_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["date_font_size"]))) : '');
|
107 |
-
$event_num_color = ((isset($_POST["event_num_color"])) ? esc_sql(esc_html(stripslashes($_POST["event_num_color"]))) : '');
|
108 |
-
$event_num_bg_color2 = ((isset($_POST["event_num_bg_color2"])) ? esc_sql(esc_html(stripslashes($_POST["event_num_bg_color2"]))) : '');
|
109 |
-
$event_num_bg_color1 = ((isset($_POST["event_num_bg_color1"])) ? esc_sql(esc_html(stripslashes($_POST["event_num_bg_color1"]))) : '');
|
110 |
-
$event_bg_color2 = ((isset($_POST["event_bg_color2"])) ? esc_sql(esc_html(stripslashes($_POST["event_bg_color2"]))) : '');
|
111 |
-
$event_bg_color1 = ((isset($_POST["event_bg_color1"])) ? esc_sql(esc_html(stripslashes($_POST["event_bg_color1"]))) : '');
|
112 |
-
$date_bg_color = ((isset($_POST["date_bg_color"])) ? esc_sql(esc_html(stripslashes($_POST["date_bg_color"]))) : '');
|
113 |
-
if ($id === -1) {
|
114 |
-
$save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_theme', array(
|
115 |
-
'id' => NULL,
|
116 |
-
'title' => $title,
|
117 |
-
'width' => $width,
|
118 |
-
'week_start_day' => $week_start_day,
|
119 |
-
'border_color' => $border_color,
|
120 |
-
'border_radius' => $border_radius,
|
121 |
-
'border_width' => $border_width,
|
122 |
-
'show_cat' => $show_cat,
|
123 |
-
'top_height' => $top_height,
|
124 |
-
'bg_top' => $bg_top,
|
125 |
-
'year_font_size' => $year_font_size,
|
126 |
-
'text_color_year' => $text_color_year,
|
127 |
-
'arrow_color_year' => $arrow_color_year,
|
128 |
-
'month_type' => $month_type,
|
129 |
-
'month_font_size' => $month_font_size,
|
130 |
-
'text_color_month' => $text_color_month,
|
131 |
-
'arrow_color_month' => $arrow_color_month,
|
132 |
-
'next_month_text_color' => $next_month_text_color,
|
133 |
-
'next_month_font_size' => $next_month_font_size,
|
134 |
-
'next_month_arrow_color' => $next_month_arrow_color,
|
135 |
-
'prev_month_text_color' => $prev_month_text_color,
|
136 |
-
'prev_month_font_size' => $prev_month_font_size,
|
137 |
-
'prev_month_arrow_color' => $prev_month_arrow_color,
|
138 |
-
'arrow_size' => $arrow_size,
|
139 |
-
'text_color_week_days' => $text_color_week_days,
|
140 |
-
'week_days_cell_height' => $week_days_cell_height,
|
141 |
-
'weekdays_bg_color' => $weekdays_bg_color,
|
142 |
-
'weekday_sunday_bg_color' => $weekday_sunday_bg_color,
|
143 |
-
'weekdays_font_size' => $weekdays_font_size,
|
144 |
-
'bg_bottom' => $bg_bottom,
|
145 |
-
'cell_height' => $cell_height,
|
146 |
-
'text_color_other_months' => $text_color_other_months,
|
147 |
-
'bg_color_other_months' => $bg_color_other_months,
|
148 |
-
'text_color_this_month_unevented' => $text_color_this_month_unevented,
|
149 |
-
'text_color_this_month_evented' => $text_color_this_month_evented,
|
150 |
-
'bg_color_this_month_evented' => $bg_color_this_month_evented,
|
151 |
-
'event_title_color' => $event_title_color,
|
152 |
-
'current_day_border_color' => $current_day_border_color,
|
153 |
-
'cell_border_color' => $cell_border_color,
|
154 |
-
'text_color_sun_days' => $text_color_sun_days,
|
155 |
-
'sundays_bg_color' => $sundays_bg_color,
|
156 |
-
'sundays_font_size' => $sundays_font_size,
|
157 |
-
'other_days_font_size' => $other_days_font_size,
|
158 |
-
'show_time' => $show_time,
|
159 |
-
'date_format' => $date_format,
|
160 |
-
'title_color' => $title_color,
|
161 |
-
'title_font_size' => $title_font_size,
|
162 |
-
'title_font' => $title_font,
|
163 |
-
'title_style' => $title_style,
|
164 |
-
'date_color' => $date_color,
|
165 |
-
'date_size' => $date_size,
|
166 |
-
'date_font' => $date_font,
|
167 |
-
'date_style' => $date_style,
|
168 |
-
'next_prev_event_bgcolor' => $next_prev_event_bgcolor,
|
169 |
-
'next_prev_event_arrowcolor' => $next_prev_event_arrowcolor,
|
170 |
-
'show_event_bgcolor' => $show_event_bgcolor,
|
171 |
-
'popup_width' => $popup_width,
|
172 |
-
'popup_height' => $popup_height,
|
173 |
-
'number_of_shown_evetns' => $number_of_shown_evetns,
|
174 |
-
'show_repeat' => $show_repeat,
|
175 |
-
'day_start' => $show_event,
|
176 |
-
'views_tabs_font_size' => $views_tabs_font_size,
|
177 |
-
'views_tabs_text_color' => $views_tabs_text_color,
|
178 |
-
'views_tabs_bg_color' => $views_tabs_bg_color,
|
179 |
-
'day_month_font_color' => $day_month_font_color,
|
180 |
-
'week_font_color' => $week_font_color,
|
181 |
-
'day_month_font_size' => $day_month_font_size,
|
182 |
-
'week_font_size' => $week_font_size,
|
183 |
-
'ev_title_bg_color' => $ev_title_bg_color,
|
184 |
-
'date_height' => $date_height,
|
185 |
-
'event_table_height' => $event_table_height,
|
186 |
-
'event_num_font_size' => $event_num_font_size,
|
187 |
-
'date_font_size' => $date_font_size,
|
188 |
-
'event_num_color' => $event_num_color,
|
189 |
-
'event_num_bg_color2' => $event_num_bg_color2,
|
190 |
-
'event_num_bg_color1' => $event_num_bg_color1,
|
191 |
-
'event_bg_color2' => $event_bg_color2,
|
192 |
-
'event_bg_color1' => $event_bg_color1,
|
193 |
-
'date_bg_color' => $date_bg_color,
|
194 |
-
'day_start' => $show_event,
|
195 |
-
), array(
|
196 |
-
'%d',
|
197 |
-
'%s',
|
198 |
-
'%s',
|
199 |
-
'%s',
|
200 |
-
'%s',
|
201 |
-
'%s',
|
202 |
-
'%s',
|
203 |
-
'%s',
|
204 |
-
'%s',
|
205 |
-
'%s',
|
206 |
-
'%s',
|
207 |
-
'%s',
|
208 |
-
'%s',
|
209 |
-
'%s',
|
210 |
-
'%s',
|
211 |
-
'%s',
|
212 |
-
'%s',
|
213 |
-
'%s',
|
214 |
-
'%s',
|
215 |
-
'%s',
|
216 |
-
'%s',
|
217 |
-
'%s',
|
218 |
-
'%s',
|
219 |
-
'%s',
|
220 |
-
'%s',
|
221 |
-
'%s',
|
222 |
-
'%s',
|
223 |
-
'%s',
|
224 |
-
'%s',
|
225 |
-
'%s',
|
226 |
-
'%s',
|
227 |
-
'%s',
|
228 |
-
'%s',
|
229 |
-
'%s',
|
230 |
-
'%s',
|
231 |
-
'%s',
|
232 |
-
'%s',
|
233 |
-
'%s',
|
234 |
-
'%s',
|
235 |
-
'%s',
|
236 |
-
'%s',
|
237 |
-
'%s',
|
238 |
-
'%s',
|
239 |
-
'%s',
|
240 |
-
'%s',
|
241 |
-
'%s',
|
242 |
-
'%s',
|
243 |
-
'%s',
|
244 |
-
'%s',
|
245 |
-
'%s',
|
246 |
-
'%s',
|
247 |
-
'%s',
|
248 |
-
'%s',
|
249 |
-
'%s',
|
250 |
-
'%s',
|
251 |
-
'%s',
|
252 |
-
'%s',
|
253 |
-
'%s',
|
254 |
-
'%d',
|
255 |
-
'%d',
|
256 |
-
'%s',
|
257 |
-
'%s',
|
258 |
-
'%s',
|
259 |
-
'%s',
|
260 |
-
'%s',
|
261 |
-
'%s',
|
262 |
-
'%s',
|
263 |
-
'%s',
|
264 |
-
'%s',
|
265 |
-
'%s',
|
266 |
-
'%s',
|
267 |
-
'%s',
|
268 |
-
'%s',
|
269 |
-
'%s',
|
270 |
-
'%s',
|
271 |
-
'%s',
|
272 |
-
'%s',
|
273 |
-
'%s',
|
274 |
-
'%s',
|
275 |
-
'%d',
|
276 |
-
'%d'
|
277 |
-
));
|
278 |
-
}
|
279 |
-
else {
|
280 |
-
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_theme', array(
|
281 |
-
'title' => $title,
|
282 |
-
'width' => $width,
|
283 |
-
'week_start_day' => $week_start_day,
|
284 |
-
'border_color' => $border_color,
|
285 |
-
'border_radius' => $border_radius,
|
286 |
-
'border_width' => $border_width,
|
287 |
-
'top_height' => $top_height,
|
288 |
-
'bg_top' => $bg_top,
|
289 |
-
'year_font_size' => $year_font_size,
|
290 |
-
'text_color_year' => $text_color_year,
|
291 |
-
'arrow_color_year' => $arrow_color_year,
|
292 |
-
'month_type' => $month_type,
|
293 |
-
'month_font_size' => $month_font_size,
|
294 |
-
'text_color_month' => $text_color_month,
|
295 |
-
'arrow_color_month' => $arrow_color_month,
|
296 |
-
'next_month_text_color' => $next_month_text_color,
|
297 |
-
'next_month_font_size' => $next_month_font_size,
|
298 |
-
'next_month_arrow_color' => $next_month_arrow_color,
|
299 |
-
'prev_month_text_color' => $prev_month_text_color,
|
300 |
-
'prev_month_font_size' => $prev_month_font_size,
|
301 |
-
'prev_month_arrow_color' => $prev_month_arrow_color,
|
302 |
-
'arrow_size' => $arrow_size,
|
303 |
-
'text_color_week_days' => $text_color_week_days,
|
304 |
-
'week_days_cell_height' => $week_days_cell_height,
|
305 |
-
'weekdays_bg_color' => $weekdays_bg_color,
|
306 |
-
'weekday_sunday_bg_color' => $weekday_sunday_bg_color,
|
307 |
-
'weekdays_font_size' => $weekdays_font_size,
|
308 |
-
'bg_bottom' => $bg_bottom,
|
309 |
-
'cell_height' => $cell_height,
|
310 |
-
'text_color_other_months' => $text_color_other_months,
|
311 |
-
'bg_color_other_months' => $bg_color_other_months,
|
312 |
-
'text_color_this_month_unevented' => $text_color_this_month_unevented,
|
313 |
-
'text_color_this_month_evented' => $text_color_this_month_evented,
|
314 |
-
'bg_color_this_month_evented' => $bg_color_this_month_evented,
|
315 |
-
'event_title_color' => $event_title_color,
|
316 |
-
'current_day_border_color' => $current_day_border_color,
|
317 |
-
'cell_border_color' => $cell_border_color,
|
318 |
-
'text_color_sun_days' => $text_color_sun_days,
|
319 |
-
'sundays_bg_color' => $sundays_bg_color,
|
320 |
-
'sundays_font_size' => $sundays_font_size,
|
321 |
-
'other_days_font_size' => $other_days_font_size,
|
322 |
-
'show_time' => $show_time,
|
323 |
-
'date_format' => $date_format,
|
324 |
-
'title_color' => $title_color,
|
325 |
-
'title_font_size' => $title_font_size,
|
326 |
-
'title_font' => $title_font,
|
327 |
-
'title_style' => $title_style,
|
328 |
-
'date_color' => $date_color,
|
329 |
-
'date_size' => $date_size,
|
330 |
-
'date_font' => $date_font,
|
331 |
-
'date_style' => $date_style,
|
332 |
-
'next_prev_event_bgcolor' => $next_prev_event_bgcolor,
|
333 |
-
'next_prev_event_arrowcolor' => $next_prev_event_arrowcolor,
|
334 |
-
'show_event_bgcolor' => $show_event_bgcolor,
|
335 |
-
'popup_width' => $popup_width,
|
336 |
-
'popup_height' => $popup_height,
|
337 |
-
'number_of_shown_evetns' => $number_of_shown_evetns,
|
338 |
-
'show_repeat' => $show_repeat,
|
339 |
-
'day_start' => $show_event,
|
340 |
-
'views_tabs_font_size' => $views_tabs_font_size,
|
341 |
-
'views_tabs_text_color' => $views_tabs_text_color,
|
342 |
-
'views_tabs_bg_color' => $views_tabs_bg_color,
|
343 |
-
'day_month_font_color' => $day_month_font_color,
|
344 |
-
'week_font_color' => $week_font_color,
|
345 |
-
'day_month_font_size' => $day_month_font_size,
|
346 |
-
'week_font_size' => $week_font_size,
|
347 |
-
'ev_title_bg_color' => $ev_title_bg_color,
|
348 |
-
'date_height' => $date_height,
|
349 |
-
'event_table_height' => $event_table_height,
|
350 |
-
'event_num_font_size' => $event_num_font_size,
|
351 |
-
'date_font_size' => $date_font_size,
|
352 |
-
'event_num_color' => $event_num_color,
|
353 |
-
'event_num_bg_color2' => $event_num_bg_color2,
|
354 |
-
'event_num_bg_color1' => $event_num_bg_color1,
|
355 |
-
'event_bg_color2' => $event_bg_color2,
|
356 |
-
'event_bg_color1' => $event_bg_color1,
|
357 |
-
'date_bg_color' => $date_bg_color,
|
358 |
-
'day_start' => $show_event,
|
359 |
-
'show_cat' => $show_cat,
|
360 |
-
), array('id' => $id), array(
|
361 |
-
'%s',
|
362 |
-
'%s',
|
363 |
-
'%s',
|
364 |
-
'%s',
|
365 |
-
'%s',
|
366 |
-
'%s',
|
367 |
-
'%s',
|
368 |
-
'%s',
|
369 |
-
'%s',
|
370 |
-
'%s',
|
371 |
-
'%s',
|
372 |
-
'%s',
|
373 |
-
'%s',
|
374 |
-
'%s',
|
375 |
-
'%s',
|
376 |
-
'%s',
|
377 |
-
'%s',
|
378 |
-
'%s',
|
379 |
-
'%s',
|
380 |
-
'%s',
|
381 |
-
'%s',
|
382 |
-
'%s',
|
383 |
-
'%s',
|
384 |
-
'%s',
|
385 |
-
'%s',
|
386 |
-
'%s',
|
387 |
-
'%s',
|
388 |
-
'%s',
|
389 |
-
'%s',
|
390 |
-
'%s',
|
391 |
-
'%s',
|
392 |
-
'%s',
|
393 |
-
'%s',
|
394 |
-
'%s',
|
395 |
-
'%s',
|
396 |
-
'%s',
|
397 |
-
'%s',
|
398 |
-
'%s',
|
399 |
-
'%s',
|
400 |
-
'%s',
|
401 |
-
'%s',
|
402 |
-
'%s',
|
403 |
-
'%s',
|
404 |
-
'%s',
|
405 |
-
'%s',
|
406 |
-
'%s',
|
407 |
-
'%s',
|
408 |
-
'%s',
|
409 |
-
'%s',
|
410 |
-
'%s',
|
411 |
-
'%s',
|
412 |
-
'%s',
|
413 |
-
'%s',
|
414 |
-
'%s',
|
415 |
-
'%s',
|
416 |
-
'%s',
|
417 |
-
'%d',
|
418 |
-
'%d',
|
419 |
-
'%s',
|
420 |
-
'%s',
|
421 |
-
'%s',
|
422 |
-
'%s',
|
423 |
-
'%s',
|
424 |
-
'%s',
|
425 |
-
'%s',
|
426 |
-
'%s',
|
427 |
-
'%s',
|
428 |
-
'%s',
|
429 |
-
'%s',
|
430 |
-
'%s',
|
431 |
-
'%s',
|
432 |
-
'%s',
|
433 |
-
'%s',
|
434 |
-
'%s',
|
435 |
-
'%s',
|
436 |
-
'%s',
|
437 |
-
'%s',
|
438 |
-
'%d',
|
439 |
-
'%d',
|
440 |
-
), array('%d'));
|
441 |
-
}
|
442 |
-
if ($save_or_no === FALSE) {
|
443 |
-
?>
|
444 |
-
<div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
|
445 |
-
<?php
|
446 |
-
return FALSE;
|
447 |
-
}
|
448 |
-
else {
|
449 |
-
?>
|
450 |
-
<div class="updated"><p><strong>Theme Saved.</strong></p></div>
|
451 |
-
<?php
|
452 |
-
return TRUE;
|
453 |
-
}
|
454 |
-
}
|
455 |
-
|
456 |
-
function edit_theme_calendar($id) {
|
457 |
-
global $wpdb;
|
458 |
-
if ($id == 0) {
|
459 |
-
$row = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=1');
|
460 |
-
}
|
461 |
-
else {
|
462 |
-
$row = $wpdb->get_row($wpdb->prepare ('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d' , $id ));
|
463 |
-
}
|
464 |
-
html_edit_theme_calendar($row, $id);
|
465 |
-
}
|
466 |
-
|
467 |
-
function remove_theme_calendar($id) {
|
468 |
-
if ($id > 0 && $id < 18) {
|
469 |
-
?>
|
470 |
-
<div id="message" class="error"><p>You can't delete deafult theme.</p></div>
|
471 |
-
<?php
|
472 |
-
return FALSE;
|
473 |
-
}
|
474 |
-
global $wpdb;
|
475 |
-
$sql_remove_tag = $wpdb->prepare ( "DELETE FROM " . $wpdb->prefix . "spidercalendar_theme WHERE id=%d", $id );
|
476 |
-
if (!$wpdb->query($sql_remove_tag)) {
|
477 |
-
?>
|
478 |
-
<div id="message" class="error"><p>Spider Calendar Theme Not Deleted</p></div>
|
479 |
-
<?php
|
480 |
-
}
|
481 |
-
else {
|
482 |
-
?>
|
483 |
-
<div class="updated"><p><strong>Item Deleted.</strong></p></div>
|
484 |
-
<?php
|
485 |
-
}
|
486 |
-
}
|
487 |
-
|
488 |
?>
|
1 |
+
<?php
|
2 |
+
if (!current_user_can('manage_options')) {
|
3 |
+
die('Access Denied');
|
4 |
+
}
|
5 |
+
// function add_theme_calendar() {
|
6 |
+
// global $wpdb;
|
7 |
+
// html_add_theme();
|
8 |
+
// }
|
9 |
+
|
10 |
+
function show_theme_calendar() {
|
11 |
+
global $wpdb;
|
12 |
+
$order = "title";
|
13 |
+
$asc_desc = "ASC";
|
14 |
+
$order_by = "";
|
15 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
16 |
+
$sort["sortid_by"] = "title";
|
17 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
18 |
+
$sort["1_or_2"] = "2";
|
19 |
+
if (isset($_POST['page_number'])) {
|
20 |
+
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
21 |
+
$sort["sortid_by"] = esc_sql(esc_html(stripslashes($_POST['order_by'])));
|
22 |
+
}
|
23 |
+
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
24 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
25 |
+
$sort["1_or_2"] = "2";
|
26 |
+
$order = esc_sql(esc_html($sort["sortid_by"]));
|
27 |
+
$asc_desc = "ASC";
|
28 |
+
}
|
29 |
+
else {
|
30 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
31 |
+
$sort["1_or_2"] = "1";
|
32 |
+
$order = esc_sql(esc_html($sort["sortid_by"]));
|
33 |
+
$asc_desc = "DESC";
|
34 |
+
}
|
35 |
+
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
36 |
+
$limit = (esc_sql(esc_html(stripslashes($_POST['page_number']))) - 1) * 20;
|
37 |
+
}
|
38 |
+
else {
|
39 |
+
$limit = 0;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
else {
|
43 |
+
$limit = 0;
|
44 |
+
}
|
45 |
+
if (isset($_POST['search_events_by_title'])) {
|
46 |
+
$search_tag = esc_sql(esc_html(stripslashes($_POST['search_events_by_title'])));
|
47 |
+
}
|
48 |
+
else {
|
49 |
+
$search_tag = "";
|
50 |
+
}
|
51 |
+
if ($search_tag) {
|
52 |
+
$where = ' WHERE title LIKE "%%' . esc_sql(esc_html($search_tag)) . '%%"';
|
53 |
+
}
|
54 |
+
else {
|
55 |
+
$where = '';
|
56 |
+
}
|
57 |
+
// get the total number of records
|
58 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_theme" . str_replace('%%','%',$where);
|
59 |
+
$total = $wpdb->get_var($query);
|
60 |
+
$pageNav['total'] = $total;
|
61 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
62 |
+
if( $order == "id" || $order == "title" ) $order_by = " ORDER BY " . $order . " " . $asc_desc;
|
63 |
+
$query = $wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_theme" . $where . " " . $order . " " . " LIMIT %d,20",$limit);
|
64 |
+
$rows = $wpdb->get_results( $query);
|
65 |
+
html_show_theme_calendar($rows, $pageNav, $sort);
|
66 |
+
}
|
67 |
+
|
68 |
+
function apply_theme_calendar($id) {
|
69 |
+
global $wpdb;
|
70 |
+
$title = ((isset($_POST["title"])) ? esc_sql(esc_html(stripslashes($_POST["title"]))) : '');
|
71 |
+
$width = ((isset($_POST["width"])) ? esc_sql(esc_html(stripslashes($_POST["width"]))) : '');
|
72 |
+
$week_start_day = ((isset($_POST["week_start_day"])) ? esc_sql(esc_html(stripslashes($_POST["week_start_day"]))) : '');
|
73 |
+
$border_color = ((isset($_POST["border_color"])) ? esc_sql(esc_html(stripslashes($_POST["border_color"]))) : '');
|
74 |
+
$border_radius = ((isset($_POST["border_radius"])) ? esc_sql(esc_html(stripslashes($_POST["border_radius"]))) : '');
|
75 |
+
$border_width = ((isset($_POST["border_width"])) ? esc_sql(esc_html(stripslashes($_POST["border_width"]))) : '');
|
76 |
+
$show_cat = ((isset($_POST["show_cat"])) ? esc_sql(esc_html(stripslashes($_POST["show_cat"]))) : '');
|
77 |
+
$top_height = ((isset($_POST["top_height"])) ? esc_sql(esc_html(stripslashes($_POST["top_height"]))) : '');
|
78 |
+
$bg_top = ((isset($_POST["bg_top"])) ? esc_sql(esc_html(stripslashes($_POST["bg_top"]))) : '');
|
79 |
+
$year_font_size = ((isset($_POST["year_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["year_font_size"]))) : '');
|
80 |
+
$text_color_year = ((isset($_POST["text_color_year"])) ? esc_sql(esc_html(stripslashes($_POST["text_color_year"]))) : '');
|
81 |
+
$arrow_color_year = ((isset($_POST["arrow_color_year"])) ? esc_sql(esc_html(stripslashes($_POST["arrow_color_year"]))) : '');
|
82 |
+
$month_type = ((isset($_POST["month_type"])) ? esc_sql(esc_html(stripslashes($_POST["month_type"]))) : '');
|
83 |
+
$month_font_size = ((isset($_POST["month_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["month_font_size"]))) : '');
|
84 |
+
$text_color_month = ((isset($_POST["text_color_month"])) ? esc_sql(esc_html(stripslashes($_POST["text_color_month"]))) : '');
|
85 |
+
$date_font = ((isset($_POST["date_font"])) ? esc_sql(esc_html(stripslashes($_POST["date_font"]))) : '');
|
86 |
+
$date_style = ((isset($_POST["date_style"])) ? esc_sql(esc_html(stripslashes($_POST["date_style"]))) : '');
|
87 |
+
$next_prev_event_bgcolor = ((isset($_POST["next_prev_event_bgcolor"])) ? esc_sql(esc_html(stripslashes($_POST["next_prev_event_bgcolor"]))) : '');
|
88 |
+
$next_prev_event_arrowcolor = ((isset($_POST["next_prev_event_arrowcolor"])) ? esc_sql(esc_html(stripslashes($_POST["next_prev_event_arrowcolor"]))) : '');
|
89 |
+
$show_event_bgcolor = ((isset($_POST["show_event_bgcolor"])) ? esc_sql(esc_html(stripslashes($_POST["show_event_bgcolor"]))) : '');
|
90 |
+
$popup_width = ((isset($_POST["popup_width"])) ? esc_sql(esc_html(stripslashes($_POST["popup_width"]))) : '');
|
91 |
+
$popup_height = ((isset($_POST["popup_height"])) ? esc_sql(esc_html(stripslashes($_POST["popup_height"]))) : '');
|
92 |
+
$number_of_shown_evetns = ((isset($_POST["number_of_shown_evetns"])) ? esc_sql(esc_html(stripslashes($_POST["number_of_shown_evetns"]))) : '');
|
93 |
+
$show_repeat = ((isset($_POST["show_repeat"])) ? esc_sql(esc_html(stripslashes($_POST["show_repeat"]))) : '');
|
94 |
+
$day_start = ((isset($_POST["show_event"])) ? esc_sql(esc_html(stripslashes($_POST["show_event"]))) : '');
|
95 |
+
$views_tabs_font_size = ((isset($_POST["views_tabs_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["views_tabs_font_size"]))) : '');
|
96 |
+
$views_tabs_text_color = ((isset($_POST["views_tabs_text_color"])) ? esc_sql(esc_html(stripslashes($_POST["views_tabs_text_color"]))) : '');
|
97 |
+
$views_tabs_bg_color = ((isset($_POST["views_tabs_bg_color"])) ? esc_sql(esc_html(stripslashes($_POST["views_tabs_bg_color"]))) : '');
|
98 |
+
$day_month_font_color = ((isset($_POST["day_month_font_color"])) ? esc_sql(esc_html(stripslashes($_POST["day_month_font_color"]))) : '');
|
99 |
+
$week_font_color = ((isset($_POST["week_font_color"])) ? esc_sql(esc_html(stripslashes($_POST["week_font_color"]))) : '');
|
100 |
+
$day_month_font_size = ((isset($_POST["day_month_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["day_month_font_size"]))) : '');
|
101 |
+
$week_font_size = ((isset($_POST["week_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["week_font_size"]))) : '');
|
102 |
+
$ev_title_bg_color = ((isset($_POST["ev_title_bg_color"])) ? esc_sql(esc_html(stripslashes($_POST["ev_title_bg_color"]))) : '');
|
103 |
+
$date_height = ((isset($_POST["date_height"])) ? esc_sql(esc_html(stripslashes($_POST["date_height"]))) : '');
|
104 |
+
$event_table_height = ((isset($_POST["event_table_height"])) ? esc_sql(esc_html(stripslashes($_POST["event_table_height"]))) : '');
|
105 |
+
$event_num_font_size = ((isset($_POST["event_num_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["event_num_font_size"]))) : '');
|
106 |
+
$date_font_size = ((isset($_POST["date_font_size"])) ? esc_sql(esc_html(stripslashes($_POST["date_font_size"]))) : '');
|
107 |
+
$event_num_color = ((isset($_POST["event_num_color"])) ? esc_sql(esc_html(stripslashes($_POST["event_num_color"]))) : '');
|
108 |
+
$event_num_bg_color2 = ((isset($_POST["event_num_bg_color2"])) ? esc_sql(esc_html(stripslashes($_POST["event_num_bg_color2"]))) : '');
|
109 |
+
$event_num_bg_color1 = ((isset($_POST["event_num_bg_color1"])) ? esc_sql(esc_html(stripslashes($_POST["event_num_bg_color1"]))) : '');
|
110 |
+
$event_bg_color2 = ((isset($_POST["event_bg_color2"])) ? esc_sql(esc_html(stripslashes($_POST["event_bg_color2"]))) : '');
|
111 |
+
$event_bg_color1 = ((isset($_POST["event_bg_color1"])) ? esc_sql(esc_html(stripslashes($_POST["event_bg_color1"]))) : '');
|
112 |
+
$date_bg_color = ((isset($_POST["date_bg_color"])) ? esc_sql(esc_html(stripslashes($_POST["date_bg_color"]))) : '');
|
113 |
+
if ($id === -1) {
|
114 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_theme', array(
|
115 |
+
'id' => NULL,
|
116 |
+
'title' => $title,
|
117 |
+
'width' => $width,
|
118 |
+
'week_start_day' => $week_start_day,
|
119 |
+
'border_color' => $border_color,
|
120 |
+
'border_radius' => $border_radius,
|
121 |
+
'border_width' => $border_width,
|
122 |
+
'show_cat' => $show_cat,
|
123 |
+
'top_height' => $top_height,
|
124 |
+
'bg_top' => $bg_top,
|
125 |
+
'year_font_size' => $year_font_size,
|
126 |
+
'text_color_year' => $text_color_year,
|
127 |
+
'arrow_color_year' => $arrow_color_year,
|
128 |
+
'month_type' => $month_type,
|
129 |
+
'month_font_size' => $month_font_size,
|
130 |
+
'text_color_month' => $text_color_month,
|
131 |
+
'arrow_color_month' => $arrow_color_month,
|
132 |
+
'next_month_text_color' => $next_month_text_color,
|
133 |
+
'next_month_font_size' => $next_month_font_size,
|
134 |
+
'next_month_arrow_color' => $next_month_arrow_color,
|
135 |
+
'prev_month_text_color' => $prev_month_text_color,
|
136 |
+
'prev_month_font_size' => $prev_month_font_size,
|
137 |
+
'prev_month_arrow_color' => $prev_month_arrow_color,
|
138 |
+
'arrow_size' => $arrow_size,
|
139 |
+
'text_color_week_days' => $text_color_week_days,
|
140 |
+
'week_days_cell_height' => $week_days_cell_height,
|
141 |
+
'weekdays_bg_color' => $weekdays_bg_color,
|
142 |
+
'weekday_sunday_bg_color' => $weekday_sunday_bg_color,
|
143 |
+
'weekdays_font_size' => $weekdays_font_size,
|
144 |
+
'bg_bottom' => $bg_bottom,
|
145 |
+
'cell_height' => $cell_height,
|
146 |
+
'text_color_other_months' => $text_color_other_months,
|
147 |
+
'bg_color_other_months' => $bg_color_other_months,
|
148 |
+
'text_color_this_month_unevented' => $text_color_this_month_unevented,
|
149 |
+
'text_color_this_month_evented' => $text_color_this_month_evented,
|
150 |
+
'bg_color_this_month_evented' => $bg_color_this_month_evented,
|
151 |
+
'event_title_color' => $event_title_color,
|
152 |
+
'current_day_border_color' => $current_day_border_color,
|
153 |
+
'cell_border_color' => $cell_border_color,
|
154 |
+
'text_color_sun_days' => $text_color_sun_days,
|
155 |
+
'sundays_bg_color' => $sundays_bg_color,
|
156 |
+
'sundays_font_size' => $sundays_font_size,
|
157 |
+
'other_days_font_size' => $other_days_font_size,
|
158 |
+
'show_time' => $show_time,
|
159 |
+
'date_format' => $date_format,
|
160 |
+
'title_color' => $title_color,
|
161 |
+
'title_font_size' => $title_font_size,
|
162 |
+
'title_font' => $title_font,
|
163 |
+
'title_style' => $title_style,
|
164 |
+
'date_color' => $date_color,
|
165 |
+
'date_size' => $date_size,
|
166 |
+
'date_font' => $date_font,
|
167 |
+
'date_style' => $date_style,
|
168 |
+
'next_prev_event_bgcolor' => $next_prev_event_bgcolor,
|
169 |
+
'next_prev_event_arrowcolor' => $next_prev_event_arrowcolor,
|
170 |
+
'show_event_bgcolor' => $show_event_bgcolor,
|
171 |
+
'popup_width' => $popup_width,
|
172 |
+
'popup_height' => $popup_height,
|
173 |
+
'number_of_shown_evetns' => $number_of_shown_evetns,
|
174 |
+
'show_repeat' => $show_repeat,
|
175 |
+
'day_start' => $show_event,
|
176 |
+
'views_tabs_font_size' => $views_tabs_font_size,
|
177 |
+
'views_tabs_text_color' => $views_tabs_text_color,
|
178 |
+
'views_tabs_bg_color' => $views_tabs_bg_color,
|
179 |
+
'day_month_font_color' => $day_month_font_color,
|
180 |
+
'week_font_color' => $week_font_color,
|
181 |
+
'day_month_font_size' => $day_month_font_size,
|
182 |
+
'week_font_size' => $week_font_size,
|
183 |
+
'ev_title_bg_color' => $ev_title_bg_color,
|
184 |
+
'date_height' => $date_height,
|
185 |
+
'event_table_height' => $event_table_height,
|
186 |
+
'event_num_font_size' => $event_num_font_size,
|
187 |
+
'date_font_size' => $date_font_size,
|
188 |
+
'event_num_color' => $event_num_color,
|
189 |
+
'event_num_bg_color2' => $event_num_bg_color2,
|
190 |
+
'event_num_bg_color1' => $event_num_bg_color1,
|
191 |
+
'event_bg_color2' => $event_bg_color2,
|
192 |
+
'event_bg_color1' => $event_bg_color1,
|
193 |
+
'date_bg_color' => $date_bg_color,
|
194 |
+
'day_start' => $show_event,
|
195 |
+
), array(
|
196 |
+
'%d',
|
197 |
+
'%s',
|
198 |
+
'%s',
|
199 |
+
'%s',
|
200 |
+
'%s',
|
201 |
+
'%s',
|
202 |
+
'%s',
|
203 |
+
'%s',
|
204 |
+
'%s',
|
205 |
+
'%s',
|
206 |
+
'%s',
|
207 |
+
'%s',
|
208 |
+
'%s',
|
209 |
+
'%s',
|
210 |
+
'%s',
|
211 |
+
'%s',
|
212 |
+
'%s',
|
213 |
+
'%s',
|
214 |
+
'%s',
|
215 |
+
'%s',
|
216 |
+
'%s',
|
217 |
+
'%s',
|
218 |
+
'%s',
|
219 |
+
'%s',
|
220 |
+
'%s',
|
221 |
+
'%s',
|
222 |
+
'%s',
|
223 |
+
'%s',
|
224 |
+
'%s',
|
225 |
+
'%s',
|
226 |
+
'%s',
|
227 |
+
'%s',
|
228 |
+
'%s',
|
229 |
+
'%s',
|
230 |
+
'%s',
|
231 |
+
'%s',
|
232 |
+
'%s',
|
233 |
+
'%s',
|
234 |
+
'%s',
|
235 |
+
'%s',
|
236 |
+
'%s',
|
237 |
+
'%s',
|
238 |
+
'%s',
|
239 |
+
'%s',
|
240 |
+
'%s',
|
241 |
+
'%s',
|
242 |
+
'%s',
|
243 |
+
'%s',
|
244 |
+
'%s',
|
245 |
+
'%s',
|
246 |
+
'%s',
|
247 |
+
'%s',
|
248 |
+
'%s',
|
249 |
+
'%s',
|
250 |
+
'%s',
|
251 |
+
'%s',
|
252 |
+
'%s',
|
253 |
+
'%s',
|
254 |
+
'%d',
|
255 |
+
'%d',
|
256 |
+
'%s',
|
257 |
+
'%s',
|
258 |
+
'%s',
|
259 |
+
'%s',
|
260 |
+
'%s',
|
261 |
+
'%s',
|
262 |
+
'%s',
|
263 |
+
'%s',
|
264 |
+
'%s',
|
265 |
+
'%s',
|
266 |
+
'%s',
|
267 |
+
'%s',
|
268 |
+
'%s',
|
269 |
+
'%s',
|
270 |
+
'%s',
|
271 |
+
'%s',
|
272 |
+
'%s',
|
273 |
+
'%s',
|
274 |
+
'%s',
|
275 |
+
'%d',
|
276 |
+
'%d'
|
277 |
+
));
|
278 |
+
}
|
279 |
+
else {
|
280 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_theme', array(
|
281 |
+
'title' => $title,
|
282 |
+
'width' => $width,
|
283 |
+
'week_start_day' => $week_start_day,
|
284 |
+
'border_color' => $border_color,
|
285 |
+
'border_radius' => $border_radius,
|
286 |
+
'border_width' => $border_width,
|
287 |
+
'top_height' => $top_height,
|
288 |
+
'bg_top' => $bg_top,
|
289 |
+
'year_font_size' => $year_font_size,
|
290 |
+
'text_color_year' => $text_color_year,
|
291 |
+
'arrow_color_year' => $arrow_color_year,
|
292 |
+
'month_type' => $month_type,
|
293 |
+
'month_font_size' => $month_font_size,
|
294 |
+
'text_color_month' => $text_color_month,
|
295 |
+
'arrow_color_month' => $arrow_color_month,
|
296 |
+
'next_month_text_color' => $next_month_text_color,
|
297 |
+
'next_month_font_size' => $next_month_font_size,
|
298 |
+
'next_month_arrow_color' => $next_month_arrow_color,
|
299 |
+
'prev_month_text_color' => $prev_month_text_color,
|
300 |
+
'prev_month_font_size' => $prev_month_font_size,
|
301 |
+
'prev_month_arrow_color' => $prev_month_arrow_color,
|
302 |
+
'arrow_size' => $arrow_size,
|
303 |
+
'text_color_week_days' => $text_color_week_days,
|
304 |
+
'week_days_cell_height' => $week_days_cell_height,
|
305 |
+
'weekdays_bg_color' => $weekdays_bg_color,
|
306 |
+
'weekday_sunday_bg_color' => $weekday_sunday_bg_color,
|
307 |
+
'weekdays_font_size' => $weekdays_font_size,
|
308 |
+
'bg_bottom' => $bg_bottom,
|
309 |
+
'cell_height' => $cell_height,
|
310 |
+
'text_color_other_months' => $text_color_other_months,
|
311 |
+
'bg_color_other_months' => $bg_color_other_months,
|
312 |
+
'text_color_this_month_unevented' => $text_color_this_month_unevented,
|
313 |
+
'text_color_this_month_evented' => $text_color_this_month_evented,
|
314 |
+
'bg_color_this_month_evented' => $bg_color_this_month_evented,
|
315 |
+
'event_title_color' => $event_title_color,
|
316 |
+
'current_day_border_color' => $current_day_border_color,
|
317 |
+
'cell_border_color' => $cell_border_color,
|
318 |
+
'text_color_sun_days' => $text_color_sun_days,
|
319 |
+
'sundays_bg_color' => $sundays_bg_color,
|
320 |
+
'sundays_font_size' => $sundays_font_size,
|
321 |
+
'other_days_font_size' => $other_days_font_size,
|
322 |
+
'show_time' => $show_time,
|
323 |
+
'date_format' => $date_format,
|
324 |
+
'title_color' => $title_color,
|
325 |
+
'title_font_size' => $title_font_size,
|
326 |
+
'title_font' => $title_font,
|
327 |
+
'title_style' => $title_style,
|
328 |
+
'date_color' => $date_color,
|
329 |
+
'date_size' => $date_size,
|
330 |
+
'date_font' => $date_font,
|
331 |
+
'date_style' => $date_style,
|
332 |
+
'next_prev_event_bgcolor' => $next_prev_event_bgcolor,
|
333 |
+
'next_prev_event_arrowcolor' => $next_prev_event_arrowcolor,
|
334 |
+
'show_event_bgcolor' => $show_event_bgcolor,
|
335 |
+
'popup_width' => $popup_width,
|
336 |
+
'popup_height' => $popup_height,
|
337 |
+
'number_of_shown_evetns' => $number_of_shown_evetns,
|
338 |
+
'show_repeat' => $show_repeat,
|
339 |
+
'day_start' => $show_event,
|
340 |
+
'views_tabs_font_size' => $views_tabs_font_size,
|
341 |
+
'views_tabs_text_color' => $views_tabs_text_color,
|
342 |
+
'views_tabs_bg_color' => $views_tabs_bg_color,
|
343 |
+
'day_month_font_color' => $day_month_font_color,
|
344 |
+
'week_font_color' => $week_font_color,
|
345 |
+
'day_month_font_size' => $day_month_font_size,
|
346 |
+
'week_font_size' => $week_font_size,
|
347 |
+
'ev_title_bg_color' => $ev_title_bg_color,
|
348 |
+
'date_height' => $date_height,
|
349 |
+
'event_table_height' => $event_table_height,
|
350 |
+
'event_num_font_size' => $event_num_font_size,
|
351 |
+
'date_font_size' => $date_font_size,
|
352 |
+
'event_num_color' => $event_num_color,
|
353 |
+
'event_num_bg_color2' => $event_num_bg_color2,
|
354 |
+
'event_num_bg_color1' => $event_num_bg_color1,
|
355 |
+
'event_bg_color2' => $event_bg_color2,
|
356 |
+
'event_bg_color1' => $event_bg_color1,
|
357 |
+
'date_bg_color' => $date_bg_color,
|
358 |
+
'day_start' => $show_event,
|
359 |
+
'show_cat' => $show_cat,
|
360 |
+
), array('id' => $id), array(
|
361 |
+
'%s',
|
362 |
+
'%s',
|
363 |
+
'%s',
|
364 |
+
'%s',
|
365 |
+
'%s',
|
366 |
+
'%s',
|
367 |
+
'%s',
|
368 |
+
'%s',
|
369 |
+
'%s',
|
370 |
+
'%s',
|
371 |
+
'%s',
|
372 |
+
'%s',
|
373 |
+
'%s',
|
374 |
+
'%s',
|
375 |
+
'%s',
|
376 |
+
'%s',
|
377 |
+
'%s',
|
378 |
+
'%s',
|
379 |
+
'%s',
|
380 |
+
'%s',
|
381 |
+
'%s',
|
382 |
+
'%s',
|
383 |
+
'%s',
|
384 |
+
'%s',
|
385 |
+
'%s',
|
386 |
+
'%s',
|
387 |
+
'%s',
|
388 |
+
'%s',
|
389 |
+
'%s',
|
390 |
+
'%s',
|
391 |
+
'%s',
|
392 |
+
'%s',
|
393 |
+
'%s',
|
394 |
+
'%s',
|
395 |
+
'%s',
|
396 |
+
'%s',
|
397 |
+
'%s',
|
398 |
+
'%s',
|
399 |
+
'%s',
|
400 |
+
'%s',
|
401 |
+
'%s',
|
402 |
+
'%s',
|
403 |
+
'%s',
|
404 |
+
'%s',
|
405 |
+
'%s',
|
406 |
+
'%s',
|
407 |
+
'%s',
|
408 |
+
'%s',
|
409 |
+
'%s',
|
410 |
+
'%s',
|
411 |
+
'%s',
|
412 |
+
'%s',
|
413 |
+
'%s',
|
414 |
+
'%s',
|
415 |
+
'%s',
|
416 |
+
'%s',
|
417 |
+
'%d',
|
418 |
+
'%d',
|
419 |
+
'%s',
|
420 |
+
'%s',
|
421 |
+
'%s',
|
422 |
+
'%s',
|
423 |
+
'%s',
|
424 |
+
'%s',
|
425 |
+
'%s',
|
426 |
+
'%s',
|
427 |
+
'%s',
|
428 |
+
'%s',
|
429 |
+
'%s',
|
430 |
+
'%s',
|
431 |
+
'%s',
|
432 |
+
'%s',
|
433 |
+
'%s',
|
434 |
+
'%s',
|
435 |
+
'%s',
|
436 |
+
'%s',
|
437 |
+
'%s',
|
438 |
+
'%d',
|
439 |
+
'%d',
|
440 |
+
), array('%d'));
|
441 |
+
}
|
442 |
+
if ($save_or_no === FALSE) {
|
443 |
+
?>
|
444 |
+
<div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
|
445 |
+
<?php
|
446 |
+
return FALSE;
|
447 |
+
}
|
448 |
+
else {
|
449 |
+
?>
|
450 |
+
<div class="updated"><p><strong>Theme Saved.</strong></p></div>
|
451 |
+
<?php
|
452 |
+
return TRUE;
|
453 |
+
}
|
454 |
+
}
|
455 |
+
|
456 |
+
function edit_theme_calendar($id) {
|
457 |
+
global $wpdb;
|
458 |
+
if ($id == 0) {
|
459 |
+
$row = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=1');
|
460 |
+
}
|
461 |
+
else {
|
462 |
+
$row = $wpdb->get_row($wpdb->prepare ('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d' , $id ));
|
463 |
+
}
|
464 |
+
html_edit_theme_calendar($row, $id);
|
465 |
+
}
|
466 |
+
|
467 |
+
function remove_theme_calendar($id) {
|
468 |
+
if ($id > 0 && $id < 18) {
|
469 |
+
?>
|
470 |
+
<div id="message" class="error"><p>You can't delete deafult theme.</p></div>
|
471 |
+
<?php
|
472 |
+
return FALSE;
|
473 |
+
}
|
474 |
+
global $wpdb;
|
475 |
+
$sql_remove_tag = $wpdb->prepare ( "DELETE FROM " . $wpdb->prefix . "spidercalendar_theme WHERE id=%d", $id );
|
476 |
+
if (!$wpdb->query($sql_remove_tag)) {
|
477 |
+
?>
|
478 |
+
<div id="message" class="error"><p>Spider Calendar Theme Not Deleted</p></div>
|
479 |
+
<?php
|
480 |
+
}
|
481 |
+
else {
|
482 |
+
?>
|
483 |
+
<div class="updated"><p><strong>Item Deleted.</strong></p></div>
|
484 |
+
<?php
|
485 |
+
}
|
486 |
+
}
|
487 |
+
|
488 |
?>
|
calendar.php
CHANGED
@@ -3,12 +3,12 @@
|
|
3 |
Plugin Name: Spider Event Calendar
|
4 |
Plugin URI: https://web-dorado.com/products/wordpress-calendar.html
|
5 |
Description: Spider Event Calendar is a highly configurable product which allows you to have multiple organized events. Spider Event Calendar is an extraordinary user friendly extension.
|
6 |
-
Version: 1.5.
|
7 |
Author: WebDorado
|
8 |
Author URI: https://web-dorado.com
|
9 |
License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
*/
|
11 |
-
$wd_spider_calendar_version="1.5.
|
12 |
// LANGUAGE localization.
|
13 |
function sp_calendar_language_load() {
|
14 |
load_plugin_textdomain('sp_calendar', FALSE, basename(dirname(__FILE__)) . '/languages');
|
@@ -100,7 +100,7 @@ $themes = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spid
|
|
100 |
}
|
101 |
$cal_width = $themes->width; ?>
|
102 |
<input type="hidden" id="cal_width<?php echo $many_sp_calendar ?>" value="<?php echo $cal_width ?>" />
|
103 |
-
<div id='bigcalendar<?php echo $many_sp_calendar ?>'></div>
|
104 |
<script>
|
105 |
var tb_pathToImage = "<?php echo plugins_url('images/loadingAnimation.gif', __FILE__) ?>";
|
106 |
var tb_closeImage = "<?php echo plugins_url('images/tb-close.png', __FILE__) ?>"
|
@@ -154,7 +154,8 @@ if(widget!=1)
|
|
154 |
jQuery('pop_table').css('height','100%');
|
155 |
}
|
156 |
var thickDims, tbWidth, tbHeight;
|
157 |
-
jQuery(document).ready(function ($) {
|
|
|
158 |
setInterval(function(){
|
159 |
if(jQuery("body").hasClass("modal-open")) jQuery("html").addClass("thickbox_open");
|
160 |
else jQuery("html").removeClass("thickbox_open");
|
@@ -275,85 +276,11 @@ if(widget!=1)
|
|
275 |
'widget' => $widget,
|
276 |
'rand' => $many_sp_calendar,
|
277 |
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>');</script>
|
278 |
-
<style>
|
279 |
-
|
280 |
-
|
281 |
-
}
|
282 |
-
#TB_window iframe{
|
283 |
-
margin-left: 0;
|
284 |
-
margin-top: 0;
|
285 |
-
padding-left: 0;
|
286 |
-
padding-top: 0;
|
287 |
-
}
|
288 |
-
|
289 |
-
#TB_iframeContent{
|
290 |
-
height: 100% !important;
|
291 |
-
width: 100%;
|
292 |
-
}
|
293 |
-
#TB_window{
|
294 |
-
z-index: 1000000;
|
295 |
-
color: #dfdfdf;
|
296 |
-
top: 100px !important;
|
297 |
-
}
|
298 |
-
#TB_title{
|
299 |
-
background: #222;
|
300 |
-
}
|
301 |
-
|
302 |
-
.screen-reader-text,
|
303 |
-
#views_select .arrow-down,
|
304 |
-
#views_select .arrow-right{
|
305 |
-
display: none;
|
306 |
-
}
|
307 |
-
|
308 |
-
#afterbig<?php echo $many_sp_calendar; ?>{
|
309 |
-
display: block !important;
|
310 |
-
}
|
311 |
-
|
312 |
-
#afterbig<?php echo $many_sp_calendar; ?> li{
|
313 |
-
list-style: none;
|
314 |
-
}
|
315 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> p{
|
316 |
-
margin: 0;
|
317 |
-
padding: 0;
|
318 |
-
}
|
319 |
-
|
320 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
321 |
-
table-layout: auto;
|
322 |
-
}
|
323 |
-
|
324 |
-
.general_table a,
|
325 |
-
.last_table a,
|
326 |
-
.week_list a,
|
327 |
-
.day_ev a{
|
328 |
-
border: 0;
|
329 |
-
}
|
330 |
-
|
331 |
-
.show_arrow{
|
332 |
-
display: inline-block !important;
|
333 |
-
}
|
334 |
-
@media screen and (max-width: 768px) {
|
335 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #cal_event p:not(.ev_name){
|
336 |
-
display: block; /* Fallback for non-webkit */
|
337 |
-
display: -webkit-box;
|
338 |
-
max-width: 400px;
|
339 |
-
height: 32px; /* Fallback for non-webkit */
|
340 |
-
margin: 0 auto;
|
341 |
-
font-size: 13px;
|
342 |
-
line-height: 15px;
|
343 |
-
-webkit-line-clamp: 2;
|
344 |
-
-webkit-box-orient: vertical;
|
345 |
-
overflow: hidden;
|
346 |
-
text-overflow: ellipsis;
|
347 |
-
}
|
348 |
-
div#afterbig<?php echo $many_sp_calendar; ?>{
|
349 |
-
width: 100% !important;
|
350 |
-
margin: 0;
|
351 |
-
}
|
352 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day{
|
353 |
-
max-width: 37px;
|
354 |
}
|
355 |
-
|
356 |
-
</style>
|
357 |
<?php
|
358 |
$many_sp_calendar++;
|
359 |
$calendar = ob_get_contents();
|
3 |
Plugin Name: Spider Event Calendar
|
4 |
Plugin URI: https://web-dorado.com/products/wordpress-calendar.html
|
5 |
Description: Spider Event Calendar is a highly configurable product which allows you to have multiple organized events. Spider Event Calendar is an extraordinary user friendly extension.
|
6 |
+
Version: 1.5.53
|
7 |
Author: WebDorado
|
8 |
Author URI: https://web-dorado.com
|
9 |
License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
*/
|
11 |
+
$wd_spider_calendar_version="1.5.53";
|
12 |
// LANGUAGE localization.
|
13 |
function sp_calendar_language_load() {
|
14 |
load_plugin_textdomain('sp_calendar', FALSE, basename(dirname(__FILE__)) . '/languages');
|
100 |
}
|
101 |
$cal_width = $themes->width; ?>
|
102 |
<input type="hidden" id="cal_width<?php echo $many_sp_calendar ?>" value="<?php echo $cal_width ?>" />
|
103 |
+
<div id='bigcalendar<?php echo $many_sp_calendar ?>' class="wdc_calendar"></div>
|
104 |
<script>
|
105 |
var tb_pathToImage = "<?php echo plugins_url('images/loadingAnimation.gif', __FILE__) ?>";
|
106 |
var tb_closeImage = "<?php echo plugins_url('images/tb-close.png', __FILE__) ?>"
|
154 |
jQuery('pop_table').css('height','100%');
|
155 |
}
|
156 |
var thickDims, tbWidth, tbHeight;
|
157 |
+
jQuery(document).ready(function ($) {
|
158 |
+
if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) { jQuery('body').addClass('ios_device'); }
|
159 |
setInterval(function(){
|
160 |
if(jQuery("body").hasClass("modal-open")) jQuery("html").addClass("thickbox_open");
|
161 |
else jQuery("html").removeClass("thickbox_open");
|
276 |
'widget' => $widget,
|
277 |
'rand' => $many_sp_calendar,
|
278 |
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>');</script>
|
279 |
+
<style>
|
280 |
+
#TB_window iframe{
|
281 |
+
background: <?php echo '#'.str_replace('#','',$themes->show_event_bgcolor); ?>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
}
|
283 |
+
</style>
|
|
|
284 |
<?php
|
285 |
$many_sp_calendar++;
|
286 |
$calendar = ob_get_contents();
|
calendar_functions.html.php
CHANGED
@@ -1,2446 +1,2446 @@
|
|
1 |
-
<?php
|
2 |
-
if (function_exists('current_user_can')) {
|
3 |
-
if (!current_user_can('manage_options')) {
|
4 |
-
die('Access Denied');
|
5 |
-
}
|
6 |
-
}
|
7 |
-
|
8 |
-
function html_show_spider_calendar($rows, $pageNav, $sort) {
|
9 |
-
?>
|
10 |
-
<script language="javascript">
|
11 |
-
function confirmation(href, title) {
|
12 |
-
var answer = confirm("Are you sure you want to delete '" + title + "'?")
|
13 |
-
if (answer) {
|
14 |
-
document.getElementById('admin_form').action = href;
|
15 |
-
document.getElementById('admin_form').submit();
|
16 |
-
}
|
17 |
-
}
|
18 |
-
function ordering(name, as_or_desc) {
|
19 |
-
document.getElementById('asc_or_desc').value = as_or_desc;
|
20 |
-
document.getElementById('order_by').value = name;
|
21 |
-
document.getElementById('admin_form').submit();
|
22 |
-
}
|
23 |
-
function submit_form_id(x) {
|
24 |
-
var val = x.options[x.selectedIndex].value;
|
25 |
-
document.getElementById("id_for_playlist").value = val;
|
26 |
-
document.getElementById("admin_form").submit();
|
27 |
-
}
|
28 |
-
function doNothing() {
|
29 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
30 |
-
if (keyCode == 13) {
|
31 |
-
if (!e) var e = window.event;
|
32 |
-
e.cancelBubble = true;
|
33 |
-
e.returnValue = false;
|
34 |
-
if (e.stopPropagation) {
|
35 |
-
e.stopPropagation();
|
36 |
-
e.preventDefault();
|
37 |
-
}
|
38 |
-
}
|
39 |
-
}
|
40 |
-
var show_one_cal = 1;
|
41 |
-
var get_cal_id = 0;
|
42 |
-
function show_calendar_inline(cal_id) {
|
43 |
-
if (show_one_cal == 1) {
|
44 |
-
show_one_cal = 0;
|
45 |
-
jQuery.ajax({
|
46 |
-
type:'POST',
|
47 |
-
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineedit') ?>',
|
48 |
-
data:{calendar_id:cal_id},
|
49 |
-
dataType:'html',
|
50 |
-
success:function (data) {
|
51 |
-
cancel_qiucik_edit(get_cal_id);
|
52 |
-
var edit_cal_tr = document.createElement("tr")
|
53 |
-
edit_cal_tr.innerHTML = data;
|
54 |
-
edit_cal_tr.setAttribute('class', 'inline-edit-row inline-edit-row-page inline-edit-page quick-edit-row quick-edit-row-page inline-edit-page alternate inline-editor')
|
55 |
-
edit_cal_tr.setAttribute('id', 'edit_calendar-' + cal_id);
|
56 |
-
|
57 |
-
document.getElementById('Calendar-' + cal_id).style.display = "none";
|
58 |
-
document.getElementById('calendar_body').appendChild(edit_cal_tr);
|
59 |
-
document.getElementById('calendar_body').insertBefore(edit_cal_tr, document.getElementById('Calendar-' + cal_id));
|
60 |
-
get_cal_id = cal_id;
|
61 |
-
show_one_cal = 1
|
62 |
-
}
|
63 |
-
});
|
64 |
-
}
|
65 |
-
}
|
66 |
-
function cancel_qiucik_edit(cal_id) {
|
67 |
-
if (document.getElementById('edit_calendar-' + cal_id)) {
|
68 |
-
var tr = document.getElementById('edit_calendar-' + cal_id);
|
69 |
-
tr.parentNode.removeChild(tr);
|
70 |
-
document.getElementById('Calendar-' + cal_id).style.display = "";
|
71 |
-
}
|
72 |
-
}
|
73 |
-
function updae_inline_sp_calendar(cal_id) {
|
74 |
-
var cal_title = document.getElementById('calendar_title').value;
|
75 |
-
var cal_12_format = getCheckedValue(document.getElementsByName('time_format'));
|
76 |
-
var def_year = document.getElementById('def_year').value;
|
77 |
-
var def_month = document.getElementById('def_month').value;
|
78 |
-
jQuery.ajax({
|
79 |
-
type:'POST',
|
80 |
-
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineupdate') ?>',
|
81 |
-
data:{
|
82 |
-
calendar_id:cal_id,
|
83 |
-
calendar_title:cal_title,
|
84 |
-
us_12_format_sp_calendar:cal_12_format,
|
85 |
-
default_year:def_year,
|
86 |
-
default_month:def_month
|
87 |
-
},
|
88 |
-
dataType:'html',
|
89 |
-
success:function (data) {
|
90 |
-
if (data) {
|
91 |
-
document.getElementById('Calendar-' + cal_id).innerHTML = data;
|
92 |
-
cancel_qiucik_edit(cal_id);
|
93 |
-
}
|
94 |
-
else {
|
95 |
-
alert('ERROR PLEAS INSTALL PLUGIN AGAIN');
|
96 |
-
cancel_qiucik_edit(cal_id);
|
97 |
-
}
|
98 |
-
}
|
99 |
-
});
|
100 |
-
}
|
101 |
-
function getCheckedValue(radioObj) {
|
102 |
-
if (!radioObj)
|
103 |
-
return "";
|
104 |
-
var radioLength = radioObj.length;
|
105 |
-
if (radioLength == undefined)
|
106 |
-
if (radioObj.checked)
|
107 |
-
return radioObj.value;
|
108 |
-
else
|
109 |
-
return "";
|
110 |
-
for (var i = 0; i < radioLength; i++) {
|
111 |
-
if (radioObj[i].checked) {
|
112 |
-
return radioObj[i].value;
|
113 |
-
}
|
114 |
-
}
|
115 |
-
return "";
|
116 |
-
}
|
117 |
-
</script>
|
118 |
-
<?php
|
119 |
-
global $wpdb;
|
120 |
-
$calendarwd = $wpdb->get_results("SHOW COLUMNS FROM ".$wpdb->prefix."spidercalendar_calendar");
|
121 |
-
$def_zone_wd = 0;
|
122 |
-
for($i=0;$i<count($calendarwd);$i++){
|
123 |
-
if($calendarwd[$i]->Field=="def_zone"){
|
124 |
-
$def_zone_wd = 1;
|
125 |
-
break;
|
126 |
-
}
|
127 |
-
}
|
128 |
-
if($def_zone_wd == 0) {
|
129 |
-
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "spidercalendar_calendar ADD def_zone varchar(255) DEFAULT 'Asia/Muscat'");
|
130 |
-
} ?>
|
131 |
-
<?php upgrade_pro_sp(); ?>
|
132 |
-
<form method="post" onKeyPress="doNothing()" action="admin.php?page=SpiderCalendar" id="admin_form" name="admin_form">
|
133 |
-
<?php $sp_cal_nonce = wp_create_nonce('nonce_sp_cal'); ?>
|
134 |
-
<table cellspacing="10" width="100%" id="calendar_table">
|
135 |
-
<tr>
|
136 |
-
<td><h2>Calendar Manager</h2></td>
|
137 |
-
<td style="text-align: right;">
|
138 |
-
<p class="submit" style="padding:0px; text-align: right;">
|
139 |
-
<input type="button" value="Add a Calendar" name="custom_parametrs" onClick="window.location.href='admin.php?page=SpiderCalendar&task=add_calendar'"/>
|
140 |
-
</p>
|
141 |
-
</td>
|
142 |
-
</tr>
|
143 |
-
</table>
|
144 |
-
<?php
|
145 |
-
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
146 |
-
$serch_value = esc_js(esc_html(stripslashes($_POST['search_events_by_title'])));
|
147 |
-
}
|
148 |
-
else {
|
149 |
-
$serch_value = "";
|
150 |
-
}
|
151 |
-
$serch_fields = '
|
152 |
-
<div class="alignleft actions">
|
153 |
-
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
154 |
-
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()">
|
155 |
-
</div>
|
156 |
-
<div class="alignleft actions">
|
157 |
-
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
158 |
-
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
159 |
-
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=SpiderCalendar\'" class="button-secondary action">
|
160 |
-
</div>';
|
161 |
-
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
162 |
-
?>
|
163 |
-
<table class="wp-list-table widefat fixed pages" style="width:99%">
|
164 |
-
<thead>
|
165 |
-
<TR>
|
166 |
-
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
167 |
-
<a href="javascript:ordering('id',<?php echo(($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
168 |
-
<span>ID</span>
|
169 |
-
<span class="sorting-indicator"></span>
|
170 |
-
</a>
|
171 |
-
</th>
|
172 |
-
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
173 |
-
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
174 |
-
<span>Title</span>
|
175 |
-
<span class="sorting-indicator"></span>
|
176 |
-
</a>
|
177 |
-
</th>
|
178 |
-
<th style="width:100px">Manage Events</th>
|
179 |
-
<th style="width:100px">Edit</th>
|
180 |
-
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
181 |
-
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
182 |
-
<span>Published</span>
|
183 |
-
<span class="sorting-indicator"></span>
|
184 |
-
</a>
|
185 |
-
</th>
|
186 |
-
</TR>
|
187 |
-
</thead>
|
188 |
-
<tbody id="calendar_body">
|
189 |
-
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
190 |
-
<tr id="Calendar-<?php echo $rows[$i]->id; ?>" class=" hentry alternate iedit author-self" style="display:table-row;">
|
191 |
-
<td><?php echo $rows[$i]->id; ?></td>
|
192 |
-
<td class="post-title page-title column-title">
|
193 |
-
<a title="Manage Events" class="row-title" href="admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=<?php echo $rows[$i]->id; ?>"><?php echo $rows[$i]->title; ?></a>
|
194 |
-
<div class="row-actions">
|
195 |
-
|
196 |
-
<span class="inline hide-if-no-js">
|
197 |
-
<a href="#" class="editinline" onClick="show_calendar_inline(<?php echo $rows[$i]->id; ?>)" title="Edit This Calendar Inline">Quick Edit</a> | </span>
|
198 |
-
<span class="trash">
|
199 |
-
<a class="submitdelete" title="Delete This Calendar" href="javascript:confirmation('admin.php?page=SpiderCalendar&task=remove_calendar&id=<?php echo $rows[$i]->id; ?>','<?php echo $rows[$i]->title; ?>')">Delete</a></span>
|
200 |
-
</div>
|
201 |
-
</td>
|
202 |
-
<td><a href="admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=<?php echo $rows[$i]->id; ?>">Manage events</a></td>
|
203 |
-
<td><a href="admin.php?page=SpiderCalendar&task=edit_calendar&id=<?php echo $rows[$i]->id; ?>" title="Edit This Calendar">Edit</a></td>
|
204 |
-
<td><a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?>
|
205 |
-
href="admin.php?page=SpiderCalendar&task=published&id=<?php echo $rows[$i]->id; ?>&_wpnonce=<?php echo $sp_cal_nonce; ?>"><?php if ($rows[$i]->published) echo 'Yes'; else echo 'No'; ?></a>
|
206 |
-
</td>
|
207 |
-
</tr>
|
208 |
-
<?php } ?>
|
209 |
-
</tbody>
|
210 |
-
</table>
|
211 |
-
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
212 |
-
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo esc_js(esc_html(stripslashes($_POST['id_for_playlist'])));?>"/>
|
213 |
-
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo esc_js(esc_html(stripslashes($_POST['asc_or_desc'])));?>"/>
|
214 |
-
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo esc_js(esc_html(stripslashes($_POST['order_by'])));?>"/>
|
215 |
-
<?php
|
216 |
-
?>
|
217 |
-
</form>
|
218 |
-
<?php
|
219 |
-
}
|
220 |
-
|
221 |
-
function html_add_spider_calendar() {
|
222 |
-
?>
|
223 |
-
<script language="javascript" type="text/javascript">
|
224 |
-
function submitbutton(pressbutton) {
|
225 |
-
var form = document.adminForm;
|
226 |
-
if (pressbutton == 'cancel_calendar') {
|
227 |
-
submitform(pressbutton);
|
228 |
-
return;
|
229 |
-
}
|
230 |
-
submitform(pressbutton);
|
231 |
-
}
|
232 |
-
function submitform(pressbutton) {
|
233 |
-
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
234 |
-
if (document.getElementById('title').value == "") {
|
235 |
-
alert('Provide calendar title:');
|
236 |
-
}
|
237 |
-
else {
|
238 |
-
document.getElementById('adminForm').submit();
|
239 |
-
}
|
240 |
-
}
|
241 |
-
function doNothing() {
|
242 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
243 |
-
if (keyCode == 13) {
|
244 |
-
if (!e) {
|
245 |
-
var e = window.event;
|
246 |
-
}
|
247 |
-
e.cancelBubble = true;
|
248 |
-
e.returnValue = false;
|
249 |
-
if (e.stopPropagation) {
|
250 |
-
e.stopPropagation();
|
251 |
-
e.preventDefault();
|
252 |
-
}
|
253 |
-
}
|
254 |
-
}
|
255 |
-
</script>
|
256 |
-
<style>
|
257 |
-
.calendar .button {
|
258 |
-
display: table-cell !important;
|
259 |
-
}
|
260 |
-
.wd_button{
|
261 |
-
border: 1px solid #D5D5D5 !important;
|
262 |
-
border-radius: 10px;
|
263 |
-
width: 30px;
|
264 |
-
height: 25px;
|
265 |
-
}
|
266 |
-
</style>
|
267 |
-
<?php upgrade_pro_sp(); ?>
|
268 |
-
<table width="95%">
|
269 |
-
<tr>
|
270 |
-
<td width="100%"><h2>Add Calendar</h2></td>
|
271 |
-
<td align="right"><input type="button" onClick="submitbutton('Save')" value="Save" class="button-secondary action"></td>
|
272 |
-
<td align="right"><input type="button" onClick="submitbutton('Apply')" value="Apply" class="button-secondary action"></td>
|
273 |
-
<td align="right"><input type="button" onClick="window.location.href='admin.php?page=SpiderCalendar'" value="Cancel" class="button-secondary action"></td>
|
274 |
-
</tr>
|
275 |
-
</table>
|
276 |
-
|
277 |
-
<form onKeyPress="doNothing()" action="admin.php?page=SpiderCalendar" method="post" name="adminForm" id="adminForm">
|
278 |
-
<table class="form-table" style="width: 525px;">
|
279 |
-
<tr>
|
280 |
-
<td class="key"><label for="name">Title: </label></td>
|
281 |
-
<td><input type="text" name="title" id="title" size="30" value=""/></td>
|
282 |
-
</tr>
|
283 |
-
<tr>
|
284 |
-
<td class="key"><label for="def_year">Default Year: </label></td>
|
285 |
-
<td><input type="text" name="def_year" id="def_year" size="30" value=""/></td>
|
286 |
-
</tr>
|
287 |
-
<tr>
|
288 |
-
<td class="key"><label for="def_month">Default Month: </label></td>
|
289 |
-
<td>
|
290 |
-
<select id="def_month" name="def_month">
|
291 |
-
<option selected="selected" value="">Current</option>
|
292 |
-
<?php
|
293 |
-
$month_array = array(
|
294 |
-
'01' => 'January',
|
295 |
-
'02' => 'February',
|
296 |
-
'03' => 'March',
|
297 |
-
'04' => 'April',
|
298 |
-
'05' => 'May',
|
299 |
-
'06' => 'June',
|
300 |
-
'07' => 'July',
|
301 |
-
'08' => 'August',
|
302 |
-
'09' => 'September',
|
303 |
-
'10' => 'October',
|
304 |
-
'11' => 'November',
|
305 |
-
'12' => 'December',
|
306 |
-
);
|
307 |
-
foreach ($month_array as $key => $def_month) {
|
308 |
-
?>
|
309 |
-
<option value="<?php echo $key;?>"><?php echo $def_month;?></option>
|
310 |
-
<?php
|
311 |
-
}
|
312 |
-
?>
|
313 |
-
</select>
|
314 |
-
</td>
|
315 |
-
</tr>
|
316 |
-
<tr>
|
317 |
-
<td class="key"><label for="name">Set the default timezone: </label></td>
|
318 |
-
<td>
|
319 |
-
<select id="def_zone" name="def_zone">
|
320 |
-
<option selected="selected" value="Asia/Muscat">Current</option>
|
321 |
-
<?php
|
322 |
-
$zonelist = array(
|
323 |
-
'Kwajalein' => '-12.00',
|
324 |
-
'Pacific/Midway' => '-11.00',
|
325 |
-
'Pacific/Honolulu' => '-10.00',
|
326 |
-
'America/Anchorage' => '-9.00',
|
327 |
-
'America/Los_Angeles' => '-8.00',
|
328 |
-
'America/Denver' => '-7.00',
|
329 |
-
'America/Tegucigalpa' => '-6.00',
|
330 |
-
'America/New_York' => '-5.00',
|
331 |
-
'America/Caracas' => '-4.30',
|
332 |
-
'America/Halifax' => '-4.00',
|
333 |
-
'America/St_Johns' => '-3.30',
|
334 |
-
'America/Argentina/Buenos_Aires' => '-3.00',
|
335 |
-
'America/Sao_Paulo' => '-3.00',
|
336 |
-
'Atlantic/South_Georgia' => '-2.00',
|
337 |
-
'Atlantic/Azores' => '-1.00',
|
338 |
-
'Europe/Dublin' => '0',
|
339 |
-
'Europe/Belgrade' => '+1.00',
|
340 |
-
'Europe/Minsk' => '+2.00',
|
341 |
-
'Asia/Kuwait' => '+3.00',
|
342 |
-
'Asia/Tehran' => '+3.30',
|
343 |
-
'Asia/Muscat' => '+4.00',
|
344 |
-
'Asia/Yekaterinburg' => '+5.00',
|
345 |
-
'Asia/Kolkata' => '+5.30',
|
346 |
-
'Asia/Katmandu' => '+5.45',
|
347 |
-
'Asia/Dhaka' => '+6.00',
|
348 |
-
'Asia/Rangoon' => '+6.30',
|
349 |
-
'Asia/Krasnoyarsk' => '+7.00',
|
350 |
-
'Asia/Brunei' => '+8.00',
|
351 |
-
'Asia/Seoul' => '+9.00',
|
352 |
-
'Australia/Darwin' => '+9.30',
|
353 |
-
'Australia/Canberra' => '+10.00',
|
354 |
-
'Asia/Magadan' => '+11.00',
|
355 |
-
'Pacific/Fiji' => '+12.00',
|
356 |
-
'Pacific/Tongatapu' => '+13.00');
|
357 |
-
|
358 |
-
foreach ($zonelist as $key => $def_zone) {
|
359 |
-
?>
|
360 |
-
<option value="<?php echo $key; ?>"><?php echo $key; ?> UTC<?php echo $def_zone; ?></option>
|
361 |
-
<?php
|
362 |
-
}
|
363 |
-
?>
|
364 |
-
</select>
|
365 |
-
</td>
|
366 |
-
</tr>
|
367 |
-
<tr>
|
368 |
-
<td class="key"><label for="name">Use 12-hour time format: </label></td>
|
369 |
-
<td>
|
370 |
-
<input type="radio" name="time_format" id="time_format0" value="0" checked="checked" class="inputbox">
|
371 |
-
<label for="time_format0">No</label>
|
372 |
-
<input type="radio" name="time_format" id="time_format1" value="1" class="inputbox">
|
373 |
-
<label for="time_format1">Yes</label>
|
374 |
-
</td>
|
375 |
-
</tr>
|
376 |
-
<tr>
|
377 |
-
<td class="key"><label for="published">Published: </label></td>
|
378 |
-
<td>
|
379 |
-
<input type="radio" name="published" id="published0" value="0" class="inputbox">
|
380 |
-
<label for="published0">No</label>
|
381 |
-
<input type="radio" name="published" id="published1" value="1" checked="checked" class="inputbox">
|
382 |
-
<label for="published1">Yes</label>
|
383 |
-
</td>
|
384 |
-
</tr>
|
385 |
-
</table>
|
386 |
-
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
387 |
-
<input type="hidden" name="option" value="com_spidercalendar"/>
|
388 |
-
<input type="hidden" name="id" value=""/>
|
389 |
-
<input type="hidden" name="cid[]" value=""/>
|
390 |
-
<input type="hidden" name="task" value=""/>
|
391 |
-
</form>
|
392 |
-
<?php
|
393 |
-
}
|
394 |
-
|
395 |
-
function html_edit_spider_calendar($row) {
|
396 |
-
?>
|
397 |
-
<script language="javascript" type="text/javascript">
|
398 |
-
function submitbutton(pressbutton) {
|
399 |
-
var form = document.adminForm;
|
400 |
-
if (pressbutton == 'cancel_calendar') {
|
401 |
-
submitform(pressbutton);
|
402 |
-
return;
|
403 |
-
}
|
404 |
-
submitform(pressbutton);
|
405 |
-
}
|
406 |
-
function submitform(pressbutton) {
|
407 |
-
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
408 |
-
if (document.getElementById('title').value == "") {
|
409 |
-
alert('Provide calendar title:');
|
410 |
-
}
|
411 |
-
else {
|
412 |
-
document.getElementById('adminForm').submit();
|
413 |
-
}
|
414 |
-
}
|
415 |
-
function doNothing() {
|
416 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
417 |
-
if (keyCode == 13) {
|
418 |
-
if (!e) {
|
419 |
-
var e = window.event;
|
420 |
-
}
|
421 |
-
e.cancelBubble = true;
|
422 |
-
e.returnValue = false;
|
423 |
-
if (e.stopPropagation) {
|
424 |
-
e.stopPropagation();
|
425 |
-
e.preventDefault();
|
426 |
-
}
|
427 |
-
}
|
428 |
-
}
|
429 |
-
</script>
|
430 |
-
<style>
|
431 |
-
.calendar .button {
|
432 |
-
display: table-cell !important;
|
433 |
-
}
|
434 |
-
.wd_button{
|
435 |
-
border: 1px solid #D5D5D5 !important;
|
436 |
-
border-radius: 10px;
|
437 |
-
width: 30px;
|
438 |
-
height: 25px;
|
439 |
-
}
|
440 |
-
</style>
|
441 |
-
<?php upgrade_pro_sp(); ?>
|
442 |
-
<table width="95%">
|
443 |
-
<tr>
|
444 |
-
<td width="100%"><h2>Calendar - <?php echo $row->title; ?></h2></td>
|
445 |
-
<td align="right"><input type="button" onClick="submitbutton('Save')" value="Save" class="button-secondary action"></td>
|
446 |
-
<td align="right"><input type="button" onClick="submitbutton('Apply')" value="Apply" class="button-secondary action"></td>
|
447 |
-
<td align="right"><input type="button" onClick="window.location.href='admin.php?page=SpiderCalendar'" value="Cancel" class="button-secondary action"></td>
|
448 |
-
</tr>
|
449 |
-
</table>
|
450 |
-
|
451 |
-
<form onKeyPress="doNothing()" action="admin.php?page=SpiderCalendar&id=<?php echo $row->id; ?>" method="post" name="adminForm" id="adminForm">
|
452 |
-
<table class="form-table" style="width: 525px;">
|
453 |
-
<tr>
|
454 |
-
<td class="key"><label for="name">Title: </label></td>
|
455 |
-
<td><input type="text" name="title" id="title" size="30" value="<?php echo $row->title; ?>"/></td>
|
456 |
-
</tr>
|
457 |
-
<tr>
|
458 |
-
<td class="key"><label for="name">Default Year: </label></td>
|
459 |
-
<td><input type="text" name="def_year" id="def_year" size="30" value="<?php echo $row->def_year; ?>"/></td>
|
460 |
-
</tr>
|
461 |
-
<tr>
|
462 |
-
<td class="key"><label for="name">Default Month: </label></td>
|
463 |
-
<td>
|
464 |
-
<select id="def_month" name="def_month">
|
465 |
-
<?php
|
466 |
-
$month_array = array(
|
467 |
-
'' => 'Current',
|
468 |
-
'01' => 'January',
|
469 |
-
'02' => 'February',
|
470 |
-
'03' => 'March',
|
471 |
-
'04' => 'April',
|
472 |
-
'05' => 'May',
|
473 |
-
'06' => 'June',
|
474 |
-
'07' => 'July',
|
475 |
-
'08' => 'August',
|
476 |
-
'09' => 'September',
|
477 |
-
'10' => 'October',
|
478 |
-
'11' => 'November',
|
479 |
-
'12' => 'December',
|
480 |
-
);
|
481 |
-
foreach ($month_array as $key => $def_month) {
|
482 |
-
?>
|
483 |
-
<option <?php echo (($row->def_month == $key) ? 'selected="selected"' : ''); ?> value="<?php echo $key; ?>"><?php echo $def_month; ?></option>
|
484 |
-
<?php
|
485 |
-
}
|
486 |
-
?>
|
487 |
-
</select>
|
488 |
-
</td>
|
489 |
-
</tr>
|
490 |
-
<tr>
|
491 |
-
<td class="key"><label for="name">Set the default timezone: </label></td>
|
492 |
-
<td>
|
493 |
-
<select id="def_zone" name="def_zone">
|
494 |
-
<option selected="selected" value="Asia/Muscat">Current</option>
|
495 |
-
<?php
|
496 |
-
$zonelist = array(
|
497 |
-
'Kwajalein' => '-12.00',
|
498 |
-
'Pacific/Midway' => '-11.00',
|
499 |
-
'Pacific/Honolulu' => '-10.00',
|
500 |
-
'America/Anchorage' => '-9.00',
|
501 |
-
'America/Los_Angeles' => '-8.00',
|
502 |
-
'America/Denver' => '-7.00',
|
503 |
-
'America/Tegucigalpa' => '-6.00',
|
504 |
-
'America/New_York' => '-5.00',
|
505 |
-
'America/Caracas' => '-4.30',
|
506 |
-
'America/Halifax' => '-4.00',
|
507 |
-
'America/St_Johns' => '-3.30',
|
508 |
-
'America/Argentina/Buenos_Aires' => '-3.00',
|
509 |
-
'America/Sao_Paulo' => '-3.00',
|
510 |
-
'Atlantic/South_Georgia' => '-2.00',
|
511 |
-
'Atlantic/Azores' => '-1.00',
|
512 |
-
'Europe/Dublin' => '0',
|
513 |
-
'Europe/Belgrade' => '+1.00',
|
514 |
-
'Europe/Minsk' => '+2.00',
|
515 |
-
'Asia/Kuwait' => '+3.00',
|
516 |
-
'Asia/Tehran' => '+3.30',
|
517 |
-
'Asia/Muscat' => '+4.00',
|
518 |
-
'Asia/Yekaterinburg' => '+5.00',
|
519 |
-
'Asia/Kolkata' => '+5.30',
|
520 |
-
'Asia/Katmandu' => '+5.45',
|
521 |
-
'Asia/Dhaka' => '+6.00',
|
522 |
-
'Asia/Rangoon' => '+6.30',
|
523 |
-
'Asia/Krasnoyarsk' => '+7.00',
|
524 |
-
'Asia/Brunei' => '+8.00',
|
525 |
-
'Asia/Seoul' => '+9.00',
|
526 |
-
'Australia/Darwin' => '+9.30',
|
527 |
-
'Australia/Canberra' => '+10.00',
|
528 |
-
'Asia/Magadan' => '+11.00',
|
529 |
-
'Pacific/Fiji' => '+12.00',
|
530 |
-
'Pacific/Tongatapu' => '+13.00');
|
531 |
-
|
532 |
-
foreach ($zonelist as $key => $def_zone) {
|
533 |
-
?>
|
534 |
-
<option <?php echo (($row->def_zone == $key) ? 'selected="selected"' : ''); ?> value="<?php echo $key; ?>"><?php echo $key; ?> UTC<?php echo $def_zone; ?></option>
|
535 |
-
<?php
|
536 |
-
}
|
537 |
-
?>
|
538 |
-
</select>
|
539 |
-
</td>
|
540 |
-
</tr>
|
541 |
-
<tr>
|
542 |
-
<td class="key"><label for="name">Use 12 hours time format: </label></td>
|
543 |
-
<td>
|
544 |
-
<input type="radio" name="time_format" id="time_format0" value="0" <?php cheched($row->time_format, '0'); ?> class="inputbox">
|
545 |
-
<label for="time_format0">No</label>
|
546 |
-
<input type="radio" name="time_format" id="time_format1" value="1" <?php cheched($row->time_format, '1'); ?> class="inputbox">
|
547 |
-
<label for="time_format1">Yes</label>
|
548 |
-
</td>
|
549 |
-
</tr>
|
550 |
-
<tr>
|
551 |
-
<td class="key"><label for="published">Published:</label></td>
|
552 |
-
<td>
|
553 |
-
<input type="radio" name="published" id="published0" value="0" <?php cheched($row->published, '0'); ?> class="inputbox">
|
554 |
-
<label for="published0">No</label>
|
555 |
-
<input type="radio" name="published" id="published1" value="1" <?php cheched($row->published, '1'); ?> class="inputbox">
|
556 |
-
<label for="published1">Yes</label>
|
557 |
-
</td>
|
558 |
-
</tr>
|
559 |
-
</table>
|
560 |
-
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
561 |
-
<input type="hidden" name="option" value="com_spidercalendar"/>
|
562 |
-
<input type="hidden" name="id" value="<?php echo $row->id; ?>"/>
|
563 |
-
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
564 |
-
<input type="hidden" name="task" value=""/>
|
565 |
-
</form>
|
566 |
-
<?php
|
567 |
-
}
|
568 |
-
|
569 |
-
function cheched($row, $y) {
|
570 |
-
if ($row == $y) {
|
571 |
-
echo 'checked="checked"';
|
572 |
-
}
|
573 |
-
}
|
574 |
-
|
575 |
-
function selectted($row, $y) {
|
576 |
-
if ($row == $y) {
|
577 |
-
echo 'selected="selected"';
|
578 |
-
}
|
579 |
-
}
|
580 |
-
|
581 |
-
function show_event_category($rows, $pageNav, $sort){
|
582 |
-
global $wpdb;
|
583 |
-
?>
|
584 |
-
<script language="javascript">
|
585 |
-
function confirmation(href, title) {
|
586 |
-
var answer = confirm("Are you sure you want to delete '" + title + "'?")
|
587 |
-
if (answer) {
|
588 |
-
document.getElementById('admin_form').action = href;
|
589 |
-
document.getElementById('admin_form').submit();
|
590 |
-
}
|
591 |
-
}
|
592 |
-
function ordering(name, as_or_desc) {
|
593 |
-
document.getElementById('asc_or_desc').value = as_or_desc;
|
594 |
-
document.getElementById('order_by').value = name;
|
595 |
-
document.getElementById('admin_form').submit();
|
596 |
-
}
|
597 |
-
function submit_form_id(x) {
|
598 |
-
var val = x.options[x.selectedIndex].value;
|
599 |
-
document.getElementById("id_for_playlist").value = val;
|
600 |
-
document.getElementById("admin_form").submit();
|
601 |
-
}
|
602 |
-
function doNothing() {
|
603 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
604 |
-
if (keyCode == 13) {
|
605 |
-
if (!e) var e = window.event;
|
606 |
-
e.cancelBubble = true;
|
607 |
-
e.returnValue = false;
|
608 |
-
if (e.stopPropagation) {
|
609 |
-
e.stopPropagation();
|
610 |
-
e.preventDefault();
|
611 |
-
}
|
612 |
-
}
|
613 |
-
}
|
614 |
-
var show_one_cal = 1;
|
615 |
-
var get_cal_id = 0;
|
616 |
-
function show_calendar_inline(cal_id) {
|
617 |
-
if (show_one_cal == 1) {
|
618 |
-
show_one_cal = 0;
|
619 |
-
jQuery.ajax({
|
620 |
-
type:'POST',
|
621 |
-
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineedit') ?>',
|
622 |
-
data:{calendar_id:cal_id},
|
623 |
-
dataType:'html',
|
624 |
-
success:function (data) {
|
625 |
-
cancel_qiucik_edit(get_cal_id);
|
626 |
-
var edit_cal_tr = document.createElement("tr")
|
627 |
-
edit_cal_tr.innerHTML = data;
|
628 |
-
edit_cal_tr.setAttribute('class', 'inline-edit-row inline-edit-row-page inline-edit-page quick-edit-row quick-edit-row-page inline-edit-page alternate inline-editor')
|
629 |
-
edit_cal_tr.setAttribute('id', 'edit_calendar-' + cal_id);
|
630 |
-
|
631 |
-
document.getElementById('Calendar-' + cal_id).style.display = "none";
|
632 |
-
document.getElementById('calendar_body').appendChild(edit_cal_tr);
|
633 |
-
document.getElementById('calendar_body').insertBefore(edit_cal_tr, document.getElementById('Calendar-' + cal_id));
|
634 |
-
get_cal_id = cal_id;
|
635 |
-
show_one_cal = 1
|
636 |
-
}
|
637 |
-
});
|
638 |
-
}
|
639 |
-
}
|
640 |
-
function cancel_qiucik_edit(cal_id) {
|
641 |
-
if (document.getElementById('edit_calendar-' + cal_id)) {
|
642 |
-
var tr = document.getElementById('edit_calendar-' + cal_id);
|
643 |
-
tr.parentNode.removeChild(tr);
|
644 |
-
document.getElementById('Calendar-' + cal_id).style.display = "";
|
645 |
-
}
|
646 |
-
}
|
647 |
-
function updae_inline_sp_calendar(cal_id) {
|
648 |
-
var cal_title = document.getElementById('calendar_title').value;
|
649 |
-
var cal_12_format = getCheckedValue(document.getElementsByName('time_format'));
|
650 |
-
var def_year = document.getElementById('def_year').value;
|
651 |
-
var def_month = document.getElementById('def_month').value;
|
652 |
-
jQuery.ajax({
|
653 |
-
type:'POST',
|
654 |
-
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineupdate') ?>',
|
655 |
-
data:{
|
656 |
-
calendar_id:cal_id,
|
657 |
-
calendar_title:cal_title,
|
658 |
-
us_12_format_sp_calendar:cal_12_format,
|
659 |
-
default_year:def_year,
|
660 |
-
default_month:def_month
|
661 |
-
},
|
662 |
-
dataType:'html',
|
663 |
-
success:function (data) {
|
664 |
-
if (data) {
|
665 |
-
document.getElementById('Calendar-' + cal_id).innerHTML = data;
|
666 |
-
cancel_qiucik_edit(cal_id);
|
667 |
-
}
|
668 |
-
else {
|
669 |
-
alert('ERROR PLEAS INSTALL PLUGIN AGAIN');
|
670 |
-
cancel_qiucik_edit(cal_id);
|
671 |
-
}
|
672 |
-
}
|
673 |
-
});
|
674 |
-
}
|
675 |
-
function getCheckedValue(radioObj) {
|
676 |
-
if (!radioObj)
|
677 |
-
return "";
|
678 |
-
var radioLength = radioObj.length;
|
679 |
-
if (radioLength == undefined)
|
680 |
-
if (radioObj.checked)
|
681 |
-
return radioObj.value;
|
682 |
-
else
|
683 |
-
return "";
|
684 |
-
for (var i = 0; i < radioLength; i++) {
|
685 |
-
if (radioObj[i].checked) {
|
686 |
-
return radioObj[i].value;
|
687 |
-
}
|
688 |
-
}
|
689 |
-
return "";
|
690 |
-
}
|
691 |
-
</script>
|
692 |
-
<?php upgrade_pro_sp(); ?>
|
693 |
-
<form method="post" onKeyPress="doNothing()" action="admin.php?page=spider_calendar_event_category" id="admin_form" name="admin_form">
|
694 |
-
<?php $sp_cal_nonce = wp_create_nonce('nonce_sp_cal'); ?>
|
695 |
-
<table cellspacing="10" width="100%" id="category_table">
|
696 |
-
<tr>
|
697 |
-
<td><h2>Event Category</h2></td>
|
698 |
-
<td style="text-align:right;">
|
699 |
-
<p class="submit" style="padding:0px; text-align:left">
|
700 |
-
<input type="button" value="Add a Category" name="custom_parametrs" onClick="window.location.href='admin.php?page=spider_calendar_event_category&task=add_category'" class="wd-right"/>
|
701 |
-
</p>
|
702 |
-
</td>
|
703 |
-
</tr>
|
704 |
-
</table>
|
705 |
-
<?php
|
706 |
-
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
707 |
-
$serch_value = esc_js(esc_html(stripslashes($_POST['search_cat_by_title'])));
|
708 |
-
}
|
709 |
-
else {
|
710 |
-
$serch_value = "";
|
711 |
-
}
|
712 |
-
$serch_fields = '
|
713 |
-
<div class="alignleft actions" >
|
714 |
-
<label for="search_cat_by_title" style="font-size:14px">Title: </label>
|
715 |
-
<input type="text" name="search_cat_by_title" value="' . $serch_value . '" id="search_cat_by_title" onchange="clear_serch_texts()">
|
716 |
-
</div>
|
717 |
-
<div class="alignleft actions">
|
718 |
-
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
719 |
-
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
720 |
-
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=spider_calendar_event_category\'" class="button-secondary action">
|
721 |
-
</div>';
|
722 |
-
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
723 |
-
?>
|
724 |
-
<table class="wp-list-table widefat fixed pages" style="width:99%">
|
725 |
-
<thead>
|
726 |
-
<TR>
|
727 |
-
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
728 |
-
<a href="javascript:ordering('id',<?php echo(($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
729 |
-
<span>ID</span>
|
730 |
-
<span class="sorting-indicator"></span>
|
731 |
-
</a>
|
732 |
-
</th>
|
733 |
-
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
734 |
-
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
735 |
-
<span>Title</span>
|
736 |
-
<span class="sorting-indicator"></span>
|
737 |
-
</a>
|
738 |
-
</th>
|
739 |
-
<th scope="col" id="description" class="<?php echo (($sort["sortid_by"] == "description") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
740 |
-
<a href="javascript:ordering('description',<?php echo (($sort["sortid_by"] == "description") ? $sort["1_or_2"] : "1"); ?>)">
|
741 |
-
<span>Description</span>
|
742 |
-
<span class="sorting-indicator"></span>
|
743 |
-
</a>
|
744 |
-
</th>
|
745 |
-
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
746 |
-
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
747 |
-
<span>Published</span>
|
748 |
-
<span class="sorting-indicator"></span>
|
749 |
-
</a>
|
750 |
-
</th>
|
751 |
-
</TR>
|
752 |
-
</thead>
|
753 |
-
<tbody id="category_body">
|
754 |
-
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
755 |
-
<tr id="Calendar-<?php echo $rows[$i]->id; ?>" class=" hentry alternate iedit author-self" style="display:table-row;">
|
756 |
-
<td><?php echo $rows[$i]->id; ?></td>
|
757 |
-
<td class="post-title page-title column-title">
|
758 |
-
<?php echo $rows[$i]->title; ?></a>
|
759 |
-
|
760 |
-
<div class="row-actions">
|
761 |
-
<span class="edit">
|
762 |
-
<a href="admin.php?page=spider_calendar_event_category&task=edit_event_category&id=<?php echo $rows[$i]->id; ?>" title="Edit This Calendar">Edit</a> | </span>
|
763 |
-
<span class="trash">
|
764 |
-
<a class="submitdelete" title="Delete This Calendar" href="javascript:confirmation('admin.php?page=spider_calendar_event_category&task=remove_event_category&id=<?php echo $rows[$i]->id; ?>','<?php echo $rows[$i]->title; ?>')">Delete</a></span>
|
765 |
-
</div>
|
766 |
-
</td>
|
767 |
-
<td><?php echo $rows[$i]->description; ?></td>
|
768 |
-
<td><a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?> href="admin.php?page=spider_calendar_event_category&task=published&id=<?php echo $rows[$i]->id; ?>&_wpnonce=<?php echo $sp_cal_nonce; ?>"><?php if ($rows[$i]->published) echo 'Yes'; else echo 'No'; ?></a>
|
769 |
-
</td>
|
770 |
-
</tr>
|
771 |
-
<?php } ?>
|
772 |
-
</tbody>
|
773 |
-
</table>
|
774 |
-
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
775 |
-
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo esc_js(esc_html(stripslashes($_POST['id_for_playlist'])));?>"/>
|
776 |
-
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo esc_js(esc_html(stripslashes($_POST['asc_or_desc'])));?>"/>
|
777 |
-
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo esc_js(esc_html(stripslashes($_POST['order_by'])));?>"/>
|
778 |
-
<?php
|
779 |
-
?>
|
780 |
-
</form>
|
781 |
-
<?php
|
782 |
-
|
783 |
-
}
|
784 |
-
|
785 |
-
function edit_event_category($id){
|
786 |
-
global $wpdb;
|
787 |
-
$row=$wpdb->get_row($wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE id=%d" , $id ));
|
788 |
-
?>
|
789 |
-
|
790 |
-
<script language="javascript" type="text/javascript">
|
791 |
-
<!--
|
792 |
-
function submitbutton(pressbutton) {
|
793 |
-
document.getElementById('adminForm').action = "admin.php?page=spider_calendar_event_category&task=" + pressbutton+"&id=<?php echo $id?>";
|
794 |
-
if (document.getElementById('cat_title').value == "") {
|
795 |
-
alert('Provide the category title:');
|
796 |
-
}
|
797 |
-
else if (document.getElementById('color').value == "") {
|
798 |
-
alert('Provide the category color:');
|
799 |
-
}
|
800 |
-
else {
|
801 |
-
document.getElementById('adminForm').submit();
|
802 |
-
}
|
803 |
-
}
|
804 |
-
jQuery(document).ready(function() {
|
805 |
-
jQuery('.color_input').wpColorPicker();
|
806 |
-
});
|
807 |
-
</script>
|
808 |
-
<style>
|
809 |
-
.wp-picker-holder{
|
810 |
-
position: absolute;
|
811 |
-
z-index: 2;
|
812 |
-
top: 20px;
|
813 |
-
}
|
814 |
-
.wp-color-result {
|
815 |
-
background-color: transparent;
|
816 |
-
width: 85px;
|
817 |
-
}
|
818 |
-
.wp-color-result:focus{
|
819 |
-
outline: none;
|
820 |
-
}
|
821 |
-
.color_for_this {
|
822 |
-
height: 24px;
|
823 |
-
top: 0px;
|
824 |
-
position: relative;
|
825 |
-
width: 35px;
|
826 |
-
left: 2px;
|
827 |
-
}
|
828 |
-
.wp-color-result:hover{
|
829 |
-
background-color: transparent;
|
830 |
-
}
|
831 |
-
|
832 |
-
.button-secondary.action{
|
833 |
-
margin: -4px;
|
834 |
-
}
|
835 |
-
</style>
|
836 |
-
<?php upgrade_pro_sp(); ?>
|
837 |
-
<table cellspacing="10" width="100%" id="category_table">
|
838 |
-
<tr>
|
839 |
-
<td><h2>Event Category <?php if(isset($row->title)) echo htmlspecialchars($row->title); ?></h2></td>
|
840 |
-
<td align="right" style="width: 45px;"><input type="button" onClick="submitbutton('save_category_event')" value="Save" class="button-secondary action"></td>
|
841 |
-
<td align="right" style="width: 50px;"><input type="button" onClick="submitbutton('apply_event_category')" value="Apply" class="button-secondary action"></td>
|
842 |
-
<td align="right" style="width: 59px;"><input type="button" onClick="window.location.href='admin.php?page=spider_calendar_event_category'" value="Cancel" class="button-secondary action" style="margin: 0px 0px 0px -5px;"></td>
|
843 |
-
</tr>
|
844 |
-
</table>
|
845 |
-
|
846 |
-
|
847 |
-
<form action="" method="post" name="adminForm" id="adminForm">
|
848 |
-
<div class="width-45 fltlft ">
|
849 |
-
<fieldset class="adminform" >
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
<table class="admintable" >
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
<tr>
|
859 |
-
<td class="key" ><label for="message"><?php echo 'Title'; ?>:</label> </td>
|
860 |
-
<td>
|
861 |
-
|
862 |
-
<input type="text" name="title" value="<?php if(isset($row->title)) echo htmlspecialchars($row->title);
|
863 |
-
?>" id="cat_title"/>
|
864 |
-
</td>
|
865 |
-
</tr>
|
866 |
-
|
867 |
-
<tr>
|
868 |
-
<td class="key" ><label for="message"><?php echo 'Color'; ?>:</label> </td>
|
869 |
-
|
870 |
-
<td>
|
871 |
-
<div class="color_for_this" style="background-color: #<?php if(isset($row->color)) echo htmlspecialchars($row->color); ?>">
|
872 |
-
<input type="text" name="color" id="color" class="color_input wp-color-picker" style="width:134px;" value="<?php if(isset($row->color)) echo htmlspecialchars($row->color); ?>"/>
|
873 |
-
</div>
|
874 |
-
</td>
|
875 |
-
</tr>
|
876 |
-
|
877 |
-
|
878 |
-
<tr>
|
879 |
-
<td class="key"><label for="message"> <?php echo 'Description'; ?>:</label></td>
|
880 |
-
<td ><div id="poststuff" style="width:100% !important;">
|
881 |
-
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
882 |
-
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor(stripslashes($row->description),"description","title" ); ?>
|
883 |
-
</div>
|
884 |
-
<?php }else{
|
885 |
-
if(isset($row->description)) $desc1 = $row->description;
|
886 |
-
else $desc1 = "";
|
887 |
-
wp_editor($desc1, "description"); }?>
|
888 |
-
|
889 |
-
</div>
|
890 |
-
</div></td>
|
891 |
-
|
892 |
-
</tr>
|
893 |
-
|
894 |
-
<tr>
|
895 |
-
<td class="key" ><label for="message"><?php echo 'Published'; ?>:</label> </td>
|
896 |
-
|
897 |
-
<td>
|
898 |
-
<input type="radio" name="published" id="published0" value="0" <?php if(isset($row->published)) cheched($row->published, '0'); ?> class="inputbox">
|
899 |
-
<label for="published0">No</label>
|
900 |
-
<input type="radio" name="published" id="published1" value="1" <?php (isset($row->published)) ? cheched($row->published, '1') : cheched('1', '1'); ?> class="inputbox">
|
901 |
-
<label for="published1">Yes</label>
|
902 |
-
</td>
|
903 |
-
</tr>
|
904 |
-
|
905 |
-
</table>
|
906 |
-
|
907 |
-
</fieldset >
|
908 |
-
</div>
|
909 |
-
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
910 |
-
<input type="hidden" name="id" value="<?php echo $id ?>" />
|
911 |
-
</form>
|
912 |
-
<?php
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
}
|
917 |
-
|
918 |
-
|
919 |
-
function html_upcoming_widget($rows, $pageNav, $sort){
|
920 |
-
require_once("spidercalendar_upcoming_events_widget.php");
|
921 |
-
global $wpdb;
|
922 |
-
$input_id=esc_html($_GET['id_input']);
|
923 |
-
$w_id = esc_html($_GET['w_id']);
|
924 |
-
$tbody_id='event'.$w_id;
|
925 |
-
$calendar_id=esc_html($_GET['upcalendar_id']);
|
926 |
-
?><html>
|
927 |
-
<head>
|
928 |
-
<link rel="stylesheet" id="thickbox-css" href="<?php echo plugins_url("elements/calendar-jos.css", __FILE__) ?>" type="text/css" media="all">
|
929 |
-
<?php wp_print_scripts("Canlendar_upcoming");
|
930 |
-
wp_print_scripts("calendnar-setup_upcoming");
|
931 |
-
wp_print_scripts("calenndar_function_upcoming");
|
932 |
-
?>
|
933 |
-
|
934 |
-
<style>
|
935 |
-
.calendar .button {
|
936 |
-
display: table-cell !important;
|
937 |
-
}
|
938 |
-
|
939 |
-
.wd_button{
|
940 |
-
border: 1px solid #D5D5D5 !important;
|
941 |
-
border-radius: 10px;
|
942 |
-
width: 30px;
|
943 |
-
height: 25px;
|
944 |
-
}
|
945 |
-
}
|
946 |
-
input[type=checkbox]:checked:before,
|
947 |
-
th.sorted.asc .sorting-indicator:before, th.desc:hover span.sorting-indicator:before,
|
948 |
-
th.sorted.desc .sorting-indicator:before, th.asc:hover span.sorting-indicator:before{
|
949 |
-
content: close-quote !important;
|
950 |
-
}
|
951 |
-
|
952 |
-
</style>
|
953 |
-
<script language="javascript">
|
954 |
-
function ordering(name, as_or_desc) {
|
955 |
-
document.getElementById('asc_or_desc').value = as_or_desc;
|
956 |
-
document.getElementById('order_by').value = name;
|
957 |
-
document.getElementById('admin_form').submit();
|
958 |
-
}
|
959 |
-
function submit_form_id(x) {
|
960 |
-
var val = x.options[x.selectedIndex].value;
|
961 |
-
document.getElementById("id_for_playlist").value = val;
|
962 |
-
document.getElementById("admin_form").submit();
|
963 |
-
}
|
964 |
-
|
965 |
-
function doNothing() {
|
966 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
967 |
-
if (keyCode == 13) {
|
968 |
-
if (!e) {
|
969 |
-
var e = window.event;
|
970 |
-
}
|
971 |
-
e.cancelBubble = true;
|
972 |
-
e.returnValue = false;
|
973 |
-
if (e.stopPropagation) {
|
974 |
-
e.stopPropagation();
|
975 |
-
e.preventDefault();
|
976 |
-
}
|
977 |
-
}
|
978 |
-
}
|
979 |
-
|
980 |
-
|
981 |
-
function isChecked(isitchecked){
|
982 |
-
if (isitchecked == true){
|
983 |
-
document.adminForm.boxchecked.value++;
|
984 |
-
}
|
985 |
-
else {
|
986 |
-
document.adminForm.boxchecked.value--;
|
987 |
-
}
|
988 |
-
}
|
989 |
-
|
990 |
-
|
991 |
-
function checkAll( n, fldName ) {
|
992 |
-
|
993 |
-
if (!fldName) {
|
994 |
-
|
995 |
-
fldName = 'cb';
|
996 |
-
|
997 |
-
}
|
998 |
-
|
999 |
-
var f = document.admin_form;
|
1000 |
-
|
1001 |
-
var c = f.toggle.checked;
|
1002 |
-
|
1003 |
-
var n2 = 0;
|
1004 |
-
|
1005 |
-
for (i=0; i < n; i++) {
|
1006 |
-
|
1007 |
-
cb = eval( 'f.' + fldName + '' + i );
|
1008 |
-
|
1009 |
-
if (cb) {
|
1010 |
-
|
1011 |
-
cb.checked = c;
|
1012 |
-
|
1013 |
-
n2++;
|
1014 |
-
|
1015 |
-
}
|
1016 |
-
|
1017 |
-
}
|
1018 |
-
|
1019 |
-
if (c) {
|
1020 |
-
|
1021 |
-
document.admin_form.boxchecked.value = n2;
|
1022 |
-
|
1023 |
-
} else {
|
1024 |
-
|
1025 |
-
document.admin_form.boxchecked.value = 0;
|
1026 |
-
|
1027 |
-
}
|
1028 |
-
|
1029 |
-
}
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
function select_events()
|
1035 |
-
|
1036 |
-
{
|
1037 |
-
var id =[];
|
1038 |
-
var title =[];
|
1039 |
-
|
1040 |
-
for(i=0; i<<?php echo count($rows)?>; i++)
|
1041 |
-
if(document.getElementById("p"+i))
|
1042 |
-
if(document.getElementById("p"+i).checked)
|
1043 |
-
{
|
1044 |
-
id.push(document.getElementById("p"+i).value);
|
1045 |
-
title.push(document.getElementById("title_"+i).value);
|
1046 |
-
|
1047 |
-
}
|
1048 |
-
window.parent.jSelectEvents('<?php echo $input_id ?>','<?php echo $tbody_id ?>','<?php echo $w_id ?>',id, title);
|
1049 |
-
}
|
1050 |
-
|
1051 |
-
|
1052 |
-
</script>
|
1053 |
-
<?php
|
1054 |
-
|
1055 |
-
|
1056 |
-
if(get_bloginfo( 'version' )>3.3){
|
1057 |
-
|
1058 |
-
?>
|
1059 |
-
|
1060 |
-
<link rel="stylesheet" href="<?php echo bloginfo("url") ?>/wp-admin/load-styles.php?c=0&dir=ltr&load=admin-bar,wp-admin&ver=7f0753feec257518ac1fec83d5bced6a" type="text/css" media="all">
|
1061 |
-
|
1062 |
-
<?php
|
1063 |
-
|
1064 |
-
}
|
1065 |
-
|
1066 |
-
else
|
1067 |
-
|
1068 |
-
{
|
1069 |
-
|
1070 |
-
?>
|
1071 |
-
|
1072 |
-
<link rel="stylesheet" href="<?php echo bloginfo("url") ?>/wp-admin/load-styles.php?c=1&dir=ltr&load=global,wp-admin&ver=aba7495e395713976b6073d5d07d3b17" type="text/css" media="all">
|
1073 |
-
|
1074 |
-
<?php
|
1075 |
-
|
1076 |
-
}
|
1077 |
-
|
1078 |
-
?>
|
1079 |
-
|
1080 |
-
<link rel="stylesheet" id="thickbox-css" href="<?php echo bloginfo('url')?>/wp-includes/js/thickbox/thickbox.css?ver=20111117" type="text/css" media="all">
|
1081 |
-
|
1082 |
-
<!---- <link rel="stylesheet" id="colors-css" href="<?php echo bloginfo('url')?>/wp-admin/css/colors-classic.css?ver=20111206" type="text/css" media="all"> --->
|
1083 |
-
</head>
|
1084 |
-
<body>
|
1085 |
-
<form method="post" onKeyPress="doNothing()" action="<?php echo admin_url('admin-ajax.php') ?>?action=upcoming&id_input=<?php echo $input_id;?>&upcalendar_id=<?php echo $calendar_id;?>&w_id=<?php echo $w_id;?>" id="admin_form" name="admin_form">
|
1086 |
-
<table cellspacing="10" width="100%">
|
1087 |
-
|
1088 |
-
<tr>
|
1089 |
-
<td width="100%"><h2>Event Manager</h2></td></td>
|
1090 |
-
<td align="right" width="100%">
|
1091 |
-
|
1092 |
-
<button onClick="select_events();" style="width:98px; height:34px; background:url(<?php echo plugins_url('',__FILE__) ?>/front_end/images/add_but.png) no-repeat;border:none;cursor:pointer;"> </button>
|
1093 |
-
</td>
|
1094 |
-
</tr>
|
1095 |
-
</table>
|
1096 |
-
<?php
|
1097 |
-
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
1098 |
-
$serch_value = esc_js(esc_html(stripslashes($_POST['search_events_by_title'])));
|
1099 |
-
}
|
1100 |
-
else {
|
1101 |
-
$serch_value = "";
|
1102 |
-
}
|
1103 |
-
$startdate = (isset($_POST["startdate"]) ? esc_js(esc_html(stripslashes($_POST["startdate"]))) : '');
|
1104 |
-
$enddate = (isset($_POST["enddate"]) ? esc_js(esc_html(stripslashes($_POST["enddate"]))) : '');
|
1105 |
-
$serch_fields = '
|
1106 |
-
<div class="alignleft actions">
|
1107 |
-
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
1108 |
-
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()" style="border: 1px solid #DCDCEC;"/>
|
1109 |
-
</div>
|
1110 |
-
<div class="alignleft actions">
|
1111 |
-
From: <input class="inputbox" type="text" style="width: 90px;border: 1px solid #DCDCEC;" name="startdate" id="startdate" size="10" maxlength="10" value="' . $startdate . '" />
|
1112 |
-
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'startdate\',\'%Y-%m-%d\');">
|
1113 |
-
To: <input class="inputbox" type="text" style="width: 90px;border: 1px solid #DCDCEC;" name="enddate" id="enddate" size="10" maxlength="10" value="' . $enddate . '">
|
1114 |
-
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'enddate\',\'%Y-%m-%d\');">
|
1115 |
-
</div>
|
1116 |
-
<div class="alignleft actions">
|
1117 |
-
<input type="button" style="border: 1px solid #DCDCEC;border-radius: 10px;" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\';document.getElementById(\'serch_or_not\').value=\'search\'; document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
1118 |
-
<input type="button" style="border: 1px solid #DCDCEC;border-radius: 10px;" value="Reset" onclick="window.location.href=\'admin-ajax.php?action=upcoming&id_input='.$input_id.'&upcalendar_id='.$calendar_id.'&w_id='.$w_id.'\'" class="button-secondary action">
|
1119 |
-
</div>';
|
1120 |
-
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
1121 |
-
?>
|
1122 |
-
<style>
|
1123 |
-
.sorting-indicator {
|
1124 |
-
width: 7px;
|
1125 |
-
height: 4px;
|
1126 |
-
margin-top: 8px;
|
1127 |
-
margin-left: 7px;
|
1128 |
-
background-image: url('images/sort.gif');
|
1129 |
-
background-repeat: no-repeat;
|
1130 |
-
}
|
1131 |
-
.wd_button{
|
1132 |
-
border: 1px solid #D5D5D5 !important;
|
1133 |
-
border-radius: 10px;
|
1134 |
-
width: 30px;
|
1135 |
-
height: 25px;
|
1136 |
-
}
|
1137 |
-
</style>
|
1138 |
-
<table class="wp-list-table widefat fixed pages" style="width:100%">
|
1139 |
-
<thead>
|
1140 |
-
<TR>
|
1141 |
-
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px;background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);">
|
1142 |
-
<a href="javascript:ordering('id',<?php echo (($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
1143 |
-
<span>ID</span>
|
1144 |
-
<span class="sorting-indicator"></span>
|
1145 |
-
</a>
|
1146 |
-
</th>
|
1147 |
-
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);" width="20" class="manage-column column-cb check-column">
|
1148 |
-
|
1149 |
-
<input style="border: 1px solid #DCDCEC;-webkit-appearance: checkbox;" type="checkbox" name="toggle" id="toggle" value="" onClick="checkAll(<?php echo count($rows)?>, 'p')">
|
1150 |
-
|
1151 |
-
</th>
|
1152 |
-
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);" scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1153 |
-
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
1154 |
-
<span>Title</span>
|
1155 |
-
<span class="sorting-indicator"></span>
|
1156 |
-
</a>
|
1157 |
-
</th>
|
1158 |
-
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);"scope="col" id="date" class="<?php echo (($sort["sortid_by"] == "date") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1159 |
-
<a href="javascript:ordering('date',<?php echo (($sort["sortid_by"] == "date") ? $sort["1_or_2"] : "1"); ?>)">
|
1160 |
-
<span>Date</span>
|
1161 |
-
<span class="sorting-indicator"></span>
|
1162 |
-
</a>
|
1163 |
-
</th>
|
1164 |
-
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);"scope="col" id="time" class="<?php echo (($sort["sortid_by"] == "time") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1165 |
-
<a href="javascript:ordering('time',<?php echo (($sort["sortid_by"] == "time") ? $sort["1_or_2"] : "1"); ?>)">
|
1166 |
-
<span>Time</span>
|
1167 |
-
<span class="sorting-indicator"></span>
|
1168 |
-
</a>
|
1169 |
-
</th>
|
1170 |
-
</TR>
|
1171 |
-
</thead>
|
1172 |
-
<tbody>
|
1173 |
-
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
1174 |
-
<tr>
|
1175 |
-
|
1176 |
-
<td style="border-bottom: 1px solid #DCDCEC;"><?php echo $rows[$i]->id; ?></td>
|
1177 |
-
<td style="border-bottom: 1px solid #DCDCEC;">
|
1178 |
-
<input style="border: 1px solid #DCDCEC;-webkit-appearance: checkbox;" type="checkbox" id="p<?php echo $i?>" value="<?php echo $rows[$i]->id;?>" />
|
1179 |
-
<input type="hidden" id="title_<?php echo $i?>" value="<?php echo htmlspecialchars($rows[$i]->title);?>" />
|
1180 |
-
</td>
|
1181 |
-
<td style="border-bottom: 1px solid #DCDCEC;"><a href="<?php echo admin_url('admin-ajax.php') ?>?action=upcoming" onClick="window.parent.jSelectEvents('<?php echo $input_id ?>','<?php echo $tbody_id ?>','<?php echo $w_id ?>',['<?php echo $rows[$i]->id?>'],['<?php echo htmlspecialchars(addslashes($rows[$i]->title));?>'])"><?php echo $rows[$i]->title; ?></a>
|
1182 |
-
</td>
|
1183 |
-
<td style="border-bottom: 1px solid #DCDCEC;"><?php if ($rows[$i]->date_end != '0000-00-00' && $rows[$i]->date_end != '2035-12-12') echo $rows[$i]->date . ' - ' . $rows[$i]->date_end; else echo $rows[$i]->date; ?></td>
|
1184 |
-
<td style="border-bottom: 1px solid #DCDCEC;"><?php echo $rows[$i]->time ?></td>
|
1185 |
-
</tr>
|
1186 |
-
<?php } ?>
|
1187 |
-
</tbody>
|
1188 |
-
</table>
|
1189 |
-
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
1190 |
-
<input type="hidden" name="boxchecked" value="0">
|
1191 |
-
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo esc_js(esc_html(stripslashes($_POST['asc_or_desc']))); ?>"/>
|
1192 |
-
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo esc_js(esc_html(stripslashes($_POST['order_by']))); ?>"/>
|
1193 |
-
<?php
|
1194 |
-
?>
|
1195 |
-
</form>
|
1196 |
-
</body>
|
1197 |
-
</html>
|
1198 |
-
<?php
|
1199 |
-
die();
|
1200 |
-
}
|
1201 |
-
|
1202 |
-
// Events.
|
1203 |
-
function html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name) {
|
1204 |
-
global $wpdb;
|
1205 |
-
?>
|
1206 |
-
<style>
|
1207 |
-
.calendar .button {
|
1208 |
-
display: table-cell !important;
|
1209 |
-
}
|
1210 |
-
.wd_button{
|
1211 |
-
border: 1px solid #D5D5D5 !important;
|
1212 |
-
border-radius: 10px;
|
1213 |
-
width: 30px;
|
1214 |
-
height: 25px;
|
1215 |
-
}
|
1216 |
-
</style>
|
1217 |
-
<script language="javascript">
|
1218 |
-
function ordering(name, as_or_desc) {
|
1219 |
-
document.getElementById('asc_or_desc').value = as_or_desc;
|
1220 |
-
document.getElementById('order_by').value = name;
|
1221 |
-
document.getElementById('admin_form').submit();
|
1222 |
-
}
|
1223 |
-
function doNothing() {
|
1224 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
1225 |
-
if (keyCode == 13) {
|
1226 |
-
if (!e) {
|
1227 |
-
var e = window.event;
|
1228 |
-
}
|
1229 |
-
e.cancelBubble = true;
|
1230 |
-
e.returnValue = false;
|
1231 |
-
if (e.stopPropagation) {
|
1232 |
-
e.stopPropagation();
|
1233 |
-
e.preventDefault();
|
1234 |
-
}
|
1235 |
-
}
|
1236 |
-
}
|
1237 |
-
</script>
|
1238 |
-
<div class="sp_calendar_upgrade wd-clear" >
|
1239 |
-
<div class="wd-left">
|
1240 |
-
<div style="font-size: 14px;">
|
1241 |
-
<?php _e("This section allows you to create/edit the events of a particular calendar.","sp_calendar");?>
|
1242 |
-
<a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
|
1243 |
-
</div>
|
1244 |
-
</div>
|
1245 |
-
<div class="wd-right">
|
1246 |
-
<div class="wd-table">
|
1247 |
-
<div class="wd-cell wd-cell-valign-middle">
|
1248 |
-
<a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
|
1249 |
-
<img src="<?php echo plugins_url('images/i_support.png', __FILE__); ?>" >
|
1250 |
-
<?php _e("Support Forum", "sp_calendar"); ?>
|
1251 |
-
</a>
|
1252 |
-
</div>
|
1253 |
-
<div class="wd-cell wd-cell-valign-middle">
|
1254 |
-
<a href="https://web-dorado.com/products/wordpress-calendar.html" target="_blank">
|
1255 |
-
<?php _e("UPGRADE TO PAID VERSION", "sp_calendar"); ?>
|
1256 |
-
</a>
|
1257 |
-
</div>
|
1258 |
-
</div>
|
1259 |
-
|
1260 |
-
</div>
|
1261 |
-
</div>
|
1262 |
-
<form method="post" onKeyPress="doNothing()" action="admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=<?php echo $calendar_id; ?>" id="admin_form" name="admin_form">
|
1263 |
-
<?php $sp_cal_nonce = wp_create_nonce('nonce_sp_cal'); ?>
|
1264 |
-
<table cellspacing="10" width="95%">
|
1265 |
-
<tr>
|
1266 |
-
<td width="100%"><h2>Event Manager for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
1267 |
-
<td>
|
1268 |
-
<p class="submit" style="padding:0px; text-align:left">
|
1269 |
-
<input class="button-primary" type="button" value="Add an Event" name="custom_parametrs" onClick="window.location.href='admin.php?page=SpiderCalendar&task=add_event&calendar_id=<?php echo $calendar_id; ?>'" style="float: right; margin: 0px 0 0 40px;"/>
|
1270 |
-
</p>
|
1271 |
-
</td>
|
1272 |
-
<td>
|
1273 |
-
<p class="submit" style="padding:0px; text-align:left">
|
1274 |
-
<input type="button" class="button-primary" value="Back" name="custom_parametrs" onClick="window.location.href='admin.php?page=SpiderCalendar'" style="margin: 0 0 0 -5px; float: right;"/>
|
1275 |
-
</p>
|
1276 |
-
</td>
|
1277 |
-
</tr>
|
1278 |
-
</table>
|
1279 |
-
<?php
|
1280 |
-
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
1281 |
-
$serch_value = esc_js(esc_html(stripslashes($_POST['search_events_by_title'])));
|
1282 |
-
}
|
1283 |
-
else {
|
1284 |
-
$serch_value = "";
|
1285 |
-
}
|
1286 |
-
$startdate = (isset($_POST["startdate"]) ? esc_js(esc_html(stripslashes($_POST["startdate"]))) : '');
|
1287 |
-
$enddate = (isset($_POST["enddate"]) ? esc_js(esc_html(stripslashes($_POST["enddate"]))) : '');
|
1288 |
-
$serch_fields = '
|
1289 |
-
<div class="alignleft actions">
|
1290 |
-
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
1291 |
-
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()" />
|
1292 |
-
</div>
|
1293 |
-
<div class="alignleft actions">
|
1294 |
-
From: <input style="width: 90px;" class="inputbox" type="text" name="startdate" id="startdate" size="10" maxlength="10" value="' . $startdate . '" />
|
1295 |
-
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'startdate\',\'%Y-%m-%d\');">
|
1296 |
-
To: <input style="width: 90px;" class="inputbox" type="text" name="enddate" id="enddate" size="10" maxlength="10" value="' . $enddate . '">
|
1297 |
-
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'enddate\',\'%Y-%m-%d\');">
|
1298 |
-
</div>
|
1299 |
-
<div class="alignleft actions">
|
1300 |
-
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\';document.getElementById(\'serch_or_not\').value=\'search\'; document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
1301 |
-
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=' . $calendar_id . '\'" class="button-secondary action">
|
1302 |
-
</div>';
|
1303 |
-
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
1304 |
-
?>
|
1305 |
-
<table class="wp-list-table widefat fixed pages" style="width:99%">
|
1306 |
-
<thead>
|
1307 |
-
<TR>
|
1308 |
-
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
1309 |
-
<a href="javascript:ordering('id',<?php echo (($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
1310 |
-
<span>ID</span>
|
1311 |
-
<span class="sorting-indicator"></span>
|
1312 |
-
</a>
|
1313 |
-
</th>
|
1314 |
-
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1315 |
-
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
1316 |
-
<span>Title</span>
|
1317 |
-
<span class="sorting-indicator"></span>
|
1318 |
-
</a>
|
1319 |
-
</th>
|
1320 |
-
<th scope="col" id="date" class="<?php echo (($sort["sortid_by"] == "date") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1321 |
-
<a href="javascript:ordering('date',<?php echo (($sort["sortid_by"] == "date") ? $sort["1_or_2"] : "1"); ?>)">
|
1322 |
-
<span>Date</span>
|
1323 |
-
<span class="sorting-indicator"></span>
|
1324 |
-
</a>
|
1325 |
-
</th>
|
1326 |
-
<th scope="col" id="time" class="<?php echo (($sort["sortid_by"] == "time") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1327 |
-
<a href="javascript:ordering('time',<?php echo (($sort["sortid_by"] == "time") ? $sort["1_or_2"] : "1"); ?>)">
|
1328 |
-
<span>Time</span>
|
1329 |
-
<span class="sorting-indicator"></span>
|
1330 |
-
</a>
|
1331 |
-
</th>
|
1332 |
-
<th scope="col" id="cattitle" class="<?php echo (($sort["sortid_by"] == "cattitle") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1333 |
-
<a href="javascript:ordering('cattitle',<?php echo (($sort["sortid_by"] == "cattitle") ? $sort["1_or_2"] : "1"); ?>)">
|
1334 |
-
<span>Category</span>
|
1335 |
-
<span class="sorting-indicator"></span>
|
1336 |
-
</a>
|
1337 |
-
</th>
|
1338 |
-
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
1339 |
-
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
1340 |
-
<span>Published</span>
|
1341 |
-
<span class="sorting-indicator"></span>
|
1342 |
-
</a>
|
1343 |
-
</th>
|
1344 |
-
<th style="width:80px">Copy</th>
|
1345 |
-
<th style="width:80px">Edit</th>
|
1346 |
-
<th style="width:80px">Delete</th>
|
1347 |
-
</TR>
|
1348 |
-
</thead>
|
1349 |
-
<tbody>
|
1350 |
-
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
1351 |
-
<tr>
|
1352 |
-
<td><?php echo $rows[$i]->id; ?></td>
|
1353 |
-
<td><a href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=edit_event&id=<?php echo $rows[$i]->id; ?>"><?php echo $rows[$i]->title; ?></a>
|
1354 |
-
</td>
|
1355 |
-
<td><?php if ($rows[$i]->date_end != '0000-00-00' && $rows[$i]->date_end != '2035-12-12') echo $rows[$i]->date . ' - ' . $rows[$i]->date_end; else echo $rows[$i]->date; ?></td>
|
1356 |
-
<td><?php echo $rows[$i]->time ?></td>
|
1357 |
-
<td><?php echo $rows[$i]->cattitle ?></td>
|
1358 |
-
<td>
|
1359 |
-
<a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?> href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=published_event&id=<?php echo $rows[$i]->id; ?>&_wpnonce=<?php echo $sp_cal_nonce; ?>"><?php if ($rows[$i]->published)
|
1360 |
-
echo 'Yes'; else echo 'No'; ?>
|
1361 |
-
</a>
|
1362 |
-
</td>
|
1363 |
-
<td>
|
1364 |
-
<a href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=copy_event&id=<?php echo $rows[$i]->id; ?>&_wpnonce=<?php echo $sp_cal_nonce; ?>"><img src="<?php echo plugins_url('images/copy_cal.gif', __FILE__); ?>" /></a>
|
1365 |
-
</td>
|
1366 |
-
<td>
|
1367 |
-
<a href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=edit_event&id=<?php echo $rows[$i]->id; ?>">Edit</a>
|
1368 |
-
</td>
|
1369 |
-
<td>
|
1370 |
-
<a href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=remove_event&id=<?php echo $rows[$i]->id; ?>&_wpnonce=<?php echo $sp_cal_nonce; ?>">Delete</a>
|
1371 |
-
</td>
|
1372 |
-
</tr>
|
1373 |
-
<?php } ?>
|
1374 |
-
</tbody>
|
1375 |
-
</table>
|
1376 |
-
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo esc_js(esc_html(stripslashes($_POST['id_for_playlist']))); ?>"/>
|
1377 |
-
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo esc_js(esc_html(stripslashes($_POST['asc_or_desc']))); ?>"/>
|
1378 |
-
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo esc_js(esc_html(stripslashes($_POST['order_by']))); ?>"/>
|
1379 |
-
<?php
|
1380 |
-
?>
|
1381 |
-
</form>
|
1382 |
-
|
1383 |
-
<?php
|
1384 |
-
}
|
1385 |
-
|
1386 |
-
function html_add_spider_event($calendar_id, $cal_name) {
|
1387 |
-
?>
|
1388 |
-
<style>
|
1389 |
-
.calendar .button {
|
1390 |
-
display: table-cell !important;
|
1391 |
-
}
|
1392 |
-
.wd_button{
|
1393 |
-
border: 1px solid #D5D5D5 !important;
|
1394 |
-
border-radius: 10px;
|
1395 |
-
width: 30px;
|
1396 |
-
height: 25px;
|
1397 |
-
}
|
1398 |
-
</style>
|
1399 |
-
<script language="javascript" type="text/javascript">
|
1400 |
-
function submitbutton(pressbutton) {
|
1401 |
-
var form = document.adminForm;
|
1402 |
-
if (pressbutton == 'cancel_event') {
|
1403 |
-
submitform(pressbutton);
|
1404 |
-
return;
|
1405 |
-
}
|
1406 |
-
if (form.date.value.search(/^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/)) {
|
1407 |
-
alert('Invalid Date');
|
1408 |
-
}
|
1409 |
-
else if(form.repeat_method.value=="weekly"){
|
1410 |
-
var atLeastOneIsChecked = false;
|
1411 |
-
jQuery('input:checkbox').each(function () {
|
1412 |
-
if (jQuery(this).is(':checked')) {
|
1413 |
-
atLeastOneIsChecked = true;
|
1414 |
-
}
|
1415 |
-
});
|
1416 |
-
if(atLeastOneIsChecked) submitform(pressbutton)
|
1417 |
-
else alert('Invalid Weekday');
|
1418 |
-
}
|
1419 |
-
else if (form.selhour_from.value == "" && form.selminute_from.value == "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1420 |
-
submitform(pressbutton);
|
1421 |
-
}
|
1422 |
-
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1423 |
-
submitform(pressbutton);
|
1424 |
-
}
|
1425 |
-
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value != "" && form.selminute_to.value != "") {
|
1426 |
-
submitform(pressbutton);
|
1427 |
-
}
|
1428 |
-
|
1429 |
-
else {
|
1430 |
-
alert('Invalid Time');
|
1431 |
-
}
|
1432 |
-
}
|
1433 |
-
|
1434 |
-
|
1435 |
-
function submitform(pressbutton) {
|
1436 |
-
|
1437 |
-
if (document.getElementById('title').value == "") {
|
1438 |
-
alert('Provide the title:');
|
1439 |
-
}
|
1440 |
-
else {
|
1441 |
-
document.getElementById('adminForm').submit();
|
1442 |
-
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
1443 |
-
document.getElementById('adminForm').submit();
|
1444 |
-
}
|
1445 |
-
}
|
1446 |
-
function checkhour(id,event) {
|
1447 |
-
if (typeof(event) != 'undefined') {
|
1448 |
-
var e = event; // for trans-browser compatibility
|
1449 |
-
var charCode = e.which || e.keyCode;
|
1450 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1451 |
-
return false;
|
1452 |
-
}
|
1453 |
-
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1454 |
-
hour = parseFloat(hour);
|
1455 |
-
if (document.getSelection() != '') {
|
1456 |
-
return true;
|
1457 |
-
}
|
1458 |
-
if ((hour < 0) || (hour > 23)) {
|
1459 |
-
return false;
|
1460 |
-
}
|
1461 |
-
}
|
1462 |
-
return true;
|
1463 |
-
}
|
1464 |
-
function check12hour(id,event) {
|
1465 |
-
if (typeof(event) != 'undefined') {
|
1466 |
-
var e = event; // for trans-browser compatibility
|
1467 |
-
var charCode = e.which || e.keyCode;
|
1468 |
-
input = document.getElementById(id);
|
1469 |
-
if (charCode == 48 && input.value.length == 0) {
|
1470 |
-
return false;
|
1471 |
-
}
|
1472 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1473 |
-
return false;
|
1474 |
-
}
|
1475 |
-
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1476 |
-
hour = parseFloat(hour);
|
1477 |
-
if (document.getSelection() != '') {
|
1478 |
-
return true;
|
1479 |
-
}
|
1480 |
-
if ((hour < 0) || (hour > 12)) {
|
1481 |
-
return false;
|
1482 |
-
}
|
1483 |
-
}
|
1484 |
-
return true;
|
1485 |
-
}
|
1486 |
-
function checknumber(id,event) {
|
1487 |
-
if (typeof(event) != 'undefined') {
|
1488 |
-
var e = event; // for trans-browser compatibility
|
1489 |
-
var charCode = e.which || e.keyCode;
|
1490 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1491 |
-
return false;
|
1492 |
-
}
|
1493 |
-
}
|
1494 |
-
return true;
|
1495 |
-
}
|
1496 |
-
function checkminute(id,event) {
|
1497 |
-
if (typeof(event) != 'undefined') {
|
1498 |
-
var e = event; // for trans-browser compatibility
|
1499 |
-
var charCode = e.which || e.keyCode;
|
1500 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1501 |
-
return false;
|
1502 |
-
}
|
1503 |
-
minute = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1504 |
-
minute = parseFloat(minute);
|
1505 |
-
if (document.getSelection() != '') {
|
1506 |
-
return true;
|
1507 |
-
}
|
1508 |
-
if ((minute < 0) || (minute > 59)) {
|
1509 |
-
return false;
|
1510 |
-
}
|
1511 |
-
}
|
1512 |
-
return true;
|
1513 |
-
}
|
1514 |
-
function add_0(id) {
|
1515 |
-
input = document.getElementById(id);
|
1516 |
-
if (input.value.length == 1) {
|
1517 |
-
input.value = '0' + input.value;
|
1518 |
-
input.setAttribute("value", input.value);
|
1519 |
-
}
|
1520 |
-
}
|
1521 |
-
function change_type(type) {
|
1522 |
-
if (document.getElementById('daily1').value == '') {
|
1523 |
-
document.getElementById('daily1').value = 1;
|
1524 |
-
}
|
1525 |
-
else {
|
1526 |
-
document.getElementById('repeat_input').removeAttribute('style');
|
1527 |
-
}
|
1528 |
-
if (document.getElementById('weekly1').value == '') {
|
1529 |
-
document.getElementById('weekly1').value = 1;
|
1530 |
-
}
|
1531 |
-
if (document.getElementById('monthly1').value == '') {
|
1532 |
-
document.getElementById('monthly1').value = 1;
|
1533 |
-
}
|
1534 |
-
if (document.getElementById('yearly1').value == '') {
|
1535 |
-
document.getElementById('yearly1').value = 1;
|
1536 |
-
}
|
1537 |
-
switch (type) {
|
1538 |
-
case 'no_repeat':
|
1539 |
-
document.getElementById('daily').setAttribute('style', 'display:none');
|
1540 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1541 |
-
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1542 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1543 |
-
document.getElementById('month').value = '';
|
1544 |
-
document.getElementById('date_end').value = '';
|
1545 |
-
document.getElementById('repeat_until').setAttribute('style', 'display:none');
|
1546 |
-
break;
|
1547 |
-
|
1548 |
-
case 'daily':
|
1549 |
-
document.getElementById('daily').removeAttribute('style');
|
1550 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1551 |
-
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1552 |
-
document.getElementById('repeat').innerHTML = 'Day(s)';
|
1553 |
-
document.getElementById('repeat_input').value = document.getElementById('daily1').value;
|
1554 |
-
document.getElementById('month').value = '';
|
1555 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1556 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
1557 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1558 |
-
return input_value('daily1')
|
1559 |
-
};
|
1560 |
-
break;
|
1561 |
-
|
1562 |
-
case 'weekly':
|
1563 |
-
document.getElementById('daily').removeAttribute('style');
|
1564 |
-
document.getElementById('weekly').removeAttribute('style');
|
1565 |
-
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1566 |
-
document.getElementById('repeat').innerHTML = 'Week(s) on :';
|
1567 |
-
document.getElementById('repeat_input').value = document.getElementById('weekly1').value;
|
1568 |
-
document.getElementById('month').value = '';
|
1569 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1570 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
1571 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1572 |
-
return input_value('weekly1')
|
1573 |
-
};
|
1574 |
-
break;
|
1575 |
-
|
1576 |
-
case 'monthly':
|
1577 |
-
document.getElementById('daily').removeAttribute('style');
|
1578 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1579 |
-
document.getElementById('monthly').removeAttribute('style');
|
1580 |
-
document.getElementById('repeat').innerHTML = 'Month(s)'
|
1581 |
-
document.getElementById('repeat_input').value = document.getElementById('monthly1').value;
|
1582 |
-
document.getElementById('month').value = '';
|
1583 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1584 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
1585 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1586 |
-
return input_value('monthly1')
|
1587 |
-
};
|
1588 |
-
|
1589 |
-
break;
|
1590 |
-
|
1591 |
-
case 'yearly':
|
1592 |
-
document.getElementById('daily').removeAttribute('style');
|
1593 |
-
document.getElementById('year_month').removeAttribute('style');
|
1594 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1595 |
-
document.getElementById('monthly').removeAttribute('style');
|
1596 |
-
document.getElementById('repeat').innerHTML = 'Year(s) in ';
|
1597 |
-
document.getElementById('repeat_input').value = document.getElementById('yearly1').value;
|
1598 |
-
document.getElementById('month').value = '';
|
1599 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
1600 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1601 |
-
return input_value('yearly1')
|
1602 |
-
};
|
1603 |
-
break;
|
1604 |
-
}
|
1605 |
-
}
|
1606 |
-
function week_value() {
|
1607 |
-
var value = '';
|
1608 |
-
for (i = 1; i <= 7; i++) {
|
1609 |
-
if (document.getElementById('week_' + i).checked) {
|
1610 |
-
value = value + document.getElementById('week_' + i).value + ',';
|
1611 |
-
}
|
1612 |
-
}
|
1613 |
-
document.getElementById('week').value = value;
|
1614 |
-
}
|
1615 |
-
function input_repeat() {
|
1616 |
-
if (document.getElementById('repeat_input').value == 1) {
|
1617 |
-
document.getElementById('repeat_input').value = '';
|
1618 |
-
}
|
1619 |
-
document.getElementById('repeat_input').removeAttribute('style');
|
1620 |
-
}
|
1621 |
-
function radio_month() {
|
1622 |
-
if (document.getElementById('radio1').checked == true) {
|
1623 |
-
document.getElementById('monthly_list').disabled = true;
|
1624 |
-
document.getElementById('month_week').disabled = true;
|
1625 |
-
document.getElementById('month').disabled = false;
|
1626 |
-
}
|
1627 |
-
else {
|
1628 |
-
document.getElementById('month').disabled = true;
|
1629 |
-
document.getElementById('monthly_list').disabled = false;
|
1630 |
-
document.getElementById('month_week').disabled = false;
|
1631 |
-
}
|
1632 |
-
}
|
1633 |
-
function input_value(id) {
|
1634 |
-
document.getElementById(id).value = document.getElementById('repeat_input').value;
|
1635 |
-
}
|
1636 |
-
</script>
|
1637 |
-
<style>
|
1638 |
-
fieldset {
|
1639 |
-
border: 2px solid #4f9bc6;
|
1640 |
-
width: 100%;
|
1641 |
-
background: #fafbfd;
|
1642 |
-
padding: 13px;
|
1643 |
-
margin-top: 20px;
|
1644 |
-
-webkit-border-radius: 8px;
|
1645 |
-
-moz-border-radius: 8px;
|
1646 |
-
border-radius: 8px;
|
1647 |
-
|
1648 |
-
}
|
1649 |
-
.wd_button{
|
1650 |
-
border: 1px solid #D5D5D5 !important;
|
1651 |
-
border-radius: 10px;
|
1652 |
-
width: 30px;
|
1653 |
-
height: 25px;
|
1654 |
-
}
|
1655 |
-
</style>
|
1656 |
-
<div class="sp_calendar_upgrade wd-clear" >
|
1657 |
-
<div class="wd-left">
|
1658 |
-
<div style="font-size: 14px;">
|
1659 |
-
<?php _e("This section allows you to create/edit the events of a particular calendar.","sp_calendar");?>
|
1660 |
-
<a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
|
1661 |
-
</div>
|
1662 |
-
</div>
|
1663 |
-
<div class="wd-right">
|
1664 |
-
<div class="wd-table">
|
1665 |
-
<div class="wd-cell wd-cell-valign-middle">
|
1666 |
-
<a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
|
1667 |
-
<img src="<?php echo plugins_url('images/i_support.png', __FILE__); ?>" >
|
1668 |
-
<?php _e("Support Forum", "sp_calendar"); ?>
|
1669 |
-
</a>
|
1670 |
-
</div>
|
1671 |
-
<div class="wd-cell wd-cell-valign-middle">
|
1672 |
-
<a href="https://web-dorado.com/products/wordpress-calendar.html" target="_blank">
|
1673 |
-
<?php _e("UPGRADE TO PAID VERSION", "sp_calendar"); ?>
|
1674 |
-
</a>
|
1675 |
-
</div>
|
1676 |
-
</div>
|
1677 |
-
|
1678 |
-
</div>
|
1679 |
-
</div>
|
1680 |
-
<table width="95%">
|
1681 |
-
<tbody>
|
1682 |
-
<tr>
|
1683 |
-
<td width="100%"><h2>Add an event for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
1684 |
-
<td align="right"><input type="button" onClick="submitbutton('save_event')" value="Save" class="button-secondary action"></td>
|
1685 |
-
<td align="right"><input type="button" onClick="submitbutton('apply_event')" value="Apply" class="button-secondary action"></td>
|
1686 |
-
<td align="right"><input type="button" onClick="window.location.href='admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=show_manage_event'" value="Cancel" class="button-secondary action"></td>
|
1687 |
-
</tr>
|
1688 |
-
</tbody>
|
1689 |
-
</table>
|
1690 |
-
<?php
|
1691 |
-
global $wpdb;
|
1692 |
-
$calendar = $wpdb->get_row($wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id=%d", $calendar_id ));
|
1693 |
-
|
1694 |
-
|
1695 |
-
$query1 = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.category, " . $wpdb->prefix . "spidercalendar_event_category.title
|
1696 |
-
FROM " . $wpdb->prefix . "spidercalendar_event
|
1697 |
-
JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
1698 |
-
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id;");
|
1699 |
-
|
1700 |
-
$query2 = $wpdb->get_results("SELECT title,id FROM " . $wpdb->prefix . "spidercalendar_event_category");
|
1701 |
-
|
1702 |
-
?>
|
1703 |
-
<form action="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>" method="post" id="adminForm" name="adminForm">
|
1704 |
-
<table width="95%">
|
1705 |
-
<tr>
|
1706 |
-
<td style="width:45%">
|
1707 |
-
<div style="width:95%">
|
1708 |
-
<fieldset class="adminform">
|
1709 |
-
<legend>Event Details</legend>
|
1710 |
-
<table class="admintable">
|
1711 |
-
<tr>
|
1712 |
-
<td class="key"><label for="title">Title: </label></td>
|
1713 |
-
<td><input type="text" id="title" name="title" size="41"/></td>
|
1714 |
-
</tr>
|
1715 |
-
|
1716 |
-
<tr>
|
1717 |
-
<td class="key"><label for="category">Select Category: </label></td>
|
1718 |
-
<td>
|
1719 |
-
<select id="category" name="category" style="width:240px">
|
1720 |
-
<option value="0">--Select Category--</option>
|
1721 |
-
<?php foreach ($query2 as $key => $category) {
|
1722 |
-
?>
|
1723 |
-
<option value="<?php echo $category->id; ?>"><?php if(isset($category)) echo $category->title ?></option>
|
1724 |
-
<?php
|
1725 |
-
}
|
1726 |
-
?>
|
1727 |
-
</select>
|
1728 |
-
</td>
|
1729 |
-
</tr>
|
1730 |
-
<tr>
|
1731 |
-
<td class="key"><label for="date">Date: </label></td>
|
1732 |
-
<td>
|
1733 |
-
<input style="width:90px" class="inputbox" type="text" name="date" id="date" size="10" maxlength="10" value="" />
|
1734 |
-
<input type="reset" class="wd_button" value="..." onClick="return showCalendar('date','%Y-%m-%d');" style="width: 31px;" />
|
1735 |
-
</td>
|
1736 |
-
</tr>
|
1737 |
-
<tr>
|
1738 |
-
<td class="key"><label for="selhour_from">Time: </label></td>
|
1739 |
-
<?php if ($calendar->time_format == 1) { ?>
|
1740 |
-
<td>
|
1741 |
-
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right" onKeyPress="return check12hour('selhour_from',event)" value="" title="from"/> <b>:</b>
|
1742 |
-
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right" onKeyPress="return checkminute('selminute_from',event)" value="" onBlur="add_0('selminute_from')" title="from"/>
|
1743 |
-
<select id="select_from" name="select_from">
|
1744 |
-
<option selected="selected">AM</option>
|
1745 |
-
<option>PM</option>
|
1746 |
-
</select>
|
1747 |
-
<span style="font-size:12px"> - </span>
|
1748 |
-
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right" onKeyPress="return check12hour('selhour_to',event)" value="" title="to"/> <b>:</b>
|
1749 |
-
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right" onKeyPress="return checkminute('selminute_to',event)" value="" onBlur="add_0('selminute_to')" title="to"/>
|
1750 |
-
<select id="select_to" name="select_to">
|
1751 |
-
<option>AM</option>
|
1752 |
-
<option>PM</option>
|
1753 |
-
</select>
|
1754 |
-
</td>
|
1755 |
-
<?php } if ($calendar->time_format == 0) { ?>
|
1756 |
-
<td>
|
1757 |
-
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right" onKeyPress="return checkhour('selhour_from',event)" value="" title="from" /> <b>:</b>
|
1758 |
-
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right" onKeyPress="return checkminute('selminute_from',event)" value="" title="from" onBlur="add_0('selminute_from')"/>
|
1759 |
-
<span style="font-size:12px"> - </span>
|
1760 |
-
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right" onKeyPress="return checkhour('selhour_to',event)" value="" title="to" /> <b>:</b>
|
1761 |
-
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right" onKeyPress="return checkminute('selminute_to',event)" value="" title="to" onBlur="add_0('selminute_to')"/>
|
1762 |
-
</td>
|
1763 |
-
<?php }?>
|
1764 |
-
</tr>
|
1765 |
-
<tr>
|
1766 |
-
<td class="key"><label for="poststuff">Note: </label></td>
|
1767 |
-
<td>
|
1768 |
-
<div id="poststuff" style="width:100% !important; min-width: 540px;">
|
1769 |
-
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
1770 |
-
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
|
1771 |
-
<?php the_editor(stripslashes(""),"text_for_date","title" ); ?>
|
1772 |
-
</div>
|
1773 |
-
<?php }else{
|
1774 |
-
wp_editor("", "text_for_date"); }?>
|
1775 |
-
</div>
|
1776 |
-
</div>
|
1777 |
-
</td>
|
1778 |
-
</tr>
|
1779 |
-
<tr>
|
1780 |
-
<td class="key"><label for="published1">Published: </label></td>
|
1781 |
-
<td>
|
1782 |
-
<input type="radio" name="published" id="published0" value="0" class="inputbox">
|
1783 |
-
<label for="published0">No</label>
|
1784 |
-
<input type="radio" name="published" id="published1" value="1" checked="checked" class="inputbox">
|
1785 |
-
<label for="published1">Yes</label>
|
1786 |
-
</td>
|
1787 |
-
</tr>
|
1788 |
-
</table>
|
1789 |
-
</fieldset>
|
1790 |
-
</div>
|
1791 |
-
</td>
|
1792 |
-
<td style="padding-left:25px; vertical-align:top !important; width:45%">
|
1793 |
-
<div style="width:100%">
|
1794 |
-
<fieldset class="adminform" style="margin-left: -25px;"><legend>Repeat Event</legend>
|
1795 |
-
<table>
|
1796 |
-
<tr>
|
1797 |
-
<td valign="top">
|
1798 |
-
<input type="radio" id="no_repeat_type" value="no_repeat" name="repeat_method" checked="checked" onChange="change_type('no_repeat')">
|
1799 |
-
<label for="no_repeat_type">Don't repeat this event</label>
|
1800 |
-
<br/>
|
1801 |
-
<input type="radio" id="daily_type" value="daily" name="repeat_method" onChange="change_type('daily');">
|
1802 |
-
<label for="daily_type">Repeat daily</label>
|
1803 |
-
<br/>
|
1804 |
-
<input type="radio" id="weekly_type" value="weekly" name="repeat_method" onChange="change_type('weekly');">
|
1805 |
-
<label for="weekly_type">Repeat weekly</label>
|
1806 |
-
<br/>
|
1807 |
-
<input type="radio" id="monthly_type" value="monthly" name="repeat_method" onChange="change_type('monthly');">
|
1808 |
-
<label for="monthly_type">Repeat monthly</label>
|
1809 |
-
<br/>
|
1810 |
-
<input type="radio" id="yearly_type" value="yearly" name="repeat_method" onChange="change_type('yearly');">
|
1811 |
-
<label for="yearly_type">Repeat yearly</label>
|
1812 |
-
<br/>
|
1813 |
-
</td>
|
1814 |
-
<td style="padding-left:10px" valign="top">
|
1815 |
-
<div id="daily" style="display:none">Repeat every
|
1816 |
-
<input type="text" id="repeat_input" size="5" name="repeat" onClick="return input_repeat()" onKeyPress="return checknumber(repeat_input)" value="1"/>
|
1817 |
-
<label id="repeat"></label>
|
1818 |
-
<label id="year_month" style="display:none;">
|
1819 |
-
<select name="year_month" id="year_month" class="inputbox">
|
1820 |
-
<option value="1" selected="selected">January</option>
|
1821 |
-
<option value="2">February</option>
|
1822 |
-
<option value="3">March</option>
|
1823 |
-
<option value="4">April</option>
|
1824 |
-
<option value="5">May</option>
|
1825 |
-
<option value="6">June</option>
|
1826 |
-
<option value="7">July</option>
|
1827 |
-
<option value="8">August</option>
|
1828 |
-
<option value="9">September</option>
|
1829 |
-
<option value="10">October</option>
|
1830 |
-
<option value="11">November</option>
|
1831 |
-
<option value="12">December</option>
|
1832 |
-
</select>
|
1833 |
-
</label>
|
1834 |
-
</div>
|
1835 |
-
<br/>
|
1836 |
-
<input type="hidden" id="daily1"/>
|
1837 |
-
<input type="hidden" id="weekly1"/>
|
1838 |
-
<input type="hidden" id="monthly1"/>
|
1839 |
-
<input type="hidden" id="yearly1"/>
|
1840 |
-
<div class="key" id="weekly" style="display:none">
|
1841 |
-
<input type="checkbox" value="Mon" id="week_1" onChange="week_value()"/>Mon
|
1842 |
-
<input type="checkbox" value="Tue" id="week_2" onChange="week_value()"/>Tue
|
1843 |
-
<input type="checkbox" value="Wed" id="week_3" onChange="week_value()"/>Wed
|
1844 |
-
<input type="checkbox" value="Thu" id="week_4" onChange="week_value()"/>Thu
|
1845 |
-
<input type="checkbox" value="Fri" id="week_5" onChange="week_value()"/>Fri
|
1846 |
-
<input type="checkbox" value="Sat" id="week_6" onChange="week_value()"/>Sat
|
1847 |
-
<input type="checkbox" value="Sun" id="week_7" onChange="week_value()"/>Sun
|
1848 |
-
<input type="hidden" name="week" id="week"/>
|
1849 |
-
</div>
|
1850 |
-
<br/>
|
1851 |
-
<div class="key" id="monthly" style="display:none">
|
1852 |
-
<input type="radio" id="radio1" onChange="radio_month()" name="month_type" value="1" checked="checked"/>on the:
|
1853 |
-
<input type="text" onKeyPress="return checknumber(month)" name="month" size="3" id="month"/><br/>
|
1854 |
-
<input type="radio" id="radio2" onChange="radio_month()" name="month_type" value="2"/>on the:
|
1855 |
-
<select name="monthly_list" id="monthly_list" class="inputbox">
|
1856 |
-
<option value="1">First</option>
|
1857 |
-
<option value="8">Second</option>
|
1858 |
-
<option value="15">Third</option>
|
1859 |
-
<option value="22">Fourth</option>
|
1860 |
-
<option value="last">Last</option>
|
1861 |
-
</select>
|
1862 |
-
<select name="month_week" id="month_week" class="inputbox">
|
1863 |
-
<option value="Mon">Monday</option>
|
1864 |
-
<option value="Tue">Tuesday</option>
|
1865 |
-
<option value="Wed">Wednesday</option>
|
1866 |
-
<option value="Thu">Thursday</option>
|
1867 |
-
<option value="Fri">Friday</option>
|
1868 |
-
<option value="Sat">Saturday</option>
|
1869 |
-
<option value="Sun">Sunday</option>
|
1870 |
-
</select>
|
1871 |
-
</div>
|
1872 |
-
<br/>
|
1873 |
-
<script>
|
1874 |
-
window.onload = radio_month();
|
1875 |
-
</script>
|
1876 |
-
</td>
|
1877 |
-
</tr>
|
1878 |
-
<tr id="repeat_until" style="display:none">
|
1879 |
-
<td>Repeat until: </td>
|
1880 |
-
<td>
|
1881 |
-
<input style="width:90px" class="inputbox" type="text" name="date_end" id="date_end" size="10" maxlength="10" value=""/>
|
1882 |
-
<input type="reset" class="wd_button" value="..." onClick="return showCalendar('date_end','%Y-%m-%d');"/>
|
1883 |
-
</td>
|
1884 |
-
</tr>
|
1885 |
-
</table>
|
1886 |
-
</fieldset>
|
1887 |
-
</div>
|
1888 |
-
</td>
|
1889 |
-
</tr>
|
1890 |
-
</table>
|
1891 |
-
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
1892 |
-
<input type="hidden" name="option" value="com_spidercalendar"/>
|
1893 |
-
<input type="hidden" name="task" value=""/>
|
1894 |
-
<input type="hidden" name="calendar" value=""/>
|
1895 |
-
</form>
|
1896 |
-
<?php
|
1897 |
-
}
|
1898 |
-
|
1899 |
-
function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
1900 |
-
global $wpdb;
|
1901 |
-
$calendar = $wpdb->get_row($wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where id=%d", $calendar_id ));
|
1902 |
-
|
1903 |
-
?>
|
1904 |
-
<style>
|
1905 |
-
.calendar .button {
|
1906 |
-
display: table-cell !important;
|
1907 |
-
}
|
1908 |
-
fieldset {
|
1909 |
-
border: 2px solid #4f9bc6; /*#CCA383 1462a5*/
|
1910 |
-
width: 100%;
|
1911 |
-
background: #fafbfd;
|
1912 |
-
padding: 13px;
|
1913 |
-
margin-top: 20px;
|
1914 |
-
-webkit-border-radius: 8px;
|
1915 |
-
-moz-border-radius: 8px;
|
1916 |
-
border-radius: 8px;
|
1917 |
-
}
|
1918 |
-
.wd_button{
|
1919 |
-
border: 1px solid #D5D5D5 !important;
|
1920 |
-
border-radius: 10px;
|
1921 |
-
width: 30px;
|
1922 |
-
height: 25px;
|
1923 |
-
}
|
1924 |
-
</style>
|
1925 |
-
<script language="javascript" type="text/javascript">
|
1926 |
-
function submitform(pressbutton) {
|
1927 |
-
if (document.getElementById('title').value == "") {
|
1928 |
-
alert('Provide the title:');
|
1929 |
-
}
|
1930 |
-
else {
|
1931 |
-
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
1932 |
-
document.getElementById('adminForm').submit();
|
1933 |
-
}
|
1934 |
-
}
|
1935 |
-
function submitbutton(pressbutton) {
|
1936 |
-
var form = document.adminForm;
|
1937 |
-
if (pressbutton == 'cancel_event') {
|
1938 |
-
submitform(pressbutton);
|
1939 |
-
return;
|
1940 |
-
}
|
1941 |
-
if (form.date.value.search(/^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/)) {
|
1942 |
-
alert('Invalid Date');
|
1943 |
-
}
|
1944 |
-
else if(form.repeat_method.value=="weekly"){
|
1945 |
-
var atLeastOneIsChecked = false;
|
1946 |
-
jQuery('input:checkbox').each(function () {
|
1947 |
-
if (jQuery(this).is(':checked')) {
|
1948 |
-
atLeastOneIsChecked = true;
|
1949 |
-
}
|
1950 |
-
});
|
1951 |
-
if(atLeastOneIsChecked) submitform(pressbutton)
|
1952 |
-
else alert('Invalid Weekday');
|
1953 |
-
}
|
1954 |
-
else if (form.selhour_from.value == "" && form.selminute_from.value == "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1955 |
-
submitform(pressbutton);
|
1956 |
-
}
|
1957 |
-
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1958 |
-
submitform(pressbutton);
|
1959 |
-
}
|
1960 |
-
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value != "" && form.selminute_to.value != "") {
|
1961 |
-
submitform(pressbutton);
|
1962 |
-
}
|
1963 |
-
else {
|
1964 |
-
alert('Invalid Time');
|
1965 |
-
}
|
1966 |
-
}
|
1967 |
-
function checkhour(id,event) {
|
1968 |
-
if (typeof(event) != 'undefined') {
|
1969 |
-
var e = event; // for trans-browser compatibility
|
1970 |
-
var charCode = e.which || e.keyCode;
|
1971 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1972 |
-
return false;
|
1973 |
-
}
|
1974 |
-
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1975 |
-
hour = parseFloat(hour);
|
1976 |
-
if (document.getSelection() != '') {
|
1977 |
-
return true;
|
1978 |
-
}
|
1979 |
-
if ((hour < 0) || (hour > 23)) {
|
1980 |
-
return false;
|
1981 |
-
}
|
1982 |
-
}
|
1983 |
-
return true;
|
1984 |
-
}
|
1985 |
-
function check12hour(id,event) {
|
1986 |
-
if (typeof(event) != 'undefined') {
|
1987 |
-
var e = event; // for trans-browser compatibility
|
1988 |
-
var charCode = e.which || e.keyCode;
|
1989 |
-
input = document.getElementById(id);
|
1990 |
-
if (charCode == 48 && input.value.length == 0) {
|
1991 |
-
return false;
|
1992 |
-
}
|
1993 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1994 |
-
return false;
|
1995 |
-
}
|
1996 |
-
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1997 |
-
hour = parseFloat(hour);
|
1998 |
-
if (document.getSelection() != '') {
|
1999 |
-
return true;
|
2000 |
-
}
|
2001 |
-
if ((hour < 0) || (hour > 12)) {
|
2002 |
-
return false;
|
2003 |
-
}
|
2004 |
-
}
|
2005 |
-
return true;
|
2006 |
-
}
|
2007 |
-
function checknumber(id,event) {
|
2008 |
-
if (typeof(event) != 'undefined') {
|
2009 |
-
var e = event; // for trans-browser compatibility
|
2010 |
-
var charCode = e.which || e.keyCode;
|
2011 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
2012 |
-
return false;
|
2013 |
-
}
|
2014 |
-
}
|
2015 |
-
return true;
|
2016 |
-
}
|
2017 |
-
function checkminute(id,event) {
|
2018 |
-
if (typeof(event) != 'undefined') {
|
2019 |
-
var e = event; // for trans-browser compatibility
|
2020 |
-
var charCode = e.which || e.keyCode;
|
2021 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
2022 |
-
return false;
|
2023 |
-
}
|
2024 |
-
minute = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
2025 |
-
minute = parseFloat(minute);
|
2026 |
-
if (document.getSelection() != '') {
|
2027 |
-
return true;
|
2028 |
-
}
|
2029 |
-
if ((minute < 0) || (minute > 59)) {
|
2030 |
-
return false;
|
2031 |
-
}
|
2032 |
-
}
|
2033 |
-
return true;
|
2034 |
-
}
|
2035 |
-
function add_0(id) {
|
2036 |
-
input = document.getElementById(id);
|
2037 |
-
if (input.value.length == 1) {
|
2038 |
-
input.value = '0' + input.value;
|
2039 |
-
input.setAttribute("value", input.value);
|
2040 |
-
}
|
2041 |
-
}
|
2042 |
-
function change_type(type) {
|
2043 |
-
if (document.getElementById('daily1').value == '') {
|
2044 |
-
document.getElementById('daily1').value = 1;
|
2045 |
-
}
|
2046 |
-
if (document.getElementById('weekly1').value == '') {
|
2047 |
-
document.getElementById('weekly1').value = 1;
|
2048 |
-
}
|
2049 |
-
if (document.getElementById('monthly1').value == '') {
|
2050 |
-
document.getElementById('monthly1').value = 1;
|
2051 |
-
}
|
2052 |
-
if (document.getElementById('yearly1').value == '') {
|
2053 |
-
document.getElementById('yearly1').value = 1;
|
2054 |
-
}
|
2055 |
-
switch (type) {
|
2056 |
-
case 'no_repeat':
|
2057 |
-
document.getElementById('daily').setAttribute('style', 'display:none');
|
2058 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
2059 |
-
document.getElementById('monthly').setAttribute('style', 'display:none');
|
2060 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
2061 |
-
document.getElementById('repeat_until').setAttribute('style', 'display:none');
|
2062 |
-
document.getElementById('month').value = '';
|
2063 |
-
document.getElementById('date_end').value = ''
|
2064 |
-
break;
|
2065 |
-
|
2066 |
-
case 'daily':
|
2067 |
-
document.getElementById('daily').removeAttribute('style');
|
2068 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
2069 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
2070 |
-
document.getElementById('monthly').setAttribute('style', 'display:none');
|
2071 |
-
document.getElementById('repeat').innerHTML = 'Day(s)';
|
2072 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
2073 |
-
return input_value('daily1')
|
2074 |
-
};
|
2075 |
-
document.getElementById('month').value = '';
|
2076 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
2077 |
-
document.getElementById('repeat_input').value = document.getElementById('daily1').value;
|
2078 |
-
break;
|
2079 |
-
|
2080 |
-
case 'weekly':
|
2081 |
-
document.getElementById('daily').removeAttribute('style');
|
2082 |
-
document.getElementById('weekly').removeAttribute('style');
|
2083 |
-
document.getElementById('monthly').setAttribute('style', 'display:none');
|
2084 |
-
document.getElementById('repeat').innerHTML = 'Week(s) on :';
|
2085 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
2086 |
-
return input_value('weekly1')
|
2087 |
-
};
|
2088 |
-
document.getElementById('month').value = '';
|
2089 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
2090 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
2091 |
-
document.getElementById('repeat_input').value = document.getElementById('weekly1').value;
|
2092 |
-
break;
|
2093 |
-
|
2094 |
-
case 'monthly':
|
2095 |
-
document.getElementById('daily').removeAttribute('style');
|
2096 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
2097 |
-
document.getElementById('monthly').removeAttribute('style');
|
2098 |
-
document.getElementById('repeat').innerHTML = 'Month(s)'
|
2099 |
-
document.getElementById('repeat_input').value = document.getElementById('monthly1').value;
|
2100 |
-
document.getElementById('month').value = '';
|
2101 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
2102 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
2103 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
2104 |
-
return input_value('monthly1')
|
2105 |
-
};
|
2106 |
-
break;
|
2107 |
-
|
2108 |
-
case 'yearly':
|
2109 |
-
document.getElementById('daily').removeAttribute('style');
|
2110 |
-
document.getElementById('year_month').removeAttribute('style');
|
2111 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
2112 |
-
document.getElementById('monthly').removeAttribute('style');
|
2113 |
-
document.getElementById('repeat').innerHTML = 'Year(s) in ';
|
2114 |
-
document.getElementById('repeat_input').value = document.getElementById('yearly1').value;
|
2115 |
-
document.getElementById('month').value = '';
|
2116 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
2117 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
2118 |
-
return input_value('yearly1')
|
2119 |
-
};
|
2120 |
-
break;
|
2121 |
-
}
|
2122 |
-
}
|
2123 |
-
function week_value() {
|
2124 |
-
var value = '';
|
2125 |
-
for (i = 1; i <= 7; i++) {
|
2126 |
-
if (document.getElementById('week_' + i).checked) {
|
2127 |
-
value = value + document.getElementById('week_' + i).value + ',';
|
2128 |
-
}
|
2129 |
-
}
|
2130 |
-
document.getElementById('week').value = value;
|
2131 |
-
}
|
2132 |
-
function radio_month() {
|
2133 |
-
if (document.getElementById('radio1').checked == true) {
|
2134 |
-
document.getElementById('monthly_list').disabled = true;
|
2135 |
-
document.getElementById('month_week').disabled = true;
|
2136 |
-
document.getElementById('month').disabled = false;
|
2137 |
-
}
|
2138 |
-
else {
|
2139 |
-
document.getElementById('month').disabled = true;
|
2140 |
-
document.getElementById('monthly_list').disabled = false;
|
2141 |
-
document.getElementById('month_week').disabled = false;
|
2142 |
-
}
|
2143 |
-
}
|
2144 |
-
function input_value(id) {
|
2145 |
-
document.getElementById(id).value = document.getElementById('repeat_input').value;
|
2146 |
-
}
|
2147 |
-
</script>
|
2148 |
-
<?php $query = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.category, " . $wpdb->prefix . "spidercalendar_event_category.title as cattitle FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id");
|
2149 |
-
|
2150 |
-
$query2 = $wpdb->get_results("SELECT title,id FROM " . $wpdb->prefix . "spidercalendar_event_category");
|
2151 |
-
?>
|
2152 |
-
<div class="sp_calendar_upgrade wd-clear" >
|
2153 |
-
<div class="wd-left">
|
2154 |
-
<div style="font-size: 14px;">
|
2155 |
-
<?php _e("This section allows you to create/edit the events of a particular calendar.","sp_calendar");?>
|
2156 |
-
<a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
|
2157 |
-
</div>
|
2158 |
-
</div>
|
2159 |
-
<div class="wd-right">
|
2160 |
-
<div class="wd-table">
|
2161 |
-
<div class="wd-cell wd-cell-valign-middle">
|
2162 |
-
<a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
|
2163 |
-
<img src="<?php echo plugins_url('images/i_support.png', __FILE__); ?>" >
|
2164 |
-
<?php _e("Support Forum", "sp_calendar"); ?>
|
2165 |
-
</a>
|
2166 |
-
</div>
|
2167 |
-
<div class="wd-cell wd-cell-valign-middle">
|
2168 |
-
<a href="https://web-dorado.com/products/wordpress-calendar.html" target="_blank">
|
2169 |
-
<?php _e("UPGRADE TO PAID VERSION", "sp_calendar"); ?>
|
2170 |
-
</a>
|
2171 |
-
</div>
|
2172 |
-
</div>
|
2173 |
-
|
2174 |
-
</div>
|
2175 |
-
</div>
|
2176 |
-
<table width="95%">
|
2177 |
-
<tbody>
|
2178 |
-
<tr>
|
2179 |
-
<td width="100%"><h2>Edit an event for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
2180 |
-
<td align="right"><input type="button" onClick="submitbutton('save_event')" value="Save" class="button-secondary action"></td>
|
2181 |
-
<td align="right"><input type="button" onClick="submitbutton('apply_event')" value="Apply" class="button-secondary action"></td>
|
2182 |
-
<td align="right"><input type="button" onClick="window.location.href='admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=show_manage_event'" value="Cancel" class="button-secondary action"></td>
|
2183 |
-
</tr>
|
2184 |
-
</tbody>
|
2185 |
-
</table>
|
2186 |
-
|
2187 |
-
<form action="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm">
|
2188 |
-
<table width="95%">
|
2189 |
-
<tr>
|
2190 |
-
<td style="width:45%">
|
2191 |
-
<div style="width:95%">
|
2192 |
-
<fieldset class="adminform">
|
2193 |
-
<legend>Event Details</legend>
|
2194 |
-
<table class="admintable">
|
2195 |
-
<tr>
|
2196 |
-
<td class="key"><label for="message">Title: </label></td>
|
2197 |
-
<td><input type="text" id="title" name="title" size="41" value="<?php echo htmlspecialchars($row->title, ENT_QUOTES); ?>"/></td>
|
2198 |
-
</tr>
|
2199 |
-
<tr>
|
2200 |
-
<td class="key"><label for="category">Select Category: </label></td>
|
2201 |
-
<td>
|
2202 |
-
<select id="category" name="category" style="width:240px">
|
2203 |
-
<option value="0" <?php if ($row->category == "0") echo 'selected="selected"'; ?>><?php if(isset($category)) echo $category->title ?>--Select Category--</option>
|
2204 |
-
<?php foreach ($query2 as $key => $category) {
|
2205 |
-
?>
|
2206 |
-
<option value="<?php echo $category->id; ?>" <?php if ( $category->id == $row->category ) echo 'selected="selected"'; ?>><?php if(isset($category)) echo $category->title ?></option>
|
2207 |
-
<?php
|
2208 |
-
}
|
2209 |
-
?>
|
2210 |
-
|
2211 |
-
</select>
|
2212 |
-
</td>
|
2213 |
-
</tr>
|
2214 |
-
|
2215 |
-
<tr>
|
2216 |
-
<td class="key"><label for="message">Date: </label></td>
|
2217 |
-
<td>
|
2218 |
-
<input class="inputbox" style="width:90px" type="text" name="date" id="date" size="10" maxlength="10" value="<?php echo $row->date; ?>"/>
|
2219 |
-
<?php
|
2220 |
-
if ($row->date_end == '0000-00-00') {
|
2221 |
-
$row->date_end = "";
|
2222 |
-
}
|
2223 |
-
?>
|
2224 |
-
<input type="reset" class="wd_button" value="..." onClick="return showCalendar('date','%Y-%m-%d');"/>
|
2225 |
-
</td>
|
2226 |
-
</tr>
|
2227 |
-
<tr>
|
2228 |
-
<td class="key"><label for="message">Time: </label></td>
|
2229 |
-
<td>
|
2230 |
-
<?php
|
2231 |
-
if (!$row->time) {
|
2232 |
-
$from[0] = "";
|
2233 |
-
$from[1] = "";
|
2234 |
-
$to[0] = "";
|
2235 |
-
$to[1] = "";
|
2236 |
-
}
|
2237 |
-
else {
|
2238 |
-
$from_to = explode("-", $row->time);
|
2239 |
-
$from = explode(":", $from_to[0]);
|
2240 |
-
if (isset($from_to[1])) {
|
2241 |
-
$to = explode(":", $from_to[1]);
|
2242 |
-
}
|
2243 |
-
else {
|
2244 |
-
$to[0] = "";
|
2245 |
-
$to[1] = "";
|
2246 |
-
}
|
2247 |
-
}
|
2248 |
-
?>
|
2249 |
-
<?php if ($calendar->time_format == 0) { ?>
|
2250 |
-
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
2251 |
-
onkeypress="return checkhour('selhour_from',event)" value="<?php echo $from[0]; ?>" title="from" /> <b>:</b>
|
2252 |
-
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
2253 |
-
onkeypress="return checkminute('selminute_from',event)" value="<?php echo substr($from[1], 0, 2); ?>"
|
2254 |
-
title="from" onBlur="add_0('selminute_from')"/> <span style="font-size:12px"> - </span>
|
2255 |
-
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
2256 |
-
onkeypress="return checkhour('selhour_to',event)" value="<?php echo $to[0]; ?>" title="to" /> <b>:</b>
|
2257 |
-
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
2258 |
-
onkeypress="return checkminute('selminute_to',event)" value="<?php echo substr($to[1], 0, 2); ?>"
|
2259 |
-
title="to" onBlur="add_0('selminute_to')"/>
|
2260 |
-
<?php }
|
2261 |
-
if ($calendar->time_format == 1) { ?>
|
2262 |
-
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
2263 |
-
onkeypress="return check12hour('selhour_from',event)" value="<?php echo $from[0]; ?>" title="from"
|
2264 |
-
/> <b>:</b>
|
2265 |
-
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
2266 |
-
onkeypress="return checkminute('selminute_from',event)" value="<?php echo substr($from[1], 0, 2); ?>"
|
2267 |
-
title="from" onBlur="add_0('selminute_from')"/>
|
2268 |
-
<select id="select_from" name="select_from">
|
2269 |
-
<option <?php if (substr($from[1], 2, 2) == "AM")
|
2270 |
-
echo 'selected="selected"'; ?>>AM
|
2271 |
-
</option>
|
2272 |
-
<option <?php if (substr($from[1], 2, 2) == "PM")
|
2273 |
-
echo 'selected="selected"'; ?>>PM
|
2274 |
-
</option>
|
2275 |
-
</select>
|
2276 |
-
<span style="font-size:12px"> - </span>
|
2277 |
-
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
2278 |
-
onkeypress="return check12hour('selhour_to',event)" value="<?php echo $to[0]; ?>" title="to"
|
2279 |
-
/> <b>:</b>
|
2280 |
-
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
2281 |
-
onkeypress="return checkminute('selminute_to',event)" value="<?php echo substr($to[1], 0, 2); ?>"
|
2282 |
-
title="to" onBlur="add_0('selminute_to')"/>
|
2283 |
-
<select id="select_to" name="select_to">
|
2284 |
-
<option <?php if (substr($to[1], 2, 2) == "AM")
|
2285 |
-
echo 'selected="selected"'; ?>>AM
|
2286 |
-
</option>
|
2287 |
-
<option <?php if (substr($to[1], 2, 2) == "PM")
|
2288 |
-
echo 'selected="selected"'; ?>>PM
|
2289 |
-
</option>
|
2290 |
-
</select>
|
2291 |
-
<?php }?>
|
2292 |
-
</td>
|
2293 |
-
</tr>
|
2294 |
-
<tr>
|
2295 |
-
<td class="key"><label for="note">Note: </label></td>
|
2296 |
-
<td>
|
2297 |
-
<div id="poststuff" style="width:100% !important; min-width: 540px;">
|
2298 |
-
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
2299 |
-
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor(stripslashes($row->description),"text_for_date","title" ); ?>
|
2300 |
-
</div>
|
2301 |
-
<?php }else{
|
2302 |
-
if(isset($row->text_for_date)) $desc1 = $row->text_for_date;
|
2303 |
-
else $desc1 = "";
|
2304 |
-
wp_editor($desc1, "text_for_date"); }?>
|
2305 |
-
</div>
|
2306 |
-
</div>
|
2307 |
-
</td>
|
2308 |
-
</tr>
|
2309 |
-
<tr>
|
2310 |
-
<td class="key"><label for="note">Published: </label></td>
|
2311 |
-
<td>
|
2312 |
-
<input type="radio" name="published" id="published0" value="0" <?php cheched($row->published, '0'); ?> class="inputbox">
|
2313 |
-
<label for="published0">No</label>
|
2314 |
-
<input type="radio" name="published" id="published1" value="1" <?php cheched($row->published, '1'); ?> class="inputbox">
|
2315 |
-
<label for="published1">Yes</label>
|
2316 |
-
</td>
|
2317 |
-
</tr>
|
2318 |
-
</table>
|
2319 |
-
</fieldset>
|
2320 |
-
</div>
|
2321 |
-
</td>
|
2322 |
-
<td style="padding-left:25px; vertical-align:top !important; width:45%">
|
2323 |
-
<div style="width:100%">
|
2324 |
-
<fieldset class="adminform" style="margin-left: -25px;">
|
2325 |
-
<legend>Repeat Event</legend>
|
2326 |
-
<table>
|
2327 |
-
<tr>
|
2328 |
-
<td valign="top">
|
2329 |
-
<input type="radio" value="no_repeat" id="no_repeat_type" name="repeat_method" <?php if ($row->repeat_method == 'no_repeat')
|
2330 |
-
echo 'checked="checked"' ?> checked="checked" onChange="change_type('no_repeat')"/>
|
2331 |
-
<label for="no_repeat_type">Don't repeat this event</label><br/>
|
2332 |
-
|
2333 |
-
<input type="radio" value="daily" id="daily_type" name="repeat_method" <?php if ($row->repeat_method == 'daily')
|
2334 |
-
echo 'checked="checked"' ?> onchange="change_type('daily')"/>
|
2335 |
-
<label for="daily_type">Repeat daily</label><br/>
|
2336 |
-
|
2337 |
-
<input type="radio" value="weekly" id="weekly_type" name="repeat_method" <?php if ($row->repeat_method == 'weekly')
|
2338 |
-
echo 'checked="checked"' ?> onChange="change_type('weekly')"/>
|
2339 |
-
<label for="weekly_type">Repeat weekly</label>
|
2340 |
-
<br/>
|
2341 |
-
<input type="radio" value="monthly" id="monthly_type" name="repeat_method" <?php if ($row->repeat_method == 'monthly')
|
2342 |
-
echo 'checked="checked"'?> onChange="change_type('monthly')"/>
|
2343 |
-
<label for="monthly_type">Repeat monthly</label>
|
2344 |
-
<br/>
|
2345 |
-
<input type="radio" value="yearly" id="yearly_type" name="repeat_method" <?php if ($row->repeat_method == 'yearly')
|
2346 |
-
echo 'checked="checked"' ?> onChange="change_type('yearly')"/>
|
2347 |
-
<label for="yearly_type">Repeat yearly</label>
|
2348 |
-
<br/>
|
2349 |
-
</td>
|
2350 |
-
<td style="padding-left:10px" valign="top">
|
2351 |
-
<div id="daily" style="display:<?php if ($row->repeat_method == 'no_repeat') echo 'none'; ?>">
|
2352 |
-
Repeat every <input type="text" id="repeat_input" size="5" name="repeat" onKeyPress="return checknumber(repeat_input)" value="<?php echo $row->repeat ?>"/>
|
2353 |
-
<label id="repeat"><?php if ($row->repeat_method == 'daily')
|
2354 |
-
echo 'Day(s)';
|
2355 |
-
if ($row->repeat_method == 'weekly')
|
2356 |
-
echo 'Week(s) on :';
|
2357 |
-
if ($row->repeat_method == 'monthly')
|
2358 |
-
echo 'Month(s)';
|
2359 |
-
if ($row->repeat_method == 'yearly')
|
2360 |
-
echo 'Year(s) in';
|
2361 |
-
?></label>
|
2362 |
-
<label id="year_month" style="display:<?php if ($row->repeat_method != 'yearly') echo 'none'; ?>">
|
2363 |
-
<select name="year_month" id="year_month" class="inputbox">
|
2364 |
-
<option value="1" <?php echo selectted($row->year_month, '1'); ?>>January</option>
|
2365 |
-
<option value="2" <?php echo selectted($row->year_month, '2'); ?>>February</option>
|
2366 |
-
<option value="3" <?php echo selectted($row->year_month, '3'); ?>>March</option>
|
2367 |
-
<option value="4" <?php echo selectted($row->year_month, '4'); ?>>April</option>
|
2368 |
-
<option value="5" <?php echo selectted($row->year_month, '5'); ?>>May</option>
|
2369 |
-
<option value="6" <?php echo selectted($row->year_month, '6'); ?>>June</option>
|
2370 |
-
<option value="7" <?php echo selectted($row->year_month, '7'); ?>>July</option>
|
2371 |
-
<option value="8" <?php echo selectted($row->year_month, '8'); ?>>August</option>
|
2372 |
-
<option value="9" <?php echo selectted($row->year_month, '9'); ?>>September</option>
|
2373 |
-
<option value="10" <?php echo selectted($row->year_month, '10'); ?>>October</option>
|
2374 |
-
<option value="11" <?php echo selectted($row->year_month, '11'); ?>>November</option>
|
2375 |
-
<option value="12" <?php echo selectted($row->year_month, '12'); ?>>December</option>
|
2376 |
-
</select></label>
|
2377 |
-
<input type="hidden" value="<?php if ($row->repeat_method == 'daily') echo $row->repeat; ?>" id="daily1"/>
|
2378 |
-
<input type="hidden" value="<?php if ($row->repeat_method == 'weekly') echo $row->repeat; ?>" id="weekly1"/>
|
2379 |
-
<input type="hidden" value="<?php if ($row->repeat_method == 'monthly') echo $row->repeat; ?>" id="monthly1"/>
|
2380 |
-
<input type="hidden" value="<?php if ($row->repeat_method == 'yearly') echo $row->repeat; ?>" id="yearly1"/>
|
2381 |
-
</div>
|
2382 |
-
<br/>
|
2383 |
-
<div class="key" id="weekly" style="display:<?php if ($row->repeat_method != 'weekly') echo 'none'; ?>">
|
2384 |
-
<input type="checkbox" value="Mon" id="week_1" onChange="week_value()" <?php if (in_array('Mon', explode(',', $row->week))) echo 'checked="checked"' ?> />Mon
|
2385 |
-
<input type="checkbox" value="Tue" id="week_2" onChange="week_value()" <?php if (in_array('Tue', explode(',', $row->week))) echo 'checked="checked"' ?> />Tue
|
2386 |
-
<input type="checkbox" value="Wed" id="week_3" onChange="week_value()" <?php if (in_array('Wed', explode(',', $row->week))) echo 'checked="checked"' ?> />Wed
|
2387 |
-
<input type="checkbox" value="Thu" id="week_4" onChange="week_value()" <?php if (in_array('Thu', explode(',', $row->week))) echo 'checked="checked"' ?> />Thu
|
2388 |
-
<input type="checkbox" value="Fri" id="week_5" onChange="week_value()" <?php if (in_array('Fri', explode(',', $row->week))) echo 'checked="checked"' ?> />Fri
|
2389 |
-
<input type="checkbox" value="Sat" id="week_6" onChange="week_value()" <?php if (in_array('Sat', explode(',', $row->week))) echo 'checked="checked"' ?> />Sat
|
2390 |
-
<input type="checkbox" value="Sun" id="week_7" onChange="week_value()" <?php if (in_array('Sun', explode(',', $row->week))) echo 'checked="checked"' ?> />Sun
|
2391 |
-
<input type="hidden" name="week" id="week" value="<?php echo $row->week ?>"/>
|
2392 |
-
</div>
|
2393 |
-
<br/>
|
2394 |
-
<div class="key" id="monthly" style="display:<?php if ($row->repeat_method != 'monthly' && $row->repeat_method != 'yearly') echo 'none'; ?>">
|
2395 |
-
<input type="radio" id="radio1" name="month_type" onChange="radio_month()" value="1" checked="checked" <?php if ($row->month_type == 1)
|
2396 |
-
echo 'checked="checked"' ?> />on the: <input type="text" name="month" size="3" onKeyPress="return checknumber(month)" id="month"
|
2397 |
-
value="<?php echo $row->month; ?>"/><br/>
|
2398 |
-
<input type="radio" id="radio2" name="month_type" onChange="radio_month()" value="2" <?php if ($row->month_type == 2) echo 'checked="checked"'; ?> />on the:
|
2399 |
-
<select name="monthly_list" id="monthly_list" class="inputbox">
|
2400 |
-
<option <?php echo selectted($row->monthly_list, '1'); ?> value="1">First</option>
|
2401 |
-
<option <?php echo selectted($row->monthly_list, '8'); ?> value="8">Second</option>
|
2402 |
-
<option <?php echo selectted($row->monthly_list, '15'); ?> value="15">Third</option>
|
2403 |
-
<option <?php echo selectted($row->monthly_list, '22'); ?> value="22">Fourth</option>
|
2404 |
-
<option <?php echo selectted($row->monthly_list, 'last'); ?> value="last">Last</option>
|
2405 |
-
</select>
|
2406 |
-
<select name="month_week" id="month_week" class="inputbox">
|
2407 |
-
<option <?php echo selectted($row->month_week, 'Mon'); ?> value="Mon">Monday</option>
|
2408 |
-
<option <?php echo selectted($row->month_week, 'Tue'); ?> value="Tue">Tuesday</option>
|
2409 |
-
<option <?php echo selectted($row->month_week, 'Wed'); ?> value="Wed">Wednesday</option>
|
2410 |
-
<option <?php echo selectted($row->month_week, 'Thu'); ?> value="Thu">Thursday</option>
|
2411 |
-
<option <?php echo selectted($row->month_week, 'Fri'); ?> value="Fri">Friday</option>
|
2412 |
-
<option <?php echo selectted($row->month_week, 'Sat'); ?> value="Sat">Saturday</option>
|
2413 |
-
<option <?php echo selectted($row->month_week, 'Sun'); ?> value="Sun">Sunday</option>
|
2414 |
-
</select>
|
2415 |
-
</div>
|
2416 |
-
<br/>
|
2417 |
-
<script>
|
2418 |
-
window.onload = radio_month();
|
2419 |
-
</script>
|
2420 |
-
</td>
|
2421 |
-
</tr>
|
2422 |
-
<tr id="repeat_until" style="display:<?php if ($row->repeat_method == 'no_repeat') echo 'none'; ?>">
|
2423 |
-
<td>Repeat until: </td>
|
2424 |
-
<?php
|
2425 |
-
if ($row->date_end == '2035-12-12') {
|
2426 |
-
$row->date_end = '';
|
2427 |
-
}
|
2428 |
-
?>
|
2429 |
-
<td>
|
2430 |
-
<input style="width:90px" class="inputbox" type="text" name="date_end" id="date_end" size="10" maxlength="10" value="<?php echo $row->date_end; ?>"/>
|
2431 |
-
<input type="reset" class="wd_button" value="..." onClick="return showCalendar('date_end','%Y-%m-%d');"/>
|
2432 |
-
</td>
|
2433 |
-
</tr>
|
2434 |
-
</table>
|
2435 |
-
</fieldset>
|
2436 |
-
</div>
|
2437 |
-
</td>
|
2438 |
-
</tr>
|
2439 |
-
</table>
|
2440 |
-
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
2441 |
-
<input type="hidden" name="option" value="com_spidercalendar"/>
|
2442 |
-
<input type="hidden" name="id" value="<?php echo $row->id; ?>"/>
|
2443 |
-
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
2444 |
-
<input type="hidden" name="task" value="event"/>
|
2445 |
-
<input type="hidden" name="calendar" value=""/>
|
2446 |
</form> <?php } ?>
|
1 |
+
<?php
|
2 |
+
if (function_exists('current_user_can')) {
|
3 |
+
if (!current_user_can('manage_options')) {
|
4 |
+
die('Access Denied');
|
5 |
+
}
|
6 |
+
}
|
7 |
+
|
8 |
+
function html_show_spider_calendar($rows, $pageNav, $sort) {
|
9 |
+
?>
|
10 |
+
<script language="javascript">
|
11 |
+
function confirmation(href, title) {
|
12 |
+
var answer = confirm("Are you sure you want to delete '" + title + "'?")
|
13 |
+
if (answer) {
|
14 |
+
document.getElementById('admin_form').action = href;
|
15 |
+
document.getElementById('admin_form').submit();
|
16 |
+
}
|
17 |
+
}
|
18 |
+
function ordering(name, as_or_desc) {
|
19 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
20 |
+
document.getElementById('order_by').value = name;
|
21 |
+
document.getElementById('admin_form').submit();
|
22 |
+
}
|
23 |
+
function submit_form_id(x) {
|
24 |
+
var val = x.options[x.selectedIndex].value;
|
25 |
+
document.getElementById("id_for_playlist").value = val;
|
26 |
+
document.getElementById("admin_form").submit();
|
27 |
+
}
|
28 |
+
function doNothing() {
|
29 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
30 |
+
if (keyCode == 13) {
|
31 |
+
if (!e) var e = window.event;
|
32 |
+
e.cancelBubble = true;
|
33 |
+
e.returnValue = false;
|
34 |
+
if (e.stopPropagation) {
|
35 |
+
e.stopPropagation();
|
36 |
+
e.preventDefault();
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
var show_one_cal = 1;
|
41 |
+
var get_cal_id = 0;
|
42 |
+
function show_calendar_inline(cal_id) {
|
43 |
+
if (show_one_cal == 1) {
|
44 |
+
show_one_cal = 0;
|
45 |
+
jQuery.ajax({
|
46 |
+
type:'POST',
|
47 |
+
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineedit') ?>',
|
48 |
+
data:{calendar_id:cal_id},
|
49 |
+
dataType:'html',
|
50 |
+
success:function (data) {
|
51 |
+
cancel_qiucik_edit(get_cal_id);
|
52 |
+
var edit_cal_tr = document.createElement("tr")
|
53 |
+
edit_cal_tr.innerHTML = data;
|
54 |
+
edit_cal_tr.setAttribute('class', 'inline-edit-row inline-edit-row-page inline-edit-page quick-edit-row quick-edit-row-page inline-edit-page alternate inline-editor')
|
55 |
+
edit_cal_tr.setAttribute('id', 'edit_calendar-' + cal_id);
|
56 |
+
|
57 |
+
document.getElementById('Calendar-' + cal_id).style.display = "none";
|
58 |
+
document.getElementById('calendar_body').appendChild(edit_cal_tr);
|
59 |
+
document.getElementById('calendar_body').insertBefore(edit_cal_tr, document.getElementById('Calendar-' + cal_id));
|
60 |
+
get_cal_id = cal_id;
|
61 |
+
show_one_cal = 1
|
62 |
+
}
|
63 |
+
});
|
64 |
+
}
|
65 |
+
}
|
66 |
+
function cancel_qiucik_edit(cal_id) {
|
67 |
+
if (document.getElementById('edit_calendar-' + cal_id)) {
|
68 |
+
var tr = document.getElementById('edit_calendar-' + cal_id);
|
69 |
+
tr.parentNode.removeChild(tr);
|
70 |
+
document.getElementById('Calendar-' + cal_id).style.display = "";
|
71 |
+
}
|
72 |
+
}
|
73 |
+
function updae_inline_sp_calendar(cal_id) {
|
74 |
+
var cal_title = document.getElementById('calendar_title').value;
|
75 |
+
var cal_12_format = getCheckedValue(document.getElementsByName('time_format'));
|
76 |
+
var def_year = document.getElementById('def_year').value;
|
77 |
+
var def_month = document.getElementById('def_month').value;
|
78 |
+
jQuery.ajax({
|
79 |
+
type:'POST',
|
80 |
+
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineupdate') ?>',
|
81 |
+
data:{
|
82 |
+
calendar_id:cal_id,
|
83 |
+
calendar_title:cal_title,
|
84 |
+
us_12_format_sp_calendar:cal_12_format,
|
85 |
+
default_year:def_year,
|
86 |
+
default_month:def_month
|
87 |
+
},
|
88 |
+
dataType:'html',
|
89 |
+
success:function (data) {
|
90 |
+
if (data) {
|
91 |
+
document.getElementById('Calendar-' + cal_id).innerHTML = data;
|
92 |
+
cancel_qiucik_edit(cal_id);
|
93 |
+
}
|
94 |
+
else {
|
95 |
+
alert('ERROR PLEAS INSTALL PLUGIN AGAIN');
|
96 |
+
cancel_qiucik_edit(cal_id);
|
97 |
+
}
|
98 |
+
}
|
99 |
+
});
|
100 |
+
}
|
101 |
+
function getCheckedValue(radioObj) {
|
102 |
+
if (!radioObj)
|
103 |
+
return "";
|
104 |
+
var radioLength = radioObj.length;
|
105 |
+
if (radioLength == undefined)
|
106 |
+
if (radioObj.checked)
|
107 |
+
return radioObj.value;
|
108 |
+
else
|
109 |
+
return "";
|
110 |
+
for (var i = 0; i < radioLength; i++) {
|
111 |
+
if (radioObj[i].checked) {
|
112 |
+
return radioObj[i].value;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
return "";
|
116 |
+
}
|
117 |
+
</script>
|
118 |
+
<?php
|
119 |
+
global $wpdb;
|
120 |
+
$calendarwd = $wpdb->get_results("SHOW COLUMNS FROM ".$wpdb->prefix."spidercalendar_calendar");
|
121 |
+
$def_zone_wd = 0;
|
122 |
+
for($i=0;$i<count($calendarwd);$i++){
|
123 |
+
if($calendarwd[$i]->Field=="def_zone"){
|
124 |
+
$def_zone_wd = 1;
|
125 |
+
break;
|
126 |
+
}
|
127 |
+
}
|
128 |
+
if($def_zone_wd == 0) {
|
129 |
+
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "spidercalendar_calendar ADD def_zone varchar(255) DEFAULT 'Asia/Muscat'");
|
130 |
+
} ?>
|
131 |
+
<?php upgrade_pro_sp(); ?>
|
132 |
+
<form method="post" onKeyPress="doNothing()" action="admin.php?page=SpiderCalendar" id="admin_form" name="admin_form">
|
133 |
+
<?php $sp_cal_nonce = wp_create_nonce('nonce_sp_cal'); ?>
|
134 |
+
<table cellspacing="10" width="100%" id="calendar_table">
|
135 |
+
<tr>
|
136 |
+
<td><h2>Calendar Manager</h2></td>
|
137 |
+
<td style="text-align: right;">
|
138 |
+
<p class="submit" style="padding:0px; text-align: right;">
|
139 |
+
<input type="button" value="Add a Calendar" name="custom_parametrs" onClick="window.location.href='admin.php?page=SpiderCalendar&task=add_calendar'"/>
|
140 |
+
</p>
|
141 |
+
</td>
|
142 |
+
</tr>
|
143 |
+
</table>
|
144 |
+
<?php
|
145 |
+
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
146 |
+
$serch_value = esc_js(esc_html(stripslashes($_POST['search_events_by_title'])));
|
147 |
+
}
|
148 |
+
else {
|
149 |
+
$serch_value = "";
|
150 |
+
}
|
151 |
+
$serch_fields = '
|
152 |
+
<div class="alignleft actions">
|
153 |
+
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
154 |
+
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()">
|
155 |
+
</div>
|
156 |
+
<div class="alignleft actions">
|
157 |
+
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
158 |
+
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
159 |
+
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=SpiderCalendar\'" class="button-secondary action">
|
160 |
+
</div>';
|
161 |
+
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
162 |
+
?>
|
163 |
+
<table class="wp-list-table widefat fixed pages" style="width:99%">
|
164 |
+
<thead>
|
165 |
+
<TR>
|
166 |
+
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
167 |
+
<a href="javascript:ordering('id',<?php echo(($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
168 |
+
<span>ID</span>
|
169 |
+
<span class="sorting-indicator"></span>
|
170 |
+
</a>
|
171 |
+
</th>
|
172 |
+
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
173 |
+
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
174 |
+
<span>Title</span>
|
175 |
+
<span class="sorting-indicator"></span>
|
176 |
+
</a>
|
177 |
+
</th>
|
178 |
+
<th style="width:100px">Manage Events</th>
|
179 |
+
<th style="width:100px">Edit</th>
|
180 |
+
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
181 |
+
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
182 |
+
<span>Published</span>
|
183 |
+
<span class="sorting-indicator"></span>
|
184 |
+
</a>
|
185 |
+
</th>
|
186 |
+
</TR>
|
187 |
+
</thead>
|
188 |
+
<tbody id="calendar_body">
|
189 |
+
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
190 |
+
<tr id="Calendar-<?php echo $rows[$i]->id; ?>" class=" hentry alternate iedit author-self" style="display:table-row;">
|
191 |
+
<td><?php echo $rows[$i]->id; ?></td>
|
192 |
+
<td class="post-title page-title column-title">
|
193 |
+
<a title="Manage Events" class="row-title" href="admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=<?php echo $rows[$i]->id; ?>"><?php echo $rows[$i]->title; ?></a>
|
194 |
+
<div class="row-actions">
|
195 |
+
|
196 |
+
<span class="inline hide-if-no-js">
|
197 |
+
<a href="#" class="editinline" onClick="show_calendar_inline(<?php echo $rows[$i]->id; ?>)" title="Edit This Calendar Inline">Quick Edit</a> | </span>
|
198 |
+
<span class="trash">
|
199 |
+
<a class="submitdelete" title="Delete This Calendar" href="javascript:confirmation('admin.php?page=SpiderCalendar&task=remove_calendar&id=<?php echo $rows[$i]->id; ?>','<?php echo $rows[$i]->title; ?>')">Delete</a></span>
|
200 |
+
</div>
|
201 |
+
</td>
|
202 |
+
<td><a href="admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=<?php echo $rows[$i]->id; ?>">Manage events</a></td>
|
203 |
+
<td><a href="admin.php?page=SpiderCalendar&task=edit_calendar&id=<?php echo $rows[$i]->id; ?>" title="Edit This Calendar">Edit</a></td>
|
204 |
+
<td><a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?>
|
205 |
+
href="admin.php?page=SpiderCalendar&task=published&id=<?php echo $rows[$i]->id; ?>&_wpnonce=<?php echo $sp_cal_nonce; ?>"><?php if ($rows[$i]->published) echo 'Yes'; else echo 'No'; ?></a>
|
206 |
+
</td>
|
207 |
+
</tr>
|
208 |
+
<?php } ?>
|
209 |
+
</tbody>
|
210 |
+
</table>
|
211 |
+
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
212 |
+
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo esc_js(esc_html(stripslashes($_POST['id_for_playlist'])));?>"/>
|
213 |
+
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo esc_js(esc_html(stripslashes($_POST['asc_or_desc'])));?>"/>
|
214 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo esc_js(esc_html(stripslashes($_POST['order_by'])));?>"/>
|
215 |
+
<?php
|
216 |
+
?>
|
217 |
+
</form>
|
218 |
+
<?php
|
219 |
+
}
|
220 |
+
|
221 |
+
function html_add_spider_calendar() {
|
222 |
+
?>
|
223 |
+
<script language="javascript" type="text/javascript">
|
224 |
+
function submitbutton(pressbutton) {
|
225 |
+
var form = document.adminForm;
|
226 |
+
if (pressbutton == 'cancel_calendar') {
|
227 |
+
submitform(pressbutton);
|
228 |
+
return;
|
229 |
+
}
|
230 |
+
submitform(pressbutton);
|
231 |
+
}
|
232 |
+
function submitform(pressbutton) {
|
233 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
234 |
+
if (document.getElementById('title').value == "") {
|
235 |
+
alert('Provide calendar title:');
|
236 |
+
}
|
237 |
+
else {
|
238 |
+
document.getElementById('adminForm').submit();
|
239 |
+
}
|
240 |
+
}
|
241 |
+
function doNothing() {
|
242 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
243 |
+
if (keyCode == 13) {
|
244 |
+
if (!e) {
|
245 |
+
var e = window.event;
|
246 |
+
}
|
247 |
+
e.cancelBubble = true;
|
248 |
+
e.returnValue = false;
|
249 |
+
if (e.stopPropagation) {
|
250 |
+
e.stopPropagation();
|
251 |
+
e.preventDefault();
|
252 |
+
}
|
253 |
+
}
|
254 |
+
}
|
255 |
+
</script>
|
256 |
+
<style>
|
257 |
+
.calendar .button {
|
258 |
+
display: table-cell !important;
|
259 |
+
}
|
260 |
+
.wd_button{
|
261 |
+
border: 1px solid #D5D5D5 !important;
|
262 |
+
border-radius: 10px;
|
263 |
+
width: 30px;
|
264 |
+
height: 25px;
|
265 |
+
}
|
266 |
+
</style>
|
267 |
+
<?php upgrade_pro_sp(); ?>
|
268 |
+
<table width="95%">
|
269 |
+
<tr>
|
270 |
+
<td width="100%"><h2>Add Calendar</h2></td>
|
271 |
+
<td align="right"><input type="button" onClick="submitbutton('Save')" value="Save" class="button-secondary action"></td>
|
272 |
+
<td align="right"><input type="button" onClick="submitbutton('Apply')" value="Apply" class="button-secondary action"></td>
|
273 |
+
<td align="right"><input type="button" onClick="window.location.href='admin.php?page=SpiderCalendar'" value="Cancel" class="button-secondary action"></td>
|
274 |
+
</tr>
|
275 |
+
</table>
|
276 |
+
|
277 |
+
<form onKeyPress="doNothing()" action="admin.php?page=SpiderCalendar" method="post" name="adminForm" id="adminForm">
|
278 |
+
<table class="form-table" style="width: 525px;">
|
279 |
+
<tr>
|
280 |
+
<td class="key"><label for="name">Title: </label></td>
|
281 |
+
<td><input type="text" name="title" id="title" size="30" value=""/></td>
|
282 |
+
</tr>
|
283 |
+
<tr>
|
284 |
+
<td class="key"><label for="def_year">Default Year: </label></td>
|
285 |
+
<td><input type="text" name="def_year" id="def_year" size="30" value=""/></td>
|
286 |
+
</tr>
|
287 |
+
<tr>
|
288 |
+
<td class="key"><label for="def_month">Default Month: </label></td>
|
289 |
+
<td>
|
290 |
+
<select id="def_month" name="def_month">
|
291 |
+
<option selected="selected" value="">Current</option>
|
292 |
+
<?php
|
293 |
+
$month_array = array(
|
294 |
+
'01' => 'January',
|
295 |
+
'02' => 'February',
|
296 |
+
'03' => 'March',
|
297 |
+
'04' => 'April',
|
298 |
+
'05' => 'May',
|
299 |
+
'06' => 'June',
|
300 |
+
'07' => 'July',
|
301 |
+
'08' => 'August',
|
302 |
+
'09' => 'September',
|
303 |
+
'10' => 'October',
|
304 |
+
'11' => 'November',
|
305 |
+
'12' => 'December',
|
306 |
+
);
|
307 |
+
foreach ($month_array as $key => $def_month) {
|
308 |
+
?>
|
309 |
+
<option value="<?php echo $key;?>"><?php echo $def_month;?></option>
|
310 |
+
<?php
|
311 |
+
}
|
312 |
+
?>
|
313 |
+
</select>
|
314 |
+
</td>
|
315 |
+
</tr>
|
316 |
+
<tr>
|
317 |
+
<td class="key"><label for="name">Set the default timezone: </label></td>
|
318 |
+
<td>
|
319 |
+
<select id="def_zone" name="def_zone">
|
320 |
+
<option selected="selected" value="Asia/Muscat">Current</option>
|
321 |
+
<?php
|
322 |
+
$zonelist = array(
|
323 |
+
'Kwajalein' => '-12.00',
|
324 |
+
'Pacific/Midway' => '-11.00',
|
325 |
+
'Pacific/Honolulu' => '-10.00',
|
326 |
+
'America/Anchorage' => '-9.00',
|
327 |
+
'America/Los_Angeles' => '-8.00',
|
328 |
+
'America/Denver' => '-7.00',
|
329 |
+
'America/Tegucigalpa' => '-6.00',
|
330 |
+
'America/New_York' => '-5.00',
|
331 |
+
'America/Caracas' => '-4.30',
|
332 |
+
'America/Halifax' => '-4.00',
|
333 |
+
'America/St_Johns' => '-3.30',
|
334 |
+
'America/Argentina/Buenos_Aires' => '-3.00',
|
335 |
+
'America/Sao_Paulo' => '-3.00',
|
336 |
+
'Atlantic/South_Georgia' => '-2.00',
|
337 |
+
'Atlantic/Azores' => '-1.00',
|
338 |
+
'Europe/Dublin' => '0',
|
339 |
+
'Europe/Belgrade' => '+1.00',
|
340 |
+
'Europe/Minsk' => '+2.00',
|
341 |
+
'Asia/Kuwait' => '+3.00',
|
342 |
+
'Asia/Tehran' => '+3.30',
|
343 |
+
'Asia/Muscat' => '+4.00',
|
344 |
+
'Asia/Yekaterinburg' => '+5.00',
|
345 |
+
'Asia/Kolkata' => '+5.30',
|
346 |
+
'Asia/Katmandu' => '+5.45',
|
347 |
+
'Asia/Dhaka' => '+6.00',
|
348 |
+
'Asia/Rangoon' => '+6.30',
|
349 |
+
'Asia/Krasnoyarsk' => '+7.00',
|
350 |
+
'Asia/Brunei' => '+8.00',
|
351 |
+
'Asia/Seoul' => '+9.00',
|
352 |
+
'Australia/Darwin' => '+9.30',
|
353 |
+
'Australia/Canberra' => '+10.00',
|
354 |
+
'Asia/Magadan' => '+11.00',
|
355 |
+
'Pacific/Fiji' => '+12.00',
|
356 |
+
'Pacific/Tongatapu' => '+13.00');
|
357 |
+
|
358 |
+
foreach ($zonelist as $key => $def_zone) {
|
359 |
+
?>
|
360 |
+
<option value="<?php echo $key; ?>"><?php echo $key; ?> UTC<?php echo $def_zone; ?></option>
|
361 |
+
<?php
|
362 |
+
}
|
363 |
+
?>
|
364 |
+
</select>
|
365 |
+
</td>
|
366 |
+
</tr>
|
367 |
+
<tr>
|
368 |
+
<td class="key"><label for="name">Use 12-hour time format: </label></td>
|
369 |
+
<td>
|
370 |
+
<input type="radio" name="time_format" id="time_format0" value="0" checked="checked" class="inputbox">
|
371 |
+
<label for="time_format0">No</label>
|
372 |
+
<input type="radio" name="time_format" id="time_format1" value="1" class="inputbox">
|
373 |
+
<label for="time_format1">Yes</label>
|
374 |
+
</td>
|
375 |
+
</tr>
|
376 |
+
<tr>
|
377 |
+
<td class="key"><label for="published">Published: </label></td>
|
378 |
+
<td>
|
379 |
+
<input type="radio" name="published" id="published0" value="0" class="inputbox">
|
380 |
+
<label for="published0">No</label>
|
381 |
+
<input type="radio" name="published" id="published1" value="1" checked="checked" class="inputbox">
|
382 |
+
<label for="published1">Yes</label>
|
383 |
+
</td>
|
384 |
+
</tr>
|
385 |
+
</table>
|
386 |
+
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
387 |
+
<input type="hidden" name="option" value="com_spidercalendar"/>
|
388 |
+
<input type="hidden" name="id" value=""/>
|
389 |
+
<input type="hidden" name="cid[]" value=""/>
|
390 |
+
<input type="hidden" name="task" value=""/>
|
391 |
+
</form>
|
392 |
+
<?php
|
393 |
+
}
|
394 |
+
|
395 |
+
function html_edit_spider_calendar($row) {
|
396 |
+
?>
|
397 |
+
<script language="javascript" type="text/javascript">
|
398 |
+
function submitbutton(pressbutton) {
|
399 |
+
var form = document.adminForm;
|
400 |
+
if (pressbutton == 'cancel_calendar') {
|
401 |
+
submitform(pressbutton);
|
402 |
+
return;
|
403 |
+
}
|
404 |
+
submitform(pressbutton);
|
405 |
+
}
|
406 |
+
function submitform(pressbutton) {
|
407 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
408 |
+
if (document.getElementById('title').value == "") {
|
409 |
+
alert('Provide calendar title:');
|
410 |
+
}
|
411 |
+
else {
|
412 |
+
document.getElementById('adminForm').submit();
|
413 |
+
}
|
414 |
+
}
|
415 |
+
function doNothing() {
|
416 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
417 |
+
if (keyCode == 13) {
|
418 |
+
if (!e) {
|
419 |
+
var e = window.event;
|
420 |
+
}
|
421 |
+
e.cancelBubble = true;
|
422 |
+
e.returnValue = false;
|
423 |
+
if (e.stopPropagation) {
|
424 |
+
e.stopPropagation();
|
425 |
+
e.preventDefault();
|
426 |
+
}
|
427 |
+
}
|
428 |
+
}
|
429 |
+
</script>
|
430 |
+
<style>
|
431 |
+
.calendar .button {
|
432 |
+
display: table-cell !important;
|
433 |
+
}
|
434 |
+
.wd_button{
|
435 |
+
border: 1px solid #D5D5D5 !important;
|
436 |
+
border-radius: 10px;
|
437 |
+
width: 30px;
|
438 |
+
height: 25px;
|
439 |
+
}
|
440 |
+
</style>
|
441 |
+
<?php upgrade_pro_sp(); ?>
|
442 |
+
<table width="95%">
|
443 |
+
<tr>
|
444 |
+
<td width="100%"><h2>Calendar - <?php echo $row->title; ?></h2></td>
|
445 |
+
<td align="right"><input type="button" onClick="submitbutton('Save')" value="Save" class="button-secondary action"></td>
|
446 |
+
<td align="right"><input type="button" onClick="submitbutton('Apply')" value="Apply" class="button-secondary action"></td>
|
447 |
+
<td align="right"><input type="button" onClick="window.location.href='admin.php?page=SpiderCalendar'" value="Cancel" class="button-secondary action"></td>
|
448 |
+
</tr>
|
449 |
+
</table>
|
450 |
+
|
451 |
+
<form onKeyPress="doNothing()" action="admin.php?page=SpiderCalendar&id=<?php echo $row->id; ?>" method="post" name="adminForm" id="adminForm">
|
452 |
+
<table class="form-table" style="width: 525px;">
|
453 |
+
<tr>
|
454 |
+
<td class="key"><label for="name">Title: </label></td>
|
455 |
+
<td><input type="text" name="title" id="title" size="30" value="<?php echo $row->title; ?>"/></td>
|
456 |
+
</tr>
|
457 |
+
<tr>
|
458 |
+
<td class="key"><label for="name">Default Year: </label></td>
|
459 |
+
<td><input type="text" name="def_year" id="def_year" size="30" value="<?php echo $row->def_year; ?>"/></td>
|
460 |
+
</tr>
|
461 |
+
<tr>
|
462 |
+
<td class="key"><label for="name">Default Month: </label></td>
|
463 |
+
<td>
|
464 |
+
<select id="def_month" name="def_month">
|
465 |
+
<?php
|
466 |
+
$month_array = array(
|
467 |
+
'' => 'Current',
|
468 |
+
'01' => 'January',
|
469 |
+
'02' => 'February',
|
470 |
+
'03' => 'March',
|
471 |
+
'04' => 'April',
|
472 |
+
'05' => 'May',
|
473 |
+
'06' => 'June',
|
474 |
+
'07' => 'July',
|
475 |
+
'08' => 'August',
|
476 |
+
'09' => 'September',
|
477 |
+
'10' => 'October',
|
478 |
+
'11' => 'November',
|
479 |
+
'12' => 'December',
|
480 |
+
);
|
481 |
+
foreach ($month_array as $key => $def_month) {
|
482 |
+
?>
|
483 |
+
<option <?php echo (($row->def_month == $key) ? 'selected="selected"' : ''); ?> value="<?php echo $key; ?>"><?php echo $def_month; ?></option>
|
484 |
+
<?php
|
485 |
+
}
|
486 |
+
?>
|
487 |
+
</select>
|
488 |
+
</td>
|
489 |
+
</tr>
|
490 |
+
<tr>
|
491 |
+
<td class="key"><label for="name">Set the default timezone: </label></td>
|
492 |
+
<td>
|
493 |
+
<select id="def_zone" name="def_zone">
|
494 |
+
<option selected="selected" value="Asia/Muscat">Current</option>
|
495 |
+
<?php
|
496 |
+
$zonelist = array(
|
497 |
+
'Kwajalein' => '-12.00',
|
498 |
+
'Pacific/Midway' => '-11.00',
|
499 |
+
'Pacific/Honolulu' => '-10.00',
|
500 |
+
'America/Anchorage' => '-9.00',
|
501 |
+
'America/Los_Angeles' => '-8.00',
|
502 |
+
'America/Denver' => '-7.00',
|
503 |
+
'America/Tegucigalpa' => '-6.00',
|
504 |
+
'America/New_York' => '-5.00',
|
505 |
+
'America/Caracas' => '-4.30',
|
506 |
+
'America/Halifax' => '-4.00',
|
507 |
+
'America/St_Johns' => '-3.30',
|
508 |
+
'America/Argentina/Buenos_Aires' => '-3.00',
|
509 |
+
'America/Sao_Paulo' => '-3.00',
|
510 |
+
'Atlantic/South_Georgia' => '-2.00',
|
511 |
+
'Atlantic/Azores' => '-1.00',
|
512 |
+
'Europe/Dublin' => '0',
|
513 |
+
'Europe/Belgrade' => '+1.00',
|
514 |
+
'Europe/Minsk' => '+2.00',
|
515 |
+
'Asia/Kuwait' => '+3.00',
|
516 |
+
'Asia/Tehran' => '+3.30',
|
517 |
+
'Asia/Muscat' => '+4.00',
|
518 |
+
'Asia/Yekaterinburg' => '+5.00',
|
519 |
+
'Asia/Kolkata' => '+5.30',
|
520 |
+
'Asia/Katmandu' => '+5.45',
|
521 |
+
'Asia/Dhaka' => '+6.00',
|
522 |
+
'Asia/Rangoon' => '+6.30',
|
523 |
+
'Asia/Krasnoyarsk' => '+7.00',
|
524 |
+
'Asia/Brunei' => '+8.00',
|
525 |
+
'Asia/Seoul' => '+9.00',
|
526 |
+
'Australia/Darwin' => '+9.30',
|
527 |
+
'Australia/Canberra' => '+10.00',
|
528 |
+
'Asia/Magadan' => '+11.00',
|
529 |
+
'Pacific/Fiji' => '+12.00',
|
530 |
+
'Pacific/Tongatapu' => '+13.00');
|
531 |
+
|
532 |
+
foreach ($zonelist as $key => $def_zone) {
|
533 |
+
?>
|
534 |
+
<option <?php echo (($row->def_zone == $key) ? 'selected="selected"' : ''); ?> value="<?php echo $key; ?>"><?php echo $key; ?> UTC<?php echo $def_zone; ?></option>
|
535 |
+
<?php
|
536 |
+
}
|
537 |
+
?>
|
538 |
+
</select>
|
539 |
+
</td>
|
540 |
+
</tr>
|
541 |
+
<tr>
|
542 |
+
<td class="key"><label for="name">Use 12 hours time format: </label></td>
|
543 |
+
<td>
|
544 |
+
<input type="radio" name="time_format" id="time_format0" value="0" <?php cheched($row->time_format, '0'); ?> class="inputbox">
|
545 |
+
<label for="time_format0">No</label>
|
546 |
+
<input type="radio" name="time_format" id="time_format1" value="1" <?php cheched($row->time_format, '1'); ?> class="inputbox">
|
547 |
+
<label for="time_format1">Yes</label>
|
548 |
+
</td>
|
549 |
+
</tr>
|
550 |
+
<tr>
|
551 |
+
<td class="key"><label for="published">Published:</label></td>
|
552 |
+
<td>
|
553 |
+
<input type="radio" name="published" id="published0" value="0" <?php cheched($row->published, '0'); ?> class="inputbox">
|
554 |
+
<label for="published0">No</label>
|
555 |
+
<input type="radio" name="published" id="published1" value="1" <?php cheched($row->published, '1'); ?> class="inputbox">
|
556 |
+
<label for="published1">Yes</label>
|
557 |
+
</td>
|
558 |
+
</tr>
|
559 |
+
</table>
|
560 |
+
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
561 |
+
<input type="hidden" name="option" value="com_spidercalendar"/>
|
562 |
+
<input type="hidden" name="id" value="<?php echo $row->id; ?>"/>
|
563 |
+
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
564 |
+
<input type="hidden" name="task" value=""/>
|
565 |
+
</form>
|
566 |
+
<?php
|
567 |
+
}
|
568 |
+
|
569 |
+
function cheched($row, $y) {
|
570 |
+
if ($row == $y) {
|
571 |
+
echo 'checked="checked"';
|
572 |
+
}
|
573 |
+
}
|
574 |
+
|
575 |
+
function selectted($row, $y) {
|
576 |
+
if ($row == $y) {
|
577 |
+
echo 'selected="selected"';
|
578 |
+
}
|
579 |
+
}
|
580 |
+
|
581 |
+
function show_event_category($rows, $pageNav, $sort){
|
582 |
+
global $wpdb;
|
583 |
+
?>
|
584 |
+
<script language="javascript">
|
585 |
+
function confirmation(href, title) {
|
586 |
+
var answer = confirm("Are you sure you want to delete '" + title + "'?")
|
587 |
+
if (answer) {
|
588 |
+
document.getElementById('admin_form').action = href;
|
589 |
+
document.getElementById('admin_form').submit();
|
590 |
+
}
|
591 |
+
}
|
592 |
+
function ordering(name, as_or_desc) {
|
593 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
594 |
+
document.getElementById('order_by').value = name;
|
595 |
+
document.getElementById('admin_form').submit();
|
596 |
+
}
|
597 |
+
function submit_form_id(x) {
|
598 |
+
var val = x.options[x.selectedIndex].value;
|
599 |
+
document.getElementById("id_for_playlist").value = val;
|
600 |
+
document.getElementById("admin_form").submit();
|
601 |
+
}
|
602 |
+
function doNothing() {
|
603 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
604 |
+
if (keyCode == 13) {
|
605 |
+
if (!e) var e = window.event;
|
606 |
+
e.cancelBubble = true;
|
607 |
+
e.returnValue = false;
|
608 |
+
if (e.stopPropagation) {
|
609 |
+
e.stopPropagation();
|
610 |
+
e.preventDefault();
|
611 |
+
}
|
612 |
+
}
|
613 |
+
}
|
614 |
+
var show_one_cal = 1;
|
615 |
+
var get_cal_id = 0;
|
616 |
+
function show_calendar_inline(cal_id) {
|
617 |
+
if (show_one_cal == 1) {
|
618 |
+
show_one_cal = 0;
|
619 |
+
jQuery.ajax({
|
620 |
+
type:'POST',
|
621 |
+
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineedit') ?>',
|
622 |
+
data:{calendar_id:cal_id},
|
623 |
+
dataType:'html',
|
624 |
+
success:function (data) {
|
625 |
+
cancel_qiucik_edit(get_cal_id);
|
626 |
+
var edit_cal_tr = document.createElement("tr")
|
627 |
+
edit_cal_tr.innerHTML = data;
|
628 |
+
edit_cal_tr.setAttribute('class', 'inline-edit-row inline-edit-row-page inline-edit-page quick-edit-row quick-edit-row-page inline-edit-page alternate inline-editor')
|
629 |
+
edit_cal_tr.setAttribute('id', 'edit_calendar-' + cal_id);
|
630 |
+
|
631 |
+
document.getElementById('Calendar-' + cal_id).style.display = "none";
|
632 |
+
document.getElementById('calendar_body').appendChild(edit_cal_tr);
|
633 |
+
document.getElementById('calendar_body').insertBefore(edit_cal_tr, document.getElementById('Calendar-' + cal_id));
|
634 |
+
get_cal_id = cal_id;
|
635 |
+
show_one_cal = 1
|
636 |
+
}
|
637 |
+
});
|
638 |
+
}
|
639 |
+
}
|
640 |
+
function cancel_qiucik_edit(cal_id) {
|
641 |
+
if (document.getElementById('edit_calendar-' + cal_id)) {
|
642 |
+
var tr = document.getElementById('edit_calendar-' + cal_id);
|
643 |
+
tr.parentNode.removeChild(tr);
|
644 |
+
document.getElementById('Calendar-' + cal_id).style.display = "";
|
645 |
+
}
|
646 |
+
}
|
647 |
+
function updae_inline_sp_calendar(cal_id) {
|
648 |
+
var cal_title = document.getElementById('calendar_title').value;
|
649 |
+
var cal_12_format = getCheckedValue(document.getElementsByName('time_format'));
|
650 |
+
var def_year = document.getElementById('def_year').value;
|
651 |
+
var def_month = document.getElementById('def_month').value;
|
652 |
+
jQuery.ajax({
|
653 |
+
type:'POST',
|
654 |
+
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineupdate') ?>',
|
655 |
+
data:{
|
656 |
+
calendar_id:cal_id,
|
657 |
+
calendar_title:cal_title,
|
658 |
+
us_12_format_sp_calendar:cal_12_format,
|
659 |
+
default_year:def_year,
|
660 |
+
default_month:def_month
|
661 |
+
},
|
662 |
+
dataType:'html',
|
663 |
+
success:function (data) {
|
664 |
+
if (data) {
|
665 |
+
document.getElementById('Calendar-' + cal_id).innerHTML = data;
|
666 |
+
cancel_qiucik_edit(cal_id);
|
667 |
+
}
|
668 |
+
else {
|
669 |
+
alert('ERROR PLEAS INSTALL PLUGIN AGAIN');
|
670 |
+
cancel_qiucik_edit(cal_id);
|
671 |
+
}
|
672 |
+
}
|
673 |
+
});
|
674 |
+
}
|
675 |
+
function getCheckedValue(radioObj) {
|
676 |
+
if (!radioObj)
|
677 |
+
return "";
|
678 |
+
var radioLength = radioObj.length;
|
679 |
+
if (radioLength == undefined)
|
680 |
+
if (radioObj.checked)
|
681 |
+
return radioObj.value;
|
682 |
+
else
|
683 |
+
return "";
|
684 |
+
for (var i = 0; i < radioLength; i++) {
|
685 |
+
if (radioObj[i].checked) {
|
686 |
+
return radioObj[i].value;
|
687 |
+
}
|
688 |
+
}
|
689 |
+
return "";
|
690 |
+
}
|
691 |
+
</script>
|
692 |
+
<?php upgrade_pro_sp(); ?>
|
693 |
+
<form method="post" onKeyPress="doNothing()" action="admin.php?page=spider_calendar_event_category" id="admin_form" name="admin_form">
|
694 |
+
<?php $sp_cal_nonce = wp_create_nonce('nonce_sp_cal'); ?>
|
695 |
+
<table cellspacing="10" width="100%" id="category_table">
|
696 |
+
<tr>
|
697 |
+
<td><h2>Event Category</h2></td>
|
698 |
+
<td style="text-align:right;">
|
699 |
+
<p class="submit" style="padding:0px; text-align:left">
|
700 |
+
<input type="button" value="Add a Category" name="custom_parametrs" onClick="window.location.href='admin.php?page=spider_calendar_event_category&task=add_category'" class="wd-right"/>
|
701 |
+
</p>
|
702 |
+
</td>
|
703 |
+
</tr>
|
704 |
+
</table>
|
705 |
+
<?php
|
706 |
+
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
707 |
+
$serch_value = esc_js(esc_html(stripslashes($_POST['search_cat_by_title'])));
|
708 |
+
}
|
709 |
+
else {
|
710 |
+
$serch_value = "";
|
711 |
+
}
|
712 |
+
$serch_fields = '
|
713 |
+
<div class="alignleft actions" >
|
714 |
+
<label for="search_cat_by_title" style="font-size:14px">Title: </label>
|
715 |
+
<input type="text" name="search_cat_by_title" value="' . $serch_value . '" id="search_cat_by_title" onchange="clear_serch_texts()">
|
716 |
+
</div>
|
717 |
+
<div class="alignleft actions">
|
718 |
+
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
719 |
+
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
720 |
+
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=spider_calendar_event_category\'" class="button-secondary action">
|
721 |
+
</div>';
|
722 |
+
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
723 |
+
?>
|
724 |
+
<table class="wp-list-table widefat fixed pages" style="width:99%">
|
725 |
+
<thead>
|
726 |
+
<TR>
|
727 |
+
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
728 |
+
<a href="javascript:ordering('id',<?php echo(($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
729 |
+
<span>ID</span>
|
730 |
+
<span class="sorting-indicator"></span>
|
731 |
+
</a>
|
732 |
+
</th>
|
733 |
+
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
734 |
+
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
735 |
+
<span>Title</span>
|
736 |
+
<span class="sorting-indicator"></span>
|
737 |
+
</a>
|
738 |
+
</th>
|
739 |
+
<th scope="col" id="description" class="<?php echo (($sort["sortid_by"] == "description") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
740 |
+
<a href="javascript:ordering('description',<?php echo (($sort["sortid_by"] == "description") ? $sort["1_or_2"] : "1"); ?>)">
|
741 |
+
<span>Description</span>
|
742 |
+
<span class="sorting-indicator"></span>
|
743 |
+
</a>
|
744 |
+
</th>
|
745 |
+
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
746 |
+
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
747 |
+
<span>Published</span>
|
748 |
+
<span class="sorting-indicator"></span>
|
749 |
+
</a>
|
750 |
+
</th>
|
751 |
+
</TR>
|
752 |
+
</thead>
|
753 |
+
<tbody id="category_body">
|
754 |
+
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
755 |
+
<tr id="Calendar-<?php echo $rows[$i]->id; ?>" class=" hentry alternate iedit author-self" style="display:table-row;">
|
756 |
+
<td><?php echo $rows[$i]->id; ?></td>
|
757 |
+
<td class="post-title page-title column-title">
|
758 |
+
<?php echo $rows[$i]->title; ?></a>
|
759 |
+
|
760 |
+
<div class="row-actions">
|
761 |
+
<span class="edit">
|
762 |
+
<a href="admin.php?page=spider_calendar_event_category&task=edit_event_category&id=<?php echo $rows[$i]->id; ?>" title="Edit This Calendar">Edit</a> | </span>
|
763 |
+
<span class="trash">
|
764 |
+
<a class="submitdelete" title="Delete This Calendar" href="javascript:confirmation('admin.php?page=spider_calendar_event_category&task=remove_event_category&id=<?php echo $rows[$i]->id; ?>','<?php echo $rows[$i]->title; ?>')">Delete</a></span>
|
765 |
+
</div>
|
766 |
+
</td>
|
767 |
+
<td><?php echo $rows[$i]->description; ?></td>
|
768 |
+
<td><a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?> href="admin.php?page=spider_calendar_event_category&task=published&id=<?php echo $rows[$i]->id; ?>&_wpnonce=<?php echo $sp_cal_nonce; ?>"><?php if ($rows[$i]->published) echo 'Yes'; else echo 'No'; ?></a>
|
769 |
+
</td>
|
770 |
+
</tr>
|
771 |
+
<?php } ?>
|
772 |
+
</tbody>
|
773 |
+
</table>
|
774 |
+
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
775 |
+
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo esc_js(esc_html(stripslashes($_POST['id_for_playlist'])));?>"/>
|
776 |
+
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo esc_js(esc_html(stripslashes($_POST['asc_or_desc'])));?>"/>
|
777 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo esc_js(esc_html(stripslashes($_POST['order_by'])));?>"/>
|
778 |
+
<?php
|
779 |
+
?>
|
780 |
+
</form>
|
781 |
+
<?php
|
782 |
+
|
783 |
+
}
|
784 |
+
|
785 |
+
function edit_event_category($id){
|
786 |
+
global $wpdb;
|
787 |
+
$row=$wpdb->get_row($wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE id=%d" , $id ));
|
788 |
+
?>
|
789 |
+
|
790 |
+
<script language="javascript" type="text/javascript">
|
791 |
+
<!--
|
792 |
+
function submitbutton(pressbutton) {
|
793 |
+
document.getElementById('adminForm').action = "admin.php?page=spider_calendar_event_category&task=" + pressbutton+"&id=<?php echo $id?>";
|
794 |
+
if (document.getElementById('cat_title').value == "") {
|
795 |
+
alert('Provide the category title:');
|
796 |
+
}
|
797 |
+
else if (document.getElementById('color').value == "") {
|
798 |
+
alert('Provide the category color:');
|
799 |
+
}
|
800 |
+
else {
|
801 |
+
document.getElementById('adminForm').submit();
|
802 |
+
}
|
803 |
+
}
|
804 |
+
jQuery(document).ready(function() {
|
805 |
+
jQuery('.color_input').wpColorPicker();
|
806 |
+
});
|
807 |
+
</script>
|
808 |
+
<style>
|
809 |
+
.wp-picker-holder{
|
810 |
+
position: absolute;
|
811 |
+
z-index: 2;
|
812 |
+
top: 20px;
|
813 |
+
}
|
814 |
+
.wp-color-result {
|
815 |
+
background-color: transparent;
|
816 |
+
width: 85px;
|
817 |
+
}
|
818 |
+
.wp-color-result:focus{
|
819 |
+
outline: none;
|
820 |
+
}
|
821 |
+
.color_for_this {
|
822 |
+
height: 24px;
|
823 |
+
top: 0px;
|
824 |
+
position: relative;
|
825 |
+
width: 35px;
|
826 |
+
left: 2px;
|
827 |
+
}
|
828 |
+
.wp-color-result:hover{
|
829 |
+
background-color: transparent;
|
830 |
+
}
|
831 |
+
|
832 |
+
.button-secondary.action{
|
833 |
+
margin: -4px;
|
834 |
+
}
|
835 |
+
</style>
|
836 |
+
<?php upgrade_pro_sp(); ?>
|
837 |
+
<table cellspacing="10" width="100%" id="category_table">
|
838 |
+
<tr>
|
839 |
+
<td><h2>Event Category <?php if(isset($row->title)) echo htmlspecialchars($row->title); ?></h2></td>
|
840 |
+
<td align="right" style="width: 45px;"><input type="button" onClick="submitbutton('save_category_event')" value="Save" class="button-secondary action"></td>
|
841 |
+
<td align="right" style="width: 50px;"><input type="button" onClick="submitbutton('apply_event_category')" value="Apply" class="button-secondary action"></td>
|
842 |
+
<td align="right" style="width: 59px;"><input type="button" onClick="window.location.href='admin.php?page=spider_calendar_event_category'" value="Cancel" class="button-secondary action" style="margin: 0px 0px 0px -5px;"></td>
|
843 |
+
</tr>
|
844 |
+
</table>
|
845 |
+
|
846 |
+
|
847 |
+
<form action="" method="post" name="adminForm" id="adminForm">
|
848 |
+
<div class="width-45 fltlft ">
|
849 |
+
<fieldset class="adminform" >
|
850 |
+
|
851 |
+
|
852 |
+
|
853 |
+
|
854 |
+
<table class="admintable" >
|
855 |
+
|
856 |
+
|
857 |
+
|
858 |
+
<tr>
|
859 |
+
<td class="key" ><label for="message"><?php echo 'Title'; ?>:</label> </td>
|
860 |
+
<td>
|
861 |
+
|
862 |
+
<input type="text" name="title" value="<?php if(isset($row->title)) echo htmlspecialchars($row->title);
|
863 |
+
?>" id="cat_title"/>
|
864 |
+
</td>
|
865 |
+
</tr>
|
866 |
+
|
867 |
+
<tr>
|
868 |
+
<td class="key" ><label for="message"><?php echo 'Color'; ?>:</label> </td>
|
869 |
+
|
870 |
+
<td>
|
871 |
+
<div class="color_for_this" style="background-color: #<?php if(isset($row->color)) echo htmlspecialchars($row->color); ?>">
|
872 |
+
<input type="text" name="color" id="color" class="color_input wp-color-picker" style="width:134px;" value="<?php if(isset($row->color)) echo htmlspecialchars($row->color); ?>"/>
|
873 |
+
</div>
|
874 |
+
</td>
|
875 |
+
</tr>
|
876 |
+
|
877 |
+
|
878 |
+
<tr>
|
879 |
+
<td class="key"><label for="message"> <?php echo 'Description'; ?>:</label></td>
|
880 |
+
<td ><div id="poststuff" style="width:100% !important;">
|
881 |
+
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
882 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor(stripslashes($row->description),"description","title" ); ?>
|
883 |
+
</div>
|
884 |
+
<?php }else{
|
885 |
+
if(isset($row->description)) $desc1 = $row->description;
|
886 |
+
else $desc1 = "";
|
887 |
+
wp_editor($desc1, "description"); }?>
|
888 |
+
|
889 |
+
</div>
|
890 |
+
</div></td>
|
891 |
+
|
892 |
+
</tr>
|
893 |
+
|
894 |
+
<tr>
|
895 |
+
<td class="key" ><label for="message"><?php echo 'Published'; ?>:</label> </td>
|
896 |
+
|
897 |
+
<td>
|
898 |
+
<input type="radio" name="published" id="published0" value="0" <?php if(isset($row->published)) cheched($row->published, '0'); ?> class="inputbox">
|
899 |
+
<label for="published0">No</label>
|
900 |
+
<input type="radio" name="published" id="published1" value="1" <?php (isset($row->published)) ? cheched($row->published, '1') : cheched('1', '1'); ?> class="inputbox">
|
901 |
+
<label for="published1">Yes</label>
|
902 |
+
</td>
|
903 |
+
</tr>
|
904 |
+
|
905 |
+
</table>
|
906 |
+
|
907 |
+
</fieldset >
|
908 |
+
</div>
|
909 |
+
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
910 |
+
<input type="hidden" name="id" value="<?php echo $id ?>" />
|
911 |
+
</form>
|
912 |
+
<?php
|
913 |
+
|
914 |
+
|
915 |
+
|
916 |
+
}
|
917 |
+
|
918 |
+
|
919 |
+
function html_upcoming_widget($rows, $pageNav, $sort){
|
920 |
+
require_once("spidercalendar_upcoming_events_widget.php");
|
921 |
+
global $wpdb;
|
922 |
+
$input_id=esc_html($_GET['id_input']);
|
923 |
+
$w_id = esc_html($_GET['w_id']);
|
924 |
+
$tbody_id='event'.$w_id;
|
925 |
+
$calendar_id=esc_html($_GET['upcalendar_id']);
|
926 |
+
?><html>
|
927 |
+
<head>
|
928 |
+
<link rel="stylesheet" id="thickbox-css" href="<?php echo plugins_url("elements/calendar-jos.css", __FILE__) ?>" type="text/css" media="all">
|
929 |
+
<?php wp_print_scripts("Canlendar_upcoming");
|
930 |
+
wp_print_scripts("calendnar-setup_upcoming");
|
931 |
+
wp_print_scripts("calenndar_function_upcoming");
|
932 |
+
?>
|
933 |
+
|
934 |
+
<style>
|
935 |
+
.calendar .button {
|
936 |
+
display: table-cell !important;
|
937 |
+
}
|
938 |
+
|
939 |
+
.wd_button{
|
940 |
+
border: 1px solid #D5D5D5 !important;
|
941 |
+
border-radius: 10px;
|
942 |
+
width: 30px;
|
943 |
+
height: 25px;
|
944 |
+
}
|
945 |
+
}
|
946 |
+
input[type=checkbox]:checked:before,
|
947 |
+
th.sorted.asc .sorting-indicator:before, th.desc:hover span.sorting-indicator:before,
|
948 |
+
th.sorted.desc .sorting-indicator:before, th.asc:hover span.sorting-indicator:before{
|
949 |
+
content: close-quote !important;
|
950 |
+
}
|
951 |
+
|
952 |
+
</style>
|
953 |
+
<script language="javascript">
|
954 |
+
function ordering(name, as_or_desc) {
|
955 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
956 |
+
document.getElementById('order_by').value = name;
|
957 |
+
document.getElementById('admin_form').submit();
|
958 |
+
}
|
959 |
+
function submit_form_id(x) {
|
960 |
+
var val = x.options[x.selectedIndex].value;
|
961 |
+
document.getElementById("id_for_playlist").value = val;
|
962 |
+
document.getElementById("admin_form").submit();
|
963 |
+
}
|
964 |
+
|
965 |
+
function doNothing() {
|
966 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
967 |
+
if (keyCode == 13) {
|
968 |
+
if (!e) {
|
969 |
+
var e = window.event;
|
970 |
+
}
|
971 |
+
e.cancelBubble = true;
|
972 |
+
e.returnValue = false;
|
973 |
+
if (e.stopPropagation) {
|
974 |
+
e.stopPropagation();
|
975 |
+
e.preventDefault();
|
976 |
+
}
|
977 |
+
}
|
978 |
+
}
|
979 |
+
|
980 |
+
|
981 |
+
function isChecked(isitchecked){
|
982 |
+
if (isitchecked == true){
|
983 |
+
document.adminForm.boxchecked.value++;
|
984 |
+
}
|
985 |
+
else {
|
986 |
+
document.adminForm.boxchecked.value--;
|
987 |
+
}
|
988 |
+
}
|
989 |
+
|
990 |
+
|
991 |
+
function checkAll( n, fldName ) {
|
992 |
+
|
993 |
+
if (!fldName) {
|
994 |
+
|
995 |
+
fldName = 'cb';
|
996 |
+
|
997 |
+
}
|
998 |
+
|
999 |
+
var f = document.admin_form;
|
1000 |
+
|
1001 |
+
var c = f.toggle.checked;
|
1002 |
+
|
1003 |
+
var n2 = 0;
|
1004 |
+
|
1005 |
+
for (i=0; i < n; i++) {
|
1006 |
+
|
1007 |
+
cb = eval( 'f.' + fldName + '' + i );
|
1008 |
+
|
1009 |
+
if (cb) {
|
1010 |
+
|
1011 |
+
cb.checked = c;
|
1012 |
+
|
1013 |
+
n2++;
|
1014 |
+
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
}
|
1018 |
+
|
1019 |
+
if (c) {
|
1020 |
+
|
1021 |
+
document.admin_form.boxchecked.value = n2;
|
1022 |
+
|
1023 |
+
} else {
|
1024 |
+
|
1025 |
+
document.admin_form.boxchecked.value = 0;
|
1026 |
+
|
1027 |
+
}
|
1028 |
+
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
|
1032 |
+
|
1033 |
+
|
1034 |
+
function select_events()
|
1035 |
+
|
1036 |
+
{
|
1037 |
+
var id =[];
|
1038 |
+
var title =[];
|
1039 |
+
|
1040 |
+
for(i=0; i<<?php echo count($rows)?>; i++)
|
1041 |
+
if(document.getElementById("p"+i))
|
1042 |
+
if(document.getElementById("p"+i).checked)
|
1043 |
+
{
|
1044 |
+
id.push(document.getElementById("p"+i).value);
|
1045 |
+
title.push(document.getElementById("title_"+i).value);
|
1046 |
+
|
1047 |
+
}
|
1048 |
+
window.parent.jSelectEvents('<?php echo $input_id ?>','<?php echo $tbody_id ?>','<?php echo $w_id ?>',id, title);
|
1049 |
+
}
|
1050 |
+
|
1051 |
+
|
1052 |
+
</script>
|
1053 |
+
<?php
|
1054 |
+
|
1055 |
+
|
1056 |
+
if(get_bloginfo( 'version' )>3.3){
|
1057 |
+
|
1058 |
+
?>
|
1059 |
+
|
1060 |
+
<link rel="stylesheet" href="<?php echo bloginfo("url") ?>/wp-admin/load-styles.php?c=0&dir=ltr&load=admin-bar,wp-admin&ver=7f0753feec257518ac1fec83d5bced6a" type="text/css" media="all">
|
1061 |
+
|
1062 |
+
<?php
|
1063 |
+
|
1064 |
+
}
|
1065 |
+
|
1066 |
+
else
|
1067 |
+
|
1068 |
+
{
|
1069 |
+
|
1070 |
+
?>
|
1071 |
+
|
1072 |
+
<link rel="stylesheet" href="<?php echo bloginfo("url") ?>/wp-admin/load-styles.php?c=1&dir=ltr&load=global,wp-admin&ver=aba7495e395713976b6073d5d07d3b17" type="text/css" media="all">
|
1073 |
+
|
1074 |
+
<?php
|
1075 |
+
|
1076 |
+
}
|
1077 |
+
|
1078 |
+
?>
|
1079 |
+
|
1080 |
+
<link rel="stylesheet" id="thickbox-css" href="<?php echo bloginfo('url')?>/wp-includes/js/thickbox/thickbox.css?ver=20111117" type="text/css" media="all">
|
1081 |
+
|
1082 |
+
<!---- <link rel="stylesheet" id="colors-css" href="<?php echo bloginfo('url')?>/wp-admin/css/colors-classic.css?ver=20111206" type="text/css" media="all"> --->
|
1083 |
+
</head>
|
1084 |
+
<body>
|
1085 |
+
<form method="post" onKeyPress="doNothing()" action="<?php echo admin_url('admin-ajax.php') ?>?action=upcoming&id_input=<?php echo $input_id;?>&upcalendar_id=<?php echo $calendar_id;?>&w_id=<?php echo $w_id;?>" id="admin_form" name="admin_form">
|
1086 |
+
<table cellspacing="10" width="100%">
|
1087 |
+
|
1088 |
+
<tr>
|
1089 |
+
<td width="100%"><h2>Event Manager</h2></td></td>
|
1090 |
+
<td align="right" width="100%">
|
1091 |
+
|
1092 |
+
<button onClick="select_events();" style="width:98px; height:34px; background:url(<?php echo plugins_url('',__FILE__) ?>/front_end/images/add_but.png) no-repeat;border:none;cursor:pointer;"> </button>
|
1093 |
+
</td>
|
1094 |
+
</tr>
|
1095 |
+
</table>
|
1096 |
+
<?php
|
1097 |
+
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
1098 |
+
$serch_value = esc_js(esc_html(stripslashes($_POST['search_events_by_title'])));
|
1099 |
+
}
|
1100 |
+
else {
|
1101 |
+
$serch_value = "";
|
1102 |
+
}
|
1103 |
+
$startdate = (isset($_POST["startdate"]) ? esc_js(esc_html(stripslashes($_POST["startdate"]))) : '');
|
1104 |
+
$enddate = (isset($_POST["enddate"]) ? esc_js(esc_html(stripslashes($_POST["enddate"]))) : '');
|
1105 |
+
$serch_fields = '
|
1106 |
+
<div class="alignleft actions">
|
1107 |
+
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
1108 |
+
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()" style="border: 1px solid #DCDCEC;"/>
|
1109 |
+
</div>
|
1110 |
+
<div class="alignleft actions">
|
1111 |
+
From: <input class="inputbox" type="text" style="width: 90px;border: 1px solid #DCDCEC;" name="startdate" id="startdate" size="10" maxlength="10" value="' . $startdate . '" />
|
1112 |
+
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'startdate\',\'%Y-%m-%d\');">
|
1113 |
+
To: <input class="inputbox" type="text" style="width: 90px;border: 1px solid #DCDCEC;" name="enddate" id="enddate" size="10" maxlength="10" value="' . $enddate . '">
|
1114 |
+
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'enddate\',\'%Y-%m-%d\');">
|
1115 |
+
</div>
|
1116 |
+
<div class="alignleft actions">
|
1117 |
+
<input type="button" style="border: 1px solid #DCDCEC;border-radius: 10px;" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\';document.getElementById(\'serch_or_not\').value=\'search\'; document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
1118 |
+
<input type="button" style="border: 1px solid #DCDCEC;border-radius: 10px;" value="Reset" onclick="window.location.href=\'admin-ajax.php?action=upcoming&id_input='.$input_id.'&upcalendar_id='.$calendar_id.'&w_id='.$w_id.'\'" class="button-secondary action">
|
1119 |
+
</div>';
|
1120 |
+
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
1121 |
+
?>
|
1122 |
+
<style>
|
1123 |
+
.sorting-indicator {
|
1124 |
+
width: 7px;
|
1125 |
+
height: 4px;
|
1126 |
+
margin-top: 8px;
|
1127 |
+
margin-left: 7px;
|
1128 |
+
background-image: url('images/sort.gif');
|
1129 |
+
background-repeat: no-repeat;
|
1130 |
+
}
|
1131 |
+
.wd_button{
|
1132 |
+
border: 1px solid #D5D5D5 !important;
|
1133 |
+
border-radius: 10px;
|
1134 |
+
width: 30px;
|
1135 |
+
height: 25px;
|
1136 |
+
}
|
1137 |
+
</style>
|
1138 |
+
<table class="wp-list-table widefat fixed pages" style="width:100%">
|
1139 |
+
<thead>
|
1140 |
+
<TR>
|
1141 |
+
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px;background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);">
|
1142 |
+
<a href="javascript:ordering('id',<?php echo (($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
1143 |
+
<span>ID</span>
|
1144 |
+
<span class="sorting-indicator"></span>
|
1145 |
+
</a>
|
1146 |
+
</th>
|
1147 |
+
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);" width="20" class="manage-column column-cb check-column">
|
1148 |
+
|
1149 |
+
<input style="border: 1px solid #DCDCEC;-webkit-appearance: checkbox;" type="checkbox" name="toggle" id="toggle" value="" onClick="checkAll(<?php echo count($rows)?>, 'p')">
|
1150 |
+
|
1151 |
+
</th>
|
1152 |
+
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);" scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1153 |
+
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
1154 |
+
<span>Title</span>
|
1155 |
+
<span class="sorting-indicator"></span>
|
1156 |
+
</a>
|
1157 |
+
</th>
|
1158 |
+
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);"scope="col" id="date" class="<?php echo (($sort["sortid_by"] == "date") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1159 |
+
<a href="javascript:ordering('date',<?php echo (($sort["sortid_by"] == "date") ? $sort["1_or_2"] : "1"); ?>)">
|
1160 |
+
<span>Date</span>
|
1161 |
+
<span class="sorting-indicator"></span>
|
1162 |
+
</a>
|
1163 |
+
</th>
|
1164 |
+
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);"scope="col" id="time" class="<?php echo (($sort["sortid_by"] == "time") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1165 |
+
<a href="javascript:ordering('time',<?php echo (($sort["sortid_by"] == "time") ? $sort["1_or_2"] : "1"); ?>)">
|
1166 |
+
<span>Time</span>
|
1167 |
+
<span class="sorting-indicator"></span>
|
1168 |
+
</a>
|
1169 |
+
</th>
|
1170 |
+
</TR>
|
1171 |
+
</thead>
|
1172 |
+
<tbody>
|
1173 |
+
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
1174 |
+
<tr>
|
1175 |
+
|
1176 |
+
<td style="border-bottom: 1px solid #DCDCEC;"><?php echo $rows[$i]->id; ?></td>
|
1177 |
+
<td style="border-bottom: 1px solid #DCDCEC;">
|
1178 |
+
<input style="border: 1px solid #DCDCEC;-webkit-appearance: checkbox;" type="checkbox" id="p<?php echo $i?>" value="<?php echo $rows[$i]->id;?>" />
|
1179 |
+
<input type="hidden" id="title_<?php echo $i?>" value="<?php echo htmlspecialchars($rows[$i]->title);?>" />
|
1180 |
+
</td>
|
1181 |
+
<td style="border-bottom: 1px solid #DCDCEC;"><a href="<?php echo admin_url('admin-ajax.php') ?>?action=upcoming" onClick="window.parent.jSelectEvents('<?php echo $input_id ?>','<?php echo $tbody_id ?>','<?php echo $w_id ?>',['<?php echo $rows[$i]->id?>'],['<?php echo htmlspecialchars(addslashes($rows[$i]->title));?>'])"><?php echo $rows[$i]->title; ?></a>
|
1182 |
+
</td>
|
1183 |
+
<td style="border-bottom: 1px solid #DCDCEC;"><?php if ($rows[$i]->date_end != '0000-00-00' && $rows[$i]->date_end != '2035-12-12') echo $rows[$i]->date . ' - ' . $rows[$i]->date_end; else echo $rows[$i]->date; ?></td>
|
1184 |
+
<td style="border-bottom: 1px solid #DCDCEC;"><?php echo $rows[$i]->time ?></td>
|
1185 |
+
</tr>
|
1186 |
+
<?php } ?>
|
1187 |
+
</tbody>
|
1188 |
+
</table>
|
1189 |
+
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
1190 |
+
<input type="hidden" name="boxchecked" value="0">
|
1191 |
+
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo esc_js(esc_html(stripslashes($_POST['asc_or_desc']))); ?>"/>
|
1192 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo esc_js(esc_html(stripslashes($_POST['order_by']))); ?>"/>
|
1193 |
+
<?php
|
1194 |
+
?>
|
1195 |
+
</form>
|
1196 |
+
</body>
|
1197 |
+
</html>
|
1198 |
+
<?php
|
1199 |
+
die();
|
1200 |
+
}
|
1201 |
+
|
1202 |
+
// Events.
|
1203 |
+
function html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name) {
|
1204 |
+
global $wpdb;
|
1205 |
+
?>
|
1206 |
+
<style>
|
1207 |
+
.calendar .button {
|
1208 |
+
display: table-cell !important;
|
1209 |
+
}
|
1210 |
+
.wd_button{
|
1211 |
+
border: 1px solid #D5D5D5 !important;
|
1212 |
+
border-radius: 10px;
|
1213 |
+
width: 30px;
|
1214 |
+
height: 25px;
|
1215 |
+
}
|
1216 |
+
</style>
|
1217 |
+
<script language="javascript">
|
1218 |
+
function ordering(name, as_or_desc) {
|
1219 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
1220 |
+
document.getElementById('order_by').value = name;
|
1221 |
+
document.getElementById('admin_form').submit();
|
1222 |
+
}
|
1223 |
+
function doNothing() {
|
1224 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
1225 |
+
if (keyCode == 13) {
|
1226 |
+
if (!e) {
|
1227 |
+
var e = window.event;
|
1228 |
+
}
|
1229 |
+
e.cancelBubble = true;
|
1230 |
+
e.returnValue = false;
|
1231 |
+
if (e.stopPropagation) {
|
1232 |
+
e.stopPropagation();
|
1233 |
+
e.preventDefault();
|
1234 |
+
}
|
1235 |
+
}
|
1236 |
+
}
|
1237 |
+
</script>
|
1238 |
+
<div class="sp_calendar_upgrade wd-clear" >
|
1239 |
+
<div class="wd-left">
|
1240 |
+
<div style="font-size: 14px;">
|
1241 |
+
<?php _e("This section allows you to create/edit the events of a particular calendar.","sp_calendar");?>
|
1242 |
+
<a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
|
1243 |
+
</div>
|
1244 |
+
</div>
|
1245 |
+
<div class="wd-right">
|
1246 |
+
<div class="wd-table">
|
1247 |
+
<div class="wd-cell wd-cell-valign-middle">
|
1248 |
+
<a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
|
1249 |
+
<img src="<?php echo plugins_url('images/i_support.png', __FILE__); ?>" >
|
1250 |
+
<?php _e("Support Forum", "sp_calendar"); ?>
|
1251 |
+
</a>
|
1252 |
+
</div>
|
1253 |
+
<div class="wd-cell wd-cell-valign-middle">
|
1254 |
+
<a href="https://web-dorado.com/products/wordpress-calendar.html" target="_blank">
|
1255 |
+
<?php _e("UPGRADE TO PAID VERSION", "sp_calendar"); ?>
|
1256 |
+
</a>
|
1257 |
+
</div>
|
1258 |
+
</div>
|
1259 |
+
|
1260 |
+
</div>
|
1261 |
+
</div>
|
1262 |
+
<form method="post" onKeyPress="doNothing()" action="admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=<?php echo $calendar_id; ?>" id="admin_form" name="admin_form">
|
1263 |
+
<?php $sp_cal_nonce = wp_create_nonce('nonce_sp_cal'); ?>
|
1264 |
+
<table cellspacing="10" width="95%">
|
1265 |
+
<tr>
|
1266 |
+
<td width="100%"><h2>Event Manager for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
1267 |
+
<td>
|
1268 |
+
<p class="submit" style="padding:0px; text-align:left">
|
1269 |
+
<input class="button-primary" type="button" value="Add an Event" name="custom_parametrs" onClick="window.location.href='admin.php?page=SpiderCalendar&task=add_event&calendar_id=<?php echo $calendar_id; ?>'" style="float: right; margin: 0px 0 0 40px;"/>
|
1270 |
+
</p>
|
1271 |
+
</td>
|
1272 |
+
<td>
|
1273 |
+
<p class="submit" style="padding:0px; text-align:left">
|
1274 |
+
<input type="button" class="button-primary" value="Back" name="custom_parametrs" onClick="window.location.href='admin.php?page=SpiderCalendar'" style="margin: 0 0 0 -5px; float: right;"/>
|
1275 |
+
</p>
|
1276 |
+
</td>
|
1277 |
+
</tr>
|
1278 |
+
</table>
|
1279 |
+
<?php
|
1280 |
+
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
1281 |
+
$serch_value = esc_js(esc_html(stripslashes($_POST['search_events_by_title'])));
|
1282 |
+
}
|
1283 |
+
else {
|
1284 |
+
$serch_value = "";
|
1285 |
+
}
|
1286 |
+
$startdate = (isset($_POST["startdate"]) ? esc_js(esc_html(stripslashes($_POST["startdate"]))) : '');
|
1287 |
+
$enddate = (isset($_POST["enddate"]) ? esc_js(esc_html(stripslashes($_POST["enddate"]))) : '');
|
1288 |
+
$serch_fields = '
|
1289 |
+
<div class="alignleft actions">
|
1290 |
+
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
1291 |
+
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()" />
|
1292 |
+
</div>
|
1293 |
+
<div class="alignleft actions">
|
1294 |
+
From: <input style="width: 90px;" class="inputbox" type="text" name="startdate" id="startdate" size="10" maxlength="10" value="' . $startdate . '" />
|
1295 |
+
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'startdate\',\'%Y-%m-%d\');">
|
1296 |
+
To: <input style="width: 90px;" class="inputbox" type="text" name="enddate" id="enddate" size="10" maxlength="10" value="' . $enddate . '">
|
1297 |
+
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'enddate\',\'%Y-%m-%d\');">
|
1298 |
+
</div>
|
1299 |
+
<div class="alignleft actions">
|
1300 |
+
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\';document.getElementById(\'serch_or_not\').value=\'search\'; document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
1301 |
+
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=' . $calendar_id . '\'" class="button-secondary action">
|
1302 |
+
</div>';
|
1303 |
+
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
1304 |
+
?>
|
1305 |
+
<table class="wp-list-table widefat fixed pages" style="width:99%">
|
1306 |
+
<thead>
|
1307 |
+
<TR>
|
1308 |
+
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
1309 |
+
<a href="javascript:ordering('id',<?php echo (($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
1310 |
+
<span>ID</span>
|
1311 |
+
<span class="sorting-indicator"></span>
|
1312 |
+
</a>
|
1313 |
+
</th>
|
1314 |
+
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1315 |
+
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
1316 |
+
<span>Title</span>
|
1317 |
+
<span class="sorting-indicator"></span>
|
1318 |
+
</a>
|
1319 |
+
</th>
|
1320 |
+
<th scope="col" id="date" class="<?php echo (($sort["sortid_by"] == "date") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1321 |
+
<a href="javascript:ordering('date',<?php echo (($sort["sortid_by"] == "date") ? $sort["1_or_2"] : "1"); ?>)">
|
1322 |
+
<span>Date</span>
|
1323 |
+
<span class="sorting-indicator"></span>
|
1324 |
+
</a>
|
1325 |
+
</th>
|
1326 |
+
<th scope="col" id="time" class="<?php echo (($sort["sortid_by"] == "time") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1327 |
+
<a href="javascript:ordering('time',<?php echo (($sort["sortid_by"] == "time") ? $sort["1_or_2"] : "1"); ?>)">
|
1328 |
+
<span>Time</span>
|
1329 |
+
<span class="sorting-indicator"></span>
|
1330 |
+
</a>
|
1331 |
+
</th>
|
1332 |
+
<th scope="col" id="cattitle" class="<?php echo (($sort["sortid_by"] == "cattitle") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1333 |
+
<a href="javascript:ordering('cattitle',<?php echo (($sort["sortid_by"] == "cattitle") ? $sort["1_or_2"] : "1"); ?>)">
|
1334 |
+
<span>Category</span>
|
1335 |
+
<span class="sorting-indicator"></span>
|
1336 |
+
</a>
|
1337 |
+
</th>
|
1338 |
+
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
1339 |
+
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
1340 |
+
<span>Published</span>
|
1341 |
+
<span class="sorting-indicator"></span>
|
1342 |
+
</a>
|
1343 |
+
</th>
|
1344 |
+
<th style="width:80px">Copy</th>
|
1345 |
+
<th style="width:80px">Edit</th>
|
1346 |
+
<th style="width:80px">Delete</th>
|
1347 |
+
</TR>
|
1348 |
+
</thead>
|
1349 |
+
<tbody>
|
1350 |
+
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
1351 |
+
<tr>
|
1352 |
+
<td><?php echo $rows[$i]->id; ?></td>
|
1353 |
+
<td><a href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=edit_event&id=<?php echo $rows[$i]->id; ?>"><?php echo $rows[$i]->title; ?></a>
|
1354 |
+
</td>
|
1355 |
+
<td><?php if ($rows[$i]->date_end != '0000-00-00' && $rows[$i]->date_end != '2035-12-12') echo $rows[$i]->date . ' - ' . $rows[$i]->date_end; else echo $rows[$i]->date; ?></td>
|
1356 |
+
<td><?php echo $rows[$i]->time ?></td>
|
1357 |
+
<td><?php echo $rows[$i]->cattitle ?></td>
|
1358 |
+
<td>
|
1359 |
+
<a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?> href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=published_event&id=<?php echo $rows[$i]->id; ?>&_wpnonce=<?php echo $sp_cal_nonce; ?>"><?php if ($rows[$i]->published)
|
1360 |
+
echo 'Yes'; else echo 'No'; ?>
|
1361 |
+
</a>
|
1362 |
+
</td>
|
1363 |
+
<td>
|
1364 |
+
<a href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=copy_event&id=<?php echo $rows[$i]->id; ?>&_wpnonce=<?php echo $sp_cal_nonce; ?>"><img src="<?php echo plugins_url('images/copy_cal.gif', __FILE__); ?>" /></a>
|
1365 |
+
</td>
|
1366 |
+
<td>
|
1367 |
+
<a href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=edit_event&id=<?php echo $rows[$i]->id; ?>">Edit</a>
|
1368 |
+
</td>
|
1369 |
+
<td>
|
1370 |
+
<a href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=remove_event&id=<?php echo $rows[$i]->id; ?>&_wpnonce=<?php echo $sp_cal_nonce; ?>">Delete</a>
|
1371 |
+
</td>
|
1372 |
+
</tr>
|
1373 |
+
<?php } ?>
|
1374 |
+
</tbody>
|
1375 |
+
</table>
|
1376 |
+
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo esc_js(esc_html(stripslashes($_POST['id_for_playlist']))); ?>"/>
|
1377 |
+
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo esc_js(esc_html(stripslashes($_POST['asc_or_desc']))); ?>"/>
|
1378 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo esc_js(esc_html(stripslashes($_POST['order_by']))); ?>"/>
|
1379 |
+
<?php
|
1380 |
+
?>
|
1381 |
+
</form>
|
1382 |
+
|
1383 |
+
<?php
|
1384 |
+
}
|
1385 |
+
|
1386 |
+
function html_add_spider_event($calendar_id, $cal_name) {
|
1387 |
+
?>
|
1388 |
+
<style>
|
1389 |
+
.calendar .button {
|
1390 |
+
display: table-cell !important;
|
1391 |
+
}
|
1392 |
+
.wd_button{
|
1393 |
+
border: 1px solid #D5D5D5 !important;
|
1394 |
+
border-radius: 10px;
|
1395 |
+
width: 30px;
|
1396 |
+
height: 25px;
|
1397 |
+
}
|
1398 |
+
</style>
|
1399 |
+
<script language="javascript" type="text/javascript">
|
1400 |
+
function submitbutton(pressbutton) {
|
1401 |
+
var form = document.adminForm;
|
1402 |
+
if (pressbutton == 'cancel_event') {
|
1403 |
+
submitform(pressbutton);
|
1404 |
+
return;
|
1405 |
+
}
|
1406 |
+
if (form.date.value.search(/^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/)) {
|
1407 |
+
alert('Invalid Date');
|
1408 |
+
}
|
1409 |
+
else if(form.repeat_method.value=="weekly"){
|
1410 |
+
var atLeastOneIsChecked = false;
|
1411 |
+
jQuery('input:checkbox').each(function () {
|
1412 |
+
if (jQuery(this).is(':checked')) {
|
1413 |
+
atLeastOneIsChecked = true;
|
1414 |
+
}
|
1415 |
+
});
|
1416 |
+
if(atLeastOneIsChecked) submitform(pressbutton)
|
1417 |
+
else alert('Invalid Weekday');
|
1418 |
+
}
|
1419 |
+
else if (form.selhour_from.value == "" && form.selminute_from.value == "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1420 |
+
submitform(pressbutton);
|
1421 |
+
}
|
1422 |
+
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1423 |
+
submitform(pressbutton);
|
1424 |
+
}
|
1425 |
+
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value != "" && form.selminute_to.value != "") {
|
1426 |
+
submitform(pressbutton);
|
1427 |
+
}
|
1428 |
+
|
1429 |
+
else {
|
1430 |
+
alert('Invalid Time');
|
1431 |
+
}
|
1432 |
+
}
|
1433 |
+
|
1434 |
+
|
1435 |
+
function submitform(pressbutton) {
|
1436 |
+
|
1437 |
+
if (document.getElementById('title').value == "") {
|
1438 |
+
alert('Provide the title:');
|
1439 |
+
}
|
1440 |
+
else {
|
1441 |
+
document.getElementById('adminForm').submit();
|
1442 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
1443 |
+
document.getElementById('adminForm').submit();
|
1444 |
+
}
|
1445 |
+
}
|
1446 |
+
function checkhour(id,event) {
|
1447 |
+
if (typeof(event) != 'undefined') {
|
1448 |
+
var e = event; // for trans-browser compatibility
|
1449 |
+
var charCode = e.which || e.keyCode;
|
1450 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1451 |
+
return false;
|
1452 |
+
}
|
1453 |
+
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1454 |
+
hour = parseFloat(hour);
|
1455 |
+
if (document.getSelection() != '') {
|
1456 |
+
return true;
|
1457 |
+
}
|
1458 |
+
if ((hour < 0) || (hour > 23)) {
|
1459 |
+
return false;
|
1460 |
+
}
|
1461 |
+
}
|
1462 |
+
return true;
|
1463 |
+
}
|
1464 |
+
function check12hour(id,event) {
|
1465 |
+
if (typeof(event) != 'undefined') {
|
1466 |
+
var e = event; // for trans-browser compatibility
|
1467 |
+
var charCode = e.which || e.keyCode;
|
1468 |
+
input = document.getElementById(id);
|
1469 |
+
if (charCode == 48 && input.value.length == 0) {
|
1470 |
+
return false;
|
1471 |
+
}
|
1472 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1473 |
+
return false;
|
1474 |
+
}
|
1475 |
+
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1476 |
+
hour = parseFloat(hour);
|
1477 |
+
if (document.getSelection() != '') {
|
1478 |
+
return true;
|
1479 |
+
}
|
1480 |
+
if ((hour < 0) || (hour > 12)) {
|
1481 |
+
return false;
|
1482 |
+
}
|
1483 |
+
}
|
1484 |
+
return true;
|
1485 |
+
}
|
1486 |
+
function checknumber(id,event) {
|
1487 |
+
if (typeof(event) != 'undefined') {
|
1488 |
+
var e = event; // for trans-browser compatibility
|
1489 |
+
var charCode = e.which || e.keyCode;
|
1490 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1491 |
+
return false;
|
1492 |
+
}
|
1493 |
+
}
|
1494 |
+
return true;
|
1495 |
+
}
|
1496 |
+
function checkminute(id,event) {
|
1497 |
+
if (typeof(event) != 'undefined') {
|
1498 |
+
var e = event; // for trans-browser compatibility
|
1499 |
+
var charCode = e.which || e.keyCode;
|
1500 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1501 |
+
return false;
|
1502 |
+
}
|
1503 |
+
minute = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1504 |
+
minute = parseFloat(minute);
|
1505 |
+
if (document.getSelection() != '') {
|
1506 |
+
return true;
|
1507 |
+
}
|
1508 |
+
if ((minute < 0) || (minute > 59)) {
|
1509 |
+
return false;
|
1510 |
+
}
|
1511 |
+
}
|
1512 |
+
return true;
|
1513 |
+
}
|
1514 |
+
function add_0(id) {
|
1515 |
+
input = document.getElementById(id);
|
1516 |
+
if (input.value.length == 1) {
|
1517 |
+
input.value = '0' + input.value;
|
1518 |
+
input.setAttribute("value", input.value);
|
1519 |
+
}
|
1520 |
+
}
|
1521 |
+
function change_type(type) {
|
1522 |
+
if (document.getElementById('daily1').value == '') {
|
1523 |
+
document.getElementById('daily1').value = 1;
|
1524 |
+
}
|
1525 |
+
else {
|
1526 |
+
document.getElementById('repeat_input').removeAttribute('style');
|
1527 |
+
}
|
1528 |
+
if (document.getElementById('weekly1').value == '') {
|
1529 |
+
document.getElementById('weekly1').value = 1;
|
1530 |
+
}
|
1531 |
+
if (document.getElementById('monthly1').value == '') {
|
1532 |
+
document.getElementById('monthly1').value = 1;
|
1533 |
+
}
|
1534 |
+
if (document.getElementById('yearly1').value == '') {
|
1535 |
+
document.getElementById('yearly1').value = 1;
|
1536 |
+
}
|
1537 |
+
switch (type) {
|
1538 |
+
case 'no_repeat':
|
1539 |
+
document.getElementById('daily').setAttribute('style', 'display:none');
|
1540 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1541 |
+
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1542 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1543 |
+
document.getElementById('month').value = '';
|
1544 |
+
document.getElementById('date_end').value = '';
|
1545 |
+
document.getElementById('repeat_until').setAttribute('style', 'display:none');
|
1546 |
+
break;
|
1547 |
+
|
1548 |
+
case 'daily':
|
1549 |
+
document.getElementById('daily').removeAttribute('style');
|
1550 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1551 |
+
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1552 |
+
document.getElementById('repeat').innerHTML = 'Day(s)';
|
1553 |
+
document.getElementById('repeat_input').value = document.getElementById('daily1').value;
|
1554 |
+
document.getElementById('month').value = '';
|
1555 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1556 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
1557 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1558 |
+
return input_value('daily1')
|
1559 |
+
};
|
1560 |
+
break;
|
1561 |
+
|
1562 |
+
case 'weekly':
|
1563 |
+
document.getElementById('daily').removeAttribute('style');
|
1564 |
+
document.getElementById('weekly').removeAttribute('style');
|
1565 |
+
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1566 |
+
document.getElementById('repeat').innerHTML = 'Week(s) on :';
|
1567 |
+
document.getElementById('repeat_input').value = document.getElementById('weekly1').value;
|
1568 |
+
document.getElementById('month').value = '';
|
1569 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1570 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
1571 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1572 |
+
return input_value('weekly1')
|
1573 |
+
};
|
1574 |
+
break;
|
1575 |
+
|
1576 |
+
case 'monthly':
|
1577 |
+
document.getElementById('daily').removeAttribute('style');
|
1578 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1579 |
+
document.getElementById('monthly').removeAttribute('style');
|
1580 |
+
document.getElementById('repeat').innerHTML = 'Month(s)'
|
1581 |
+
document.getElementById('repeat_input').value = document.getElementById('monthly1').value;
|
1582 |
+
document.getElementById('month').value = '';
|
1583 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1584 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
1585 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1586 |
+
return input_value('monthly1')
|
1587 |
+
};
|
1588 |
+
|
1589 |
+
break;
|
1590 |
+
|
1591 |
+
case 'yearly':
|
1592 |
+
document.getElementById('daily').removeAttribute('style');
|
1593 |
+
document.getElementById('year_month').removeAttribute('style');
|
1594 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1595 |
+
document.getElementById('monthly').removeAttribute('style');
|
1596 |
+
document.getElementById('repeat').innerHTML = 'Year(s) in ';
|
1597 |
+
document.getElementById('repeat_input').value = document.getElementById('yearly1').value;
|
1598 |
+
document.getElementById('month').value = '';
|
1599 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
1600 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1601 |
+
return input_value('yearly1')
|
1602 |
+
};
|
1603 |
+
break;
|
1604 |
+
}
|
1605 |
+
}
|
1606 |
+
function week_value() {
|
1607 |
+
var value = '';
|
1608 |
+
for (i = 1; i <= 7; i++) {
|
1609 |
+
if (document.getElementById('week_' + i).checked) {
|
1610 |
+
value = value + document.getElementById('week_' + i).value + ',';
|
1611 |
+
}
|
1612 |
+
}
|
1613 |
+
document.getElementById('week').value = value;
|
1614 |
+
}
|
1615 |
+
function input_repeat() {
|
1616 |
+
if (document.getElementById('repeat_input').value == 1) {
|
1617 |
+
document.getElementById('repeat_input').value = '';
|
1618 |
+
}
|
1619 |
+
document.getElementById('repeat_input').removeAttribute('style');
|
1620 |
+
}
|
1621 |
+
function radio_month() {
|
1622 |
+
if (document.getElementById('radio1').checked == true) {
|
1623 |
+
document.getElementById('monthly_list').disabled = true;
|
1624 |
+
document.getElementById('month_week').disabled = true;
|
1625 |
+
document.getElementById('month').disabled = false;
|
1626 |
+
}
|
1627 |
+
else {
|
1628 |
+
document.getElementById('month').disabled = true;
|
1629 |
+
document.getElementById('monthly_list').disabled = false;
|
1630 |
+
document.getElementById('month_week').disabled = false;
|
1631 |
+
}
|
1632 |
+
}
|
1633 |
+
function input_value(id) {
|
1634 |
+
document.getElementById(id).value = document.getElementById('repeat_input').value;
|
1635 |
+
}
|
1636 |
+
</script>
|
1637 |
+
<style>
|
1638 |
+
fieldset {
|
1639 |
+
border: 2px solid #4f9bc6;
|
1640 |
+
width: 100%;
|
1641 |
+
background: #fafbfd;
|
1642 |
+
padding: 13px;
|
1643 |
+
margin-top: 20px;
|
1644 |
+
-webkit-border-radius: 8px;
|
1645 |
+
-moz-border-radius: 8px;
|
1646 |
+
border-radius: 8px;
|
1647 |
+
|
1648 |
+
}
|
1649 |
+
.wd_button{
|
1650 |
+
border: 1px solid #D5D5D5 !important;
|
1651 |
+
border-radius: 10px;
|
1652 |
+
width: 30px;
|
1653 |
+
height: 25px;
|
1654 |
+
}
|
1655 |
+
</style>
|
1656 |
+
<div class="sp_calendar_upgrade wd-clear" >
|
1657 |
+
<div class="wd-left">
|
1658 |
+
<div style="font-size: 14px;">
|
1659 |
+
<?php _e("This section allows you to create/edit the events of a particular calendar.","sp_calendar");?>
|
1660 |
+
<a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
|
1661 |
+
</div>
|
1662 |
+
</div>
|
1663 |
+
<div class="wd-right">
|
1664 |
+
<div class="wd-table">
|
1665 |
+
<div class="wd-cell wd-cell-valign-middle">
|
1666 |
+
<a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
|
1667 |
+
<img src="<?php echo plugins_url('images/i_support.png', __FILE__); ?>" >
|
1668 |
+
<?php _e("Support Forum", "sp_calendar"); ?>
|
1669 |
+
</a>
|
1670 |
+
</div>
|
1671 |
+
<div class="wd-cell wd-cell-valign-middle">
|
1672 |
+
<a href="https://web-dorado.com/products/wordpress-calendar.html" target="_blank">
|
1673 |
+
<?php _e("UPGRADE TO PAID VERSION", "sp_calendar"); ?>
|
1674 |
+
</a>
|
1675 |
+
</div>
|
1676 |
+
</div>
|
1677 |
+
|
1678 |
+
</div>
|
1679 |
+
</div>
|
1680 |
+
<table width="95%">
|
1681 |
+
<tbody>
|
1682 |
+
<tr>
|
1683 |
+
<td width="100%"><h2>Add an event for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
1684 |
+
<td align="right"><input type="button" onClick="submitbutton('save_event')" value="Save" class="button-secondary action"></td>
|
1685 |
+
<td align="right"><input type="button" onClick="submitbutton('apply_event')" value="Apply" class="button-secondary action"></td>
|
1686 |
+
<td align="right"><input type="button" onClick="window.location.href='admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=show_manage_event'" value="Cancel" class="button-secondary action"></td>
|
1687 |
+
</tr>
|
1688 |
+
</tbody>
|
1689 |
+
</table>
|
1690 |
+
<?php
|
1691 |
+
global $wpdb;
|
1692 |
+
$calendar = $wpdb->get_row($wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id=%d", $calendar_id ));
|
1693 |
+
|
1694 |
+
|
1695 |
+
$query1 = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.category, " . $wpdb->prefix . "spidercalendar_event_category.title
|
1696 |
+
FROM " . $wpdb->prefix . "spidercalendar_event
|
1697 |
+
JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
1698 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id;");
|
1699 |
+
|
1700 |
+
$query2 = $wpdb->get_results("SELECT title,id FROM " . $wpdb->prefix . "spidercalendar_event_category");
|
1701 |
+
|
1702 |
+
?>
|
1703 |
+
<form action="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>" method="post" id="adminForm" name="adminForm">
|
1704 |
+
<table width="95%">
|
1705 |
+
<tr>
|
1706 |
+
<td style="width:45%">
|
1707 |
+
<div style="width:95%">
|
1708 |
+
<fieldset class="adminform">
|
1709 |
+
<legend>Event Details</legend>
|
1710 |
+
<table class="admintable">
|
1711 |
+
<tr>
|
1712 |
+
<td class="key"><label for="title">Title: </label></td>
|
1713 |
+
<td><input type="text" id="title" name="title" size="41"/></td>
|
1714 |
+
</tr>
|
1715 |
+
|
1716 |
+
<tr>
|
1717 |
+
<td class="key"><label for="category">Select Category: </label></td>
|
1718 |
+
<td>
|
1719 |
+
<select id="category" name="category" style="width:240px">
|
1720 |
+
<option value="0">--Select Category--</option>
|
1721 |
+
<?php foreach ($query2 as $key => $category) {
|
1722 |
+
?>
|
1723 |
+
<option value="<?php echo $category->id; ?>"><?php if(isset($category)) echo $category->title ?></option>
|
1724 |
+
<?php
|
1725 |
+
}
|
1726 |
+
?>
|
1727 |
+
</select>
|
1728 |
+
</td>
|
1729 |
+
</tr>
|
1730 |
+
<tr>
|
1731 |
+
<td class="key"><label for="date">Date: </label></td>
|
1732 |
+
<td>
|
1733 |
+
<input style="width:90px" class="inputbox" type="text" name="date" id="date" size="10" maxlength="10" value="" />
|
1734 |
+
<input type="reset" class="wd_button" value="..." onClick="return showCalendar('date','%Y-%m-%d');" style="width: 31px;" />
|
1735 |
+
</td>
|
1736 |
+
</tr>
|
1737 |
+
<tr>
|
1738 |
+
<td class="key"><label for="selhour_from">Time: </label></td>
|
1739 |
+
<?php if ($calendar->time_format == 1) { ?>
|
1740 |
+
<td>
|
1741 |
+
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right" onKeyPress="return check12hour('selhour_from',event)" value="" title="from"/> <b>:</b>
|
1742 |
+
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right" onKeyPress="return checkminute('selminute_from',event)" value="" onBlur="add_0('selminute_from')" title="from"/>
|
1743 |
+
<select id="select_from" name="select_from">
|
1744 |
+
<option selected="selected">AM</option>
|
1745 |
+
<option>PM</option>
|
1746 |
+
</select>
|
1747 |
+
<span style="font-size:12px"> - </span>
|
1748 |
+
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right" onKeyPress="return check12hour('selhour_to',event)" value="" title="to"/> <b>:</b>
|
1749 |
+
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right" onKeyPress="return checkminute('selminute_to',event)" value="" onBlur="add_0('selminute_to')" title="to"/>
|
1750 |
+
<select id="select_to" name="select_to">
|
1751 |
+
<option>AM</option>
|
1752 |
+
<option>PM</option>
|
1753 |
+
</select>
|
1754 |
+
</td>
|
1755 |
+
<?php } if ($calendar->time_format == 0) { ?>
|
1756 |
+
<td>
|
1757 |
+
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right" onKeyPress="return checkhour('selhour_from',event)" value="" title="from" /> <b>:</b>
|
1758 |
+
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right" onKeyPress="return checkminute('selminute_from',event)" value="" title="from" onBlur="add_0('selminute_from')"/>
|
1759 |
+
<span style="font-size:12px"> - </span>
|
1760 |
+
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right" onKeyPress="return checkhour('selhour_to',event)" value="" title="to" /> <b>:</b>
|
1761 |
+
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right" onKeyPress="return checkminute('selminute_to',event)" value="" title="to" onBlur="add_0('selminute_to')"/>
|
1762 |
+
</td>
|
1763 |
+
<?php }?>
|
1764 |
+
</tr>
|
1765 |
+
<tr>
|
1766 |
+
<td class="key"><label for="poststuff">Note: </label></td>
|
1767 |
+
<td>
|
1768 |
+
<div id="poststuff" style="width:100% !important; min-width: 540px;">
|
1769 |
+
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
1770 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
|
1771 |
+
<?php the_editor(stripslashes(""),"text_for_date","title" ); ?>
|
1772 |
+
</div>
|
1773 |
+
<?php }else{
|
1774 |
+
wp_editor("", "text_for_date"); }?>
|
1775 |
+
</div>
|
1776 |
+
</div>
|
1777 |
+
</td>
|
1778 |
+
</tr>
|
1779 |
+
<tr>
|
1780 |
+
<td class="key"><label for="published1">Published: </label></td>
|
1781 |
+
<td>
|
1782 |
+
<input type="radio" name="published" id="published0" value="0" class="inputbox">
|
1783 |
+
<label for="published0">No</label>
|
1784 |
+
<input type="radio" name="published" id="published1" value="1" checked="checked" class="inputbox">
|
1785 |
+
<label for="published1">Yes</label>
|
1786 |
+
</td>
|
1787 |
+
</tr>
|
1788 |
+
</table>
|
1789 |
+
</fieldset>
|
1790 |
+
</div>
|
1791 |
+
</td>
|
1792 |
+
<td style="padding-left:25px; vertical-align:top !important; width:45%">
|
1793 |
+
<div style="width:100%">
|
1794 |
+
<fieldset class="adminform" style="margin-left: -25px;"><legend>Repeat Event</legend>
|
1795 |
+
<table>
|
1796 |
+
<tr>
|
1797 |
+
<td valign="top">
|
1798 |
+
<input type="radio" id="no_repeat_type" value="no_repeat" name="repeat_method" checked="checked" onChange="change_type('no_repeat')">
|
1799 |
+
<label for="no_repeat_type">Don't repeat this event</label>
|
1800 |
+
<br/>
|
1801 |
+
<input type="radio" id="daily_type" value="daily" name="repeat_method" onChange="change_type('daily');">
|
1802 |
+
<label for="daily_type">Repeat daily</label>
|
1803 |
+
<br/>
|
1804 |
+
<input type="radio" id="weekly_type" value="weekly" name="repeat_method" onChange="change_type('weekly');">
|
1805 |
+
<label for="weekly_type">Repeat weekly</label>
|
1806 |
+
<br/>
|
1807 |
+
<input type="radio" id="monthly_type" value="monthly" name="repeat_method" onChange="change_type('monthly');">
|
1808 |
+
<label for="monthly_type">Repeat monthly</label>
|
1809 |
+
<br/>
|
1810 |
+
<input type="radio" id="yearly_type" value="yearly" name="repeat_method" onChange="change_type('yearly');">
|
1811 |
+
<label for="yearly_type">Repeat yearly</label>
|
1812 |
+
<br/>
|
1813 |
+
</td>
|
1814 |
+
<td style="padding-left:10px" valign="top">
|
1815 |
+
<div id="daily" style="display:none">Repeat every
|
1816 |
+
<input type="text" id="repeat_input" size="5" name="repeat" onClick="return input_repeat()" onKeyPress="return checknumber(repeat_input)" value="1"/>
|
1817 |
+
<label id="repeat"></label>
|
1818 |
+
<label id="year_month" style="display:none;">
|
1819 |
+
<select name="year_month" id="year_month" class="inputbox">
|
1820 |
+
<option value="1" selected="selected">January</option>
|
1821 |
+
<option value="2">February</option>
|
1822 |
+
<option value="3">March</option>
|
1823 |
+
<option value="4">April</option>
|
1824 |
+
<option value="5">May</option>
|
1825 |
+
<option value="6">June</option>
|
1826 |
+
<option value="7">July</option>
|
1827 |
+
<option value="8">August</option>
|
1828 |
+
<option value="9">September</option>
|
1829 |
+
<option value="10">October</option>
|
1830 |
+
<option value="11">November</option>
|
1831 |
+
<option value="12">December</option>
|
1832 |
+
</select>
|
1833 |
+
</label>
|
1834 |
+
</div>
|
1835 |
+
<br/>
|
1836 |
+
<input type="hidden" id="daily1"/>
|
1837 |
+
<input type="hidden" id="weekly1"/>
|
1838 |
+
<input type="hidden" id="monthly1"/>
|
1839 |
+
<input type="hidden" id="yearly1"/>
|
1840 |
+
<div class="key" id="weekly" style="display:none">
|
1841 |
+
<input type="checkbox" value="Mon" id="week_1" onChange="week_value()"/>Mon
|
1842 |
+
<input type="checkbox" value="Tue" id="week_2" onChange="week_value()"/>Tue
|
1843 |
+
<input type="checkbox" value="Wed" id="week_3" onChange="week_value()"/>Wed
|
1844 |
+
<input type="checkbox" value="Thu" id="week_4" onChange="week_value()"/>Thu
|
1845 |
+
<input type="checkbox" value="Fri" id="week_5" onChange="week_value()"/>Fri
|
1846 |
+
<input type="checkbox" value="Sat" id="week_6" onChange="week_value()"/>Sat
|
1847 |
+
<input type="checkbox" value="Sun" id="week_7" onChange="week_value()"/>Sun
|
1848 |
+
<input type="hidden" name="week" id="week"/>
|
1849 |
+
</div>
|
1850 |
+
<br/>
|
1851 |
+
<div class="key" id="monthly" style="display:none">
|
1852 |
+
<input type="radio" id="radio1" onChange="radio_month()" name="month_type" value="1" checked="checked"/>on the:
|
1853 |
+
<input type="text" onKeyPress="return checknumber(month)" name="month" size="3" id="month"/><br/>
|
1854 |
+
<input type="radio" id="radio2" onChange="radio_month()" name="month_type" value="2"/>on the:
|
1855 |
+
<select name="monthly_list" id="monthly_list" class="inputbox">
|
1856 |
+
<option value="1">First</option>
|
1857 |
+
<option value="8">Second</option>
|
1858 |
+
<option value="15">Third</option>
|
1859 |
+
<option value="22">Fourth</option>
|
1860 |
+
<option value="last">Last</option>
|
1861 |
+
</select>
|
1862 |
+
<select name="month_week" id="month_week" class="inputbox">
|
1863 |
+
<option value="Mon">Monday</option>
|
1864 |
+
<option value="Tue">Tuesday</option>
|
1865 |
+
<option value="Wed">Wednesday</option>
|
1866 |
+
<option value="Thu">Thursday</option>
|
1867 |
+
<option value="Fri">Friday</option>
|
1868 |
+
<option value="Sat">Saturday</option>
|
1869 |
+
<option value="Sun">Sunday</option>
|
1870 |
+
</select>
|
1871 |
+
</div>
|
1872 |
+
<br/>
|
1873 |
+
<script>
|
1874 |
+
window.onload = radio_month();
|
1875 |
+
</script>
|
1876 |
+
</td>
|
1877 |
+
</tr>
|
1878 |
+
<tr id="repeat_until" style="display:none">
|
1879 |
+
<td>Repeat until: </td>
|
1880 |
+
<td>
|
1881 |
+
<input style="width:90px" class="inputbox" type="text" name="date_end" id="date_end" size="10" maxlength="10" value=""/>
|
1882 |
+
<input type="reset" class="wd_button" value="..." onClick="return showCalendar('date_end','%Y-%m-%d');"/>
|
1883 |
+
</td>
|
1884 |
+
</tr>
|
1885 |
+
</table>
|
1886 |
+
</fieldset>
|
1887 |
+
</div>
|
1888 |
+
</td>
|
1889 |
+
</tr>
|
1890 |
+
</table>
|
1891 |
+
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
1892 |
+
<input type="hidden" name="option" value="com_spidercalendar"/>
|
1893 |
+
<input type="hidden" name="task" value=""/>
|
1894 |
+
<input type="hidden" name="calendar" value=""/>
|
1895 |
+
</form>
|
1896 |
+
<?php
|
1897 |
+
}
|
1898 |
+
|
1899 |
+
function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
1900 |
+
global $wpdb;
|
1901 |
+
$calendar = $wpdb->get_row($wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where id=%d", $calendar_id ));
|
1902 |
+
|
1903 |
+
?>
|
1904 |
+
<style>
|
1905 |
+
.calendar .button {
|
1906 |
+
display: table-cell !important;
|
1907 |
+
}
|
1908 |
+
fieldset {
|
1909 |
+
border: 2px solid #4f9bc6; /*#CCA383 1462a5*/
|
1910 |
+
width: 100%;
|
1911 |
+
background: #fafbfd;
|
1912 |
+
padding: 13px;
|
1913 |
+
margin-top: 20px;
|
1914 |
+
-webkit-border-radius: 8px;
|
1915 |
+
-moz-border-radius: 8px;
|
1916 |
+
border-radius: 8px;
|
1917 |
+
}
|
1918 |
+
.wd_button{
|
1919 |
+
border: 1px solid #D5D5D5 !important;
|
1920 |
+
border-radius: 10px;
|
1921 |
+
width: 30px;
|
1922 |
+
height: 25px;
|
1923 |
+
}
|
1924 |
+
</style>
|
1925 |
+
<script language="javascript" type="text/javascript">
|
1926 |
+
function submitform(pressbutton) {
|
1927 |
+
if (document.getElementById('title').value == "") {
|
1928 |
+
alert('Provide the title:');
|
1929 |
+
}
|
1930 |
+
else {
|
1931 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
1932 |
+
document.getElementById('adminForm').submit();
|
1933 |
+
}
|
1934 |
+
}
|
1935 |
+
function submitbutton(pressbutton) {
|
1936 |
+
var form = document.adminForm;
|
1937 |
+
if (pressbutton == 'cancel_event') {
|
1938 |
+
submitform(pressbutton);
|
1939 |
+
return;
|
1940 |
+
}
|
1941 |
+
if (form.date.value.search(/^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/)) {
|
1942 |
+
alert('Invalid Date');
|
1943 |
+
}
|
1944 |
+
else if(form.repeat_method.value=="weekly"){
|
1945 |
+
var atLeastOneIsChecked = false;
|
1946 |
+
jQuery('input:checkbox').each(function () {
|
1947 |
+
if (jQuery(this).is(':checked')) {
|
1948 |
+
atLeastOneIsChecked = true;
|
1949 |
+
}
|
1950 |
+
});
|
1951 |
+
if(atLeastOneIsChecked) submitform(pressbutton)
|
1952 |
+
else alert('Invalid Weekday');
|
1953 |
+
}
|
1954 |
+
else if (form.selhour_from.value == "" && form.selminute_from.value == "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1955 |
+
submitform(pressbutton);
|
1956 |
+
}
|
1957 |
+
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1958 |
+
submitform(pressbutton);
|
1959 |
+
}
|
1960 |
+
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value != "" && form.selminute_to.value != "") {
|
1961 |
+
submitform(pressbutton);
|
1962 |
+
}
|
1963 |
+
else {
|
1964 |
+
alert('Invalid Time');
|
1965 |
+
}
|
1966 |
+
}
|
1967 |
+
function checkhour(id,event) {
|
1968 |
+
if (typeof(event) != 'undefined') {
|
1969 |
+
var e = event; // for trans-browser compatibility
|
1970 |
+
var charCode = e.which || e.keyCode;
|
1971 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1972 |
+
return false;
|
1973 |
+
}
|
1974 |
+
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1975 |
+
hour = parseFloat(hour);
|
1976 |
+
if (document.getSelection() != '') {
|
1977 |
+
return true;
|
1978 |
+
}
|
1979 |
+
if ((hour < 0) || (hour > 23)) {
|
1980 |
+
return false;
|
1981 |
+
}
|
1982 |
+
}
|
1983 |
+
return true;
|
1984 |
+
}
|
1985 |
+
function check12hour(id,event) {
|
1986 |
+
if (typeof(event) != 'undefined') {
|
1987 |
+
var e = event; // for trans-browser compatibility
|
1988 |
+
var charCode = e.which || e.keyCode;
|
1989 |
+
input = document.getElementById(id);
|
1990 |
+
if (charCode == 48 && input.value.length == 0) {
|
1991 |
+
return false;
|
1992 |
+
}
|
1993 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1994 |
+
return false;
|
1995 |
+
}
|
1996 |
+
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1997 |
+
hour = parseFloat(hour);
|
1998 |
+
if (document.getSelection() != '') {
|
1999 |
+
return true;
|
2000 |
+
}
|
2001 |
+
if ((hour < 0) || (hour > 12)) {
|
2002 |
+
return false;
|
2003 |
+
}
|
2004 |
+
}
|
2005 |
+
return true;
|
2006 |
+
}
|
2007 |
+
function checknumber(id,event) {
|
2008 |
+
if (typeof(event) != 'undefined') {
|
2009 |
+
var e = event; // for trans-browser compatibility
|
2010 |
+
var charCode = e.which || e.keyCode;
|
2011 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
2012 |
+
return false;
|
2013 |
+
}
|
2014 |
+
}
|
2015 |
+
return true;
|
2016 |
+
}
|
2017 |
+
function checkminute(id,event) {
|
2018 |
+
if (typeof(event) != 'undefined') {
|
2019 |
+
var e = event; // for trans-browser compatibility
|
2020 |
+
var charCode = e.which || e.keyCode;
|
2021 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
2022 |
+
return false;
|
2023 |
+
}
|
2024 |
+
minute = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
2025 |
+
minute = parseFloat(minute);
|
2026 |
+
if (document.getSelection() != '') {
|
2027 |
+
return true;
|
2028 |
+
}
|
2029 |
+
if ((minute < 0) || (minute > 59)) {
|
2030 |
+
return false;
|
2031 |
+
}
|
2032 |
+
}
|
2033 |
+
return true;
|
2034 |
+
}
|
2035 |
+
function add_0(id) {
|
2036 |
+
input = document.getElementById(id);
|
2037 |
+
if (input.value.length == 1) {
|
2038 |
+
input.value = '0' + input.value;
|
2039 |
+
input.setAttribute("value", input.value);
|
2040 |
+
}
|
2041 |
+
}
|
2042 |
+
function change_type(type) {
|
2043 |
+
if (document.getElementById('daily1').value == '') {
|
2044 |
+
document.getElementById('daily1').value = 1;
|
2045 |
+
}
|
2046 |
+
if (document.getElementById('weekly1').value == '') {
|
2047 |
+
document.getElementById('weekly1').value = 1;
|
2048 |
+
}
|
2049 |
+
if (document.getElementById('monthly1').value == '') {
|
2050 |
+
document.getElementById('monthly1').value = 1;
|
2051 |
+
}
|
2052 |
+
if (document.getElementById('yearly1').value == '') {
|
2053 |
+
document.getElementById('yearly1').value = 1;
|
2054 |
+
}
|
2055 |
+
switch (type) {
|
2056 |
+
case 'no_repeat':
|
2057 |
+
document.getElementById('daily').setAttribute('style', 'display:none');
|
2058 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
2059 |
+
document.getElementById('monthly').setAttribute('style', 'display:none');
|
2060 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
2061 |
+
document.getElementById('repeat_until').setAttribute('style', 'display:none');
|
2062 |
+
document.getElementById('month').value = '';
|
2063 |
+
document.getElementById('date_end').value = ''
|
2064 |
+
break;
|
2065 |
+
|
2066 |
+
case 'daily':
|
2067 |
+
document.getElementById('daily').removeAttribute('style');
|
2068 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
2069 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
2070 |
+
document.getElementById('monthly').setAttribute('style', 'display:none');
|
2071 |
+
document.getElementById('repeat').innerHTML = 'Day(s)';
|
2072 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
2073 |
+
return input_value('daily1')
|
2074 |
+
};
|
2075 |
+
document.getElementById('month').value = '';
|
2076 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
2077 |
+
document.getElementById('repeat_input').value = document.getElementById('daily1').value;
|
2078 |
+
break;
|
2079 |
+
|
2080 |
+
case 'weekly':
|
2081 |
+
document.getElementById('daily').removeAttribute('style');
|
2082 |
+
document.getElementById('weekly').removeAttribute('style');
|
2083 |
+
document.getElementById('monthly').setAttribute('style', 'display:none');
|
2084 |
+
document.getElementById('repeat').innerHTML = 'Week(s) on :';
|
2085 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
2086 |
+
return input_value('weekly1')
|
2087 |
+
};
|
2088 |
+
document.getElementById('month').value = '';
|
2089 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
2090 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
2091 |
+
document.getElementById('repeat_input').value = document.getElementById('weekly1').value;
|
2092 |
+
break;
|
2093 |
+
|
2094 |
+
case 'monthly':
|
2095 |
+
document.getElementById('daily').removeAttribute('style');
|
2096 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
2097 |
+
document.getElementById('monthly').removeAttribute('style');
|
2098 |
+
document.getElementById('repeat').innerHTML = 'Month(s)'
|
2099 |
+
document.getElementById('repeat_input').value = document.getElementById('monthly1').value;
|
2100 |
+
document.getElementById('month').value = '';
|
2101 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
2102 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
2103 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
2104 |
+
return input_value('monthly1')
|
2105 |
+
};
|
2106 |
+
break;
|
2107 |
+
|
2108 |
+
case 'yearly':
|
2109 |
+
document.getElementById('daily').removeAttribute('style');
|
2110 |
+
document.getElementById('year_month').removeAttribute('style');
|
2111 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
2112 |
+
document.getElementById('monthly').removeAttribute('style');
|
2113 |
+
document.getElementById('repeat').innerHTML = 'Year(s) in ';
|
2114 |
+
document.getElementById('repeat_input').value = document.getElementById('yearly1').value;
|
2115 |
+
document.getElementById('month').value = '';
|
2116 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
2117 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
2118 |
+
return input_value('yearly1')
|
2119 |
+
};
|
2120 |
+
break;
|
2121 |
+
}
|
2122 |
+
}
|
2123 |
+
function week_value() {
|
2124 |
+
var value = '';
|
2125 |
+
for (i = 1; i <= 7; i++) {
|
2126 |
+
if (document.getElementById('week_' + i).checked) {
|
2127 |
+
value = value + document.getElementById('week_' + i).value + ',';
|
2128 |
+
}
|
2129 |
+
}
|
2130 |
+
document.getElementById('week').value = value;
|
2131 |
+
}
|
2132 |
+
function radio_month() {
|
2133 |
+
if (document.getElementById('radio1').checked == true) {
|
2134 |
+
document.getElementById('monthly_list').disabled = true;
|
2135 |
+
document.getElementById('month_week').disabled = true;
|
2136 |
+
document.getElementById('month').disabled = false;
|
2137 |
+
}
|
2138 |
+
else {
|
2139 |
+
document.getElementById('month').disabled = true;
|
2140 |
+
document.getElementById('monthly_list').disabled = false;
|
2141 |
+
document.getElementById('month_week').disabled = false;
|
2142 |
+
}
|
2143 |
+
}
|
2144 |
+
function input_value(id) {
|
2145 |
+
document.getElementById(id).value = document.getElementById('repeat_input').value;
|
2146 |
+
}
|
2147 |
+
</script>
|
2148 |
+
<?php $query = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.category, " . $wpdb->prefix . "spidercalendar_event_category.title as cattitle FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id");
|
2149 |
+
|
2150 |
+
$query2 = $wpdb->get_results("SELECT title,id FROM " . $wpdb->prefix . "spidercalendar_event_category");
|
2151 |
+
?>
|
2152 |
+
<div class="sp_calendar_upgrade wd-clear" >
|
2153 |
+
<div class="wd-left">
|
2154 |
+
<div style="font-size: 14px;">
|
2155 |
+
<?php _e("This section allows you to create/edit the events of a particular calendar.","sp_calendar");?>
|
2156 |
+
<a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank" href="https://web-dorado.com/wordpress-spider-calendar/creating-editing-events.html"><?php _e("Read More in User Manual.","sp_calendar");?></a>
|
2157 |
+
</div>
|
2158 |
+
</div>
|
2159 |
+
<div class="wd-right">
|
2160 |
+
<div class="wd-table">
|
2161 |
+
<div class="wd-cell wd-cell-valign-middle">
|
2162 |
+
<a href="https://wordpress.org/support/plugin/spider-event-calendar" target="_blank">
|
2163 |
+
<img src="<?php echo plugins_url('images/i_support.png', __FILE__); ?>" >
|
2164 |
+
<?php _e("Support Forum", "sp_calendar"); ?>
|
2165 |
+
</a>
|
2166 |
+
</div>
|
2167 |
+
<div class="wd-cell wd-cell-valign-middle">
|
2168 |
+
<a href="https://web-dorado.com/products/wordpress-calendar.html" target="_blank">
|
2169 |
+
<?php _e("UPGRADE TO PAID VERSION", "sp_calendar"); ?>
|
2170 |
+
</a>
|
2171 |
+
</div>
|
2172 |
+
</div>
|
2173 |
+
|
2174 |
+
</div>
|
2175 |
+
</div>
|
2176 |
+
<table width="95%">
|
2177 |
+
<tbody>
|
2178 |
+
<tr>
|
2179 |
+
<td width="100%"><h2>Edit an event for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
2180 |
+
<td align="right"><input type="button" onClick="submitbutton('save_event')" value="Save" class="button-secondary action"></td>
|
2181 |
+
<td align="right"><input type="button" onClick="submitbutton('apply_event')" value="Apply" class="button-secondary action"></td>
|
2182 |
+
<td align="right"><input type="button" onClick="window.location.href='admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=show_manage_event'" value="Cancel" class="button-secondary action"></td>
|
2183 |
+
</tr>
|
2184 |
+
</tbody>
|
2185 |
+
</table>
|
2186 |
+
|
2187 |
+
<form action="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm">
|
2188 |
+
<table width="95%">
|
2189 |
+
<tr>
|
2190 |
+
<td style="width:45%">
|
2191 |
+
<div style="width:95%">
|
2192 |
+
<fieldset class="adminform">
|
2193 |
+
<legend>Event Details</legend>
|
2194 |
+
<table class="admintable">
|
2195 |
+
<tr>
|
2196 |
+
<td class="key"><label for="message">Title: </label></td>
|
2197 |
+
<td><input type="text" id="title" name="title" size="41" value="<?php echo htmlspecialchars($row->title, ENT_QUOTES); ?>"/></td>
|
2198 |
+
</tr>
|
2199 |
+
<tr>
|
2200 |
+
<td class="key"><label for="category">Select Category: </label></td>
|
2201 |
+
<td>
|
2202 |
+
<select id="category" name="category" style="width:240px">
|
2203 |
+
<option value="0" <?php if ($row->category == "0") echo 'selected="selected"'; ?>><?php if(isset($category)) echo $category->title ?>--Select Category--</option>
|
2204 |
+
<?php foreach ($query2 as $key => $category) {
|
2205 |
+
?>
|
2206 |
+
<option value="<?php echo $category->id; ?>" <?php if ( $category->id == $row->category ) echo 'selected="selected"'; ?>><?php if(isset($category)) echo $category->title ?></option>
|
2207 |
+
<?php
|
2208 |
+
}
|
2209 |
+
?>
|
2210 |
+
|
2211 |
+
</select>
|
2212 |
+
</td>
|
2213 |
+
</tr>
|
2214 |
+
|
2215 |
+
<tr>
|
2216 |
+
<td class="key"><label for="message">Date: </label></td>
|
2217 |
+
<td>
|
2218 |
+
<input class="inputbox" style="width:90px" type="text" name="date" id="date" size="10" maxlength="10" value="<?php echo $row->date; ?>"/>
|
2219 |
+
<?php
|
2220 |
+
if ($row->date_end == '0000-00-00') {
|
2221 |
+
$row->date_end = "";
|
2222 |
+
}
|
2223 |
+
?>
|
2224 |
+
<input type="reset" class="wd_button" value="..." onClick="return showCalendar('date','%Y-%m-%d');"/>
|
2225 |
+
</td>
|
2226 |
+
</tr>
|
2227 |
+
<tr>
|
2228 |
+
<td class="key"><label for="message">Time: </label></td>
|
2229 |
+
<td>
|
2230 |
+
<?php
|
2231 |
+
if (!$row->time) {
|
2232 |
+
$from[0] = "";
|
2233 |
+
$from[1] = "";
|
2234 |
+
$to[0] = "";
|
2235 |
+
$to[1] = "";
|
2236 |
+
}
|
2237 |
+
else {
|
2238 |
+
$from_to = explode("-", $row->time);
|
2239 |
+
$from = explode(":", $from_to[0]);
|
2240 |
+
if (isset($from_to[1])) {
|
2241 |
+
$to = explode(":", $from_to[1]);
|
2242 |
+
}
|
2243 |
+
else {
|
2244 |
+
$to[0] = "";
|
2245 |
+
$to[1] = "";
|
2246 |
+
}
|
2247 |
+
}
|
2248 |
+
?>
|
2249 |
+
<?php if ($calendar->time_format == 0) { ?>
|
2250 |
+
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
2251 |
+
onkeypress="return checkhour('selhour_from',event)" value="<?php echo $from[0]; ?>" title="from" /> <b>:</b>
|
2252 |
+
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
2253 |
+
onkeypress="return checkminute('selminute_from',event)" value="<?php echo substr($from[1], 0, 2); ?>"
|
2254 |
+
title="from" onBlur="add_0('selminute_from')"/> <span style="font-size:12px"> - </span>
|
2255 |
+
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
2256 |
+
onkeypress="return checkhour('selhour_to',event)" value="<?php echo $to[0]; ?>" title="to" /> <b>:</b>
|
2257 |
+
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
2258 |
+
onkeypress="return checkminute('selminute_to',event)" value="<?php echo substr($to[1], 0, 2); ?>"
|
2259 |
+
title="to" onBlur="add_0('selminute_to')"/>
|
2260 |
+
<?php }
|
2261 |
+
if ($calendar->time_format == 1) { ?>
|
2262 |
+
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
2263 |
+
onkeypress="return check12hour('selhour_from',event)" value="<?php echo $from[0]; ?>" title="from"
|
2264 |
+
/> <b>:</b>
|
2265 |
+
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
2266 |
+
onkeypress="return checkminute('selminute_from',event)" value="<?php echo substr($from[1], 0, 2); ?>"
|
2267 |
+
title="from" onBlur="add_0('selminute_from')"/>
|
2268 |
+
<select id="select_from" name="select_from">
|
2269 |
+
<option <?php if (substr($from[1], 2, 2) == "AM")
|
2270 |
+
echo 'selected="selected"'; ?>>AM
|
2271 |
+
</option>
|
2272 |
+
<option <?php if (substr($from[1], 2, 2) == "PM")
|
2273 |
+
echo 'selected="selected"'; ?>>PM
|
2274 |
+
</option>
|
2275 |
+
</select>
|
2276 |
+
<span style="font-size:12px"> - </span>
|
2277 |
+
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
2278 |
+
onkeypress="return check12hour('selhour_to',event)" value="<?php echo $to[0]; ?>" title="to"
|
2279 |
+
/> <b>:</b>
|
2280 |
+
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
2281 |
+
onkeypress="return checkminute('selminute_to',event)" value="<?php echo substr($to[1], 0, 2); ?>"
|
2282 |
+
title="to" onBlur="add_0('selminute_to')"/>
|
2283 |
+
<select id="select_to" name="select_to">
|
2284 |
+
<option <?php if (substr($to[1], 2, 2) == "AM")
|
2285 |
+
echo 'selected="selected"'; ?>>AM
|
2286 |
+
</option>
|
2287 |
+
<option <?php if (substr($to[1], 2, 2) == "PM")
|
2288 |
+
echo 'selected="selected"'; ?>>PM
|
2289 |
+
</option>
|
2290 |
+
</select>
|
2291 |
+
<?php }?>
|
2292 |
+
</td>
|
2293 |
+
</tr>
|
2294 |
+
<tr>
|
2295 |
+
<td class="key"><label for="note">Note: </label></td>
|
2296 |
+
<td>
|
2297 |
+
<div id="poststuff" style="width:100% !important; min-width: 540px;">
|
2298 |
+
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
2299 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor(stripslashes($row->description),"text_for_date","title" ); ?>
|
2300 |
+
</div>
|
2301 |
+
<?php }else{
|
2302 |
+
if(isset($row->text_for_date)) $desc1 = $row->text_for_date;
|
2303 |
+
else $desc1 = "";
|
2304 |
+
wp_editor($desc1, "text_for_date"); }?>
|
2305 |
+
</div>
|
2306 |
+
</div>
|
2307 |
+
</td>
|
2308 |
+
</tr>
|
2309 |
+
<tr>
|
2310 |
+
<td class="key"><label for="note">Published: </label></td>
|
2311 |
+
<td>
|
2312 |
+
<input type="radio" name="published" id="published0" value="0" <?php cheched($row->published, '0'); ?> class="inputbox">
|
2313 |
+
<label for="published0">No</label>
|
2314 |
+
<input type="radio" name="published" id="published1" value="1" <?php cheched($row->published, '1'); ?> class="inputbox">
|
2315 |
+
<label for="published1">Yes</label>
|
2316 |
+
</td>
|
2317 |
+
</tr>
|
2318 |
+
</table>
|
2319 |
+
</fieldset>
|
2320 |
+
</div>
|
2321 |
+
</td>
|
2322 |
+
<td style="padding-left:25px; vertical-align:top !important; width:45%">
|
2323 |
+
<div style="width:100%">
|
2324 |
+
<fieldset class="adminform" style="margin-left: -25px;">
|
2325 |
+
<legend>Repeat Event</legend>
|
2326 |
+
<table>
|
2327 |
+
<tr>
|
2328 |
+
<td valign="top">
|
2329 |
+
<input type="radio" value="no_repeat" id="no_repeat_type" name="repeat_method" <?php if ($row->repeat_method == 'no_repeat')
|
2330 |
+
echo 'checked="checked"' ?> checked="checked" onChange="change_type('no_repeat')"/>
|
2331 |
+
<label for="no_repeat_type">Don't repeat this event</label><br/>
|
2332 |
+
|
2333 |
+
<input type="radio" value="daily" id="daily_type" name="repeat_method" <?php if ($row->repeat_method == 'daily')
|
2334 |
+
echo 'checked="checked"' ?> onchange="change_type('daily')"/>
|
2335 |
+
<label for="daily_type">Repeat daily</label><br/>
|
2336 |
+
|
2337 |
+
<input type="radio" value="weekly" id="weekly_type" name="repeat_method" <?php if ($row->repeat_method == 'weekly')
|
2338 |
+
echo 'checked="checked"' ?> onChange="change_type('weekly')"/>
|
2339 |
+
<label for="weekly_type">Repeat weekly</label>
|
2340 |
+
<br/>
|
2341 |
+
<input type="radio" value="monthly" id="monthly_type" name="repeat_method" <?php if ($row->repeat_method == 'monthly')
|
2342 |
+
echo 'checked="checked"'?> onChange="change_type('monthly')"/>
|
2343 |
+
<label for="monthly_type">Repeat monthly</label>
|
2344 |
+
<br/>
|
2345 |
+
<input type="radio" value="yearly" id="yearly_type" name="repeat_method" <?php if ($row->repeat_method == 'yearly')
|
2346 |
+
echo 'checked="checked"' ?> onChange="change_type('yearly')"/>
|
2347 |
+
<label for="yearly_type">Repeat yearly</label>
|
2348 |
+
<br/>
|
2349 |
+
</td>
|
2350 |
+
<td style="padding-left:10px" valign="top">
|
2351 |
+
<div id="daily" style="display:<?php if ($row->repeat_method == 'no_repeat') echo 'none'; ?>">
|
2352 |
+
Repeat every <input type="text" id="repeat_input" size="5" name="repeat" onKeyPress="return checknumber(repeat_input)" value="<?php echo $row->repeat ?>"/>
|
2353 |
+
<label id="repeat"><?php if ($row->repeat_method == 'daily')
|
2354 |
+
echo 'Day(s)';
|
2355 |
+
if ($row->repeat_method == 'weekly')
|
2356 |
+
echo 'Week(s) on :';
|
2357 |
+
if ($row->repeat_method == 'monthly')
|
2358 |
+
echo 'Month(s)';
|
2359 |
+
if ($row->repeat_method == 'yearly')
|
2360 |
+
echo 'Year(s) in';
|
2361 |
+
?></label>
|
2362 |
+
<label id="year_month" style="display:<?php if ($row->repeat_method != 'yearly') echo 'none'; ?>">
|
2363 |
+
<select name="year_month" id="year_month" class="inputbox">
|
2364 |
+
<option value="1" <?php echo selectted($row->year_month, '1'); ?>>January</option>
|
2365 |
+
<option value="2" <?php echo selectted($row->year_month, '2'); ?>>February</option>
|
2366 |
+
<option value="3" <?php echo selectted($row->year_month, '3'); ?>>March</option>
|
2367 |
+
<option value="4" <?php echo selectted($row->year_month, '4'); ?>>April</option>
|
2368 |
+
<option value="5" <?php echo selectted($row->year_month, '5'); ?>>May</option>
|
2369 |
+
<option value="6" <?php echo selectted($row->year_month, '6'); ?>>June</option>
|
2370 |
+
<option value="7" <?php echo selectted($row->year_month, '7'); ?>>July</option>
|
2371 |
+
<option value="8" <?php echo selectted($row->year_month, '8'); ?>>August</option>
|
2372 |
+
<option value="9" <?php echo selectted($row->year_month, '9'); ?>>September</option>
|
2373 |
+
<option value="10" <?php echo selectted($row->year_month, '10'); ?>>October</option>
|
2374 |
+
<option value="11" <?php echo selectted($row->year_month, '11'); ?>>November</option>
|
2375 |
+
<option value="12" <?php echo selectted($row->year_month, '12'); ?>>December</option>
|
2376 |
+
</select></label>
|
2377 |
+
<input type="hidden" value="<?php if ($row->repeat_method == 'daily') echo $row->repeat; ?>" id="daily1"/>
|
2378 |
+
<input type="hidden" value="<?php if ($row->repeat_method == 'weekly') echo $row->repeat; ?>" id="weekly1"/>
|
2379 |
+
<input type="hidden" value="<?php if ($row->repeat_method == 'monthly') echo $row->repeat; ?>" id="monthly1"/>
|
2380 |
+
<input type="hidden" value="<?php if ($row->repeat_method == 'yearly') echo $row->repeat; ?>" id="yearly1"/>
|
2381 |
+
</div>
|
2382 |
+
<br/>
|
2383 |
+
<div class="key" id="weekly" style="display:<?php if ($row->repeat_method != 'weekly') echo 'none'; ?>">
|
2384 |
+
<input type="checkbox" value="Mon" id="week_1" onChange="week_value()" <?php if (in_array('Mon', explode(',', $row->week))) echo 'checked="checked"' ?> />Mon
|
2385 |
+
<input type="checkbox" value="Tue" id="week_2" onChange="week_value()" <?php if (in_array('Tue', explode(',', $row->week))) echo 'checked="checked"' ?> />Tue
|
2386 |
+
<input type="checkbox" value="Wed" id="week_3" onChange="week_value()" <?php if (in_array('Wed', explode(',', $row->week))) echo 'checked="checked"' ?> />Wed
|
2387 |
+
<input type="checkbox" value="Thu" id="week_4" onChange="week_value()" <?php if (in_array('Thu', explode(',', $row->week))) echo 'checked="checked"' ?> />Thu
|
2388 |
+
<input type="checkbox" value="Fri" id="week_5" onChange="week_value()" <?php if (in_array('Fri', explode(',', $row->week))) echo 'checked="checked"' ?> />Fri
|
2389 |
+
<input type="checkbox" value="Sat" id="week_6" onChange="week_value()" <?php if (in_array('Sat', explode(',', $row->week))) echo 'checked="checked"' ?> />Sat
|
2390 |
+
<input type="checkbox" value="Sun" id="week_7" onChange="week_value()" <?php if (in_array('Sun', explode(',', $row->week))) echo 'checked="checked"' ?> />Sun
|
2391 |
+
<input type="hidden" name="week" id="week" value="<?php echo $row->week ?>"/>
|
2392 |
+
</div>
|
2393 |
+
<br/>
|
2394 |
+
<div class="key" id="monthly" style="display:<?php if ($row->repeat_method != 'monthly' && $row->repeat_method != 'yearly') echo 'none'; ?>">
|
2395 |
+
<input type="radio" id="radio1" name="month_type" onChange="radio_month()" value="1" checked="checked" <?php if ($row->month_type == 1)
|
2396 |
+
echo 'checked="checked"' ?> />on the: <input type="text" name="month" size="3" onKeyPress="return checknumber(month)" id="month"
|
2397 |
+
value="<?php echo $row->month; ?>"/><br/>
|
2398 |
+
<input type="radio" id="radio2" name="month_type" onChange="radio_month()" value="2" <?php if ($row->month_type == 2) echo 'checked="checked"'; ?> />on the:
|
2399 |
+
<select name="monthly_list" id="monthly_list" class="inputbox">
|
2400 |
+
<option <?php echo selectted($row->monthly_list, '1'); ?> value="1">First</option>
|
2401 |
+
<option <?php echo selectted($row->monthly_list, '8'); ?> value="8">Second</option>
|
2402 |
+
<option <?php echo selectted($row->monthly_list, '15'); ?> value="15">Third</option>
|
2403 |
+
<option <?php echo selectted($row->monthly_list, '22'); ?> value="22">Fourth</option>
|
2404 |
+
<option <?php echo selectted($row->monthly_list, 'last'); ?> value="last">Last</option>
|
2405 |
+
</select>
|
2406 |
+
<select name="month_week" id="month_week" class="inputbox">
|
2407 |
+
<option <?php echo selectted($row->month_week, 'Mon'); ?> value="Mon">Monday</option>
|
2408 |
+
<option <?php echo selectted($row->month_week, 'Tue'); ?> value="Tue">Tuesday</option>
|
2409 |
+
<option <?php echo selectted($row->month_week, 'Wed'); ?> value="Wed">Wednesday</option>
|
2410 |
+
<option <?php echo selectted($row->month_week, 'Thu'); ?> value="Thu">Thursday</option>
|
2411 |
+
<option <?php echo selectted($row->month_week, 'Fri'); ?> value="Fri">Friday</option>
|
2412 |
+
<option <?php echo selectted($row->month_week, 'Sat'); ?> value="Sat">Saturday</option>
|
2413 |
+
<option <?php echo selectted($row->month_week, 'Sun'); ?> value="Sun">Sunday</option>
|
2414 |
+
</select>
|
2415 |
+
</div>
|
2416 |
+
<br/>
|
2417 |
+
<script>
|
2418 |
+
window.onload = radio_month();
|
2419 |
+
</script>
|
2420 |
+
</td>
|
2421 |
+
</tr>
|
2422 |
+
<tr id="repeat_until" style="display:<?php if ($row->repeat_method == 'no_repeat') echo 'none'; ?>">
|
2423 |
+
<td>Repeat until: </td>
|
2424 |
+
<?php
|
2425 |
+
if ($row->date_end == '2035-12-12') {
|
2426 |
+
$row->date_end = '';
|
2427 |
+
}
|
2428 |
+
?>
|
2429 |
+
<td>
|
2430 |
+
<input style="width:90px" class="inputbox" type="text" name="date_end" id="date_end" size="10" maxlength="10" value="<?php echo $row->date_end; ?>"/>
|
2431 |
+
<input type="reset" class="wd_button" value="..." onClick="return showCalendar('date_end','%Y-%m-%d');"/>
|
2432 |
+
</td>
|
2433 |
+
</tr>
|
2434 |
+
</table>
|
2435 |
+
</fieldset>
|
2436 |
+
</div>
|
2437 |
+
</td>
|
2438 |
+
</tr>
|
2439 |
+
</table>
|
2440 |
+
<?php wp_nonce_field('nonce_sp_cal', 'nonce_sp_cal'); ?>
|
2441 |
+
<input type="hidden" name="option" value="com_spidercalendar"/>
|
2442 |
+
<input type="hidden" name="id" value="<?php echo $row->id; ?>"/>
|
2443 |
+
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
2444 |
+
<input type="hidden" name="task" value="event"/>
|
2445 |
+
<input type="hidden" name="calendar" value=""/>
|
2446 |
</form> <?php } ?>
|
calendar_functions.php
CHANGED
@@ -1,724 +1,724 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (function_exists('current_user_can')) {
|
4 |
-
if (!current_user_can('manage_options')) {
|
5 |
-
die('Access Denied');
|
6 |
-
}
|
7 |
-
}
|
8 |
-
|
9 |
-
function add_spider_calendar() {
|
10 |
-
html_add_spider_calendar();
|
11 |
-
}
|
12 |
-
|
13 |
-
function copy_spider_event($calendar_id, $id) {
|
14 |
-
global $wpdb;
|
15 |
-
$query = $wpdb->prepare ('INSERT INTO `'.$wpdb->prefix . 'spidercalendar_event`(`calendar`, `date`, `date_end`, `title`, `category`, `time`, `text_for_date`, `userID`, `repeat_method`, `repeat`, `week`, `month`, `month_type`, `monthly_list`, `month_week`, `year_month`, `published`) SELECT `calendar`, `date`, `date_end`, `title`, `category`, `time`, `text_for_date`, `userID`, `repeat_method`, `repeat`, `week`, `month`, `month_type`, `monthly_list`, `month_week`, `year_month`, `published` FROM `'.$wpdb->prefix . 'spidercalendar_event` WHERE `id` = "%d"', $id );
|
16 |
-
if (!$wpdb->query($query)) {
|
17 |
-
?>
|
18 |
-
<div id="message" class="error"><p>Event copy was not created.</p></div>
|
19 |
-
<?php
|
20 |
-
}
|
21 |
-
else {
|
22 |
-
?>
|
23 |
-
<div class="updated"><p><strong>Event successfully copied.</strong></p></div>
|
24 |
-
<?php
|
25 |
-
}
|
26 |
-
}
|
27 |
-
|
28 |
-
function spider_upcoming(){
|
29 |
-
if(isset($_GET['upcalendar_id']))
|
30 |
-
$calendar_id=(int)$_GET['upcalendar_id'];
|
31 |
-
else $calendar_id="0";
|
32 |
-
|
33 |
-
global $wpdb;
|
34 |
-
$order = "title";
|
35 |
-
$asc_desc = "ASC";
|
36 |
-
$order_by = "";
|
37 |
-
$sort["default_style"] = "manage-column column-autor sortable desc";
|
38 |
-
$sort["sortid_by"] = "title";
|
39 |
-
$sort["custom_style"] = "manage-column column-title sorted asc";
|
40 |
-
$sort["1_or_2"] = "2";
|
41 |
-
if (isset($_POST['page_number'])) {
|
42 |
-
if (esc_html($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
43 |
-
if (isset($_POST['order_by'])) {
|
44 |
-
$sort["sortid_by"] = esc_sql(esc_html($_POST['order_by']));
|
45 |
-
}
|
46 |
-
$sort["custom_style"] = "manage-column column-title sorted asc";
|
47 |
-
$sort["1_or_2"] = "2";
|
48 |
-
$order = esc_sql(esc_html($sort["sortid_by"]));
|
49 |
-
$asc_desc = "ASC";
|
50 |
-
}
|
51 |
-
else {
|
52 |
-
$sort["custom_style"] = "manage-column column-title sorted desc";
|
53 |
-
$sort["1_or_2"] = "1";
|
54 |
-
$order = esc_sql(esc_html($sort["sortid_by"]));
|
55 |
-
$asc_desc = "DESC";
|
56 |
-
}
|
57 |
-
if ($_POST['page_number']) {
|
58 |
-
$limit = (esc_sql(esc_html(stripslashes($_POST['page_number'])))- 1) * 20;
|
59 |
-
}
|
60 |
-
else {
|
61 |
-
$limit = 0;
|
62 |
-
}
|
63 |
-
}
|
64 |
-
else {
|
65 |
-
$limit = 0;
|
66 |
-
}
|
67 |
-
if (isset($_POST['search_events_by_title'])) {
|
68 |
-
$search_tag = esc_sql(esc_html(stripslashes($_POST['search_events_by_title'])));
|
69 |
-
}
|
70 |
-
else {
|
71 |
-
$search_tag = "";
|
72 |
-
}
|
73 |
-
|
74 |
-
if ($search_tag) {
|
75 |
-
$where = ' AND ' . $wpdb->prefix . 'spidercalendar_event.title LIKE "%%' . esc_sql(esc_html($search_tag)) . '%%"';
|
76 |
-
}
|
77 |
-
else {
|
78 |
-
$where = '';
|
79 |
-
}
|
80 |
-
if (isset($_POST['startdate']) && esc_html($_POST['startdate'])) {
|
81 |
-
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date > \'' . esc_sql(esc_html($_POST['startdate'])) . '\' ';
|
82 |
-
}
|
83 |
-
if (isset($_POST['enddate']) && esc_html($_POST['enddate'])) {
|
84 |
-
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date < \'' . esc_sql(esc_html($_POST['enddate'])) . '\' ';
|
85 |
-
}
|
86 |
-
// Get the total number of records.
|
87 |
-
|
88 |
-
$query = $wpdb->prepare ("SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=%d " . $where . " ",$calendar_id );
|
89 |
-
|
90 |
-
$total = $wpdb->get_var($query);
|
91 |
-
$pageNav['total'] = $total;
|
92 |
-
$pageNav['limit'] = $limit / 20 + 1;
|
93 |
-
|
94 |
-
if( $order == "id" || $order == "title" || $order == "date" || $order == "time" ) $order_by = " ORDER BY " . $order . " " . $asc_desc;
|
95 |
-
$query = $wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=%d " . $where . " " . $order_by . " " . " LIMIT %d,20",$calendar_id,$limit);
|
96 |
-
|
97 |
-
$rows=$wpdb->get_results($query);
|
98 |
-
|
99 |
-
|
100 |
-
html_upcoming_widget($rows, $pageNav, $sort);
|
101 |
-
|
102 |
-
}
|
103 |
-
|
104 |
-
|
105 |
-
function show_spider_calendar() {
|
106 |
-
global $wpdb;
|
107 |
-
$order = "title";
|
108 |
-
$asc_desc = "ASC";
|
109 |
-
$order_by = "";
|
110 |
-
|
111 |
-
$sort["default_style"] = "manage-column column-autor sortable desc";
|
112 |
-
$sort["sortid_by"] = "title";
|
113 |
-
$sort["custom_style"] = "manage-column column-title sorted asc";
|
114 |
-
$sort["1_or_2"] = "2";
|
115 |
-
if (isset($_POST['page_number'])) {
|
116 |
-
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
117 |
-
$sort["sortid_by"] = esc_sql(esc_html(stripslashes($_POST['order_by'])));
|
118 |
-
}
|
119 |
-
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
120 |
-
$sort["custom_style"] = "manage-column column-title sorted asc";
|
121 |
-
$sort["1_or_2"] = "2";
|
122 |
-
$order = esc_sql(esc_html($sort["sortid_by"]));
|
123 |
-
$asc_desc = "ASC";
|
124 |
-
}
|
125 |
-
else {
|
126 |
-
$sort["custom_style"] = "manage-column column-title sorted desc";
|
127 |
-
$sort["1_or_2"] = "1";
|
128 |
-
$order = esc_sql(esc_html($sort["sortid_by"]));
|
129 |
-
$asc_desc = "DESC";
|
130 |
-
}
|
131 |
-
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
132 |
-
$limit = (esc_sql(esc_html(stripslashes($_POST['page_number']))) - 1) * 20;
|
133 |
-
}
|
134 |
-
else {
|
135 |
-
$limit = 0;
|
136 |
-
}
|
137 |
-
}
|
138 |
-
else {
|
139 |
-
$limit = 0;
|
140 |
-
}
|
141 |
-
if (isset($_POST['search_events_by_title'])) {
|
142 |
-
$search_tag = esc_sql(esc_html(stripslashes($_POST['search_events_by_title'])));
|
143 |
-
}
|
144 |
-
else {
|
145 |
-
$search_tag = "";
|
146 |
-
}
|
147 |
-
if ($search_tag) {
|
148 |
-
$where = ' WHERE title LIKE "%%' . esc_sql(esc_html($search_tag)) . '%%"';
|
149 |
-
}
|
150 |
-
else {
|
151 |
-
$where = ' ';
|
152 |
-
}
|
153 |
-
// Get the total number of records.
|
154 |
-
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_calendar" . str_replace('%%','%',$where);
|
155 |
-
$total = $wpdb->get_var($query);
|
156 |
-
$pageNav['total'] = $total;
|
157 |
-
$pageNav['limit'] = $limit / 20 + 1;
|
158 |
-
|
159 |
-
if( $order == "id" || $order == "title" || $order == "published" )
|
160 |
-
$order_by = " ORDER BY " . $order . " " . $asc_desc;
|
161 |
-
$query = $wpdb->prepare ( "SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar" . $where . " " . $order_by . " " . " LIMIT %d,20",$limit);
|
162 |
-
$rows = $wpdb->get_results($query);
|
163 |
-
// display function
|
164 |
-
html_show_spider_calendar($rows, $pageNav, $sort);
|
165 |
-
}
|
166 |
-
|
167 |
-
function show_event_cat(){
|
168 |
-
global $wpdb;
|
169 |
-
$order = "title";
|
170 |
-
$asc_desc = "ASC";
|
171 |
-
$order_by = "";
|
172 |
-
$sort["default_style"] = "manage-column column-autor sortable desc";
|
173 |
-
$sort["sortid_by"] = "title";
|
174 |
-
$sort["custom_style"] = "manage-column column-title sorted asc";
|
175 |
-
$sort["1_or_2"] = "2";
|
176 |
-
if (isset($_POST['page_number'])) {
|
177 |
-
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
178 |
-
$sort["sortid_by"] = esc_sql(esc_html(stripslashes($_POST['order_by'])));
|
179 |
-
}
|
180 |
-
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
181 |
-
$sort["custom_style"] = "manage-column column-title sorted asc";
|
182 |
-
$sort["1_or_2"] = "2";
|
183 |
-
$order = esc_sql(esc_html($sort["sortid_by"]));
|
184 |
-
$asc_desc = "ASC";
|
185 |
-
}
|
186 |
-
else {
|
187 |
-
$sort["custom_style"] = "manage-column column-title sorted desc";
|
188 |
-
$sort["1_or_2"] = "1";
|
189 |
-
$order = esc_sql(esc_html($sort["sortid_by"]));
|
190 |
-
$asc_desc = "DESC";
|
191 |
-
}
|
192 |
-
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
193 |
-
$limit = (esc_sql(esc_html(stripslashes($_POST['page_number']))) - 1) * 20;
|
194 |
-
}
|
195 |
-
else {
|
196 |
-
$limit = 0;
|
197 |
-
}
|
198 |
-
}
|
199 |
-
else {
|
200 |
-
$limit = 0;
|
201 |
-
}
|
202 |
-
if (isset($_POST['search_cat_by_title'])) {
|
203 |
-
$search_tag = esc_sql(esc_html(stripslashes($_POST['search_cat_by_title'])));
|
204 |
-
}
|
205 |
-
else {
|
206 |
-
$search_tag = "";
|
207 |
-
}
|
208 |
-
if ($search_tag) {
|
209 |
-
$where = ' WHERE title LIKE "%%' . esc_sql(esc_html($search_tag)) . '%%"';
|
210 |
-
}
|
211 |
-
else {
|
212 |
-
$where = ' ';
|
213 |
-
}
|
214 |
-
// Get the total number of records.
|
215 |
-
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event_category" . str_replace('%%','%',$where);
|
216 |
-
$total = $wpdb->get_var($query);
|
217 |
-
$pageNav['total'] = $total;
|
218 |
-
$pageNav['limit'] = $limit / 20 + 1;
|
219 |
-
if( $order == "id" || $order == "title" || $order == "published" || $order == "description" )
|
220 |
-
$order_by = " ORDER BY " . $order . " " . $asc_desc;
|
221 |
-
$query =$wpdb->prepare ( "SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category" . $where . " " . $order_by . " " . " LIMIT %d,20",$limit);
|
222 |
-
|
223 |
-
$rows = $wpdb->get_results($query);
|
224 |
-
// display function
|
225 |
-
show_event_category($rows, $pageNav, $sort);
|
226 |
-
|
227 |
-
}
|
228 |
-
|
229 |
-
|
230 |
-
// Edit calendar.
|
231 |
-
function edit_spider_calendar($id) {
|
232 |
-
global $wpdb;
|
233 |
-
$row = $wpdb->get_row($wpdb->prepare ('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE id=%d',$id));
|
234 |
-
html_edit_spider_calendar($row);
|
235 |
-
}
|
236 |
-
|
237 |
-
// Delete calendar.
|
238 |
-
function remove_spider_calendar($id) {
|
239 |
-
global $wpdb;
|
240 |
-
$sql_remov_vid = $wpdb->prepare ("DELETE FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id=%d", $id);
|
241 |
-
$sql_remov_eve = $wpdb->prepare ("DELETE FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=%d", $id);
|
242 |
-
if (!$wpdb->query($sql_remov_vid)) {
|
243 |
-
?>
|
244 |
-
<div id="message" class="error"><p>Calendar Not Deleted.</p></div>
|
245 |
-
<?php
|
246 |
-
}
|
247 |
-
else {
|
248 |
-
?>
|
249 |
-
<div class="updated"><p><strong>Calendar Deleted.</strong></p></div>
|
250 |
-
<?php
|
251 |
-
$count_eve = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE `calendar`="%d"', $id));
|
252 |
-
if ($count_eve) {
|
253 |
-
if (!$wpdb->query($sql_remov_eve)) {
|
254 |
-
?>
|
255 |
-
<div id="message" class="error"><p>Events Not Deleted.</p></div>
|
256 |
-
<?php
|
257 |
-
}
|
258 |
-
}
|
259 |
-
}
|
260 |
-
}
|
261 |
-
|
262 |
-
|
263 |
-
//Save Category Event
|
264 |
-
|
265 |
-
function save_spider_category_event() {
|
266 |
-
/*
|
267 |
-
if (!$id) {
|
268 |
-
echo '<h1 style="color:#00C">Error. ID does not exist.</h1>';
|
269 |
-
exit;
|
270 |
-
}
|
271 |
-
*/
|
272 |
-
if(isset($_POST['title'])){
|
273 |
-
$title = (isset($_POST["title"]) ? esc_sql(esc_html(stripslashes($_POST["title"]))) : '');
|
274 |
-
$published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
|
275 |
-
$color = (isset($_POST["color"]) ? esc_sql(esc_html(stripslashes($_POST["color"]))) : '');
|
276 |
-
$description = preg_replace('#<script(.*?)>(.*?)</script>#is', '', stripslashes($_POST["description"]));
|
277 |
-
global $wpdb;
|
278 |
-
|
279 |
-
$save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_event_category', array(
|
280 |
-
'id' => NULL,
|
281 |
-
'title' => $title,
|
282 |
-
'published' => $published,
|
283 |
-
'color' => $color,
|
284 |
-
'description' => $description,
|
285 |
-
), array(
|
286 |
-
'%d',
|
287 |
-
'%s',
|
288 |
-
'%d',
|
289 |
-
'%s',
|
290 |
-
'%s'
|
291 |
-
));
|
292 |
-
}
|
293 |
-
}
|
294 |
-
|
295 |
-
|
296 |
-
// Publish/Unpublish category.
|
297 |
-
function spider_category_published($id) {
|
298 |
-
global $wpdb;
|
299 |
-
$publish = $wpdb->get_var($wpdb->prepare('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_event_category WHERE `id`="%d"', $id));
|
300 |
-
if ($publish) {
|
301 |
-
$publish = 0;
|
302 |
-
$publish_unpublish = 'Category unpublished.';
|
303 |
-
}
|
304 |
-
else {
|
305 |
-
$publish = 1;
|
306 |
-
$publish_unpublish = 'Category published.';
|
307 |
-
}
|
308 |
-
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event_category', array(
|
309 |
-
'published' => $publish,
|
310 |
-
), array('id' => $id), array(
|
311 |
-
'%d',
|
312 |
-
));
|
313 |
-
|
314 |
-
if ($save_or_no !== FALSE) {
|
315 |
-
?>
|
316 |
-
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
317 |
-
<?php
|
318 |
-
}
|
319 |
-
}
|
320 |
-
|
321 |
-
|
322 |
-
//Apply category event
|
323 |
-
|
324 |
-
function apply_spider_category_event($id) {
|
325 |
-
|
326 |
-
$title = (isset($_POST["title"]) ? esc_sql(esc_html(stripslashes($_POST["title"]))) : '');
|
327 |
-
$published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
|
328 |
-
$color = (isset($_POST["color"]) ? esc_sql(esc_html(stripslashes($_POST["color"]))) : '');
|
329 |
-
$description = preg_replace('#<script(.*?)>(.*?)</script>#is', '', stripslashes($_POST["description"]));
|
330 |
-
global $wpdb;
|
331 |
-
|
332 |
-
|
333 |
-
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event_category', array(
|
334 |
-
'title' => $title,
|
335 |
-
'published' => $published,
|
336 |
-
'color' => $color,
|
337 |
-
'description' => $description,
|
338 |
-
), array('id' => $_POST['id']), array(
|
339 |
-
'%s',
|
340 |
-
'%d',
|
341 |
-
'%s',
|
342 |
-
'%s'
|
343 |
-
));
|
344 |
-
|
345 |
-
}
|
346 |
-
|
347 |
-
// Save calendar.
|
348 |
-
function apply_spider_calendar($id) {
|
349 |
-
if (!$id) {
|
350 |
-
echo '<h1 style="color:#00C">Error. ID does not exist.</h1>';
|
351 |
-
exit;
|
352 |
-
}
|
353 |
-
if(isset($_POST['title'])){
|
354 |
-
$title = (isset($_POST["title"]) ? esc_sql(esc_html(stripslashes($_POST["title"]))) : '');
|
355 |
-
$user_type = (isset($_POST["user_type"]) ? esc_sql(esc_html(stripslashes($_POST["user_type"]))) : '');
|
356 |
-
$time_format = (isset($_POST["time_format"]) ? (int) $_POST["time_format"] : 0);
|
357 |
-
$def_year = (isset($_POST["def_year"]) ? esc_sql(esc_html(stripslashes($_POST["def_year"]))) : '');
|
358 |
-
$def_month = (isset($_POST["def_month"]) ? esc_sql(esc_html(stripslashes($_POST["def_month"]))) : '');
|
359 |
-
$def_zone = (isset($_POST["def_zone"]) ? esc_sql(esc_html(stripslashes($_POST["def_zone"]))) : '');
|
360 |
-
$allow_publish = (isset($_POST["allow_publish"]) ? esc_sql(esc_html(stripslashes($_POST["allow_publish"]))) : '');
|
361 |
-
$published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
|
362 |
-
global $wpdb;
|
363 |
-
if ($id === -1) {
|
364 |
-
|
365 |
-
$save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_calendar', array(
|
366 |
-
'id' => NULL,
|
367 |
-
'title' => $title,
|
368 |
-
'gid' => $user_type,
|
369 |
-
'def_year' => $def_year,
|
370 |
-
'def_month' => $def_month,
|
371 |
-
'def_zone' => $def_zone,
|
372 |
-
'time_format' => $time_format,
|
373 |
-
'allow_publish' => $allow_publish,
|
374 |
-
'published' => $published,
|
375 |
-
), array(
|
376 |
-
'%d',
|
377 |
-
'%s',
|
378 |
-
'%s',
|
379 |
-
'%s',
|
380 |
-
'%s',
|
381 |
-
'%s',
|
382 |
-
'%s',
|
383 |
-
'%s',
|
384 |
-
'%d'
|
385 |
-
));
|
386 |
-
|
387 |
-
}
|
388 |
-
else {
|
389 |
-
|
390 |
-
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_calendar', array(
|
391 |
-
'title' => $title,
|
392 |
-
'gid' => $user_type,
|
393 |
-
'time_format' => $time_format,
|
394 |
-
'def_year' => $def_year,
|
395 |
-
'def_month' => $def_month,
|
396 |
-
'def_zone' => $def_zone,
|
397 |
-
'allow_publish' => $allow_publish,
|
398 |
-
'published' => $published,
|
399 |
-
), array('id' => $id), array(
|
400 |
-
'%s',
|
401 |
-
'%s',
|
402 |
-
'%d',
|
403 |
-
'%s',
|
404 |
-
'%s',
|
405 |
-
'%s',
|
406 |
-
'%s',
|
407 |
-
'%d'
|
408 |
-
));
|
409 |
-
}
|
410 |
-
if ($save_or_no === FALSE) {
|
411 |
-
?>
|
412 |
-
<div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
|
413 |
-
<?php
|
414 |
-
return FALSE;
|
415 |
-
}
|
416 |
-
else {
|
417 |
-
?>
|
418 |
-
<div class="updated"><p><strong>Calendar Saved.</strong></p></div>
|
419 |
-
<?php
|
420 |
-
return TRUE;
|
421 |
-
}
|
422 |
-
}
|
423 |
-
}
|
424 |
-
|
425 |
-
// Publish/Unpublish calendar.
|
426 |
-
function spider_calendar_published($id) {
|
427 |
-
global $wpdb;
|
428 |
-
$publish = $wpdb->get_var($wpdb->prepare('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $id));
|
429 |
-
if ($publish) {
|
430 |
-
$publish = 0;
|
431 |
-
$publish_unpublish = 'Calendar unpublished.';
|
432 |
-
}
|
433 |
-
else {
|
434 |
-
$publish = 1;
|
435 |
-
$publish_unpublish = 'Calendar published.';
|
436 |
-
}
|
437 |
-
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_calendar', array(
|
438 |
-
'published' => $publish,
|
439 |
-
), array('id' => $id), array(
|
440 |
-
'%d',
|
441 |
-
));
|
442 |
-
if ($save_or_no !== FALSE) {
|
443 |
-
?>
|
444 |
-
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
445 |
-
<?php
|
446 |
-
}
|
447 |
-
}
|
448 |
-
|
449 |
-
// Event in table
|
450 |
-
function show_spider_event($calendar_id) {
|
451 |
-
global $wpdb;
|
452 |
-
$order = "title";
|
453 |
-
$asc_desc = "ASC";
|
454 |
-
$order_by = "";
|
455 |
-
$sort["default_style"] = "manage-column column-autor sortable desc";
|
456 |
-
$sort["sortid_by"] = "title";
|
457 |
-
$sort["custom_style"] = "manage-column column-title sorted asc";
|
458 |
-
$sort["1_or_2"] = "2";
|
459 |
-
if (isset($_POST['page_number'])) {
|
460 |
-
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
461 |
-
$sort["sortid_by"] =esc_sql(esc_html(stripslashes($_POST['order_by'])));
|
462 |
-
}
|
463 |
-
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
464 |
-
$sort["custom_style"] = "manage-column column-title sorted asc";
|
465 |
-
$sort["1_or_2"] = "2";
|
466 |
-
$order = esc_sql(esc_html($sort["sortid_by"]));
|
467 |
-
$asc_desc = "ASC";
|
468 |
-
}
|
469 |
-
else {
|
470 |
-
$sort["custom_style"] = "manage-column column-title sorted desc";
|
471 |
-
$sort["1_or_2"] = "1";
|
472 |
-
$order = esc_sql(esc_html($sort["sortid_by"]));
|
473 |
-
$asc_desc = "DESC";
|
474 |
-
}
|
475 |
-
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
476 |
-
$limit = (esc_sql(esc_html(stripslashes($_POST['page_number']))) - 1) * 20;
|
477 |
-
}
|
478 |
-
else {
|
479 |
-
$limit = 0;
|
480 |
-
}
|
481 |
-
}
|
482 |
-
else {
|
483 |
-
$limit = 0;
|
484 |
-
}
|
485 |
-
if (isset($_POST['search_events_by_title'])) {
|
486 |
-
$search_tag = esc_sql(esc_html(stripslashes($_POST['search_events_by_title'])));
|
487 |
-
}
|
488 |
-
else {
|
489 |
-
$search_tag = "";
|
490 |
-
}
|
491 |
-
if ($search_tag) {
|
492 |
-
$where = ' AND ' . $wpdb->prefix . 'spidercalendar_event.title LIKE "%%' . esc_sql(esc_html($search_tag)) . '%%"';
|
493 |
-
}
|
494 |
-
else {
|
495 |
-
$where = '';
|
496 |
-
}
|
497 |
-
if (isset($_POST['startdate']) && esc_html($_POST['startdate'])) {
|
498 |
-
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date > \'' . esc_sql(esc_html(stripslashes($_POST['startdate']))) . '\' ';
|
499 |
-
}
|
500 |
-
if (isset($_POST['enddate']) && $_POST['enddate']) {
|
501 |
-
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date < \'' .esc_sql(esc_html(stripslashes($_POST['enddate']))). '\' ';
|
502 |
-
}
|
503 |
-
|
504 |
-
// Get the total number of records.
|
505 |
-
$query = $wpdb->prepare ("SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=%d " . $where . " ", $calendar_id);
|
506 |
-
$total = $wpdb->get_var($query);
|
507 |
-
$pageNav['total'] = $total;
|
508 |
-
$pageNav['limit'] = $limit / 20 + 1;
|
509 |
-
if( $order == "id" || $order == "title" || $order == "date" || $order == "time" || $order == "cattitle" || $order == "published" )
|
510 |
-
$order_by = " ORDER BY " . $order . " " . $asc_desc;
|
511 |
-
$query = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event.*, " . $wpdb->prefix . "spidercalendar_event_category.title as cattitle FROM " . $wpdb->prefix . "spidercalendar_event LEFT JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE calendar=%d " . $where . $order_by." LIMIT %d,20", $calendar_id, $limit);
|
512 |
-
$rows = $wpdb->get_results($query);
|
513 |
-
$cal_name = $wpdb->get_var($wpdb->prepare('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $calendar_id));
|
514 |
-
html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name);
|
515 |
-
}
|
516 |
-
|
517 |
-
|
518 |
-
// Add an event.
|
519 |
-
function add_spider_event($calendar_id) {
|
520 |
-
global $wpdb;
|
521 |
-
$cal_name = $wpdb->get_var($wpdb->prepare('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $calendar_id));
|
522 |
-
html_add_spider_event($calendar_id, $cal_name);
|
523 |
-
}
|
524 |
-
|
525 |
-
// Edit event.
|
526 |
-
function edit_spider_event($calendar_id, $id) {
|
527 |
-
global $wpdb;
|
528 |
-
$row = $wpdb->get_row($wpdb->prepare ('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE id=%d', $id ));
|
529 |
-
$calendar = $row->calendar;
|
530 |
-
$query = $wpdb->prepare ('SELECT title FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE id=%d' , $calendar);
|
531 |
-
$calendar_name = $wpdb->get_var($query);
|
532 |
-
$cal_name = $wpdb->get_var($wpdb->prepare('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $calendar_id));
|
533 |
-
html_edit_spider_event($row, $calendar_id, $id, $cal_name);
|
534 |
-
}
|
535 |
-
|
536 |
-
// Save event.
|
537 |
-
function apply_spider_event($calendar_id, $id) {
|
538 |
-
global $wpdb;
|
539 |
-
if(isset($_POST['title'])){
|
540 |
-
$title = ((isset($_POST['title'])) ? esc_sql(esc_html(stripslashes($_POST['title']))) : '');
|
541 |
-
$category = ((isset($_POST['category'])) ? esc_sql(esc_html(stripslashes($_POST['category']))) : '');
|
542 |
-
$text_for_date = preg_replace('#<script(.*?)>(.*?)</script>#is', '', stripslashes($_POST["text_for_date"]));
|
543 |
-
$published = ((isset($_POST['published'])) ? (int) $_POST['published'] : 1);
|
544 |
-
$repeat = ((isset($_POST['repeat'])) ? esc_sql(esc_html(stripslashes($_POST['repeat']))) : '');
|
545 |
-
$week = ((isset($_POST['week'])) ? esc_sql(esc_html(stripslashes($_POST['week']))) : '');
|
546 |
-
$month = ((isset($_POST['month'])) ? esc_sql(esc_html(stripslashes($_POST['month']))) : '');
|
547 |
-
$monthly_list = ((isset($_POST['monthly_list'])) ? esc_sql(esc_html(stripslashes($_POST['monthly_list']))) : '');
|
548 |
-
$month_type = ((isset($_POST['month_type'])) ? esc_sql(esc_html(stripslashes($_POST['month_type']))) : '');
|
549 |
-
$month_week = ((isset($_POST['month_week'])) ? esc_sql(esc_html(stripslashes($_POST['month_week']))) : '');
|
550 |
-
$year_month = ((isset($_POST['year_month'])) ? esc_sql(esc_html(stripslashes($_POST['year_month']))) : '');
|
551 |
-
$repeat_method = ((isset($_POST['repeat_method'])) ? esc_sql(esc_html(stripslashes($_POST['repeat_method']))) : 'no_repeat');
|
552 |
-
$date = ((isset($_POST['date'])) ? esc_sql(esc_html(stripslashes($_POST['date']))) : '');
|
553 |
-
$date_end = ((isset($_POST['date_end'])) ? esc_sql(esc_html(stripslashes($_POST['date_end']))) : '');
|
554 |
-
if ($date_end == '' && $repeat_method != 'no_repeat') {
|
555 |
-
$date_end = '2035-12-12';
|
556 |
-
}
|
557 |
-
$select_from = ((isset($_POST['select_from'])) ? esc_sql(esc_html(stripslashes($_POST['select_from']))) : '');
|
558 |
-
$select_to = ((isset($_POST['select_to'])) ? esc_sql(esc_html(stripslashes($_POST['select_to']))) : '');
|
559 |
-
$selhour_from = ((isset($_POST['selhour_from'])) ? esc_sql(esc_html(stripslashes($_POST['selhour_from']))) : '');
|
560 |
-
$selhour_to = ((isset($_POST['selhour_to'])) ? esc_sql(esc_html(stripslashes($_POST['selhour_to']))) : '');
|
561 |
-
$selminute_from = ((isset($_POST['selminute_from'])) ? esc_sql(esc_html(stripslashes($_POST['selminute_from']))) : '');
|
562 |
-
$selminute_to = ((isset($_POST['selminute_to'])) ? esc_sql(esc_html(stripslashes($_POST['selminute_to']))) : '');
|
563 |
-
if ($selhour_from) {
|
564 |
-
if ($selhour_to) {
|
565 |
-
$time = $selhour_from . ':' . $selminute_from . '' . $select_from . '-' . $selhour_to . ':' . $selminute_to . '' . $select_to;
|
566 |
-
}
|
567 |
-
else {
|
568 |
-
$time = $selhour_from . ':' . $selminute_from . ' ' . $select_from;
|
569 |
-
}
|
570 |
-
}
|
571 |
-
else {
|
572 |
-
$time = '';
|
573 |
-
}
|
574 |
-
if ($id === -1) {
|
575 |
-
$save = $wpdb->insert($wpdb->prefix . 'spidercalendar_event', array(
|
576 |
-
'id' => NULL,
|
577 |
-
'category' => $category,
|
578 |
-
'title' => $title,
|
579 |
-
'time' => $time,
|
580 |
-
'calendar' => $calendar_id,
|
581 |
-
'date' => $date,
|
582 |
-
'text_for_date' => $text_for_date,
|
583 |
-
'published' => $published,
|
584 |
-
'repeat' => $repeat,
|
585 |
-
'week' => $week,
|
586 |
-
'date_end' => $date_end,
|
587 |
-
'month' => $month,
|
588 |
-
'monthly_list' => $monthly_list,
|
589 |
-
'month_week' => $month_week,
|
590 |
-
'month_type' => $month_type,
|
591 |
-
'year_month' => $year_month,
|
592 |
-
'repeat_method' => $repeat_method,
|
593 |
-
'userID' => ''
|
594 |
-
), array(
|
595 |
-
'%d',
|
596 |
-
'%s',
|
597 |
-
'%s',
|
598 |
-
'%s',
|
599 |
-
'%d',
|
600 |
-
'%s',
|
601 |
-
'%s',
|
602 |
-
'%d',
|
603 |
-
'%s',
|
604 |
-
'%s',
|
605 |
-
'%s',
|
606 |
-
'%s',
|
607 |
-
'%s',
|
608 |
-
'%s',
|
609 |
-
'%s',
|
610 |
-
'%s',
|
611 |
-
'%s',
|
612 |
-
'%s'
|
613 |
-
));
|
614 |
-
}
|
615 |
-
else {
|
616 |
-
$save = $wpdb->update($wpdb->prefix . 'spidercalendar_event', array(
|
617 |
-
'title' => $title,
|
618 |
-
'category' => $category,
|
619 |
-
'time' => $time,
|
620 |
-
'calendar' => $calendar_id,
|
621 |
-
'date' => $date,
|
622 |
-
'text_for_date' => $text_for_date,
|
623 |
-
'published' => $published,
|
624 |
-
'repeat' => $repeat,
|
625 |
-
'week' => $week,
|
626 |
-
'date_end' => $date_end,
|
627 |
-
'month' => $month,
|
628 |
-
'monthly_list' => $monthly_list,
|
629 |
-
'month_type' => $month_type,
|
630 |
-
'month_week' => $month_week,
|
631 |
-
'year_month' => $year_month,
|
632 |
-
'repeat_method' => $repeat_method
|
633 |
-
), array('id' => $id), array(
|
634 |
-
'%s',
|
635 |
-
'%d',
|
636 |
-
'%s',
|
637 |
-
'%d',
|
638 |
-
'%s',
|
639 |
-
'%s',
|
640 |
-
'%d',
|
641 |
-
'%s',
|
642 |
-
'%s',
|
643 |
-
'%s',
|
644 |
-
'%s',
|
645 |
-
'%s',
|
646 |
-
'%s',
|
647 |
-
'%s',
|
648 |
-
'%s',
|
649 |
-
'%s'
|
650 |
-
));
|
651 |
-
}
|
652 |
-
if ($save !== FALSE) {
|
653 |
-
?>
|
654 |
-
<div class="updated"><p><strong>Item Saved.</strong></p></div>
|
655 |
-
<?php
|
656 |
-
return TRUE;
|
657 |
-
}
|
658 |
-
else {
|
659 |
-
?>
|
660 |
-
<div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
|
661 |
-
<?php
|
662 |
-
return FALSE;
|
663 |
-
}
|
664 |
-
}
|
665 |
-
}
|
666 |
-
|
667 |
-
// Publish/Unpublish event.
|
668 |
-
function published_spider_event($calendar_id, $id) {
|
669 |
-
global $wpdb;
|
670 |
-
$publish = $wpdb->get_var($wpdb->prepare('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE `id`="%d"', $id));
|
671 |
-
if ($publish) {
|
672 |
-
$publish = 0;
|
673 |
-
$publish_unpublish = 'Event unpublished.';
|
674 |
-
}
|
675 |
-
else {
|
676 |
-
$publish = 1;
|
677 |
-
$publish_unpublish = 'Event published.';
|
678 |
-
}
|
679 |
-
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event', array(
|
680 |
-
'published' => $publish,
|
681 |
-
), array('id' => $id), array(
|
682 |
-
'%d',
|
683 |
-
));
|
684 |
-
if ($save_or_no !== FALSE) {
|
685 |
-
?>
|
686 |
-
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
687 |
-
<?php
|
688 |
-
}
|
689 |
-
|
690 |
-
}
|
691 |
-
|
692 |
-
// Delete event.
|
693 |
-
function remove_spider_event($calendar_id, $id) {
|
694 |
-
global $wpdb;
|
695 |
-
$sql_remove_vid = $wpdb->prepare ("DELETE FROM " . $wpdb->prefix . "spidercalendar_event WHERE id=%d" , $id );
|
696 |
-
if (!$wpdb->query($sql_remove_vid)) {
|
697 |
-
?>
|
698 |
-
<div id="message" class="error"><p>Event Not Deleted.</p></div>
|
699 |
-
<?php
|
700 |
-
}
|
701 |
-
else {
|
702 |
-
?>
|
703 |
-
<div class="updated"><p><strong>Event Deleted.</strong></p></div>
|
704 |
-
<?php
|
705 |
-
}
|
706 |
-
}
|
707 |
-
|
708 |
-
|
709 |
-
// Delete event.
|
710 |
-
function remove_category_event($id) {
|
711 |
-
global $wpdb;
|
712 |
-
$sql_remove_vid = $wpdb->prepare ("DELETE FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE id=%d", $id );
|
713 |
-
if (!$wpdb->query($sql_remove_vid)) {
|
714 |
-
?>
|
715 |
-
<div id="message" class="error"><p>Event Category Not Deleted.</p></div>
|
716 |
-
<?php
|
717 |
-
}
|
718 |
-
else {
|
719 |
-
?>
|
720 |
-
<div class="updated"><p><strong>Event Category Deleted.</strong></p></div>
|
721 |
-
<?php
|
722 |
-
}
|
723 |
-
}
|
724 |
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (function_exists('current_user_can')) {
|
4 |
+
if (!current_user_can('manage_options')) {
|
5 |
+
die('Access Denied');
|
6 |
+
}
|
7 |
+
}
|
8 |
+
|
9 |
+
function add_spider_calendar() {
|
10 |
+
html_add_spider_calendar();
|
11 |
+
}
|
12 |
+
|
13 |
+
function copy_spider_event($calendar_id, $id) {
|
14 |
+
global $wpdb;
|
15 |
+
$query = $wpdb->prepare ('INSERT INTO `'.$wpdb->prefix . 'spidercalendar_event`(`calendar`, `date`, `date_end`, `title`, `category`, `time`, `text_for_date`, `userID`, `repeat_method`, `repeat`, `week`, `month`, `month_type`, `monthly_list`, `month_week`, `year_month`, `published`) SELECT `calendar`, `date`, `date_end`, `title`, `category`, `time`, `text_for_date`, `userID`, `repeat_method`, `repeat`, `week`, `month`, `month_type`, `monthly_list`, `month_week`, `year_month`, `published` FROM `'.$wpdb->prefix . 'spidercalendar_event` WHERE `id` = "%d"', $id );
|
16 |
+
if (!$wpdb->query($query)) {
|
17 |
+
?>
|
18 |
+
<div id="message" class="error"><p>Event copy was not created.</p></div>
|
19 |
+
<?php
|
20 |
+
}
|
21 |
+
else {
|
22 |
+
?>
|
23 |
+
<div class="updated"><p><strong>Event successfully copied.</strong></p></div>
|
24 |
+
<?php
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
function spider_upcoming(){
|
29 |
+
if(isset($_GET['upcalendar_id']))
|
30 |
+
$calendar_id=(int)$_GET['upcalendar_id'];
|
31 |
+
else $calendar_id="0";
|
32 |
+
|
33 |
+
global $wpdb;
|
34 |
+
$order = "title";
|
35 |
+
$asc_desc = "ASC";
|
36 |
+
$order_by = "";
|
37 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
38 |
+
$sort["sortid_by"] = "title";
|
39 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
40 |
+
$sort["1_or_2"] = "2";
|
41 |
+
if (isset($_POST['page_number'])) {
|
42 |
+
if (esc_html($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
43 |
+
if (isset($_POST['order_by'])) {
|
44 |
+
$sort["sortid_by"] = esc_sql(esc_html($_POST['order_by']));
|
45 |
+
}
|
46 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
47 |
+
$sort["1_or_2"] = "2";
|
48 |
+
$order = esc_sql(esc_html($sort["sortid_by"]));
|
49 |
+
$asc_desc = "ASC";
|
50 |
+
}
|
51 |
+
else {
|
52 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
53 |
+
$sort["1_or_2"] = "1";
|
54 |
+
$order = esc_sql(esc_html($sort["sortid_by"]));
|
55 |
+
$asc_desc = "DESC";
|
56 |
+
}
|
57 |
+
if ($_POST['page_number']) {
|
58 |
+
$limit = (esc_sql(esc_html(stripslashes($_POST['page_number'])))- 1) * 20;
|
59 |
+
}
|
60 |
+
else {
|
61 |
+
$limit = 0;
|
62 |
+
}
|
63 |
+
}
|
64 |
+
else {
|
65 |
+
$limit = 0;
|
66 |
+
}
|
67 |
+
if (isset($_POST['search_events_by_title'])) {
|
68 |
+
$search_tag = esc_sql(esc_html(stripslashes($_POST['search_events_by_title'])));
|
69 |
+
}
|
70 |
+
else {
|
71 |
+
$search_tag = "";
|
72 |
+
}
|
73 |
+
|
74 |
+
if ($search_tag) {
|
75 |
+
$where = ' AND ' . $wpdb->prefix . 'spidercalendar_event.title LIKE "%%' . esc_sql(esc_html($search_tag)) . '%%"';
|
76 |
+
}
|
77 |
+
else {
|
78 |
+
$where = '';
|
79 |
+
}
|
80 |
+
if (isset($_POST['startdate']) && esc_html($_POST['startdate'])) {
|
81 |
+
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date > \'' . esc_sql(esc_html($_POST['startdate'])) . '\' ';
|
82 |
+
}
|
83 |
+
if (isset($_POST['enddate']) && esc_html($_POST['enddate'])) {
|
84 |
+
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date < \'' . esc_sql(esc_html($_POST['enddate'])) . '\' ';
|
85 |
+
}
|
86 |
+
// Get the total number of records.
|
87 |
+
|
88 |
+
$query = $wpdb->prepare ("SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=%d " . $where . " ",$calendar_id );
|
89 |
+
|
90 |
+
$total = $wpdb->get_var($query);
|
91 |
+
$pageNav['total'] = $total;
|
92 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
93 |
+
|
94 |
+
if( $order == "id" || $order == "title" || $order == "date" || $order == "time" ) $order_by = " ORDER BY " . $order . " " . $asc_desc;
|
95 |
+
$query = $wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=%d " . $where . " " . $order_by . " " . " LIMIT %d,20",$calendar_id,$limit);
|
96 |
+
|
97 |
+
$rows=$wpdb->get_results($query);
|
98 |
+
|
99 |
+
|
100 |
+
html_upcoming_widget($rows, $pageNav, $sort);
|
101 |
+
|
102 |
+
}
|
103 |
+
|
104 |
+
|
105 |
+
function show_spider_calendar() {
|
106 |
+
global $wpdb;
|
107 |
+
$order = "title";
|
108 |
+
$asc_desc = "ASC";
|
109 |
+
$order_by = "";
|
110 |
+
|
111 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
112 |
+
$sort["sortid_by"] = "title";
|
113 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
114 |
+
$sort["1_or_2"] = "2";
|
115 |
+
if (isset($_POST['page_number'])) {
|
116 |
+
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
117 |
+
$sort["sortid_by"] = esc_sql(esc_html(stripslashes($_POST['order_by'])));
|
118 |
+
}
|
119 |
+
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
120 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
121 |
+
$sort["1_or_2"] = "2";
|
122 |
+
$order = esc_sql(esc_html($sort["sortid_by"]));
|
123 |
+
$asc_desc = "ASC";
|
124 |
+
}
|
125 |
+
else {
|
126 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
127 |
+
$sort["1_or_2"] = "1";
|
128 |
+
$order = esc_sql(esc_html($sort["sortid_by"]));
|
129 |
+
$asc_desc = "DESC";
|
130 |
+
}
|
131 |
+
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
132 |
+
$limit = (esc_sql(esc_html(stripslashes($_POST['page_number']))) - 1) * 20;
|
133 |
+
}
|
134 |
+
else {
|
135 |
+
$limit = 0;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
else {
|
139 |
+
$limit = 0;
|
140 |
+
}
|
141 |
+
if (isset($_POST['search_events_by_title'])) {
|
142 |
+
$search_tag = esc_sql(esc_html(stripslashes($_POST['search_events_by_title'])));
|
143 |
+
}
|
144 |
+
else {
|
145 |
+
$search_tag = "";
|
146 |
+
}
|
147 |
+
if ($search_tag) {
|
148 |
+
$where = ' WHERE title LIKE "%%' . esc_sql(esc_html($search_tag)) . '%%"';
|
149 |
+
}
|
150 |
+
else {
|
151 |
+
$where = ' ';
|
152 |
+
}
|
153 |
+
// Get the total number of records.
|
154 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_calendar" . str_replace('%%','%',$where);
|
155 |
+
$total = $wpdb->get_var($query);
|
156 |
+
$pageNav['total'] = $total;
|
157 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
158 |
+
|
159 |
+
if( $order == "id" || $order == "title" || $order == "published" )
|
160 |
+
$order_by = " ORDER BY " . $order . " " . $asc_desc;
|
161 |
+
$query = $wpdb->prepare ( "SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar" . $where . " " . $order_by . " " . " LIMIT %d,20",$limit);
|
162 |
+
$rows = $wpdb->get_results($query);
|
163 |
+
// display function
|
164 |
+
html_show_spider_calendar($rows, $pageNav, $sort);
|
165 |
+
}
|
166 |
+
|
167 |
+
function show_event_cat(){
|
168 |
+
global $wpdb;
|
169 |
+
$order = "title";
|
170 |
+
$asc_desc = "ASC";
|
171 |
+
$order_by = "";
|
172 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
173 |
+
$sort["sortid_by"] = "title";
|
174 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
175 |
+
$sort["1_or_2"] = "2";
|
176 |
+
if (isset($_POST['page_number'])) {
|
177 |
+
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
178 |
+
$sort["sortid_by"] = esc_sql(esc_html(stripslashes($_POST['order_by'])));
|
179 |
+
}
|
180 |
+
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
181 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
182 |
+
$sort["1_or_2"] = "2";
|
183 |
+
$order = esc_sql(esc_html($sort["sortid_by"]));
|
184 |
+
$asc_desc = "ASC";
|
185 |
+
}
|
186 |
+
else {
|
187 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
188 |
+
$sort["1_or_2"] = "1";
|
189 |
+
$order = esc_sql(esc_html($sort["sortid_by"]));
|
190 |
+
$asc_desc = "DESC";
|
191 |
+
}
|
192 |
+
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
193 |
+
$limit = (esc_sql(esc_html(stripslashes($_POST['page_number']))) - 1) * 20;
|
194 |
+
}
|
195 |
+
else {
|
196 |
+
$limit = 0;
|
197 |
+
}
|
198 |
+
}
|
199 |
+
else {
|
200 |
+
$limit = 0;
|
201 |
+
}
|
202 |
+
if (isset($_POST['search_cat_by_title'])) {
|
203 |
+
$search_tag = esc_sql(esc_html(stripslashes($_POST['search_cat_by_title'])));
|
204 |
+
}
|
205 |
+
else {
|
206 |
+
$search_tag = "";
|
207 |
+
}
|
208 |
+
if ($search_tag) {
|
209 |
+
$where = ' WHERE title LIKE "%%' . esc_sql(esc_html($search_tag)) . '%%"';
|
210 |
+
}
|
211 |
+
else {
|
212 |
+
$where = ' ';
|
213 |
+
}
|
214 |
+
// Get the total number of records.
|
215 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event_category" . str_replace('%%','%',$where);
|
216 |
+
$total = $wpdb->get_var($query);
|
217 |
+
$pageNav['total'] = $total;
|
218 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
219 |
+
if( $order == "id" || $order == "title" || $order == "published" || $order == "description" )
|
220 |
+
$order_by = " ORDER BY " . $order . " " . $asc_desc;
|
221 |
+
$query =$wpdb->prepare ( "SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category" . $where . " " . $order_by . " " . " LIMIT %d,20",$limit);
|
222 |
+
|
223 |
+
$rows = $wpdb->get_results($query);
|
224 |
+
// display function
|
225 |
+
show_event_category($rows, $pageNav, $sort);
|
226 |
+
|
227 |
+
}
|
228 |
+
|
229 |
+
|
230 |
+
// Edit calendar.
|
231 |
+
function edit_spider_calendar($id) {
|
232 |
+
global $wpdb;
|
233 |
+
$row = $wpdb->get_row($wpdb->prepare ('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE id=%d',$id));
|
234 |
+
html_edit_spider_calendar($row);
|
235 |
+
}
|
236 |
+
|
237 |
+
// Delete calendar.
|
238 |
+
function remove_spider_calendar($id) {
|
239 |
+
global $wpdb;
|
240 |
+
$sql_remov_vid = $wpdb->prepare ("DELETE FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id=%d", $id);
|
241 |
+
$sql_remov_eve = $wpdb->prepare ("DELETE FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=%d", $id);
|
242 |
+
if (!$wpdb->query($sql_remov_vid)) {
|
243 |
+
?>
|
244 |
+
<div id="message" class="error"><p>Calendar Not Deleted.</p></div>
|
245 |
+
<?php
|
246 |
+
}
|
247 |
+
else {
|
248 |
+
?>
|
249 |
+
<div class="updated"><p><strong>Calendar Deleted.</strong></p></div>
|
250 |
+
<?php
|
251 |
+
$count_eve = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE `calendar`="%d"', $id));
|
252 |
+
if ($count_eve) {
|
253 |
+
if (!$wpdb->query($sql_remov_eve)) {
|
254 |
+
?>
|
255 |
+
<div id="message" class="error"><p>Events Not Deleted.</p></div>
|
256 |
+
<?php
|
257 |
+
}
|
258 |
+
}
|
259 |
+
}
|
260 |
+
}
|
261 |
+
|
262 |
+
|
263 |
+
//Save Category Event
|
264 |
+
|
265 |
+
function save_spider_category_event() {
|
266 |
+
/*
|
267 |
+
if (!$id) {
|
268 |
+
echo '<h1 style="color:#00C">Error. ID does not exist.</h1>';
|
269 |
+
exit;
|
270 |
+
}
|
271 |
+
*/
|
272 |
+
if(isset($_POST['title'])){
|
273 |
+
$title = (isset($_POST["title"]) ? esc_sql(esc_html(stripslashes($_POST["title"]))) : '');
|
274 |
+
$published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
|
275 |
+
$color = (isset($_POST["color"]) ? esc_sql(esc_html(stripslashes($_POST["color"]))) : '');
|
276 |
+
$description = preg_replace('#<script(.*?)>(.*?)</script>#is', '', stripslashes($_POST["description"]));
|
277 |
+
global $wpdb;
|
278 |
+
|
279 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_event_category', array(
|
280 |
+
'id' => NULL,
|
281 |
+
'title' => $title,
|
282 |
+
'published' => $published,
|
283 |
+
'color' => $color,
|
284 |
+
'description' => $description,
|
285 |
+
), array(
|
286 |
+
'%d',
|
287 |
+
'%s',
|
288 |
+
'%d',
|
289 |
+
'%s',
|
290 |
+
'%s'
|
291 |
+
));
|
292 |
+
}
|
293 |
+
}
|
294 |
+
|
295 |
+
|
296 |
+
// Publish/Unpublish category.
|
297 |
+
function spider_category_published($id) {
|
298 |
+
global $wpdb;
|
299 |
+
$publish = $wpdb->get_var($wpdb->prepare('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_event_category WHERE `id`="%d"', $id));
|
300 |
+
if ($publish) {
|
301 |
+
$publish = 0;
|
302 |
+
$publish_unpublish = 'Category unpublished.';
|
303 |
+
}
|
304 |
+
else {
|
305 |
+
$publish = 1;
|
306 |
+
$publish_unpublish = 'Category published.';
|
307 |
+
}
|
308 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event_category', array(
|
309 |
+
'published' => $publish,
|
310 |
+
), array('id' => $id), array(
|
311 |
+
'%d',
|
312 |
+
));
|
313 |
+
|
314 |
+
if ($save_or_no !== FALSE) {
|
315 |
+
?>
|
316 |
+
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
317 |
+
<?php
|
318 |
+
}
|
319 |
+
}
|
320 |
+
|
321 |
+
|
322 |
+
//Apply category event
|
323 |
+
|
324 |
+
function apply_spider_category_event($id) {
|
325 |
+
|
326 |
+
$title = (isset($_POST["title"]) ? esc_sql(esc_html(stripslashes($_POST["title"]))) : '');
|
327 |
+
$published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
|
328 |
+
$color = (isset($_POST["color"]) ? esc_sql(esc_html(stripslashes($_POST["color"]))) : '');
|
329 |
+
$description = preg_replace('#<script(.*?)>(.*?)</script>#is', '', stripslashes($_POST["description"]));
|
330 |
+
global $wpdb;
|
331 |
+
|
332 |
+
|
333 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event_category', array(
|
334 |
+
'title' => $title,
|
335 |
+
'published' => $published,
|
336 |
+
'color' => $color,
|
337 |
+
'description' => $description,
|
338 |
+
), array('id' => $_POST['id']), array(
|
339 |
+
'%s',
|
340 |
+
'%d',
|
341 |
+
'%s',
|
342 |
+
'%s'
|
343 |
+
));
|
344 |
+
|
345 |
+
}
|
346 |
+
|
347 |
+
// Save calendar.
|
348 |
+
function apply_spider_calendar($id) {
|
349 |
+
if (!$id) {
|
350 |
+
echo '<h1 style="color:#00C">Error. ID does not exist.</h1>';
|
351 |
+
exit;
|
352 |
+
}
|
353 |
+
if(isset($_POST['title'])){
|
354 |
+
$title = (isset($_POST["title"]) ? esc_sql(esc_html(stripslashes($_POST["title"]))) : '');
|
355 |
+
$user_type = (isset($_POST["user_type"]) ? esc_sql(esc_html(stripslashes($_POST["user_type"]))) : '');
|
356 |
+
$time_format = (isset($_POST["time_format"]) ? (int) $_POST["time_format"] : 0);
|
357 |
+
$def_year = (isset($_POST["def_year"]) ? esc_sql(esc_html(stripslashes($_POST["def_year"]))) : '');
|
358 |
+
$def_month = (isset($_POST["def_month"]) ? esc_sql(esc_html(stripslashes($_POST["def_month"]))) : '');
|
359 |
+
$def_zone = (isset($_POST["def_zone"]) ? esc_sql(esc_html(stripslashes($_POST["def_zone"]))) : '');
|
360 |
+
$allow_publish = (isset($_POST["allow_publish"]) ? esc_sql(esc_html(stripslashes($_POST["allow_publish"]))) : '');
|
361 |
+
$published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
|
362 |
+
global $wpdb;
|
363 |
+
if ($id === -1) {
|
364 |
+
|
365 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_calendar', array(
|
366 |
+
'id' => NULL,
|
367 |
+
'title' => $title,
|
368 |
+
'gid' => $user_type,
|
369 |
+
'def_year' => $def_year,
|
370 |
+
'def_month' => $def_month,
|
371 |
+
'def_zone' => $def_zone,
|
372 |
+
'time_format' => $time_format,
|
373 |
+
'allow_publish' => $allow_publish,
|
374 |
+
'published' => $published,
|
375 |
+
), array(
|
376 |
+
'%d',
|
377 |
+
'%s',
|
378 |
+
'%s',
|
379 |
+
'%s',
|
380 |
+
'%s',
|
381 |
+
'%s',
|
382 |
+
'%s',
|
383 |
+
'%s',
|
384 |
+
'%d'
|
385 |
+
));
|
386 |
+
|
387 |
+
}
|
388 |
+
else {
|
389 |
+
|
390 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_calendar', array(
|
391 |
+
'title' => $title,
|
392 |
+
'gid' => $user_type,
|
393 |
+
'time_format' => $time_format,
|
394 |
+
'def_year' => $def_year,
|
395 |
+
'def_month' => $def_month,
|
396 |
+
'def_zone' => $def_zone,
|
397 |
+
'allow_publish' => $allow_publish,
|
398 |
+
'published' => $published,
|
399 |
+
), array('id' => $id), array(
|
400 |
+
'%s',
|
401 |
+
'%s',
|
402 |
+
'%d',
|
403 |
+
'%s',
|
404 |
+
'%s',
|
405 |
+
'%s',
|
406 |
+
'%s',
|
407 |
+
'%d'
|
408 |
+
));
|
409 |
+
}
|
410 |
+
if ($save_or_no === FALSE) {
|
411 |
+
?>
|
412 |
+
<div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
|
413 |
+
<?php
|
414 |
+
return FALSE;
|
415 |
+
}
|
416 |
+
else {
|
417 |
+
?>
|
418 |
+
<div class="updated"><p><strong>Calendar Saved.</strong></p></div>
|
419 |
+
<?php
|
420 |
+
return TRUE;
|
421 |
+
}
|
422 |
+
}
|
423 |
+
}
|
424 |
+
|
425 |
+
// Publish/Unpublish calendar.
|
426 |
+
function spider_calendar_published($id) {
|
427 |
+
global $wpdb;
|
428 |
+
$publish = $wpdb->get_var($wpdb->prepare('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $id));
|
429 |
+
if ($publish) {
|
430 |
+
$publish = 0;
|
431 |
+
$publish_unpublish = 'Calendar unpublished.';
|
432 |
+
}
|
433 |
+
else {
|
434 |
+
$publish = 1;
|
435 |
+
$publish_unpublish = 'Calendar published.';
|
436 |
+
}
|
437 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_calendar', array(
|
438 |
+
'published' => $publish,
|
439 |
+
), array('id' => $id), array(
|
440 |
+
'%d',
|
441 |
+
));
|
442 |
+
if ($save_or_no !== FALSE) {
|
443 |
+
?>
|
444 |
+
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
445 |
+
<?php
|
446 |
+
}
|
447 |
+
}
|
448 |
+
|
449 |
+
// Event in table
|
450 |
+
function show_spider_event($calendar_id) {
|
451 |
+
global $wpdb;
|
452 |
+
$order = "title";
|
453 |
+
$asc_desc = "ASC";
|
454 |
+
$order_by = "";
|
455 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
456 |
+
$sort["sortid_by"] = "title";
|
457 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
458 |
+
$sort["1_or_2"] = "2";
|
459 |
+
if (isset($_POST['page_number'])) {
|
460 |
+
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
461 |
+
$sort["sortid_by"] =esc_sql(esc_html(stripslashes($_POST['order_by'])));
|
462 |
+
}
|
463 |
+
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
464 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
465 |
+
$sort["1_or_2"] = "2";
|
466 |
+
$order = esc_sql(esc_html($sort["sortid_by"]));
|
467 |
+
$asc_desc = "ASC";
|
468 |
+
}
|
469 |
+
else {
|
470 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
471 |
+
$sort["1_or_2"] = "1";
|
472 |
+
$order = esc_sql(esc_html($sort["sortid_by"]));
|
473 |
+
$asc_desc = "DESC";
|
474 |
+
}
|
475 |
+
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
476 |
+
$limit = (esc_sql(esc_html(stripslashes($_POST['page_number']))) - 1) * 20;
|
477 |
+
}
|
478 |
+
else {
|
479 |
+
$limit = 0;
|
480 |
+
}
|
481 |
+
}
|
482 |
+
else {
|
483 |
+
$limit = 0;
|
484 |
+
}
|
485 |
+
if (isset($_POST['search_events_by_title'])) {
|
486 |
+
$search_tag = esc_sql(esc_html(stripslashes($_POST['search_events_by_title'])));
|
487 |
+
}
|
488 |
+
else {
|
489 |
+
$search_tag = "";
|
490 |
+
}
|
491 |
+
if ($search_tag) {
|
492 |
+
$where = ' AND ' . $wpdb->prefix . 'spidercalendar_event.title LIKE "%%' . esc_sql(esc_html($search_tag)) . '%%"';
|
493 |
+
}
|
494 |
+
else {
|
495 |
+
$where = '';
|
496 |
+
}
|
497 |
+
if (isset($_POST['startdate']) && esc_html($_POST['startdate'])) {
|
498 |
+
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date > \'' . esc_sql(esc_html(stripslashes($_POST['startdate']))) . '\' ';
|
499 |
+
}
|
500 |
+
if (isset($_POST['enddate']) && $_POST['enddate']) {
|
501 |
+
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date < \'' .esc_sql(esc_html(stripslashes($_POST['enddate']))). '\' ';
|
502 |
+
}
|
503 |
+
|
504 |
+
// Get the total number of records.
|
505 |
+
$query = $wpdb->prepare ("SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=%d " . $where . " ", $calendar_id);
|
506 |
+
$total = $wpdb->get_var($query);
|
507 |
+
$pageNav['total'] = $total;
|
508 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
509 |
+
if( $order == "id" || $order == "title" || $order == "date" || $order == "time" || $order == "cattitle" || $order == "published" )
|
510 |
+
$order_by = " ORDER BY " . $order . " " . $asc_desc;
|
511 |
+
$query = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event.*, " . $wpdb->prefix . "spidercalendar_event_category.title as cattitle FROM " . $wpdb->prefix . "spidercalendar_event LEFT JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE calendar=%d " . $where . $order_by." LIMIT %d,20", $calendar_id, $limit);
|
512 |
+
$rows = $wpdb->get_results($query);
|
513 |
+
$cal_name = $wpdb->get_var($wpdb->prepare('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $calendar_id));
|
514 |
+
html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name);
|
515 |
+
}
|
516 |
+
|
517 |
+
|
518 |
+
// Add an event.
|
519 |
+
function add_spider_event($calendar_id) {
|
520 |
+
global $wpdb;
|
521 |
+
$cal_name = $wpdb->get_var($wpdb->prepare('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $calendar_id));
|
522 |
+
html_add_spider_event($calendar_id, $cal_name);
|
523 |
+
}
|
524 |
+
|
525 |
+
// Edit event.
|
526 |
+
function edit_spider_event($calendar_id, $id) {
|
527 |
+
global $wpdb;
|
528 |
+
$row = $wpdb->get_row($wpdb->prepare ('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE id=%d', $id ));
|
529 |
+
$calendar = $row->calendar;
|
530 |
+
$query = $wpdb->prepare ('SELECT title FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE id=%d' , $calendar);
|
531 |
+
$calendar_name = $wpdb->get_var($query);
|
532 |
+
$cal_name = $wpdb->get_var($wpdb->prepare('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $calendar_id));
|
533 |
+
html_edit_spider_event($row, $calendar_id, $id, $cal_name);
|
534 |
+
}
|
535 |
+
|
536 |
+
// Save event.
|
537 |
+
function apply_spider_event($calendar_id, $id) {
|
538 |
+
global $wpdb;
|
539 |
+
if(isset($_POST['title'])){
|
540 |
+
$title = ((isset($_POST['title'])) ? esc_sql(esc_html(stripslashes($_POST['title']))) : '');
|
541 |
+
$category = ((isset($_POST['category'])) ? esc_sql(esc_html(stripslashes($_POST['category']))) : '');
|
542 |
+
$text_for_date = preg_replace('#<script(.*?)>(.*?)</script>#is', '', stripslashes($_POST["text_for_date"]));
|
543 |
+
$published = ((isset($_POST['published'])) ? (int) $_POST['published'] : 1);
|
544 |
+
$repeat = ((isset($_POST['repeat'])) ? esc_sql(esc_html(stripslashes($_POST['repeat']))) : '');
|
545 |
+
$week = ((isset($_POST['week'])) ? esc_sql(esc_html(stripslashes($_POST['week']))) : '');
|
546 |
+
$month = ((isset($_POST['month'])) ? esc_sql(esc_html(stripslashes($_POST['month']))) : '');
|
547 |
+
$monthly_list = ((isset($_POST['monthly_list'])) ? esc_sql(esc_html(stripslashes($_POST['monthly_list']))) : '');
|
548 |
+
$month_type = ((isset($_POST['month_type'])) ? esc_sql(esc_html(stripslashes($_POST['month_type']))) : '');
|
549 |
+
$month_week = ((isset($_POST['month_week'])) ? esc_sql(esc_html(stripslashes($_POST['month_week']))) : '');
|
550 |
+
$year_month = ((isset($_POST['year_month'])) ? esc_sql(esc_html(stripslashes($_POST['year_month']))) : '');
|
551 |
+
$repeat_method = ((isset($_POST['repeat_method'])) ? esc_sql(esc_html(stripslashes($_POST['repeat_method']))) : 'no_repeat');
|
552 |
+
$date = ((isset($_POST['date'])) ? esc_sql(esc_html(stripslashes($_POST['date']))) : '');
|
553 |
+
$date_end = ((isset($_POST['date_end'])) ? esc_sql(esc_html(stripslashes($_POST['date_end']))) : '');
|
554 |
+
if ($date_end == '' && $repeat_method != 'no_repeat') {
|
555 |
+
$date_end = '2035-12-12';
|
556 |
+
}
|
557 |
+
$select_from = ((isset($_POST['select_from'])) ? esc_sql(esc_html(stripslashes($_POST['select_from']))) : '');
|
558 |
+
$select_to = ((isset($_POST['select_to'])) ? esc_sql(esc_html(stripslashes($_POST['select_to']))) : '');
|
559 |
+
$selhour_from = ((isset($_POST['selhour_from'])) ? esc_sql(esc_html(stripslashes($_POST['selhour_from']))) : '');
|
560 |
+
$selhour_to = ((isset($_POST['selhour_to'])) ? esc_sql(esc_html(stripslashes($_POST['selhour_to']))) : '');
|
561 |
+
$selminute_from = ((isset($_POST['selminute_from'])) ? esc_sql(esc_html(stripslashes($_POST['selminute_from']))) : '');
|
562 |
+
$selminute_to = ((isset($_POST['selminute_to'])) ? esc_sql(esc_html(stripslashes($_POST['selminute_to']))) : '');
|
563 |
+
if ($selhour_from) {
|
564 |
+
if ($selhour_to) {
|
565 |
+
$time = $selhour_from . ':' . $selminute_from . '' . $select_from . '-' . $selhour_to . ':' . $selminute_to . '' . $select_to;
|
566 |
+
}
|
567 |
+
else {
|
568 |
+
$time = $selhour_from . ':' . $selminute_from . ' ' . $select_from;
|
569 |
+
}
|
570 |
+
}
|
571 |
+
else {
|
572 |
+
$time = '';
|
573 |
+
}
|
574 |
+
if ($id === -1) {
|
575 |
+
$save = $wpdb->insert($wpdb->prefix . 'spidercalendar_event', array(
|
576 |
+
'id' => NULL,
|
577 |
+
'category' => $category,
|
578 |
+
'title' => $title,
|
579 |
+
'time' => $time,
|
580 |
+
'calendar' => $calendar_id,
|
581 |
+
'date' => $date,
|
582 |
+
'text_for_date' => $text_for_date,
|
583 |
+
'published' => $published,
|
584 |
+
'repeat' => $repeat,
|
585 |
+
'week' => $week,
|
586 |
+
'date_end' => $date_end,
|
587 |
+
'month' => $month,
|
588 |
+
'monthly_list' => $monthly_list,
|
589 |
+
'month_week' => $month_week,
|
590 |
+
'month_type' => $month_type,
|
591 |
+
'year_month' => $year_month,
|
592 |
+
'repeat_method' => $repeat_method,
|
593 |
+
'userID' => ''
|
594 |
+
), array(
|
595 |
+
'%d',
|
596 |
+
'%s',
|
597 |
+
'%s',
|
598 |
+
'%s',
|
599 |
+
'%d',
|
600 |
+
'%s',
|
601 |
+
'%s',
|
602 |
+
'%d',
|
603 |
+
'%s',
|
604 |
+
'%s',
|
605 |
+
'%s',
|
606 |
+
'%s',
|
607 |
+
'%s',
|
608 |
+
'%s',
|
609 |
+
'%s',
|
610 |
+
'%s',
|
611 |
+
'%s',
|
612 |
+
'%s'
|
613 |
+
));
|
614 |
+
}
|
615 |
+
else {
|
616 |
+
$save = $wpdb->update($wpdb->prefix . 'spidercalendar_event', array(
|
617 |
+
'title' => $title,
|
618 |
+
'category' => $category,
|
619 |
+
'time' => $time,
|
620 |
+
'calendar' => $calendar_id,
|
621 |
+
'date' => $date,
|
622 |
+
'text_for_date' => $text_for_date,
|
623 |
+
'published' => $published,
|
624 |
+
'repeat' => $repeat,
|
625 |
+
'week' => $week,
|
626 |
+
'date_end' => $date_end,
|
627 |
+
'month' => $month,
|
628 |
+
'monthly_list' => $monthly_list,
|
629 |
+
'month_type' => $month_type,
|
630 |
+
'month_week' => $month_week,
|
631 |
+
'year_month' => $year_month,
|
632 |
+
'repeat_method' => $repeat_method
|
633 |
+
), array('id' => $id), array(
|
634 |
+
'%s',
|
635 |
+
'%d',
|
636 |
+
'%s',
|
637 |
+
'%d',
|
638 |
+
'%s',
|
639 |
+
'%s',
|
640 |
+
'%d',
|
641 |
+
'%s',
|
642 |
+
'%s',
|
643 |
+
'%s',
|
644 |
+
'%s',
|
645 |
+
'%s',
|
646 |
+
'%s',
|
647 |
+
'%s',
|
648 |
+
'%s',
|
649 |
+
'%s'
|
650 |
+
));
|
651 |
+
}
|
652 |
+
if ($save !== FALSE) {
|
653 |
+
?>
|
654 |
+
<div class="updated"><p><strong>Item Saved.</strong></p></div>
|
655 |
+
<?php
|
656 |
+
return TRUE;
|
657 |
+
}
|
658 |
+
else {
|
659 |
+
?>
|
660 |
+
<div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
|
661 |
+
<?php
|
662 |
+
return FALSE;
|
663 |
+
}
|
664 |
+
}
|
665 |
+
}
|
666 |
+
|
667 |
+
// Publish/Unpublish event.
|
668 |
+
function published_spider_event($calendar_id, $id) {
|
669 |
+
global $wpdb;
|
670 |
+
$publish = $wpdb->get_var($wpdb->prepare('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE `id`="%d"', $id));
|
671 |
+
if ($publish) {
|
672 |
+
$publish = 0;
|
673 |
+
$publish_unpublish = 'Event unpublished.';
|
674 |
+
}
|
675 |
+
else {
|
676 |
+
$publish = 1;
|
677 |
+
$publish_unpublish = 'Event published.';
|
678 |
+
}
|
679 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event', array(
|
680 |
+
'published' => $publish,
|
681 |
+
), array('id' => $id), array(
|
682 |
+
'%d',
|
683 |
+
));
|
684 |
+
if ($save_or_no !== FALSE) {
|
685 |
+
?>
|
686 |
+
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
687 |
+
<?php
|
688 |
+
}
|
689 |
+
|
690 |
+
}
|
691 |
+
|
692 |
+
// Delete event.
|
693 |
+
function remove_spider_event($calendar_id, $id) {
|
694 |
+
global $wpdb;
|
695 |
+
$sql_remove_vid = $wpdb->prepare ("DELETE FROM " . $wpdb->prefix . "spidercalendar_event WHERE id=%d" , $id );
|
696 |
+
if (!$wpdb->query($sql_remove_vid)) {
|
697 |
+
?>
|
698 |
+
<div id="message" class="error"><p>Event Not Deleted.</p></div>
|
699 |
+
<?php
|
700 |
+
}
|
701 |
+
else {
|
702 |
+
?>
|
703 |
+
<div class="updated"><p><strong>Event Deleted.</strong></p></div>
|
704 |
+
<?php
|
705 |
+
}
|
706 |
+
}
|
707 |
+
|
708 |
+
|
709 |
+
// Delete event.
|
710 |
+
function remove_category_event($id) {
|
711 |
+
global $wpdb;
|
712 |
+
$sql_remove_vid = $wpdb->prepare ("DELETE FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE id=%d", $id );
|
713 |
+
if (!$wpdb->query($sql_remove_vid)) {
|
714 |
+
?>
|
715 |
+
<div id="message" class="error"><p>Event Category Not Deleted.</p></div>
|
716 |
+
<?php
|
717 |
+
}
|
718 |
+
else {
|
719 |
+
?>
|
720 |
+
<div class="updated"><p><strong>Event Category Deleted.</strong></p></div>
|
721 |
+
<?php
|
722 |
+
}
|
723 |
+
}
|
724 |
?>
|
elements/calendar-jos.css
CHANGED
@@ -327,4 +327,118 @@ div.calendar {
|
|
327 |
|
328 |
a:focus{
|
329 |
box-shadow: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
}
|
327 |
|
328 |
a:focus{
|
329 |
box-shadow: none;
|
330 |
+
}
|
331 |
+
|
332 |
+
/************* front end ************/
|
333 |
+
|
334 |
+
|
335 |
+
#TB_iframeContent{
|
336 |
+
width: 100%;
|
337 |
+
height: inherit !important;
|
338 |
+
}
|
339 |
+
#TB_window{
|
340 |
+
z-index: 1000000 !important;
|
341 |
+
color: #dfdfdf;
|
342 |
+
top: 100px !important;
|
343 |
+
}
|
344 |
+
#TB_title{
|
345 |
+
border-bottom: none;
|
346 |
+
height: 0px;
|
347 |
+
}
|
348 |
+
|
349 |
+
#TB_closeWindowButton,
|
350 |
+
.tb-close-icon,
|
351 |
+
#TB_closeWindowButton:focus .tb-close-icon{
|
352 |
+
outline:0 !important;
|
353 |
+
box-shadow: 0 0;
|
354 |
+
}
|
355 |
+
|
356 |
+
.tb-close-icon{
|
357 |
+
left: -17px;
|
358 |
+
top: 11px;
|
359 |
+
}
|
360 |
+
|
361 |
+
.tb-close-icon:before{
|
362 |
+
content: 'x';
|
363 |
+
font-weight: 300;
|
364 |
+
font-family: monospace;
|
365 |
+
}
|
366 |
+
|
367 |
+
.screen-reader-text,
|
368 |
+
#views_select .arrow-down,
|
369 |
+
#views_select .arrow-right{
|
370 |
+
display: none;
|
371 |
+
}
|
372 |
+
|
373 |
+
html.thickbox_open{
|
374 |
+
overflow: hidden;
|
375 |
+
}
|
376 |
+
#TB_window iframe{
|
377 |
+
margin-left: 0;
|
378 |
+
margin-top: 0;
|
379 |
+
padding-left: 0;
|
380 |
+
padding-top: 0;
|
381 |
+
}
|
382 |
+
|
383 |
+
.show_arrow{
|
384 |
+
display: inline-block !important;
|
385 |
+
}
|
386 |
+
|
387 |
+
.ios_device #TB_window {
|
388 |
+
height: 90%;
|
389 |
+
-webkit-overflow-scrolling: touch !important;
|
390 |
+
overflow: scroll !important;
|
391 |
+
}
|
392 |
+
|
393 |
+
.general_table a,
|
394 |
+
.last_table a,
|
395 |
+
.week_list a,
|
396 |
+
.day_ev a{
|
397 |
+
border: 0;
|
398 |
+
text-decoration: none;
|
399 |
+
box-shadow: 0 0;
|
400 |
+
}
|
401 |
+
|
402 |
+
|
403 |
+
.wdc_calendar{
|
404 |
+
display: block !important;
|
405 |
+
max-width: 100% !important;
|
406 |
+
border: 0;
|
407 |
+
text-decoration: none;
|
408 |
+
box-shadow: 0 0;
|
409 |
+
}
|
410 |
+
|
411 |
+
.wdc_calendar li{
|
412 |
+
list-style: none;
|
413 |
+
}
|
414 |
+
.wdc_calendar p{
|
415 |
+
margin: 0;
|
416 |
+
padding: 0;
|
417 |
+
}
|
418 |
+
|
419 |
+
.wdc_calendar table{
|
420 |
+
table-layout: auto;
|
421 |
+
}
|
422 |
+
|
423 |
+
@media screen and (max-width: 768px) {
|
424 |
+
.wdc_calendar #cal_event p:not(.ev_name){
|
425 |
+
display: block; /* Fallback for non-webkit */
|
426 |
+
display: -webkit-box;
|
427 |
+
max-width: 400px;
|
428 |
+
height: 32px; /* Fallback for non-webkit */
|
429 |
+
margin: 0 auto;
|
430 |
+
font-size: 13px;
|
431 |
+
line-height: 15px;
|
432 |
+
-webkit-line-clamp: 2;
|
433 |
+
-webkit-box-orient: vertical;
|
434 |
+
overflow: hidden;
|
435 |
+
text-overflow: ellipsis;
|
436 |
+
}
|
437 |
+
div.wdc_calendar{
|
438 |
+
width: 100% !important;
|
439 |
+
margin: 0;
|
440 |
+
}
|
441 |
+
.wdc_calendar .cala_day{
|
442 |
+
max-width: 37px;
|
443 |
+
}
|
444 |
}
|
front_end/bigcalendarday.php
CHANGED
@@ -1,1047 +1,1047 @@
|
|
1 |
-
<?php
|
2 |
-
function big_calendar_day() {
|
3 |
-
require_once("frontend_functions.php");
|
4 |
-
global $wpdb;
|
5 |
-
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
-
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
-
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
-
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 30);
|
9 |
-
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
10 |
-
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
-
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
12 |
-
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
13 |
-
$site_url = get_admin_url().'admin-ajax.php';
|
14 |
-
///////////////////////////////////////////////////////////////////////////////////
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
if($cat_ids=='')
|
19 |
-
$cat_ids .= $cat_id.',';
|
20 |
-
else
|
21 |
-
$cat_ids .= ','.$cat_id.',';
|
22 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
23 |
-
|
24 |
-
function getelementcountinarray($array , $element)
|
25 |
-
{
|
26 |
-
$t=0;
|
27 |
-
|
28 |
-
for($i=0; $i<count($array); $i++)
|
29 |
-
{
|
30 |
-
if($element==$array[$i])
|
31 |
-
$t++;
|
32 |
-
|
33 |
-
}
|
34 |
-
|
35 |
-
|
36 |
-
return $t;
|
37 |
-
|
38 |
-
}
|
39 |
-
|
40 |
-
function getelementindexinarray($array , $element)
|
41 |
-
{
|
42 |
-
|
43 |
-
$t='';
|
44 |
-
|
45 |
-
for($i=0; $i<count($array); $i++)
|
46 |
-
{
|
47 |
-
if($element==$array[$i])
|
48 |
-
$t.=$i.',';
|
49 |
-
|
50 |
-
}
|
51 |
-
|
52 |
-
return $t;
|
53 |
-
|
54 |
-
|
55 |
-
}
|
56 |
-
$cat_ids_array = explode(',',$cat_ids);
|
57 |
-
|
58 |
-
|
59 |
-
if($cat_id!='')
|
60 |
-
{
|
61 |
-
|
62 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
63 |
-
{
|
64 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
65 |
-
$index_array = explode(',' , $index_in_line);
|
66 |
-
array_pop ($index_array);
|
67 |
-
for($j=0; $j<count($index_array); $j++)
|
68 |
-
unset($cat_ids_array[$index_array[$j]]);
|
69 |
-
$cat_ids = implode(',',$cat_ids_array);
|
70 |
-
}
|
71 |
-
}
|
72 |
-
else
|
73 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
74 |
-
|
75 |
-
|
76 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
77 |
-
|
78 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
79 |
-
$cal_width = $theme->width;
|
80 |
-
$bg_top = '#' . str_replace('#','',$theme->bg_top);
|
81 |
-
$bg_bottom = '#' . str_replace('#','',$theme->bg_bottom);
|
82 |
-
$border_color = '#' . str_replace('#','',$theme->border_color);
|
83 |
-
$text_color_year = '#' . str_replace('#','',$theme->text_color_year);
|
84 |
-
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
85 |
-
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
86 |
-
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
87 |
-
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
88 |
-
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
89 |
-
$evented_color_bg = (isset($theme->bg_color_this_month_evented) ?'#' . str_replace('#','',$theme->bg_color_this_month_evented) : '');
|
90 |
-
$color_arrow_year = '#' . str_replace('#','',$theme->arrow_color_year);
|
91 |
-
$color_arrow_month = '#' . str_replace('#','',$theme->arrow_color_month);
|
92 |
-
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
93 |
-
$event_title_color = '#' . str_replace('#','',$theme->event_title_color);
|
94 |
-
$current_day_border_color = '#' . str_replace('#','',$theme->current_day_border_color);
|
95 |
-
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
96 |
-
$cell_height = $theme->cell_height;
|
97 |
-
$popup_width = $theme->popup_width;
|
98 |
-
$popup_height = $theme->popup_height;
|
99 |
-
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
100 |
-
$sundays_font_size = $theme->sundays_font_size;
|
101 |
-
$other_days_font_size = $theme->other_days_font_size;
|
102 |
-
$weekdays_font_size = $theme->weekdays_font_size;
|
103 |
-
$border_width = $theme->border_width;
|
104 |
-
$top_height = $theme->top_height;
|
105 |
-
$bg_color_other_months = '#' . str_replace('#','',$theme->bg_color_other_months);
|
106 |
-
$sundays_bg_color = '#' . str_replace('#','',$theme->sundays_bg_color);
|
107 |
-
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
108 |
-
$weekstart = $theme->week_start_day;
|
109 |
-
$weekday_sunday_bg_color = '#' . str_replace('#','',$theme->weekday_sunday_bg_color);
|
110 |
-
$border_radius = $theme->border_radius;
|
111 |
-
$border_radius2 = $border_radius-$border_width;
|
112 |
-
$week_days_cell_height = $theme->week_days_cell_height;
|
113 |
-
$year_font_size = $theme->year_font_size;
|
114 |
-
$month_font_size = $theme->month_font_size;
|
115 |
-
$arrow_size = $theme->arrow_size;
|
116 |
-
$arrow_size_hover = $arrow_size;
|
117 |
-
$next_month_text_color = '#' . str_replace('#','',$theme->next_month_text_color);
|
118 |
-
$prev_month_text_color = '#' . str_replace('#','',$theme->prev_month_text_color);
|
119 |
-
$next_month_arrow_color = '#' . str_replace('#','',$theme->next_month_arrow_color);
|
120 |
-
$prev_month_arrow_color = '#' . str_replace('#','',$theme->prev_month_arrow_color);
|
121 |
-
$next_month_font_size = $theme->next_month_font_size;
|
122 |
-
$prev_month_font_size = $theme->prev_month_font_size;
|
123 |
-
$month_type = $theme->month_type;
|
124 |
-
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
125 |
-
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
126 |
-
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
127 |
-
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
128 |
-
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
129 |
-
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
130 |
-
$date_font_size = $theme->date_font_size;
|
131 |
-
$event_num_font_size = $theme->event_num_font_size;
|
132 |
-
$event_table_height = $theme->event_table_height;
|
133 |
-
$date_height = $theme->date_height;
|
134 |
-
$day_month_font_size = $theme->day_month_font_size;
|
135 |
-
$week_font_size = $theme->week_font_size;
|
136 |
-
$day_month_font_color = '#' . str_replace('#','',$theme->day_month_font_color);
|
137 |
-
$week_font_color = '#' . str_replace('#','',$theme->week_font_color);
|
138 |
-
$views_tabs_bg_color = '#' . str_replace('#','',$theme->views_tabs_bg_color);
|
139 |
-
$views_tabs_text_color = '#' . str_replace('#','',$theme->views_tabs_text_color);
|
140 |
-
$views_tabs_font_size = $theme->views_tabs_font_size;
|
141 |
-
$show_cat = $theme->show_cat;
|
142 |
-
$header_format = (isset($theme->header_format) ? $theme->header_format : 'w/d/m/y');
|
143 |
-
|
144 |
-
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
145 |
-
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
146 |
-
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
147 |
-
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
148 |
-
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
149 |
-
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
150 |
-
$date_font_size = $theme->date_font_size;
|
151 |
-
$event_num_font_size = $theme->event_num_font_size;
|
152 |
-
$show_numbers_for_events = $theme->day_start;
|
153 |
-
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
154 |
-
|
155 |
-
__('January', 'sp_calendar');
|
156 |
-
__('February', 'sp_calendar');
|
157 |
-
__('March', 'sp_calendar');
|
158 |
-
__('April', 'sp_calendar');
|
159 |
-
__('May', 'sp_calendar');
|
160 |
-
__('June', 'sp_calendar');
|
161 |
-
__('July', 'sp_calendar');
|
162 |
-
__('August', 'sp_calendar');
|
163 |
-
__('September', 'sp_calendar');
|
164 |
-
__('October', 'sp_calendar');
|
165 |
-
__('November', 'sp_calendar');
|
166 |
-
__('December', 'sp_calendar');
|
167 |
-
if ($cell_height == '') {
|
168 |
-
$cell_height = 70;
|
169 |
-
}
|
170 |
-
if ($cal_width == '') {
|
171 |
-
$cal_width = 700;
|
172 |
-
}
|
173 |
-
if ($date != '') {
|
174 |
-
$date_REFERER = $date;
|
175 |
-
}
|
176 |
-
else {
|
177 |
-
$date_REFERER = date("Y-m");
|
178 |
-
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
179 |
-
}
|
180 |
-
$year_REFERER = substr($date_REFERER, 0, 4);
|
181 |
-
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
182 |
-
$day_REFERER = substr($date_REFERER, 8, 2);
|
183 |
-
|
184 |
-
$year = substr($date, 0, 4);
|
185 |
-
$month = Month_name(substr($date, 5, 2));
|
186 |
-
$day = substr($date, 8, 2);
|
187 |
-
|
188 |
-
$cell_width = $cal_width / 7;
|
189 |
-
$month_day_count = date('t', mktime(0, 0, 0, Month_num($month), 1, $year));
|
190 |
-
$prev_month_day_count = date('t', mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
191 |
-
|
192 |
-
if ($day > $month_day_count) {
|
193 |
-
$month = Month_name(Month_num($month) + 1);
|
194 |
-
$day = '01';
|
195 |
-
}
|
196 |
-
if ((int) $day < 1) {
|
197 |
-
$month = Month_name(Month_num($month) - 1);
|
198 |
-
$day = $prev_month_day_count;
|
199 |
-
}
|
200 |
-
|
201 |
-
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
202 |
-
$prev_month = add_0((int) $this_month - 1);
|
203 |
-
$next_month = add_0((int) $this_month + 1);
|
204 |
-
|
205 |
-
$view = 'bigcalendarday';
|
206 |
-
$views = explode(',', $view_select);
|
207 |
-
$defaultview = 'day';
|
208 |
-
array_pop($views);
|
209 |
-
$display = '';
|
210 |
-
if (count($views) == 0) {
|
211 |
-
$display = "display:none";
|
212 |
-
}
|
213 |
-
if(count($views) == 1 && $views[0] == $defaultview) {
|
214 |
-
$display = "display:none";
|
215 |
-
}
|
216 |
-
|
217 |
-
$activedate = explode('/', $header_format);
|
218 |
-
for ($i = 0; $i < 4; $i++) {
|
219 |
-
if (isset($activedate[$i]) && $activedate[$i] == 'w') unset($activedate[$i]);
|
220 |
-
if (isset($activedate[$i]) && $activedate[$i] == 'm') {
|
221 |
-
$activedate[$i] = 'F';
|
222 |
-
}
|
223 |
-
if (isset($activedate[$i]) && $activedate[$i] == 'y') {
|
224 |
-
$activedate[$i] = 'Y';
|
225 |
-
}
|
226 |
-
}
|
227 |
-
$activedatestr = "";
|
228 |
-
$header_date_format = implode(' ', $activedate);
|
229 |
-
$name_year = date($header_date_format, strtotime($date));
|
230 |
-
$exp_name_year = explode(' ', $name_year);
|
231 |
-
$exp_name_year = explode(' ', $name_year);
|
232 |
-
for($j = 0; $j < count($exp_name_year); $j++){
|
233 |
-
$activedatestr .= __($exp_name_year[$j], 'sp_calendar') . ' ';
|
234 |
-
}
|
235 |
-
?>
|
236 |
-
<html>
|
237 |
-
<head>
|
238 |
-
<style type='text/css'>
|
239 |
-
#afterbig<?php echo $many_sp_calendar; ?> table,
|
240 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
241 |
-
font-family: Segoe UI;
|
242 |
-
border: 0;
|
243 |
-
}
|
244 |
-
|
245 |
-
.day_ev{
|
246 |
-
border-top-left-radius: <?php echo $border_radius2 ?>px !important;
|
247 |
-
border-top-right-radius: <?php echo $border_radius2 ?>px !important;
|
248 |
-
border-radius: <?php echo $border_radius2 ?>px !important;
|
249 |
-
border-bottom-left-radius: <?php echo $border_radius2 ?>px !important;
|
250 |
-
}
|
251 |
-
#TB_iframeContent{
|
252 |
-
background-color: <?php echo $show_event_bgcolor; ?>;
|
253 |
-
}
|
254 |
-
|
255 |
-
#bigcalendar<?php echo $many_sp_calendar ?> td, #bigcalendar<?php echo $many_sp_calendar ?> tr, #spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
256 |
-
border: none !important;
|
257 |
-
}
|
258 |
-
#bigcalendar<?php echo $many_sp_calendar ?> .general_table {
|
259 |
-
border-radius: <?php echo $border_radius ?>px !important;
|
260 |
-
}
|
261 |
-
#bigcalendar<?php echo $many_sp_calendar ?> .top_table {
|
262 |
-
border-top-left-radius: <?php echo $border_radius2 ?>px !important;
|
263 |
-
border-top-right-radius: <?php echo $border_radius2 ?>px !important;
|
264 |
-
}
|
265 |
-
.general_table table table:last-child .day_ev:last-child td,
|
266 |
-
.general_table table table:last-child .week_list:last-child td{
|
267 |
-
border-bottom-left-radius:<?php echo $border_radius2?>px;
|
268 |
-
|
269 |
-
}
|
270 |
-
|
271 |
-
.general_table table tr:last-child >td:last-child{
|
272 |
-
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
273 |
-
border-top-right-radius: <?php echo $border_radius2 ?>px;
|
274 |
-
}
|
275 |
-
|
276 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-left {
|
277 |
-
width: 0px;
|
278 |
-
height: 0px;
|
279 |
-
border-top: 15px solid transparent;
|
280 |
-
border-bottom: 15px solid transparent;
|
281 |
-
border-right: 20px solid;
|
282 |
-
margin: 0 auto;
|
283 |
-
}
|
284 |
-
|
285 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-right {
|
286 |
-
width: 0px;
|
287 |
-
height: 0px;
|
288 |
-
border-top: 15px solid transparent;
|
289 |
-
border-bottom: 15px solid transparent;
|
290 |
-
border-left: 20px solid;
|
291 |
-
margin: 0 auto;
|
292 |
-
}
|
293 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-right{
|
294 |
-
border-top: 5px solid transparent;
|
295 |
-
border-bottom: 5px solid transparent;
|
296 |
-
border-left: 8px solid;
|
297 |
-
left: 5px;
|
298 |
-
position: relative;
|
299 |
-
}
|
300 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-down{
|
301 |
-
width: 0px;
|
302 |
-
height: 0px;
|
303 |
-
border-left: 5px solid transparent;
|
304 |
-
border-right: 5px solid transparent;
|
305 |
-
border-top: 8px solid;
|
306 |
-
}
|
307 |
-
|
308 |
-
#bigcalendar<?php echo $many_sp_calendar ?> .cala_arrow a:link, #bigcalendar .cala_arrow a:visited {
|
309 |
-
text-decoration: none !important;
|
310 |
-
box-shadow: none !important;
|
311 |
-
background: none !important;
|
312 |
-
font-size: <?php echo $arrow_size ?>px !important;
|
313 |
-
}
|
314 |
-
#bigcalendar<?php echo $many_sp_calendar ?> .cala_arrow {
|
315 |
-
vertical-align: middle !important;
|
316 |
-
}
|
317 |
-
#bigcalendar<?php echo $many_sp_calendar ?> .cala_arrow a:hover {
|
318 |
-
font-size: <?php echo $arrow_size_hover ?>px !important;
|
319 |
-
text-decoration: none !important;
|
320 |
-
background: none !important;
|
321 |
-
}
|
322 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link, #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
323 |
-
text-decoration: none !important;
|
324 |
-
background: none !important;
|
325 |
-
font-size: 12px !important;
|
326 |
-
color: red;
|
327 |
-
}
|
328 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
329 |
-
text-decoration: none !important;
|
330 |
-
background: none !important;
|
331 |
-
}
|
332 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
333 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
334 |
-
<?php echo 'vertical-align:top !important;'; ?>
|
335 |
-
}
|
336 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
337 |
-
vertical-align: middle !important;
|
338 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
339 |
-
}
|
340 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
341 |
-
font-size: <?php echo $weekdays_font_size; ?>px !important;
|
342 |
-
}
|
343 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
344 |
-
border-spacing: 0 !important;
|
345 |
-
width: 100% !important;
|
346 |
-
}
|
347 |
-
.calyear_table table #bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
348 |
-
border-spacing: 0 !important;
|
349 |
-
width: 100% !important;
|
350 |
-
}
|
351 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg, #bigcalendar .calbg td {
|
352 |
-
text-align: center !important;
|
353 |
-
width: 14% !important;
|
354 |
-
}
|
355 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
356 |
-
color: <?php echo $text_color_other_months; ?> !important;
|
357 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
358 |
-
<?php echo 'vertical-align:top !important;'; ?>
|
359 |
-
}
|
360 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
361 |
-
color: <?php echo $text_color_this_month_unevented; ?> !important;
|
362 |
-
}
|
363 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
364 |
-
font-size: 24px !important;
|
365 |
-
font-weight: bold !important;
|
366 |
-
color: <?php echo $text_color_year; ?> !important;
|
367 |
-
}
|
368 |
-
.general_table table, .general_table td, .general_table tr {
|
369 |
-
border: inherit !important;
|
370 |
-
vertical-align: initial !important;
|
371 |
-
border-collapse: inherit !important;
|
372 |
-
margin: inherit !important;
|
373 |
-
padding: inherit !important;
|
374 |
-
}
|
375 |
-
.general_table {
|
376 |
-
border-collapse: inherit !important;
|
377 |
-
margin: inherit !important;
|
378 |
-
}
|
379 |
-
.general_table p {
|
380 |
-
margin: inherit !important;
|
381 |
-
padding: inherit !important;
|
382 |
-
}
|
383 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
384 |
-
color: <?php echo $sun_days ?> !important;
|
385 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
386 |
-
<?php echo 'vertical-align:top !important; text-align:left !important;'; ?>
|
387 |
-
background-color: <?php echo $sundays_bg_color; ?> !important;
|
388 |
-
}
|
389 |
-
#TB_window {
|
390 |
-
z-index: 10000;
|
391 |
-
}
|
392 |
-
|
393 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> td {
|
394 |
-
vertical-align: middle !important;
|
395 |
-
}
|
396 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table {
|
397 |
-
border-collapse: initial;
|
398 |
-
border:0px;
|
399 |
-
max-width: none;
|
400 |
-
}
|
401 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table tr:hover td {
|
402 |
-
background: none;
|
403 |
-
}
|
404 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
405 |
-
padding: 0px;
|
406 |
-
vertical-align: none;
|
407 |
-
border-top:none;
|
408 |
-
line-height: none;
|
409 |
-
text-align: none;
|
410 |
-
background: transparent;
|
411 |
-
}
|
412 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
413 |
-
margin-bottom:0;
|
414 |
-
}
|
415 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
416 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
417 |
-
#spiderCalendarTitlesList td,
|
418 |
-
#spiderCalendarTitlesList tr {
|
419 |
-
border:none;
|
420 |
-
}
|
421 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
422 |
-
border-radius: <?php echo $border_radius; ?>px;
|
423 |
-
}
|
424 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
425 |
-
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
426 |
-
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
427 |
-
}
|
428 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
429 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
430 |
-
text-decoration:none !important;
|
431 |
-
background:none;
|
432 |
-
font-size: <?php echo $arrow_size; ?>px;
|
433 |
-
}
|
434 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
435 |
-
text-decoration:none;
|
436 |
-
background:none;
|
437 |
-
}
|
438 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
439 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
440 |
-
text-decoration:none;
|
441 |
-
background:none;
|
442 |
-
font-size:12px;
|
443 |
-
color:red;
|
444 |
-
}
|
445 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
446 |
-
text-decoration:none;
|
447 |
-
background:none;
|
448 |
-
}
|
449 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
450 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
451 |
-
vertical-align:top;
|
452 |
-
}
|
453 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
454 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
455 |
-
}
|
456 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
457 |
-
font-size:<?php echo $weekdays_font_size; ?>px;
|
458 |
-
}
|
459 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
460 |
-
border-spacing:0;
|
461 |
-
width:100%;
|
462 |
-
}
|
463 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
464 |
-
border-spacing:0;
|
465 |
-
width:100%;
|
466 |
-
}
|
467 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
468 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
|
469 |
-
text-align:center;
|
470 |
-
width:14%;
|
471 |
-
}
|
472 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
473 |
-
color:<?php echo $text_color_other_months; ?>;
|
474 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
475 |
-
vertical-align:top;
|
476 |
-
}
|
477 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
478 |
-
color:<?php echo $text_color_this_month_unevented; ?>;
|
479 |
-
}
|
480 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
481 |
-
font-size:24px;
|
482 |
-
font-weight:bold;
|
483 |
-
color:<?php echo $text_color_year; ?>;
|
484 |
-
}
|
485 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
486 |
-
color:<?php echo $sun_days; ?>;
|
487 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
488 |
-
vertical-align:top;
|
489 |
-
text-align:left;
|
490 |
-
background-color:<?php echo $sundays_bg_color; ?>;
|
491 |
-
}
|
492 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
493 |
-
float: right;
|
494 |
-
background-color: <?php echo $views_tabs_bg_color; ?>;
|
495 |
-
min-height: 25px;
|
496 |
-
min-width: 70px;
|
497 |
-
margin-left: 2px;
|
498 |
-
text-align: center;
|
499 |
-
cursor:pointer;
|
500 |
-
position: relative;
|
501 |
-
top: 5px;
|
502 |
-
}
|
503 |
-
|
504 |
-
|
505 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
506 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
507 |
-
{
|
508 |
-
background-color: <?php echo $views_tabs_bg_color?>;
|
509 |
-
width: 120px;
|
510 |
-
text-align: center;
|
511 |
-
cursor: pointer;
|
512 |
-
padding: 6px;
|
513 |
-
position: relative;
|
514 |
-
}
|
515 |
-
|
516 |
-
#afterbig<?php echo $many_sp_calendar; ?> .views span,
|
517 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
518 |
-
line-height: 30px;
|
519 |
-
}
|
520 |
-
|
521 |
-
#drop_down_views
|
522 |
-
{
|
523 |
-
list-style-type:none !important;
|
524 |
-
position: absolute;
|
525 |
-
top: 46px;
|
526 |
-
left: 0px;
|
527 |
-
display:none;
|
528 |
-
z-index: 4545;
|
529 |
-
margin-left: 0;
|
530 |
-
}
|
531 |
-
|
532 |
-
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
533 |
-
{
|
534 |
-
background:<?php echo $bg_top ?>;
|
535 |
-
}
|
536 |
-
|
537 |
-
#drop_down_views >li
|
538 |
-
{
|
539 |
-
border-bottom:1px solid #fff !important;
|
540 |
-
}
|
541 |
-
|
542 |
-
|
543 |
-
#views_tabs_select
|
544 |
-
{
|
545 |
-
display:none;
|
546 |
-
}
|
547 |
-
|
548 |
-
</style>
|
549 |
-
</head>
|
550 |
-
<body>
|
551 |
-
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
552 |
-
<div style="width:100%;">
|
553 |
-
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
554 |
-
<tr>
|
555 |
-
<td>
|
556 |
-
|
557 |
-
<div id="views_tabs" style="width: 100%;<?php echo $display ?>">
|
558 |
-
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
559 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
560 |
-
'action' => 'spiderbigcalendar_day',
|
561 |
-
'theme_id' => $theme_id,
|
562 |
-
'calendar' => $calendar_id,
|
563 |
-
'select' => $view_select,
|
564 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
565 |
-
'many_sp_calendar' => $many_sp_calendar,
|
566 |
-
'cat_id' => '',
|
567 |
-
'cat_ids' => $cat_ids,
|
568 |
-
'widget' => $widget,
|
569 |
-
'rand' => $many_sp_calendar,
|
570 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Day', 'sp_calendar'); ?></span>
|
571 |
-
</div>
|
572 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
573 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
574 |
-
'action' => 'spiderbigcalendar_week',
|
575 |
-
'theme_id' => $theme_id,
|
576 |
-
'calendar' => $calendar_id,
|
577 |
-
'select' => $view_select,
|
578 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
579 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
580 |
-
'many_sp_calendar' => $many_sp_calendar,
|
581 |
-
'cat_id' => '',
|
582 |
-
'cat_ids' => $cat_ids,
|
583 |
-
'widget' => $widget,
|
584 |
-
'rand' => $many_sp_calendar,
|
585 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Week', 'sp_calendar'); ?></span>
|
586 |
-
</div>
|
587 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
588 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
589 |
-
'action' => 'spiderbigcalendar_list',
|
590 |
-
'theme_id' => $theme_id,
|
591 |
-
'calendar' => $calendar_id,
|
592 |
-
'select' => $view_select,
|
593 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
594 |
-
'many_sp_calendar' => $many_sp_calendar,
|
595 |
-
'cat_id' => '',
|
596 |
-
'cat_ids' => $cat_ids,
|
597 |
-
'widget' => $widget,
|
598 |
-
'rand' => $many_sp_calendar,
|
599 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('List', 'sp_calendar'); ?></span>
|
600 |
-
</div>
|
601 |
-
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
602 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
603 |
-
'action' => 'spiderbigcalendar_month',
|
604 |
-
'theme_id' => $theme_id,
|
605 |
-
'calendar' => $calendar_id,
|
606 |
-
'select' => $view_select,
|
607 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
608 |
-
'many_sp_calendar' => $many_sp_calendar,
|
609 |
-
'cat_id' => '',
|
610 |
-
'cat_ids' => $cat_ids,
|
611 |
-
'widget' => $widget,
|
612 |
-
'rand' => $many_sp_calendar,
|
613 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Month', 'sp_calendar'); ?></span>
|
614 |
-
</div>
|
615 |
-
</div>
|
616 |
-
<div id="views_tabs_select" style="display:none" >
|
617 |
-
<div id="views_select" style="background-color:<?php echo $bg_top?> !important;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
618 |
-
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
619 |
-
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
620 |
-
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
621 |
-
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
622 |
-
<div class="arrow-right show_arrow"></div>
|
623 |
-
<div class="arrow-down"></div>
|
624 |
-
</div>
|
625 |
-
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
626 |
-
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
627 |
-
<div class="views_select"
|
628 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
629 |
-
'action' => 'spiderbigcalendar_day',
|
630 |
-
'theme_id' => $theme_id,
|
631 |
-
'calendar' => $calendar_id,
|
632 |
-
'select' => $view_select,
|
633 |
-
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
634 |
-
'many_sp_calendar' => $many_sp_calendar,
|
635 |
-
'cat_id' => '',
|
636 |
-
'cat_ids' => $cat_ids,
|
637 |
-
'widget' => $widget,
|
638 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
639 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
640 |
-
</div>
|
641 |
-
</li>
|
642 |
-
|
643 |
-
<li <?php if($view=='bigcalendarweek'):?> class="active" <?php endif; ?> style="<?php if(!in_array('week',$views) AND $defaultview!='week' ) echo 'display:none;' ; ?>" ><div class="views_select"
|
644 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
645 |
-
'action' => 'spiderbigcalendar_week',
|
646 |
-
'theme_id' => $theme_id,
|
647 |
-
'calendar' => $calendar_id,
|
648 |
-
'select' => $view_select,
|
649 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
650 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
651 |
-
'many_sp_calendar' => $many_sp_calendar,
|
652 |
-
'cat_id' => '',
|
653 |
-
'cat_ids' => $cat_ids,
|
654 |
-
'widget' => $widget,
|
655 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
656 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
657 |
-
</div>
|
658 |
-
</li>
|
659 |
-
|
660 |
-
<li <?php if($view=='bigcalendarlist'):?> class="active" <?php endif; ?> style="<?php if(!in_array('list',$views) AND $defaultview!='list' ) echo 'display:none;' ;?>"><div class="views_select"
|
661 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
662 |
-
'action' => 'spiderbigcalendar_list',
|
663 |
-
'theme_id' => $theme_id,
|
664 |
-
'calendar' => $calendar_id,
|
665 |
-
'select' => $view_select,
|
666 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
667 |
-
'many_sp_calendar' => $many_sp_calendar,
|
668 |
-
'cat_id' => '',
|
669 |
-
'cat_ids' => $cat_ids,
|
670 |
-
'widget' => $widget,
|
671 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
672 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
673 |
-
</div>
|
674 |
-
</li>
|
675 |
-
|
676 |
-
<li <?php if($view=='bigcalendarmonth'):?> class="active" <?php endif; ?> style="<?php if(!in_array('month',$views) AND $defaultview!='month' ) echo 'display:none;'; ?>"><div class="views_select"
|
677 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
678 |
-
'action' => 'spiderbigcalendar_month',
|
679 |
-
'theme_id' => $theme_id,
|
680 |
-
'calendar' => $calendar_id,
|
681 |
-
'select' => $view_select,
|
682 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
683 |
-
'many_sp_calendar' => $many_sp_calendar,
|
684 |
-
'cat_id' => '',
|
685 |
-
'cat_ids' => $cat_ids,
|
686 |
-
'widget' => $widget,
|
687 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
688 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Month</span></div></li>
|
689 |
-
|
690 |
-
</ul>
|
691 |
-
</div>
|
692 |
-
|
693 |
-
</td>
|
694 |
-
</tr>
|
695 |
-
<tr>
|
696 |
-
<td>
|
697 |
-
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width:100%; border:<?php echo $border_color; ?> solid <?php echo $border_width; ?>px; margin:0; padding:0; background-color:<?php echo $bg_bottom; ?> !important;">
|
698 |
-
<tr>
|
699 |
-
<td width="100%" style="padding:0; margin:0;">
|
700 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;" >
|
701 |
-
<tr style="height:40px; width:100%;">
|
702 |
-
<td class="top_table" align="center" colspan="7" style="position: relative;padding:0; margin:0; background-color:<?php echo $bg_top; ?> !important;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
703 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width:99.8%; height:<?php echo $top_height; ?>px;">
|
704 |
-
<tr>
|
705 |
-
<td width="15%">
|
706 |
-
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
707 |
-
echo add_query_arg(array(
|
708 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
709 |
-
'theme_id' => $theme_id,
|
710 |
-
'calendar' => $calendar_id,
|
711 |
-
'select' => $view_select,
|
712 |
-
'date' => ($year - 1) . '-' . add_0((Month_num($month))) . '-' . $day,
|
713 |
-
'many_sp_calendar' => $many_sp_calendar,
|
714 |
-
'cat_id' => '',
|
715 |
-
'cat_ids' => $cat_ids,
|
716 |
-
'widget' => $widget,
|
717 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color: <?php echo hex_to_rgb($views_tabs_bg_color, 0.4) ?>;">
|
718 |
-
<span style="font-size:18px; color:#FFF"><?php echo $year - 1; ?></span>
|
719 |
-
</div>
|
720 |
-
</td>
|
721 |
-
<td style="width:100%;vertical-align:center">
|
722 |
-
<table style="width:100%;">
|
723 |
-
<tr>
|
724 |
-
<td class="cala_arrow" width="11%" style="text-align:right;margin:0px;padding: 0px 30px 0px 0px !important;">
|
725 |
-
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
726 |
-
|
727 |
-
if ($day == '01' && Month_num(Month_name(Month_num($month) - 1)) != '12') {
|
728 |
-
$needed_date = $year . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
729 |
-
}
|
730 |
-
|
731 |
-
else
|
732 |
-
{
|
733 |
-
if (Month_num(Month_name(Month_num($month) - 1)) == '12' && $day == '01') {
|
734 |
-
|
735 |
-
$needed_date = ($year - 1) . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
736 |
-
}
|
737 |
-
else {
|
738 |
-
$needed_date = $year . '-' . add_0((Month_num($month))) . '-' . add_0($day - 1);
|
739 |
-
}
|
740 |
-
}
|
741 |
-
echo add_query_arg(array(
|
742 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
743 |
-
'theme_id' => $theme_id,
|
744 |
-
'calendar' => $calendar_id,
|
745 |
-
'select' => $view_select,
|
746 |
-
'date' => $needed_date,
|
747 |
-
'many_sp_calendar' => $many_sp_calendar,
|
748 |
-
'cat_id' => '',
|
749 |
-
'cat_ids' => $cat_ids,
|
750 |
-
'widget' => $widget,
|
751 |
-
), $site_url);
|
752 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❰
|
753 |
-
</a>
|
754 |
-
</td>
|
755 |
-
<td style="text-align:center; margin:0;" width="40%">
|
756 |
-
<input type="hidden" name="month" readonly="" value="<?php echo $month?>"/>
|
757 |
-
<span style="line-height: 30px;font-family:arial; color:<?php echo $text_color_month; ?>; font-size:<?php echo $month_font_size ?>px;text-shadow: 1px 1px black;"><?php echo $activedatestr; ?></span>
|
758 |
-
</td>
|
759 |
-
<?php
|
760 |
-
if ($day == $month_day_count && Month_num(Month_name(Month_num($month) + 1)) != '1') {
|
761 |
-
$needed_date = $year . '-' . add_0((Month_num($month) + 1)) . '-01';
|
762 |
-
|
763 |
-
}
|
764 |
-
else
|
765 |
-
{
|
766 |
-
|
767 |
-
if (Month_num(Month_name(Month_num($month) + 1)) == '1' && $day == $month_day_count) {
|
768 |
-
$needed_date = ($year + 1) . '-' . add_0(Month_num($month + 1)) . '-01';
|
769 |
-
|
770 |
-
}
|
771 |
-
else {
|
772 |
-
$needed_date = $year . '-' . add_0(Month_num($month)) . '-' . add_0($day + 1);
|
773 |
-
}
|
774 |
-
}
|
775 |
-
|
776 |
-
?>
|
777 |
-
|
778 |
-
<td style="margin:0; padding: 0px 0px 0px 30px !important; text-align:left" width="11%" class="cala_arrow">
|
779 |
-
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
780 |
-
|
781 |
-
echo add_query_arg(array(
|
782 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
783 |
-
'theme_id' => $theme_id,
|
784 |
-
'calendar' => $calendar_id,
|
785 |
-
'select' => $view_select,
|
786 |
-
'date' => $needed_date,
|
787 |
-
'many_sp_calendar' => $many_sp_calendar,
|
788 |
-
'cat_id' => '',
|
789 |
-
'cat_ids' => $cat_ids,
|
790 |
-
'widget' => $widget,
|
791 |
-
), $site_url);
|
792 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❱
|
793 |
-
</a>
|
794 |
-
</td>
|
795 |
-
<td width="15%">
|
796 |
-
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
797 |
-
echo add_query_arg(array(
|
798 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
799 |
-
'theme_id' => $theme_id,
|
800 |
-
'calendar' => $calendar_id,
|
801 |
-
'select' => $view_select,
|
802 |
-
'date' => ($year + 1) . '-' . add_0((Month_num($month))) . '-' . $day,
|
803 |
-
'many_sp_calendar' => $many_sp_calendar,
|
804 |
-
'cat_id' => '',
|
805 |
-
'cat_ids' => $cat_ids,
|
806 |
-
'widget' => $widget,
|
807 |
-
), $site_url); ?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color: <?php echo hex_to_rgb($views_tabs_bg_color, 0.4) ?>;">
|
808 |
-
<span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
|
809 |
-
</div>
|
810 |
-
</td>
|
811 |
-
</tr>
|
812 |
-
</table>
|
813 |
-
</td>
|
814 |
-
</tr>
|
815 |
-
</table>
|
816 |
-
</td>
|
817 |
-
|
818 |
-
</tr>
|
819 |
-
</tr>
|
820 |
-
<tr>
|
821 |
-
<td>
|
822 |
-
<?php
|
823 |
-
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
824 |
-
if ($weekstart == "su") {
|
825 |
-
$month_first_weekday++;
|
826 |
-
if ($month_first_weekday == 8) {
|
827 |
-
$month_first_weekday = 1;
|
828 |
-
}
|
829 |
-
}
|
830 |
-
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
831 |
-
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
832 |
-
$weekday_i = $month_first_weekday;
|
833 |
-
$last_month_days = $last_month_days - $weekday_i + 2;
|
834 |
-
$percent = 1;
|
835 |
-
$sum = $month_days - 8 + $month_first_weekday;
|
836 |
-
if ($sum % 7 <> 0) {
|
837 |
-
$percent = $percent + 1;
|
838 |
-
}
|
839 |
-
$sum = $sum - ($sum % 7);
|
840 |
-
$percent = $percent + ($sum / 7);
|
841 |
-
$percent = 107 / $percent;
|
842 |
-
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
843 |
-
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
844 |
-
$calendar = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
845 |
-
$array_days = $all_calendar_files[0]['array_days'];
|
846 |
-
$array_days1 = $all_calendar_files[0]['array_days1'];
|
847 |
-
$title = $all_calendar_files[0]['title'];
|
848 |
-
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
849 |
-
sort($array_days, SORT_NUMERIC);
|
850 |
-
if (!$array_days || !in_array((int) $day, $array_days)) {
|
851 |
-
$week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
|
852 |
-
echo '<table style="border-spacing:0;width:100%;border-bottom:1px solid ' . $cell_border_color . '">
|
853 |
-
<tr>
|
854 |
-
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . ' !important; color:#6E7276">
|
855 |
-
<span style="padding-left:10px; font-size:' . $week_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
856 |
-
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
|
857 |
-
</td>
|
858 |
-
</tr>
|
859 |
-
<tr>
|
860 |
-
<td>
|
861 |
-
<table style="border-bottom-left-radius: '.$border_radius2.'px;border-bottom-right-radius: '.$border_radius2.'px;height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '" class="week_list">
|
862 |
-
<tr>
|
863 |
-
<td style="font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ' !important;color:' . $event_num_color . '"></td>
|
864 |
-
<td><p style="color:' . $event_title_color . ';border:none;"> ' . __('There are no events on this date', 'sp_calendar') . '</p></td>
|
865 |
-
</tr>
|
866 |
-
</table>
|
867 |
-
</td>
|
868 |
-
</tr>
|
869 |
-
</table>';
|
870 |
-
}
|
871 |
-
if (in_array((int) $day, $array_days)) {
|
872 |
-
$week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
|
873 |
-
echo '<table style="border-spacing:0;width:100%;border-bottom:1px solid ' . $cell_border_color . '">
|
874 |
-
<tr>
|
875 |
-
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . ' !important; color:#6E7276">
|
876 |
-
<span style="padding-left:10px; font-size:' . $date_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
877 |
-
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
|
878 |
-
</td>
|
879 |
-
<tr>
|
880 |
-
<td>';
|
881 |
-
foreach ($title as $key => $value) {
|
882 |
-
if ($key == (int) $day) {
|
883 |
-
$ev_id = explode('<br>', $ev_ids[$key]);
|
884 |
-
array_pop($ev_id);
|
885 |
-
$ev_ids_inline = implode(',', $ev_id);
|
886 |
-
$ev_title = explode('</p>', $value);
|
887 |
-
array_pop($ev_title);
|
888 |
-
for ($j = 0; $j < count($ev_title); $j++) {
|
889 |
-
|
890 |
-
|
891 |
-
$query =$wpdb->prepare ( "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
892 |
-
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
893 |
-
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d" ,$calendar ,$ev_id[$j] );
|
894 |
-
|
895 |
-
$cat_color = $wpdb->get_row($query);
|
896 |
-
|
897 |
-
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color=$bg_top;};
|
898 |
-
|
899 |
-
if (($j + 1) % 2 == 0) {
|
900 |
-
$color = $event_num_bg_color2;
|
901 |
-
$table_color = $event_bg_color2;
|
902 |
-
}
|
903 |
-
else {
|
904 |
-
$color = $event_num_bg_color1;
|
905 |
-
$table_color = $event_bg_color1;
|
906 |
-
}
|
907 |
-
|
908 |
-
echo '<table style="margin: 0;border-spacing:0;height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . ' !important;" class="day_ev">
|
909 |
-
<tr>
|
910 |
-
<td style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color: #' . str_replace('#','',$cat_color->color) . ' !important;color:' . $event_num_color . '">' . (($show_numbers_for_events) ? ($j + 1) : '') . '</td>
|
911 |
-
<td>
|
912 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:15px;background:none;text-decoration:none;color:' . $event_title_color . '; "
|
913 |
-
href="' . add_query_arg(array(
|
914 |
-
'action' => 'spidercalendarbig',
|
915 |
-
'theme_id' => $theme_id,
|
916 |
-
'calendar_id' => $calendar_id,
|
917 |
-
'ev_ids' => $ev_ids_inline,
|
918 |
-
'eventID' => $ev_id[$j],
|
919 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . (int) $day,
|
920 |
-
'many_sp_calendar' => $many_sp_calendar,
|
921 |
-
'widget' => $widget,
|
922 |
-
'TB_iframe' => 1,
|
923 |
-
'tbWidth' => $popup_width,
|
924 |
-
'tbHeight' => $popup_height,
|
925 |
-
), $site_url) . '"><b>' . $ev_title[$j] . '</b>
|
926 |
-
</a>
|
927 |
-
</td>
|
928 |
-
</tr>
|
929 |
-
</table>';
|
930 |
-
}
|
931 |
-
}
|
932 |
-
}
|
933 |
-
echo '</td></tr></table>';
|
934 |
-
}
|
935 |
-
?>
|
936 |
-
</td>
|
937 |
-
</tr>
|
938 |
-
</table>
|
939 |
-
</tr>
|
940 |
-
</table>
|
941 |
-
</td>
|
942 |
-
</tr>
|
943 |
-
</table>
|
944 |
-
<style>
|
945 |
-
@media only screen and (max-width : 640px) {
|
946 |
-
#views_tabs ,#drop_down_views
|
947 |
-
{
|
948 |
-
display:none;
|
949 |
-
}
|
950 |
-
|
951 |
-
#views_tabs_select
|
952 |
-
{
|
953 |
-
display:block !important;
|
954 |
-
}
|
955 |
-
}
|
956 |
-
|
957 |
-
@media only screen and (max-width : 968px) {
|
958 |
-
#cats >li
|
959 |
-
{
|
960 |
-
float:none;
|
961 |
-
}
|
962 |
-
}
|
963 |
-
|
964 |
-
.spider_categories{
|
965 |
-
display:inline-block;
|
966 |
-
cursor:pointer;
|
967 |
-
}
|
968 |
-
|
969 |
-
.spider_categories p{
|
970 |
-
color: #fff;
|
971 |
-
padding: 2px 10px !important;
|
972 |
-
margin: 2px 0 !important;
|
973 |
-
font-size: 14px;
|
974 |
-
font-weight: 600;
|
975 |
-
}
|
976 |
-
</style>
|
977 |
-
<?php
|
978 |
-
|
979 |
-
//reindex cat_ids_array
|
980 |
-
$re_cat_ids_array = array_values($cat_ids_array);
|
981 |
-
|
982 |
-
for($i=0; $i<count($re_cat_ids_array); $i++)
|
983 |
-
{
|
984 |
-
echo'
|
985 |
-
<style>
|
986 |
-
#cats #category'.$re_cat_ids_array[$i].'
|
987 |
-
{
|
988 |
-
text-decoration:underline;
|
989 |
-
cursor:pointer;
|
990 |
-
|
991 |
-
}
|
992 |
-
|
993 |
-
</style>';
|
994 |
-
|
995 |
-
}
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
if($cat_ids=='')
|
1000 |
-
$cat_ids='';
|
1001 |
-
if($show_cat){
|
1002 |
-
echo '<ul id="cats" style="list-style-type:none; padding: 0;">';
|
1003 |
-
|
1004 |
-
|
1005 |
-
foreach($categories as $category)
|
1006 |
-
{
|
1007 |
-
|
1008 |
-
?>
|
1009 |
-
|
1010 |
-
<li class="spider_categories"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1011 |
-
'action' => 'spiderbigcalendar_day',
|
1012 |
-
'theme_id' => $theme_id,
|
1013 |
-
'calendar' => $calendar_id,
|
1014 |
-
'select' => $view_select,
|
1015 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
|
1016 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1017 |
-
'cat_id' => $category->id,
|
1018 |
-
'cat_ids' => $cat_ids,
|
1019 |
-
'widget' => $widget,
|
1020 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1021 |
-
|
1022 |
-
|
1023 |
-
<?php
|
1024 |
-
}
|
1025 |
-
if (!empty($categories)) {
|
1026 |
-
?>
|
1027 |
-
<li class="spider_categories"><p id="category0" style="background-color:#<?php echo str_replace('#','',$bg_top); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1028 |
-
'action' => 'spiderbigcalendar_day',
|
1029 |
-
'theme_id' => $theme_id,
|
1030 |
-
'calendar' => $calendar_id,
|
1031 |
-
'select' => $view_select,
|
1032 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
|
1033 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1034 |
-
'cat_id' => '',
|
1035 |
-
'cat_ids' => '',
|
1036 |
-
'widget' => $widget,
|
1037 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
1038 |
-
<?php echo '</ul>';
|
1039 |
-
}
|
1040 |
-
} ?>
|
1041 |
-
</body>
|
1042 |
-
</html>
|
1043 |
-
<?php
|
1044 |
-
die();
|
1045 |
-
}
|
1046 |
-
|
1047 |
?>
|
1 |
+
<?php
|
2 |
+
function big_calendar_day() {
|
3 |
+
require_once("frontend_functions.php");
|
4 |
+
global $wpdb;
|
5 |
+
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
+
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
+
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
+
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 30);
|
9 |
+
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
10 |
+
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
+
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
12 |
+
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
13 |
+
$site_url = get_admin_url().'admin-ajax.php';
|
14 |
+
///////////////////////////////////////////////////////////////////////////////////
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
if($cat_ids=='')
|
19 |
+
$cat_ids .= $cat_id.',';
|
20 |
+
else
|
21 |
+
$cat_ids .= ','.$cat_id.',';
|
22 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
23 |
+
|
24 |
+
function getelementcountinarray($array , $element)
|
25 |
+
{
|
26 |
+
$t=0;
|
27 |
+
|
28 |
+
for($i=0; $i<count($array); $i++)
|
29 |
+
{
|
30 |
+
if($element==$array[$i])
|
31 |
+
$t++;
|
32 |
+
|
33 |
+
}
|
34 |
+
|
35 |
+
|
36 |
+
return $t;
|
37 |
+
|
38 |
+
}
|
39 |
+
|
40 |
+
function getelementindexinarray($array , $element)
|
41 |
+
{
|
42 |
+
|
43 |
+
$t='';
|
44 |
+
|
45 |
+
for($i=0; $i<count($array); $i++)
|
46 |
+
{
|
47 |
+
if($element==$array[$i])
|
48 |
+
$t.=$i.',';
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
return $t;
|
53 |
+
|
54 |
+
|
55 |
+
}
|
56 |
+
$cat_ids_array = explode(',',$cat_ids);
|
57 |
+
|
58 |
+
|
59 |
+
if($cat_id!='')
|
60 |
+
{
|
61 |
+
|
62 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
63 |
+
{
|
64 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
65 |
+
$index_array = explode(',' , $index_in_line);
|
66 |
+
array_pop ($index_array);
|
67 |
+
for($j=0; $j<count($index_array); $j++)
|
68 |
+
unset($cat_ids_array[$index_array[$j]]);
|
69 |
+
$cat_ids = implode(',',$cat_ids_array);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
else
|
73 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
74 |
+
|
75 |
+
|
76 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
77 |
+
|
78 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
79 |
+
$cal_width = $theme->width;
|
80 |
+
$bg_top = '#' . str_replace('#','',$theme->bg_top);
|
81 |
+
$bg_bottom = '#' . str_replace('#','',$theme->bg_bottom);
|
82 |
+
$border_color = '#' . str_replace('#','',$theme->border_color);
|
83 |
+
$text_color_year = '#' . str_replace('#','',$theme->text_color_year);
|
84 |
+
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
85 |
+
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
86 |
+
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
87 |
+
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
88 |
+
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
89 |
+
$evented_color_bg = (isset($theme->bg_color_this_month_evented) ?'#' . str_replace('#','',$theme->bg_color_this_month_evented) : '');
|
90 |
+
$color_arrow_year = '#' . str_replace('#','',$theme->arrow_color_year);
|
91 |
+
$color_arrow_month = '#' . str_replace('#','',$theme->arrow_color_month);
|
92 |
+
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
93 |
+
$event_title_color = '#' . str_replace('#','',$theme->event_title_color);
|
94 |
+
$current_day_border_color = '#' . str_replace('#','',$theme->current_day_border_color);
|
95 |
+
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
96 |
+
$cell_height = $theme->cell_height;
|
97 |
+
$popup_width = $theme->popup_width;
|
98 |
+
$popup_height = $theme->popup_height;
|
99 |
+
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
100 |
+
$sundays_font_size = $theme->sundays_font_size;
|
101 |
+
$other_days_font_size = $theme->other_days_font_size;
|
102 |
+
$weekdays_font_size = $theme->weekdays_font_size;
|
103 |
+
$border_width = $theme->border_width;
|
104 |
+
$top_height = $theme->top_height;
|
105 |
+
$bg_color_other_months = '#' . str_replace('#','',$theme->bg_color_other_months);
|
106 |
+
$sundays_bg_color = '#' . str_replace('#','',$theme->sundays_bg_color);
|
107 |
+
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
108 |
+
$weekstart = $theme->week_start_day;
|
109 |
+
$weekday_sunday_bg_color = '#' . str_replace('#','',$theme->weekday_sunday_bg_color);
|
110 |
+
$border_radius = $theme->border_radius;
|
111 |
+
$border_radius2 = $border_radius-$border_width;
|
112 |
+
$week_days_cell_height = $theme->week_days_cell_height;
|
113 |
+
$year_font_size = $theme->year_font_size;
|
114 |
+
$month_font_size = $theme->month_font_size;
|
115 |
+
$arrow_size = $theme->arrow_size;
|
116 |
+
$arrow_size_hover = $arrow_size;
|
117 |
+
$next_month_text_color = '#' . str_replace('#','',$theme->next_month_text_color);
|
118 |
+
$prev_month_text_color = '#' . str_replace('#','',$theme->prev_month_text_color);
|
119 |
+
$next_month_arrow_color = '#' . str_replace('#','',$theme->next_month_arrow_color);
|
120 |
+
$prev_month_arrow_color = '#' . str_replace('#','',$theme->prev_month_arrow_color);
|
121 |
+
$next_month_font_size = $theme->next_month_font_size;
|
122 |
+
$prev_month_font_size = $theme->prev_month_font_size;
|
123 |
+
$month_type = $theme->month_type;
|
124 |
+
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
125 |
+
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
126 |
+
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
127 |
+
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
128 |
+
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
129 |
+
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
130 |
+
$date_font_size = $theme->date_font_size;
|
131 |
+
$event_num_font_size = $theme->event_num_font_size;
|
132 |
+
$event_table_height = $theme->event_table_height;
|
133 |
+
$date_height = $theme->date_height;
|
134 |
+
$day_month_font_size = $theme->day_month_font_size;
|
135 |
+
$week_font_size = $theme->week_font_size;
|
136 |
+
$day_month_font_color = '#' . str_replace('#','',$theme->day_month_font_color);
|
137 |
+
$week_font_color = '#' . str_replace('#','',$theme->week_font_color);
|
138 |
+
$views_tabs_bg_color = '#' . str_replace('#','',$theme->views_tabs_bg_color);
|
139 |
+
$views_tabs_text_color = '#' . str_replace('#','',$theme->views_tabs_text_color);
|
140 |
+
$views_tabs_font_size = $theme->views_tabs_font_size;
|
141 |
+
$show_cat = $theme->show_cat;
|
142 |
+
$header_format = (isset($theme->header_format) ? $theme->header_format : 'w/d/m/y');
|
143 |
+
|
144 |
+
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
145 |
+
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
146 |
+
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
147 |
+
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
148 |
+
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
149 |
+
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
150 |
+
$date_font_size = $theme->date_font_size;
|
151 |
+
$event_num_font_size = $theme->event_num_font_size;
|
152 |
+
$show_numbers_for_events = $theme->day_start;
|
153 |
+
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
154 |
+
|
155 |
+
__('January', 'sp_calendar');
|
156 |
+
__('February', 'sp_calendar');
|
157 |
+
__('March', 'sp_calendar');
|
158 |
+
__('April', 'sp_calendar');
|
159 |
+
__('May', 'sp_calendar');
|
160 |
+
__('June', 'sp_calendar');
|
161 |
+
__('July', 'sp_calendar');
|
162 |
+
__('August', 'sp_calendar');
|
163 |
+
__('September', 'sp_calendar');
|
164 |
+
__('October', 'sp_calendar');
|
165 |
+
__('November', 'sp_calendar');
|
166 |
+
__('December', 'sp_calendar');
|
167 |
+
if ($cell_height == '') {
|
168 |
+
$cell_height = 70;
|
169 |
+
}
|
170 |
+
if ($cal_width == '') {
|
171 |
+
$cal_width = 700;
|
172 |
+
}
|
173 |
+
if ($date != '') {
|
174 |
+
$date_REFERER = $date;
|
175 |
+
}
|
176 |
+
else {
|
177 |
+
$date_REFERER = date("Y-m");
|
178 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
179 |
+
}
|
180 |
+
$year_REFERER = substr($date_REFERER, 0, 4);
|
181 |
+
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
182 |
+
$day_REFERER = substr($date_REFERER, 8, 2);
|
183 |
+
|
184 |
+
$year = substr($date, 0, 4);
|
185 |
+
$month = Month_name(substr($date, 5, 2));
|
186 |
+
$day = substr($date, 8, 2);
|
187 |
+
|
188 |
+
$cell_width = $cal_width / 7;
|
189 |
+
$month_day_count = date('t', mktime(0, 0, 0, Month_num($month), 1, $year));
|
190 |
+
$prev_month_day_count = date('t', mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
191 |
+
|
192 |
+
if ($day > $month_day_count) {
|
193 |
+
$month = Month_name(Month_num($month) + 1);
|
194 |
+
$day = '01';
|
195 |
+
}
|
196 |
+
if ((int) $day < 1) {
|
197 |
+
$month = Month_name(Month_num($month) - 1);
|
198 |
+
$day = $prev_month_day_count;
|
199 |
+
}
|
200 |
+
|
201 |
+
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
202 |
+
$prev_month = add_0((int) $this_month - 1);
|
203 |
+
$next_month = add_0((int) $this_month + 1);
|
204 |
+
|
205 |
+
$view = 'bigcalendarday';
|
206 |
+
$views = explode(',', $view_select);
|
207 |
+
$defaultview = 'day';
|
208 |
+
array_pop($views);
|
209 |
+
$display = '';
|
210 |
+
if (count($views) == 0) {
|
211 |
+
$display = "display:none";
|
212 |
+
}
|
213 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
214 |
+
$display = "display:none";
|
215 |
+
}
|
216 |
+
|
217 |
+
$activedate = explode('/', $header_format);
|
218 |
+
for ($i = 0; $i < 4; $i++) {
|
219 |
+
if (isset($activedate[$i]) && $activedate[$i] == 'w') unset($activedate[$i]);
|
220 |
+
if (isset($activedate[$i]) && $activedate[$i] == 'm') {
|
221 |
+
$activedate[$i] = 'F';
|
222 |
+
}
|
223 |
+
if (isset($activedate[$i]) && $activedate[$i] == 'y') {
|
224 |
+
$activedate[$i] = 'Y';
|
225 |
+
}
|
226 |
+
}
|
227 |
+
$activedatestr = "";
|
228 |
+
$header_date_format = implode(' ', $activedate);
|
229 |
+
$name_year = date($header_date_format, strtotime($date));
|
230 |
+
$exp_name_year = explode(' ', $name_year);
|
231 |
+
$exp_name_year = explode(' ', $name_year);
|
232 |
+
for($j = 0; $j < count($exp_name_year); $j++){
|
233 |
+
$activedatestr .= __($exp_name_year[$j], 'sp_calendar') . ' ';
|
234 |
+
}
|
235 |
+
?>
|
236 |
+
<html>
|
237 |
+
<head>
|
238 |
+
<style type='text/css'>
|
239 |
+
#afterbig<?php echo $many_sp_calendar; ?> table,
|
240 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
241 |
+
font-family: Segoe UI;
|
242 |
+
border: 0;
|
243 |
+
}
|
244 |
+
|
245 |
+
.day_ev{
|
246 |
+
border-top-left-radius: <?php echo $border_radius2 ?>px !important;
|
247 |
+
border-top-right-radius: <?php echo $border_radius2 ?>px !important;
|
248 |
+
border-radius: <?php echo $border_radius2 ?>px !important;
|
249 |
+
border-bottom-left-radius: <?php echo $border_radius2 ?>px !important;
|
250 |
+
}
|
251 |
+
#TB_iframeContent{
|
252 |
+
background-color: <?php echo $show_event_bgcolor; ?>;
|
253 |
+
}
|
254 |
+
|
255 |
+
#bigcalendar<?php echo $many_sp_calendar ?> td, #bigcalendar<?php echo $many_sp_calendar ?> tr, #spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
256 |
+
border: none !important;
|
257 |
+
}
|
258 |
+
#bigcalendar<?php echo $many_sp_calendar ?> .general_table {
|
259 |
+
border-radius: <?php echo $border_radius ?>px !important;
|
260 |
+
}
|
261 |
+
#bigcalendar<?php echo $many_sp_calendar ?> .top_table {
|
262 |
+
border-top-left-radius: <?php echo $border_radius2 ?>px !important;
|
263 |
+
border-top-right-radius: <?php echo $border_radius2 ?>px !important;
|
264 |
+
}
|
265 |
+
.general_table table table:last-child .day_ev:last-child td,
|
266 |
+
.general_table table table:last-child .week_list:last-child td{
|
267 |
+
border-bottom-left-radius:<?php echo $border_radius2?>px;
|
268 |
+
|
269 |
+
}
|
270 |
+
|
271 |
+
.general_table table tr:last-child >td:last-child{
|
272 |
+
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
273 |
+
border-top-right-radius: <?php echo $border_radius2 ?>px;
|
274 |
+
}
|
275 |
+
|
276 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-left {
|
277 |
+
width: 0px;
|
278 |
+
height: 0px;
|
279 |
+
border-top: 15px solid transparent;
|
280 |
+
border-bottom: 15px solid transparent;
|
281 |
+
border-right: 20px solid;
|
282 |
+
margin: 0 auto;
|
283 |
+
}
|
284 |
+
|
285 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-right {
|
286 |
+
width: 0px;
|
287 |
+
height: 0px;
|
288 |
+
border-top: 15px solid transparent;
|
289 |
+
border-bottom: 15px solid transparent;
|
290 |
+
border-left: 20px solid;
|
291 |
+
margin: 0 auto;
|
292 |
+
}
|
293 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-right{
|
294 |
+
border-top: 5px solid transparent;
|
295 |
+
border-bottom: 5px solid transparent;
|
296 |
+
border-left: 8px solid;
|
297 |
+
left: 5px;
|
298 |
+
position: relative;
|
299 |
+
}
|
300 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-down{
|
301 |
+
width: 0px;
|
302 |
+
height: 0px;
|
303 |
+
border-left: 5px solid transparent;
|
304 |
+
border-right: 5px solid transparent;
|
305 |
+
border-top: 8px solid;
|
306 |
+
}
|
307 |
+
|
308 |
+
#bigcalendar<?php echo $many_sp_calendar ?> .cala_arrow a:link, #bigcalendar .cala_arrow a:visited {
|
309 |
+
text-decoration: none !important;
|
310 |
+
box-shadow: none !important;
|
311 |
+
background: none !important;
|
312 |
+
font-size: <?php echo $arrow_size ?>px !important;
|
313 |
+
}
|
314 |
+
#bigcalendar<?php echo $many_sp_calendar ?> .cala_arrow {
|
315 |
+
vertical-align: middle !important;
|
316 |
+
}
|
317 |
+
#bigcalendar<?php echo $many_sp_calendar ?> .cala_arrow a:hover {
|
318 |
+
font-size: <?php echo $arrow_size_hover ?>px !important;
|
319 |
+
text-decoration: none !important;
|
320 |
+
background: none !important;
|
321 |
+
}
|
322 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link, #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
323 |
+
text-decoration: none !important;
|
324 |
+
background: none !important;
|
325 |
+
font-size: 12px !important;
|
326 |
+
color: red;
|
327 |
+
}
|
328 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
329 |
+
text-decoration: none !important;
|
330 |
+
background: none !important;
|
331 |
+
}
|
332 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
333 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
334 |
+
<?php echo 'vertical-align:top !important;'; ?>
|
335 |
+
}
|
336 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
337 |
+
vertical-align: middle !important;
|
338 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
339 |
+
}
|
340 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
341 |
+
font-size: <?php echo $weekdays_font_size; ?>px !important;
|
342 |
+
}
|
343 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
344 |
+
border-spacing: 0 !important;
|
345 |
+
width: 100% !important;
|
346 |
+
}
|
347 |
+
.calyear_table table #bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
348 |
+
border-spacing: 0 !important;
|
349 |
+
width: 100% !important;
|
350 |
+
}
|
351 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg, #bigcalendar .calbg td {
|
352 |
+
text-align: center !important;
|
353 |
+
width: 14% !important;
|
354 |
+
}
|
355 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
356 |
+
color: <?php echo $text_color_other_months; ?> !important;
|
357 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
358 |
+
<?php echo 'vertical-align:top !important;'; ?>
|
359 |
+
}
|
360 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
361 |
+
color: <?php echo $text_color_this_month_unevented; ?> !important;
|
362 |
+
}
|
363 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
364 |
+
font-size: 24px !important;
|
365 |
+
font-weight: bold !important;
|
366 |
+
color: <?php echo $text_color_year; ?> !important;
|
367 |
+
}
|
368 |
+
.general_table table, .general_table td, .general_table tr {
|
369 |
+
border: inherit !important;
|
370 |
+
vertical-align: initial !important;
|
371 |
+
border-collapse: inherit !important;
|
372 |
+
margin: inherit !important;
|
373 |
+
padding: inherit !important;
|
374 |
+
}
|
375 |
+
.general_table {
|
376 |
+
border-collapse: inherit !important;
|
377 |
+
margin: inherit !important;
|
378 |
+
}
|
379 |
+
.general_table p {
|
380 |
+
margin: inherit !important;
|
381 |
+
padding: inherit !important;
|
382 |
+
}
|
383 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
384 |
+
color: <?php echo $sun_days ?> !important;
|
385 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
386 |
+
<?php echo 'vertical-align:top !important; text-align:left !important;'; ?>
|
387 |
+
background-color: <?php echo $sundays_bg_color; ?> !important;
|
388 |
+
}
|
389 |
+
#TB_window {
|
390 |
+
z-index: 10000;
|
391 |
+
}
|
392 |
+
|
393 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td {
|
394 |
+
vertical-align: middle !important;
|
395 |
+
}
|
396 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table {
|
397 |
+
border-collapse: initial;
|
398 |
+
border:0px;
|
399 |
+
max-width: none;
|
400 |
+
}
|
401 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table tr:hover td {
|
402 |
+
background: none;
|
403 |
+
}
|
404 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
405 |
+
padding: 0px;
|
406 |
+
vertical-align: none;
|
407 |
+
border-top:none;
|
408 |
+
line-height: none;
|
409 |
+
text-align: none;
|
410 |
+
background: transparent;
|
411 |
+
}
|
412 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
413 |
+
margin-bottom:0;
|
414 |
+
}
|
415 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
416 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
417 |
+
#spiderCalendarTitlesList td,
|
418 |
+
#spiderCalendarTitlesList tr {
|
419 |
+
border:none;
|
420 |
+
}
|
421 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
422 |
+
border-radius: <?php echo $border_radius; ?>px;
|
423 |
+
}
|
424 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
425 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
426 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
427 |
+
}
|
428 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
429 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
430 |
+
text-decoration:none !important;
|
431 |
+
background:none;
|
432 |
+
font-size: <?php echo $arrow_size; ?>px;
|
433 |
+
}
|
434 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
435 |
+
text-decoration:none;
|
436 |
+
background:none;
|
437 |
+
}
|
438 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
439 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
440 |
+
text-decoration:none;
|
441 |
+
background:none;
|
442 |
+
font-size:12px;
|
443 |
+
color:red;
|
444 |
+
}
|
445 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
446 |
+
text-decoration:none;
|
447 |
+
background:none;
|
448 |
+
}
|
449 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
450 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
451 |
+
vertical-align:top;
|
452 |
+
}
|
453 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
454 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
455 |
+
}
|
456 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
457 |
+
font-size:<?php echo $weekdays_font_size; ?>px;
|
458 |
+
}
|
459 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
460 |
+
border-spacing:0;
|
461 |
+
width:100%;
|
462 |
+
}
|
463 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
464 |
+
border-spacing:0;
|
465 |
+
width:100%;
|
466 |
+
}
|
467 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
468 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
|
469 |
+
text-align:center;
|
470 |
+
width:14%;
|
471 |
+
}
|
472 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
473 |
+
color:<?php echo $text_color_other_months; ?>;
|
474 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
475 |
+
vertical-align:top;
|
476 |
+
}
|
477 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
478 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
479 |
+
}
|
480 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
481 |
+
font-size:24px;
|
482 |
+
font-weight:bold;
|
483 |
+
color:<?php echo $text_color_year; ?>;
|
484 |
+
}
|
485 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
486 |
+
color:<?php echo $sun_days; ?>;
|
487 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
488 |
+
vertical-align:top;
|
489 |
+
text-align:left;
|
490 |
+
background-color:<?php echo $sundays_bg_color; ?>;
|
491 |
+
}
|
492 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
493 |
+
float: right;
|
494 |
+
background-color: <?php echo $views_tabs_bg_color; ?>;
|
495 |
+
min-height: 25px;
|
496 |
+
min-width: 70px;
|
497 |
+
margin-left: 2px;
|
498 |
+
text-align: center;
|
499 |
+
cursor:pointer;
|
500 |
+
position: relative;
|
501 |
+
top: 5px;
|
502 |
+
}
|
503 |
+
|
504 |
+
|
505 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
506 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
507 |
+
{
|
508 |
+
background-color: <?php echo $views_tabs_bg_color?>;
|
509 |
+
width: 120px;
|
510 |
+
text-align: center;
|
511 |
+
cursor: pointer;
|
512 |
+
padding: 6px;
|
513 |
+
position: relative;
|
514 |
+
}
|
515 |
+
|
516 |
+
#afterbig<?php echo $many_sp_calendar; ?> .views span,
|
517 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
518 |
+
line-height: 30px;
|
519 |
+
}
|
520 |
+
|
521 |
+
#drop_down_views
|
522 |
+
{
|
523 |
+
list-style-type:none !important;
|
524 |
+
position: absolute;
|
525 |
+
top: 46px;
|
526 |
+
left: 0px;
|
527 |
+
display:none;
|
528 |
+
z-index: 4545;
|
529 |
+
margin-left: 0;
|
530 |
+
}
|
531 |
+
|
532 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
533 |
+
{
|
534 |
+
background:<?php echo $bg_top ?>;
|
535 |
+
}
|
536 |
+
|
537 |
+
#drop_down_views >li
|
538 |
+
{
|
539 |
+
border-bottom:1px solid #fff !important;
|
540 |
+
}
|
541 |
+
|
542 |
+
|
543 |
+
#views_tabs_select
|
544 |
+
{
|
545 |
+
display:none;
|
546 |
+
}
|
547 |
+
|
548 |
+
</style>
|
549 |
+
</head>
|
550 |
+
<body>
|
551 |
+
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>" class="wdc_calendar">
|
552 |
+
<div style="width:100%;">
|
553 |
+
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
554 |
+
<tr>
|
555 |
+
<td>
|
556 |
+
|
557 |
+
<div id="views_tabs" style="width: 100%;<?php echo $display ?>">
|
558 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
559 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
560 |
+
'action' => 'spiderbigcalendar_day',
|
561 |
+
'theme_id' => $theme_id,
|
562 |
+
'calendar' => $calendar_id,
|
563 |
+
'select' => $view_select,
|
564 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
565 |
+
'many_sp_calendar' => $many_sp_calendar,
|
566 |
+
'cat_id' => '',
|
567 |
+
'cat_ids' => $cat_ids,
|
568 |
+
'widget' => $widget,
|
569 |
+
'rand' => $many_sp_calendar,
|
570 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Day', 'sp_calendar'); ?></span>
|
571 |
+
</div>
|
572 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
573 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
574 |
+
'action' => 'spiderbigcalendar_week',
|
575 |
+
'theme_id' => $theme_id,
|
576 |
+
'calendar' => $calendar_id,
|
577 |
+
'select' => $view_select,
|
578 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
579 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
580 |
+
'many_sp_calendar' => $many_sp_calendar,
|
581 |
+
'cat_id' => '',
|
582 |
+
'cat_ids' => $cat_ids,
|
583 |
+
'widget' => $widget,
|
584 |
+
'rand' => $many_sp_calendar,
|
585 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Week', 'sp_calendar'); ?></span>
|
586 |
+
</div>
|
587 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
588 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
589 |
+
'action' => 'spiderbigcalendar_list',
|
590 |
+
'theme_id' => $theme_id,
|
591 |
+
'calendar' => $calendar_id,
|
592 |
+
'select' => $view_select,
|
593 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
594 |
+
'many_sp_calendar' => $many_sp_calendar,
|
595 |
+
'cat_id' => '',
|
596 |
+
'cat_ids' => $cat_ids,
|
597 |
+
'widget' => $widget,
|
598 |
+
'rand' => $many_sp_calendar,
|
599 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('List', 'sp_calendar'); ?></span>
|
600 |
+
</div>
|
601 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
602 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
603 |
+
'action' => 'spiderbigcalendar_month',
|
604 |
+
'theme_id' => $theme_id,
|
605 |
+
'calendar' => $calendar_id,
|
606 |
+
'select' => $view_select,
|
607 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
608 |
+
'many_sp_calendar' => $many_sp_calendar,
|
609 |
+
'cat_id' => '',
|
610 |
+
'cat_ids' => $cat_ids,
|
611 |
+
'widget' => $widget,
|
612 |
+
'rand' => $many_sp_calendar,
|
613 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Month', 'sp_calendar'); ?></span>
|
614 |
+
</div>
|
615 |
+
</div>
|
616 |
+
<div id="views_tabs_select" style="display:none" >
|
617 |
+
<div id="views_select" style="background-color:<?php echo $bg_top?> !important;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
618 |
+
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
619 |
+
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
620 |
+
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
621 |
+
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
622 |
+
<div class="arrow-right show_arrow"></div>
|
623 |
+
<div class="arrow-down"></div>
|
624 |
+
</div>
|
625 |
+
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
626 |
+
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
627 |
+
<div class="views_select"
|
628 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
629 |
+
'action' => 'spiderbigcalendar_day',
|
630 |
+
'theme_id' => $theme_id,
|
631 |
+
'calendar' => $calendar_id,
|
632 |
+
'select' => $view_select,
|
633 |
+
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
634 |
+
'many_sp_calendar' => $many_sp_calendar,
|
635 |
+
'cat_id' => '',
|
636 |
+
'cat_ids' => $cat_ids,
|
637 |
+
'widget' => $widget,
|
638 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
639 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
640 |
+
</div>
|
641 |
+
</li>
|
642 |
+
|
643 |
+
<li <?php if($view=='bigcalendarweek'):?> class="active" <?php endif; ?> style="<?php if(!in_array('week',$views) AND $defaultview!='week' ) echo 'display:none;' ; ?>" ><div class="views_select"
|
644 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
645 |
+
'action' => 'spiderbigcalendar_week',
|
646 |
+
'theme_id' => $theme_id,
|
647 |
+
'calendar' => $calendar_id,
|
648 |
+
'select' => $view_select,
|
649 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
650 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
651 |
+
'many_sp_calendar' => $many_sp_calendar,
|
652 |
+
'cat_id' => '',
|
653 |
+
'cat_ids' => $cat_ids,
|
654 |
+
'widget' => $widget,
|
655 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
656 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
657 |
+
</div>
|
658 |
+
</li>
|
659 |
+
|
660 |
+
<li <?php if($view=='bigcalendarlist'):?> class="active" <?php endif; ?> style="<?php if(!in_array('list',$views) AND $defaultview!='list' ) echo 'display:none;' ;?>"><div class="views_select"
|
661 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
662 |
+
'action' => 'spiderbigcalendar_list',
|
663 |
+
'theme_id' => $theme_id,
|
664 |
+
'calendar' => $calendar_id,
|
665 |
+
'select' => $view_select,
|
666 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
667 |
+
'many_sp_calendar' => $many_sp_calendar,
|
668 |
+
'cat_id' => '',
|
669 |
+
'cat_ids' => $cat_ids,
|
670 |
+
'widget' => $widget,
|
671 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
672 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
673 |
+
</div>
|
674 |
+
</li>
|
675 |
+
|
676 |
+
<li <?php if($view=='bigcalendarmonth'):?> class="active" <?php endif; ?> style="<?php if(!in_array('month',$views) AND $defaultview!='month' ) echo 'display:none;'; ?>"><div class="views_select"
|
677 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
678 |
+
'action' => 'spiderbigcalendar_month',
|
679 |
+
'theme_id' => $theme_id,
|
680 |
+
'calendar' => $calendar_id,
|
681 |
+
'select' => $view_select,
|
682 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
683 |
+
'many_sp_calendar' => $many_sp_calendar,
|
684 |
+
'cat_id' => '',
|
685 |
+
'cat_ids' => $cat_ids,
|
686 |
+
'widget' => $widget,
|
687 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
688 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Month</span></div></li>
|
689 |
+
|
690 |
+
</ul>
|
691 |
+
</div>
|
692 |
+
|
693 |
+
</td>
|
694 |
+
</tr>
|
695 |
+
<tr>
|
696 |
+
<td>
|
697 |
+
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width:100%; border:<?php echo $border_color; ?> solid <?php echo $border_width; ?>px; margin:0; padding:0; background-color:<?php echo $bg_bottom; ?> !important;">
|
698 |
+
<tr>
|
699 |
+
<td width="100%" style="padding:0; margin:0;">
|
700 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;" >
|
701 |
+
<tr style="height:40px; width:100%;">
|
702 |
+
<td class="top_table" align="center" colspan="7" style="position: relative;padding:0; margin:0; background-color:<?php echo $bg_top; ?> !important;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
703 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width:99.8%; height:<?php echo $top_height; ?>px;">
|
704 |
+
<tr>
|
705 |
+
<td width="15%">
|
706 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
707 |
+
echo add_query_arg(array(
|
708 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
709 |
+
'theme_id' => $theme_id,
|
710 |
+
'calendar' => $calendar_id,
|
711 |
+
'select' => $view_select,
|
712 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))) . '-' . $day,
|
713 |
+
'many_sp_calendar' => $many_sp_calendar,
|
714 |
+
'cat_id' => '',
|
715 |
+
'cat_ids' => $cat_ids,
|
716 |
+
'widget' => $widget,
|
717 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color: <?php echo hex_to_rgb($views_tabs_bg_color, 0.4) ?>;">
|
718 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year - 1; ?></span>
|
719 |
+
</div>
|
720 |
+
</td>
|
721 |
+
<td style="width:100%;vertical-align:center">
|
722 |
+
<table style="width:100%;">
|
723 |
+
<tr>
|
724 |
+
<td class="cala_arrow" width="11%" style="text-align:right;margin:0px;padding: 0px 30px 0px 0px !important;">
|
725 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
726 |
+
|
727 |
+
if ($day == '01' && Month_num(Month_name(Month_num($month) - 1)) != '12') {
|
728 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
729 |
+
}
|
730 |
+
|
731 |
+
else
|
732 |
+
{
|
733 |
+
if (Month_num(Month_name(Month_num($month) - 1)) == '12' && $day == '01') {
|
734 |
+
|
735 |
+
$needed_date = ($year - 1) . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
736 |
+
}
|
737 |
+
else {
|
738 |
+
$needed_date = $year . '-' . add_0((Month_num($month))) . '-' . add_0($day - 1);
|
739 |
+
}
|
740 |
+
}
|
741 |
+
echo add_query_arg(array(
|
742 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
743 |
+
'theme_id' => $theme_id,
|
744 |
+
'calendar' => $calendar_id,
|
745 |
+
'select' => $view_select,
|
746 |
+
'date' => $needed_date,
|
747 |
+
'many_sp_calendar' => $many_sp_calendar,
|
748 |
+
'cat_id' => '',
|
749 |
+
'cat_ids' => $cat_ids,
|
750 |
+
'widget' => $widget,
|
751 |
+
), $site_url);
|
752 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❰
|
753 |
+
</a>
|
754 |
+
</td>
|
755 |
+
<td style="text-align:center; margin:0;" width="40%">
|
756 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month?>"/>
|
757 |
+
<span style="line-height: 30px;font-family:arial; color:<?php echo $text_color_month; ?>; font-size:<?php echo $month_font_size ?>px;text-shadow: 1px 1px black;"><?php echo $activedatestr; ?></span>
|
758 |
+
</td>
|
759 |
+
<?php
|
760 |
+
if ($day == $month_day_count && Month_num(Month_name(Month_num($month) + 1)) != '1') {
|
761 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1)) . '-01';
|
762 |
+
|
763 |
+
}
|
764 |
+
else
|
765 |
+
{
|
766 |
+
|
767 |
+
if (Month_num(Month_name(Month_num($month) + 1)) == '1' && $day == $month_day_count) {
|
768 |
+
$needed_date = ($year + 1) . '-' . add_0(Month_num($month + 1)) . '-01';
|
769 |
+
|
770 |
+
}
|
771 |
+
else {
|
772 |
+
$needed_date = $year . '-' . add_0(Month_num($month)) . '-' . add_0($day + 1);
|
773 |
+
}
|
774 |
+
}
|
775 |
+
|
776 |
+
?>
|
777 |
+
|
778 |
+
<td style="margin:0; padding: 0px 0px 0px 30px !important; text-align:left" width="11%" class="cala_arrow">
|
779 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
780 |
+
|
781 |
+
echo add_query_arg(array(
|
782 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
783 |
+
'theme_id' => $theme_id,
|
784 |
+
'calendar' => $calendar_id,
|
785 |
+
'select' => $view_select,
|
786 |
+
'date' => $needed_date,
|
787 |
+
'many_sp_calendar' => $many_sp_calendar,
|
788 |
+
'cat_id' => '',
|
789 |
+
'cat_ids' => $cat_ids,
|
790 |
+
'widget' => $widget,
|
791 |
+
), $site_url);
|
792 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❱
|
793 |
+
</a>
|
794 |
+
</td>
|
795 |
+
<td width="15%">
|
796 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
797 |
+
echo add_query_arg(array(
|
798 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
799 |
+
'theme_id' => $theme_id,
|
800 |
+
'calendar' => $calendar_id,
|
801 |
+
'select' => $view_select,
|
802 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month))) . '-' . $day,
|
803 |
+
'many_sp_calendar' => $many_sp_calendar,
|
804 |
+
'cat_id' => '',
|
805 |
+
'cat_ids' => $cat_ids,
|
806 |
+
'widget' => $widget,
|
807 |
+
), $site_url); ?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color: <?php echo hex_to_rgb($views_tabs_bg_color, 0.4) ?>;">
|
808 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
|
809 |
+
</div>
|
810 |
+
</td>
|
811 |
+
</tr>
|
812 |
+
</table>
|
813 |
+
</td>
|
814 |
+
</tr>
|
815 |
+
</table>
|
816 |
+
</td>
|
817 |
+
|
818 |
+
</tr>
|
819 |
+
</tr>
|
820 |
+
<tr>
|
821 |
+
<td>
|
822 |
+
<?php
|
823 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
824 |
+
if ($weekstart == "su") {
|
825 |
+
$month_first_weekday++;
|
826 |
+
if ($month_first_weekday == 8) {
|
827 |
+
$month_first_weekday = 1;
|
828 |
+
}
|
829 |
+
}
|
830 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
831 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
832 |
+
$weekday_i = $month_first_weekday;
|
833 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
834 |
+
$percent = 1;
|
835 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
836 |
+
if ($sum % 7 <> 0) {
|
837 |
+
$percent = $percent + 1;
|
838 |
+
}
|
839 |
+
$sum = $sum - ($sum % 7);
|
840 |
+
$percent = $percent + ($sum / 7);
|
841 |
+
$percent = 107 / $percent;
|
842 |
+
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
843 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
844 |
+
$calendar = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
845 |
+
$array_days = $all_calendar_files[0]['array_days'];
|
846 |
+
$array_days1 = $all_calendar_files[0]['array_days1'];
|
847 |
+
$title = $all_calendar_files[0]['title'];
|
848 |
+
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
849 |
+
sort($array_days, SORT_NUMERIC);
|
850 |
+
if (!$array_days || !in_array((int) $day, $array_days)) {
|
851 |
+
$week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
|
852 |
+
echo '<table style="border-spacing:0;width:100%;border-bottom:1px solid ' . $cell_border_color . '">
|
853 |
+
<tr>
|
854 |
+
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . ' !important; color:#6E7276">
|
855 |
+
<span style="padding-left:10px; font-size:' . $week_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
856 |
+
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
|
857 |
+
</td>
|
858 |
+
</tr>
|
859 |
+
<tr>
|
860 |
+
<td>
|
861 |
+
<table style="border-bottom-left-radius: '.$border_radius2.'px;border-bottom-right-radius: '.$border_radius2.'px;height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '" class="week_list">
|
862 |
+
<tr>
|
863 |
+
<td style="font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ' !important;color:' . $event_num_color . '"></td>
|
864 |
+
<td><p style="color:' . $event_title_color . ';border:none;"> ' . __('There are no events on this date', 'sp_calendar') . '</p></td>
|
865 |
+
</tr>
|
866 |
+
</table>
|
867 |
+
</td>
|
868 |
+
</tr>
|
869 |
+
</table>';
|
870 |
+
}
|
871 |
+
if (in_array((int) $day, $array_days)) {
|
872 |
+
$week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
|
873 |
+
echo '<table style="border-spacing:0;width:100%;border-bottom:1px solid ' . $cell_border_color . '">
|
874 |
+
<tr>
|
875 |
+
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . ' !important; color:#6E7276">
|
876 |
+
<span style="padding-left:10px; font-size:' . $date_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
877 |
+
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
|
878 |
+
</td>
|
879 |
+
<tr>
|
880 |
+
<td>';
|
881 |
+
foreach ($title as $key => $value) {
|
882 |
+
if ($key == (int) $day) {
|
883 |
+
$ev_id = explode('<br>', $ev_ids[$key]);
|
884 |
+
array_pop($ev_id);
|
885 |
+
$ev_ids_inline = implode(',', $ev_id);
|
886 |
+
$ev_title = explode('</p>', $value);
|
887 |
+
array_pop($ev_title);
|
888 |
+
for ($j = 0; $j < count($ev_title); $j++) {
|
889 |
+
|
890 |
+
|
891 |
+
$query =$wpdb->prepare ( "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
892 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
893 |
+
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d" ,$calendar ,$ev_id[$j] );
|
894 |
+
|
895 |
+
$cat_color = $wpdb->get_row($query);
|
896 |
+
|
897 |
+
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color=$bg_top;};
|
898 |
+
|
899 |
+
if (($j + 1) % 2 == 0) {
|
900 |
+
$color = $event_num_bg_color2;
|
901 |
+
$table_color = $event_bg_color2;
|
902 |
+
}
|
903 |
+
else {
|
904 |
+
$color = $event_num_bg_color1;
|
905 |
+
$table_color = $event_bg_color1;
|
906 |
+
}
|
907 |
+
|
908 |
+
echo '<table style="margin: 0;border-spacing:0;height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . ' !important;" class="day_ev">
|
909 |
+
<tr>
|
910 |
+
<td style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color: #' . str_replace('#','',$cat_color->color) . ' !important;color:' . $event_num_color . '">' . (($show_numbers_for_events) ? ($j + 1) : '') . '</td>
|
911 |
+
<td>
|
912 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:15px;background:none;text-decoration:none;color:' . $event_title_color . '; "
|
913 |
+
href="' . add_query_arg(array(
|
914 |
+
'action' => 'spidercalendarbig',
|
915 |
+
'theme_id' => $theme_id,
|
916 |
+
'calendar_id' => $calendar_id,
|
917 |
+
'ev_ids' => $ev_ids_inline,
|
918 |
+
'eventID' => $ev_id[$j],
|
919 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . (int) $day,
|
920 |
+
'many_sp_calendar' => $many_sp_calendar,
|
921 |
+
'widget' => $widget,
|
922 |
+
'TB_iframe' => 1,
|
923 |
+
'tbWidth' => $popup_width,
|
924 |
+
'tbHeight' => $popup_height,
|
925 |
+
), $site_url) . '"><b>' . $ev_title[$j] . '</b>
|
926 |
+
</a>
|
927 |
+
</td>
|
928 |
+
</tr>
|
929 |
+
</table>';
|
930 |
+
}
|
931 |
+
}
|
932 |
+
}
|
933 |
+
echo '</td></tr></table>';
|
934 |
+
}
|
935 |
+
?>
|
936 |
+
</td>
|
937 |
+
</tr>
|
938 |
+
</table>
|
939 |
+
</tr>
|
940 |
+
</table>
|
941 |
+
</td>
|
942 |
+
</tr>
|
943 |
+
</table>
|
944 |
+
<style>
|
945 |
+
@media only screen and (max-width : 640px) {
|
946 |
+
#views_tabs ,#drop_down_views
|
947 |
+
{
|
948 |
+
display:none;
|
949 |
+
}
|
950 |
+
|
951 |
+
#views_tabs_select
|
952 |
+
{
|
953 |
+
display:block !important;
|
954 |
+
}
|
955 |
+
}
|
956 |
+
|
957 |
+
@media only screen and (max-width : 968px) {
|
958 |
+
#cats >li
|
959 |
+
{
|
960 |
+
float:none;
|
961 |
+
}
|
962 |
+
}
|
963 |
+
|
964 |
+
.spider_categories{
|
965 |
+
display:inline-block;
|
966 |
+
cursor:pointer;
|
967 |
+
}
|
968 |
+
|
969 |
+
.spider_categories p{
|
970 |
+
color: #fff;
|
971 |
+
padding: 2px 10px !important;
|
972 |
+
margin: 2px 0 !important;
|
973 |
+
font-size: 14px;
|
974 |
+
font-weight: 600;
|
975 |
+
}
|
976 |
+
</style>
|
977 |
+
<?php
|
978 |
+
|
979 |
+
//reindex cat_ids_array
|
980 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
981 |
+
|
982 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
983 |
+
{
|
984 |
+
echo'
|
985 |
+
<style>
|
986 |
+
#cats #category'.$re_cat_ids_array[$i].'
|
987 |
+
{
|
988 |
+
text-decoration:underline;
|
989 |
+
cursor:pointer;
|
990 |
+
|
991 |
+
}
|
992 |
+
|
993 |
+
</style>';
|
994 |
+
|
995 |
+
}
|
996 |
+
|
997 |
+
|
998 |
+
|
999 |
+
if($cat_ids=='')
|
1000 |
+
$cat_ids='';
|
1001 |
+
if($show_cat){
|
1002 |
+
echo '<ul id="cats" style="list-style-type:none; padding: 0;">';
|
1003 |
+
|
1004 |
+
|
1005 |
+
foreach($categories as $category)
|
1006 |
+
{
|
1007 |
+
|
1008 |
+
?>
|
1009 |
+
|
1010 |
+
<li class="spider_categories"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1011 |
+
'action' => 'spiderbigcalendar_day',
|
1012 |
+
'theme_id' => $theme_id,
|
1013 |
+
'calendar' => $calendar_id,
|
1014 |
+
'select' => $view_select,
|
1015 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
|
1016 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1017 |
+
'cat_id' => $category->id,
|
1018 |
+
'cat_ids' => $cat_ids,
|
1019 |
+
'widget' => $widget,
|
1020 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1021 |
+
|
1022 |
+
|
1023 |
+
<?php
|
1024 |
+
}
|
1025 |
+
if (!empty($categories)) {
|
1026 |
+
?>
|
1027 |
+
<li class="spider_categories"><p id="category0" style="background-color:#<?php echo str_replace('#','',$bg_top); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1028 |
+
'action' => 'spiderbigcalendar_day',
|
1029 |
+
'theme_id' => $theme_id,
|
1030 |
+
'calendar' => $calendar_id,
|
1031 |
+
'select' => $view_select,
|
1032 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
|
1033 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1034 |
+
'cat_id' => '',
|
1035 |
+
'cat_ids' => '',
|
1036 |
+
'widget' => $widget,
|
1037 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
1038 |
+
<?php echo '</ul>';
|
1039 |
+
}
|
1040 |
+
} ?>
|
1041 |
+
</body>
|
1042 |
+
</html>
|
1043 |
+
<?php
|
1044 |
+
die();
|
1045 |
+
}
|
1046 |
+
|
1047 |
?>
|
front_end/bigcalendarday_widget.php
CHANGED
@@ -1,723 +1,723 @@
|
|
1 |
-
<?php
|
2 |
-
function big_calendar_day_widget() {
|
3 |
-
require_once("frontend_functions.php");
|
4 |
-
global $wpdb;
|
5 |
-
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
-
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
-
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
-
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 1);
|
9 |
-
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
10 |
-
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
11 |
-
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
12 |
-
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
13 |
-
$site_url = get_admin_url().'admin-ajax.php';
|
14 |
-
///////////////////////////////////////////////////////////////////////////////////
|
15 |
-
|
16 |
-
|
17 |
-
if($cat_ids=='')
|
18 |
-
$cat_ids .= $cat_id.',';
|
19 |
-
else
|
20 |
-
$cat_ids .= ','.$cat_id.',';
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
25 |
-
|
26 |
-
|
27 |
-
function getelementcountinarray($array , $element)
|
28 |
-
{
|
29 |
-
$t=0;
|
30 |
-
|
31 |
-
for($i=0; $i<count($array); $i++)
|
32 |
-
{
|
33 |
-
if($element==$array[$i])
|
34 |
-
$t++;
|
35 |
-
|
36 |
-
}
|
37 |
-
|
38 |
-
|
39 |
-
return $t;
|
40 |
-
|
41 |
-
}
|
42 |
-
|
43 |
-
function getelementindexinarray($array , $element)
|
44 |
-
{
|
45 |
-
|
46 |
-
$t='';
|
47 |
-
|
48 |
-
for($i=0; $i<count($array); $i++)
|
49 |
-
{
|
50 |
-
if($element==$array[$i])
|
51 |
-
$t.=$i.',';
|
52 |
-
|
53 |
-
}
|
54 |
-
|
55 |
-
return $t;
|
56 |
-
|
57 |
-
|
58 |
-
}
|
59 |
-
$cat_ids_array = explode(',',$cat_ids);
|
60 |
-
|
61 |
-
|
62 |
-
if($cat_id!='')
|
63 |
-
{
|
64 |
-
|
65 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
66 |
-
{
|
67 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
68 |
-
$index_array = explode(',' , $index_in_line);
|
69 |
-
array_pop ($index_array);
|
70 |
-
for($j=0; $j<count($index_array); $j++)
|
71 |
-
unset($cat_ids_array[$index_array[$j]]);
|
72 |
-
$cat_ids = implode(',',$cat_ids_array);
|
73 |
-
}
|
74 |
-
}
|
75 |
-
else
|
76 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
77 |
-
|
78 |
-
|
79 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
80 |
-
|
81 |
-
|
82 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
83 |
-
$weekstart = $theme->week_start_day;
|
84 |
-
$bg = '#' . str_replace('#','',$theme->header_bgcolor);
|
85 |
-
$bg_color_selected = '#' . str_replace('#','',$theme->bg_color_selected);
|
86 |
-
$color_arrow = '#' . str_replace('#','',$theme->arrow_color);
|
87 |
-
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
88 |
-
$evented_color_bg = '#' . str_replace('#','',$theme->bg_color_this_month_evented);
|
89 |
-
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
90 |
-
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
91 |
-
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
92 |
-
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
93 |
-
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
94 |
-
$text_color_selected = '#' . str_replace('#','',$theme->text_color_selected);
|
95 |
-
$border_day = '#' . str_replace('#','',$theme->border_day);
|
96 |
-
$calendar_width = $theme->width;
|
97 |
-
$calendar_bg = '#' . str_replace('#','',$theme->footer_bgcolor);
|
98 |
-
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
99 |
-
$weekday_su_bg_color = '#' . str_replace('#','',$theme->su_bg_color);
|
100 |
-
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
101 |
-
$year_font_size = $theme->year_font_size;
|
102 |
-
$year_font_color = '#' . str_replace('#','',$theme->year_font_color);
|
103 |
-
$year_tabs_bg_color = '#' . str_replace('#','',$theme->year_tabs_bg_color);
|
104 |
-
$show_cat = $theme->show_cat;
|
105 |
-
$font_year = $theme->font_year;
|
106 |
-
$font_month = $theme->font_month;
|
107 |
-
$font_day = $theme->font_day;
|
108 |
-
$font_weekday = $theme->font_weekday;
|
109 |
-
$ev_title_color = '#' . str_replace('#','',$theme->ev_title_color);
|
110 |
-
$popup_width = $theme->popup_width;
|
111 |
-
$popup_height = $theme->popup_height;
|
112 |
-
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
113 |
-
|
114 |
-
__('January', 'sp_calendar');
|
115 |
-
__('February', 'sp_calendar');
|
116 |
-
__('March', 'sp_calendar');
|
117 |
-
__('April', 'sp_calendar');
|
118 |
-
__('May', 'sp_calendar');
|
119 |
-
__('June', 'sp_calendar');
|
120 |
-
__('July', 'sp_calendar');
|
121 |
-
__('August', 'sp_calendar');
|
122 |
-
__('September', 'sp_calendar');
|
123 |
-
__('October', 'sp_calendar');
|
124 |
-
__('November', 'sp_calendar');
|
125 |
-
__('December', 'sp_calendar');
|
126 |
-
// if ($cell_height == '') {
|
127 |
-
// $cell_height = 70;
|
128 |
-
// }
|
129 |
-
// if ($cal_width == '') {
|
130 |
-
// $cal_width = 700;
|
131 |
-
// }
|
132 |
-
if ($date != '') {
|
133 |
-
$date_REFERER = $date;
|
134 |
-
}
|
135 |
-
else {
|
136 |
-
$date_REFERER = date("Y-m");
|
137 |
-
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
138 |
-
}
|
139 |
-
|
140 |
-
$year_REFERER = substr($date_REFERER, 0, 4);
|
141 |
-
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
142 |
-
$day_REFERER = substr($date_REFERER, 8, 2);
|
143 |
-
|
144 |
-
$year = substr($date, 0, 4);
|
145 |
-
$month = Month_name(substr($date, 5, 2));
|
146 |
-
$day = substr($date, 8, 2);
|
147 |
-
|
148 |
-
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
149 |
-
$prev_month = add_0((int) $this_month - 1);
|
150 |
-
$next_month = add_0((int) $this_month + 1);
|
151 |
-
|
152 |
-
$cell_width = $calendar_width / 7;
|
153 |
-
$cell_width = (int) $cell_width - 2;
|
154 |
-
|
155 |
-
$month_day_count = date('t', mktime(0, 0, 0, Month_num($month), 1, $year));
|
156 |
-
$prev_month_day_count = date('t', mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
157 |
-
|
158 |
-
if ($day > $month_day_count) {
|
159 |
-
$month = Month_name(Month_num($month) + 1);
|
160 |
-
$day = '01';
|
161 |
-
}
|
162 |
-
if ((int) $day < 1) {
|
163 |
-
$month = Month_name(Month_num($month) - 1);
|
164 |
-
$day = $prev_month_day_count;
|
165 |
-
}
|
166 |
-
|
167 |
-
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
168 |
-
$prev_month = add_0((int) $this_month - 1);
|
169 |
-
$next_month = add_0((int) $this_month + 1);
|
170 |
-
|
171 |
-
$view = 'bigcalendarday_widget';
|
172 |
-
$views = explode(',', $view_select);
|
173 |
-
$defaultview = 'day';
|
174 |
-
array_pop($views);
|
175 |
-
$display = '';
|
176 |
-
if (count($views) == 0) {
|
177 |
-
$display = "display:none";
|
178 |
-
}
|
179 |
-
if(count($views) == 1 && $views[0] == $defaultview) {
|
180 |
-
$display = "display:none";
|
181 |
-
}
|
182 |
-
?>
|
183 |
-
<html>
|
184 |
-
<head>
|
185 |
-
<style type='text/css'>
|
186 |
-
#calendar_<?php echo $many_sp_calendar; ?> table {
|
187 |
-
border-collapse: initial;
|
188 |
-
border:0px;
|
189 |
-
}
|
190 |
-
#TB_iframeContent{
|
191 |
-
background-color: <?php echo $show_event_bgcolor; ?>;
|
192 |
-
}
|
193 |
-
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
194 |
-
padding: 0px;
|
195 |
-
vertical-align: none;
|
196 |
-
border-top:none;
|
197 |
-
line-height: none;
|
198 |
-
text-align: none;
|
199 |
-
}
|
200 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
201 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
202 |
-
font-family: <?php echo $font_day; ?>;
|
203 |
-
}
|
204 |
-
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
205 |
-
margin-bottom: 0;
|
206 |
-
}
|
207 |
-
#calendar_<?php echo $many_sp_calendar; ?> td,
|
208 |
-
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
209 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar ?> td,
|
210 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar ?> tr {
|
211 |
-
border:none;
|
212 |
-
}
|
213 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
214 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
215 |
-
color: <?php echo $color_arrow; ?>;
|
216 |
-
text-decoration: none !important;
|
217 |
-
background: none !important;
|
218 |
-
font-size: 16px;
|
219 |
-
}
|
220 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
221 |
-
color: <?php echo $color_arrow; ?>;
|
222 |
-
text-decoration:none;
|
223 |
-
background:none !important;
|
224 |
-
}
|
225 |
-
#calendar_<?php echo $many_sp_calendar; ?> .arrow-left {
|
226 |
-
width: 0px;
|
227 |
-
height: 0px;
|
228 |
-
border-top: 7px solid transparent;
|
229 |
-
border-bottom: 7px solid transparent;
|
230 |
-
border-right: 13px solid;
|
231 |
-
margin: 0 auto;
|
232 |
-
}
|
233 |
-
|
234 |
-
#calendar_<?php echo $many_sp_calendar; ?> .arrow-right {
|
235 |
-
width: 0px;
|
236 |
-
height: 0px;
|
237 |
-
border-top: 7px solid transparent;
|
238 |
-
border-bottom: 7px solid transparent;
|
239 |
-
border-left: 13px solid;
|
240 |
-
margin: 0 auto;
|
241 |
-
}
|
242 |
-
|
243 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
244 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
245 |
-
text-decoration:underline;
|
246 |
-
background:none !important;
|
247 |
-
font-size:11px;
|
248 |
-
}
|
249 |
-
#calendar_<?php echo $many_sp_calendar; ?> a {
|
250 |
-
font-weight: normal;
|
251 |
-
}
|
252 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
253 |
-
font-size:12px;
|
254 |
-
text-decoration:none;
|
255 |
-
background:none !important;
|
256 |
-
}
|
257 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
258 |
-
border-spacing:0;
|
259 |
-
width:100%;
|
260 |
-
}
|
261 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
262 |
-
border-spacing: 0;
|
263 |
-
vertical-align: middle;
|
264 |
-
width: 100%;
|
265 |
-
}
|
266 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
267 |
-
background-color:<?php echo $bg; ?> !important;
|
268 |
-
text-align:center;
|
269 |
-
vertical-align: middle;
|
270 |
-
}
|
271 |
-
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
272 |
-
color:<?php echo $text_color_other_months; ?>;
|
273 |
-
}
|
274 |
-
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
275 |
-
color:<?php echo $text_color_this_month_unevented; ?>;
|
276 |
-
}
|
277 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calfont_year {
|
278 |
-
font-size:24px;
|
279 |
-
font-weight:bold;
|
280 |
-
color:<?php echo $year_font_color; ?>;
|
281 |
-
}
|
282 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
283 |
-
color:<?php echo $sun_days; ?>;
|
284 |
-
}
|
285 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
286 |
-
border: solid <?php echo $border_day; ?> 1px;
|
287 |
-
}
|
288 |
-
#TB_window {
|
289 |
-
z-index: 10000;
|
290 |
-
}
|
291 |
-
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
292 |
-
float: right;
|
293 |
-
background-color: <?php echo $calendar_bg; ?> !important;
|
294 |
-
height: 25px;
|
295 |
-
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
296 |
-
margin-left: 2px;
|
297 |
-
text-align: center;
|
298 |
-
cursor:pointer;
|
299 |
-
position: relative;
|
300 |
-
top: 3px;
|
301 |
-
font-family: <?php echo $font_month; ?>;
|
302 |
-
font-size: 14px;
|
303 |
-
}
|
304 |
-
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
305 |
-
background: transparent !important;
|
306 |
-
}
|
307 |
-
|
308 |
-
|
309 |
-
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
310 |
-
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
311 |
-
{
|
312 |
-
width: 120px;
|
313 |
-
text-align: center;
|
314 |
-
cursor: pointer;
|
315 |
-
padding: 6px;
|
316 |
-
position: relative;
|
317 |
-
}
|
318 |
-
|
319 |
-
|
320 |
-
#drop_down_views
|
321 |
-
{
|
322 |
-
list-style-type:none !important;
|
323 |
-
position: absolute;
|
324 |
-
top: 46px;
|
325 |
-
left: -15px;
|
326 |
-
display:none;
|
327 |
-
z-index: 4545;
|
328 |
-
|
329 |
-
}
|
330 |
-
|
331 |
-
#drop_down_views >li
|
332 |
-
{
|
333 |
-
border-bottom:1px solid #fff !important;
|
334 |
-
}
|
335 |
-
|
336 |
-
|
337 |
-
#views_tabs_select
|
338 |
-
{
|
339 |
-
display:none;
|
340 |
-
}
|
341 |
-
</style>
|
342 |
-
</head>
|
343 |
-
<body>
|
344 |
-
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
345 |
-
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?> !important">
|
346 |
-
<tr style="background-color:#FFFFFF;">
|
347 |
-
<td style="background-color:#FFFFFF;">
|
348 |
-
<div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
|
349 |
-
<div class="views" style="margin-left: 4px;<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
350 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
351 |
-
'action' => 'spiderbigcalendar_day_widget',
|
352 |
-
'theme_id' => $theme_id,
|
353 |
-
'calendar' => $calendar_id,
|
354 |
-
'select' => $view_select,
|
355 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
356 |
-
'many_sp_calendar' => $many_sp_calendar,
|
357 |
-
'cat_id' => '',
|
358 |
-
'cat_ids' => $cat_ids,
|
359 |
-
'widget' => $widget,
|
360 |
-
'TB_iframe' => 1,
|
361 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Day', 'sp_calendar'); ?></span>
|
362 |
-
</div>
|
363 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
364 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
365 |
-
'action' => 'spiderbigcalendar_week_widget',
|
366 |
-
'theme_id' => $theme_id,
|
367 |
-
'calendar' => $calendar_id,
|
368 |
-
'select' => $view_select,
|
369 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
370 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
371 |
-
'many_sp_calendar' => $many_sp_calendar,
|
372 |
-
'cat_id' => '',
|
373 |
-
'cat_ids' => $cat_ids,
|
374 |
-
'widget' => $widget,
|
375 |
-
'TB_iframe' => 1,
|
376 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Week', 'sp_calendar'); ?></span>
|
377 |
-
</div>
|
378 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;' ?>"
|
379 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
380 |
-
'action' => 'spiderbigcalendar_list_widget',
|
381 |
-
'theme_id' => $theme_id,
|
382 |
-
'calendar' => $calendar_id,
|
383 |
-
'select' => $view_select,
|
384 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
385 |
-
'many_sp_calendar' => $many_sp_calendar,
|
386 |
-
'cat_id' => '',
|
387 |
-
'cat_ids' => $cat_ids,
|
388 |
-
'widget' => $widget,
|
389 |
-
'TB_iframe' => 1,
|
390 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('List', 'sp_calendar'); ?></span>
|
391 |
-
</div>
|
392 |
-
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
393 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
394 |
-
'action' => 'spiderbigcalendar_month_widget',
|
395 |
-
'theme_id' => $theme_id,
|
396 |
-
'calendar' => $calendar_id,
|
397 |
-
'select' => $view_select,
|
398 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
399 |
-
'many_sp_calendar' => $many_sp_calendar,
|
400 |
-
'cat_id' => '',
|
401 |
-
'cat_ids' => $cat_ids,
|
402 |
-
'widget' => $widget,
|
403 |
-
'TB_iframe' => 1,
|
404 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
405 |
-
</div>
|
406 |
-
</div>
|
407 |
-
</td>
|
408 |
-
</tr>
|
409 |
-
<tr>
|
410 |
-
<td width="100%" style="padding:0; margin:0;">
|
411 |
-
<form action="" method="get" style="background:none; margin:0; padding:0;">
|
412 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>">
|
413 |
-
<tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
|
414 |
-
<td class="calbg" colspan="7" style="background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');margin:0; padding:0;background-repeat: no-repeat;background-size: 100% 100%;" >
|
415 |
-
<?php //MONTH TABLE ?>
|
416 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
|
417 |
-
<tr>
|
418 |
-
<td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
419 |
-
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
420 |
-
if ($day == '01' && Month_num(Month_name(Month_num($month) - 1)) != '12') {
|
421 |
-
$needed_date = $year . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
422 |
-
}
|
423 |
-
elseif (Month_num(Month_name(Month_num($month) - 1)) == '12' && $day == '01') {
|
424 |
-
$needed_date = ($year - 1) . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
425 |
-
}
|
426 |
-
else {
|
427 |
-
$needed_date = $year . '-' . add_0((Month_num($month))) . '-' . add_0($day - 1);
|
428 |
-
}
|
429 |
-
echo add_query_arg(array(
|
430 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
431 |
-
'theme_id' => $theme_id,
|
432 |
-
'calendar' => $calendar_id,
|
433 |
-
'select' => $view_select,
|
434 |
-
'date' => $needed_date,
|
435 |
-
'many_sp_calendar' => $many_sp_calendar,
|
436 |
-
'cat_id' => '',
|
437 |
-
'cat_ids' => $cat_ids,
|
438 |
-
'widget' => $widget,
|
439 |
-
'TB_iframe' => 1,
|
440 |
-
), $site_url);
|
441 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-left"></div>
|
442 |
-
</a>
|
443 |
-
</td>
|
444 |
-
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
445 |
-
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
446 |
-
<span style="font-size:<?php echo $year_font_size; ?>px;?>; color:<?php echo $text_color_month; ?>;"><?php echo $day . ' ' . __($month, 'sp_calendar') . ', ' . $year ?></span>
|
447 |
-
</td>
|
448 |
-
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
449 |
-
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
450 |
-
if ($day == $month_day_count && Month_num(Month_name(Month_num($month) + 1)) != '1') {
|
451 |
-
$needed_date = $year . '-' . add_0((Month_num($month) + 1)) . '-01';
|
452 |
-
}
|
453 |
-
elseif (Month_num(Month_name(Month_num($month) + 1)) == '1' && $day == $month_day_count) {
|
454 |
-
$needed_date = ($year + 1) . '-' . add_0(Month_num($month + 1)) . '-01';
|
455 |
-
}
|
456 |
-
else {
|
457 |
-
$needed_date = $year . '-' . add_0(Month_num($month)) . '-' . add_0($day + 1);
|
458 |
-
}
|
459 |
-
echo add_query_arg(array(
|
460 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
461 |
-
'theme_id' => $theme_id,
|
462 |
-
'calendar' => $calendar_id,
|
463 |
-
'select' => $view_select,
|
464 |
-
'date' => $needed_date,
|
465 |
-
'many_sp_calendar' => $many_sp_calendar,
|
466 |
-
'cat_id' => '',
|
467 |
-
'cat_ids' => $cat_ids,
|
468 |
-
'widget' => $widget,
|
469 |
-
'TB_iframe' => 1,
|
470 |
-
), $site_url);
|
471 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-right"></div>
|
472 |
-
</a>
|
473 |
-
</td>
|
474 |
-
</tr>
|
475 |
-
</table>
|
476 |
-
</td>
|
477 |
-
</tr>
|
478 |
-
|
479 |
-
<tr>
|
480 |
-
<td colspan="7">
|
481 |
-
<?php
|
482 |
-
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
483 |
-
if ($weekstart == "su") {
|
484 |
-
$month_first_weekday++;
|
485 |
-
if ($month_first_weekday == 8) {
|
486 |
-
$month_first_weekday = 1;
|
487 |
-
}
|
488 |
-
}
|
489 |
-
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
490 |
-
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
491 |
-
$weekday_i = $month_first_weekday;
|
492 |
-
$last_month_days = $last_month_days - $weekday_i + 2;
|
493 |
-
$percent = 1;
|
494 |
-
$sum = $month_days - 8 + $month_first_weekday;
|
495 |
-
if ($sum % 7 <> 0) {
|
496 |
-
$percent = $percent + 1;
|
497 |
-
}
|
498 |
-
$sum = $sum - ($sum % 7);
|
499 |
-
$percent = $percent + ($sum / 7);
|
500 |
-
$percent = 107 / $percent;
|
501 |
-
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
502 |
-
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
503 |
-
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
504 |
-
$array_days = $all_calendar_files[0]['array_days'];
|
505 |
-
$array_days1 = $all_calendar_files[0]['array_days1'];
|
506 |
-
$title = $all_calendar_files[0]['title'];
|
507 |
-
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
508 |
-
sort($array_days, SORT_NUMERIC);
|
509 |
-
if (!$array_days || !in_array((int) $day, $array_days)) {
|
510 |
-
$week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
|
511 |
-
echo '<table style="border-spacing:0;width:100%;">
|
512 |
-
<tr>
|
513 |
-
<td style="height:14px;font-size:12px; padding-left:10px;background-color:#D6D4D5 !important; color:#6E7276">
|
514 |
-
<span style="padding-left:10px; font-size:12px;color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
|
515 |
-
<span style="font-size:12px;color:#949394;">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
|
516 |
-
</td>
|
517 |
-
</tr>
|
518 |
-
<tr>
|
519 |
-
<td>
|
520 |
-
<table style="height:14px;border-spacing:0;width: 100%;background-color:#D6D4D5 !important;">
|
521 |
-
<tr>
|
522 |
-
<td style="font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $bg . ' !important;color:#949394;"></td>
|
523 |
-
<td><p style="font-size:12px;color:' . $bg . ';border:none;"> ' . __('There are no events on this date', 'sp_calendar') . '</p></td>
|
524 |
-
</tr>
|
525 |
-
</table>
|
526 |
-
</td>
|
527 |
-
</tr>
|
528 |
-
</table>';
|
529 |
-
}
|
530 |
-
if (in_array((int) $day, $array_days)) {
|
531 |
-
$week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
|
532 |
-
echo '<table style="border-spacing:0;width:100%;">
|
533 |
-
<tr>
|
534 |
-
<td style="height:14px;font-size:12px; padding-left:10px;background-color:#D6D4D5 !important; color:#6E7276">
|
535 |
-
<span style="padding-left:10px; font-size:12px;color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
|
536 |
-
<span style="font-size:12px;color:#949394;">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
|
537 |
-
</td>
|
538 |
-
<tr>
|
539 |
-
<td>';
|
540 |
-
foreach ($title as $key => $value) {
|
541 |
-
if ($key == (int) $day) {
|
542 |
-
$ev_id = explode('<br>', $ev_ids[$key]);
|
543 |
-
array_pop($ev_id);
|
544 |
-
$ev_ids_inline = implode(',', $ev_id);
|
545 |
-
$ev_title = explode('</p>', $value);
|
546 |
-
array_pop($ev_title);
|
547 |
-
for ($j = 0; $j < count($ev_title); $j++) {
|
548 |
-
$query = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
549 |
-
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
550 |
-
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d" , $calendar,$ev_id[$j] );
|
551 |
-
|
552 |
-
$cat_color = $wpdb->get_row($query);
|
553 |
-
|
554 |
-
if (($j + 1) % 2 == 0) {
|
555 |
-
$color = $bg;
|
556 |
-
$table_color = $calendar_bg;
|
557 |
-
}
|
558 |
-
else {
|
559 |
-
$color = $bg;
|
560 |
-
$table_color = $calendar_bg;
|
561 |
-
}
|
562 |
-
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color=$bg;};
|
563 |
-
echo '<table style="border-spacing:0;height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
564 |
-
<tr>
|
565 |
-
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . str_replace('#','',$cat_color->color) . ' !important;color:' . $calendar_bg . '">' . ($j + 1) . '</td>
|
566 |
-
<td>
|
567 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:15px;background:none;text-decoration:none;color:' . $ev_title_color . '; "
|
568 |
-
href="' . add_query_arg(array(
|
569 |
-
'action' => 'spidercalendarbig',
|
570 |
-
'theme_id' => $theme_id,
|
571 |
-
'calendar_id' => $calendar_id,
|
572 |
-
'ev_ids' => $ev_ids_inline,
|
573 |
-
'eventID' => $ev_id[$j],
|
574 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . (int) $day,
|
575 |
-
'many_sp_calendar' => $many_sp_calendar,
|
576 |
-
'widget' => $widget,
|
577 |
-
'TB_iframe' => 1,
|
578 |
-
'tbWidth' => $popup_width,
|
579 |
-
'tbHeight' => $popup_height,
|
580 |
-
), $site_url) . '"><b>' . $ev_title[$j] . '</b>
|
581 |
-
</a>
|
582 |
-
</td>
|
583 |
-
</tr>
|
584 |
-
</table>';
|
585 |
-
}
|
586 |
-
}
|
587 |
-
}
|
588 |
-
echo '</td></tr></table>';
|
589 |
-
}
|
590 |
-
?>
|
591 |
-
</td>
|
592 |
-
</tr>
|
593 |
-
<tr style="height:<?php echo $year_font_size + 2; ?>px; font-family: <?php echo $font_year; ?>;">
|
594 |
-
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
595 |
-
echo add_query_arg(array(
|
596 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
597 |
-
'theme_id' => $theme_id,
|
598 |
-
'calendar' => $calendar_id,
|
599 |
-
'select' => $view_select,
|
600 |
-
'date' => ($year - 1) . '-' . add_0((Month_num($month))). '-' . $day,
|
601 |
-
'many_sp_calendar' => $many_sp_calendar,
|
602 |
-
'widget' => $widget,
|
603 |
-
'cat_id' => '',
|
604 |
-
'cat_ids' => $cat_ids,
|
605 |
-
'TB_iframe' => 1,
|
606 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important">
|
607 |
-
<?php echo ($year - 1); ?>
|
608 |
-
</td>
|
609 |
-
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
610 |
-
<?php echo $year; ?>
|
611 |
-
</td>
|
612 |
-
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
613 |
-
echo add_query_arg(array(
|
614 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
615 |
-
'theme_id' => $theme_id,
|
616 |
-
'calendar' => $calendar_id,
|
617 |
-
'select' => $view_select,
|
618 |
-
'date' => ($year + 1) . '-' . add_0((Month_num($month))). '-' . $day,
|
619 |
-
'many_sp_calendar' => $many_sp_calendar,
|
620 |
-
'widget' => $widget,
|
621 |
-
'cat_id' => '',
|
622 |
-
'cat_ids' => $cat_ids,
|
623 |
-
'TB_iframe' => 1,
|
624 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important;color:<?php echo $year_font_color; ?>">
|
625 |
-
<?php echo ($year + 1); ?>
|
626 |
-
</td>
|
627 |
-
</tr>
|
628 |
-
</table>
|
629 |
-
<input type="text" value="1" name="day" style="display:none" />
|
630 |
-
</form>
|
631 |
-
</td>
|
632 |
-
</tr>
|
633 |
-
</table>
|
634 |
-
</div>
|
635 |
-
<style>
|
636 |
-
#calendar_<?php echo $many_sp_calendar; ?> table{
|
637 |
-
width: 100%;
|
638 |
-
}
|
639 |
-
.spider_categories_widget{
|
640 |
-
display:inline-block;
|
641 |
-
cursor:pointer;
|
642 |
-
}
|
643 |
-
|
644 |
-
.spider_categories_widget p{
|
645 |
-
color: #fff;
|
646 |
-
padding: 2px 10px !important;
|
647 |
-
margin: 2px 0 !important;
|
648 |
-
font-size: 13px;
|
649 |
-
}
|
650 |
-
</style>
|
651 |
-
<?php
|
652 |
-
|
653 |
-
//reindex cat_ids_array
|
654 |
-
$re_cat_ids_array = array_values($cat_ids_array);
|
655 |
-
|
656 |
-
for($i=0; $i<count($re_cat_ids_array); $i++)
|
657 |
-
{
|
658 |
-
echo'
|
659 |
-
<style>
|
660 |
-
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
661 |
-
{
|
662 |
-
text-decoration:underline;
|
663 |
-
cursor:pointer;
|
664 |
-
|
665 |
-
}
|
666 |
-
|
667 |
-
</style>';
|
668 |
-
|
669 |
-
}
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
if($cat_ids=='')
|
674 |
-
$cat_ids='';
|
675 |
-
if($show_cat){
|
676 |
-
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none; margin-top: 10px;">';
|
677 |
-
|
678 |
-
foreach($categories as $category)
|
679 |
-
{
|
680 |
-
|
681 |
-
?>
|
682 |
-
|
683 |
-
<li class="spider_categories_widget"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
684 |
-
'action' => 'spiderbigcalendar_day_widget',
|
685 |
-
'theme_id' => $theme_id,
|
686 |
-
'calendar' => $calendar_id,
|
687 |
-
'select' => $view_select,
|
688 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
|
689 |
-
'many_sp_calendar' => $many_sp_calendar,
|
690 |
-
'cat_id' => $category->id,
|
691 |
-
'cat_ids' => $cat_ids,
|
692 |
-
'widget' => $widget,
|
693 |
-
'TB_iframe' => 1,
|
694 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
695 |
-
|
696 |
-
|
697 |
-
<?php
|
698 |
-
}
|
699 |
-
if (!empty($categories)) {
|
700 |
-
?>
|
701 |
-
<li class="spider_categories_widget"><p id="category0" style="background-color:<?php echo $bg; ?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
702 |
-
'action' => 'spiderbigcalendar_day_widget',
|
703 |
-
'theme_id' => $theme_id,
|
704 |
-
'calendar' => $calendar_id,
|
705 |
-
'select' => $view_select,
|
706 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
|
707 |
-
'many_sp_calendar' => $many_sp_calendar,
|
708 |
-
'cat_id' => '',
|
709 |
-
'cat_ids' => '',
|
710 |
-
'widget' => $widget,
|
711 |
-
'TB_iframe' => 1,
|
712 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
713 |
-
|
714 |
-
<?php echo '</ul>';
|
715 |
-
}
|
716 |
-
} ?>
|
717 |
-
</body>
|
718 |
-
</html>
|
719 |
-
<?php
|
720 |
-
die();
|
721 |
-
}
|
722 |
-
|
723 |
?>
|
1 |
+
<?php
|
2 |
+
function big_calendar_day_widget() {
|
3 |
+
require_once("frontend_functions.php");
|
4 |
+
global $wpdb;
|
5 |
+
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
+
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
+
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
+
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 1);
|
9 |
+
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
10 |
+
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
11 |
+
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
12 |
+
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
13 |
+
$site_url = get_admin_url().'admin-ajax.php';
|
14 |
+
///////////////////////////////////////////////////////////////////////////////////
|
15 |
+
|
16 |
+
|
17 |
+
if($cat_ids=='')
|
18 |
+
$cat_ids .= $cat_id.',';
|
19 |
+
else
|
20 |
+
$cat_ids .= ','.$cat_id.',';
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
25 |
+
|
26 |
+
|
27 |
+
function getelementcountinarray($array , $element)
|
28 |
+
{
|
29 |
+
$t=0;
|
30 |
+
|
31 |
+
for($i=0; $i<count($array); $i++)
|
32 |
+
{
|
33 |
+
if($element==$array[$i])
|
34 |
+
$t++;
|
35 |
+
|
36 |
+
}
|
37 |
+
|
38 |
+
|
39 |
+
return $t;
|
40 |
+
|
41 |
+
}
|
42 |
+
|
43 |
+
function getelementindexinarray($array , $element)
|
44 |
+
{
|
45 |
+
|
46 |
+
$t='';
|
47 |
+
|
48 |
+
for($i=0; $i<count($array); $i++)
|
49 |
+
{
|
50 |
+
if($element==$array[$i])
|
51 |
+
$t.=$i.',';
|
52 |
+
|
53 |
+
}
|
54 |
+
|
55 |
+
return $t;
|
56 |
+
|
57 |
+
|
58 |
+
}
|
59 |
+
$cat_ids_array = explode(',',$cat_ids);
|
60 |
+
|
61 |
+
|
62 |
+
if($cat_id!='')
|
63 |
+
{
|
64 |
+
|
65 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
66 |
+
{
|
67 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
68 |
+
$index_array = explode(',' , $index_in_line);
|
69 |
+
array_pop ($index_array);
|
70 |
+
for($j=0; $j<count($index_array); $j++)
|
71 |
+
unset($cat_ids_array[$index_array[$j]]);
|
72 |
+
$cat_ids = implode(',',$cat_ids_array);
|
73 |
+
}
|
74 |
+
}
|
75 |
+
else
|
76 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
77 |
+
|
78 |
+
|
79 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
80 |
+
|
81 |
+
|
82 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
83 |
+
$weekstart = $theme->week_start_day;
|
84 |
+
$bg = '#' . str_replace('#','',$theme->header_bgcolor);
|
85 |
+
$bg_color_selected = '#' . str_replace('#','',$theme->bg_color_selected);
|
86 |
+
$color_arrow = '#' . str_replace('#','',$theme->arrow_color);
|
87 |
+
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
88 |
+
$evented_color_bg = '#' . str_replace('#','',$theme->bg_color_this_month_evented);
|
89 |
+
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
90 |
+
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
91 |
+
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
92 |
+
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
93 |
+
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
94 |
+
$text_color_selected = '#' . str_replace('#','',$theme->text_color_selected);
|
95 |
+
$border_day = '#' . str_replace('#','',$theme->border_day);
|
96 |
+
$calendar_width = $theme->width;
|
97 |
+
$calendar_bg = '#' . str_replace('#','',$theme->footer_bgcolor);
|
98 |
+
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
99 |
+
$weekday_su_bg_color = '#' . str_replace('#','',$theme->su_bg_color);
|
100 |
+
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
101 |
+
$year_font_size = $theme->year_font_size;
|
102 |
+
$year_font_color = '#' . str_replace('#','',$theme->year_font_color);
|
103 |
+
$year_tabs_bg_color = '#' . str_replace('#','',$theme->year_tabs_bg_color);
|
104 |
+
$show_cat = $theme->show_cat;
|
105 |
+
$font_year = $theme->font_year;
|
106 |
+
$font_month = $theme->font_month;
|
107 |
+
$font_day = $theme->font_day;
|
108 |
+
$font_weekday = $theme->font_weekday;
|
109 |
+
$ev_title_color = '#' . str_replace('#','',$theme->ev_title_color);
|
110 |
+
$popup_width = $theme->popup_width;
|
111 |
+
$popup_height = $theme->popup_height;
|
112 |
+
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
113 |
+
|
114 |
+
__('January', 'sp_calendar');
|
115 |
+
__('February', 'sp_calendar');
|
116 |
+
__('March', 'sp_calendar');
|
117 |
+
__('April', 'sp_calendar');
|
118 |
+
__('May', 'sp_calendar');
|
119 |
+
__('June', 'sp_calendar');
|
120 |
+
__('July', 'sp_calendar');
|
121 |
+
__('August', 'sp_calendar');
|
122 |
+
__('September', 'sp_calendar');
|
123 |
+
__('October', 'sp_calendar');
|
124 |
+
__('November', 'sp_calendar');
|
125 |
+
__('December', 'sp_calendar');
|
126 |
+
// if ($cell_height == '') {
|
127 |
+
// $cell_height = 70;
|
128 |
+
// }
|
129 |
+
// if ($cal_width == '') {
|
130 |
+
// $cal_width = 700;
|
131 |
+
// }
|
132 |
+
if ($date != '') {
|
133 |
+
$date_REFERER = $date;
|
134 |
+
}
|
135 |
+
else {
|
136 |
+
$date_REFERER = date("Y-m");
|
137 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
138 |
+
}
|
139 |
+
|
140 |
+
$year_REFERER = substr($date_REFERER, 0, 4);
|
141 |
+
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
142 |
+
$day_REFERER = substr($date_REFERER, 8, 2);
|
143 |
+
|
144 |
+
$year = substr($date, 0, 4);
|
145 |
+
$month = Month_name(substr($date, 5, 2));
|
146 |
+
$day = substr($date, 8, 2);
|
147 |
+
|
148 |
+
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
149 |
+
$prev_month = add_0((int) $this_month - 1);
|
150 |
+
$next_month = add_0((int) $this_month + 1);
|
151 |
+
|
152 |
+
$cell_width = $calendar_width / 7;
|
153 |
+
$cell_width = (int) $cell_width - 2;
|
154 |
+
|
155 |
+
$month_day_count = date('t', mktime(0, 0, 0, Month_num($month), 1, $year));
|
156 |
+
$prev_month_day_count = date('t', mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
157 |
+
|
158 |
+
if ($day > $month_day_count) {
|
159 |
+
$month = Month_name(Month_num($month) + 1);
|
160 |
+
$day = '01';
|
161 |
+
}
|
162 |
+
if ((int) $day < 1) {
|
163 |
+
$month = Month_name(Month_num($month) - 1);
|
164 |
+
$day = $prev_month_day_count;
|
165 |
+
}
|
166 |
+
|
167 |
+
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
168 |
+
$prev_month = add_0((int) $this_month - 1);
|
169 |
+
$next_month = add_0((int) $this_month + 1);
|
170 |
+
|
171 |
+
$view = 'bigcalendarday_widget';
|
172 |
+
$views = explode(',', $view_select);
|
173 |
+
$defaultview = 'day';
|
174 |
+
array_pop($views);
|
175 |
+
$display = '';
|
176 |
+
if (count($views) == 0) {
|
177 |
+
$display = "display:none";
|
178 |
+
}
|
179 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
180 |
+
$display = "display:none";
|
181 |
+
}
|
182 |
+
?>
|
183 |
+
<html>
|
184 |
+
<head>
|
185 |
+
<style type='text/css'>
|
186 |
+
#calendar_<?php echo $many_sp_calendar; ?> table {
|
187 |
+
border-collapse: initial;
|
188 |
+
border:0px;
|
189 |
+
}
|
190 |
+
#TB_iframeContent{
|
191 |
+
background-color: <?php echo $show_event_bgcolor; ?>;
|
192 |
+
}
|
193 |
+
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
194 |
+
padding: 0px;
|
195 |
+
vertical-align: none;
|
196 |
+
border-top:none;
|
197 |
+
line-height: none;
|
198 |
+
text-align: none;
|
199 |
+
}
|
200 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
201 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
202 |
+
font-family: <?php echo $font_day; ?>;
|
203 |
+
}
|
204 |
+
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
205 |
+
margin-bottom: 0;
|
206 |
+
}
|
207 |
+
#calendar_<?php echo $many_sp_calendar; ?> td,
|
208 |
+
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
209 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar ?> td,
|
210 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar ?> tr {
|
211 |
+
border:none;
|
212 |
+
}
|
213 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
214 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
215 |
+
color: <?php echo $color_arrow; ?>;
|
216 |
+
text-decoration: none !important;
|
217 |
+
background: none !important;
|
218 |
+
font-size: 16px;
|
219 |
+
}
|
220 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
221 |
+
color: <?php echo $color_arrow; ?>;
|
222 |
+
text-decoration:none;
|
223 |
+
background:none !important;
|
224 |
+
}
|
225 |
+
#calendar_<?php echo $many_sp_calendar; ?> .arrow-left {
|
226 |
+
width: 0px;
|
227 |
+
height: 0px;
|
228 |
+
border-top: 7px solid transparent;
|
229 |
+
border-bottom: 7px solid transparent;
|
230 |
+
border-right: 13px solid;
|
231 |
+
margin: 0 auto;
|
232 |
+
}
|
233 |
+
|
234 |
+
#calendar_<?php echo $many_sp_calendar; ?> .arrow-right {
|
235 |
+
width: 0px;
|
236 |
+
height: 0px;
|
237 |
+
border-top: 7px solid transparent;
|
238 |
+
border-bottom: 7px solid transparent;
|
239 |
+
border-left: 13px solid;
|
240 |
+
margin: 0 auto;
|
241 |
+
}
|
242 |
+
|
243 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
244 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
245 |
+
text-decoration:underline;
|
246 |
+
background:none !important;
|
247 |
+
font-size:11px;
|
248 |
+
}
|
249 |
+
#calendar_<?php echo $many_sp_calendar; ?> a {
|
250 |
+
font-weight: normal;
|
251 |
+
}
|
252 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
253 |
+
font-size:12px;
|
254 |
+
text-decoration:none;
|
255 |
+
background:none !important;
|
256 |
+
}
|
257 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
258 |
+
border-spacing:0;
|
259 |
+
width:100%;
|
260 |
+
}
|
261 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
262 |
+
border-spacing: 0;
|
263 |
+
vertical-align: middle;
|
264 |
+
width: 100%;
|
265 |
+
}
|
266 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
267 |
+
background-color:<?php echo $bg; ?> !important;
|
268 |
+
text-align:center;
|
269 |
+
vertical-align: middle;
|
270 |
+
}
|
271 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
272 |
+
color:<?php echo $text_color_other_months; ?>;
|
273 |
+
}
|
274 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
275 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
276 |
+
}
|
277 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calfont_year {
|
278 |
+
font-size:24px;
|
279 |
+
font-weight:bold;
|
280 |
+
color:<?php echo $year_font_color; ?>;
|
281 |
+
}
|
282 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
283 |
+
color:<?php echo $sun_days; ?>;
|
284 |
+
}
|
285 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
286 |
+
border: solid <?php echo $border_day; ?> 1px;
|
287 |
+
}
|
288 |
+
#TB_window {
|
289 |
+
z-index: 10000;
|
290 |
+
}
|
291 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
292 |
+
float: right;
|
293 |
+
background-color: <?php echo $calendar_bg; ?> !important;
|
294 |
+
height: 25px;
|
295 |
+
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
296 |
+
margin-left: 2px;
|
297 |
+
text-align: center;
|
298 |
+
cursor:pointer;
|
299 |
+
position: relative;
|
300 |
+
top: 3px;
|
301 |
+
font-family: <?php echo $font_month; ?>;
|
302 |
+
font-size: 14px;
|
303 |
+
}
|
304 |
+
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
305 |
+
background: transparent !important;
|
306 |
+
}
|
307 |
+
|
308 |
+
|
309 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
310 |
+
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
311 |
+
{
|
312 |
+
width: 120px;
|
313 |
+
text-align: center;
|
314 |
+
cursor: pointer;
|
315 |
+
padding: 6px;
|
316 |
+
position: relative;
|
317 |
+
}
|
318 |
+
|
319 |
+
|
320 |
+
#drop_down_views
|
321 |
+
{
|
322 |
+
list-style-type:none !important;
|
323 |
+
position: absolute;
|
324 |
+
top: 46px;
|
325 |
+
left: -15px;
|
326 |
+
display:none;
|
327 |
+
z-index: 4545;
|
328 |
+
|
329 |
+
}
|
330 |
+
|
331 |
+
#drop_down_views >li
|
332 |
+
{
|
333 |
+
border-bottom:1px solid #fff !important;
|
334 |
+
}
|
335 |
+
|
336 |
+
|
337 |
+
#views_tabs_select
|
338 |
+
{
|
339 |
+
display:none;
|
340 |
+
}
|
341 |
+
</style>
|
342 |
+
</head>
|
343 |
+
<body>
|
344 |
+
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
345 |
+
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?> !important">
|
346 |
+
<tr style="background-color:#FFFFFF;">
|
347 |
+
<td style="background-color:#FFFFFF;">
|
348 |
+
<div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
|
349 |
+
<div class="views" style="margin-left: 4px;<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
350 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
351 |
+
'action' => 'spiderbigcalendar_day_widget',
|
352 |
+
'theme_id' => $theme_id,
|
353 |
+
'calendar' => $calendar_id,
|
354 |
+
'select' => $view_select,
|
355 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
356 |
+
'many_sp_calendar' => $many_sp_calendar,
|
357 |
+
'cat_id' => '',
|
358 |
+
'cat_ids' => $cat_ids,
|
359 |
+
'widget' => $widget,
|
360 |
+
'TB_iframe' => 1,
|
361 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Day', 'sp_calendar'); ?></span>
|
362 |
+
</div>
|
363 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
364 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
365 |
+
'action' => 'spiderbigcalendar_week_widget',
|
366 |
+
'theme_id' => $theme_id,
|
367 |
+
'calendar' => $calendar_id,
|
368 |
+
'select' => $view_select,
|
369 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
370 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
371 |
+
'many_sp_calendar' => $many_sp_calendar,
|
372 |
+
'cat_id' => '',
|
373 |
+
'cat_ids' => $cat_ids,
|
374 |
+
'widget' => $widget,
|
375 |
+
'TB_iframe' => 1,
|
376 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Week', 'sp_calendar'); ?></span>
|
377 |
+
</div>
|
378 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;' ?>"
|
379 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
380 |
+
'action' => 'spiderbigcalendar_list_widget',
|
381 |
+
'theme_id' => $theme_id,
|
382 |
+
'calendar' => $calendar_id,
|
383 |
+
'select' => $view_select,
|
384 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
385 |
+
'many_sp_calendar' => $many_sp_calendar,
|
386 |
+
'cat_id' => '',
|
387 |
+
'cat_ids' => $cat_ids,
|
388 |
+
'widget' => $widget,
|
389 |
+
'TB_iframe' => 1,
|
390 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('List', 'sp_calendar'); ?></span>
|
391 |
+
</div>
|
392 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
393 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
394 |
+
'action' => 'spiderbigcalendar_month_widget',
|
395 |
+
'theme_id' => $theme_id,
|
396 |
+
'calendar' => $calendar_id,
|
397 |
+
'select' => $view_select,
|
398 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
399 |
+
'many_sp_calendar' => $many_sp_calendar,
|
400 |
+
'cat_id' => '',
|
401 |
+
'cat_ids' => $cat_ids,
|
402 |
+
'widget' => $widget,
|
403 |
+
'TB_iframe' => 1,
|
404 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
405 |
+
</div>
|
406 |
+
</div>
|
407 |
+
</td>
|
408 |
+
</tr>
|
409 |
+
<tr>
|
410 |
+
<td width="100%" style="padding:0; margin:0;">
|
411 |
+
<form action="" method="get" style="background:none; margin:0; padding:0;">
|
412 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>">
|
413 |
+
<tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
|
414 |
+
<td class="calbg" colspan="7" style="background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');margin:0; padding:0;background-repeat: no-repeat;background-size: 100% 100%;" >
|
415 |
+
<?php //MONTH TABLE ?>
|
416 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
|
417 |
+
<tr>
|
418 |
+
<td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
419 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
420 |
+
if ($day == '01' && Month_num(Month_name(Month_num($month) - 1)) != '12') {
|
421 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
422 |
+
}
|
423 |
+
elseif (Month_num(Month_name(Month_num($month) - 1)) == '12' && $day == '01') {
|
424 |
+
$needed_date = ($year - 1) . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
425 |
+
}
|
426 |
+
else {
|
427 |
+
$needed_date = $year . '-' . add_0((Month_num($month))) . '-' . add_0($day - 1);
|
428 |
+
}
|
429 |
+
echo add_query_arg(array(
|
430 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
431 |
+
'theme_id' => $theme_id,
|
432 |
+
'calendar' => $calendar_id,
|
433 |
+
'select' => $view_select,
|
434 |
+
'date' => $needed_date,
|
435 |
+
'many_sp_calendar' => $many_sp_calendar,
|
436 |
+
'cat_id' => '',
|
437 |
+
'cat_ids' => $cat_ids,
|
438 |
+
'widget' => $widget,
|
439 |
+
'TB_iframe' => 1,
|
440 |
+
), $site_url);
|
441 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-left"></div>
|
442 |
+
</a>
|
443 |
+
</td>
|
444 |
+
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
445 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
446 |
+
<span style="font-size:<?php echo $year_font_size; ?>px;?>; color:<?php echo $text_color_month; ?>;"><?php echo $day . ' ' . __($month, 'sp_calendar') . ', ' . $year ?></span>
|
447 |
+
</td>
|
448 |
+
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
449 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
450 |
+
if ($day == $month_day_count && Month_num(Month_name(Month_num($month) + 1)) != '1') {
|
451 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1)) . '-01';
|
452 |
+
}
|
453 |
+
elseif (Month_num(Month_name(Month_num($month) + 1)) == '1' && $day == $month_day_count) {
|
454 |
+
$needed_date = ($year + 1) . '-' . add_0(Month_num($month + 1)) . '-01';
|
455 |
+
}
|
456 |
+
else {
|
457 |
+
$needed_date = $year . '-' . add_0(Month_num($month)) . '-' . add_0($day + 1);
|
458 |
+
}
|
459 |
+
echo add_query_arg(array(
|
460 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
461 |
+
'theme_id' => $theme_id,
|
462 |
+
'calendar' => $calendar_id,
|
463 |
+
'select' => $view_select,
|
464 |
+
'date' => $needed_date,
|
465 |
+
'many_sp_calendar' => $many_sp_calendar,
|
466 |
+
'cat_id' => '',
|
467 |
+
'cat_ids' => $cat_ids,
|
468 |
+
'widget' => $widget,
|
469 |
+
'TB_iframe' => 1,
|
470 |
+
), $site_url);
|
471 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-right"></div>
|
472 |
+
</a>
|
473 |
+
</td>
|
474 |
+
</tr>
|
475 |
+
</table>
|
476 |
+
</td>
|
477 |
+
</tr>
|
478 |
+
|
479 |
+
<tr>
|
480 |
+
<td colspan="7">
|
481 |
+
<?php
|
482 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
483 |
+
if ($weekstart == "su") {
|
484 |
+
$month_first_weekday++;
|
485 |
+
if ($month_first_weekday == 8) {
|
486 |
+
$month_first_weekday = 1;
|
487 |
+
}
|
488 |
+
}
|
489 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
490 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
491 |
+
$weekday_i = $month_first_weekday;
|
492 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
493 |
+
$percent = 1;
|
494 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
495 |
+
if ($sum % 7 <> 0) {
|
496 |
+
$percent = $percent + 1;
|
497 |
+
}
|
498 |
+
$sum = $sum - ($sum % 7);
|
499 |
+
$percent = $percent + ($sum / 7);
|
500 |
+
$percent = 107 / $percent;
|
501 |
+
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
502 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
503 |
+
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
504 |
+
$array_days = $all_calendar_files[0]['array_days'];
|
505 |
+
$array_days1 = $all_calendar_files[0]['array_days1'];
|
506 |
+
$title = $all_calendar_files[0]['title'];
|
507 |
+
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
508 |
+
sort($array_days, SORT_NUMERIC);
|
509 |
+
if (!$array_days || !in_array((int) $day, $array_days)) {
|
510 |
+
$week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
|
511 |
+
echo '<table style="border-spacing:0;width:100%;">
|
512 |
+
<tr>
|
513 |
+
<td style="height:14px;font-size:12px; padding-left:10px;background-color:#D6D4D5 !important; color:#6E7276">
|
514 |
+
<span style="padding-left:10px; font-size:12px;color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
|
515 |
+
<span style="font-size:12px;color:#949394;">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
|
516 |
+
</td>
|
517 |
+
</tr>
|
518 |
+
<tr>
|
519 |
+
<td>
|
520 |
+
<table style="height:14px;border-spacing:0;width: 100%;background-color:#D6D4D5 !important;">
|
521 |
+
<tr>
|
522 |
+
<td style="font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $bg . ' !important;color:#949394;"></td>
|
523 |
+
<td><p style="font-size:12px;color:' . $bg . ';border:none;"> ' . __('There are no events on this date', 'sp_calendar') . '</p></td>
|
524 |
+
</tr>
|
525 |
+
</table>
|
526 |
+
</td>
|
527 |
+
</tr>
|
528 |
+
</table>';
|
529 |
+
}
|
530 |
+
if (in_array((int) $day, $array_days)) {
|
531 |
+
$week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
|
532 |
+
echo '<table style="border-spacing:0;width:100%;">
|
533 |
+
<tr>
|
534 |
+
<td style="height:14px;font-size:12px; padding-left:10px;background-color:#D6D4D5 !important; color:#6E7276">
|
535 |
+
<span style="padding-left:10px; font-size:12px;color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
|
536 |
+
<span style="font-size:12px;color:#949394;">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
|
537 |
+
</td>
|
538 |
+
<tr>
|
539 |
+
<td>';
|
540 |
+
foreach ($title as $key => $value) {
|
541 |
+
if ($key == (int) $day) {
|
542 |
+
$ev_id = explode('<br>', $ev_ids[$key]);
|
543 |
+
array_pop($ev_id);
|
544 |
+
$ev_ids_inline = implode(',', $ev_id);
|
545 |
+
$ev_title = explode('</p>', $value);
|
546 |
+
array_pop($ev_title);
|
547 |
+
for ($j = 0; $j < count($ev_title); $j++) {
|
548 |
+
$query = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
549 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
550 |
+
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d" , $calendar,$ev_id[$j] );
|
551 |
+
|
552 |
+
$cat_color = $wpdb->get_row($query);
|
553 |
+
|
554 |
+
if (($j + 1) % 2 == 0) {
|
555 |
+
$color = $bg;
|
556 |
+
$table_color = $calendar_bg;
|
557 |
+
}
|
558 |
+
else {
|
559 |
+
$color = $bg;
|
560 |
+
$table_color = $calendar_bg;
|
561 |
+
}
|
562 |
+
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color=$bg;};
|
563 |
+
echo '<table style="border-spacing:0;height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
564 |
+
<tr>
|
565 |
+
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . str_replace('#','',$cat_color->color) . ' !important;color:' . $calendar_bg . '">' . ($j + 1) . '</td>
|
566 |
+
<td>
|
567 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:15px;background:none;text-decoration:none;color:' . $ev_title_color . '; "
|
568 |
+
href="' . add_query_arg(array(
|
569 |
+
'action' => 'spidercalendarbig',
|
570 |
+
'theme_id' => $theme_id,
|
571 |
+
'calendar_id' => $calendar_id,
|
572 |
+
'ev_ids' => $ev_ids_inline,
|
573 |
+
'eventID' => $ev_id[$j],
|
574 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . (int) $day,
|
575 |
+
'many_sp_calendar' => $many_sp_calendar,
|
576 |
+
'widget' => $widget,
|
577 |
+
'TB_iframe' => 1,
|
578 |
+
'tbWidth' => $popup_width,
|
579 |
+
'tbHeight' => $popup_height,
|
580 |
+
), $site_url) . '"><b>' . $ev_title[$j] . '</b>
|
581 |
+
</a>
|
582 |
+
</td>
|
583 |
+
</tr>
|
584 |
+
</table>';
|
585 |
+
}
|
586 |
+
}
|
587 |
+
}
|
588 |
+
echo '</td></tr></table>';
|
589 |
+
}
|
590 |
+
?>
|
591 |
+
</td>
|
592 |
+
</tr>
|
593 |
+
<tr style="height:<?php echo $year_font_size + 2; ?>px; font-family: <?php echo $font_year; ?>;">
|
594 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
595 |
+
echo add_query_arg(array(
|
596 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
597 |
+
'theme_id' => $theme_id,
|
598 |
+
'calendar' => $calendar_id,
|
599 |
+
'select' => $view_select,
|
600 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))). '-' . $day,
|
601 |
+
'many_sp_calendar' => $many_sp_calendar,
|
602 |
+
'widget' => $widget,
|
603 |
+
'cat_id' => '',
|
604 |
+
'cat_ids' => $cat_ids,
|
605 |
+
'TB_iframe' => 1,
|
606 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important">
|
607 |
+
<?php echo ($year - 1); ?>
|
608 |
+
</td>
|
609 |
+
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
610 |
+
<?php echo $year; ?>
|
611 |
+
</td>
|
612 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
613 |
+
echo add_query_arg(array(
|
614 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
615 |
+
'theme_id' => $theme_id,
|
616 |
+
'calendar' => $calendar_id,
|
617 |
+
'select' => $view_select,
|
618 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month))). '-' . $day,
|
619 |
+
'many_sp_calendar' => $many_sp_calendar,
|
620 |
+
'widget' => $widget,
|
621 |
+
'cat_id' => '',
|
622 |
+
'cat_ids' => $cat_ids,
|
623 |
+
'TB_iframe' => 1,
|
624 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important;color:<?php echo $year_font_color; ?>">
|
625 |
+
<?php echo ($year + 1); ?>
|
626 |
+
</td>
|
627 |
+
</tr>
|
628 |
+
</table>
|
629 |
+
<input type="text" value="1" name="day" style="display:none" />
|
630 |
+
</form>
|
631 |
+
</td>
|
632 |
+
</tr>
|
633 |
+
</table>
|
634 |
+
</div>
|
635 |
+
<style>
|
636 |
+
#calendar_<?php echo $many_sp_calendar; ?> table{
|
637 |
+
width: 100%;
|
638 |
+
}
|
639 |
+
.spider_categories_widget{
|
640 |
+
display:inline-block;
|
641 |
+
cursor:pointer;
|
642 |
+
}
|
643 |
+
|
644 |
+
.spider_categories_widget p{
|
645 |
+
color: #fff;
|
646 |
+
padding: 2px 10px !important;
|
647 |
+
margin: 2px 0 !important;
|
648 |
+
font-size: 13px;
|
649 |
+
}
|
650 |
+
</style>
|
651 |
+
<?php
|
652 |
+
|
653 |
+
//reindex cat_ids_array
|
654 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
655 |
+
|
656 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
657 |
+
{
|
658 |
+
echo'
|
659 |
+
<style>
|
660 |
+
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
661 |
+
{
|
662 |
+
text-decoration:underline;
|
663 |
+
cursor:pointer;
|
664 |
+
|
665 |
+
}
|
666 |
+
|
667 |
+
</style>';
|
668 |
+
|
669 |
+
}
|
670 |
+
|
671 |
+
|
672 |
+
|
673 |
+
if($cat_ids=='')
|
674 |
+
$cat_ids='';
|
675 |
+
if($show_cat){
|
676 |
+
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none; margin-top: 10px;">';
|
677 |
+
|
678 |
+
foreach($categories as $category)
|
679 |
+
{
|
680 |
+
|
681 |
+
?>
|
682 |
+
|
683 |
+
<li class="spider_categories_widget"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
684 |
+
'action' => 'spiderbigcalendar_day_widget',
|
685 |
+
'theme_id' => $theme_id,
|
686 |
+
'calendar' => $calendar_id,
|
687 |
+
'select' => $view_select,
|
688 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
|
689 |
+
'many_sp_calendar' => $many_sp_calendar,
|
690 |
+
'cat_id' => $category->id,
|
691 |
+
'cat_ids' => $cat_ids,
|
692 |
+
'widget' => $widget,
|
693 |
+
'TB_iframe' => 1,
|
694 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
695 |
+
|
696 |
+
|
697 |
+
<?php
|
698 |
+
}
|
699 |
+
if (!empty($categories)) {
|
700 |
+
?>
|
701 |
+
<li class="spider_categories_widget"><p id="category0" style="background-color:<?php echo $bg; ?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
702 |
+
'action' => 'spiderbigcalendar_day_widget',
|
703 |
+
'theme_id' => $theme_id,
|
704 |
+
'calendar' => $calendar_id,
|
705 |
+
'select' => $view_select,
|
706 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
|
707 |
+
'many_sp_calendar' => $many_sp_calendar,
|
708 |
+
'cat_id' => '',
|
709 |
+
'cat_ids' => '',
|
710 |
+
'widget' => $widget,
|
711 |
+
'TB_iframe' => 1,
|
712 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
713 |
+
|
714 |
+
<?php echo '</ul>';
|
715 |
+
}
|
716 |
+
} ?>
|
717 |
+
</body>
|
718 |
+
</html>
|
719 |
+
<?php
|
720 |
+
die();
|
721 |
+
}
|
722 |
+
|
723 |
?>
|
front_end/bigcalendarlist.php
CHANGED
@@ -1,990 +1,990 @@
|
|
1 |
-
<?php
|
2 |
-
function big_calendar_list() {
|
3 |
-
require_once("frontend_functions.php");
|
4 |
-
global $wpdb;
|
5 |
-
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
-
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
-
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
-
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 30);
|
9 |
-
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
10 |
-
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
11 |
-
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
12 |
-
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
13 |
-
$site_url = get_admin_url().'admin-ajax.php';
|
14 |
-
///////////////////////////////////////////////////////////////////////////////////
|
15 |
-
|
16 |
-
|
17 |
-
if($cat_ids=='')
|
18 |
-
$cat_ids .= $cat_id.',';
|
19 |
-
else
|
20 |
-
$cat_ids .= ','.$cat_id.',';
|
21 |
-
|
22 |
-
|
23 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
24 |
-
|
25 |
-
|
26 |
-
function getelementcountinarray($array , $element)
|
27 |
-
{
|
28 |
-
$t=0;
|
29 |
-
|
30 |
-
for($i=0; $i<count($array); $i++)
|
31 |
-
{
|
32 |
-
if($element==$array[$i])
|
33 |
-
$t++;
|
34 |
-
|
35 |
-
}
|
36 |
-
|
37 |
-
|
38 |
-
return $t;
|
39 |
-
|
40 |
-
}
|
41 |
-
|
42 |
-
function getelementindexinarray($array , $element)
|
43 |
-
{
|
44 |
-
|
45 |
-
$t='';
|
46 |
-
|
47 |
-
for($i=0; $i<count($array); $i++)
|
48 |
-
{
|
49 |
-
if($element==$array[$i])
|
50 |
-
$t.=$i.',';
|
51 |
-
|
52 |
-
}
|
53 |
-
|
54 |
-
return $t;
|
55 |
-
|
56 |
-
|
57 |
-
}
|
58 |
-
$cat_ids_array = explode(',',$cat_ids);
|
59 |
-
|
60 |
-
if($cat_id!='')
|
61 |
-
{
|
62 |
-
|
63 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
64 |
-
{
|
65 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
66 |
-
$index_array = explode(',' , $index_in_line);
|
67 |
-
array_pop ($index_array);
|
68 |
-
for($j=0; $j<count($index_array); $j++)
|
69 |
-
unset($cat_ids_array[$index_array[$j]]);
|
70 |
-
$cat_ids = implode(',',$cat_ids_array);
|
71 |
-
}
|
72 |
-
}
|
73 |
-
else
|
74 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
75 |
-
|
76 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
77 |
-
|
78 |
-
|
79 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
80 |
-
$cal_width = $theme->width;
|
81 |
-
$bg_top = '#' . str_replace('#','',$theme->bg_top);
|
82 |
-
$bg_bottom = '#' . str_replace('#','',$theme->bg_bottom);
|
83 |
-
$border_color = '#' . str_replace('#','',$theme->border_color);
|
84 |
-
$text_color_year = '#' . str_replace('#','',$theme->text_color_year);
|
85 |
-
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
86 |
-
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
87 |
-
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
88 |
-
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
89 |
-
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
90 |
-
$evented_color_bg = (isset($theme->bg_color_this_month_evented) ?'#' . str_replace('#','',$theme->bg_color_this_month_evented) : '');
|
91 |
-
$color_arrow_year = '#' . str_replace('#','',$theme->arrow_color_year);
|
92 |
-
$color_arrow_month = '#' . str_replace('#','',$theme->arrow_color_month);
|
93 |
-
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
94 |
-
$event_title_color = '#' . str_replace('#','',$theme->event_title_color);
|
95 |
-
$current_day_border_color = '#' . str_replace('#','',$theme->current_day_border_color);
|
96 |
-
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
97 |
-
$cell_height = $theme->cell_height;
|
98 |
-
$popup_width = $theme->popup_width;
|
99 |
-
$popup_height = $theme->popup_height;
|
100 |
-
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
101 |
-
$sundays_font_size = $theme->sundays_font_size;
|
102 |
-
$other_days_font_size = $theme->other_days_font_size;
|
103 |
-
$weekdays_font_size = $theme->weekdays_font_size;
|
104 |
-
$border_width = $theme->border_width;
|
105 |
-
$top_height = $theme->top_height;
|
106 |
-
$bg_color_other_months = '#' . str_replace('#','',$theme->bg_color_other_months);
|
107 |
-
$sundays_bg_color = '#' . str_replace('#','',$theme->sundays_bg_color);
|
108 |
-
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
109 |
-
$weekstart = $theme->week_start_day;
|
110 |
-
$weekday_sunday_bg_color = '#' . str_replace('#','',$theme->weekday_sunday_bg_color);
|
111 |
-
$border_radius = $theme->border_radius;
|
112 |
-
$border_radius2 = $border_radius-$border_width;
|
113 |
-
$week_days_cell_height = $theme->week_days_cell_height;
|
114 |
-
$year_font_size = $theme->year_font_size;
|
115 |
-
$month_font_size = $theme->month_font_size;
|
116 |
-
$arrow_size = $theme->arrow_size;
|
117 |
-
$arrow_size_hover = $arrow_size;
|
118 |
-
$next_month_text_color = '#' . str_replace('#','',$theme->next_month_text_color);
|
119 |
-
$prev_month_text_color = '#' . str_replace('#','',$theme->prev_month_text_color);
|
120 |
-
$next_month_arrow_color = '#' . str_replace('#','',$theme->next_month_arrow_color);
|
121 |
-
$prev_month_arrow_color = '#' . str_replace('#','',$theme->prev_month_arrow_color);
|
122 |
-
$next_month_font_size = $theme->next_month_font_size;
|
123 |
-
$prev_month_font_size = $theme->prev_month_font_size;
|
124 |
-
$month_type = $theme->month_type;
|
125 |
-
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
126 |
-
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
127 |
-
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
128 |
-
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
129 |
-
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
130 |
-
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
131 |
-
$date_font_size = $theme->date_font_size;
|
132 |
-
$event_num_font_size = $theme->event_num_font_size;
|
133 |
-
$event_table_height = $theme->event_table_height;
|
134 |
-
$date_height = $theme->date_height;
|
135 |
-
$day_month_font_size = $theme->day_month_font_size;
|
136 |
-
$week_font_size = $theme->week_font_size;
|
137 |
-
$day_month_font_color = '#' . str_replace('#','',$theme->day_month_font_color);
|
138 |
-
$week_font_color = '#' . str_replace('#','',$theme->week_font_color);
|
139 |
-
$views_tabs_bg_color = '#' . str_replace('#','',$theme->views_tabs_bg_color);
|
140 |
-
$views_tabs_text_color = '#' . str_replace('#','',$theme->views_tabs_text_color);
|
141 |
-
$views_tabs_font_size = $theme->views_tabs_font_size;
|
142 |
-
$show_cat = $theme->show_cat;
|
143 |
-
$header_format = (isset($theme->header_format) ? $theme->header_format : 'w/d/m/y');
|
144 |
-
|
145 |
-
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
146 |
-
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
147 |
-
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
148 |
-
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
149 |
-
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
150 |
-
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
151 |
-
$date_font_size = $theme->date_font_size;
|
152 |
-
$event_num_font_size = $theme->event_num_font_size;
|
153 |
-
$show_numbers_for_events = $theme->day_start;
|
154 |
-
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
155 |
-
|
156 |
-
__('January', 'sp_calendar');
|
157 |
-
__('February', 'sp_calendar');
|
158 |
-
__('March', 'sp_calendar');
|
159 |
-
__('April', 'sp_calendar');
|
160 |
-
__('May', 'sp_calendar');
|
161 |
-
__('June', 'sp_calendar');
|
162 |
-
__('July', 'sp_calendar');
|
163 |
-
__('August', 'sp_calendar');
|
164 |
-
__('September', 'sp_calendar');
|
165 |
-
__('October', 'sp_calendar');
|
166 |
-
__('November', 'sp_calendar');
|
167 |
-
__('December', 'sp_calendar');
|
168 |
-
if ($cell_height == '') {
|
169 |
-
$cell_height = 70;
|
170 |
-
}
|
171 |
-
if ($cal_width == '') {
|
172 |
-
$cal_width = 700;
|
173 |
-
}
|
174 |
-
|
175 |
-
if ($date != '') {
|
176 |
-
$date_REFERER = $date;
|
177 |
-
}
|
178 |
-
else {
|
179 |
-
$date_REFERER = date("Y-m");
|
180 |
-
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
181 |
-
}
|
182 |
-
$year_REFERER = substr($date_REFERER, 0, 4);
|
183 |
-
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
184 |
-
$day_REFERER = substr($date_REFERER, 8, 2);
|
185 |
-
|
186 |
-
$year = substr($date, 0, 4);
|
187 |
-
$month = Month_name(substr($date, 5, 2));
|
188 |
-
$day = substr($date, 8, 2);
|
189 |
-
|
190 |
-
$cell_width = $cal_width / 7;
|
191 |
-
|
192 |
-
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
193 |
-
$prev_month = add_0((int) $this_month - 1);
|
194 |
-
$next_month = add_0((int) $this_month + 1);
|
195 |
-
|
196 |
-
$activedatestr = "";
|
197 |
-
$view = 'bigcalendarlist';
|
198 |
-
$views = explode(',', $view_select);
|
199 |
-
$defaultview = 'list';
|
200 |
-
array_pop($views);
|
201 |
-
$display = '';
|
202 |
-
if (count($views) == 0) {
|
203 |
-
$display = "display:none";
|
204 |
-
}
|
205 |
-
if(count($views) == 1 && $views[0] == $defaultview) {
|
206 |
-
$display = "display:none";
|
207 |
-
}
|
208 |
-
|
209 |
-
|
210 |
-
$date_format_array = explode('/', $header_format);
|
211 |
-
for ($i = 0; $i < 4; $i++) {
|
212 |
-
if (isset($date_format_array[$i]) && ($date_format_array[$i] == 'd' || $date_format_array[$i] == 'w')) {
|
213 |
-
unset($date_format_array[$i]);
|
214 |
-
}
|
215 |
-
if (isset($date_format_array[$i]) && $date_format_array[$i] == 'm') $date_format_array[$i] = 'F';
|
216 |
-
if (isset($date_format_array[$i]) && $date_format_array[$i] == 'y') $date_format_array[$i] = 'Y';
|
217 |
-
}
|
218 |
-
$header_date_format = implode(' ', $date_format_array);
|
219 |
-
$name_year = date($header_date_format, strtotime($date));
|
220 |
-
$exp_name_year = explode(' ', $name_year);
|
221 |
-
for($j = 0; $j < count($exp_name_year); $j++){
|
222 |
-
$activedatestr .= __($exp_name_year[$j], 'sp_calendar') . ' ';
|
223 |
-
}
|
224 |
-
|
225 |
-
?>
|
226 |
-
<html>
|
227 |
-
<head>
|
228 |
-
<style type='text/css'>
|
229 |
-
#afterbig<?php echo $many_sp_calendar; ?> table,
|
230 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
231 |
-
font-family: Segoe UI;
|
232 |
-
border: 0;
|
233 |
-
}
|
234 |
-
|
235 |
-
.general_table table table:last-child .last_table:last-child td{
|
236 |
-
border-bottom-left-radius:<?php echo $border_radius2?>px;
|
237 |
-
|
238 |
-
}
|
239 |
-
#TB_iframeContent{
|
240 |
-
background-color: <?php echo $show_event_bgcolor; ?>;
|
241 |
-
}
|
242 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-left {
|
243 |
-
width: 0px;
|
244 |
-
height: 0px;
|
245 |
-
border-top: 15px solid transparent;
|
246 |
-
border-bottom: 15px solid transparent;
|
247 |
-
border-right: 20px solid;
|
248 |
-
margin: 0 auto;
|
249 |
-
}
|
250 |
-
|
251 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-right {
|
252 |
-
width: 0px;
|
253 |
-
height: 0px;
|
254 |
-
border-top: 15px solid transparent;
|
255 |
-
border-bottom: 15px solid transparent;
|
256 |
-
border-left: 20px solid;
|
257 |
-
margin: 0 auto;
|
258 |
-
}
|
259 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-right{
|
260 |
-
border-top: 5px solid transparent;
|
261 |
-
border-bottom: 5px solid transparent;
|
262 |
-
border-left: 8px solid;
|
263 |
-
left: 5px;
|
264 |
-
position: relative;
|
265 |
-
}
|
266 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-down{
|
267 |
-
width: 0px;
|
268 |
-
height: 0px;
|
269 |
-
border-left: 5px solid transparent;
|
270 |
-
border-right: 5px solid transparent;
|
271 |
-
border-top: 8px solid;
|
272 |
-
}
|
273 |
-
|
274 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
275 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
276 |
-
#spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
277 |
-
border: none !important;
|
278 |
-
}
|
279 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
280 |
-
border-radius: <?php echo $border_radius; ?>px !important;
|
281 |
-
}
|
282 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
283 |
-
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
284 |
-
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
285 |
-
}
|
286 |
-
|
287 |
-
|
288 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
289 |
-
#bigcalendar .cala_arrow a:visited {
|
290 |
-
text-decoration: none !important;
|
291 |
-
box-shadow: none !important;
|
292 |
-
background: none !important;
|
293 |
-
font-size: <?php echo $arrow_size; ?>px !important;
|
294 |
-
}
|
295 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow {
|
296 |
-
vertical-align: middle !important;
|
297 |
-
}
|
298 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
299 |
-
font-size: <?php echo $arrow_size_hover; ?>px !important;
|
300 |
-
text-decoration: none !important;
|
301 |
-
background: none !important;
|
302 |
-
}
|
303 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
304 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
305 |
-
text-decoration: none !important;
|
306 |
-
background: none !important;
|
307 |
-
font-size: 12px !important;
|
308 |
-
color: red;
|
309 |
-
}
|
310 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
311 |
-
text-decoration: none !important;
|
312 |
-
background: none !important;
|
313 |
-
}
|
314 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
315 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
316 |
-
<?php echo 'vertical-align:top !important;'; ?>
|
317 |
-
}
|
318 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
319 |
-
vertical-align: middle !important;
|
320 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
321 |
-
}
|
322 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
323 |
-
font-size: <?php echo $weekdays_font_size; ?>px !important;
|
324 |
-
}
|
325 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
326 |
-
border-spacing: 0 !important;
|
327 |
-
width: 100% !important;
|
328 |
-
}
|
329 |
-
.calyear_table table #bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
330 |
-
border-spacing: 0 !important;
|
331 |
-
width: 100% !important;
|
332 |
-
}
|
333 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
334 |
-
#bigcalendar .calbg td {
|
335 |
-
text-align: center !important;
|
336 |
-
width: 14% !important;
|
337 |
-
}
|
338 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
339 |
-
color: <?php echo $text_color_other_months; ?> !important;
|
340 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
341 |
-
<?php echo 'vertical-align:top !important;'; ?>
|
342 |
-
}
|
343 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
344 |
-
color: <?php echo $text_color_this_month_unevented; ?> !important;
|
345 |
-
}
|
346 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
347 |
-
font-size: 24px !important;
|
348 |
-
font-weight: bold !important;
|
349 |
-
color: <?php echo $text_color_year; ?> !important;
|
350 |
-
}
|
351 |
-
.general_table table, .general_table td, .general_table tr {
|
352 |
-
border: inherit !important;
|
353 |
-
vertical-align: initial !important;
|
354 |
-
border-collapse: inherit !important;
|
355 |
-
margin: inherit !important;
|
356 |
-
padding: inherit !important;
|
357 |
-
}
|
358 |
-
.general_table {
|
359 |
-
border-collapse: inherit !important;
|
360 |
-
margin: inherit !important;
|
361 |
-
}
|
362 |
-
.general_table p {
|
363 |
-
margin: inherit !important;
|
364 |
-
padding: inherit !important;
|
365 |
-
}
|
366 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
367 |
-
color: <?php echo $sun_days; ?> !important;
|
368 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
369 |
-
<?php echo 'vertical-align:top !important; text-align:left !important;'; ?>
|
370 |
-
background-color: <?php echo $sundays_bg_color; ?> !important;
|
371 |
-
}
|
372 |
-
#TB_window {
|
373 |
-
z-index: 10000;
|
374 |
-
}
|
375 |
-
|
376 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> td {
|
377 |
-
vertical-align: middle !important;
|
378 |
-
}
|
379 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table {
|
380 |
-
border-collapse: initial;
|
381 |
-
border:0px;
|
382 |
-
max-width: none;
|
383 |
-
}
|
384 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table tr:hover td {
|
385 |
-
background: none;
|
386 |
-
}
|
387 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
388 |
-
padding: 0px;
|
389 |
-
vertical-align: none;
|
390 |
-
border-top:none;
|
391 |
-
line-height: none;
|
392 |
-
text-align: none;
|
393 |
-
background: transparent;
|
394 |
-
}
|
395 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
396 |
-
margin-bottom:0;
|
397 |
-
}
|
398 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
399 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
400 |
-
#spiderCalendarTitlesList td,
|
401 |
-
#spiderCalendarTitlesList tr {
|
402 |
-
border:none;
|
403 |
-
}
|
404 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
405 |
-
border-radius: <?php echo $border_radius; ?>px;
|
406 |
-
}
|
407 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
408 |
-
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
409 |
-
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
410 |
-
}
|
411 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
412 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
413 |
-
text-decoration:none !important;
|
414 |
-
background:none;
|
415 |
-
font-size: <?php echo $arrow_size; ?>px;
|
416 |
-
}
|
417 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
418 |
-
text-decoration:none;
|
419 |
-
background:none;
|
420 |
-
}
|
421 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
422 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
423 |
-
text-decoration:none;
|
424 |
-
background:none;
|
425 |
-
font-size:12px;
|
426 |
-
color:red;
|
427 |
-
}
|
428 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
429 |
-
text-decoration:none;
|
430 |
-
background:none;
|
431 |
-
}
|
432 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
433 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
434 |
-
vertical-align:top;
|
435 |
-
}
|
436 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
437 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
438 |
-
}
|
439 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
440 |
-
font-size:<?php echo $weekdays_font_size; ?>px;
|
441 |
-
}
|
442 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
443 |
-
border-spacing:0;
|
444 |
-
width:100%;
|
445 |
-
}
|
446 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
447 |
-
border-spacing:0;
|
448 |
-
width:100%;
|
449 |
-
}
|
450 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
451 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
|
452 |
-
text-align:center;
|
453 |
-
width:14%;
|
454 |
-
}
|
455 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
456 |
-
color:<?php echo $text_color_other_months; ?>;
|
457 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
458 |
-
vertical-align:top;
|
459 |
-
}
|
460 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
461 |
-
color:<?php echo $text_color_this_month_unevented; ?>;
|
462 |
-
}
|
463 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
464 |
-
font-size:24px;
|
465 |
-
font-weight:bold;
|
466 |
-
color:<?php echo $text_color_year; ?>;
|
467 |
-
}
|
468 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
469 |
-
color:<?php echo $sun_days; ?>;
|
470 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
471 |
-
vertical-align:top;
|
472 |
-
text-align:left;
|
473 |
-
background-color:<?php echo $sundays_bg_color; ?> !important;
|
474 |
-
}
|
475 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
476 |
-
float: right;
|
477 |
-
background-color: <?php echo $views_tabs_bg_color; ?> !important;
|
478 |
-
min-height: 25px;
|
479 |
-
min-width: 70px;
|
480 |
-
margin-left: 2px;
|
481 |
-
text-align: center;
|
482 |
-
cursor:pointer;
|
483 |
-
position: relative;
|
484 |
-
top: 5px;
|
485 |
-
}
|
486 |
-
#afterbig<?php echo $many_sp_calendar; ?> .views span,
|
487 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
488 |
-
line-height: 30px;
|
489 |
-
}
|
490 |
-
|
491 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
492 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
493 |
-
{
|
494 |
-
|
495 |
-
background-color: <?php echo $views_tabs_bg_color?> !important;
|
496 |
-
width: 120px;
|
497 |
-
text-align: center;
|
498 |
-
cursor: pointer;
|
499 |
-
padding: 6px;
|
500 |
-
position: relative;
|
501 |
-
}
|
502 |
-
|
503 |
-
|
504 |
-
#drop_down_views
|
505 |
-
{
|
506 |
-
list-style-type:none !important;
|
507 |
-
position: absolute;
|
508 |
-
top: 46px;
|
509 |
-
left: 0;
|
510 |
-
display:none;
|
511 |
-
z-index: 4545;
|
512 |
-
margin-left: 0;
|
513 |
-
}
|
514 |
-
|
515 |
-
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
516 |
-
{
|
517 |
-
background:<?php echo $bg_top ?> !important;
|
518 |
-
}
|
519 |
-
|
520 |
-
#drop_down_views >li
|
521 |
-
{
|
522 |
-
border-bottom:1px solid #fff !important;
|
523 |
-
}
|
524 |
-
|
525 |
-
|
526 |
-
#views_tabs_select
|
527 |
-
{
|
528 |
-
display:none;
|
529 |
-
}
|
530 |
-
|
531 |
-
</style>
|
532 |
-
</head>
|
533 |
-
<body>
|
534 |
-
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
535 |
-
<div style="width:100%;">
|
536 |
-
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
537 |
-
<tr>
|
538 |
-
<td>
|
539 |
-
|
540 |
-
<div id="views_tabs" style="width: 100%;<?php echo $display; ?>">
|
541 |
-
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
542 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
543 |
-
'action' => 'spiderbigcalendar_day',
|
544 |
-
'theme_id' => $theme_id,
|
545 |
-
'calendar' => $calendar_id,
|
546 |
-
'select' => $view_select,
|
547 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
548 |
-
'many_sp_calendar' => $many_sp_calendar,
|
549 |
-
'cat_id' => '',
|
550 |
-
'cat_ids' => $cat_ids,
|
551 |
-
'widget' => $widget,
|
552 |
-
'rand' => $many_sp_calendar,
|
553 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Day', 'sp_calendar'); ?></span>
|
554 |
-
</div>
|
555 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
556 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
557 |
-
'action' => 'spiderbigcalendar_week',
|
558 |
-
'theme_id' => $theme_id,
|
559 |
-
'calendar' => $calendar_id,
|
560 |
-
'select' => $view_select,
|
561 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
562 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
563 |
-
'many_sp_calendar' => $many_sp_calendar,
|
564 |
-
'cat_id' => '',
|
565 |
-
'cat_ids' => $cat_ids,
|
566 |
-
'widget' => $widget,
|
567 |
-
'rand' => $many_sp_calendar,
|
568 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Week', 'sp_calendar'); ?></span>
|
569 |
-
</div>
|
570 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
571 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
572 |
-
'action' => 'spiderbigcalendar_list',
|
573 |
-
'theme_id' => $theme_id,
|
574 |
-
'calendar' => $calendar_id,
|
575 |
-
'select' => $view_select,
|
576 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
577 |
-
'many_sp_calendar' => $many_sp_calendar,
|
578 |
-
'cat_id' => '',
|
579 |
-
'cat_ids' => $cat_ids,
|
580 |
-
'widget' => $widget,
|
581 |
-
'rand' => $many_sp_calendar,
|
582 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('List', 'sp_calendar'); ?></span>
|
583 |
-
</div>
|
584 |
-
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
585 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
586 |
-
'action' => 'spiderbigcalendar_month',
|
587 |
-
'theme_id' => $theme_id,
|
588 |
-
'calendar' => $calendar_id,
|
589 |
-
'select' => $view_select,
|
590 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
591 |
-
'many_sp_calendar' => $many_sp_calendar,
|
592 |
-
'cat_id' => '',
|
593 |
-
'cat_ids' => $cat_ids,
|
594 |
-
'widget' => $widget,
|
595 |
-
'rand' => $many_sp_calendar,
|
596 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Month', 'sp_calendar'); ?></span>
|
597 |
-
</div>
|
598 |
-
</div>
|
599 |
-
|
600 |
-
<div id="views_tabs_select" style="display:none" >
|
601 |
-
<div id="views_select" style="background-color:<?php echo $bg_top?> !important;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
602 |
-
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
603 |
-
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
604 |
-
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
605 |
-
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
606 |
-
<div class="arrow-right show_arrow"></div>
|
607 |
-
<div class="arrow-down"></div>
|
608 |
-
</div>
|
609 |
-
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
610 |
-
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
611 |
-
<div class="views_select"
|
612 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
613 |
-
'action' => 'spiderbigcalendar_month',
|
614 |
-
'theme_id' => $theme_id,
|
615 |
-
'calendar' => $calendar_id,
|
616 |
-
'select' => $view_select,
|
617 |
-
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
618 |
-
'many_sp_calendar' => $many_sp_calendar,
|
619 |
-
'cat_id' => '',
|
620 |
-
'cat_ids' => $cat_ids,
|
621 |
-
'widget' => $widget,
|
622 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
623 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
624 |
-
</div>
|
625 |
-
</li>
|
626 |
-
|
627 |
-
<li <?php if($view=='bigcalendarweek'):?> class="active" <?php endif; ?> style="<?php if(!in_array('week',$views) AND $defaultview!='week' ) echo 'display:none;' ; ?>" ><div class="views_select"
|
628 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
629 |
-
'action' => 'spiderbigcalendar_week',
|
630 |
-
'theme_id' => $theme_id,
|
631 |
-
'calendar' => $calendar_id,
|
632 |
-
'select' => $view_select,
|
633 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
634 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
635 |
-
'many_sp_calendar' => $many_sp_calendar,
|
636 |
-
'cat_id' => '',
|
637 |
-
'cat_ids' => $cat_ids,
|
638 |
-
'widget' => $widget,
|
639 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
640 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
641 |
-
</div>
|
642 |
-
</li>
|
643 |
-
|
644 |
-
<li <?php if($view=='bigcalendarlist'):?> class="active" <?php endif; ?> style="<?php if(!in_array('list',$views) AND $defaultview!='list' ) echo 'display:none;' ;?>"><div class="views_select"
|
645 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
646 |
-
'action' => 'spiderbigcalendar_list',
|
647 |
-
'theme_id' => $theme_id,
|
648 |
-
'calendar' => $calendar_id,
|
649 |
-
'select' => $view_select,
|
650 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
651 |
-
'many_sp_calendar' => $many_sp_calendar,
|
652 |
-
'cat_id' => '',
|
653 |
-
'cat_ids' => $cat_ids,
|
654 |
-
'widget' => $widget,
|
655 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
656 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
657 |
-
</div>
|
658 |
-
</li>
|
659 |
-
|
660 |
-
<li <?php if($view=='bigcalendarmonth'):?> class="active" <?php endif; ?> style="<?php if(!in_array('month',$views) AND $defaultview!='month' ) echo 'display:none;'; ?>"><div class="views_select"
|
661 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
662 |
-
'action' => 'spiderbigcalendar_month',
|
663 |
-
'theme_id' => $theme_id,
|
664 |
-
'calendar' => $calendar_id,
|
665 |
-
'select' => $view_select,
|
666 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
667 |
-
'many_sp_calendar' => $many_sp_calendar,
|
668 |
-
'cat_id' => '',
|
669 |
-
'cat_ids' => $cat_ids,
|
670 |
-
'widget' => $widget,
|
671 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
672 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Month</span></div></li>
|
673 |
-
|
674 |
-
</ul>
|
675 |
-
</div>
|
676 |
-
</td>
|
677 |
-
</tr>
|
678 |
-
<tr>
|
679 |
-
<td>
|
680 |
-
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width:100%;border:<?php echo $border_color ?> solid <?php echo $border_width ?>px; margin:0; padding:0;background-color:<?php echo $bg_bottom; ?> !important;">
|
681 |
-
<tr>
|
682 |
-
<td width="100%" style=" padding:0; margin:0">
|
683 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%">
|
684 |
-
<tr style="height:40px; width:100%;">
|
685 |
-
<td class="top_table" align="center" colspan="7" style="position: relative;padding:0; margin:0; background-color:<?php echo $bg_top ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%; " >
|
686 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width:100%; height:<?php echo $top_height ?>px;">
|
687 |
-
<tr>
|
688 |
-
<td style="width:100%;vertical-align:center">
|
689 |
-
<table style="width:100%;">
|
690 |
-
<tr>
|
691 |
-
<td width="15%">
|
692 |
-
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
693 |
-
echo add_query_arg(array(
|
694 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
695 |
-
'theme_id' => $theme_id,
|
696 |
-
'calendar' => $calendar_id,
|
697 |
-
'select' => $view_select,
|
698 |
-
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
699 |
-
'many_sp_calendar' => $many_sp_calendar,
|
700 |
-
'cat_id' => '',
|
701 |
-
'cat_ids' => $cat_ids,
|
702 |
-
'widget' => $widget,
|
703 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color: <?php echo hex_to_rgb($views_tabs_bg_color, 0.4) ?>;">
|
704 |
-
<span style="font-size:18px; color:#FFF"><?php echo $year-1; ?></span>
|
705 |
-
</div>
|
706 |
-
</td>
|
707 |
-
<td class="cala_arrow" width="11%" style="text-align:right;margin:0px;padding: 0px 30px 0px 0px !important;">
|
708 |
-
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
709 |
-
if (Month_num($month) == 1) {
|
710 |
-
$needed_date = ($year - 1) . '-12';
|
711 |
-
}
|
712 |
-
else {
|
713 |
-
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
714 |
-
}
|
715 |
-
echo add_query_arg(array(
|
716 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
717 |
-
'theme_id' => $theme_id,
|
718 |
-
'calendar' => $calendar_id,
|
719 |
-
'select' => $view_select,
|
720 |
-
'date' => $needed_date,
|
721 |
-
'many_sp_calendar' => $many_sp_calendar,
|
722 |
-
'cat_id' => '',
|
723 |
-
'cat_ids' => $cat_ids,
|
724 |
-
'widget' => $widget,
|
725 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❰
|
726 |
-
</a>
|
727 |
-
</td>
|
728 |
-
<td style="text-align:center; margin:0;" width="40%">
|
729 |
-
<input type="hidden" name="month" readonly="" value="<?php echo $month?>"/>
|
730 |
-
<span style="line-height: 30px;font-family: Segoe UI; color:<?php echo $text_color_month;?>; font-size:<?php echo $month_font_size ?>px;text-shadow: 1px 1px black;"><?php echo $activedatestr; ?></span>
|
731 |
-
</td>
|
732 |
-
<td style="margin:0; text-align:left; padding: 0px 0px 0px 30px !important;" width="11%" class="cala_arrow">
|
733 |
-
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
734 |
-
if (Month_num($month) == 12) {
|
735 |
-
$needed_date = ($year + 1) . '-01';
|
736 |
-
}
|
737 |
-
else {
|
738 |
-
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
739 |
-
}
|
740 |
-
echo add_query_arg(array(
|
741 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
742 |
-
'theme_id' => $theme_id,
|
743 |
-
'calendar' => $calendar_id,
|
744 |
-
'select' => $view_select,
|
745 |
-
'date' => $needed_date,
|
746 |
-
'many_sp_calendar' => $many_sp_calendar,
|
747 |
-
'cat_id' => '',
|
748 |
-
'cat_ids' => $cat_ids,
|
749 |
-
'widget' => $widget,
|
750 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❱
|
751 |
-
</a>
|
752 |
-
</td>
|
753 |
-
<td width="15%">
|
754 |
-
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
755 |
-
echo add_query_arg(array(
|
756 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
757 |
-
'theme_id' => $theme_id,
|
758 |
-
'calendar' => $calendar_id,
|
759 |
-
'select' => $view_select,
|
760 |
-
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
761 |
-
'many_sp_calendar' => $many_sp_calendar,
|
762 |
-
'cat_id' => '',
|
763 |
-
'cat_ids' => $cat_ids,
|
764 |
-
'widget' => $widget,
|
765 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color: <?php echo hex_to_rgb($views_tabs_bg_color, 0.4) ?>;">
|
766 |
-
<span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
|
767 |
-
</div>
|
768 |
-
</td>
|
769 |
-
</tr>
|
770 |
-
</table>
|
771 |
-
</td>
|
772 |
-
</tr>
|
773 |
-
</table>
|
774 |
-
</td>
|
775 |
-
|
776 |
-
</tr>
|
777 |
-
</tr>
|
778 |
-
<tr>
|
779 |
-
<td>
|
780 |
-
<?php
|
781 |
-
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
782 |
-
if ($weekstart == "su") {
|
783 |
-
$month_first_weekday++;
|
784 |
-
if ($month_first_weekday == 8) {
|
785 |
-
$month_first_weekday = 1;
|
786 |
-
}
|
787 |
-
}
|
788 |
-
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
789 |
-
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
790 |
-
$weekday_i = $month_first_weekday;
|
791 |
-
$last_month_days = $last_month_days - $weekday_i + 2;
|
792 |
-
$percent = 1;
|
793 |
-
$sum = $month_days - 8 + $month_first_weekday;
|
794 |
-
if ($sum % 7 <> 0) {
|
795 |
-
$percent = $percent + 1;
|
796 |
-
}
|
797 |
-
$sum = $sum - ($sum % 7);
|
798 |
-
$percent = $percent + ($sum / 7);
|
799 |
-
$percent = 107 / $percent;
|
800 |
-
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
801 |
-
|
802 |
-
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
803 |
-
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
804 |
-
$array_days = $all_calendar_files[0]['array_days'];
|
805 |
-
$array_days1 = $all_calendar_files[0]['array_days1'];
|
806 |
-
$title = $all_calendar_files[0]['title'];
|
807 |
-
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
808 |
-
sort($array_days, SORT_NUMERIC);
|
809 |
-
if (!$array_days) {
|
810 |
-
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . ' !important">
|
811 |
-
<tr>
|
812 |
-
<td style="padding-left:10px; font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ' !important;color:' . $event_num_color . '"></td>
|
813 |
-
<td><p style="color:' . $event_title_color . '; border:none"> ' . __('There are no events for this month', 'sp_calendar') . '</p></td>
|
814 |
-
</tr>
|
815 |
-
</table>';
|
816 |
-
}
|
817 |
-
for ($i = 0; $i < count($array_days); $i++) {
|
818 |
-
$week_day = date('D', mktime(0, 0, 0, Month_num($month), $array_days[$i], $year));
|
819 |
-
if($array_days[$i]<=$month_days){
|
820 |
-
echo '<table style="width:100%;border-spacing:0;">
|
821 |
-
<tr>
|
822 |
-
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . ' !important; color:#6E7276">
|
823 |
-
<span style="padding-left:10px; font-size:' . $date_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
824 |
-
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . add_0($array_days[$i]) . ' ' . __($month,'sp_calendar') . ')</span>
|
825 |
-
</td>
|
826 |
-
</tr>
|
827 |
-
<tr>
|
828 |
-
<td>';
|
829 |
-
foreach ($title as $key => $value) {
|
830 |
-
if ($key == $array_days[$i]) {
|
831 |
-
$ev_id = explode('<br>', $ev_ids[$key]);
|
832 |
-
array_pop($ev_id);
|
833 |
-
$ev_ids_inline = implode(',', $ev_id);
|
834 |
-
$ev_title = explode('</p>', $value);
|
835 |
-
array_pop($ev_title);
|
836 |
-
for ($j = 0; $j < count($ev_title); $j++) {
|
837 |
-
$queryy = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
838 |
-
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
839 |
-
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d",$calendar,$ev_id[$j]);
|
840 |
-
|
841 |
-
$cat_color = $wpdb->get_row($queryy);
|
842 |
-
|
843 |
-
if (($j + 1) % 2 == 0) {
|
844 |
-
$color = $event_num_bg_color2;
|
845 |
-
$table_color = $event_bg_color2;
|
846 |
-
}
|
847 |
-
else {
|
848 |
-
$color = $event_num_bg_color1;
|
849 |
-
$table_color = $event_bg_color1;
|
850 |
-
}
|
851 |
-
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color=$bg_top;};
|
852 |
-
echo '<table class="last_table" style="overflow:hidden;height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . ' !important;">
|
853 |
-
<tr>
|
854 |
-
<td style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color: #' . str_replace('#','',$cat_color->color) . ' !important;color:' . $event_num_color . '">' . (($show_numbers_for_events) ? ($j + 1) : '') . '</td>
|
855 |
-
<td>
|
856 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:13px;background:none;color:' . $event_title_color . ';"
|
857 |
-
href="' . add_query_arg(array(
|
858 |
-
'action' => 'spidercalendarbig',
|
859 |
-
'theme_id' => $theme_id,
|
860 |
-
'calendar_id' => $calendar_id,
|
861 |
-
'ev_ids' => $ev_ids_inline,
|
862 |
-
'eventID' => $ev_id[$j],
|
863 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $array_days[$i],
|
864 |
-
'many_sp_calendar' => $many_sp_calendar,
|
865 |
-
'widget' => $widget,
|
866 |
-
'TB_iframe' => 1,
|
867 |
-
'tbWidth' => $popup_width,
|
868 |
-
'tbHeight' => $popup_height,
|
869 |
-
), $site_url) . '"><b>'.$ev_title[$j].'</b>
|
870 |
-
</a>
|
871 |
-
</td>
|
872 |
-
</tr>
|
873 |
-
</table>';
|
874 |
-
}
|
875 |
-
}
|
876 |
-
}
|
877 |
-
echo '</td></tr></table>';
|
878 |
-
}
|
879 |
-
}
|
880 |
-
?>
|
881 |
-
</td>
|
882 |
-
</tr>
|
883 |
-
</table>
|
884 |
-
</tr>
|
885 |
-
</table>
|
886 |
-
</td>
|
887 |
-
</tr>
|
888 |
-
</table>
|
889 |
-
<style>
|
890 |
-
@media only screen and (max-width : 640px) {
|
891 |
-
#views_tabs ,#drop_down_views
|
892 |
-
{
|
893 |
-
display:none;
|
894 |
-
}
|
895 |
-
|
896 |
-
#views_tabs_select
|
897 |
-
{
|
898 |
-
display:block !important;
|
899 |
-
}
|
900 |
-
}
|
901 |
-
|
902 |
-
@media only screen and (max-width : 968px) {
|
903 |
-
#cats >li
|
904 |
-
{
|
905 |
-
float:none;
|
906 |
-
}
|
907 |
-
}
|
908 |
-
|
909 |
-
.spider_categories{
|
910 |
-
display:inline-block;
|
911 |
-
cursor:pointer;
|
912 |
-
}
|
913 |
-
|
914 |
-
.spider_categories p{
|
915 |
-
color: #fff;
|
916 |
-
padding: 2px 10px !important;
|
917 |
-
margin: 2px 0 !important;
|
918 |
-
font-size: 14px;
|
919 |
-
font-weight: 600;
|
920 |
-
}
|
921 |
-
</style>
|
922 |
-
<?php
|
923 |
-
|
924 |
-
//reindex cat_ids_array
|
925 |
-
$re_cat_ids_array = array_values($cat_ids_array);
|
926 |
-
|
927 |
-
for($i=0; $i<count($re_cat_ids_array); $i++)
|
928 |
-
{
|
929 |
-
echo'
|
930 |
-
<style>
|
931 |
-
#cats #category'.$re_cat_ids_array[$i].'
|
932 |
-
{
|
933 |
-
text-decoration:underline;
|
934 |
-
cursor:pointer;
|
935 |
-
|
936 |
-
}
|
937 |
-
|
938 |
-
</style>';
|
939 |
-
|
940 |
-
}
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
if($cat_ids=='')
|
945 |
-
$cat_ids='';
|
946 |
-
if($show_cat){
|
947 |
-
echo '<ul id="cats" style="list-style-type:none; padding: 0;">';
|
948 |
-
|
949 |
-
foreach($categories as $category)
|
950 |
-
{
|
951 |
-
|
952 |
-
?>
|
953 |
-
|
954 |
-
<li class="spider_categories"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
955 |
-
'action' => 'spiderbigcalendar_list',
|
956 |
-
'theme_id' => $theme_id,
|
957 |
-
'calendar' => $calendar_id,
|
958 |
-
'select' => $view_select,
|
959 |
-
'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
|
960 |
-
'many_sp_calendar' => $many_sp_calendar,
|
961 |
-
'cat_id' => $category->id,
|
962 |
-
'cat_ids' => $cat_ids,
|
963 |
-
'widget' => $widget,
|
964 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
965 |
-
|
966 |
-
|
967 |
-
<?php
|
968 |
-
}
|
969 |
-
if (!empty($categories)) {
|
970 |
-
?>
|
971 |
-
<li class="spider_categories"><p id="category0" style="background-color:<?php echo $bg_top; ?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
972 |
-
'action' => 'spiderbigcalendar_list',
|
973 |
-
'theme_id' => $theme_id,
|
974 |
-
'calendar' => $calendar_id,
|
975 |
-
'select' => $view_select,
|
976 |
-
'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
|
977 |
-
'many_sp_calendar' => $many_sp_calendar,
|
978 |
-
'cat_id' => '',
|
979 |
-
'cat_ids' => '',
|
980 |
-
'widget' => $widget,
|
981 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
982 |
-
<?php echo '</ul>';
|
983 |
-
}
|
984 |
-
} ?>
|
985 |
-
</body>
|
986 |
-
</html>
|
987 |
-
<?php
|
988 |
-
die();
|
989 |
-
}
|
990 |
?>
|
1 |
+
<?php
|
2 |
+
function big_calendar_list() {
|
3 |
+
require_once("frontend_functions.php");
|
4 |
+
global $wpdb;
|
5 |
+
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
+
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
+
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
+
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 30);
|
9 |
+
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
10 |
+
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
11 |
+
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
12 |
+
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
13 |
+
$site_url = get_admin_url().'admin-ajax.php';
|
14 |
+
///////////////////////////////////////////////////////////////////////////////////
|
15 |
+
|
16 |
+
|
17 |
+
if($cat_ids=='')
|
18 |
+
$cat_ids .= $cat_id.',';
|
19 |
+
else
|
20 |
+
$cat_ids .= ','.$cat_id.',';
|
21 |
+
|
22 |
+
|
23 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
24 |
+
|
25 |
+
|
26 |
+
function getelementcountinarray($array , $element)
|
27 |
+
{
|
28 |
+
$t=0;
|
29 |
+
|
30 |
+
for($i=0; $i<count($array); $i++)
|
31 |
+
{
|
32 |
+
if($element==$array[$i])
|
33 |
+
$t++;
|
34 |
+
|
35 |
+
}
|
36 |
+
|
37 |
+
|
38 |
+
return $t;
|
39 |
+
|
40 |
+
}
|
41 |
+
|
42 |
+
function getelementindexinarray($array , $element)
|
43 |
+
{
|
44 |
+
|
45 |
+
$t='';
|
46 |
+
|
47 |
+
for($i=0; $i<count($array); $i++)
|
48 |
+
{
|
49 |
+
if($element==$array[$i])
|
50 |
+
$t.=$i.',';
|
51 |
+
|
52 |
+
}
|
53 |
+
|
54 |
+
return $t;
|
55 |
+
|
56 |
+
|
57 |
+
}
|
58 |
+
$cat_ids_array = explode(',',$cat_ids);
|
59 |
+
|
60 |
+
if($cat_id!='')
|
61 |
+
{
|
62 |
+
|
63 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
64 |
+
{
|
65 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
66 |
+
$index_array = explode(',' , $index_in_line);
|
67 |
+
array_pop ($index_array);
|
68 |
+
for($j=0; $j<count($index_array); $j++)
|
69 |
+
unset($cat_ids_array[$index_array[$j]]);
|
70 |
+
$cat_ids = implode(',',$cat_ids_array);
|
71 |
+
}
|
72 |
+
}
|
73 |
+
else
|
74 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
75 |
+
|
76 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
77 |
+
|
78 |
+
|
79 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
80 |
+
$cal_width = $theme->width;
|
81 |
+
$bg_top = '#' . str_replace('#','',$theme->bg_top);
|
82 |
+
$bg_bottom = '#' . str_replace('#','',$theme->bg_bottom);
|
83 |
+
$border_color = '#' . str_replace('#','',$theme->border_color);
|
84 |
+
$text_color_year = '#' . str_replace('#','',$theme->text_color_year);
|
85 |
+
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
86 |
+
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
87 |
+
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
88 |
+
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
89 |
+
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
90 |
+
$evented_color_bg = (isset($theme->bg_color_this_month_evented) ?'#' . str_replace('#','',$theme->bg_color_this_month_evented) : '');
|
91 |
+
$color_arrow_year = '#' . str_replace('#','',$theme->arrow_color_year);
|
92 |
+
$color_arrow_month = '#' . str_replace('#','',$theme->arrow_color_month);
|
93 |
+
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
94 |
+
$event_title_color = '#' . str_replace('#','',$theme->event_title_color);
|
95 |
+
$current_day_border_color = '#' . str_replace('#','',$theme->current_day_border_color);
|
96 |
+
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
97 |
+
$cell_height = $theme->cell_height;
|
98 |
+
$popup_width = $theme->popup_width;
|
99 |
+
$popup_height = $theme->popup_height;
|
100 |
+
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
101 |
+
$sundays_font_size = $theme->sundays_font_size;
|
102 |
+
$other_days_font_size = $theme->other_days_font_size;
|
103 |
+
$weekdays_font_size = $theme->weekdays_font_size;
|
104 |
+
$border_width = $theme->border_width;
|
105 |
+
$top_height = $theme->top_height;
|
106 |
+
$bg_color_other_months = '#' . str_replace('#','',$theme->bg_color_other_months);
|
107 |
+
$sundays_bg_color = '#' . str_replace('#','',$theme->sundays_bg_color);
|
108 |
+
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
109 |
+
$weekstart = $theme->week_start_day;
|
110 |
+
$weekday_sunday_bg_color = '#' . str_replace('#','',$theme->weekday_sunday_bg_color);
|
111 |
+
$border_radius = $theme->border_radius;
|
112 |
+
$border_radius2 = $border_radius-$border_width;
|
113 |
+
$week_days_cell_height = $theme->week_days_cell_height;
|
114 |
+
$year_font_size = $theme->year_font_size;
|
115 |
+
$month_font_size = $theme->month_font_size;
|
116 |
+
$arrow_size = $theme->arrow_size;
|
117 |
+
$arrow_size_hover = $arrow_size;
|
118 |
+
$next_month_text_color = '#' . str_replace('#','',$theme->next_month_text_color);
|
119 |
+
$prev_month_text_color = '#' . str_replace('#','',$theme->prev_month_text_color);
|
120 |
+
$next_month_arrow_color = '#' . str_replace('#','',$theme->next_month_arrow_color);
|
121 |
+
$prev_month_arrow_color = '#' . str_replace('#','',$theme->prev_month_arrow_color);
|
122 |
+
$next_month_font_size = $theme->next_month_font_size;
|
123 |
+
$prev_month_font_size = $theme->prev_month_font_size;
|
124 |
+
$month_type = $theme->month_type;
|
125 |
+
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
126 |
+
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
127 |
+
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
128 |
+
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
129 |
+
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
130 |
+
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
131 |
+
$date_font_size = $theme->date_font_size;
|
132 |
+
$event_num_font_size = $theme->event_num_font_size;
|
133 |
+
$event_table_height = $theme->event_table_height;
|
134 |
+
$date_height = $theme->date_height;
|
135 |
+
$day_month_font_size = $theme->day_month_font_size;
|
136 |
+
$week_font_size = $theme->week_font_size;
|
137 |
+
$day_month_font_color = '#' . str_replace('#','',$theme->day_month_font_color);
|
138 |
+
$week_font_color = '#' . str_replace('#','',$theme->week_font_color);
|
139 |
+
$views_tabs_bg_color = '#' . str_replace('#','',$theme->views_tabs_bg_color);
|
140 |
+
$views_tabs_text_color = '#' . str_replace('#','',$theme->views_tabs_text_color);
|
141 |
+
$views_tabs_font_size = $theme->views_tabs_font_size;
|
142 |
+
$show_cat = $theme->show_cat;
|
143 |
+
$header_format = (isset($theme->header_format) ? $theme->header_format : 'w/d/m/y');
|
144 |
+
|
145 |
+
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
146 |
+
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
147 |
+
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
148 |
+
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
149 |
+
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
150 |
+
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
151 |
+
$date_font_size = $theme->date_font_size;
|
152 |
+
$event_num_font_size = $theme->event_num_font_size;
|
153 |
+
$show_numbers_for_events = $theme->day_start;
|
154 |
+
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
155 |
+
|
156 |
+
__('January', 'sp_calendar');
|
157 |
+
__('February', 'sp_calendar');
|
158 |
+
__('March', 'sp_calendar');
|
159 |
+
__('April', 'sp_calendar');
|
160 |
+
__('May', 'sp_calendar');
|
161 |
+
__('June', 'sp_calendar');
|
162 |
+
__('July', 'sp_calendar');
|
163 |
+
__('August', 'sp_calendar');
|
164 |
+
__('September', 'sp_calendar');
|
165 |
+
__('October', 'sp_calendar');
|
166 |
+
__('November', 'sp_calendar');
|
167 |
+
__('December', 'sp_calendar');
|
168 |
+
if ($cell_height == '') {
|
169 |
+
$cell_height = 70;
|
170 |
+
}
|
171 |
+
if ($cal_width == '') {
|
172 |
+
$cal_width = 700;
|
173 |
+
}
|
174 |
+
|
175 |
+
if ($date != '') {
|
176 |
+
$date_REFERER = $date;
|
177 |
+
}
|
178 |
+
else {
|
179 |
+
$date_REFERER = date("Y-m");
|
180 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
181 |
+
}
|
182 |
+
$year_REFERER = substr($date_REFERER, 0, 4);
|
183 |
+
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
184 |
+
$day_REFERER = substr($date_REFERER, 8, 2);
|
185 |
+
|
186 |
+
$year = substr($date, 0, 4);
|
187 |
+
$month = Month_name(substr($date, 5, 2));
|
188 |
+
$day = substr($date, 8, 2);
|
189 |
+
|
190 |
+
$cell_width = $cal_width / 7;
|
191 |
+
|
192 |
+
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
193 |
+
$prev_month = add_0((int) $this_month - 1);
|
194 |
+
$next_month = add_0((int) $this_month + 1);
|
195 |
+
|
196 |
+
$activedatestr = "";
|
197 |
+
$view = 'bigcalendarlist';
|
198 |
+
$views = explode(',', $view_select);
|
199 |
+
$defaultview = 'list';
|
200 |
+
array_pop($views);
|
201 |
+
$display = '';
|
202 |
+
if (count($views) == 0) {
|
203 |
+
$display = "display:none";
|
204 |
+
}
|
205 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
206 |
+
$display = "display:none";
|
207 |
+
}
|
208 |
+
|
209 |
+
|
210 |
+
$date_format_array = explode('/', $header_format);
|
211 |
+
for ($i = 0; $i < 4; $i++) {
|
212 |
+
if (isset($date_format_array[$i]) && ($date_format_array[$i] == 'd' || $date_format_array[$i] == 'w')) {
|
213 |
+
unset($date_format_array[$i]);
|
214 |
+
}
|
215 |
+
if (isset($date_format_array[$i]) && $date_format_array[$i] == 'm') $date_format_array[$i] = 'F';
|
216 |
+
if (isset($date_format_array[$i]) && $date_format_array[$i] == 'y') $date_format_array[$i] = 'Y';
|
217 |
+
}
|
218 |
+
$header_date_format = implode(' ', $date_format_array);
|
219 |
+
$name_year = date($header_date_format, strtotime($date));
|
220 |
+
$exp_name_year = explode(' ', $name_year);
|
221 |
+
for($j = 0; $j < count($exp_name_year); $j++){
|
222 |
+
$activedatestr .= __($exp_name_year[$j], 'sp_calendar') . ' ';
|
223 |
+
}
|
224 |
+
|
225 |
+
?>
|
226 |
+
<html>
|
227 |
+
<head>
|
228 |
+
<style type='text/css'>
|
229 |
+
#afterbig<?php echo $many_sp_calendar; ?> table,
|
230 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
231 |
+
font-family: Segoe UI;
|
232 |
+
border: 0;
|
233 |
+
}
|
234 |
+
|
235 |
+
.general_table table table:last-child .last_table:last-child td{
|
236 |
+
border-bottom-left-radius:<?php echo $border_radius2?>px;
|
237 |
+
|
238 |
+
}
|
239 |
+
#TB_iframeContent{
|
240 |
+
background-color: <?php echo $show_event_bgcolor; ?>;
|
241 |
+
}
|
242 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-left {
|
243 |
+
width: 0px;
|
244 |
+
height: 0px;
|
245 |
+
border-top: 15px solid transparent;
|
246 |
+
border-bottom: 15px solid transparent;
|
247 |
+
border-right: 20px solid;
|
248 |
+
margin: 0 auto;
|
249 |
+
}
|
250 |
+
|
251 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-right {
|
252 |
+
width: 0px;
|
253 |
+
height: 0px;
|
254 |
+
border-top: 15px solid transparent;
|
255 |
+
border-bottom: 15px solid transparent;
|
256 |
+
border-left: 20px solid;
|
257 |
+
margin: 0 auto;
|
258 |
+
}
|
259 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-right{
|
260 |
+
border-top: 5px solid transparent;
|
261 |
+
border-bottom: 5px solid transparent;
|
262 |
+
border-left: 8px solid;
|
263 |
+
left: 5px;
|
264 |
+
position: relative;
|
265 |
+
}
|
266 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-down{
|
267 |
+
width: 0px;
|
268 |
+
height: 0px;
|
269 |
+
border-left: 5px solid transparent;
|
270 |
+
border-right: 5px solid transparent;
|
271 |
+
border-top: 8px solid;
|
272 |
+
}
|
273 |
+
|
274 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
275 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
276 |
+
#spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
277 |
+
border: none !important;
|
278 |
+
}
|
279 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
280 |
+
border-radius: <?php echo $border_radius; ?>px !important;
|
281 |
+
}
|
282 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
283 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
284 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
285 |
+
}
|
286 |
+
|
287 |
+
|
288 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
289 |
+
#bigcalendar .cala_arrow a:visited {
|
290 |
+
text-decoration: none !important;
|
291 |
+
box-shadow: none !important;
|
292 |
+
background: none !important;
|
293 |
+
font-size: <?php echo $arrow_size; ?>px !important;
|
294 |
+
}
|
295 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow {
|
296 |
+
vertical-align: middle !important;
|
297 |
+
}
|
298 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
299 |
+
font-size: <?php echo $arrow_size_hover; ?>px !important;
|
300 |
+
text-decoration: none !important;
|
301 |
+
background: none !important;
|
302 |
+
}
|
303 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
304 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
305 |
+
text-decoration: none !important;
|
306 |
+
background: none !important;
|
307 |
+
font-size: 12px !important;
|
308 |
+
color: red;
|
309 |
+
}
|
310 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
311 |
+
text-decoration: none !important;
|
312 |
+
background: none !important;
|
313 |
+
}
|
314 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
315 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
316 |
+
<?php echo 'vertical-align:top !important;'; ?>
|
317 |
+
}
|
318 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
319 |
+
vertical-align: middle !important;
|
320 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
321 |
+
}
|
322 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
323 |
+
font-size: <?php echo $weekdays_font_size; ?>px !important;
|
324 |
+
}
|
325 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
326 |
+
border-spacing: 0 !important;
|
327 |
+
width: 100% !important;
|
328 |
+
}
|
329 |
+
.calyear_table table #bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
330 |
+
border-spacing: 0 !important;
|
331 |
+
width: 100% !important;
|
332 |
+
}
|
333 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
334 |
+
#bigcalendar .calbg td {
|
335 |
+
text-align: center !important;
|
336 |
+
width: 14% !important;
|
337 |
+
}
|
338 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
339 |
+
color: <?php echo $text_color_other_months; ?> !important;
|
340 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
341 |
+
<?php echo 'vertical-align:top !important;'; ?>
|
342 |
+
}
|
343 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
344 |
+
color: <?php echo $text_color_this_month_unevented; ?> !important;
|
345 |
+
}
|
346 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
347 |
+
font-size: 24px !important;
|
348 |
+
font-weight: bold !important;
|
349 |
+
color: <?php echo $text_color_year; ?> !important;
|
350 |
+
}
|
351 |
+
.general_table table, .general_table td, .general_table tr {
|
352 |
+
border: inherit !important;
|
353 |
+
vertical-align: initial !important;
|
354 |
+
border-collapse: inherit !important;
|
355 |
+
margin: inherit !important;
|
356 |
+
padding: inherit !important;
|
357 |
+
}
|
358 |
+
.general_table {
|
359 |
+
border-collapse: inherit !important;
|
360 |
+
margin: inherit !important;
|
361 |
+
}
|
362 |
+
.general_table p {
|
363 |
+
margin: inherit !important;
|
364 |
+
padding: inherit !important;
|
365 |
+
}
|
366 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
367 |
+
color: <?php echo $sun_days; ?> !important;
|
368 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
369 |
+
<?php echo 'vertical-align:top !important; text-align:left !important;'; ?>
|
370 |
+
background-color: <?php echo $sundays_bg_color; ?> !important;
|
371 |
+
}
|
372 |
+
#TB_window {
|
373 |
+
z-index: 10000;
|
374 |
+
}
|
375 |
+
|
376 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td {
|
377 |
+
vertical-align: middle !important;
|
378 |
+
}
|
379 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table {
|
380 |
+
border-collapse: initial;
|
381 |
+
border:0px;
|
382 |
+
max-width: none;
|
383 |
+
}
|
384 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table tr:hover td {
|
385 |
+
background: none;
|
386 |
+
}
|
387 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
388 |
+
padding: 0px;
|
389 |
+
vertical-align: none;
|
390 |
+
border-top:none;
|
391 |
+
line-height: none;
|
392 |
+
text-align: none;
|
393 |
+
background: transparent;
|
394 |
+
}
|
395 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
396 |
+
margin-bottom:0;
|
397 |
+
}
|
398 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
399 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
400 |
+
#spiderCalendarTitlesList td,
|
401 |
+
#spiderCalendarTitlesList tr {
|
402 |
+
border:none;
|
403 |
+
}
|
404 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
405 |
+
border-radius: <?php echo $border_radius; ?>px;
|
406 |
+
}
|
407 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
408 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
409 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
410 |
+
}
|
411 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
412 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
413 |
+
text-decoration:none !important;
|
414 |
+
background:none;
|
415 |
+
font-size: <?php echo $arrow_size; ?>px;
|
416 |
+
}
|
417 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
418 |
+
text-decoration:none;
|
419 |
+
background:none;
|
420 |
+
}
|
421 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
422 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
423 |
+
text-decoration:none;
|
424 |
+
background:none;
|
425 |
+
font-size:12px;
|
426 |
+
color:red;
|
427 |
+
}
|
428 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
429 |
+
text-decoration:none;
|
430 |
+
background:none;
|
431 |
+
}
|
432 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
433 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
434 |
+
vertical-align:top;
|
435 |
+
}
|
436 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
437 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
438 |
+
}
|
439 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
440 |
+
font-size:<?php echo $weekdays_font_size; ?>px;
|
441 |
+
}
|
442 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
443 |
+
border-spacing:0;
|
444 |
+
width:100%;
|
445 |
+
}
|
446 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
447 |
+
border-spacing:0;
|
448 |
+
width:100%;
|
449 |
+
}
|
450 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
451 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
|
452 |
+
text-align:center;
|
453 |
+
width:14%;
|
454 |
+
}
|
455 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
456 |
+
color:<?php echo $text_color_other_months; ?>;
|
457 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
458 |
+
vertical-align:top;
|
459 |
+
}
|
460 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
461 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
462 |
+
}
|
463 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
464 |
+
font-size:24px;
|
465 |
+
font-weight:bold;
|
466 |
+
color:<?php echo $text_color_year; ?>;
|
467 |
+
}
|
468 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
469 |
+
color:<?php echo $sun_days; ?>;
|
470 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
471 |
+
vertical-align:top;
|
472 |
+
text-align:left;
|
473 |
+
background-color:<?php echo $sundays_bg_color; ?> !important;
|
474 |
+
}
|
475 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
476 |
+
float: right;
|
477 |
+
background-color: <?php echo $views_tabs_bg_color; ?> !important;
|
478 |
+
min-height: 25px;
|
479 |
+
min-width: 70px;
|
480 |
+
margin-left: 2px;
|
481 |
+
text-align: center;
|
482 |
+
cursor:pointer;
|
483 |
+
position: relative;
|
484 |
+
top: 5px;
|
485 |
+
}
|
486 |
+
#afterbig<?php echo $many_sp_calendar; ?> .views span,
|
487 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
488 |
+
line-height: 30px;
|
489 |
+
}
|
490 |
+
|
491 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
492 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
493 |
+
{
|
494 |
+
|
495 |
+
background-color: <?php echo $views_tabs_bg_color?> !important;
|
496 |
+
width: 120px;
|
497 |
+
text-align: center;
|
498 |
+
cursor: pointer;
|
499 |
+
padding: 6px;
|
500 |
+
position: relative;
|
501 |
+
}
|
502 |
+
|
503 |
+
|
504 |
+
#drop_down_views
|
505 |
+
{
|
506 |
+
list-style-type:none !important;
|
507 |
+
position: absolute;
|
508 |
+
top: 46px;
|
509 |
+
left: 0;
|
510 |
+
display:none;
|
511 |
+
z-index: 4545;
|
512 |
+
margin-left: 0;
|
513 |
+
}
|
514 |
+
|
515 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
516 |
+
{
|
517 |
+
background:<?php echo $bg_top ?> !important;
|
518 |
+
}
|
519 |
+
|
520 |
+
#drop_down_views >li
|
521 |
+
{
|
522 |
+
border-bottom:1px solid #fff !important;
|
523 |
+
}
|
524 |
+
|
525 |
+
|
526 |
+
#views_tabs_select
|
527 |
+
{
|
528 |
+
display:none;
|
529 |
+
}
|
530 |
+
|
531 |
+
</style>
|
532 |
+
</head>
|
533 |
+
<body>
|
534 |
+
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>" class="wdc_calendar">
|
535 |
+
<div style="width:100%;">
|
536 |
+
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
537 |
+
<tr>
|
538 |
+
<td>
|
539 |
+
|
540 |
+
<div id="views_tabs" style="width: 100%;<?php echo $display; ?>">
|
541 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
542 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
543 |
+
'action' => 'spiderbigcalendar_day',
|
544 |
+
'theme_id' => $theme_id,
|
545 |
+
'calendar' => $calendar_id,
|
546 |
+
'select' => $view_select,
|
547 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
548 |
+
'many_sp_calendar' => $many_sp_calendar,
|
549 |
+
'cat_id' => '',
|
550 |
+
'cat_ids' => $cat_ids,
|
551 |
+
'widget' => $widget,
|
552 |
+
'rand' => $many_sp_calendar,
|
553 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Day', 'sp_calendar'); ?></span>
|
554 |
+
</div>
|
555 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
556 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
557 |
+
'action' => 'spiderbigcalendar_week',
|
558 |
+
'theme_id' => $theme_id,
|
559 |
+
'calendar' => $calendar_id,
|
560 |
+
'select' => $view_select,
|
561 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
562 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
563 |
+
'many_sp_calendar' => $many_sp_calendar,
|
564 |
+
'cat_id' => '',
|
565 |
+
'cat_ids' => $cat_ids,
|
566 |
+
'widget' => $widget,
|
567 |
+
'rand' => $many_sp_calendar,
|
568 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Week', 'sp_calendar'); ?></span>
|
569 |
+
</div>
|
570 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
571 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
572 |
+
'action' => 'spiderbigcalendar_list',
|
573 |
+
'theme_id' => $theme_id,
|
574 |
+
'calendar' => $calendar_id,
|
575 |
+
'select' => $view_select,
|
576 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
577 |
+
'many_sp_calendar' => $many_sp_calendar,
|
578 |
+
'cat_id' => '',
|
579 |
+
'cat_ids' => $cat_ids,
|
580 |
+
'widget' => $widget,
|
581 |
+
'rand' => $many_sp_calendar,
|
582 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('List', 'sp_calendar'); ?></span>
|
583 |
+
</div>
|
584 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
585 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
586 |
+
'action' => 'spiderbigcalendar_month',
|
587 |
+
'theme_id' => $theme_id,
|
588 |
+
'calendar' => $calendar_id,
|
589 |
+
'select' => $view_select,
|
590 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
591 |
+
'many_sp_calendar' => $many_sp_calendar,
|
592 |
+
'cat_id' => '',
|
593 |
+
'cat_ids' => $cat_ids,
|
594 |
+
'widget' => $widget,
|
595 |
+
'rand' => $many_sp_calendar,
|
596 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Month', 'sp_calendar'); ?></span>
|
597 |
+
</div>
|
598 |
+
</div>
|
599 |
+
|
600 |
+
<div id="views_tabs_select" style="display:none" >
|
601 |
+
<div id="views_select" style="background-color:<?php echo $bg_top?> !important;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
602 |
+
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
603 |
+
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
604 |
+
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
605 |
+
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
606 |
+
<div class="arrow-right show_arrow"></div>
|
607 |
+
<div class="arrow-down"></div>
|
608 |
+
</div>
|
609 |
+
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
610 |
+
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
611 |
+
<div class="views_select"
|
612 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
613 |
+
'action' => 'spiderbigcalendar_month',
|
614 |
+
'theme_id' => $theme_id,
|
615 |
+
'calendar' => $calendar_id,
|
616 |
+
'select' => $view_select,
|
617 |
+
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
618 |
+
'many_sp_calendar' => $many_sp_calendar,
|
619 |
+
'cat_id' => '',
|
620 |
+
'cat_ids' => $cat_ids,
|
621 |
+
'widget' => $widget,
|
622 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
623 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
624 |
+
</div>
|
625 |
+
</li>
|
626 |
+
|
627 |
+
<li <?php if($view=='bigcalendarweek'):?> class="active" <?php endif; ?> style="<?php if(!in_array('week',$views) AND $defaultview!='week' ) echo 'display:none;' ; ?>" ><div class="views_select"
|
628 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
629 |
+
'action' => 'spiderbigcalendar_week',
|
630 |
+
'theme_id' => $theme_id,
|
631 |
+
'calendar' => $calendar_id,
|
632 |
+
'select' => $view_select,
|
633 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
634 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
635 |
+
'many_sp_calendar' => $many_sp_calendar,
|
636 |
+
'cat_id' => '',
|
637 |
+
'cat_ids' => $cat_ids,
|
638 |
+
'widget' => $widget,
|
639 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
640 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
641 |
+
</div>
|
642 |
+
</li>
|
643 |
+
|
644 |
+
<li <?php if($view=='bigcalendarlist'):?> class="active" <?php endif; ?> style="<?php if(!in_array('list',$views) AND $defaultview!='list' ) echo 'display:none;' ;?>"><div class="views_select"
|
645 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
646 |
+
'action' => 'spiderbigcalendar_list',
|
647 |
+
'theme_id' => $theme_id,
|
648 |
+
'calendar' => $calendar_id,
|
649 |
+
'select' => $view_select,
|
650 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
651 |
+
'many_sp_calendar' => $many_sp_calendar,
|
652 |
+
'cat_id' => '',
|
653 |
+
'cat_ids' => $cat_ids,
|
654 |
+
'widget' => $widget,
|
655 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
656 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
657 |
+
</div>
|
658 |
+
</li>
|
659 |
+
|
660 |
+
<li <?php if($view=='bigcalendarmonth'):?> class="active" <?php endif; ?> style="<?php if(!in_array('month',$views) AND $defaultview!='month' ) echo 'display:none;'; ?>"><div class="views_select"
|
661 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
662 |
+
'action' => 'spiderbigcalendar_month',
|
663 |
+
'theme_id' => $theme_id,
|
664 |
+
'calendar' => $calendar_id,
|
665 |
+
'select' => $view_select,
|
666 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
667 |
+
'many_sp_calendar' => $many_sp_calendar,
|
668 |
+
'cat_id' => '',
|
669 |
+
'cat_ids' => $cat_ids,
|
670 |
+
'widget' => $widget,
|
671 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
672 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Month</span></div></li>
|
673 |
+
|
674 |
+
</ul>
|
675 |
+
</div>
|
676 |
+
</td>
|
677 |
+
</tr>
|
678 |
+
<tr>
|
679 |
+
<td>
|
680 |
+
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width:100%;border:<?php echo $border_color ?> solid <?php echo $border_width ?>px; margin:0; padding:0;background-color:<?php echo $bg_bottom; ?> !important;">
|
681 |
+
<tr>
|
682 |
+
<td width="100%" style=" padding:0; margin:0">
|
683 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%">
|
684 |
+
<tr style="height:40px; width:100%;">
|
685 |
+
<td class="top_table" align="center" colspan="7" style="position: relative;padding:0; margin:0; background-color:<?php echo $bg_top ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%; " >
|
686 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width:100%; height:<?php echo $top_height ?>px;">
|
687 |
+
<tr>
|
688 |
+
<td style="width:100%;vertical-align:center">
|
689 |
+
<table style="width:100%;">
|
690 |
+
<tr>
|
691 |
+
<td width="15%">
|
692 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
693 |
+
echo add_query_arg(array(
|
694 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
695 |
+
'theme_id' => $theme_id,
|
696 |
+
'calendar' => $calendar_id,
|
697 |
+
'select' => $view_select,
|
698 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
699 |
+
'many_sp_calendar' => $many_sp_calendar,
|
700 |
+
'cat_id' => '',
|
701 |
+
'cat_ids' => $cat_ids,
|
702 |
+
'widget' => $widget,
|
703 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color: <?php echo hex_to_rgb($views_tabs_bg_color, 0.4) ?>;">
|
704 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year-1; ?></span>
|
705 |
+
</div>
|
706 |
+
</td>
|
707 |
+
<td class="cala_arrow" width="11%" style="text-align:right;margin:0px;padding: 0px 30px 0px 0px !important;">
|
708 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
709 |
+
if (Month_num($month) == 1) {
|
710 |
+
$needed_date = ($year - 1) . '-12';
|
711 |
+
}
|
712 |
+
else {
|
713 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
714 |
+
}
|
715 |
+
echo add_query_arg(array(
|
716 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
717 |
+
'theme_id' => $theme_id,
|
718 |
+
'calendar' => $calendar_id,
|
719 |
+
'select' => $view_select,
|
720 |
+
'date' => $needed_date,
|
721 |
+
'many_sp_calendar' => $many_sp_calendar,
|
722 |
+
'cat_id' => '',
|
723 |
+
'cat_ids' => $cat_ids,
|
724 |
+
'widget' => $widget,
|
725 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❰
|
726 |
+
</a>
|
727 |
+
</td>
|
728 |
+
<td style="text-align:center; margin:0;" width="40%">
|
729 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month?>"/>
|
730 |
+
<span style="line-height: 30px;font-family: Segoe UI; color:<?php echo $text_color_month;?>; font-size:<?php echo $month_font_size ?>px;text-shadow: 1px 1px black;"><?php echo $activedatestr; ?></span>
|
731 |
+
</td>
|
732 |
+
<td style="margin:0; text-align:left; padding: 0px 0px 0px 30px !important;" width="11%" class="cala_arrow">
|
733 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
734 |
+
if (Month_num($month) == 12) {
|
735 |
+
$needed_date = ($year + 1) . '-01';
|
736 |
+
}
|
737 |
+
else {
|
738 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
739 |
+
}
|
740 |
+
echo add_query_arg(array(
|
741 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
742 |
+
'theme_id' => $theme_id,
|
743 |
+
'calendar' => $calendar_id,
|
744 |
+
'select' => $view_select,
|
745 |
+
'date' => $needed_date,
|
746 |
+
'many_sp_calendar' => $many_sp_calendar,
|
747 |
+
'cat_id' => '',
|
748 |
+
'cat_ids' => $cat_ids,
|
749 |
+
'widget' => $widget,
|
750 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❱
|
751 |
+
</a>
|
752 |
+
</td>
|
753 |
+
<td width="15%">
|
754 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
755 |
+
echo add_query_arg(array(
|
756 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
757 |
+
'theme_id' => $theme_id,
|
758 |
+
'calendar' => $calendar_id,
|
759 |
+
'select' => $view_select,
|
760 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
761 |
+
'many_sp_calendar' => $many_sp_calendar,
|
762 |
+
'cat_id' => '',
|
763 |
+
'cat_ids' => $cat_ids,
|
764 |
+
'widget' => $widget,
|
765 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color: <?php echo hex_to_rgb($views_tabs_bg_color, 0.4) ?>;">
|
766 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
|
767 |
+
</div>
|
768 |
+
</td>
|
769 |
+
</tr>
|
770 |
+
</table>
|
771 |
+
</td>
|
772 |
+
</tr>
|
773 |
+
</table>
|
774 |
+
</td>
|
775 |
+
|
776 |
+
</tr>
|
777 |
+
</tr>
|
778 |
+
<tr>
|
779 |
+
<td>
|
780 |
+
<?php
|
781 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
782 |
+
if ($weekstart == "su") {
|
783 |
+
$month_first_weekday++;
|
784 |
+
if ($month_first_weekday == 8) {
|
785 |
+
$month_first_weekday = 1;
|
786 |
+
}
|
787 |
+
}
|
788 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
789 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
790 |
+
$weekday_i = $month_first_weekday;
|
791 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
792 |
+
$percent = 1;
|
793 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
794 |
+
if ($sum % 7 <> 0) {
|
795 |
+
$percent = $percent + 1;
|
796 |
+
}
|
797 |
+
$sum = $sum - ($sum % 7);
|
798 |
+
$percent = $percent + ($sum / 7);
|
799 |
+
$percent = 107 / $percent;
|
800 |
+
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
801 |
+
|
802 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
803 |
+
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
804 |
+
$array_days = $all_calendar_files[0]['array_days'];
|
805 |
+
$array_days1 = $all_calendar_files[0]['array_days1'];
|
806 |
+
$title = $all_calendar_files[0]['title'];
|
807 |
+
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
808 |
+
sort($array_days, SORT_NUMERIC);
|
809 |
+
if (!$array_days) {
|
810 |
+
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . ' !important">
|
811 |
+
<tr>
|
812 |
+
<td style="padding-left:10px; font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ' !important;color:' . $event_num_color . '"></td>
|
813 |
+
<td><p style="color:' . $event_title_color . '; border:none"> ' . __('There are no events for this month', 'sp_calendar') . '</p></td>
|
814 |
+
</tr>
|
815 |
+
</table>';
|
816 |
+
}
|
817 |
+
for ($i = 0; $i < count($array_days); $i++) {
|
818 |
+
$week_day = date('D', mktime(0, 0, 0, Month_num($month), $array_days[$i], $year));
|
819 |
+
if($array_days[$i]<=$month_days){
|
820 |
+
echo '<table style="width:100%;border-spacing:0;">
|
821 |
+
<tr>
|
822 |
+
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . ' !important; color:#6E7276">
|
823 |
+
<span style="padding-left:10px; font-size:' . $date_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
824 |
+
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . add_0($array_days[$i]) . ' ' . __($month,'sp_calendar') . ')</span>
|
825 |
+
</td>
|
826 |
+
</tr>
|
827 |
+
<tr>
|
828 |
+
<td>';
|
829 |
+
foreach ($title as $key => $value) {
|
830 |
+
if ($key == $array_days[$i]) {
|
831 |
+
$ev_id = explode('<br>', $ev_ids[$key]);
|
832 |
+
array_pop($ev_id);
|
833 |
+
$ev_ids_inline = implode(',', $ev_id);
|
834 |
+
$ev_title = explode('</p>', $value);
|
835 |
+
array_pop($ev_title);
|
836 |
+
for ($j = 0; $j < count($ev_title); $j++) {
|
837 |
+
$queryy = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
838 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
839 |
+
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d",$calendar,$ev_id[$j]);
|
840 |
+
|
841 |
+
$cat_color = $wpdb->get_row($queryy);
|
842 |
+
|
843 |
+
if (($j + 1) % 2 == 0) {
|
844 |
+
$color = $event_num_bg_color2;
|
845 |
+
$table_color = $event_bg_color2;
|
846 |
+
}
|
847 |
+
else {
|
848 |
+
$color = $event_num_bg_color1;
|
849 |
+
$table_color = $event_bg_color1;
|
850 |
+
}
|
851 |
+
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color=$bg_top;};
|
852 |
+
echo '<table class="last_table" style="overflow:hidden;height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . ' !important;">
|
853 |
+
<tr>
|
854 |
+
<td style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color: #' . str_replace('#','',$cat_color->color) . ' !important;color:' . $event_num_color . '">' . (($show_numbers_for_events) ? ($j + 1) : '') . '</td>
|
855 |
+
<td>
|
856 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:13px;background:none;color:' . $event_title_color . ';"
|
857 |
+
href="' . add_query_arg(array(
|
858 |
+
'action' => 'spidercalendarbig',
|
859 |
+
'theme_id' => $theme_id,
|
860 |
+
'calendar_id' => $calendar_id,
|
861 |
+
'ev_ids' => $ev_ids_inline,
|
862 |
+
'eventID' => $ev_id[$j],
|
863 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $array_days[$i],
|
864 |
+
'many_sp_calendar' => $many_sp_calendar,
|
865 |
+
'widget' => $widget,
|
866 |
+
'TB_iframe' => 1,
|
867 |
+
'tbWidth' => $popup_width,
|
868 |
+
'tbHeight' => $popup_height,
|
869 |
+
), $site_url) . '"><b>'.$ev_title[$j].'</b>
|
870 |
+
</a>
|
871 |
+
</td>
|
872 |
+
</tr>
|
873 |
+
</table>';
|
874 |
+
}
|
875 |
+
}
|
876 |
+
}
|
877 |
+
echo '</td></tr></table>';
|
878 |
+
}
|
879 |
+
}
|
880 |
+
?>
|
881 |
+
</td>
|
882 |
+
</tr>
|
883 |
+
</table>
|
884 |
+
</tr>
|
885 |
+
</table>
|
886 |
+
</td>
|
887 |
+
</tr>
|
888 |
+
</table>
|
889 |
+
<style>
|
890 |
+
@media only screen and (max-width : 640px) {
|
891 |
+
#views_tabs ,#drop_down_views
|
892 |
+
{
|
893 |
+
display:none;
|
894 |
+
}
|
895 |
+
|
896 |
+
#views_tabs_select
|
897 |
+
{
|
898 |
+
display:block !important;
|
899 |
+
}
|
900 |
+
}
|
901 |
+
|
902 |
+
@media only screen and (max-width : 968px) {
|
903 |
+
#cats >li
|
904 |
+
{
|
905 |
+
float:none;
|
906 |
+
}
|
907 |
+
}
|
908 |
+
|
909 |
+
.spider_categories{
|
910 |
+
display:inline-block;
|
911 |
+
cursor:pointer;
|
912 |
+
}
|
913 |
+
|
914 |
+
.spider_categories p{
|
915 |
+
color: #fff;
|
916 |
+
padding: 2px 10px !important;
|
917 |
+
margin: 2px 0 !important;
|
918 |
+
font-size: 14px;
|
919 |
+
font-weight: 600;
|
920 |
+
}
|
921 |
+
</style>
|
922 |
+
<?php
|
923 |
+
|
924 |
+
//reindex cat_ids_array
|
925 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
926 |
+
|
927 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
928 |
+
{
|
929 |
+
echo'
|
930 |
+
<style>
|
931 |
+
#cats #category'.$re_cat_ids_array[$i].'
|
932 |
+
{
|
933 |
+
text-decoration:underline;
|
934 |
+
cursor:pointer;
|
935 |
+
|
936 |
+
}
|
937 |
+
|
938 |
+
</style>';
|
939 |
+
|
940 |
+
}
|
941 |
+
|
942 |
+
|
943 |
+
|
944 |
+
if($cat_ids=='')
|
945 |
+
$cat_ids='';
|
946 |
+
if($show_cat){
|
947 |
+
echo '<ul id="cats" style="list-style-type:none; padding: 0;">';
|
948 |
+
|
949 |
+
foreach($categories as $category)
|
950 |
+
{
|
951 |
+
|
952 |
+
?>
|
953 |
+
|
954 |
+
<li class="spider_categories"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
955 |
+
'action' => 'spiderbigcalendar_list',
|
956 |
+
'theme_id' => $theme_id,
|
957 |
+
'calendar' => $calendar_id,
|
958 |
+
'select' => $view_select,
|
959 |
+
'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
|
960 |
+
'many_sp_calendar' => $many_sp_calendar,
|
961 |
+
'cat_id' => $category->id,
|
962 |
+
'cat_ids' => $cat_ids,
|
963 |
+
'widget' => $widget,
|
964 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
965 |
+
|
966 |
+
|
967 |
+
<?php
|
968 |
+
}
|
969 |
+
if (!empty($categories)) {
|
970 |
+
?>
|
971 |
+
<li class="spider_categories"><p id="category0" style="background-color:<?php echo $bg_top; ?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
972 |
+
'action' => 'spiderbigcalendar_list',
|
973 |
+
'theme_id' => $theme_id,
|
974 |
+
'calendar' => $calendar_id,
|
975 |
+
'select' => $view_select,
|
976 |
+
'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
|
977 |
+
'many_sp_calendar' => $many_sp_calendar,
|
978 |
+
'cat_id' => '',
|
979 |
+
'cat_ids' => '',
|
980 |
+
'widget' => $widget,
|
981 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
982 |
+
<?php echo '</ul>';
|
983 |
+
}
|
984 |
+
} ?>
|
985 |
+
</body>
|
986 |
+
</html>
|
987 |
+
<?php
|
988 |
+
die();
|
989 |
+
}
|
990 |
?>
|
front_end/bigcalendarlist_widget.php
CHANGED
@@ -1,681 +1,681 @@
|
|
1 |
-
<?php
|
2 |
-
function big_calendar_list_widget() {
|
3 |
-
require_once("frontend_functions.php");
|
4 |
-
global $wpdb;
|
5 |
-
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
-
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
-
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
-
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 1);
|
9 |
-
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
10 |
-
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
11 |
-
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
12 |
-
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
13 |
-
$site_url = get_admin_url().'admin-ajax.php';
|
14 |
-
///////////////////////////////////////////////////////////////////////////////////
|
15 |
-
|
16 |
-
if($cat_ids=='')
|
17 |
-
$cat_ids .= $cat_id.',';
|
18 |
-
else
|
19 |
-
$cat_ids .= ','.$cat_id.',';
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
24 |
-
|
25 |
-
|
26 |
-
function getelementcountinarray($array , $element)
|
27 |
-
{
|
28 |
-
$t=0;
|
29 |
-
|
30 |
-
for($i=0; $i<count($array); $i++)
|
31 |
-
{
|
32 |
-
if($element==$array[$i])
|
33 |
-
$t++;
|
34 |
-
|
35 |
-
}
|
36 |
-
|
37 |
-
|
38 |
-
return $t;
|
39 |
-
|
40 |
-
}
|
41 |
-
|
42 |
-
function getelementindexinarray($array , $element)
|
43 |
-
{
|
44 |
-
|
45 |
-
$t='';
|
46 |
-
|
47 |
-
for($i=0; $i<count($array); $i++)
|
48 |
-
{
|
49 |
-
if($element==$array[$i])
|
50 |
-
$t.=$i.',';
|
51 |
-
|
52 |
-
}
|
53 |
-
|
54 |
-
return $t;
|
55 |
-
|
56 |
-
|
57 |
-
}
|
58 |
-
$cat_ids_array = explode(',',$cat_ids);
|
59 |
-
|
60 |
-
|
61 |
-
if($cat_id!='')
|
62 |
-
{
|
63 |
-
|
64 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
65 |
-
{
|
66 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
67 |
-
$index_array = explode(',' , $index_in_line);
|
68 |
-
array_pop ($index_array);
|
69 |
-
for($j=0; $j<count($index_array); $j++)
|
70 |
-
unset($cat_ids_array[$index_array[$j]]);
|
71 |
-
$cat_ids = implode(',',$cat_ids_array);
|
72 |
-
}
|
73 |
-
}
|
74 |
-
else
|
75 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
76 |
-
|
77 |
-
|
78 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
79 |
-
|
80 |
-
|
81 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
82 |
-
$weekstart = $theme->week_start_day;
|
83 |
-
$bg = '#' . str_replace('#','',$theme->header_bgcolor);
|
84 |
-
$bg_color_selected = '#' . str_replace('#','',$theme->bg_color_selected);
|
85 |
-
$color_arrow = '#' . str_replace('#','',$theme->arrow_color);
|
86 |
-
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
87 |
-
$evented_color_bg = '#' . str_replace('#','',$theme->bg_color_this_month_evented);
|
88 |
-
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
89 |
-
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
90 |
-
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
91 |
-
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
92 |
-
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
93 |
-
$text_color_selected = '#' . str_replace('#','',$theme->text_color_selected);
|
94 |
-
$border_day = '#' . str_replace('#','',$theme->border_day);
|
95 |
-
$calendar_width = $theme->width;
|
96 |
-
$calendar_bg = '#' . str_replace('#','',$theme->footer_bgcolor);
|
97 |
-
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
98 |
-
$weekday_su_bg_color = '#' . str_replace('#','',$theme->su_bg_color);
|
99 |
-
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
100 |
-
$year_font_size = $theme->year_font_size;
|
101 |
-
$year_font_color = '#' . str_replace('#','',$theme->year_font_color);
|
102 |
-
$year_tabs_bg_color = '#' . str_replace('#','',$theme->year_tabs_bg_color);
|
103 |
-
$font_year = $theme->font_year;
|
104 |
-
$font_month = $theme->font_month;
|
105 |
-
$font_day = $theme->font_day;
|
106 |
-
$font_weekday = $theme->font_weekday;
|
107 |
-
$show_cat = $theme->show_cat;
|
108 |
-
$ev_title_color = '#' . str_replace('#','',$theme->ev_title_color);
|
109 |
-
$popup_width = $theme->popup_width;
|
110 |
-
$popup_height = $theme->popup_height;
|
111 |
-
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
112 |
-
|
113 |
-
__('January', 'sp_calendar');
|
114 |
-
__('February', 'sp_calendar');
|
115 |
-
__('March', 'sp_calendar');
|
116 |
-
__('April', 'sp_calendar');
|
117 |
-
__('May', 'sp_calendar');
|
118 |
-
__('June', 'sp_calendar');
|
119 |
-
__('July', 'sp_calendar');
|
120 |
-
__('August', 'sp_calendar');
|
121 |
-
__('September', 'sp_calendar');
|
122 |
-
__('October', 'sp_calendar');
|
123 |
-
__('November', 'sp_calendar');
|
124 |
-
__('December', 'sp_calendar');
|
125 |
-
if ($date != '') {
|
126 |
-
$date_REFERER = $date;
|
127 |
-
}
|
128 |
-
else {
|
129 |
-
$date_REFERER = date("Y-m");
|
130 |
-
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
131 |
-
}
|
132 |
-
$year_REFERER = substr($date_REFERER, 0, 4);
|
133 |
-
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
134 |
-
$day_REFERER = substr($date_REFERER, 8, 2);
|
135 |
-
|
136 |
-
$year = substr($date, 0, 4);
|
137 |
-
$month = Month_name(substr($date, 5, 2));
|
138 |
-
$day = substr($date, 8, 2);
|
139 |
-
|
140 |
-
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
141 |
-
$prev_month = add_0((int) $this_month - 1);
|
142 |
-
$next_month = add_0((int) $this_month + 1);
|
143 |
-
|
144 |
-
$cell_width = $calendar_width / 7;
|
145 |
-
$cell_width = (int) $cell_width - 2;
|
146 |
-
|
147 |
-
$view = 'bigcalendarlist_widget';
|
148 |
-
$views = explode(',', $view_select);
|
149 |
-
$defaultview = 'list';
|
150 |
-
array_pop($views);
|
151 |
-
$display = '';
|
152 |
-
if (count($views) == 0) {
|
153 |
-
$display = "display:none";
|
154 |
-
}
|
155 |
-
if(count($views) == 1 && $views[0] == $defaultview) {
|
156 |
-
$display = "display:none";
|
157 |
-
}
|
158 |
-
?>
|
159 |
-
<html>
|
160 |
-
<head>
|
161 |
-
<style type='text/css'>
|
162 |
-
#calendar_<?php echo $many_sp_calendar; ?> table {
|
163 |
-
border-collapse: initial;
|
164 |
-
border:0px;
|
165 |
-
margin: 0;
|
166 |
-
}
|
167 |
-
#TB_iframeContent{
|
168 |
-
background-color: <?php echo $show_event_bgcolor; ?>;
|
169 |
-
}
|
170 |
-
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
171 |
-
padding: 0px;
|
172 |
-
vertical-align: none;
|
173 |
-
border-top:none;
|
174 |
-
line-height: none;
|
175 |
-
text-align: none;
|
176 |
-
}
|
177 |
-
#calendar_<?php echo $many_sp_calendar; ?> .arrow-left {
|
178 |
-
width: 0px;
|
179 |
-
height: 0px;
|
180 |
-
border-top: 7px solid transparent;
|
181 |
-
border-bottom: 7px solid transparent;
|
182 |
-
border-right: 13px solid;
|
183 |
-
margin: 0 auto;
|
184 |
-
}
|
185 |
-
|
186 |
-
#calendar_<?php echo $many_sp_calendar; ?> .arrow-right {
|
187 |
-
width: 0px;
|
188 |
-
height: 0px;
|
189 |
-
border-top: 7px solid transparent;
|
190 |
-
border-bottom: 7px solid transparent;
|
191 |
-
border-left: 13px solid;
|
192 |
-
margin: 0 auto;
|
193 |
-
}
|
194 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
195 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
196 |
-
font-family: <?php echo $font_day; ?>;
|
197 |
-
}
|
198 |
-
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
199 |
-
margin-bottom: 0;
|
200 |
-
}
|
201 |
-
#calendar_<?php echo $many_sp_calendar; ?> td,
|
202 |
-
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
203 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> td,
|
204 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> tr {
|
205 |
-
border:none;
|
206 |
-
}
|
207 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
208 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
209 |
-
color: <?php echo $color_arrow; ?>;
|
210 |
-
text-decoration: none !important;
|
211 |
-
background: none;
|
212 |
-
font-size: 16px;
|
213 |
-
}
|
214 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
215 |
-
color: <?php echo $color_arrow; ?>;
|
216 |
-
text-decoration:none;
|
217 |
-
background:none;
|
218 |
-
}
|
219 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
220 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
221 |
-
text-decoration:underline;
|
222 |
-
background:none;
|
223 |
-
font-size:11px;
|
224 |
-
}
|
225 |
-
#calendar_<?php echo $many_sp_calendar; ?> a {
|
226 |
-
font-weight: normal;
|
227 |
-
}
|
228 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
229 |
-
font-size:12px;
|
230 |
-
text-decoration:none;
|
231 |
-
background:none;
|
232 |
-
}
|
233 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
234 |
-
border-spacing:0;
|
235 |
-
width:100%;
|
236 |
-
}
|
237 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
238 |
-
border-spacing: 0;
|
239 |
-
vertical-align: middle;
|
240 |
-
width: 100%;
|
241 |
-
}
|
242 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
243 |
-
background-color:<?php echo $bg; ?> !important;
|
244 |
-
text-align:center;
|
245 |
-
vertical-align: middle;
|
246 |
-
}
|
247 |
-
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
248 |
-
color:<?php echo $text_color_other_months; ?>;
|
249 |
-
}
|
250 |
-
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
251 |
-
color:<?php echo $text_color_this_month_unevented; ?>;
|
252 |
-
}
|
253 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calfont_year {
|
254 |
-
font-size:24px;
|
255 |
-
font-weight:bold;
|
256 |
-
color:<?php echo $year_font_color; ?>;
|
257 |
-
}
|
258 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
259 |
-
color:<?php echo $sun_days; ?>;
|
260 |
-
}
|
261 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
262 |
-
border: solid <?php echo $border_day; ?> 1px;
|
263 |
-
}
|
264 |
-
#TB_window {
|
265 |
-
z-index: 10000;
|
266 |
-
}
|
267 |
-
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
268 |
-
float: right;
|
269 |
-
background-color: <?php echo $calendar_bg; ?> !important;
|
270 |
-
height: 25px;
|
271 |
-
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
272 |
-
margin-left: 2px;
|
273 |
-
text-align: center;
|
274 |
-
cursor:pointer;
|
275 |
-
position: relative;
|
276 |
-
top: 3px;
|
277 |
-
font-family: <?php echo $font_month; ?>;
|
278 |
-
font-size: 14px;
|
279 |
-
}
|
280 |
-
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
281 |
-
background: transparent !important;
|
282 |
-
}
|
283 |
-
|
284 |
-
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
285 |
-
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
286 |
-
{
|
287 |
-
width: 120px;
|
288 |
-
text-align: center;
|
289 |
-
cursor: pointer;
|
290 |
-
padding: 6px;
|
291 |
-
position: relative;
|
292 |
-
}
|
293 |
-
|
294 |
-
|
295 |
-
#drop_down_views
|
296 |
-
{
|
297 |
-
list-style-type:none !important;
|
298 |
-
position: absolute;
|
299 |
-
top: 46px;
|
300 |
-
left: -15px;
|
301 |
-
display:none;
|
302 |
-
z-index: 4545;
|
303 |
-
|
304 |
-
}
|
305 |
-
|
306 |
-
#drop_down_views >li
|
307 |
-
{
|
308 |
-
border-bottom:1px solid #fff !important;
|
309 |
-
}
|
310 |
-
|
311 |
-
|
312 |
-
#views_tabs_select
|
313 |
-
{
|
314 |
-
display:none;
|
315 |
-
}
|
316 |
-
</style>
|
317 |
-
</head>
|
318 |
-
<body>
|
319 |
-
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
320 |
-
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?> !important">
|
321 |
-
<tr style="background-color:#FFFFFF;">
|
322 |
-
<td style="background-color:#FFFFFF;">
|
323 |
-
<div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
|
324 |
-
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
325 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
326 |
-
'action' => 'spiderbigcalendar_day_widget',
|
327 |
-
'theme_id' => $theme_id,
|
328 |
-
'calendar' => $calendar_id,
|
329 |
-
'select' => $view_select,
|
330 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
331 |
-
'many_sp_calendar' => $many_sp_calendar,
|
332 |
-
'cat_id' => '',
|
333 |
-
'cat_ids' => $cat_ids,
|
334 |
-
'widget' => $widget,
|
335 |
-
'TB_iframe' => 1,
|
336 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Day', 'sp_calendar'); ?></span>
|
337 |
-
</div>
|
338 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
339 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
340 |
-
'action' => 'spiderbigcalendar_week_widget',
|
341 |
-
'theme_id' => $theme_id,
|
342 |
-
'calendar' => $calendar_id,
|
343 |
-
'select' => $view_select,
|
344 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
345 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
346 |
-
'many_sp_calendar' => $many_sp_calendar,
|
347 |
-
'cat_id' => '',
|
348 |
-
'cat_ids' => $cat_ids,
|
349 |
-
'widget' => $widget,
|
350 |
-
'TB_iframe' => 1,
|
351 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Week', 'sp_calendar'); ?></span>
|
352 |
-
</div>
|
353 |
-
<div class="views" style="margin-left: 3px;margin-right: 1px;<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;' ?>"
|
354 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
355 |
-
'action' => 'spiderbigcalendar_list_widget',
|
356 |
-
'theme_id' => $theme_id,
|
357 |
-
'calendar' => $calendar_id,
|
358 |
-
'select' => $view_select,
|
359 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
360 |
-
'many_sp_calendar' => $many_sp_calendar,
|
361 |
-
'cat_id' => '',
|
362 |
-
'cat_ids' => $cat_ids,
|
363 |
-
'widget' => $widget,
|
364 |
-
'TB_iframe' => 1,
|
365 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('List', 'sp_calendar'); ?></span>
|
366 |
-
</div>
|
367 |
-
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
368 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
369 |
-
'action' => 'spiderbigcalendar_month_widget',
|
370 |
-
'theme_id' => $theme_id,
|
371 |
-
'calendar' => $calendar_id,
|
372 |
-
'select' => $view_select,
|
373 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
374 |
-
'many_sp_calendar' => $many_sp_calendar,
|
375 |
-
'cat_id' => '',
|
376 |
-
'cat_ids' => $cat_ids,
|
377 |
-
'widget' => $widget,
|
378 |
-
'TB_iframe' => 1,
|
379 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
380 |
-
</div>
|
381 |
-
</div>
|
382 |
-
</td>
|
383 |
-
</tr>
|
384 |
-
<tr>
|
385 |
-
<td width="100%" style="padding:0; margin:0;">
|
386 |
-
<form action="" method="get" style="background:none; margin:0; padding:0;">
|
387 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>">
|
388 |
-
<tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
|
389 |
-
<td class="calbg" colspan="7" style="background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');margin:0; padding:0;background-repeat: no-repeat;background-size: 100% 100%;" >
|
390 |
-
<?php //MONTH TABLE ?>
|
391 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
|
392 |
-
<tr>
|
393 |
-
<td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
394 |
-
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
395 |
-
if (Month_num($month) == 1) {
|
396 |
-
$needed_date = ($year - 1) . '-12';
|
397 |
-
}
|
398 |
-
else {
|
399 |
-
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
400 |
-
}
|
401 |
-
echo add_query_arg(array(
|
402 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
403 |
-
'theme_id' => $theme_id,
|
404 |
-
'calendar' => $calendar_id,
|
405 |
-
'select' => $view_select,
|
406 |
-
'date' => $needed_date,
|
407 |
-
'many_sp_calendar' => $many_sp_calendar,
|
408 |
-
'cat_id' => '',
|
409 |
-
'cat_ids' => $cat_ids,
|
410 |
-
'widget' => $widget,
|
411 |
-
'TB_iframe' => 1,
|
412 |
-
), $site_url);
|
413 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-left"></div>
|
414 |
-
</a>
|
415 |
-
</td>
|
416 |
-
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
417 |
-
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
418 |
-
<span style="font-size:<?php echo $year_font_size; ?>px;?>; color:<?php echo $text_color_month; ?>;"><?php echo __($month, 'sp_calendar'); ?></span>
|
419 |
-
</td>
|
420 |
-
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
421 |
-
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
422 |
-
if (Month_num($month) == 12) {
|
423 |
-
$needed_date = ($year + 1) . '-01';
|
424 |
-
}
|
425 |
-
else {
|
426 |
-
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
427 |
-
}
|
428 |
-
echo add_query_arg(array(
|
429 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
430 |
-
'theme_id' => $theme_id,
|
431 |
-
'calendar' => $calendar_id,
|
432 |
-
'select' => $view_select,
|
433 |
-
'date' => $needed_date,
|
434 |
-
'many_sp_calendar' => $many_sp_calendar,
|
435 |
-
'cat_id' => '',
|
436 |
-
'cat_ids' => $cat_ids,
|
437 |
-
'widget' => $widget,
|
438 |
-
'TB_iframe' => 1,
|
439 |
-
), $site_url);
|
440 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-right"></div>
|
441 |
-
</a>
|
442 |
-
</td>
|
443 |
-
</tr>
|
444 |
-
</table>
|
445 |
-
</td>
|
446 |
-
</tr>
|
447 |
-
|
448 |
-
<tr>
|
449 |
-
<td colspan="7">
|
450 |
-
<?php
|
451 |
-
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
452 |
-
if ($weekstart == "su") {
|
453 |
-
$month_first_weekday++;
|
454 |
-
if ($month_first_weekday == 8) {
|
455 |
-
$month_first_weekday = 1;
|
456 |
-
}
|
457 |
-
}
|
458 |
-
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
459 |
-
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
460 |
-
$weekday_i = $month_first_weekday;
|
461 |
-
$last_month_days = $last_month_days - $weekday_i + 2;
|
462 |
-
$percent = 1;
|
463 |
-
$sum = $month_days - 8 + $month_first_weekday;
|
464 |
-
if ($sum % 7 <> 0) {
|
465 |
-
$percent = $percent + 1;
|
466 |
-
}
|
467 |
-
$sum = $sum - ($sum % 7);
|
468 |
-
$percent = $percent + ($sum / 7);
|
469 |
-
$percent = 107 / $percent;
|
470 |
-
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
471 |
-
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
472 |
-
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
473 |
-
$array_days = $all_calendar_files[0]['array_days'];
|
474 |
-
$array_days1 = $all_calendar_files[0]['array_days1'];
|
475 |
-
$title = $all_calendar_files[0]['title'];
|
476 |
-
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
477 |
-
sort($array_days, SORT_NUMERIC);
|
478 |
-
if (!$array_days) {
|
479 |
-
echo '<table style="height:14px;border-spacing:0;border-spacing:0;width: 100%;background-color:#D6D4D5 !important;">
|
480 |
-
<tr>
|
481 |
-
<td style="padding-left:10px; font-size:12px;font-weight:bold;width:10px;text-align:center;background-color:' . $bg . ' !important;color:#949394;"></td>
|
482 |
-
<td><p style="font-size:12px;color:' . $bg . '; border:none"> ' . __('There are no events for this month', 'sp_calendar') . '</p></td>
|
483 |
-
</tr>
|
484 |
-
</table>';
|
485 |
-
}
|
486 |
-
for ($i = 0; $i < count($array_days); $i++) {
|
487 |
-
$week_day = date('D', mktime(0, 0, 0, Month_num($month), $array_days[$i], $year));
|
488 |
-
if($array_days[$i]<=$month_days){
|
489 |
-
echo '<table style="width:100%; border-spacing:0;">
|
490 |
-
<tr>
|
491 |
-
<td style="height:14px;font-size:12px; padding-left:10px;background-color:#D6D4D5 !important; color:#6E7276">
|
492 |
-
<span style="padding-left:10px; font-size:12px;color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
|
493 |
-
<span style="font-size:12px;color:#949394;">(' . add_0($array_days[$i]) . ' ' . __($month,'sp_calendar') . ')</span>
|
494 |
-
</td>
|
495 |
-
</tr>
|
496 |
-
<tr>
|
497 |
-
<td>';
|
498 |
-
foreach ($title as $key => $value) {
|
499 |
-
if ($key == $array_days[$i]) {
|
500 |
-
$ev_id = explode('<br>', $ev_ids[$key]);
|
501 |
-
array_pop($ev_id);
|
502 |
-
$ev_ids_inline = implode(',', $ev_id);
|
503 |
-
$ev_title = explode('</p>', $value);
|
504 |
-
array_pop($ev_title);
|
505 |
-
for ($j = 0; $j < count($ev_title); $j++) {
|
506 |
-
$queryy = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
507 |
-
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
508 |
-
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d",$calendar,$ev_id[$j]);
|
509 |
-
|
510 |
-
$cat_color = $wpdb->get_row($queryy);
|
511 |
-
|
512 |
-
if (($j + 1) % 2 == 0) {
|
513 |
-
$color = $bg;
|
514 |
-
$table_color = $calendar_bg;
|
515 |
-
}
|
516 |
-
else {
|
517 |
-
$color = $bg;
|
518 |
-
$table_color = $calendar_bg;
|
519 |
-
}
|
520 |
-
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color=$bg;};
|
521 |
-
echo '<table class="last_table" style="overflow:hidden;height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
522 |
-
<tr>
|
523 |
-
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . str_replace('#','',$cat_color->color) . ' !important;color:' . $calendar_bg . '">' . ($j +1 ) . '</td>
|
524 |
-
<td>
|
525 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:13px;background:none;color:' . $ev_title_color . ';"
|
526 |
-
href="' . add_query_arg(array(
|
527 |
-
'action' => 'spidercalendarbig',
|
528 |
-
'theme_id' => $theme_id,
|
529 |
-
'calendar_id' => $calendar_id,
|
530 |
-
'ev_ids' => $ev_ids_inline,
|
531 |
-
'eventID' => $ev_id[$j],
|
532 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $array_days[$i],
|
533 |
-
'many_sp_calendar' => $many_sp_calendar,
|
534 |
-
'widget' => $widget,
|
535 |
-
'TB_iframe' => 1,
|
536 |
-
'tbWidth' => $popup_width,
|
537 |
-
'tbHeight' => $popup_height,
|
538 |
-
), $site_url) . '"><b>'.$ev_title[$j].'</b>
|
539 |
-
</a>
|
540 |
-
</td>
|
541 |
-
</tr>
|
542 |
-
</table>';
|
543 |
-
}
|
544 |
-
}
|
545 |
-
}
|
546 |
-
echo '</td></tr></table>';
|
547 |
-
}
|
548 |
-
}
|
549 |
-
?>
|
550 |
-
</td>
|
551 |
-
</tr>
|
552 |
-
<tr style="height:<?php echo $year_font_size + 2; ?>px; font-family: <?php echo $font_year; ?>;">
|
553 |
-
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
554 |
-
echo add_query_arg(array(
|
555 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
556 |
-
'theme_id' => $theme_id,
|
557 |
-
'calendar' => $calendar_id,
|
558 |
-
'select' => $view_select,
|
559 |
-
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
560 |
-
'many_sp_calendar' => $many_sp_calendar,
|
561 |
-
'widget' => $widget,
|
562 |
-
'cat_id' => '',
|
563 |
-
'cat_ids' => $cat_ids,
|
564 |
-
'TB_iframe' => 1,
|
565 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important">
|
566 |
-
<?php echo ($year - 1); ?>
|
567 |
-
</td>
|
568 |
-
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
569 |
-
<?php echo $year; ?>
|
570 |
-
</td>
|
571 |
-
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
572 |
-
echo add_query_arg(array(
|
573 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
574 |
-
'theme_id' => $theme_id,
|
575 |
-
'calendar' => $calendar_id,
|
576 |
-
'select' => $view_select,
|
577 |
-
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
578 |
-
'many_sp_calendar' => $many_sp_calendar,
|
579 |
-
'widget' => $widget,
|
580 |
-
'cat_id' => '',
|
581 |
-
'cat_ids' => $cat_ids,
|
582 |
-
'TB_iframe' => 1,
|
583 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important;color:<?php echo $year_font_color; ?>">
|
584 |
-
<?php echo ($year + 1); ?>
|
585 |
-
</td>
|
586 |
-
</tr>
|
587 |
-
</table>
|
588 |
-
<input type="text" value="1" name="day" style="display:none" />
|
589 |
-
</form>
|
590 |
-
</td>
|
591 |
-
</tr>
|
592 |
-
</table>
|
593 |
-
</div>
|
594 |
-
<style>
|
595 |
-
#calendar_<?php echo $many_sp_calendar; ?> table{
|
596 |
-
width: 100%;
|
597 |
-
}
|
598 |
-
.spider_categories_widget{
|
599 |
-
display:inline-block;
|
600 |
-
cursor:pointer;
|
601 |
-
}
|
602 |
-
|
603 |
-
.spider_categories_widget p{
|
604 |
-
color: #fff;
|
605 |
-
padding: 2px 10px !important;
|
606 |
-
margin: 2px 0 !important;
|
607 |
-
font-size: 13px;
|
608 |
-
}
|
609 |
-
</style>
|
610 |
-
<?php
|
611 |
-
|
612 |
-
//reindex cat_ids_array
|
613 |
-
$re_cat_ids_array = array_values($cat_ids_array);
|
614 |
-
|
615 |
-
for($i=0; $i<count($re_cat_ids_array); $i++)
|
616 |
-
{
|
617 |
-
echo'
|
618 |
-
<style>
|
619 |
-
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
620 |
-
{
|
621 |
-
text-decoration:underline;
|
622 |
-
cursor:pointer;
|
623 |
-
|
624 |
-
}
|
625 |
-
|
626 |
-
</style>';
|
627 |
-
|
628 |
-
}
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
if($cat_ids=='')
|
633 |
-
$cat_ids='';
|
634 |
-
if($show_cat){
|
635 |
-
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none; margin-top: 10px;">';
|
636 |
-
|
637 |
-
foreach($categories as $category)
|
638 |
-
{
|
639 |
-
|
640 |
-
?>
|
641 |
-
|
642 |
-
<li class="spider_categories_widget"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
643 |
-
'action' => 'spiderbigcalendar_list_widget',
|
644 |
-
'theme_id' => $theme_id,
|
645 |
-
'calendar' => $calendar_id,
|
646 |
-
'select' => $view_select,
|
647 |
-
'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
|
648 |
-
'many_sp_calendar' => $many_sp_calendar,
|
649 |
-
'cat_id' => $category->id,
|
650 |
-
'cat_ids' => $cat_ids,
|
651 |
-
'widget' => $widget,
|
652 |
-
'TB_iframe' => 1,
|
653 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
654 |
-
|
655 |
-
|
656 |
-
<?php
|
657 |
-
}
|
658 |
-
if (!empty($categories)) {
|
659 |
-
?>
|
660 |
-
<li class="spider_categories_widget"><p class="categories2" id="category0" style="background-color:#<?php echo str_replace('#','',$bg); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
661 |
-
'action' => 'spiderbigcalendar_list_widget',
|
662 |
-
'theme_id' => $theme_id,
|
663 |
-
'calendar' => $calendar_id,
|
664 |
-
'select' => $view_select,
|
665 |
-
'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
|
666 |
-
'many_sp_calendar' => $many_sp_calendar,
|
667 |
-
'cat_id' => '',
|
668 |
-
'cat_ids' => '',
|
669 |
-
'widget' => $widget,
|
670 |
-
'TB_iframe' => 1,
|
671 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
672 |
-
<?php echo '</ul>';
|
673 |
-
}
|
674 |
-
} ?>
|
675 |
-
</body>
|
676 |
-
</html>
|
677 |
-
<?php
|
678 |
-
die();
|
679 |
-
}
|
680 |
-
|
681 |
?>
|
1 |
+
<?php
|
2 |
+
function big_calendar_list_widget() {
|
3 |
+
require_once("frontend_functions.php");
|
4 |
+
global $wpdb;
|
5 |
+
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
+
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
+
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
+
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 1);
|
9 |
+
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
10 |
+
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
11 |
+
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
12 |
+
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
13 |
+
$site_url = get_admin_url().'admin-ajax.php';
|
14 |
+
///////////////////////////////////////////////////////////////////////////////////
|
15 |
+
|
16 |
+
if($cat_ids=='')
|
17 |
+
$cat_ids .= $cat_id.',';
|
18 |
+
else
|
19 |
+
$cat_ids .= ','.$cat_id.',';
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
24 |
+
|
25 |
+
|
26 |
+
function getelementcountinarray($array , $element)
|
27 |
+
{
|
28 |
+
$t=0;
|
29 |
+
|
30 |
+
for($i=0; $i<count($array); $i++)
|
31 |
+
{
|
32 |
+
if($element==$array[$i])
|
33 |
+
$t++;
|
34 |
+
|
35 |
+
}
|
36 |
+
|
37 |
+
|
38 |
+
return $t;
|
39 |
+
|
40 |
+
}
|
41 |
+
|
42 |
+
function getelementindexinarray($array , $element)
|
43 |
+
{
|
44 |
+
|
45 |
+
$t='';
|
46 |
+
|
47 |
+
for($i=0; $i<count($array); $i++)
|
48 |
+
{
|
49 |
+
if($element==$array[$i])
|
50 |
+
$t.=$i.',';
|
51 |
+
|
52 |
+
}
|
53 |
+
|
54 |
+
return $t;
|
55 |
+
|
56 |
+
|
57 |
+
}
|
58 |
+
$cat_ids_array = explode(',',$cat_ids);
|
59 |
+
|
60 |
+
|
61 |
+
if($cat_id!='')
|
62 |
+
{
|
63 |
+
|
64 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
65 |
+
{
|
66 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
67 |
+
$index_array = explode(',' , $index_in_line);
|
68 |
+
array_pop ($index_array);
|
69 |
+
for($j=0; $j<count($index_array); $j++)
|
70 |
+
unset($cat_ids_array[$index_array[$j]]);
|
71 |
+
$cat_ids = implode(',',$cat_ids_array);
|
72 |
+
}
|
73 |
+
}
|
74 |
+
else
|
75 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
76 |
+
|
77 |
+
|
78 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
79 |
+
|
80 |
+
|
81 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
82 |
+
$weekstart = $theme->week_start_day;
|
83 |
+
$bg = '#' . str_replace('#','',$theme->header_bgcolor);
|
84 |
+
$bg_color_selected = '#' . str_replace('#','',$theme->bg_color_selected);
|
85 |
+
$color_arrow = '#' . str_replace('#','',$theme->arrow_color);
|
86 |
+
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
87 |
+
$evented_color_bg = '#' . str_replace('#','',$theme->bg_color_this_month_evented);
|
88 |
+
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
89 |
+
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
90 |
+
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
91 |
+
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
92 |
+
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
93 |
+
$text_color_selected = '#' . str_replace('#','',$theme->text_color_selected);
|
94 |
+
$border_day = '#' . str_replace('#','',$theme->border_day);
|
95 |
+
$calendar_width = $theme->width;
|
96 |
+
$calendar_bg = '#' . str_replace('#','',$theme->footer_bgcolor);
|
97 |
+
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
98 |
+
$weekday_su_bg_color = '#' . str_replace('#','',$theme->su_bg_color);
|
99 |
+
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
100 |
+
$year_font_size = $theme->year_font_size;
|
101 |
+
$year_font_color = '#' . str_replace('#','',$theme->year_font_color);
|
102 |
+
$year_tabs_bg_color = '#' . str_replace('#','',$theme->year_tabs_bg_color);
|
103 |
+
$font_year = $theme->font_year;
|
104 |
+
$font_month = $theme->font_month;
|
105 |
+
$font_day = $theme->font_day;
|
106 |
+
$font_weekday = $theme->font_weekday;
|
107 |
+
$show_cat = $theme->show_cat;
|
108 |
+
$ev_title_color = '#' . str_replace('#','',$theme->ev_title_color);
|
109 |
+
$popup_width = $theme->popup_width;
|
110 |
+
$popup_height = $theme->popup_height;
|
111 |
+
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
112 |
+
|
113 |
+
__('January', 'sp_calendar');
|
114 |
+
__('February', 'sp_calendar');
|
115 |
+
__('March', 'sp_calendar');
|
116 |
+
__('April', 'sp_calendar');
|
117 |
+
__('May', 'sp_calendar');
|
118 |
+
__('June', 'sp_calendar');
|
119 |
+
__('July', 'sp_calendar');
|
120 |
+
__('August', 'sp_calendar');
|
121 |
+
__('September', 'sp_calendar');
|
122 |
+
__('October', 'sp_calendar');
|
123 |
+
__('November', 'sp_calendar');
|
124 |
+
__('December', 'sp_calendar');
|
125 |
+
if ($date != '') {
|
126 |
+
$date_REFERER = $date;
|
127 |
+
}
|
128 |
+
else {
|
129 |
+
$date_REFERER = date("Y-m");
|
130 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
131 |
+
}
|
132 |
+
$year_REFERER = substr($date_REFERER, 0, 4);
|
133 |
+
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
134 |
+
$day_REFERER = substr($date_REFERER, 8, 2);
|
135 |
+
|
136 |
+
$year = substr($date, 0, 4);
|
137 |
+
$month = Month_name(substr($date, 5, 2));
|
138 |
+
$day = substr($date, 8, 2);
|
139 |
+
|
140 |
+
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
141 |
+
$prev_month = add_0((int) $this_month - 1);
|
142 |
+
$next_month = add_0((int) $this_month + 1);
|
143 |
+
|
144 |
+
$cell_width = $calendar_width / 7;
|
145 |
+
$cell_width = (int) $cell_width - 2;
|
146 |
+
|
147 |
+
$view = 'bigcalendarlist_widget';
|
148 |
+
$views = explode(',', $view_select);
|
149 |
+
$defaultview = 'list';
|
150 |
+
array_pop($views);
|
151 |
+
$display = '';
|
152 |
+
if (count($views) == 0) {
|
153 |
+
$display = "display:none";
|
154 |
+
}
|
155 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
156 |
+
$display = "display:none";
|
157 |
+
}
|
158 |
+
?>
|
159 |
+
<html>
|
160 |
+
<head>
|
161 |
+
<style type='text/css'>
|
162 |
+
#calendar_<?php echo $many_sp_calendar; ?> table {
|
163 |
+
border-collapse: initial;
|
164 |
+
border:0px;
|
165 |
+
margin: 0;
|
166 |
+
}
|
167 |
+
#TB_iframeContent{
|
168 |
+
background-color: <?php echo $show_event_bgcolor; ?>;
|
169 |
+
}
|
170 |
+
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
171 |
+
padding: 0px;
|
172 |
+
vertical-align: none;
|
173 |
+
border-top:none;
|
174 |
+
line-height: none;
|
175 |
+
text-align: none;
|
176 |
+
}
|
177 |
+
#calendar_<?php echo $many_sp_calendar; ?> .arrow-left {
|
178 |
+
width: 0px;
|
179 |
+
height: 0px;
|
180 |
+
border-top: 7px solid transparent;
|
181 |
+
border-bottom: 7px solid transparent;
|
182 |
+
border-right: 13px solid;
|
183 |
+
margin: 0 auto;
|
184 |
+
}
|
185 |
+
|
186 |
+
#calendar_<?php echo $many_sp_calendar; ?> .arrow-right {
|
187 |
+
width: 0px;
|
188 |
+
height: 0px;
|
189 |
+
border-top: 7px solid transparent;
|
190 |
+
border-bottom: 7px solid transparent;
|
191 |
+
border-left: 13px solid;
|
192 |
+
margin: 0 auto;
|
193 |
+
}
|
194 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
195 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
196 |
+
font-family: <?php echo $font_day; ?>;
|
197 |
+
}
|
198 |
+
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
199 |
+
margin-bottom: 0;
|
200 |
+
}
|
201 |
+
#calendar_<?php echo $many_sp_calendar; ?> td,
|
202 |
+
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
203 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> td,
|
204 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> tr {
|
205 |
+
border:none;
|
206 |
+
}
|
207 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
208 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
209 |
+
color: <?php echo $color_arrow; ?>;
|
210 |
+
text-decoration: none !important;
|
211 |
+
background: none;
|
212 |
+
font-size: 16px;
|
213 |
+
}
|
214 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
215 |
+
color: <?php echo $color_arrow; ?>;
|
216 |
+
text-decoration:none;
|
217 |
+
background:none;
|
218 |
+
}
|
219 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
220 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
221 |
+
text-decoration:underline;
|
222 |
+
background:none;
|
223 |
+
font-size:11px;
|
224 |
+
}
|
225 |
+
#calendar_<?php echo $many_sp_calendar; ?> a {
|
226 |
+
font-weight: normal;
|
227 |
+
}
|
228 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
229 |
+
font-size:12px;
|
230 |
+
text-decoration:none;
|
231 |
+
background:none;
|
232 |
+
}
|
233 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
234 |
+
border-spacing:0;
|
235 |
+
width:100%;
|
236 |
+
}
|
237 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
238 |
+
border-spacing: 0;
|
239 |
+
vertical-align: middle;
|
240 |
+
width: 100%;
|
241 |
+
}
|
242 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
243 |
+
background-color:<?php echo $bg; ?> !important;
|
244 |
+
text-align:center;
|
245 |
+
vertical-align: middle;
|
246 |
+
}
|
247 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
248 |
+
color:<?php echo $text_color_other_months; ?>;
|
249 |
+
}
|
250 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
251 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
252 |
+
}
|
253 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calfont_year {
|
254 |
+
font-size:24px;
|
255 |
+
font-weight:bold;
|
256 |
+
color:<?php echo $year_font_color; ?>;
|
257 |
+
}
|
258 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
259 |
+
color:<?php echo $sun_days; ?>;
|
260 |
+
}
|
261 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
262 |
+
border: solid <?php echo $border_day; ?> 1px;
|
263 |
+
}
|
264 |
+
#TB_window {
|
265 |
+
z-index: 10000;
|
266 |
+
}
|
267 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
268 |
+
float: right;
|
269 |
+
background-color: <?php echo $calendar_bg; ?> !important;
|
270 |
+
height: 25px;
|
271 |
+
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
272 |
+
margin-left: 2px;
|
273 |
+
text-align: center;
|
274 |
+
cursor:pointer;
|
275 |
+
position: relative;
|
276 |
+
top: 3px;
|
277 |
+
font-family: <?php echo $font_month; ?>;
|
278 |
+
font-size: 14px;
|
279 |
+
}
|
280 |
+
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
281 |
+
background: transparent !important;
|
282 |
+
}
|
283 |
+
|
284 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
285 |
+
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
286 |
+
{
|
287 |
+
width: 120px;
|
288 |
+
text-align: center;
|
289 |
+
cursor: pointer;
|
290 |
+
padding: 6px;
|
291 |
+
position: relative;
|
292 |
+
}
|
293 |
+
|
294 |
+
|
295 |
+
#drop_down_views
|
296 |
+
{
|
297 |
+
list-style-type:none !important;
|
298 |
+
position: absolute;
|
299 |
+
top: 46px;
|
300 |
+
left: -15px;
|
301 |
+
display:none;
|
302 |
+
z-index: 4545;
|
303 |
+
|
304 |
+
}
|
305 |
+
|
306 |
+
#drop_down_views >li
|
307 |
+
{
|
308 |
+
border-bottom:1px solid #fff !important;
|
309 |
+
}
|
310 |
+
|
311 |
+
|
312 |
+
#views_tabs_select
|
313 |
+
{
|
314 |
+
display:none;
|
315 |
+
}
|
316 |
+
</style>
|
317 |
+
</head>
|
318 |
+
<body>
|
319 |
+
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
320 |
+
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?> !important">
|
321 |
+
<tr style="background-color:#FFFFFF;">
|
322 |
+
<td style="background-color:#FFFFFF;">
|
323 |
+
<div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
|
324 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
325 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
326 |
+
'action' => 'spiderbigcalendar_day_widget',
|
327 |
+
'theme_id' => $theme_id,
|
328 |
+
'calendar' => $calendar_id,
|
329 |
+
'select' => $view_select,
|
330 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
331 |
+
'many_sp_calendar' => $many_sp_calendar,
|
332 |
+
'cat_id' => '',
|
333 |
+
'cat_ids' => $cat_ids,
|
334 |
+
'widget' => $widget,
|
335 |
+
'TB_iframe' => 1,
|
336 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Day', 'sp_calendar'); ?></span>
|
337 |
+
</div>
|
338 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
339 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
340 |
+
'action' => 'spiderbigcalendar_week_widget',
|
341 |
+
'theme_id' => $theme_id,
|
342 |
+
'calendar' => $calendar_id,
|
343 |
+
'select' => $view_select,
|
344 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
345 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
346 |
+
'many_sp_calendar' => $many_sp_calendar,
|
347 |
+
'cat_id' => '',
|
348 |
+
'cat_ids' => $cat_ids,
|
349 |
+
'widget' => $widget,
|
350 |
+
'TB_iframe' => 1,
|
351 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Week', 'sp_calendar'); ?></span>
|
352 |
+
</div>
|
353 |
+
<div class="views" style="margin-left: 3px;margin-right: 1px;<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;' ?>"
|
354 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
355 |
+
'action' => 'spiderbigcalendar_list_widget',
|
356 |
+
'theme_id' => $theme_id,
|
357 |
+
'calendar' => $calendar_id,
|
358 |
+
'select' => $view_select,
|
359 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
360 |
+
'many_sp_calendar' => $many_sp_calendar,
|
361 |
+
'cat_id' => '',
|
362 |
+
'cat_ids' => $cat_ids,
|
363 |
+
'widget' => $widget,
|
364 |
+
'TB_iframe' => 1,
|
365 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('List', 'sp_calendar'); ?></span>
|
366 |
+
</div>
|
367 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
368 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
369 |
+
'action' => 'spiderbigcalendar_month_widget',
|
370 |
+
'theme_id' => $theme_id,
|
371 |
+
'calendar' => $calendar_id,
|
372 |
+
'select' => $view_select,
|
373 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
374 |
+
'many_sp_calendar' => $many_sp_calendar,
|
375 |
+
'cat_id' => '',
|
376 |
+
'cat_ids' => $cat_ids,
|
377 |
+
'widget' => $widget,
|
378 |
+
'TB_iframe' => 1,
|
379 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
380 |
+
</div>
|
381 |
+
</div>
|
382 |
+
</td>
|
383 |
+
</tr>
|
384 |
+
<tr>
|
385 |
+
<td width="100%" style="padding:0; margin:0;">
|
386 |
+
<form action="" method="get" style="background:none; margin:0; padding:0;">
|
387 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>">
|
388 |
+
<tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
|
389 |
+
<td class="calbg" colspan="7" style="background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');margin:0; padding:0;background-repeat: no-repeat;background-size: 100% 100%;" >
|
390 |
+
<?php //MONTH TABLE ?>
|
391 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
|
392 |
+
<tr>
|
393 |
+
<td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
394 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
395 |
+
if (Month_num($month) == 1) {
|
396 |
+
$needed_date = ($year - 1) . '-12';
|
397 |
+
}
|
398 |
+
else {
|
399 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
400 |
+
}
|
401 |
+
echo add_query_arg(array(
|
402 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
403 |
+
'theme_id' => $theme_id,
|
404 |
+
'calendar' => $calendar_id,
|
405 |
+
'select' => $view_select,
|
406 |
+
'date' => $needed_date,
|
407 |
+
'many_sp_calendar' => $many_sp_calendar,
|
408 |
+
'cat_id' => '',
|
409 |
+
'cat_ids' => $cat_ids,
|
410 |
+
'widget' => $widget,
|
411 |
+
'TB_iframe' => 1,
|
412 |
+
), $site_url);
|
413 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-left"></div>
|
414 |
+
</a>
|
415 |
+
</td>
|
416 |
+
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
417 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
418 |
+
<span style="font-size:<?php echo $year_font_size; ?>px;?>; color:<?php echo $text_color_month; ?>;"><?php echo __($month, 'sp_calendar'); ?></span>
|
419 |
+
</td>
|
420 |
+
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
421 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
422 |
+
if (Month_num($month) == 12) {
|
423 |
+
$needed_date = ($year + 1) . '-01';
|
424 |
+
}
|
425 |
+
else {
|
426 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
427 |
+
}
|
428 |
+
echo add_query_arg(array(
|
429 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
430 |
+
'theme_id' => $theme_id,
|
431 |
+
'calendar' => $calendar_id,
|
432 |
+
'select' => $view_select,
|
433 |
+
'date' => $needed_date,
|
434 |
+
'many_sp_calendar' => $many_sp_calendar,
|
435 |
+
'cat_id' => '',
|
436 |
+
'cat_ids' => $cat_ids,
|
437 |
+
'widget' => $widget,
|
438 |
+
'TB_iframe' => 1,
|
439 |
+
), $site_url);
|
440 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-right"></div>
|
441 |
+
</a>
|
442 |
+
</td>
|
443 |
+
</tr>
|
444 |
+
</table>
|
445 |
+
</td>
|
446 |
+
</tr>
|
447 |
+
|
448 |
+
<tr>
|
449 |
+
<td colspan="7">
|
450 |
+
<?php
|
451 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
452 |
+
if ($weekstart == "su") {
|
453 |
+
$month_first_weekday++;
|
454 |
+
if ($month_first_weekday == 8) {
|
455 |
+
$month_first_weekday = 1;
|
456 |
+
}
|
457 |
+
}
|
458 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
459 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
460 |
+
$weekday_i = $month_first_weekday;
|
461 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
462 |
+
$percent = 1;
|
463 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
464 |
+
if ($sum % 7 <> 0) {
|
465 |
+
$percent = $percent + 1;
|
466 |
+
}
|
467 |
+
$sum = $sum - ($sum % 7);
|
468 |
+
$percent = $percent + ($sum / 7);
|
469 |
+
$percent = 107 / $percent;
|
470 |
+
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
471 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
472 |
+
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
473 |
+
$array_days = $all_calendar_files[0]['array_days'];
|
474 |
+
$array_days1 = $all_calendar_files[0]['array_days1'];
|
475 |
+
$title = $all_calendar_files[0]['title'];
|
476 |
+
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
477 |
+
sort($array_days, SORT_NUMERIC);
|
478 |
+
if (!$array_days) {
|
479 |
+
echo '<table style="height:14px;border-spacing:0;border-spacing:0;width: 100%;background-color:#D6D4D5 !important;">
|
480 |
+
<tr>
|
481 |
+
<td style="padding-left:10px; font-size:12px;font-weight:bold;width:10px;text-align:center;background-color:' . $bg . ' !important;color:#949394;"></td>
|
482 |
+
<td><p style="font-size:12px;color:' . $bg . '; border:none"> ' . __('There are no events for this month', 'sp_calendar') . '</p></td>
|
483 |
+
</tr>
|
484 |
+
</table>';
|
485 |
+
}
|
486 |
+
for ($i = 0; $i < count($array_days); $i++) {
|
487 |
+
$week_day = date('D', mktime(0, 0, 0, Month_num($month), $array_days[$i], $year));
|
488 |
+
if($array_days[$i]<=$month_days){
|
489 |
+
echo '<table style="width:100%; border-spacing:0;">
|
490 |
+
<tr>
|
491 |
+
<td style="height:14px;font-size:12px; padding-left:10px;background-color:#D6D4D5 !important; color:#6E7276">
|
492 |
+
<span style="padding-left:10px; font-size:12px;color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
|
493 |
+
<span style="font-size:12px;color:#949394;">(' . add_0($array_days[$i]) . ' ' . __($month,'sp_calendar') . ')</span>
|
494 |
+
</td>
|
495 |
+
</tr>
|
496 |
+
<tr>
|
497 |
+
<td>';
|
498 |
+
foreach ($title as $key => $value) {
|
499 |
+
if ($key == $array_days[$i]) {
|
500 |
+
$ev_id = explode('<br>', $ev_ids[$key]);
|
501 |
+
array_pop($ev_id);
|
502 |
+
$ev_ids_inline = implode(',', $ev_id);
|
503 |
+
$ev_title = explode('</p>', $value);
|
504 |
+
array_pop($ev_title);
|
505 |
+
for ($j = 0; $j < count($ev_title); $j++) {
|
506 |
+
$queryy = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
507 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
508 |
+
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d",$calendar,$ev_id[$j]);
|
509 |
+
|
510 |
+
$cat_color = $wpdb->get_row($queryy);
|
511 |
+
|
512 |
+
if (($j + 1) % 2 == 0) {
|
513 |
+
$color = $bg;
|
514 |
+
$table_color = $calendar_bg;
|
515 |
+
}
|
516 |
+
else {
|
517 |
+
$color = $bg;
|
518 |
+
$table_color = $calendar_bg;
|
519 |
+
}
|
520 |
+
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color=$bg;};
|
521 |
+
echo '<table class="last_table" style="overflow:hidden;height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
522 |
+
<tr>
|
523 |
+
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . str_replace('#','',$cat_color->color) . ' !important;color:' . $calendar_bg . '">' . ($j +1 ) . '</td>
|
524 |
+
<td>
|
525 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:13px;background:none;color:' . $ev_title_color . ';"
|
526 |
+
href="' . add_query_arg(array(
|
527 |
+
'action' => 'spidercalendarbig',
|
528 |
+
'theme_id' => $theme_id,
|
529 |
+
'calendar_id' => $calendar_id,
|
530 |
+
'ev_ids' => $ev_ids_inline,
|
531 |
+
'eventID' => $ev_id[$j],
|
532 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $array_days[$i],
|
533 |
+
'many_sp_calendar' => $many_sp_calendar,
|
534 |
+
'widget' => $widget,
|
535 |
+
'TB_iframe' => 1,
|
536 |
+
'tbWidth' => $popup_width,
|
537 |
+
'tbHeight' => $popup_height,
|
538 |
+
), $site_url) . '"><b>'.$ev_title[$j].'</b>
|
539 |
+
</a>
|
540 |
+
</td>
|
541 |
+
</tr>
|
542 |
+
</table>';
|
543 |
+
}
|
544 |
+
}
|
545 |
+
}
|
546 |
+
echo '</td></tr></table>';
|
547 |
+
}
|
548 |
+
}
|
549 |
+
?>
|
550 |
+
</td>
|
551 |
+
</tr>
|
552 |
+
<tr style="height:<?php echo $year_font_size + 2; ?>px; font-family: <?php echo $font_year; ?>;">
|
553 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
554 |
+
echo add_query_arg(array(
|
555 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
556 |
+
'theme_id' => $theme_id,
|
557 |
+
'calendar' => $calendar_id,
|
558 |
+
'select' => $view_select,
|
559 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
560 |
+
'many_sp_calendar' => $many_sp_calendar,
|
561 |
+
'widget' => $widget,
|
562 |
+
'cat_id' => '',
|
563 |
+
'cat_ids' => $cat_ids,
|
564 |
+
'TB_iframe' => 1,
|
565 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important">
|
566 |
+
<?php echo ($year - 1); ?>
|
567 |
+
</td>
|
568 |
+
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
569 |
+
<?php echo $year; ?>
|
570 |
+
</td>
|
571 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
572 |
+
echo add_query_arg(array(
|
573 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
574 |
+
'theme_id' => $theme_id,
|
575 |
+
'calendar' => $calendar_id,
|
576 |
+
'select' => $view_select,
|
577 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
578 |
+
'many_sp_calendar' => $many_sp_calendar,
|
579 |
+
'widget' => $widget,
|
580 |
+
'cat_id' => '',
|
581 |
+
'cat_ids' => $cat_ids,
|
582 |
+
'TB_iframe' => 1,
|
583 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important;color:<?php echo $year_font_color; ?>">
|
584 |
+
<?php echo ($year + 1); ?>
|
585 |
+
</td>
|
586 |
+
</tr>
|
587 |
+
</table>
|
588 |
+
<input type="text" value="1" name="day" style="display:none" />
|
589 |
+
</form>
|
590 |
+
</td>
|
591 |
+
</tr>
|
592 |
+
</table>
|
593 |
+
</div>
|
594 |
+
<style>
|
595 |
+
#calendar_<?php echo $many_sp_calendar; ?> table{
|
596 |
+
width: 100%;
|
597 |
+
}
|
598 |
+
.spider_categories_widget{
|
599 |
+
display:inline-block;
|
600 |
+
cursor:pointer;
|
601 |
+
}
|
602 |
+
|
603 |
+
.spider_categories_widget p{
|
604 |
+
color: #fff;
|
605 |
+
padding: 2px 10px !important;
|
606 |
+
margin: 2px 0 !important;
|
607 |
+
font-size: 13px;
|
608 |
+
}
|
609 |
+
</style>
|
610 |
+
<?php
|
611 |
+
|
612 |
+
//reindex cat_ids_array
|
613 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
614 |
+
|
615 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
616 |
+
{
|
617 |
+
echo'
|
618 |
+
<style>
|
619 |
+
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
620 |
+
{
|
621 |
+
text-decoration:underline;
|
622 |
+
cursor:pointer;
|
623 |
+
|
624 |
+
}
|
625 |
+
|
626 |
+
</style>';
|
627 |
+
|
628 |
+
}
|
629 |
+
|
630 |
+
|
631 |
+
|
632 |
+
if($cat_ids=='')
|
633 |
+
$cat_ids='';
|
634 |
+
if($show_cat){
|
635 |
+
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none; margin-top: 10px;">';
|
636 |
+
|
637 |
+
foreach($categories as $category)
|
638 |
+
{
|
639 |
+
|
640 |
+
?>
|
641 |
+
|
642 |
+
<li class="spider_categories_widget"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
643 |
+
'action' => 'spiderbigcalendar_list_widget',
|
644 |
+
'theme_id' => $theme_id,
|
645 |
+
'calendar' => $calendar_id,
|
646 |
+
'select' => $view_select,
|
647 |
+
'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
|
648 |
+
'many_sp_calendar' => $many_sp_calendar,
|
649 |
+
'cat_id' => $category->id,
|
650 |
+
'cat_ids' => $cat_ids,
|
651 |
+
'widget' => $widget,
|
652 |
+
'TB_iframe' => 1,
|
653 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
654 |
+
|
655 |
+
|
656 |
+
<?php
|
657 |
+
}
|
658 |
+
if (!empty($categories)) {
|
659 |
+
?>
|
660 |
+
<li class="spider_categories_widget"><p class="categories2" id="category0" style="background-color:#<?php echo str_replace('#','',$bg); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
661 |
+
'action' => 'spiderbigcalendar_list_widget',
|
662 |
+
'theme_id' => $theme_id,
|
663 |
+
'calendar' => $calendar_id,
|
664 |
+
'select' => $view_select,
|
665 |
+
'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
|
666 |
+
'many_sp_calendar' => $many_sp_calendar,
|
667 |
+
'cat_id' => '',
|
668 |
+
'cat_ids' => '',
|
669 |
+
'widget' => $widget,
|
670 |
+
'TB_iframe' => 1,
|
671 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
672 |
+
<?php echo '</ul>';
|
673 |
+
}
|
674 |
+
} ?>
|
675 |
+
</body>
|
676 |
+
</html>
|
677 |
+
<?php
|
678 |
+
die();
|
679 |
+
}
|
680 |
+
|
681 |
?>
|
front_end/bigcalendarmonth.php
CHANGED
@@ -1,1420 +1,1420 @@
|
|
1 |
-
<?php
|
2 |
-
function big_calendar_month() {
|
3 |
-
require_once("frontend_functions.php");
|
4 |
-
global $wpdb;
|
5 |
-
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
-
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
-
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
-
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 30);
|
9 |
-
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
10 |
-
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
11 |
-
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
12 |
-
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
13 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where id=".$calendar_id."";
|
14 |
-
$calendar = $wpdb->query($query);
|
15 |
-
$site_url = get_admin_url().'admin-ajax.php';
|
16 |
-
|
17 |
-
///////////////////////////////////////////////////////////////////////////////////
|
18 |
-
|
19 |
-
|
20 |
-
if($cat_ids=='')
|
21 |
-
$cat_ids .= $cat_id.',';
|
22 |
-
else
|
23 |
-
$cat_ids .= ','.$cat_id.',';
|
24 |
-
|
25 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
26 |
-
|
27 |
-
|
28 |
-
function getelementcountinarray($array , $element)
|
29 |
-
{
|
30 |
-
$t=0;
|
31 |
-
|
32 |
-
for($i=0; $i<count($array); $i++)
|
33 |
-
{
|
34 |
-
if($element==$array[$i])
|
35 |
-
$t++;
|
36 |
-
|
37 |
-
}
|
38 |
-
|
39 |
-
|
40 |
-
return $t;
|
41 |
-
|
42 |
-
}
|
43 |
-
|
44 |
-
function getelementindexinarray($array , $element)
|
45 |
-
{
|
46 |
-
|
47 |
-
$t='';
|
48 |
-
|
49 |
-
for($i=0; $i<count($array); $i++)
|
50 |
-
{
|
51 |
-
if($element==$array[$i])
|
52 |
-
$t.=$i.',';
|
53 |
-
|
54 |
-
}
|
55 |
-
|
56 |
-
return $t;
|
57 |
-
|
58 |
-
|
59 |
-
}
|
60 |
-
$cat_ids_array = explode(',',$cat_ids);
|
61 |
-
|
62 |
-
|
63 |
-
if($cat_id!='')
|
64 |
-
{
|
65 |
-
|
66 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
67 |
-
{
|
68 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
69 |
-
$index_array = explode(',' , $index_in_line);
|
70 |
-
array_pop ($index_array);
|
71 |
-
for($j=0; $j<count($index_array); $j++)
|
72 |
-
unset($cat_ids_array[$index_array[$j]]);
|
73 |
-
$cat_ids = implode(',',$cat_ids_array);
|
74 |
-
}
|
75 |
-
}
|
76 |
-
else
|
77 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
78 |
-
|
79 |
-
|
80 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
81 |
-
|
82 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
83 |
-
$themes = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme');
|
84 |
-
$theme_name = $theme->title;
|
85 |
-
$cal_width = $theme->width;
|
86 |
-
$bg_top = '#' . str_replace('#','',$theme->bg_top);
|
87 |
-
$bg_bottom = '#' . str_replace('#','',$theme->bg_bottom);
|
88 |
-
$border_color = '#' . str_replace('#','',$theme->border_color);
|
89 |
-
$text_color_year = '#' . str_replace('#','',$theme->text_color_year);
|
90 |
-
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
91 |
-
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
92 |
-
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
93 |
-
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
94 |
-
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
95 |
-
$evented_color_bg = (isset($theme->bg_color_this_month_evented) ?'#' . str_replace('#','',$theme->bg_color_this_month_evented) : '');
|
96 |
-
$color_arrow_year = '#' . str_replace('#','',$theme->arrow_color_year);
|
97 |
-
$color_arrow_month = '#' . str_replace('#','',$theme->arrow_color_month);
|
98 |
-
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
99 |
-
$event_title_color = '#' . str_replace('#','',$theme->event_title_color);
|
100 |
-
$current_day_border_color = '#' . str_replace('#','',$theme->current_day_border_color);
|
101 |
-
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
102 |
-
$cell_height = $theme->cell_height;
|
103 |
-
$popup_width = $theme->popup_width;
|
104 |
-
$popup_height = $theme->popup_height;
|
105 |
-
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
106 |
-
$sundays_font_size = $theme->sundays_font_size;
|
107 |
-
$other_days_font_size = $theme->other_days_font_size;
|
108 |
-
$weekdays_font_size = $theme->weekdays_font_size;
|
109 |
-
$border_width = $theme->border_width;
|
110 |
-
$top_height = $theme->top_height;
|
111 |
-
$bg_color_other_months = '#' . str_replace('#','',$theme->bg_color_other_months);
|
112 |
-
$sundays_bg_color = '#' . str_replace('#','',$theme->sundays_bg_color);
|
113 |
-
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
114 |
-
$weekstart = $theme->week_start_day;
|
115 |
-
$weekday_sunday_bg_color = '#' . str_replace('#','',$theme->weekday_sunday_bg_color);
|
116 |
-
$border_radius = $theme->border_radius;
|
117 |
-
$border_radius2 = $border_radius-$border_width;
|
118 |
-
$week_days_cell_height = $theme->week_days_cell_height;
|
119 |
-
$year_font_size = $theme->year_font_size;
|
120 |
-
$month_font_size = $theme->month_font_size;
|
121 |
-
$arrow_size = $theme->arrow_size;
|
122 |
-
$arrow_size_hover = $arrow_size + 5;
|
123 |
-
$next_month_text_color = '#' . str_replace('#','',$theme->next_month_text_color);
|
124 |
-
$prev_month_text_color = '#' . str_replace('#','',$theme->prev_month_text_color);
|
125 |
-
$next_month_arrow_color = '#' . str_replace('#','',$theme->next_month_arrow_color);
|
126 |
-
$prev_month_arrow_color = '#' . str_replace('#','',$theme->prev_month_arrow_color);
|
127 |
-
$next_month_font_size = $theme->next_month_font_size;
|
128 |
-
$prev_month_font_size = $theme->prev_month_font_size;
|
129 |
-
$month_type = $theme->month_type;
|
130 |
-
$header_format = (isset($theme->header_format) ? $theme->header_format : 'w/d/m/y');
|
131 |
-
$ev_title_bg_color = '#' . str_replace('#','',$theme->ev_title_bg_color);
|
132 |
-
|
133 |
-
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
134 |
-
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
135 |
-
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
136 |
-
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
137 |
-
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
138 |
-
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
139 |
-
$date_font_size = $theme->date_font_size;
|
140 |
-
$event_num_font_size = $theme->event_num_font_size;
|
141 |
-
$event_table_height = $theme->event_table_height;
|
142 |
-
$date_height = $theme->date_height;
|
143 |
-
$day_month_font_size = $theme->day_month_font_size;
|
144 |
-
$week_font_size = $theme->week_font_size;
|
145 |
-
$day_month_font_color = '#' . str_replace('#','',$theme->day_month_font_color);
|
146 |
-
$week_font_color = '#' . str_replace('#','',$theme->week_font_color);
|
147 |
-
$views_tabs_bg_color = '#' . str_replace('#','',$theme->views_tabs_bg_color);
|
148 |
-
$views_tabs_text_color = '#' . str_replace('#','',$theme->views_tabs_text_color);
|
149 |
-
$views_tabs_font_size = $theme->views_tabs_font_size;
|
150 |
-
$show_numbers_for_events = $theme->number_of_shown_evetns;
|
151 |
-
$show_cat = $theme->show_cat;
|
152 |
-
$text_color_year = '#' . str_replace('#','',$theme->text_color_year);
|
153 |
-
$ev_color = '#' . str_replace('#','',$theme->event_title_color);
|
154 |
-
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
155 |
-
|
156 |
-
|
157 |
-
$themes_titles = array('1' => 'Wasabi', '2' => 'Bluejay and Orange', '3' => 'White and Blue', '4' => 'Dark', '5' => 'Red and Olive', '6' => 'Blue and Bisque', '7' => 'White and OliveDrab', '8' => 'DarkCyan and Violet', '9' => 'SteelBlue', '10' => 'PaleGreen', '11' => 'Gold and Brown', '13' => 'Shiny Blue', '12' => 'Shiny Red', '14' => 'Shiny Green', '17' => 'Shiny Orange', '18' => 'Shiny Pink', '19' => 'Shiny Purple');
|
158 |
-
|
159 |
-
if (isset($themes_titles[$theme_id]) && $themes_titles[$theme_id] == $theme_name && count($themes)>13) {
|
160 |
-
$date_bgcolor = "transparent";
|
161 |
-
$years_bgcolor = "background-color: #000000; filter: alpha(opacity=30); opacity: 0.3;";
|
162 |
-
}
|
163 |
-
else {
|
164 |
-
$date_bgcolor = $cell_border_color;
|
165 |
-
$years_bgcolor = "background-color: ".hex_to_rgb($views_tabs_bg_color, 0.4).";";
|
166 |
-
}
|
167 |
-
|
168 |
-
__('January', 'sp_calendar');
|
169 |
-
__('February', 'sp_calendar');
|
170 |
-
__('March', 'sp_calendar');
|
171 |
-
__('April', 'sp_calendar');
|
172 |
-
__('May', 'sp_calendar');
|
173 |
-
__('June', 'sp_calendar');
|
174 |
-
__('July', 'sp_calendar');
|
175 |
-
__('August', 'sp_calendar');
|
176 |
-
__('September', 'sp_calendar');
|
177 |
-
__('October', 'sp_calendar');
|
178 |
-
__('November', 'sp_calendar');
|
179 |
-
__('December', 'sp_calendar');
|
180 |
-
if ($cell_height == '') {
|
181 |
-
$cell_height = 70;
|
182 |
-
}
|
183 |
-
if ($cal_width == '') {
|
184 |
-
$cal_width = 700;
|
185 |
-
}
|
186 |
-
if ($date != '') {
|
187 |
-
$date_REFERER = $date;
|
188 |
-
}
|
189 |
-
else {
|
190 |
-
$date_REFERER = date("Y-m");
|
191 |
-
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
192 |
-
}
|
193 |
-
|
194 |
-
$year_REFERER = substr($date_REFERER, 0, 4);
|
195 |
-
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
196 |
-
$day_REFERER = substr($date_REFERER, 8, 2);
|
197 |
-
|
198 |
-
$year = substr($date, 0, 4);
|
199 |
-
$month = Month_name(substr($date, 5, 2));
|
200 |
-
$day = substr($date, 8, 2);
|
201 |
-
$cell_width = $cal_width / 7;
|
202 |
-
$cell_width = (int) $cell_width - 2;
|
203 |
-
|
204 |
-
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
205 |
-
$prev_month = add_0((int) $this_month - 1);
|
206 |
-
$next_month = add_0((int) $this_month + 1);
|
207 |
-
$activedatestr = "";
|
208 |
-
|
209 |
-
$date_format_array = explode('/', $header_format);
|
210 |
-
for ($i = 0; $i < 4; $i++) {
|
211 |
-
if (isset($date_format_array[$i]) && ($date_format_array[$i] == 'd' || $date_format_array[$i] == 'w')) {
|
212 |
-
unset($date_format_array[$i]);
|
213 |
-
}
|
214 |
-
if (isset($date_format_array[$i]) && $date_format_array[$i] == 'm') $date_format_array[$i] = 'F';
|
215 |
-
if (isset($date_format_array[$i]) && $date_format_array[$i] == 'y') $date_format_array[$i] = 'Y';
|
216 |
-
}
|
217 |
-
$header_date_format = implode(' ', $date_format_array);
|
218 |
-
$name_year = date($header_date_format, strtotime($date));
|
219 |
-
$exp_name_year = explode(' ', $name_year);
|
220 |
-
for($j = 0; $j < count($exp_name_year); $j++){
|
221 |
-
$activedatestr .= __($exp_name_year[$j], 'sp_calendar') . ' ';
|
222 |
-
}
|
223 |
-
|
224 |
-
$view = 'bigcalendarmonth';
|
225 |
-
$views = explode(',', $view_select);
|
226 |
-
$defaultview = 'month';
|
227 |
-
array_pop($views);
|
228 |
-
|
229 |
-
$display='';
|
230 |
-
|
231 |
-
if(count($views)==0)
|
232 |
-
{
|
233 |
-
$display="display:none";
|
234 |
-
echo '<style>
|
235 |
-
@media only screen and (max-width : 640px) {
|
236 |
-
|
237 |
-
#views_tabs_select
|
238 |
-
{
|
239 |
-
display:none !important;
|
240 |
-
}
|
241 |
-
}
|
242 |
-
|
243 |
-
</style>';
|
244 |
-
}
|
245 |
-
if(count($views)==1 and $views[0]==$defaultview)
|
246 |
-
{
|
247 |
-
$display="display:none";
|
248 |
-
echo '<style>
|
249 |
-
@media only screen and (max-width : 640px) {
|
250 |
-
|
251 |
-
#views_tabs_select
|
252 |
-
{
|
253 |
-
display:none !important;
|
254 |
-
}
|
255 |
-
}
|
256 |
-
|
257 |
-
</style>';
|
258 |
-
}
|
259 |
-
?>
|
260 |
-
<html>
|
261 |
-
<head>
|
262 |
-
<style type='text/css'>
|
263 |
-
#afterbig<?php echo $many_sp_calendar; ?> table,
|
264 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
265 |
-
font-family: Segoe UI;
|
266 |
-
border: 0;
|
267 |
-
}
|
268 |
-
|
269 |
-
#afterbig<?php echo $many_sp_calendar; ?> table,
|
270 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
271 |
-
|
272 |
-
}
|
273 |
-
|
274 |
-
#TB_iframeContent{
|
275 |
-
background-color: <?php echo $show_event_bgcolor; ?>;
|
276 |
-
}
|
277 |
-
|
278 |
-
#TB_window {
|
279 |
-
z-index: 10000;
|
280 |
-
}
|
281 |
-
#afterbig<?php echo $many_sp_calendar; ?> .calyear_table td,
|
282 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table td {
|
283 |
-
vertical-align: middle !important;
|
284 |
-
}
|
285 |
-
|
286 |
-
#afterbig<?php echo $many_sp_calendar; ?> table td,
|
287 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
288 |
-
padding: 0px;
|
289 |
-
vertical-align: none;
|
290 |
-
border-bottom:none;
|
291 |
-
line-height: none;
|
292 |
-
text-align: none;
|
293 |
-
background: transparent;
|
294 |
-
}
|
295 |
-
|
296 |
-
#afterbig<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address,
|
297 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
298 |
-
margin-bottom:0;
|
299 |
-
}
|
300 |
-
#afterbig<?php echo $many_sp_calendar; ?> td,
|
301 |
-
#afterbig<?php echo $many_sp_calendar; ?> tr,
|
302 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
303 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
304 |
-
#spiderCalendarTitlesList td,
|
305 |
-
#spiderCalendarTitlesList tr {
|
306 |
-
border:none;
|
307 |
-
}
|
308 |
-
#afterbig<?php echo $many_sp_calendar; ?> .arrow-left,
|
309 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-left {
|
310 |
-
width: 0px;
|
311 |
-
height: 0px;
|
312 |
-
border-bottom: 15px solid transparent;
|
313 |
-
border-bottom: 15px solid transparent;
|
314 |
-
border-right: 20px solid;
|
315 |
-
margin: 0 auto;
|
316 |
-
}
|
317 |
-
|
318 |
-
#afterbig<?php echo $many_sp_calendar; ?> .arrow-right,
|
319 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-right {
|
320 |
-
width: 0px;
|
321 |
-
height: 0px;
|
322 |
-
border-bottom: 15px solid transparent;
|
323 |
-
border-bottom: 15px solid transparent;
|
324 |
-
border-left: 20px solid;
|
325 |
-
margin: 0 auto;
|
326 |
-
}
|
327 |
-
|
328 |
-
#bigcalendar<?php echo $many_sp_calendar ?> .cala_arrow a:hover {
|
329 |
-
text-decoration: none !important;
|
330 |
-
background: none !important;
|
331 |
-
}
|
332 |
-
|
333 |
-
#afterbig<?php echo $many_sp_calendar; ?> #views_select .arrow-right,
|
334 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-right{
|
335 |
-
border-bottom: 5px solid transparent;
|
336 |
-
border-bottom: 5px solid transparent;
|
337 |
-
border-left: 8px solid;
|
338 |
-
left: 5px;
|
339 |
-
position: relative;
|
340 |
-
}
|
341 |
-
#afterbig<?php echo $many_sp_calendar; ?> #views_select .arrow-down,
|
342 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-down{
|
343 |
-
width: 0px;
|
344 |
-
height: 0px;
|
345 |
-
border-left: 5px solid transparent;
|
346 |
-
border-right: 5px solid transparent;
|
347 |
-
border-bottom: 8px solid;
|
348 |
-
}
|
349 |
-
|
350 |
-
#afterbig<?php echo $many_sp_calendar; ?> .general_table
|
351 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
352 |
-
border-radius: <?php echo $border_radius; ?>px;
|
353 |
-
}
|
354 |
-
#afterbig<?php echo $many_sp_calendar; ?> .top_table,
|
355 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
356 |
-
border-bottom-left-radius: <?php echo $border_radius2; ?>px;
|
357 |
-
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
358 |
-
}
|
359 |
-
|
360 |
-
#afterbig<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:first-child,
|
361 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:first-child{
|
362 |
-
border-bottom-left-radius: <?php echo $border_radius2; ?>px;
|
363 |
-
}
|
364 |
-
|
365 |
-
#afterbig<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:last-child,
|
366 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:last-child{
|
367 |
-
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
368 |
-
}
|
369 |
-
|
370 |
-
#afterbig<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
371 |
-
#afterbig<?php echo $many_sp_calendar; ?> .cala_arrow a:visited,
|
372 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
373 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
374 |
-
text-decoration:none !important;
|
375 |
-
box-shadow: none !important;
|
376 |
-
background:none;
|
377 |
-
font-size: <?php echo $arrow_size; ?>px;
|
378 |
-
border: 0 !important;
|
379 |
-
box-shadow: none;
|
380 |
-
}
|
381 |
-
#afterbig<?php echo $many_sp_calendar; ?> .cala_arrow a:hover,
|
382 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
383 |
-
text-decoration:none;
|
384 |
-
background:none;
|
385 |
-
}
|
386 |
-
#afterbig<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
387 |
-
#afterbig<?php echo $many_sp_calendar; ?> .cala_day a:visited,
|
388 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
389 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
390 |
-
text-decoration:none;
|
391 |
-
background:none;
|
392 |
-
font-size:12px;
|
393 |
-
box-shadow: none;
|
394 |
-
}
|
395 |
-
#afterbig<?php echo $many_sp_calendar; ?> .cala_day a:hover,
|
396 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
397 |
-
text-decoration:none;
|
398 |
-
background:none;
|
399 |
-
}
|
400 |
-
#afterbig<?php echo $many_sp_calendar; ?> .cala_day,
|
401 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
402 |
-
border-bottom:1px solid <?php echo $cell_border_color; ?> !important;
|
403 |
-
border-left:1px solid <?php echo $cell_border_color; ?> !important;
|
404 |
-
vertical-align:top;
|
405 |
-
}
|
406 |
-
#afterbig<?php echo $many_sp_calendar; ?> .weekdays,
|
407 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
408 |
-
border-bottom: 1px solid <?php echo $cell_border_color; ?> !important;
|
409 |
-
border-left: 1px solid <?php echo $cell_border_color; ?> !important;
|
410 |
-
vertical-align: middle;
|
411 |
-
}
|
412 |
-
#afterbig<?php echo $many_sp_calendar; ?> .week_days,
|
413 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
414 |
-
font-size:<?php echo $weekdays_font_size; ?>px;
|
415 |
-
font-weight: 600;
|
416 |
-
}
|
417 |
-
#afterbig<?php echo $many_sp_calendar; ?> .calyear_table,
|
418 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
419 |
-
border-spacing:0;
|
420 |
-
width:100%;
|
421 |
-
}
|
422 |
-
#afterbig<?php echo $many_sp_calendar; ?> .calmonth_table,
|
423 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
424 |
-
border-spacing:0;
|
425 |
-
width:100%;
|
426 |
-
}
|
427 |
-
#afterbig<?php echo $many_sp_calendar; ?> .calbg,
|
428 |
-
#afterbig<?php echo $many_sp_calendar; ?> .calbg td,
|
429 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
430 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
|
431 |
-
text-align:center;
|
432 |
-
width:14%;
|
433 |
-
}
|
434 |
-
#afterbig<?php echo $many_sp_calendar; ?> .caltext_color_other_months,
|
435 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
436 |
-
color:<?php echo $text_color_other_months; ?>;
|
437 |
-
border-bottom:1px solid <?php echo $cell_border_color; ?> !important;
|
438 |
-
border-left:1px solid <?php echo $cell_border_color; ?> !important;
|
439 |
-
vertical-align:top;
|
440 |
-
}
|
441 |
-
#afterbig<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented,
|
442 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
443 |
-
color:<?php echo $text_color_this_month_unevented; ?>;
|
444 |
-
}
|
445 |
-
#afterbig<?php echo $many_sp_calendar; ?> .calfont_year,
|
446 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
447 |
-
font-size:24px;
|
448 |
-
font-weight:bold;
|
449 |
-
color:<?php echo $text_color_year; ?>;
|
450 |
-
}
|
451 |
-
#afterbig<?php echo $many_sp_calendar; ?> .calsun_days,
|
452 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
453 |
-
color:<?php echo $sun_days; ?>;
|
454 |
-
border-bottom:1px solid <?php echo $cell_border_color; ?> !important;
|
455 |
-
border-left:1px solid <?php echo $cell_border_color; ?> !important;
|
456 |
-
vertical-align:top;
|
457 |
-
text-align:left;
|
458 |
-
background-color: <?php echo $sundays_bg_color; ?> !important;
|
459 |
-
font-weight: 600;
|
460 |
-
}
|
461 |
-
#afterbig<?php echo $many_sp_calendar; ?> .views,
|
462 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
463 |
-
float: right;
|
464 |
-
background-color: <?php echo $views_tabs_bg_color; ?> !important;
|
465 |
-
min-height: 25px;
|
466 |
-
min-width: 70px;
|
467 |
-
margin-left: 2px;
|
468 |
-
text-align: center;
|
469 |
-
cursor:pointer;
|
470 |
-
position: relative;
|
471 |
-
top: 5px;
|
472 |
-
}
|
473 |
-
|
474 |
-
#afterbig<?php echo $many_sp_calendar; ?> .views span,
|
475 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
476 |
-
line-height: 30px;
|
477 |
-
}
|
478 |
-
|
479 |
-
#afterbig<?php echo $many_sp_calendar; ?> .views_select ,
|
480 |
-
#afterbig<?php echo $many_sp_calendar; ?> #views_select,
|
481 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
482 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
483 |
-
{
|
484 |
-
background-color: <?php echo $views_tabs_bg_color ?> !important;
|
485 |
-
width: 120px;
|
486 |
-
text-align: center;
|
487 |
-
cursor: pointer;
|
488 |
-
padding: 6px;
|
489 |
-
position: relative;
|
490 |
-
}
|
491 |
-
|
492 |
-
#afterbig<?php echo $many_sp_calendar; ?> #views_select,
|
493 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
494 |
-
{
|
495 |
-
min-height: 30px;
|
496 |
-
}
|
497 |
-
|
498 |
-
#drop_down_views
|
499 |
-
{
|
500 |
-
list-style-type:none !important;
|
501 |
-
display:none;
|
502 |
-
z-index: 4545;
|
503 |
-
position: absolute;
|
504 |
-
left: 0 !important;
|
505 |
-
margin-left: 0;
|
506 |
-
}
|
507 |
-
|
508 |
-
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
509 |
-
{
|
510 |
-
background:<?php echo $bg_top ?> !important;
|
511 |
-
}
|
512 |
-
|
513 |
-
#drop_down_views >li
|
514 |
-
{
|
515 |
-
border-bottom:1px solid #fff !important;
|
516 |
-
}
|
517 |
-
|
518 |
-
|
519 |
-
#views_tabs_select
|
520 |
-
{
|
521 |
-
display:none;
|
522 |
-
}
|
523 |
-
#cal_event p{
|
524 |
-
color:<?php echo $ev_color;?>;
|
525 |
-
line-height: 15px;
|
526 |
-
}
|
527 |
-
|
528 |
-
.general_table table tr > td:last-child{
|
529 |
-
border-right: 1px solid <?php echo $cell_border_color; ?> !important;
|
530 |
-
}
|
531 |
-
</style>
|
532 |
-
</head>
|
533 |
-
<body>
|
534 |
-
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
535 |
-
<div style="width:100%;">
|
536 |
-
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
537 |
-
<tr>
|
538 |
-
<td>
|
539 |
-
<div id="views_tabs" style="<?php echo $display ?>;width: 100%;">
|
540 |
-
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ' !important;top:0;' ?>"
|
541 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
542 |
-
'action' => 'spiderbigcalendar_day',
|
543 |
-
'theme_id' => $theme_id,
|
544 |
-
'calendar' => $calendar_id,
|
545 |
-
'select' => $view_select,
|
546 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
547 |
-
'many_sp_calendar' => $many_sp_calendar,
|
548 |
-
'cat_id' => '',
|
549 |
-
'cat_ids' => $cat_ids,
|
550 |
-
'widget' => $widget,
|
551 |
-
'rand' => $many_sp_calendar,
|
552 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Day', 'sp_calendar'); ?></span>
|
553 |
-
</div>
|
554 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ' !important;top:0;' ?>"
|
555 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
556 |
-
'action' => 'spiderbigcalendar_week',
|
557 |
-
'theme_id' => $theme_id,
|
558 |
-
'calendar' => $calendar_id,
|
559 |
-
'select' => $view_select,
|
560 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
561 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
562 |
-
'many_sp_calendar' => $many_sp_calendar,
|
563 |
-
'cat_id' => '',
|
564 |
-
'cat_ids' => $cat_ids,
|
565 |
-
'widget' => $widget,
|
566 |
-
'rand' => $many_sp_calendar,
|
567 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Week', 'sp_calendar'); ?></span>
|
568 |
-
</div>
|
569 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ' !important;top:0;' ?>"
|
570 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
571 |
-
'action' => 'spiderbigcalendar_list',
|
572 |
-
'theme_id' => $theme_id,
|
573 |
-
'calendar' => $calendar_id,
|
574 |
-
'select' => $view_select,
|
575 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
576 |
-
'many_sp_calendar' => $many_sp_calendar,
|
577 |
-
'cat_id' => '',
|
578 |
-
'cat_ids' => $cat_ids,
|
579 |
-
'widget' => $widget,
|
580 |
-
'rand' => $many_sp_calendar,
|
581 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('List', 'sp_calendar'); ?></span>
|
582 |
-
</div>
|
583 |
-
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
584 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
585 |
-
'action' => 'spiderbigcalendar_month',
|
586 |
-
'theme_id' => $theme_id,
|
587 |
-
'calendar' => $calendar_id,
|
588 |
-
'select' => $view_select,
|
589 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
590 |
-
'many_sp_calendar' => $many_sp_calendar,
|
591 |
-
'cat_id' => '',
|
592 |
-
'cat_ids' => $cat_ids,
|
593 |
-
'widget' => $widget,
|
594 |
-
'rand' => $many_sp_calendar,
|
595 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Month', 'sp_calendar'); ?></span>
|
596 |
-
</div>
|
597 |
-
</div>
|
598 |
-
|
599 |
-
<div id="views_tabs_select" style="display:none" >
|
600 |
-
<div id="views_select" style="background-color:<?php echo $bg_top?> !important;color:<?php echo $views_tabs_text_color ?> !important;font-size:<?php echo $views_tabs_font_size ?>px">
|
601 |
-
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
602 |
-
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
603 |
-
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
604 |
-
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
605 |
-
<div class="arrow-right show_arrow"></div>
|
606 |
-
<div class="arrow-down"></div>
|
607 |
-
</div>
|
608 |
-
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
609 |
-
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
610 |
-
<div class="views_select"
|
611 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
612 |
-
'action' => 'spiderbigcalendar_day',
|
613 |
-
'theme_id' => $theme_id,
|
614 |
-
'calendar' => $calendar_id,
|
615 |
-
'select' => $view_select,
|
616 |
-
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
617 |
-
'many_sp_calendar' => $many_sp_calendar,
|
618 |
-
'cat_id' => '',
|
619 |
-
'cat_ids' => $cat_ids,
|
620 |
-
'widget' => $widget,
|
621 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
622 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
623 |
-
</div>
|
624 |
-
</li>
|
625 |
-
|
626 |
-
<li <?php if($view=='bigcalendarweek'):?> class="active" <?php endif; ?> style="<?php if(!in_array('week',$views) AND $defaultview!='week' ) echo 'display:none;' ; ?>" ><div class="views_select"
|
627 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
628 |
-
'action' => 'spiderbigcalendar_week',
|
629 |
-
'theme_id' => $theme_id,
|
630 |
-
'calendar' => $calendar_id,
|
631 |
-
'select' => $view_select,
|
632 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
633 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
634 |
-
'many_sp_calendar' => $many_sp_calendar,
|
635 |
-
'cat_id' => '',
|
636 |
-
'cat_ids' => $cat_ids,
|
637 |
-
'widget' => $widget,
|
638 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
639 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
640 |
-
</div>
|
641 |
-
</li>
|
642 |
-
|
643 |
-
<li <?php if($view=='bigcalendarlist'):?> class="active" <?php endif; ?> style="<?php if(!in_array('list',$views) AND $defaultview!='list' ) echo 'display:none;' ;?>"><div class="views_select"
|
644 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
645 |
-
'action' => 'spiderbigcalendar_list',
|
646 |
-
'theme_id' => $theme_id,
|
647 |
-
'calendar' => $calendar_id,
|
648 |
-
'select' => $view_select,
|
649 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
650 |
-
'many_sp_calendar' => $many_sp_calendar,
|
651 |
-
'cat_id' => '',
|
652 |
-
'cat_ids' => $cat_ids,
|
653 |
-
'widget' => $widget,
|
654 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
655 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
656 |
-
</div>
|
657 |
-
</li>
|
658 |
-
|
659 |
-
<li <?php if($view=='bigcalendarmonth'):?> class="active" <?php endif; ?> style="<?php if(!in_array('month',$views) AND $defaultview!='month' ) echo 'display:none;'; ?>"><div class="views_select"
|
660 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
661 |
-
'action' => 'spiderbigcalendar_month',
|
662 |
-
'theme_id' => $theme_id,
|
663 |
-
'calendar' => $calendar_id,
|
664 |
-
'select' => $view_select,
|
665 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
666 |
-
'many_sp_calendar' => $many_sp_calendar,
|
667 |
-
'cat_id' => '',
|
668 |
-
'cat_ids' => $cat_ids,
|
669 |
-
'widget' => $widget,
|
670 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
671 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Month</span></div></li>
|
672 |
-
|
673 |
-
</ul>
|
674 |
-
</div>
|
675 |
-
</td>
|
676 |
-
</tr>
|
677 |
-
<tr>
|
678 |
-
<td>
|
679 |
-
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width:100%;border:<?php echo $border_color; ?> solid <?php echo $border_width; ?>px; margin:0; padding:0;background-color:<?php echo $bg_bottom; ?> !important;">
|
680 |
-
<tr>
|
681 |
-
<td width="100%" style="padding:0; margin:0;">
|
682 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;">
|
683 |
-
<tr style="height:40px; width:100%;">
|
684 |
-
<td class="top_table" align="center" colspan="7" style="position: relative;padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%; border: 0 !important;">
|
685 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width:100%; height:<?php echo $top_height; ?>px;">
|
686 |
-
<tr>
|
687 |
-
<td width="10%">
|
688 |
-
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
689 |
-
echo add_query_arg(array(
|
690 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
691 |
-
'theme_id' => $theme_id,
|
692 |
-
'calendar' => $calendar_id,
|
693 |
-
'select' => $view_select,
|
694 |
-
'date' => ($year - 1) . '-' . add_0(Month_num($month)),
|
695 |
-
'many_sp_calendar' => $many_sp_calendar,
|
696 |
-
'cat_id' => '',
|
697 |
-
'cat_ids' => $cat_ids,
|
698 |
-
'widget' => $widget,
|
699 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; <?php echo $years_bgcolor; ?>;">
|
700 |
-
<span style="font-size:18px;color:#FFF"><?php echo $year - 1; ?></span>
|
701 |
-
</div>
|
702 |
-
</td>
|
703 |
-
<td class="cala_arrow" width="11%" style="text-align:right;margin:0px; padding: 0px 30px 0px 0px;">
|
704 |
-
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>;" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
705 |
-
if (Month_num($month) == 1) {
|
706 |
-
$needed_date = ($year - 1) . '-12';
|
707 |
-
}
|
708 |
-
else {
|
709 |
-
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
710 |
-
}
|
711 |
-
echo add_query_arg(array(
|
712 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
713 |
-
'theme_id' => $theme_id,
|
714 |
-
'calendar' => $calendar_id,
|
715 |
-
'select' => $view_select,
|
716 |
-
'date' => $needed_date,
|
717 |
-
'many_sp_calendar' => $many_sp_calendar,
|
718 |
-
'cat_id' => '',
|
719 |
-
'cat_ids' => $cat_ids,
|
720 |
-
'widget' => $widget,
|
721 |
-
), $site_url);
|
722 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❰
|
723 |
-
</a>
|
724 |
-
</td>
|
725 |
-
<td style="text-align:center; margin:0;" width="10%">
|
726 |
-
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
727 |
-
<span style="line-height: 30px;font-family: Segoe UI; color:<?php echo $text_color_month; ?>; font-size:<?php echo $month_font_size; ?>px;text-shadow: 1px 1px black;"><?php echo $activedatestr; ?></span>
|
728 |
-
</td>
|
729 |
-
<td style="margin:0; padding: 0px 0px 0px 30px;text-align:left" width="11%" class="cala_arrow">
|
730 |
-
<a style="text-shadow: 1px 1px 2px black; color:<?php echo $color_arrow_month; ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
731 |
-
if (Month_num($month) == 12) {
|
732 |
-
$needed_date = ($year + 1) . '-01';
|
733 |
-
}
|
734 |
-
else {
|
735 |
-
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
736 |
-
}
|
737 |
-
echo add_query_arg(array(
|
738 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
739 |
-
'theme_id' => $theme_id,
|
740 |
-
'calendar' => $calendar_id,
|
741 |
-
'select' => $view_select,
|
742 |
-
'date' => $needed_date,
|
743 |
-
'many_sp_calendar' => $many_sp_calendar,
|
744 |
-
'cat_id' => '',
|
745 |
-
'cat_ids' => $cat_ids,
|
746 |
-
'widget' => $widget,
|
747 |
-
), $site_url);
|
748 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❱
|
749 |
-
</a>
|
750 |
-
</td>
|
751 |
-
<td width="10%" style="border: 0 !important;">
|
752 |
-
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
753 |
-
echo add_query_arg(array(
|
754 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
755 |
-
'theme_id' => $theme_id,
|
756 |
-
'calendar' => $calendar_id,
|
757 |
-
'select' => $view_select,
|
758 |
-
'date' => ($year + 1) . '-' . add_0(Month_num($month)),
|
759 |
-
'many_sp_calendar' => $many_sp_calendar,
|
760 |
-
'cat_id' => '',
|
761 |
-
'cat_ids' => $cat_ids,
|
762 |
-
'widget' => $widget,
|
763 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; <?php echo $years_bgcolor; ?>;">
|
764 |
-
<span style="font-size:18px;color:#FFF"><?php echo $year + 1; ?></span>
|
765 |
-
</div>
|
766 |
-
</td>
|
767 |
-
</tr>
|
768 |
-
</table>
|
769 |
-
</td>
|
770 |
-
</tr>
|
771 |
-
<tr align="center" height="<?php echo $week_days_cell_height; ?>" style="background-color:<?php echo $weekdays_bg_color; ?> !important;">
|
772 |
-
<?php if ($weekstart == "su") { ?>
|
773 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days;?>; margin:0; padding:0;background-color:<?php echo $weekday_sunday_bg_color; ?> !important">
|
774 |
-
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
775 |
-
</td>
|
776 |
-
<?php } ?>
|
777 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
778 |
-
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Mo', 'sp_calendar'); ?> </b></div>
|
779 |
-
</td>
|
780 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
781 |
-
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Tu', 'sp_calendar'); ?> </b></div>
|
782 |
-
</td>
|
783 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
784 |
-
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('We', 'sp_calendar'); ?> </b></div>
|
785 |
-
</td>
|
786 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
787 |
-
<div class="calbottom_border" style="text-align:center;margin:0; padding:0;"><b class="week_days"><?php echo __('Th', 'sp_calendar'); ?> </b></div>
|
788 |
-
</td>
|
789 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
790 |
-
<div class="calbottom_border" style="text-align:center;margin:0; padding:0;"><b class="week_days"><?php echo __('Fr', 'sp_calendar'); ?> </b></div>
|
791 |
-
</td>
|
792 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
793 |
-
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Sa', 'sp_calendar'); ?> </b></div>
|
794 |
-
</td>
|
795 |
-
<?php if ($weekstart == "mo") { ?>
|
796 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days;?>; margin:0; padding:0;background-color:<?php echo $weekday_sunday_bg_color; ?> !important">
|
797 |
-
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
798 |
-
</td>
|
799 |
-
<?php } ?>
|
800 |
-
</tr>
|
801 |
-
<?php
|
802 |
-
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
803 |
-
if ($weekstart == "su") {
|
804 |
-
$month_first_weekday++;
|
805 |
-
if ($month_first_weekday == 8) {
|
806 |
-
$month_first_weekday = 1;
|
807 |
-
}
|
808 |
-
}
|
809 |
-
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
810 |
-
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
811 |
-
$weekday_i = $month_first_weekday;
|
812 |
-
$last_month_days = $last_month_days - $weekday_i + 2;
|
813 |
-
$percent = 1;
|
814 |
-
$sum = $month_days - 8 + $month_first_weekday;
|
815 |
-
if ($sum % 7 <> 0) {
|
816 |
-
$percent = $percent + 1;
|
817 |
-
}
|
818 |
-
$sum = $sum - ($sum % 7);
|
819 |
-
$percent = $percent + ($sum / 7);
|
820 |
-
$percent = 107 / $percent;
|
821 |
-
$all_calendar_files = php_getdays($show_numbers_for_events, $calendar_id, $date, $theme_id, $widget);
|
822 |
-
$array_days = $all_calendar_files[0]['array_days'];
|
823 |
-
$array_days1 = $all_calendar_files[0]['array_days1'];
|
824 |
-
$title = $all_calendar_files[0]['title'];
|
825 |
-
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
826 |
-
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
827 |
-
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
828 |
-
|
829 |
-
echo ' <tr id="days" height="' . $cell_height . '" style="line-height:15px;">';
|
830 |
-
for ($i = 1; $i < $weekday_i; $i++) {
|
831 |
-
echo ' <td class="caltext_color_other_months" style="background-color:' . $bg_color_other_months . ' !important">
|
832 |
-
<p style="padding-right: 7px; font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4;font-family: Segoe UI;padding-left: 5px;background: '.$date_bgcolor.' !important; width: 100%; padding-right: 6px;">' . $last_month_days . '</p>
|
833 |
-
</td>';
|
834 |
-
$last_month_days = $last_month_days + 1;
|
835 |
-
}
|
836 |
-
///////////////////////////////////////////////////////////////////////
|
837 |
-
|
838 |
-
function category_color($event_id)
|
839 |
-
{
|
840 |
-
|
841 |
-
global $wpdb;
|
842 |
-
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
843 |
-
|
844 |
-
$query = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND " . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d",$calendar,$event_id);
|
845 |
-
|
846 |
-
|
847 |
-
$colors=$wpdb->get_results($query);
|
848 |
-
|
849 |
-
if(!empty($colors))
|
850 |
-
$color=$colors[0]->color;
|
851 |
-
else $color = "";
|
852 |
-
|
853 |
-
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : '');
|
854 |
-
|
855 |
-
return '#'.$color;
|
856 |
-
}
|
857 |
-
|
858 |
-
|
859 |
-
function style($title, $color,$ev_height){
|
860 |
-
$new_title = html_entity_decode(strip_tags($title));
|
861 |
-
$number = $new_title[0];
|
862 |
-
$first_letter =$new_title[1];
|
863 |
-
$ev_title = $title;
|
864 |
-
$color=str_replace('#','',$color);
|
865 |
-
$event='<div id="cal_event" style="padding-left: 5px; background-color: '.hex_to_rgb($color,'0.5').' !important;"><p class="ev_name">'.$ev_title.'</p></div>';
|
866 |
-
|
867 |
-
return $event;
|
868 |
-
}
|
869 |
-
|
870 |
-
function evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg,$events_count){
|
871 |
-
if($r < $number_of_shown_evetns && $r < $events_count){ $ev_colid = $r; }
|
872 |
-
else $ev_colid = $r - 1;
|
873 |
-
|
874 |
-
if(str_replace('#','',category_color($ev_id[0]))=="") $cat_col_without_color = $evented_color_bg;
|
875 |
-
else $cat_col_without_color = '#' . str_replace('#','',category_color($ev_id[0]));
|
876 |
-
if($r>1){
|
877 |
-
if(category_color($ev_id[$r-1])=='#')
|
878 |
-
$cat_color_for_last='#' . str_replace('#','',$evented_color_bg);
|
879 |
-
else
|
880 |
-
$cat_color_for_last='#' . str_replace('#','',category_color($ev_id[$ev_colid]));
|
881 |
-
}
|
882 |
-
else $cat_color_for_last = $cat_col_without_color;
|
883 |
-
|
884 |
-
}
|
885 |
-
|
886 |
-
/////////////////////////////////////////////////////////////////////////////
|
887 |
-
|
888 |
-
for ($i = 1; $i <= $month_days; $i++) {
|
889 |
-
if (isset($title[$i])) {
|
890 |
-
$ev_title = explode('</p>', $title[$i]);
|
891 |
-
array_pop($ev_title);
|
892 |
-
$k = count($ev_title);
|
893 |
-
$ev_id = explode('<br>', $ev_ids[$i]);
|
894 |
-
array_pop($ev_id);
|
895 |
-
$ev_ids_inline = implode(',', $ev_id);
|
896 |
-
}
|
897 |
-
else
|
898 |
-
$k=0;
|
899 |
-
|
900 |
-
$dayevent = '';
|
901 |
-
if (($weekday_i % 7 == 0 and $weekstart == "mo") or ($weekday_i % 7 == 1 and $weekstart == "su")) {
|
902 |
-
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER ) {
|
903 |
-
echo ' <td class="cala_day" style="padding:0; margin:0;line-height:15px;" id="event_td_'.$i.'">
|
904 |
-
<div class="calborder_day" style=" margin:0; padding:0;">
|
905 |
-
<p style="font-size:' . $other_days_font_size . 'px; font-weight: 600; color:' . $evented_color . ';line-height:1.4;font-family: Segoe UI; background: '.$date_bgcolor.';">' . $i . '</p>';
|
906 |
-
$r = 0;
|
907 |
-
echo ' <div style="background-color:' . $ev_title_bg_color . ' !important;">';
|
908 |
-
for ($j = 0; $j < $k; $j++) {
|
909 |
-
if(category_color($ev_id[$j])=='#')
|
910 |
-
$cat_color=$evented_color_bg;
|
911 |
-
else
|
912 |
-
$cat_color=category_color($ev_id[$j]);
|
913 |
-
if ($k > $number_of_shown_evetns)
|
914 |
-
$events_count = $number_of_shown_evetns + 1;
|
915 |
-
else $events_count = $k;
|
916 |
-
$event_height = ($cell_height - floor($other_days_font_size * 1.4))/$events_count;
|
917 |
-
if ($r < $number_of_shown_evetns) {
|
918 |
-
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $event_title_color . ';"
|
919 |
-
href="' . add_query_arg(array(
|
920 |
-
'action' => 'spidercalendarbig',
|
921 |
-
'theme_id' => $theme_id,
|
922 |
-
'calendar_id' => $calendar_id,
|
923 |
-
'ev_ids' => $ev_ids_inline,
|
924 |
-
'eventID' => $ev_id[$j],
|
925 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
926 |
-
'many_sp_calendar' => $many_sp_calendar,
|
927 |
-
'widget' => $widget,
|
928 |
-
'TB_iframe' => 1,
|
929 |
-
'tbWidth' => $popup_width,
|
930 |
-
'tbHeight' => $popup_height,
|
931 |
-
'cat_id' => $cat_ids
|
932 |
-
), $site_url) . '"><b>' . style($ev_title[$j],$cat_color,$event_height) . '</b>
|
933 |
-
</a>';
|
934 |
-
}
|
935 |
-
else {
|
936 |
-
echo '
|
937 |
-
<div style=" min-height: '.$event_height.'px;"><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="padding-left: 5px; font-size:11px; background:none; color:' . $ev_color . '; text-align:center;"
|
938 |
-
href="' . add_query_arg(array(
|
939 |
-
'action' => 'spiderseemore',
|
940 |
-
'theme_id' => $theme_id,
|
941 |
-
'calendar_id' => $calendar_id,
|
942 |
-
'ev_ids' => $ev_ids_inline,
|
943 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
944 |
-
'many_sp_calendar' => $many_sp_calendar,
|
945 |
-
'widget' => $widget,
|
946 |
-
'TB_iframe' => 1,
|
947 |
-
'tbWidth' => $popup_width,
|
948 |
-
'tbHeight' => $popup_height,
|
949 |
-
), $site_url) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
950 |
-
</a></div>';
|
951 |
-
break;
|
952 |
-
}
|
953 |
-
$r++;
|
954 |
-
}
|
955 |
-
evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg, $events_count);
|
956 |
-
echo ' </div>
|
957 |
-
</div>
|
958 |
-
</td>';
|
959 |
-
|
960 |
-
}
|
961 |
-
else
|
962 |
-
if ($i ==date( 'j' ) and $month == date('F') and $year == date('Y')) {
|
963 |
-
|
964 |
-
if(!isset($border_day)) $border_day = "";
|
965 |
-
if ($i == date('j') and $month == date('F') and $year == date('Y')) { $border_day = $current_day_border_color;}
|
966 |
-
if (in_array($i,$array_days)) {
|
967 |
-
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ' !important;overflow: hidden; padding:0; margin:0;line-height:15px; border: 2px solid ' . $current_day_border_color . ' !important" id="event_td_'.$i.'">
|
968 |
-
<p style="background-color:' . $evented_color_bg . ' !important;color:' . $evented_color . ' !important;font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4;font-family: Segoe UI;padding-left: 5px;background: '.$date_bgcolor.' !important; width: 100%; padding-right: 6px;">' . $i . '</p>';
|
969 |
-
$r = 0;
|
970 |
-
echo ' <div style="background-color:' . $ev_title_bg_color . ' !important">';
|
971 |
-
for ($j = 0; $j < $k; $j++) {
|
972 |
-
|
973 |
-
if(category_color($ev_id[$j])=='#')
|
974 |
-
$cat_color=$evented_color_bg;
|
975 |
-
else
|
976 |
-
$cat_color=category_color($ev_id[$j]);
|
977 |
-
|
978 |
-
if ($k > $number_of_shown_evetns)
|
979 |
-
$events_count = $number_of_shown_evetns + 1;
|
980 |
-
else $events_count = $k;
|
981 |
-
$event_height = ($cell_height - floor($other_days_font_size * 1.4))/$events_count;
|
982 |
-
if ($r < $number_of_shown_evetns) {
|
983 |
-
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $event_title_color . ';"
|
984 |
-
href="' . add_query_arg(array(
|
985 |
-
'action' => 'spidercalendarbig',
|
986 |
-
'theme_id' => $theme_id,
|
987 |
-
'calendar_id' => $calendar_id,
|
988 |
-
'ev_ids' => $ev_ids_inline,
|
989 |
-
'eventID' => $ev_id[$j],
|
990 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
991 |
-
'many_sp_calendar' => $many_sp_calendar,
|
992 |
-
'widget' => $widget,
|
993 |
-
'TB_iframe' => 1,
|
994 |
-
'tbWidth' => $popup_width,
|
995 |
-
'tbHeight' => $popup_height,
|
996 |
-
), $site_url) . '"><b>' . style($ev_title[$j],$cat_color,$event_height) . '</b>
|
997 |
-
</a>';
|
998 |
-
}
|
999 |
-
else {
|
1000 |
-
echo '
|
1001 |
-
<div style=" min-height: '.$event_height.'px;"><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="padding-left: 5px; font-size:11px;background:none;color:' . $ev_color . ';text-align:center;"
|
1002 |
-
href="' . add_query_arg(array(
|
1003 |
-
'action' => 'spiderseemore',
|
1004 |
-
'theme_id' => $theme_id,
|
1005 |
-
'calendar_id' => $calendar_id,
|
1006 |
-
'ev_ids' => $ev_ids_inline,
|
1007 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1008 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1009 |
-
'widget' => $widget,
|
1010 |
-
'TB_iframe' => 1,
|
1011 |
-
'tbWidth' => $popup_width,
|
1012 |
-
'tbHeight' => $popup_height,
|
1013 |
-
), $site_url) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1014 |
-
</a></div>';
|
1015 |
-
break;
|
1016 |
-
}
|
1017 |
-
$r++;
|
1018 |
-
}
|
1019 |
-
evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg, $events_count);
|
1020 |
-
echo ' </div>
|
1021 |
-
</td>';
|
1022 |
-
}
|
1023 |
-
else {
|
1024 |
-
|
1025 |
-
echo ' <td class="calsun_days" style="overflow: hidden; padding:0; font-size:' . $sundays_font_size . 'px; margin:0;line-height:1.4;font-family: Segoe UI;padding-left: 5px; border: 2px solid ' . $current_day_border_color . ' !important">
|
1026 |
-
<b>' . $i . '</b>
|
1027 |
-
</td>';
|
1028 |
-
}
|
1029 |
-
}
|
1030 |
-
else
|
1031 |
-
|
1032 |
-
if (in_array($i, $array_days)) {
|
1033 |
-
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ' !important;padding:0; margin:0;line-height:15px;" id="event_td_'.$i.'">
|
1034 |
-
<p style="background-color:' . $evented_color_bg . ' !important;color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4;font-family: Segoe UI;padding-left: 5px;background: '.$date_bgcolor.' !important; padding-right: 6px;">' . $i . '</p>
|
1035 |
-
<div>';
|
1036 |
-
$r = 0;
|
1037 |
-
for ($j = 0; $j < $k; $j++) {
|
1038 |
-
if(category_color($ev_id[$j])=='#')
|
1039 |
-
$cat_color=$evented_color_bg;
|
1040 |
-
else
|
1041 |
-
$cat_color=category_color($ev_id[$j]);
|
1042 |
-
if ($k > $number_of_shown_evetns)
|
1043 |
-
$events_count = $number_of_shown_evetns + 1;
|
1044 |
-
else $events_count = $k;
|
1045 |
-
$event_height = ($cell_height - floor($other_days_font_size * 1.4))/$events_count;
|
1046 |
-
|
1047 |
-
if ($r < $number_of_shown_evetns) {
|
1048 |
-
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ' !important;"
|
1049 |
-
href="' . add_query_arg(array(
|
1050 |
-
'action' => 'spidercalendarbig',
|
1051 |
-
'theme_id' => $theme_id,
|
1052 |
-
'calendar_id' => $calendar_id,
|
1053 |
-
'ev_ids' => $ev_ids_inline,
|
1054 |
-
'eventID' => $ev_id[$j],
|
1055 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1056 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1057 |
-
'widget' => $widget,
|
1058 |
-
'TB_iframe' => 1,
|
1059 |
-
'tbWidth' => $popup_width,
|
1060 |
-
'tbHeight' => $popup_height,
|
1061 |
-
), $site_url) . '"><b>' . style($ev_title[$j],$cat_color,$event_height) . '</b>
|
1062 |
-
</a>';
|
1063 |
-
}
|
1064 |
-
else {
|
1065 |
-
echo '
|
1066 |
-
<div style=" min-height: '.$event_height.'px;"><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="padding-left: 5px; font-size:11px; background:none; color:' . $ev_color . ' !important;text-align:center;"
|
1067 |
-
href="' . add_query_arg(array(
|
1068 |
-
'action' => 'spiderseemore',
|
1069 |
-
'theme_id' => $theme_id,
|
1070 |
-
'calendar_id' => $calendar_id,
|
1071 |
-
'ev_ids' => $ev_ids_inline,
|
1072 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1073 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1074 |
-
'widget' => $widget,
|
1075 |
-
'TB_iframe' => 1,
|
1076 |
-
'tbWidth' => $popup_width,
|
1077 |
-
'tbHeight' => $popup_height,
|
1078 |
-
), $site_url) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1079 |
-
</a></div>';
|
1080 |
-
break;
|
1081 |
-
}
|
1082 |
-
$r++;
|
1083 |
-
}
|
1084 |
-
evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg,$events_count);
|
1085 |
-
echo ' </div>
|
1086 |
-
</td>';
|
1087 |
-
}
|
1088 |
-
else {
|
1089 |
-
echo ' <td class="calsun_days" style="padding:0; margin:0;line-height:1.4;font-family: Segoe UI; font-size:' . $sundays_font_size . 'px">
|
1090 |
-
<p style="background: '.$date_bgcolor.'; padding-left: 5px; padding-right: 6px; ">' . $i . '</p>
|
1091 |
-
</td>';
|
1092 |
-
}
|
1093 |
-
}
|
1094 |
-
else
|
1095 |
-
|
1096 |
-
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
1097 |
-
|
1098 |
-
echo ' <td bgcolor="' . $ev_title_bg_color . '" class="cala_day" style="overflow: hidden; border: 2px solid ' . $current_day_border_color . ' !important;padding:0; margin:0;line-height:15px;" id="event_td_'.$i.'">
|
1099 |
-
<div class="calborder_day" style="margin:0; padding:0;">
|
1100 |
-
<p style="background-color:' . $evented_color_bg . ' !important;color:' . $evented_color . ' !important;font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4;font-family: Segoe UI;padding-left: 5px;background: '.$date_bgcolor.' !important; width: 100%; padding-left: 5px; padding-right: 6px;">' . $i . '</p>
|
1101 |
-
<div style="background-color:' . $ev_title_bg_color . ' !important">';
|
1102 |
-
$r = 0;
|
1103 |
-
for ($j = 0; $j < $k; $j++) {
|
1104 |
-
if(category_color($ev_id[$j])=='#')
|
1105 |
-
$cat_color=$evented_color_bg;
|
1106 |
-
else
|
1107 |
-
$cat_color=category_color($ev_id[$j]);
|
1108 |
-
|
1109 |
-
if ($k > $number_of_shown_evetns)
|
1110 |
-
$events_count = $number_of_shown_evetns + 1;
|
1111 |
-
else $events_count = $k;
|
1112 |
-
$event_height = ($cell_height - floor($other_days_font_size * 1.4))/$events_count;
|
1113 |
-
if ($r < $number_of_shown_evetns) {
|
1114 |
-
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ' !important;"
|
1115 |
-
href="' . add_query_arg(array(
|
1116 |
-
'action' => 'spidercalendarbig',
|
1117 |
-
'theme_id' => $theme_id,
|
1118 |
-
'calendar_id' => $calendar_id,
|
1119 |
-
'ev_ids' => $ev_ids_inline,
|
1120 |
-
'eventID' => $ev_id[$j],
|
1121 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1122 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1123 |
-
'widget' => $widget,
|
1124 |
-
'TB_iframe' => 1,
|
1125 |
-
'tbWidth' => $popup_width,
|
1126 |
-
'tbHeight' => $popup_height,
|
1127 |
-
), $site_url) . '"><b>' . style($ev_title[$j],$cat_color,$event_height) . '</b>
|
1128 |
-
</a>';
|
1129 |
-
}
|
1130 |
-
else {
|
1131 |
-
echo '
|
1132 |
-
<div style=" min-height: '.$event_height.'px;"><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="padding-left: 5px; font-size:11px; background:none; color:' . $ev_color . ';text-align:center;"
|
1133 |
-
href="' . add_query_arg(array(
|
1134 |
-
'action' => 'spiderseemore',
|
1135 |
-
'theme_id' => $theme_id,
|
1136 |
-
'calendar_id' => $calendar_id,
|
1137 |
-
'ev_ids' => $ev_ids_inline,
|
1138 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1139 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1140 |
-
'widget' => $widget,
|
1141 |
-
'TB_iframe' => 1,
|
1142 |
-
'tbWidth' => $popup_width,
|
1143 |
-
'tbHeight' => $popup_height,
|
1144 |
-
), $site_url) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1145 |
-
</a></div>';
|
1146 |
-
break;
|
1147 |
-
}
|
1148 |
-
$r++;
|
1149 |
-
}
|
1150 |
-
evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg, $events_count);
|
1151 |
-
echo ' </div>
|
1152 |
-
</div>
|
1153 |
-
</td>';
|
1154 |
-
}
|
1155 |
-
else {
|
1156 |
-
|
1157 |
-
if ($i ==date( 'j' ) and $month == date('F') and $year == date('Y')) {
|
1158 |
-
|
1159 |
-
|
1160 |
-
if (in_array ($i,$array_days)) {
|
1161 |
-
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ' !important;overflow: hidden; padding:0; margin:0;line-height:15px; border: 2px solid ' . $current_day_border_color . ' !important;" id="event_td_'.$i.'">
|
1162 |
-
<p style="background-color:' . $evented_color_bg . ' !important;color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4;font-family: Segoe UI;padding-left: 5px;background: '.$date_bgcolor.' !important; width: 100%; padding-right: 6px;">' . $i . '</p>
|
1163 |
-
<div style="background-color:' . $ev_title_bg_color . ' !important">';
|
1164 |
-
$r = 0;
|
1165 |
-
for ($j = 0; $j < $k; $j++) {
|
1166 |
-
if(category_color($ev_id[$j])=='#')
|
1167 |
-
$cat_color=$evented_color_bg;
|
1168 |
-
else
|
1169 |
-
$cat_color=category_color($ev_id[$j]);
|
1170 |
-
|
1171 |
-
if ($k > $number_of_shown_evetns)
|
1172 |
-
$events_count = $number_of_shown_evetns + 1;
|
1173 |
-
else $events_count = $k;
|
1174 |
-
$event_height = ($cell_height - floor($other_days_font_size * 1.4))/$events_count;
|
1175 |
-
if ($r < $number_of_shown_evetns) {
|
1176 |
-
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
1177 |
-
href="' . add_query_arg(array(
|
1178 |
-
'action' => 'spidercalendarbig',
|
1179 |
-
'theme_id' => $theme_id,
|
1180 |
-
'calendar_id' => $calendar_id,
|
1181 |
-
'ev_ids' => $ev_ids_inline,
|
1182 |
-
'eventID' => $ev_id[$j],
|
1183 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1184 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1185 |
-
'widget' => $widget,
|
1186 |
-
'TB_iframe' => 1,
|
1187 |
-
'tbWidth' => $popup_width,
|
1188 |
-
'tbHeight' => $popup_height,
|
1189 |
-
'tbHeight' => $popup_height,
|
1190 |
-
), $site_url) . '"><b>' . style($ev_title[$j],$cat_color,$event_height) . '</b>
|
1191 |
-
</a>';
|
1192 |
-
}
|
1193 |
-
else {
|
1194 |
-
echo '
|
1195 |
-
<div style=" min-height: '.$event_height.'px;"><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="padding-left: 5px; font-size:11px; background:none;color:' . $ev_color . ';text-align:center;"
|
1196 |
-
href="' . add_query_arg(array(
|
1197 |
-
'action' => 'spiderseemore',
|
1198 |
-
'theme_id' => $theme_id,
|
1199 |
-
'calendar_id' => $calendar_id,
|
1200 |
-
'ev_ids' => $ev_ids_inline,
|
1201 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1202 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1203 |
-
'widget' => $widget,
|
1204 |
-
'TB_iframe' => 1,
|
1205 |
-
'tbWidth' => $popup_width,
|
1206 |
-
'tbHeight' => $popup_height,
|
1207 |
-
), $site_url) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1208 |
-
</a></div>';
|
1209 |
-
break;
|
1210 |
-
}
|
1211 |
-
$r++;
|
1212 |
-
}
|
1213 |
-
evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg, $events_count);
|
1214 |
-
echo ' </div>
|
1215 |
-
</td>';
|
1216 |
-
}
|
1217 |
-
else {
|
1218 |
-
echo ' <td style="overflow: hidden; color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:15px; border: 2px solid ' . $current_day_border_color . ' !important; vertical-align:top;">
|
1219 |
-
<p style="font-size:'.$other_days_font_size.'px; font-weight: 600;line-height:1.4;font-family: Segoe UI;padding-left: 5px; background: '.$date_bgcolor.';">' . $i . '</p>
|
1220 |
-
</td>';
|
1221 |
-
}
|
1222 |
-
}
|
1223 |
-
else
|
1224 |
-
|
1225 |
-
if (in_array($i, $array_days)) {
|
1226 |
-
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ' !important;padding:0; margin:0;line-height:15px;" id="event_td_'.$i.'">
|
1227 |
-
<p style="color:' . $evented_color . ' !important;font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4; padding-left: 5px; font-family: Segoe UI;padding-left: 5px; background: '.$date_bgcolor.' !important;">' . $i . '</p>';
|
1228 |
-
$r = 0;
|
1229 |
-
echo ' <div class="events_div">';
|
1230 |
-
|
1231 |
-
for ($j = 0; $j < $k; $j++) {
|
1232 |
-
|
1233 |
-
if(category_color($ev_id[$j])=='#')
|
1234 |
-
$cat_color=$evented_color_bg;
|
1235 |
-
else
|
1236 |
-
$cat_color=category_color($ev_id[$j]);
|
1237 |
-
|
1238 |
-
if ($k > $number_of_shown_evetns)
|
1239 |
-
$events_count = $number_of_shown_evetns + 1;
|
1240 |
-
else $events_count = $k;
|
1241 |
-
$event_height = ($cell_height - floor($other_days_font_size * 1.4))/$events_count;
|
1242 |
-
|
1243 |
-
if ($r < $number_of_shown_evetns) {
|
1244 |
-
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
1245 |
-
href="' . add_query_arg(array(
|
1246 |
-
'action' => 'spidercalendarbig',
|
1247 |
-
'theme_id' => $theme_id,
|
1248 |
-
'calendar_id' => $calendar_id,
|
1249 |
-
'ev_ids' => $ev_ids_inline,
|
1250 |
-
'eventID' => $ev_id[$j],
|
1251 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1252 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1253 |
-
'widget' => $widget,
|
1254 |
-
'TB_iframe' => 1,
|
1255 |
-
'tbWidth' => $popup_width,
|
1256 |
-
'tbHeight' => $popup_height,
|
1257 |
-
), $site_url) . '"><b>' . style($ev_title[$j],$cat_color,$event_height) . '</b>
|
1258 |
-
</a>';
|
1259 |
-
}
|
1260 |
-
else {
|
1261 |
-
echo '<div style="min-height: '.$event_height.'px;"><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="padding-left: 5px; font-size:11px; background:none; color:' . $ev_color . ';text-align:center;"
|
1262 |
-
href="' . add_query_arg(array(
|
1263 |
-
'action' => 'spiderseemore',
|
1264 |
-
'theme_id' => $theme_id,
|
1265 |
-
'calendar_id' => $calendar_id,
|
1266 |
-
'ev_ids' => $ev_ids_inline,
|
1267 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1268 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1269 |
-
'widget' => $widget,
|
1270 |
-
'TB_iframe' => 1,
|
1271 |
-
'tbWidth' => $popup_width,
|
1272 |
-
'tbHeight' => $popup_height,
|
1273 |
-
), $site_url) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1274 |
-
</a></div>';
|
1275 |
-
break;
|
1276 |
-
}
|
1277 |
-
$r++;
|
1278 |
-
}
|
1279 |
-
evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg, $events_count);
|
1280 |
-
echo ' </div>
|
1281 |
-
</td>';
|
1282 |
-
}
|
1283 |
-
else {
|
1284 |
-
echo ' <td style=" color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:15px;border-bottom: 1px solid ' . $cell_border_color . ' !important; border-left: 1px solid ' . $cell_border_color . ' !important;vertical-align:top;">
|
1285 |
-
<p style="font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4;font-family: Segoe UI; padding-left: 5px; background: '.$date_bgcolor.';">' . $i . '</p>
|
1286 |
-
</td>';
|
1287 |
-
}
|
1288 |
-
}
|
1289 |
-
if ($weekday_i % 7 == 0 && $i <> $month_days) {
|
1290 |
-
echo ' </tr>
|
1291 |
-
<tr height="' . $cell_height . '" style="line-height:15px">';
|
1292 |
-
$weekday_i = 0;
|
1293 |
-
}
|
1294 |
-
$weekday_i += 1;
|
1295 |
-
}
|
1296 |
-
$weekday_i;
|
1297 |
-
$next_i = 1;
|
1298 |
-
if ($weekday_i != 1) {
|
1299 |
-
for ($i = $weekday_i; $i <= 7; $i++) {
|
1300 |
-
if ($i != 7) {
|
1301 |
-
echo ' <td class="caltext_color_other_months" style="font-size:' . $other_days_font_size . 'px;line-height:1.4;font-family: Segoe UI;font-weight: 600;background-color:' . $bg_color_other_months . ' !important;"><p style="background: '.$date_bgcolor.';"><span style="padding: 0px 19px 0px 5px;">' . $next_i . '</span></p></td>';
|
1302 |
-
}
|
1303 |
-
else {
|
1304 |
-
echo ' <td class="caltext_color_other_months" style="font-size:' . $other_days_font_size . 'px;line-height:1.4; font-weight: 600;font-family: Segoe UI; background-color:' . $bg_color_other_months . ' !important;"><p style="background: '.$date_bgcolor.';"><span style="padding: 0px 19px 0px 5px;">' . $next_i . '</span></p></td>';
|
1305 |
-
}
|
1306 |
-
$next_i += 1;
|
1307 |
-
}
|
1308 |
-
}
|
1309 |
-
echo ' </tr>
|
1310 |
-
</table>';
|
1311 |
-
?> <input type="text" value="1" name="day" style="display:none" />
|
1312 |
-
</td>
|
1313 |
-
</tr>
|
1314 |
-
</table>
|
1315 |
-
</td>
|
1316 |
-
</tr>
|
1317 |
-
</table>
|
1318 |
-
<style>
|
1319 |
-
@media only screen and (max-width : 640px) {
|
1320 |
-
#views_tabs ,#drop_down_views
|
1321 |
-
{
|
1322 |
-
display:none;
|
1323 |
-
}
|
1324 |
-
|
1325 |
-
#views_tabs_select
|
1326 |
-
{
|
1327 |
-
display:block !important;
|
1328 |
-
}
|
1329 |
-
}
|
1330 |
-
|
1331 |
-
@media only screen and (max-width : 968px) {
|
1332 |
-
#cats >li
|
1333 |
-
{
|
1334 |
-
float:none;
|
1335 |
-
}
|
1336 |
-
}
|
1337 |
-
|
1338 |
-
.spider_categories{
|
1339 |
-
display:inline-block;
|
1340 |
-
cursor:pointer;
|
1341 |
-
}
|
1342 |
-
|
1343 |
-
.spider_categories p{
|
1344 |
-
color: #fff;
|
1345 |
-
padding: 2px 10px !important;
|
1346 |
-
margin: 2px 0 !important;
|
1347 |
-
font-size: 14px;
|
1348 |
-
font-weight: 600;
|
1349 |
-
}
|
1350 |
-
</style>
|
1351 |
-
<?php
|
1352 |
-
|
1353 |
-
//reindex cat_ids_array
|
1354 |
-
$re_cat_ids_array = array_values($cat_ids_array);
|
1355 |
-
|
1356 |
-
for($i=0; $i<count($re_cat_ids_array); $i++)
|
1357 |
-
{
|
1358 |
-
echo'
|
1359 |
-
<style>
|
1360 |
-
#cats #category'.$re_cat_ids_array[$i].'
|
1361 |
-
{
|
1362 |
-
text-decoration:underline;
|
1363 |
-
cursor:pointer;
|
1364 |
-
|
1365 |
-
}
|
1366 |
-
|
1367 |
-
</style>';
|
1368 |
-
|
1369 |
-
}
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
if($cat_ids=='')
|
1374 |
-
$cat_ids='';
|
1375 |
-
|
1376 |
-
if($show_cat){
|
1377 |
-
echo '<ul id="cats" style="list-style-type:none; padding: 0;">';
|
1378 |
-
|
1379 |
-
foreach($categories as $category)
|
1380 |
-
{
|
1381 |
-
|
1382 |
-
?>
|
1383 |
-
|
1384 |
-
<li class="spider_categories"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1385 |
-
'action' => 'spiderbigcalendar_month',
|
1386 |
-
'theme_id' => $theme_id,
|
1387 |
-
'calendar' => $calendar_id,
|
1388 |
-
'select' => $view_select,
|
1389 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
1390 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1391 |
-
'cat_id' => $category->id,
|
1392 |
-
'cat_ids' => $cat_ids,
|
1393 |
-
'widget' => $widget,
|
1394 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1395 |
-
|
1396 |
-
|
1397 |
-
<?php }
|
1398 |
-
if (!empty($categories)) {
|
1399 |
-
?>
|
1400 |
-
<li class="spider_categories"><p id="category0" style="background-color:#<?php echo str_replace('#','',$bg_top); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1401 |
-
'action' => 'spiderbigcalendar_month',
|
1402 |
-
'theme_id' => $theme_id,
|
1403 |
-
'calendar' => $calendar_id,
|
1404 |
-
'select' => $view_select,
|
1405 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
1406 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1407 |
-
'cat_id' => '',
|
1408 |
-
'cat_ids' => '',
|
1409 |
-
'widget' => $widget,
|
1410 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
1411 |
-
<?php
|
1412 |
-
}
|
1413 |
-
echo '</ul>';
|
1414 |
-
}
|
1415 |
-
?>
|
1416 |
-
</body>
|
1417 |
-
</html>
|
1418 |
-
<?php
|
1419 |
-
die();
|
1420 |
} ?>
|
1 |
+
<?php
|
2 |
+
function big_calendar_month() {
|
3 |
+
require_once("frontend_functions.php");
|
4 |
+
global $wpdb;
|
5 |
+
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
+
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
+
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
+
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 30);
|
9 |
+
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
10 |
+
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
11 |
+
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
12 |
+
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
13 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where id=".$calendar_id."";
|
14 |
+
$calendar = $wpdb->query($query);
|
15 |
+
$site_url = get_admin_url().'admin-ajax.php';
|
16 |
+
|
17 |
+
///////////////////////////////////////////////////////////////////////////////////
|
18 |
+
|
19 |
+
|
20 |
+
if($cat_ids=='')
|
21 |
+
$cat_ids .= $cat_id.',';
|
22 |
+
else
|
23 |
+
$cat_ids .= ','.$cat_id.',';
|
24 |
+
|
25 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
26 |
+
|
27 |
+
|
28 |
+
function getelementcountinarray($array , $element)
|
29 |
+
{
|
30 |
+
$t=0;
|
31 |
+
|
32 |
+
for($i=0; $i<count($array); $i++)
|
33 |
+
{
|
34 |
+
if($element==$array[$i])
|
35 |
+
$t++;
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
return $t;
|
41 |
+
|
42 |
+
}
|
43 |
+
|
44 |
+
function getelementindexinarray($array , $element)
|
45 |
+
{
|
46 |
+
|
47 |
+
$t='';
|
48 |
+
|
49 |
+
for($i=0; $i<count($array); $i++)
|
50 |
+
{
|
51 |
+
if($element==$array[$i])
|
52 |
+
$t.=$i.',';
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
return $t;
|
57 |
+
|
58 |
+
|
59 |
+
}
|
60 |
+
$cat_ids_array = explode(',',$cat_ids);
|
61 |
+
|
62 |
+
|
63 |
+
if($cat_id!='')
|
64 |
+
{
|
65 |
+
|
66 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
67 |
+
{
|
68 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
69 |
+
$index_array = explode(',' , $index_in_line);
|
70 |
+
array_pop ($index_array);
|
71 |
+
for($j=0; $j<count($index_array); $j++)
|
72 |
+
unset($cat_ids_array[$index_array[$j]]);
|
73 |
+
$cat_ids = implode(',',$cat_ids_array);
|
74 |
+
}
|
75 |
+
}
|
76 |
+
else
|
77 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
78 |
+
|
79 |
+
|
80 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
81 |
+
|
82 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
83 |
+
$themes = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme');
|
84 |
+
$theme_name = $theme->title;
|
85 |
+
$cal_width = $theme->width;
|
86 |
+
$bg_top = '#' . str_replace('#','',$theme->bg_top);
|
87 |
+
$bg_bottom = '#' . str_replace('#','',$theme->bg_bottom);
|
88 |
+
$border_color = '#' . str_replace('#','',$theme->border_color);
|
89 |
+
$text_color_year = '#' . str_replace('#','',$theme->text_color_year);
|
90 |
+
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
91 |
+
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
92 |
+
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
93 |
+
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
94 |
+
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
95 |
+
$evented_color_bg = (isset($theme->bg_color_this_month_evented) ?'#' . str_replace('#','',$theme->bg_color_this_month_evented) : '');
|
96 |
+
$color_arrow_year = '#' . str_replace('#','',$theme->arrow_color_year);
|
97 |
+
$color_arrow_month = '#' . str_replace('#','',$theme->arrow_color_month);
|
98 |
+
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
99 |
+
$event_title_color = '#' . str_replace('#','',$theme->event_title_color);
|
100 |
+
$current_day_border_color = '#' . str_replace('#','',$theme->current_day_border_color);
|
101 |
+
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
102 |
+
$cell_height = $theme->cell_height;
|
103 |
+
$popup_width = $theme->popup_width;
|
104 |
+
$popup_height = $theme->popup_height;
|
105 |
+
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
106 |
+
$sundays_font_size = $theme->sundays_font_size;
|
107 |
+
$other_days_font_size = $theme->other_days_font_size;
|
108 |
+
$weekdays_font_size = $theme->weekdays_font_size;
|
109 |
+
$border_width = $theme->border_width;
|
110 |
+
$top_height = $theme->top_height;
|
111 |
+
$bg_color_other_months = '#' . str_replace('#','',$theme->bg_color_other_months);
|
112 |
+
$sundays_bg_color = '#' . str_replace('#','',$theme->sundays_bg_color);
|
113 |
+
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
114 |
+
$weekstart = $theme->week_start_day;
|
115 |
+
$weekday_sunday_bg_color = '#' . str_replace('#','',$theme->weekday_sunday_bg_color);
|
116 |
+
$border_radius = $theme->border_radius;
|
117 |
+
$border_radius2 = $border_radius-$border_width;
|
118 |
+
$week_days_cell_height = $theme->week_days_cell_height;
|
119 |
+
$year_font_size = $theme->year_font_size;
|
120 |
+
$month_font_size = $theme->month_font_size;
|
121 |
+
$arrow_size = $theme->arrow_size;
|
122 |
+
$arrow_size_hover = $arrow_size + 5;
|
123 |
+
$next_month_text_color = '#' . str_replace('#','',$theme->next_month_text_color);
|
124 |
+
$prev_month_text_color = '#' . str_replace('#','',$theme->prev_month_text_color);
|
125 |
+
$next_month_arrow_color = '#' . str_replace('#','',$theme->next_month_arrow_color);
|
126 |
+
$prev_month_arrow_color = '#' . str_replace('#','',$theme->prev_month_arrow_color);
|
127 |
+
$next_month_font_size = $theme->next_month_font_size;
|
128 |
+
$prev_month_font_size = $theme->prev_month_font_size;
|
129 |
+
$month_type = $theme->month_type;
|
130 |
+
$header_format = (isset($theme->header_format) ? $theme->header_format : 'w/d/m/y');
|
131 |
+
$ev_title_bg_color = '#' . str_replace('#','',$theme->ev_title_bg_color);
|
132 |
+
|
133 |
+
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
134 |
+
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
135 |
+
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
136 |
+
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
137 |
+
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
138 |
+
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
139 |
+
$date_font_size = $theme->date_font_size;
|
140 |
+
$event_num_font_size = $theme->event_num_font_size;
|
141 |
+
$event_table_height = $theme->event_table_height;
|
142 |
+
$date_height = $theme->date_height;
|
143 |
+
$day_month_font_size = $theme->day_month_font_size;
|
144 |
+
$week_font_size = $theme->week_font_size;
|
145 |
+
$day_month_font_color = '#' . str_replace('#','',$theme->day_month_font_color);
|
146 |
+
$week_font_color = '#' . str_replace('#','',$theme->week_font_color);
|
147 |
+
$views_tabs_bg_color = '#' . str_replace('#','',$theme->views_tabs_bg_color);
|
148 |
+
$views_tabs_text_color = '#' . str_replace('#','',$theme->views_tabs_text_color);
|
149 |
+
$views_tabs_font_size = $theme->views_tabs_font_size;
|
150 |
+
$show_numbers_for_events = $theme->number_of_shown_evetns;
|
151 |
+
$show_cat = $theme->show_cat;
|
152 |
+
$text_color_year = '#' . str_replace('#','',$theme->text_color_year);
|
153 |
+
$ev_color = '#' . str_replace('#','',$theme->event_title_color);
|
154 |
+
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
155 |
+
|
156 |
+
|
157 |
+
$themes_titles = array('1' => 'Wasabi', '2' => 'Bluejay and Orange', '3' => 'White and Blue', '4' => 'Dark', '5' => 'Red and Olive', '6' => 'Blue and Bisque', '7' => 'White and OliveDrab', '8' => 'DarkCyan and Violet', '9' => 'SteelBlue', '10' => 'PaleGreen', '11' => 'Gold and Brown', '13' => 'Shiny Blue', '12' => 'Shiny Red', '14' => 'Shiny Green', '17' => 'Shiny Orange', '18' => 'Shiny Pink', '19' => 'Shiny Purple');
|
158 |
+
|
159 |
+
if (isset($themes_titles[$theme_id]) && $themes_titles[$theme_id] == $theme_name && count($themes)>13) {
|
160 |
+
$date_bgcolor = "transparent";
|
161 |
+
$years_bgcolor = "background-color: #000000; filter: alpha(opacity=30); opacity: 0.3;";
|
162 |
+
}
|
163 |
+
else {
|
164 |
+
$date_bgcolor = $cell_border_color;
|
165 |
+
$years_bgcolor = "background-color: ".hex_to_rgb($views_tabs_bg_color, 0.4).";";
|
166 |
+
}
|
167 |
+
|
168 |
+
__('January', 'sp_calendar');
|
169 |
+
__('February', 'sp_calendar');
|
170 |
+
__('March', 'sp_calendar');
|
171 |
+
__('April', 'sp_calendar');
|
172 |
+
__('May', 'sp_calendar');
|
173 |
+
__('June', 'sp_calendar');
|
174 |
+
__('July', 'sp_calendar');
|
175 |
+
__('August', 'sp_calendar');
|
176 |
+
__('September', 'sp_calendar');
|
177 |
+
__('October', 'sp_calendar');
|
178 |
+
__('November', 'sp_calendar');
|
179 |
+
__('December', 'sp_calendar');
|
180 |
+
if ($cell_height == '') {
|
181 |
+
$cell_height = 70;
|
182 |
+
}
|
183 |
+
if ($cal_width == '') {
|
184 |
+
$cal_width = 700;
|
185 |
+
}
|
186 |
+
if ($date != '') {
|
187 |
+
$date_REFERER = $date;
|
188 |
+
}
|
189 |
+
else {
|
190 |
+
$date_REFERER = date("Y-m");
|
191 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
192 |
+
}
|
193 |
+
|
194 |
+
$year_REFERER = substr($date_REFERER, 0, 4);
|
195 |
+
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
196 |
+
$day_REFERER = substr($date_REFERER, 8, 2);
|
197 |
+
|
198 |
+
$year = substr($date, 0, 4);
|
199 |
+
$month = Month_name(substr($date, 5, 2));
|
200 |
+
$day = substr($date, 8, 2);
|
201 |
+
$cell_width = $cal_width / 7;
|
202 |
+
$cell_width = (int) $cell_width - 2;
|
203 |
+
|
204 |
+
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
205 |
+
$prev_month = add_0((int) $this_month - 1);
|
206 |
+
$next_month = add_0((int) $this_month + 1);
|
207 |
+
$activedatestr = "";
|
208 |
+
|
209 |
+
$date_format_array = explode('/', $header_format);
|
210 |
+
for ($i = 0; $i < 4; $i++) {
|
211 |
+
if (isset($date_format_array[$i]) && ($date_format_array[$i] == 'd' || $date_format_array[$i] == 'w')) {
|
212 |
+
unset($date_format_array[$i]);
|
213 |
+
}
|
214 |
+
if (isset($date_format_array[$i]) && $date_format_array[$i] == 'm') $date_format_array[$i] = 'F';
|
215 |
+
if (isset($date_format_array[$i]) && $date_format_array[$i] == 'y') $date_format_array[$i] = 'Y';
|
216 |
+
}
|
217 |
+
$header_date_format = implode(' ', $date_format_array);
|
218 |
+
$name_year = date($header_date_format, strtotime($date));
|
219 |
+
$exp_name_year = explode(' ', $name_year);
|
220 |
+
for($j = 0; $j < count($exp_name_year); $j++){
|
221 |
+
$activedatestr .= __($exp_name_year[$j], 'sp_calendar') . ' ';
|
222 |
+
}
|
223 |
+
|
224 |
+
$view = 'bigcalendarmonth';
|
225 |
+
$views = explode(',', $view_select);
|
226 |
+
$defaultview = 'month';
|
227 |
+
array_pop($views);
|
228 |
+
|
229 |
+
$display='';
|
230 |
+
|
231 |
+
if(count($views)==0)
|
232 |
+
{
|
233 |
+
$display="display:none";
|
234 |
+
echo '<style>
|
235 |
+
@media only screen and (max-width : 640px) {
|
236 |
+
|
237 |
+
#views_tabs_select
|
238 |
+
{
|
239 |
+
display:none !important;
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
</style>';
|
244 |
+
}
|
245 |
+
if(count($views)==1 and $views[0]==$defaultview)
|
246 |
+
{
|
247 |
+
$display="display:none";
|
248 |
+
echo '<style>
|
249 |
+
@media only screen and (max-width : 640px) {
|
250 |
+
|
251 |
+
#views_tabs_select
|
252 |
+
{
|
253 |
+
display:none !important;
|
254 |
+
}
|
255 |
+
}
|
256 |
+
|
257 |
+
</style>';
|
258 |
+
}
|
259 |
+
?>
|
260 |
+
<html>
|
261 |
+
<head>
|
262 |
+
<style type='text/css'>
|
263 |
+
#afterbig<?php echo $many_sp_calendar; ?> table,
|
264 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
265 |
+
font-family: Segoe UI;
|
266 |
+
border: 0;
|
267 |
+
}
|
268 |
+
|
269 |
+
#afterbig<?php echo $many_sp_calendar; ?> table,
|
270 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
271 |
+
|
272 |
+
}
|
273 |
+
|
274 |
+
#TB_iframeContent{
|
275 |
+
background-color: <?php echo $show_event_bgcolor; ?>;
|
276 |
+
}
|
277 |
+
|
278 |
+
#TB_window {
|
279 |
+
z-index: 10000;
|
280 |
+
}
|
281 |
+
#afterbig<?php echo $many_sp_calendar; ?> .calyear_table td,
|
282 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table td {
|
283 |
+
vertical-align: middle !important;
|
284 |
+
}
|
285 |
+
|
286 |
+
#afterbig<?php echo $many_sp_calendar; ?> table td,
|
287 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
288 |
+
padding: 0px;
|
289 |
+
vertical-align: none;
|
290 |
+
border-bottom:none;
|
291 |
+
line-height: none;
|
292 |
+
text-align: none;
|
293 |
+
background: transparent;
|
294 |
+
}
|
295 |
+
|
296 |
+
#afterbig<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address,
|
297 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
298 |
+
margin-bottom:0;
|
299 |
+
}
|
300 |
+
#afterbig<?php echo $many_sp_calendar; ?> td,
|
301 |
+
#afterbig<?php echo $many_sp_calendar; ?> tr,
|
302 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
303 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
304 |
+
#spiderCalendarTitlesList td,
|
305 |
+
#spiderCalendarTitlesList tr {
|
306 |
+
border:none;
|
307 |
+
}
|
308 |
+
#afterbig<?php echo $many_sp_calendar; ?> .arrow-left,
|
309 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-left {
|
310 |
+
width: 0px;
|
311 |
+
height: 0px;
|
312 |
+
border-bottom: 15px solid transparent;
|
313 |
+
border-bottom: 15px solid transparent;
|
314 |
+
border-right: 20px solid;
|
315 |
+
margin: 0 auto;
|
316 |
+
}
|
317 |
+
|
318 |
+
#afterbig<?php echo $many_sp_calendar; ?> .arrow-right,
|
319 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-right {
|
320 |
+
width: 0px;
|
321 |
+
height: 0px;
|
322 |
+
border-bottom: 15px solid transparent;
|
323 |
+
border-bottom: 15px solid transparent;
|
324 |
+
border-left: 20px solid;
|
325 |
+
margin: 0 auto;
|
326 |
+
}
|
327 |
+
|
328 |
+
#bigcalendar<?php echo $many_sp_calendar ?> .cala_arrow a:hover {
|
329 |
+
text-decoration: none !important;
|
330 |
+
background: none !important;
|
331 |
+
}
|
332 |
+
|
333 |
+
#afterbig<?php echo $many_sp_calendar; ?> #views_select .arrow-right,
|
334 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-right{
|
335 |
+
border-bottom: 5px solid transparent;
|
336 |
+
border-bottom: 5px solid transparent;
|
337 |
+
border-left: 8px solid;
|
338 |
+
left: 5px;
|
339 |
+
position: relative;
|
340 |
+
}
|
341 |
+
#afterbig<?php echo $many_sp_calendar; ?> #views_select .arrow-down,
|
342 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-down{
|
343 |
+
width: 0px;
|
344 |
+
height: 0px;
|
345 |
+
border-left: 5px solid transparent;
|
346 |
+
border-right: 5px solid transparent;
|
347 |
+
border-bottom: 8px solid;
|
348 |
+
}
|
349 |
+
|
350 |
+
#afterbig<?php echo $many_sp_calendar; ?> .general_table
|
351 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
352 |
+
border-radius: <?php echo $border_radius; ?>px;
|
353 |
+
}
|
354 |
+
#afterbig<?php echo $many_sp_calendar; ?> .top_table,
|
355 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
356 |
+
border-bottom-left-radius: <?php echo $border_radius2; ?>px;
|
357 |
+
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
358 |
+
}
|
359 |
+
|
360 |
+
#afterbig<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:first-child,
|
361 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:first-child{
|
362 |
+
border-bottom-left-radius: <?php echo $border_radius2; ?>px;
|
363 |
+
}
|
364 |
+
|
365 |
+
#afterbig<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:last-child,
|
366 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:last-child{
|
367 |
+
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
368 |
+
}
|
369 |
+
|
370 |
+
#afterbig<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
371 |
+
#afterbig<?php echo $many_sp_calendar; ?> .cala_arrow a:visited,
|
372 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
373 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
374 |
+
text-decoration:none !important;
|
375 |
+
box-shadow: none !important;
|
376 |
+
background:none;
|
377 |
+
font-size: <?php echo $arrow_size; ?>px;
|
378 |
+
border: 0 !important;
|
379 |
+
box-shadow: none;
|
380 |
+
}
|
381 |
+
#afterbig<?php echo $many_sp_calendar; ?> .cala_arrow a:hover,
|
382 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
383 |
+
text-decoration:none;
|
384 |
+
background:none;
|
385 |
+
}
|
386 |
+
#afterbig<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
387 |
+
#afterbig<?php echo $many_sp_calendar; ?> .cala_day a:visited,
|
388 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
389 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
390 |
+
text-decoration:none;
|
391 |
+
background:none;
|
392 |
+
font-size:12px;
|
393 |
+
box-shadow: none;
|
394 |
+
}
|
395 |
+
#afterbig<?php echo $many_sp_calendar; ?> .cala_day a:hover,
|
396 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
397 |
+
text-decoration:none;
|
398 |
+
background:none;
|
399 |
+
}
|
400 |
+
#afterbig<?php echo $many_sp_calendar; ?> .cala_day,
|
401 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
402 |
+
border-bottom:1px solid <?php echo $cell_border_color; ?> !important;
|
403 |
+
border-left:1px solid <?php echo $cell_border_color; ?> !important;
|
404 |
+
vertical-align:top;
|
405 |
+
}
|
406 |
+
#afterbig<?php echo $many_sp_calendar; ?> .weekdays,
|
407 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
408 |
+
border-bottom: 1px solid <?php echo $cell_border_color; ?> !important;
|
409 |
+
border-left: 1px solid <?php echo $cell_border_color; ?> !important;
|
410 |
+
vertical-align: middle;
|
411 |
+
}
|
412 |
+
#afterbig<?php echo $many_sp_calendar; ?> .week_days,
|
413 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
414 |
+
font-size:<?php echo $weekdays_font_size; ?>px;
|
415 |
+
font-weight: 600;
|
416 |
+
}
|
417 |
+
#afterbig<?php echo $many_sp_calendar; ?> .calyear_table,
|
418 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
419 |
+
border-spacing:0;
|
420 |
+
width:100%;
|
421 |
+
}
|
422 |
+
#afterbig<?php echo $many_sp_calendar; ?> .calmonth_table,
|
423 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
424 |
+
border-spacing:0;
|
425 |
+
width:100%;
|
426 |
+
}
|
427 |
+
#afterbig<?php echo $many_sp_calendar; ?> .calbg,
|
428 |
+
#afterbig<?php echo $many_sp_calendar; ?> .calbg td,
|
429 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
430 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
|
431 |
+
text-align:center;
|
432 |
+
width:14%;
|
433 |
+
}
|
434 |
+
#afterbig<?php echo $many_sp_calendar; ?> .caltext_color_other_months,
|
435 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
436 |
+
color:<?php echo $text_color_other_months; ?>;
|
437 |
+
border-bottom:1px solid <?php echo $cell_border_color; ?> !important;
|
438 |
+
border-left:1px solid <?php echo $cell_border_color; ?> !important;
|
439 |
+
vertical-align:top;
|
440 |
+
}
|
441 |
+
#afterbig<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented,
|
442 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
443 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
444 |
+
}
|
445 |
+
#afterbig<?php echo $many_sp_calendar; ?> .calfont_year,
|
446 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
447 |
+
font-size:24px;
|
448 |
+
font-weight:bold;
|
449 |
+
color:<?php echo $text_color_year; ?>;
|
450 |
+
}
|
451 |
+
#afterbig<?php echo $many_sp_calendar; ?> .calsun_days,
|
452 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
453 |
+
color:<?php echo $sun_days; ?>;
|
454 |
+
border-bottom:1px solid <?php echo $cell_border_color; ?> !important;
|
455 |
+
border-left:1px solid <?php echo $cell_border_color; ?> !important;
|
456 |
+
vertical-align:top;
|
457 |
+
text-align:left;
|
458 |
+
background-color: <?php echo $sundays_bg_color; ?> !important;
|
459 |
+
font-weight: 600;
|
460 |
+
}
|
461 |
+
#afterbig<?php echo $many_sp_calendar; ?> .views,
|
462 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
463 |
+
float: right;
|
464 |
+
background-color: <?php echo $views_tabs_bg_color; ?> !important;
|
465 |
+
min-height: 25px;
|
466 |
+
min-width: 70px;
|
467 |
+
margin-left: 2px;
|
468 |
+
text-align: center;
|
469 |
+
cursor:pointer;
|
470 |
+
position: relative;
|
471 |
+
top: 5px;
|
472 |
+
}
|
473 |
+
|
474 |
+
#afterbig<?php echo $many_sp_calendar; ?> .views span,
|
475 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
476 |
+
line-height: 30px;
|
477 |
+
}
|
478 |
+
|
479 |
+
#afterbig<?php echo $many_sp_calendar; ?> .views_select ,
|
480 |
+
#afterbig<?php echo $many_sp_calendar; ?> #views_select,
|
481 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
482 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
483 |
+
{
|
484 |
+
background-color: <?php echo $views_tabs_bg_color ?> !important;
|
485 |
+
width: 120px;
|
486 |
+
text-align: center;
|
487 |
+
cursor: pointer;
|
488 |
+
padding: 6px;
|
489 |
+
position: relative;
|
490 |
+
}
|
491 |
+
|
492 |
+
#afterbig<?php echo $many_sp_calendar; ?> #views_select,
|
493 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
494 |
+
{
|
495 |
+
min-height: 30px;
|
496 |
+
}
|
497 |
+
|
498 |
+
#drop_down_views
|
499 |
+
{
|
500 |
+
list-style-type:none !important;
|
501 |
+
display:none;
|
502 |
+
z-index: 4545;
|
503 |
+
position: absolute;
|
504 |
+
left: 0 !important;
|
505 |
+
margin-left: 0;
|
506 |
+
}
|
507 |
+
|
508 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
509 |
+
{
|
510 |
+
background:<?php echo $bg_top ?> !important;
|
511 |
+
}
|
512 |
+
|
513 |
+
#drop_down_views >li
|
514 |
+
{
|
515 |
+
border-bottom:1px solid #fff !important;
|
516 |
+
}
|
517 |
+
|
518 |
+
|
519 |
+
#views_tabs_select
|
520 |
+
{
|
521 |
+
display:none;
|
522 |
+
}
|
523 |
+
#cal_event p{
|
524 |
+
color:<?php echo $ev_color;?>;
|
525 |
+
line-height: 15px;
|
526 |
+
}
|
527 |
+
|
528 |
+
.general_table table tr > td:last-child{
|
529 |
+
border-right: 1px solid <?php echo $cell_border_color; ?> !important;
|
530 |
+
}
|
531 |
+
</style>
|
532 |
+
</head>
|
533 |
+
<body>
|
534 |
+
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>" class="wdc_calendar">
|
535 |
+
<div style="width:100%;">
|
536 |
+
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
537 |
+
<tr>
|
538 |
+
<td>
|
539 |
+
<div id="views_tabs" style="<?php echo $display ?>;width: 100%;">
|
540 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ' !important;top:0;' ?>"
|
541 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
542 |
+
'action' => 'spiderbigcalendar_day',
|
543 |
+
'theme_id' => $theme_id,
|
544 |
+
'calendar' => $calendar_id,
|
545 |
+
'select' => $view_select,
|
546 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
547 |
+
'many_sp_calendar' => $many_sp_calendar,
|
548 |
+
'cat_id' => '',
|
549 |
+
'cat_ids' => $cat_ids,
|
550 |
+
'widget' => $widget,
|
551 |
+
'rand' => $many_sp_calendar,
|
552 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Day', 'sp_calendar'); ?></span>
|
553 |
+
</div>
|
554 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ' !important;top:0;' ?>"
|
555 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
556 |
+
'action' => 'spiderbigcalendar_week',
|
557 |
+
'theme_id' => $theme_id,
|
558 |
+
'calendar' => $calendar_id,
|
559 |
+
'select' => $view_select,
|
560 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
561 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
562 |
+
'many_sp_calendar' => $many_sp_calendar,
|
563 |
+
'cat_id' => '',
|
564 |
+
'cat_ids' => $cat_ids,
|
565 |
+
'widget' => $widget,
|
566 |
+
'rand' => $many_sp_calendar,
|
567 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Week', 'sp_calendar'); ?></span>
|
568 |
+
</div>
|
569 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ' !important;top:0;' ?>"
|
570 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
571 |
+
'action' => 'spiderbigcalendar_list',
|
572 |
+
'theme_id' => $theme_id,
|
573 |
+
'calendar' => $calendar_id,
|
574 |
+
'select' => $view_select,
|
575 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
576 |
+
'many_sp_calendar' => $many_sp_calendar,
|
577 |
+
'cat_id' => '',
|
578 |
+
'cat_ids' => $cat_ids,
|
579 |
+
'widget' => $widget,
|
580 |
+
'rand' => $many_sp_calendar,
|
581 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('List', 'sp_calendar'); ?></span>
|
582 |
+
</div>
|
583 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
584 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
585 |
+
'action' => 'spiderbigcalendar_month',
|
586 |
+
'theme_id' => $theme_id,
|
587 |
+
'calendar' => $calendar_id,
|
588 |
+
'select' => $view_select,
|
589 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
590 |
+
'many_sp_calendar' => $many_sp_calendar,
|
591 |
+
'cat_id' => '',
|
592 |
+
'cat_ids' => $cat_ids,
|
593 |
+
'widget' => $widget,
|
594 |
+
'rand' => $many_sp_calendar,
|
595 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Month', 'sp_calendar'); ?></span>
|
596 |
+
</div>
|
597 |
+
</div>
|
598 |
+
|
599 |
+
<div id="views_tabs_select" style="display:none" >
|
600 |
+
<div id="views_select" style="background-color:<?php echo $bg_top?> !important;color:<?php echo $views_tabs_text_color ?> !important;font-size:<?php echo $views_tabs_font_size ?>px">
|
601 |
+
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
602 |
+
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
603 |
+
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
604 |
+
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
605 |
+
<div class="arrow-right show_arrow"></div>
|
606 |
+
<div class="arrow-down"></div>
|
607 |
+
</div>
|
608 |
+
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
609 |
+
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
610 |
+
<div class="views_select"
|
611 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
612 |
+
'action' => 'spiderbigcalendar_day',
|
613 |
+
'theme_id' => $theme_id,
|
614 |
+
'calendar' => $calendar_id,
|
615 |
+
'select' => $view_select,
|
616 |
+
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
617 |
+
'many_sp_calendar' => $many_sp_calendar,
|
618 |
+
'cat_id' => '',
|
619 |
+
'cat_ids' => $cat_ids,
|
620 |
+
'widget' => $widget,
|
621 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
622 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
623 |
+
</div>
|
624 |
+
</li>
|
625 |
+
|
626 |
+
<li <?php if($view=='bigcalendarweek'):?> class="active" <?php endif; ?> style="<?php if(!in_array('week',$views) AND $defaultview!='week' ) echo 'display:none;' ; ?>" ><div class="views_select"
|
627 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
628 |
+
'action' => 'spiderbigcalendar_week',
|
629 |
+
'theme_id' => $theme_id,
|
630 |
+
'calendar' => $calendar_id,
|
631 |
+
'select' => $view_select,
|
632 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
633 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
634 |
+
'many_sp_calendar' => $many_sp_calendar,
|
635 |
+
'cat_id' => '',
|
636 |
+
'cat_ids' => $cat_ids,
|
637 |
+
'widget' => $widget,
|
638 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
639 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
640 |
+
</div>
|
641 |
+
</li>
|
642 |
+
|
643 |
+
<li <?php if($view=='bigcalendarlist'):?> class="active" <?php endif; ?> style="<?php if(!in_array('list',$views) AND $defaultview!='list' ) echo 'display:none;' ;?>"><div class="views_select"
|
644 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
645 |
+
'action' => 'spiderbigcalendar_list',
|
646 |
+
'theme_id' => $theme_id,
|
647 |
+
'calendar' => $calendar_id,
|
648 |
+
'select' => $view_select,
|
649 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
650 |
+
'many_sp_calendar' => $many_sp_calendar,
|
651 |
+
'cat_id' => '',
|
652 |
+
'cat_ids' => $cat_ids,
|
653 |
+
'widget' => $widget,
|
654 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
655 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
656 |
+
</div>
|
657 |
+
</li>
|
658 |
+
|
659 |
+
<li <?php if($view=='bigcalendarmonth'):?> class="active" <?php endif; ?> style="<?php if(!in_array('month',$views) AND $defaultview!='month' ) echo 'display:none;'; ?>"><div class="views_select"
|
660 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
661 |
+
'action' => 'spiderbigcalendar_month',
|
662 |
+
'theme_id' => $theme_id,
|
663 |
+
'calendar' => $calendar_id,
|
664 |
+
'select' => $view_select,
|
665 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
666 |
+
'many_sp_calendar' => $many_sp_calendar,
|
667 |
+
'cat_id' => '',
|
668 |
+
'cat_ids' => $cat_ids,
|
669 |
+
'widget' => $widget,
|
670 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
671 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Month</span></div></li>
|
672 |
+
|
673 |
+
</ul>
|
674 |
+
</div>
|
675 |
+
</td>
|
676 |
+
</tr>
|
677 |
+
<tr>
|
678 |
+
<td>
|
679 |
+
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width:100%;border:<?php echo $border_color; ?> solid <?php echo $border_width; ?>px; margin:0; padding:0;background-color:<?php echo $bg_bottom; ?> !important;">
|
680 |
+
<tr>
|
681 |
+
<td width="100%" style="padding:0; margin:0;">
|
682 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;">
|
683 |
+
<tr style="height:40px; width:100%;">
|
684 |
+
<td class="top_table" align="center" colspan="7" style="position: relative;padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%; border: 0 !important;">
|
685 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width:100%; height:<?php echo $top_height; ?>px;">
|
686 |
+
<tr>
|
687 |
+
<td width="10%">
|
688 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
689 |
+
echo add_query_arg(array(
|
690 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
691 |
+
'theme_id' => $theme_id,
|
692 |
+
'calendar' => $calendar_id,
|
693 |
+
'select' => $view_select,
|
694 |
+
'date' => ($year - 1) . '-' . add_0(Month_num($month)),
|
695 |
+
'many_sp_calendar' => $many_sp_calendar,
|
696 |
+
'cat_id' => '',
|
697 |
+
'cat_ids' => $cat_ids,
|
698 |
+
'widget' => $widget,
|
699 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; <?php echo $years_bgcolor; ?>;">
|
700 |
+
<span style="font-size:18px;color:#FFF"><?php echo $year - 1; ?></span>
|
701 |
+
</div>
|
702 |
+
</td>
|
703 |
+
<td class="cala_arrow" width="11%" style="text-align:right;margin:0px; padding: 0px 30px 0px 0px;">
|
704 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>;" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
705 |
+
if (Month_num($month) == 1) {
|
706 |
+
$needed_date = ($year - 1) . '-12';
|
707 |
+
}
|
708 |
+
else {
|
709 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
710 |
+
}
|
711 |
+
echo add_query_arg(array(
|
712 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
713 |
+
'theme_id' => $theme_id,
|
714 |
+
'calendar' => $calendar_id,
|
715 |
+
'select' => $view_select,
|
716 |
+
'date' => $needed_date,
|
717 |
+
'many_sp_calendar' => $many_sp_calendar,
|
718 |
+
'cat_id' => '',
|
719 |
+
'cat_ids' => $cat_ids,
|
720 |
+
'widget' => $widget,
|
721 |
+
), $site_url);
|
722 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❰
|
723 |
+
</a>
|
724 |
+
</td>
|
725 |
+
<td style="text-align:center; margin:0;" width="10%">
|
726 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
727 |
+
<span style="line-height: 30px;font-family: Segoe UI; color:<?php echo $text_color_month; ?>; font-size:<?php echo $month_font_size; ?>px;text-shadow: 1px 1px black;"><?php echo $activedatestr; ?></span>
|
728 |
+
</td>
|
729 |
+
<td style="margin:0; padding: 0px 0px 0px 30px;text-align:left" width="11%" class="cala_arrow">
|
730 |
+
<a style="text-shadow: 1px 1px 2px black; color:<?php echo $color_arrow_month; ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
731 |
+
if (Month_num($month) == 12) {
|
732 |
+
$needed_date = ($year + 1) . '-01';
|
733 |
+
}
|
734 |
+
else {
|
735 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
736 |
+
}
|
737 |
+
echo add_query_arg(array(
|
738 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
739 |
+
'theme_id' => $theme_id,
|
740 |
+
'calendar' => $calendar_id,
|
741 |
+
'select' => $view_select,
|
742 |
+
'date' => $needed_date,
|
743 |
+
'many_sp_calendar' => $many_sp_calendar,
|
744 |
+
'cat_id' => '',
|
745 |
+
'cat_ids' => $cat_ids,
|
746 |
+
'widget' => $widget,
|
747 |
+
), $site_url);
|
748 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❱
|
749 |
+
</a>
|
750 |
+
</td>
|
751 |
+
<td width="10%" style="border: 0 !important;">
|
752 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
753 |
+
echo add_query_arg(array(
|
754 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
755 |
+
'theme_id' => $theme_id,
|
756 |
+
'calendar' => $calendar_id,
|
757 |
+
'select' => $view_select,
|
758 |
+
'date' => ($year + 1) . '-' . add_0(Month_num($month)),
|
759 |
+
'many_sp_calendar' => $many_sp_calendar,
|
760 |
+
'cat_id' => '',
|
761 |
+
'cat_ids' => $cat_ids,
|
762 |
+
'widget' => $widget,
|
763 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; <?php echo $years_bgcolor; ?>;">
|
764 |
+
<span style="font-size:18px;color:#FFF"><?php echo $year + 1; ?></span>
|
765 |
+
</div>
|
766 |
+
</td>
|
767 |
+
</tr>
|
768 |
+
</table>
|
769 |
+
</td>
|
770 |
+
</tr>
|
771 |
+
<tr align="center" height="<?php echo $week_days_cell_height; ?>" style="background-color:<?php echo $weekdays_bg_color; ?> !important;">
|
772 |
+
<?php if ($weekstart == "su") { ?>
|
773 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days;?>; margin:0; padding:0;background-color:<?php echo $weekday_sunday_bg_color; ?> !important">
|
774 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
775 |
+
</td>
|
776 |
+
<?php } ?>
|
777 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
778 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Mo', 'sp_calendar'); ?> </b></div>
|
779 |
+
</td>
|
780 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
781 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Tu', 'sp_calendar'); ?> </b></div>
|
782 |
+
</td>
|
783 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
784 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('We', 'sp_calendar'); ?> </b></div>
|
785 |
+
</td>
|
786 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
787 |
+
<div class="calbottom_border" style="text-align:center;margin:0; padding:0;"><b class="week_days"><?php echo __('Th', 'sp_calendar'); ?> </b></div>
|
788 |
+
</td>
|
789 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
790 |
+
<div class="calbottom_border" style="text-align:center;margin:0; padding:0;"><b class="week_days"><?php echo __('Fr', 'sp_calendar'); ?> </b></div>
|
791 |
+
</td>
|
792 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
793 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Sa', 'sp_calendar'); ?> </b></div>
|
794 |
+
</td>
|
795 |
+
<?php if ($weekstart == "mo") { ?>
|
796 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days;?>; margin:0; padding:0;background-color:<?php echo $weekday_sunday_bg_color; ?> !important">
|
797 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
798 |
+
</td>
|
799 |
+
<?php } ?>
|
800 |
+
</tr>
|
801 |
+
<?php
|
802 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
803 |
+
if ($weekstart == "su") {
|
804 |
+
$month_first_weekday++;
|
805 |
+
if ($month_first_weekday == 8) {
|
806 |
+
$month_first_weekday = 1;
|
807 |
+
}
|
808 |
+
}
|
809 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
810 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
811 |
+
$weekday_i = $month_first_weekday;
|
812 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
813 |
+
$percent = 1;
|
814 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
815 |
+
if ($sum % 7 <> 0) {
|
816 |
+
$percent = $percent + 1;
|
817 |
+
}
|
818 |
+
$sum = $sum - ($sum % 7);
|
819 |
+
$percent = $percent + ($sum / 7);
|
820 |
+
$percent = 107 / $percent;
|
821 |
+
$all_calendar_files = php_getdays($show_numbers_for_events, $calendar_id, $date, $theme_id, $widget);
|
822 |
+
$array_days = $all_calendar_files[0]['array_days'];
|
823 |
+
$array_days1 = $all_calendar_files[0]['array_days1'];
|
824 |
+
$title = $all_calendar_files[0]['title'];
|
825 |
+
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
826 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
827 |
+
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
828 |
+
|
829 |
+
echo ' <tr id="days" height="' . $cell_height . '" style="line-height:15px;">';
|
830 |
+
for ($i = 1; $i < $weekday_i; $i++) {
|
831 |
+
echo ' <td class="caltext_color_other_months" style="background-color:' . $bg_color_other_months . ' !important">
|
832 |
+
<p style="padding-right: 7px; font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4;font-family: Segoe UI;padding-left: 5px;background: '.$date_bgcolor.' !important; width: 100%; padding-right: 6px;">' . $last_month_days . '</p>
|
833 |
+
</td>';
|
834 |
+
$last_month_days = $last_month_days + 1;
|
835 |
+
}
|
836 |
+
///////////////////////////////////////////////////////////////////////
|
837 |
+
|
838 |
+
function category_color($event_id)
|
839 |
+
{
|
840 |
+
|
841 |
+
global $wpdb;
|
842 |
+
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
843 |
+
|
844 |
+
$query = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND " . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d",$calendar,$event_id);
|
845 |
+
|
846 |
+
|
847 |
+
$colors=$wpdb->get_results($query);
|
848 |
+
|
849 |
+
if(!empty($colors))
|
850 |
+
$color=$colors[0]->color;
|
851 |
+
else $color = "";
|
852 |
+
|
853 |
+
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : '');
|
854 |
+
|
855 |
+
return '#'.$color;
|
856 |
+
}
|
857 |
+
|
858 |
+
|
859 |
+
function style($title, $color,$ev_height){
|
860 |
+
$new_title = html_entity_decode(strip_tags($title));
|
861 |
+
$number = $new_title[0];
|
862 |
+
$first_letter =$new_title[1];
|
863 |
+
$ev_title = $title;
|
864 |
+
$color=str_replace('#','',$color);
|
865 |
+
$event='<div id="cal_event" style="padding-left: 5px; background-color: '.hex_to_rgb($color,'0.5').' !important;"><p class="ev_name">'.$ev_title.'</p></div>';
|
866 |
+
|
867 |
+
return $event;
|
868 |
+
}
|
869 |
+
|
870 |
+
function evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg,$events_count){
|
871 |
+
if($r < $number_of_shown_evetns && $r < $events_count){ $ev_colid = $r; }
|
872 |
+
else $ev_colid = $r - 1;
|
873 |
+
|
874 |
+
if(str_replace('#','',category_color($ev_id[0]))=="") $cat_col_without_color = $evented_color_bg;
|
875 |
+
else $cat_col_without_color = '#' . str_replace('#','',category_color($ev_id[0]));
|
876 |
+
if($r>1){
|
877 |
+
if(category_color($ev_id[$r-1])=='#')
|
878 |
+
$cat_color_for_last='#' . str_replace('#','',$evented_color_bg);
|
879 |
+
else
|
880 |
+
$cat_color_for_last='#' . str_replace('#','',category_color($ev_id[$ev_colid]));
|
881 |
+
}
|
882 |
+
else $cat_color_for_last = $cat_col_without_color;
|
883 |
+
|
884 |
+
}
|
885 |
+
|
886 |
+
/////////////////////////////////////////////////////////////////////////////
|
887 |
+
|
888 |
+
for ($i = 1; $i <= $month_days; $i++) {
|
889 |
+
if (isset($title[$i])) {
|
890 |
+
$ev_title = explode('</p>', $title[$i]);
|
891 |
+
array_pop($ev_title);
|
892 |
+
$k = count($ev_title);
|
893 |
+
$ev_id = explode('<br>', $ev_ids[$i]);
|
894 |
+
array_pop($ev_id);
|
895 |
+
$ev_ids_inline = implode(',', $ev_id);
|
896 |
+
}
|
897 |
+
else
|
898 |
+
$k=0;
|
899 |
+
|
900 |
+
$dayevent = '';
|
901 |
+
if (($weekday_i % 7 == 0 and $weekstart == "mo") or ($weekday_i % 7 == 1 and $weekstart == "su")) {
|
902 |
+
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER ) {
|
903 |
+
echo ' <td class="cala_day" style="padding:0; margin:0;line-height:15px;" id="event_td_'.$i.'">
|
904 |
+
<div class="calborder_day" style=" margin:0; padding:0;">
|
905 |
+
<p style="font-size:' . $other_days_font_size . 'px; font-weight: 600; color:' . $evented_color . ';line-height:1.4;font-family: Segoe UI; background: '.$date_bgcolor.';">' . $i . '</p>';
|
906 |
+
$r = 0;
|
907 |
+
echo ' <div style="background-color:' . $ev_title_bg_color . ' !important;">';
|
908 |
+
for ($j = 0; $j < $k; $j++) {
|
909 |
+
if(category_color($ev_id[$j])=='#')
|
910 |
+
$cat_color=$evented_color_bg;
|
911 |
+
else
|
912 |
+
$cat_color=category_color($ev_id[$j]);
|
913 |
+
if ($k > $number_of_shown_evetns)
|
914 |
+
$events_count = $number_of_shown_evetns + 1;
|
915 |
+
else $events_count = $k;
|
916 |
+
$event_height = ($cell_height - floor($other_days_font_size * 1.4))/$events_count;
|
917 |
+
if ($r < $number_of_shown_evetns) {
|
918 |
+
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $event_title_color . ';"
|
919 |
+
href="' . add_query_arg(array(
|
920 |
+
'action' => 'spidercalendarbig',
|
921 |
+
'theme_id' => $theme_id,
|
922 |
+
'calendar_id' => $calendar_id,
|
923 |
+
'ev_ids' => $ev_ids_inline,
|
924 |
+
'eventID' => $ev_id[$j],
|
925 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
926 |
+
'many_sp_calendar' => $many_sp_calendar,
|
927 |
+
'widget' => $widget,
|
928 |
+
'TB_iframe' => 1,
|
929 |
+
'tbWidth' => $popup_width,
|
930 |
+
'tbHeight' => $popup_height,
|
931 |
+
'cat_id' => $cat_ids
|
932 |
+
), $site_url) . '"><b>' . style($ev_title[$j],$cat_color,$event_height) . '</b>
|
933 |
+
</a>';
|
934 |
+
}
|
935 |
+
else {
|
936 |
+
echo '
|
937 |
+
<div style=" min-height: '.$event_height.'px;"><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="padding-left: 5px; font-size:11px; background:none; color:' . $ev_color . '; text-align:center;"
|
938 |
+
href="' . add_query_arg(array(
|
939 |
+
'action' => 'spiderseemore',
|
940 |
+
'theme_id' => $theme_id,
|
941 |
+
'calendar_id' => $calendar_id,
|
942 |
+
'ev_ids' => $ev_ids_inline,
|
943 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
944 |
+
'many_sp_calendar' => $many_sp_calendar,
|
945 |
+
'widget' => $widget,
|
946 |
+
'TB_iframe' => 1,
|
947 |
+
'tbWidth' => $popup_width,
|
948 |
+
'tbHeight' => $popup_height,
|
949 |
+
), $site_url) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
950 |
+
</a></div>';
|
951 |
+
break;
|
952 |
+
}
|
953 |
+
$r++;
|
954 |
+
}
|
955 |
+
evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg, $events_count);
|
956 |
+
echo ' </div>
|
957 |
+
</div>
|
958 |
+
</td>';
|
959 |
+
|
960 |
+
}
|
961 |
+
else
|
962 |
+
if ($i ==date( 'j' ) and $month == date('F') and $year == date('Y')) {
|
963 |
+
|
964 |
+
if(!isset($border_day)) $border_day = "";
|
965 |
+
if ($i == date('j') and $month == date('F') and $year == date('Y')) { $border_day = $current_day_border_color;}
|
966 |
+
if (in_array($i,$array_days)) {
|
967 |
+
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ' !important;overflow: hidden; padding:0; margin:0;line-height:15px; border: 2px solid ' . $current_day_border_color . ' !important" id="event_td_'.$i.'">
|
968 |
+
<p style="background-color:' . $evented_color_bg . ' !important;color:' . $evented_color . ' !important;font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4;font-family: Segoe UI;padding-left: 5px;background: '.$date_bgcolor.' !important; width: 100%; padding-right: 6px;">' . $i . '</p>';
|
969 |
+
$r = 0;
|
970 |
+
echo ' <div style="background-color:' . $ev_title_bg_color . ' !important">';
|
971 |
+
for ($j = 0; $j < $k; $j++) {
|
972 |
+
|
973 |
+
if(category_color($ev_id[$j])=='#')
|
974 |
+
$cat_color=$evented_color_bg;
|
975 |
+
else
|
976 |
+
$cat_color=category_color($ev_id[$j]);
|
977 |
+
|
978 |
+
if ($k > $number_of_shown_evetns)
|
979 |
+
$events_count = $number_of_shown_evetns + 1;
|
980 |
+
else $events_count = $k;
|
981 |
+
$event_height = ($cell_height - floor($other_days_font_size * 1.4))/$events_count;
|
982 |
+
if ($r < $number_of_shown_evetns) {
|
983 |
+
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $event_title_color . ';"
|
984 |
+
href="' . add_query_arg(array(
|
985 |
+
'action' => 'spidercalendarbig',
|
986 |
+
'theme_id' => $theme_id,
|
987 |
+
'calendar_id' => $calendar_id,
|
988 |
+
'ev_ids' => $ev_ids_inline,
|
989 |
+
'eventID' => $ev_id[$j],
|
990 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
991 |
+
'many_sp_calendar' => $many_sp_calendar,
|
992 |
+
'widget' => $widget,
|
993 |
+
'TB_iframe' => 1,
|
994 |
+
'tbWidth' => $popup_width,
|
995 |
+
'tbHeight' => $popup_height,
|
996 |
+
), $site_url) . '"><b>' . style($ev_title[$j],$cat_color,$event_height) . '</b>
|
997 |
+
</a>';
|
998 |
+
}
|
999 |
+
else {
|
1000 |
+
echo '
|
1001 |
+
<div style=" min-height: '.$event_height.'px;"><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="padding-left: 5px; font-size:11px;background:none;color:' . $ev_color . ';text-align:center;"
|
1002 |
+
href="' . add_query_arg(array(
|
1003 |
+
'action' => 'spiderseemore',
|
1004 |
+
'theme_id' => $theme_id,
|
1005 |
+
'calendar_id' => $calendar_id,
|
1006 |
+
'ev_ids' => $ev_ids_inline,
|
1007 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1008 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1009 |
+
'widget' => $widget,
|
1010 |
+
'TB_iframe' => 1,
|
1011 |
+
'tbWidth' => $popup_width,
|
1012 |
+
'tbHeight' => $popup_height,
|
1013 |
+
), $site_url) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1014 |
+
</a></div>';
|
1015 |
+
break;
|
1016 |
+
}
|
1017 |
+
$r++;
|
1018 |
+
}
|
1019 |
+
evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg, $events_count);
|
1020 |
+
echo ' </div>
|
1021 |
+
</td>';
|
1022 |
+
}
|
1023 |
+
else {
|
1024 |
+
|
1025 |
+
echo ' <td class="calsun_days" style="overflow: hidden; padding:0; font-size:' . $sundays_font_size . 'px; margin:0;line-height:1.4;font-family: Segoe UI;padding-left: 5px; border: 2px solid ' . $current_day_border_color . ' !important">
|
1026 |
+
<b>' . $i . '</b>
|
1027 |
+
</td>';
|
1028 |
+
}
|
1029 |
+
}
|
1030 |
+
else
|
1031 |
+
|
1032 |
+
if (in_array($i, $array_days)) {
|
1033 |
+
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ' !important;padding:0; margin:0;line-height:15px;" id="event_td_'.$i.'">
|
1034 |
+
<p style="background-color:' . $evented_color_bg . ' !important;color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4;font-family: Segoe UI;padding-left: 5px;background: '.$date_bgcolor.' !important; padding-right: 6px;">' . $i . '</p>
|
1035 |
+
<div>';
|
1036 |
+
$r = 0;
|
1037 |
+
for ($j = 0; $j < $k; $j++) {
|
1038 |
+
if(category_color($ev_id[$j])=='#')
|
1039 |
+
$cat_color=$evented_color_bg;
|
1040 |
+
else
|
1041 |
+
$cat_color=category_color($ev_id[$j]);
|
1042 |
+
if ($k > $number_of_shown_evetns)
|
1043 |
+
$events_count = $number_of_shown_evetns + 1;
|
1044 |
+
else $events_count = $k;
|
1045 |
+
$event_height = ($cell_height - floor($other_days_font_size * 1.4))/$events_count;
|
1046 |
+
|
1047 |
+
if ($r < $number_of_shown_evetns) {
|
1048 |
+
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ' !important;"
|
1049 |
+
href="' . add_query_arg(array(
|
1050 |
+
'action' => 'spidercalendarbig',
|
1051 |
+
'theme_id' => $theme_id,
|
1052 |
+
'calendar_id' => $calendar_id,
|
1053 |
+
'ev_ids' => $ev_ids_inline,
|
1054 |
+
'eventID' => $ev_id[$j],
|
1055 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1056 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1057 |
+
'widget' => $widget,
|
1058 |
+
'TB_iframe' => 1,
|
1059 |
+
'tbWidth' => $popup_width,
|
1060 |
+
'tbHeight' => $popup_height,
|
1061 |
+
), $site_url) . '"><b>' . style($ev_title[$j],$cat_color,$event_height) . '</b>
|
1062 |
+
</a>';
|
1063 |
+
}
|
1064 |
+
else {
|
1065 |
+
echo '
|
1066 |
+
<div style=" min-height: '.$event_height.'px;"><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="padding-left: 5px; font-size:11px; background:none; color:' . $ev_color . ' !important;text-align:center;"
|
1067 |
+
href="' . add_query_arg(array(
|
1068 |
+
'action' => 'spiderseemore',
|
1069 |
+
'theme_id' => $theme_id,
|
1070 |
+
'calendar_id' => $calendar_id,
|
1071 |
+
'ev_ids' => $ev_ids_inline,
|
1072 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1073 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1074 |
+
'widget' => $widget,
|
1075 |
+
'TB_iframe' => 1,
|
1076 |
+
'tbWidth' => $popup_width,
|
1077 |
+
'tbHeight' => $popup_height,
|
1078 |
+
), $site_url) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1079 |
+
</a></div>';
|
1080 |
+
break;
|
1081 |
+
}
|
1082 |
+
$r++;
|
1083 |
+
}
|
1084 |
+
evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg,$events_count);
|
1085 |
+
echo ' </div>
|
1086 |
+
</td>';
|
1087 |
+
}
|
1088 |
+
else {
|
1089 |
+
echo ' <td class="calsun_days" style="padding:0; margin:0;line-height:1.4;font-family: Segoe UI; font-size:' . $sundays_font_size . 'px">
|
1090 |
+
<p style="background: '.$date_bgcolor.'; padding-left: 5px; padding-right: 6px; ">' . $i . '</p>
|
1091 |
+
</td>';
|
1092 |
+
}
|
1093 |
+
}
|
1094 |
+
else
|
1095 |
+
|
1096 |
+
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
1097 |
+
|
1098 |
+
echo ' <td bgcolor="' . $ev_title_bg_color . '" class="cala_day" style="overflow: hidden; border: 2px solid ' . $current_day_border_color . ' !important;padding:0; margin:0;line-height:15px;" id="event_td_'.$i.'">
|
1099 |
+
<div class="calborder_day" style="margin:0; padding:0;">
|
1100 |
+
<p style="background-color:' . $evented_color_bg . ' !important;color:' . $evented_color . ' !important;font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4;font-family: Segoe UI;padding-left: 5px;background: '.$date_bgcolor.' !important; width: 100%; padding-left: 5px; padding-right: 6px;">' . $i . '</p>
|
1101 |
+
<div style="background-color:' . $ev_title_bg_color . ' !important">';
|
1102 |
+
$r = 0;
|
1103 |
+
for ($j = 0; $j < $k; $j++) {
|
1104 |
+
if(category_color($ev_id[$j])=='#')
|
1105 |
+
$cat_color=$evented_color_bg;
|
1106 |
+
else
|
1107 |
+
$cat_color=category_color($ev_id[$j]);
|
1108 |
+
|
1109 |
+
if ($k > $number_of_shown_evetns)
|
1110 |
+
$events_count = $number_of_shown_evetns + 1;
|
1111 |
+
else $events_count = $k;
|
1112 |
+
$event_height = ($cell_height - floor($other_days_font_size * 1.4))/$events_count;
|
1113 |
+
if ($r < $number_of_shown_evetns) {
|
1114 |
+
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ' !important;"
|
1115 |
+
href="' . add_query_arg(array(
|
1116 |
+
'action' => 'spidercalendarbig',
|
1117 |
+
'theme_id' => $theme_id,
|
1118 |
+
'calendar_id' => $calendar_id,
|
1119 |
+
'ev_ids' => $ev_ids_inline,
|
1120 |
+
'eventID' => $ev_id[$j],
|
1121 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1122 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1123 |
+
'widget' => $widget,
|
1124 |
+
'TB_iframe' => 1,
|
1125 |
+
'tbWidth' => $popup_width,
|
1126 |
+
'tbHeight' => $popup_height,
|
1127 |
+
), $site_url) . '"><b>' . style($ev_title[$j],$cat_color,$event_height) . '</b>
|
1128 |
+
</a>';
|
1129 |
+
}
|
1130 |
+
else {
|
1131 |
+
echo '
|
1132 |
+
<div style=" min-height: '.$event_height.'px;"><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="padding-left: 5px; font-size:11px; background:none; color:' . $ev_color . ';text-align:center;"
|
1133 |
+
href="' . add_query_arg(array(
|
1134 |
+
'action' => 'spiderseemore',
|
1135 |
+
'theme_id' => $theme_id,
|
1136 |
+
'calendar_id' => $calendar_id,
|
1137 |
+
'ev_ids' => $ev_ids_inline,
|
1138 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1139 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1140 |
+
'widget' => $widget,
|
1141 |
+
'TB_iframe' => 1,
|
1142 |
+
'tbWidth' => $popup_width,
|
1143 |
+
'tbHeight' => $popup_height,
|
1144 |
+
), $site_url) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1145 |
+
</a></div>';
|
1146 |
+
break;
|
1147 |
+
}
|
1148 |
+
$r++;
|
1149 |
+
}
|
1150 |
+
evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg, $events_count);
|
1151 |
+
echo ' </div>
|
1152 |
+
</div>
|
1153 |
+
</td>';
|
1154 |
+
}
|
1155 |
+
else {
|
1156 |
+
|
1157 |
+
if ($i ==date( 'j' ) and $month == date('F') and $year == date('Y')) {
|
1158 |
+
|
1159 |
+
|
1160 |
+
if (in_array ($i,$array_days)) {
|
1161 |
+
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ' !important;overflow: hidden; padding:0; margin:0;line-height:15px; border: 2px solid ' . $current_day_border_color . ' !important;" id="event_td_'.$i.'">
|
1162 |
+
<p style="background-color:' . $evented_color_bg . ' !important;color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4;font-family: Segoe UI;padding-left: 5px;background: '.$date_bgcolor.' !important; width: 100%; padding-right: 6px;">' . $i . '</p>
|
1163 |
+
<div style="background-color:' . $ev_title_bg_color . ' !important">';
|
1164 |
+
$r = 0;
|
1165 |
+
for ($j = 0; $j < $k; $j++) {
|
1166 |
+
if(category_color($ev_id[$j])=='#')
|
1167 |
+
$cat_color=$evented_color_bg;
|
1168 |
+
else
|
1169 |
+
$cat_color=category_color($ev_id[$j]);
|
1170 |
+
|
1171 |
+
if ($k > $number_of_shown_evetns)
|
1172 |
+
$events_count = $number_of_shown_evetns + 1;
|
1173 |
+
else $events_count = $k;
|
1174 |
+
$event_height = ($cell_height - floor($other_days_font_size * 1.4))/$events_count;
|
1175 |
+
if ($r < $number_of_shown_evetns) {
|
1176 |
+
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
1177 |
+
href="' . add_query_arg(array(
|
1178 |
+
'action' => 'spidercalendarbig',
|
1179 |
+
'theme_id' => $theme_id,
|
1180 |
+
'calendar_id' => $calendar_id,
|
1181 |
+
'ev_ids' => $ev_ids_inline,
|
1182 |
+
'eventID' => $ev_id[$j],
|
1183 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1184 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1185 |
+
'widget' => $widget,
|
1186 |
+
'TB_iframe' => 1,
|
1187 |
+
'tbWidth' => $popup_width,
|
1188 |
+
'tbHeight' => $popup_height,
|
1189 |
+
'tbHeight' => $popup_height,
|
1190 |
+
), $site_url) . '"><b>' . style($ev_title[$j],$cat_color,$event_height) . '</b>
|
1191 |
+
</a>';
|
1192 |
+
}
|
1193 |
+
else {
|
1194 |
+
echo '
|
1195 |
+
<div style=" min-height: '.$event_height.'px;"><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="padding-left: 5px; font-size:11px; background:none;color:' . $ev_color . ';text-align:center;"
|
1196 |
+
href="' . add_query_arg(array(
|
1197 |
+
'action' => 'spiderseemore',
|
1198 |
+
'theme_id' => $theme_id,
|
1199 |
+
'calendar_id' => $calendar_id,
|
1200 |
+
'ev_ids' => $ev_ids_inline,
|
1201 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1202 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1203 |
+
'widget' => $widget,
|
1204 |
+
'TB_iframe' => 1,
|
1205 |
+
'tbWidth' => $popup_width,
|
1206 |
+
'tbHeight' => $popup_height,
|
1207 |
+
), $site_url) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1208 |
+
</a></div>';
|
1209 |
+
break;
|
1210 |
+
}
|
1211 |
+
$r++;
|
1212 |
+
}
|
1213 |
+
evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg, $events_count);
|
1214 |
+
echo ' </div>
|
1215 |
+
</td>';
|
1216 |
+
}
|
1217 |
+
else {
|
1218 |
+
echo ' <td style="overflow: hidden; color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:15px; border: 2px solid ' . $current_day_border_color . ' !important; vertical-align:top;">
|
1219 |
+
<p style="font-size:'.$other_days_font_size.'px; font-weight: 600;line-height:1.4;font-family: Segoe UI;padding-left: 5px; background: '.$date_bgcolor.';">' . $i . '</p>
|
1220 |
+
</td>';
|
1221 |
+
}
|
1222 |
+
}
|
1223 |
+
else
|
1224 |
+
|
1225 |
+
if (in_array($i, $array_days)) {
|
1226 |
+
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ' !important;padding:0; margin:0;line-height:15px;" id="event_td_'.$i.'">
|
1227 |
+
<p style="color:' . $evented_color . ' !important;font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4; padding-left: 5px; font-family: Segoe UI;padding-left: 5px; background: '.$date_bgcolor.' !important;">' . $i . '</p>';
|
1228 |
+
$r = 0;
|
1229 |
+
echo ' <div class="events_div">';
|
1230 |
+
|
1231 |
+
for ($j = 0; $j < $k; $j++) {
|
1232 |
+
|
1233 |
+
if(category_color($ev_id[$j])=='#')
|
1234 |
+
$cat_color=$evented_color_bg;
|
1235 |
+
else
|
1236 |
+
$cat_color=category_color($ev_id[$j]);
|
1237 |
+
|
1238 |
+
if ($k > $number_of_shown_evetns)
|
1239 |
+
$events_count = $number_of_shown_evetns + 1;
|
1240 |
+
else $events_count = $k;
|
1241 |
+
$event_height = ($cell_height - floor($other_days_font_size * 1.4))/$events_count;
|
1242 |
+
|
1243 |
+
if ($r < $number_of_shown_evetns) {
|
1244 |
+
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
1245 |
+
href="' . add_query_arg(array(
|
1246 |
+
'action' => 'spidercalendarbig',
|
1247 |
+
'theme_id' => $theme_id,
|
1248 |
+
'calendar_id' => $calendar_id,
|
1249 |
+
'ev_ids' => $ev_ids_inline,
|
1250 |
+
'eventID' => $ev_id[$j],
|
1251 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1252 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1253 |
+
'widget' => $widget,
|
1254 |
+
'TB_iframe' => 1,
|
1255 |
+
'tbWidth' => $popup_width,
|
1256 |
+
'tbHeight' => $popup_height,
|
1257 |
+
), $site_url) . '"><b>' . style($ev_title[$j],$cat_color,$event_height) . '</b>
|
1258 |
+
</a>';
|
1259 |
+
}
|
1260 |
+
else {
|
1261 |
+
echo '<div style="min-height: '.$event_height.'px;"><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="padding-left: 5px; font-size:11px; background:none; color:' . $ev_color . ';text-align:center;"
|
1262 |
+
href="' . add_query_arg(array(
|
1263 |
+
'action' => 'spiderseemore',
|
1264 |
+
'theme_id' => $theme_id,
|
1265 |
+
'calendar_id' => $calendar_id,
|
1266 |
+
'ev_ids' => $ev_ids_inline,
|
1267 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1268 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1269 |
+
'widget' => $widget,
|
1270 |
+
'TB_iframe' => 1,
|
1271 |
+
'tbWidth' => $popup_width,
|
1272 |
+
'tbHeight' => $popup_height,
|
1273 |
+
), $site_url) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1274 |
+
</a></div>';
|
1275 |
+
break;
|
1276 |
+
}
|
1277 |
+
$r++;
|
1278 |
+
}
|
1279 |
+
evented_days($r, $number_of_shown_evetns, $ev_id, $i,$evented_color_bg, $events_count);
|
1280 |
+
echo ' </div>
|
1281 |
+
</td>';
|
1282 |
+
}
|
1283 |
+
else {
|
1284 |
+
echo ' <td style=" color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:15px;border-bottom: 1px solid ' . $cell_border_color . ' !important; border-left: 1px solid ' . $cell_border_color . ' !important;vertical-align:top;">
|
1285 |
+
<p style="font-size:' . $other_days_font_size . 'px; font-weight: 600;line-height:1.4;font-family: Segoe UI; padding-left: 5px; background: '.$date_bgcolor.';">' . $i . '</p>
|
1286 |
+
</td>';
|
1287 |
+
}
|
1288 |
+
}
|
1289 |
+
if ($weekday_i % 7 == 0 && $i <> $month_days) {
|
1290 |
+
echo ' </tr>
|
1291 |
+
<tr height="' . $cell_height . '" style="line-height:15px">';
|
1292 |
+
$weekday_i = 0;
|
1293 |
+
}
|
1294 |
+
$weekday_i += 1;
|
1295 |
+
}
|
1296 |
+
$weekday_i;
|
1297 |
+
$next_i = 1;
|
1298 |
+
if ($weekday_i != 1) {
|
1299 |
+
for ($i = $weekday_i; $i <= 7; $i++) {
|
1300 |
+
if ($i != 7) {
|
1301 |
+
echo ' <td class="caltext_color_other_months" style="font-size:' . $other_days_font_size . 'px;line-height:1.4;font-family: Segoe UI;font-weight: 600;background-color:' . $bg_color_other_months . ' !important;"><p style="background: '.$date_bgcolor.';"><span style="padding: 0px 19px 0px 5px;">' . $next_i . '</span></p></td>';
|
1302 |
+
}
|
1303 |
+
else {
|
1304 |
+
echo ' <td class="caltext_color_other_months" style="font-size:' . $other_days_font_size . 'px;line-height:1.4; font-weight: 600;font-family: Segoe UI; background-color:' . $bg_color_other_months . ' !important;"><p style="background: '.$date_bgcolor.';"><span style="padding: 0px 19px 0px 5px;">' . $next_i . '</span></p></td>';
|
1305 |
+
}
|
1306 |
+
$next_i += 1;
|
1307 |
+
}
|
1308 |
+
}
|
1309 |
+
echo ' </tr>
|
1310 |
+
</table>';
|
1311 |
+
?> <input type="text" value="1" name="day" style="display:none" />
|
1312 |
+
</td>
|
1313 |
+
</tr>
|
1314 |
+
</table>
|
1315 |
+
</td>
|
1316 |
+
</tr>
|
1317 |
+
</table>
|
1318 |
+
<style>
|
1319 |
+
@media only screen and (max-width : 640px) {
|
1320 |
+
#views_tabs ,#drop_down_views
|
1321 |
+
{
|
1322 |
+
display:none;
|
1323 |
+
}
|
1324 |
+
|
1325 |
+
#views_tabs_select
|
1326 |
+
{
|
1327 |
+
display:block !important;
|
1328 |
+
}
|
1329 |
+
}
|
1330 |
+
|
1331 |
+
@media only screen and (max-width : 968px) {
|
1332 |
+
#cats >li
|
1333 |
+
{
|
1334 |
+
float:none;
|
1335 |
+
}
|
1336 |
+
}
|
1337 |
+
|
1338 |
+
.spider_categories{
|
1339 |
+
display:inline-block;
|
1340 |
+
cursor:pointer;
|
1341 |
+
}
|
1342 |
+
|
1343 |
+
.spider_categories p{
|
1344 |
+
color: #fff;
|
1345 |
+
padding: 2px 10px !important;
|
1346 |
+
margin: 2px 0 !important;
|
1347 |
+
font-size: 14px;
|
1348 |
+
font-weight: 600;
|
1349 |
+
}
|
1350 |
+
</style>
|
1351 |
+
<?php
|
1352 |
+
|
1353 |
+
//reindex cat_ids_array
|
1354 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
1355 |
+
|
1356 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
1357 |
+
{
|
1358 |
+
echo'
|
1359 |
+
<style>
|
1360 |
+
#cats #category'.$re_cat_ids_array[$i].'
|
1361 |
+
{
|
1362 |
+
text-decoration:underline;
|
1363 |
+
cursor:pointer;
|
1364 |
+
|
1365 |
+
}
|
1366 |
+
|
1367 |
+
</style>';
|
1368 |
+
|
1369 |
+
}
|
1370 |
+
|
1371 |
+
|
1372 |
+
|
1373 |
+
if($cat_ids=='')
|
1374 |
+
$cat_ids='';
|
1375 |
+
|
1376 |
+
if($show_cat){
|
1377 |
+
echo '<ul id="cats" style="list-style-type:none; padding: 0;">';
|
1378 |
+
|
1379 |
+
foreach($categories as $category)
|
1380 |
+
{
|
1381 |
+
|
1382 |
+
?>
|
1383 |
+
|
1384 |
+
<li class="spider_categories"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1385 |
+
'action' => 'spiderbigcalendar_month',
|
1386 |
+
'theme_id' => $theme_id,
|
1387 |
+
'calendar' => $calendar_id,
|
1388 |
+
'select' => $view_select,
|
1389 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
1390 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1391 |
+
'cat_id' => $category->id,
|
1392 |
+
'cat_ids' => $cat_ids,
|
1393 |
+
'widget' => $widget,
|
1394 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1395 |
+
|
1396 |
+
|
1397 |
+
<?php }
|
1398 |
+
if (!empty($categories)) {
|
1399 |
+
?>
|
1400 |
+
<li class="spider_categories"><p id="category0" style="background-color:#<?php echo str_replace('#','',$bg_top); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1401 |
+
'action' => 'spiderbigcalendar_month',
|
1402 |
+
'theme_id' => $theme_id,
|
1403 |
+
'calendar' => $calendar_id,
|
1404 |
+
'select' => $view_select,
|
1405 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
1406 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1407 |
+
'cat_id' => '',
|
1408 |
+
'cat_ids' => '',
|
1409 |
+
'widget' => $widget,
|
1410 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
1411 |
+
<?php
|
1412 |
+
}
|
1413 |
+
echo '</ul>';
|
1414 |
+
}
|
1415 |
+
?>
|
1416 |
+
</body>
|
1417 |
+
</html>
|
1418 |
+
<?php
|
1419 |
+
die();
|
1420 |
} ?>
|
front_end/bigcalendarmonth_widget.php
CHANGED
@@ -1,979 +1,979 @@
|
|
1 |
-
<?php
|
2 |
-
function big_calendar_month_widget() {
|
3 |
-
require_once("frontend_functions.php");
|
4 |
-
global $wpdb;
|
5 |
-
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
-
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
-
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
-
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 1);
|
9 |
-
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
10 |
-
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
-
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
12 |
-
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
13 |
-
$site_url = get_admin_url().'admin-ajax.php';
|
14 |
-
///////////////////////////////////////////////////////////////////////////////////
|
15 |
-
|
16 |
-
if($cat_ids=='')
|
17 |
-
$cat_ids .= $cat_id.',';
|
18 |
-
else
|
19 |
-
$cat_ids .= ','.$cat_id.',';
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
24 |
-
|
25 |
-
function getelementcountinarray($array , $element)
|
26 |
-
{
|
27 |
-
$t=0;
|
28 |
-
|
29 |
-
for($i=0; $i<count($array); $i++)
|
30 |
-
{
|
31 |
-
if($element==$array[$i])
|
32 |
-
$t++;
|
33 |
-
|
34 |
-
}
|
35 |
-
|
36 |
-
|
37 |
-
return $t;
|
38 |
-
|
39 |
-
}
|
40 |
-
|
41 |
-
function getelementindexinarray($array , $element)
|
42 |
-
{
|
43 |
-
|
44 |
-
$t='';
|
45 |
-
|
46 |
-
for($i=0; $i<count($array); $i++)
|
47 |
-
{
|
48 |
-
if($element==$array[$i])
|
49 |
-
$t.=$i.',';
|
50 |
-
|
51 |
-
}
|
52 |
-
|
53 |
-
return $t;
|
54 |
-
|
55 |
-
|
56 |
-
}
|
57 |
-
$cat_ids_array = explode(',',$cat_ids);
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
if($cat_id!='')
|
62 |
-
{
|
63 |
-
|
64 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
65 |
-
{
|
66 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
67 |
-
$index_array = explode(',' , $index_in_line);
|
68 |
-
array_pop ($index_array);
|
69 |
-
for($j=0; $j<count($index_array); $j++)
|
70 |
-
unset($cat_ids_array[$index_array[$j]]);
|
71 |
-
$cat_ids = implode(',',$cat_ids_array);
|
72 |
-
}
|
73 |
-
}
|
74 |
-
else
|
75 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
76 |
-
|
77 |
-
|
78 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
79 |
-
|
80 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
81 |
-
$weekstart = $theme->week_start_day;
|
82 |
-
$bg = '#' . str_replace('#','',$theme->header_bgcolor);
|
83 |
-
$bg_color_selected = '#' . str_replace('#','',$theme->bg_color_selected);
|
84 |
-
$color_arrow = '#' . str_replace('#','',$theme->arrow_color);
|
85 |
-
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
86 |
-
$evented_color_bg = '#' . str_replace('#','',$theme->bg_color_this_month_evented);
|
87 |
-
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
88 |
-
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
89 |
-
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
90 |
-
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
91 |
-
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
92 |
-
$text_color_selected = '#' . str_replace('#','',$theme->text_color_selected);
|
93 |
-
$border_day = '#' . str_replace('#','',$theme->border_day);
|
94 |
-
$calendar_width = $theme->width;
|
95 |
-
$calendar_bg = '#' . str_replace('#','',$theme->footer_bgcolor);
|
96 |
-
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
97 |
-
$weekday_su_bg_color = '#' . str_replace('#','',$theme->su_bg_color);
|
98 |
-
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
99 |
-
$year_font_size = $theme->year_font_size;
|
100 |
-
$year_font_color = '#' . str_replace('#','',$theme->year_font_color);
|
101 |
-
$year_tabs_bg_color = '#' . str_replace('#','',$theme->year_tabs_bg_color);
|
102 |
-
$font_year = $theme->font_year;
|
103 |
-
$font_month = $theme->font_month;
|
104 |
-
$font_day = $theme->font_day;
|
105 |
-
$font_weekday = $theme->font_weekday;
|
106 |
-
$show_cat = $theme->show_cat;
|
107 |
-
$popup_width = $theme->popup_width;
|
108 |
-
$popup_height = $theme->popup_height;
|
109 |
-
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
110 |
-
|
111 |
-
__('January', 'sp_calendar');
|
112 |
-
__('February', 'sp_calendar');
|
113 |
-
__('March', 'sp_calendar');
|
114 |
-
__('April', 'sp_calendar');
|
115 |
-
__('May', 'sp_calendar');
|
116 |
-
__('June', 'sp_calendar');
|
117 |
-
__('July', 'sp_calendar');
|
118 |
-
__('August', 'sp_calendar');
|
119 |
-
__('September', 'sp_calendar');
|
120 |
-
__('October', 'sp_calendar');
|
121 |
-
__('November', 'sp_calendar');
|
122 |
-
__('December', 'sp_calendar');
|
123 |
-
if ($date != '') {
|
124 |
-
$date_REFERER = $date;
|
125 |
-
}
|
126 |
-
else {
|
127 |
-
$date_REFERER = date("Y-m");
|
128 |
-
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
129 |
-
}
|
130 |
-
|
131 |
-
$year_REFERER = substr($date_REFERER, 0, 4);
|
132 |
-
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
133 |
-
$day_REFERER = substr($date_REFERER, 8, 2);
|
134 |
-
|
135 |
-
$year = substr($date, 0, 4);
|
136 |
-
$month = Month_name(substr($date, 5, 2));
|
137 |
-
$day = substr($date, 8, 2);
|
138 |
-
|
139 |
-
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
140 |
-
$prev_month = add_0((int) $this_month - 1);
|
141 |
-
$next_month = add_0((int) $this_month + 1);
|
142 |
-
|
143 |
-
$cell_width = $calendar_width / 7;
|
144 |
-
$cell_width = (int) $cell_width - 2;
|
145 |
-
|
146 |
-
$view = 'bigcalendarmonth_widget';
|
147 |
-
$views = explode(',', $view_select);
|
148 |
-
$defaultview = 'month';
|
149 |
-
array_pop($views);
|
150 |
-
$display = '';
|
151 |
-
if (count($views) == 0) {
|
152 |
-
$display = "display:none";
|
153 |
-
}
|
154 |
-
if(count($views) == 1 && $views[0] == $defaultview) {
|
155 |
-
$display = "display:none";
|
156 |
-
}
|
157 |
-
?>
|
158 |
-
<html>
|
159 |
-
<head>
|
160 |
-
<style type='text/css'>
|
161 |
-
#calendar_<?php echo $many_sp_calendar; ?> table {
|
162 |
-
border-collapse: initial;
|
163 |
-
border:0px;
|
164 |
-
}
|
165 |
-
#TB_iframeContent{
|
166 |
-
background-color: <?php echo $show_event_bgcolor; ?>;
|
167 |
-
}
|
168 |
-
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
169 |
-
padding: 0px;
|
170 |
-
vertical-align: none;
|
171 |
-
border-top:none;
|
172 |
-
line-height: none;
|
173 |
-
text-align: none;
|
174 |
-
}
|
175 |
-
#calendar_<?php echo $many_sp_calendar; ?> .arrow-left {
|
176 |
-
width: 0px;
|
177 |
-
height: 0px;
|
178 |
-
border-top: 7px solid transparent;
|
179 |
-
border-bottom: 7px solid transparent;
|
180 |
-
border-right: 13px solid;
|
181 |
-
margin: 0 auto;
|
182 |
-
}
|
183 |
-
|
184 |
-
#calendar_<?php echo $many_sp_calendar; ?> .arrow-right {
|
185 |
-
width: 0px;
|
186 |
-
height: 0px;
|
187 |
-
border-top: 7px solid transparent;
|
188 |
-
border-bottom: 7px solid transparent;
|
189 |
-
border-left: 13px solid;
|
190 |
-
margin: 0 auto;
|
191 |
-
}
|
192 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
193 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
194 |
-
font-family: <?php echo $font_day; ?>;
|
195 |
-
}
|
196 |
-
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
197 |
-
margin-bottom: 0;
|
198 |
-
}
|
199 |
-
#calendar_<?php echo $many_sp_calendar; ?> td,
|
200 |
-
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
201 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> td,
|
202 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> tr {
|
203 |
-
border:none;
|
204 |
-
}
|
205 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
206 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
207 |
-
color: <?php echo $color_arrow; ?>;
|
208 |
-
text-decoration: none !important;
|
209 |
-
background: none;
|
210 |
-
font-size: 16px;
|
211 |
-
}
|
212 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
213 |
-
color: <?php echo $color_arrow; ?>;
|
214 |
-
text-decoration:none;
|
215 |
-
background:none;
|
216 |
-
}
|
217 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
218 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
219 |
-
text-decoration:underline;
|
220 |
-
background:none;
|
221 |
-
font-size:11px;
|
222 |
-
}
|
223 |
-
#calendar_<?php echo $many_sp_calendar; ?> a {
|
224 |
-
font-weight: normal;
|
225 |
-
}
|
226 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
227 |
-
font-size:12px;
|
228 |
-
text-decoration:none;
|
229 |
-
background:none;
|
230 |
-
}
|
231 |
-
|
232 |
-
|
233 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
234 |
-
border-spacing:0;
|
235 |
-
width:100%;
|
236 |
-
}
|
237 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
238 |
-
border-spacing: 0;
|
239 |
-
vertical-align: middle;
|
240 |
-
width: 100%;
|
241 |
-
}
|
242 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
243 |
-
background-color:<?php echo $bg; ?> !important;
|
244 |
-
text-align:center;
|
245 |
-
vertical-align: middle;
|
246 |
-
}
|
247 |
-
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
248 |
-
color:<?php echo $text_color_other_months; ?>;
|
249 |
-
}
|
250 |
-
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
251 |
-
color:<?php echo $text_color_this_month_unevented; ?>;
|
252 |
-
}
|
253 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
254 |
-
color:<?php echo $sun_days; ?>;
|
255 |
-
}
|
256 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
257 |
-
border: solid <?php echo $border_day; ?> 1px;
|
258 |
-
}
|
259 |
-
#TB_window {
|
260 |
-
z-index: 10000;
|
261 |
-
}
|
262 |
-
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
263 |
-
float: right;
|
264 |
-
background-color: <?php echo $calendar_bg; ?> !important;
|
265 |
-
height: 25px;
|
266 |
-
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
267 |
-
margin-left: 2px;
|
268 |
-
text-align: center;
|
269 |
-
cursor: pointer;
|
270 |
-
position: relative;
|
271 |
-
top: 3px;
|
272 |
-
font-family: <?php echo $font_month; ?>;
|
273 |
-
font-size: 14px;
|
274 |
-
}
|
275 |
-
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
276 |
-
background: transparent !important;
|
277 |
-
}
|
278 |
-
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
279 |
-
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
280 |
-
{
|
281 |
-
width: 120px;
|
282 |
-
text-align: center;
|
283 |
-
cursor: pointer;
|
284 |
-
padding: 6px;
|
285 |
-
position: relative;
|
286 |
-
}
|
287 |
-
|
288 |
-
|
289 |
-
#drop_down_views
|
290 |
-
{
|
291 |
-
list-style-type:none !important;
|
292 |
-
position: absolute;
|
293 |
-
top: 46px;
|
294 |
-
left: -15px;
|
295 |
-
display:none;
|
296 |
-
z-index: 4545;
|
297 |
-
|
298 |
-
}
|
299 |
-
|
300 |
-
#drop_down_views >li
|
301 |
-
{
|
302 |
-
border-bottom:1px solid #fff !important;
|
303 |
-
}
|
304 |
-
|
305 |
-
|
306 |
-
#views_tabs_select
|
307 |
-
{
|
308 |
-
display:none;
|
309 |
-
}
|
310 |
-
|
311 |
-
</style>
|
312 |
-
</head>
|
313 |
-
<body>
|
314 |
-
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
315 |
-
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; height:190px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?> !important">
|
316 |
-
<tr style="background-color:#FFFFFF;">
|
317 |
-
<td style="background-color:#FFFFFF;">
|
318 |
-
<div id="views_tabs" style="<?php echo $display; ?>">
|
319 |
-
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
320 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
321 |
-
'action' => 'spiderbigcalendar_day_widget',
|
322 |
-
'theme_id' => $theme_id,
|
323 |
-
'calendar' => $calendar_id,
|
324 |
-
'select' => $view_select,
|
325 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
326 |
-
'many_sp_calendar' => $many_sp_calendar,
|
327 |
-
'cat_id' => '',
|
328 |
-
'cat_ids' => $cat_ids,
|
329 |
-
'widget' => $widget,
|
330 |
-
'rand' => $many_sp_calendar,
|
331 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Day', 'sp_calendar'); ?></span>
|
332 |
-
</div>
|
333 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;' ?>"
|
334 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
335 |
-
'action' => 'spiderbigcalendar_week_widget',
|
336 |
-
'theme_id' => $theme_id,
|
337 |
-
'calendar' => $calendar_id,
|
338 |
-
'select' => $view_select,
|
339 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
340 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
341 |
-
'many_sp_calendar' => $many_sp_calendar,
|
342 |
-
'cat_id' => '',
|
343 |
-
'cat_ids' => $cat_ids,
|
344 |
-
'widget' => $widget,
|
345 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Week', 'sp_calendar'); ?></span>
|
346 |
-
</div>
|
347 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
348 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
349 |
-
'action' => 'spiderbigcalendar_list_widget',
|
350 |
-
'theme_id' => $theme_id,
|
351 |
-
'calendar' => $calendar_id,
|
352 |
-
'select' => $view_select,
|
353 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
354 |
-
'many_sp_calendar' => $many_sp_calendar,
|
355 |
-
'cat_id' => '',
|
356 |
-
'cat_ids' => $cat_ids,
|
357 |
-
'widget' => $widget,
|
358 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('List', 'sp_calendar'); ?></span>
|
359 |
-
</div>
|
360 |
-
<div class="views" style="margin-left: 0px;margin-right: 2px;<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
361 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
362 |
-
'action' => 'spiderbigcalendar_month_widget',
|
363 |
-
'theme_id' => $theme_id,
|
364 |
-
'calendar' => $calendar_id,
|
365 |
-
'select' => $view_select,
|
366 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
367 |
-
'many_sp_calendar' => $many_sp_calendar,
|
368 |
-
'cat_id' => '',
|
369 |
-
'cat_ids' => $cat_ids,
|
370 |
-
'widget' => $widget,
|
371 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="position:relative;top:15%;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
372 |
-
</div>
|
373 |
-
</div>
|
374 |
-
</td>
|
375 |
-
</tr>
|
376 |
-
<tr>
|
377 |
-
<td width="100%" style="padding:0; margin:0;">
|
378 |
-
<form action="" method="get" style="background:none; margin:0; padding:0;">
|
379 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>" height="190">
|
380 |
-
<tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
|
381 |
-
<td class="calbg" colspan="7" style="background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');margin:0; padding:0;background-repeat: no-repeat;background-size: 100% 100%;" >
|
382 |
-
<?php //MONTH TABLE ?>
|
383 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
|
384 |
-
<tr>
|
385 |
-
<td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
386 |
-
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
387 |
-
if (Month_num($month) == 1) {
|
388 |
-
$needed_date = ($year - 1) . '-12';
|
389 |
-
}
|
390 |
-
else {
|
391 |
-
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
392 |
-
}
|
393 |
-
echo add_query_arg(array(
|
394 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
395 |
-
'theme_id' => $theme_id,
|
396 |
-
'calendar' => $calendar_id,
|
397 |
-
'select' => $view_select,
|
398 |
-
'date' => $needed_date,
|
399 |
-
'many_sp_calendar' => $many_sp_calendar,
|
400 |
-
'cat_id' => '',
|
401 |
-
'cat_ids' => $cat_ids,
|
402 |
-
'widget' => $widget,
|
403 |
-
), $site_url);
|
404 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-left"></div>
|
405 |
-
</a>
|
406 |
-
</td>
|
407 |
-
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
408 |
-
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
409 |
-
<span style="font-size:<?php echo $year_font_size; ?>px;?>; color:<?php echo $text_color_month; ?>;"><?php echo __($month, 'sp_calendar'); ?></span>
|
410 |
-
</td>
|
411 |
-
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
412 |
-
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
413 |
-
if (Month_num($month) == 12) {
|
414 |
-
|
415 |
-
$needed_date = ($year + 1) . '-01';
|
416 |
-
}
|
417 |
-
else {
|
418 |
-
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
419 |
-
}
|
420 |
-
echo add_query_arg(array(
|
421 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
422 |
-
'theme_id' => $theme_id,
|
423 |
-
'calendar' => $calendar_id,
|
424 |
-
'select' => $view_select,
|
425 |
-
'date' => $needed_date,
|
426 |
-
'many_sp_calendar' => $many_sp_calendar,
|
427 |
-
'cat_id' => '',
|
428 |
-
'cat_ids' => $cat_ids,
|
429 |
-
'widget' => $widget,
|
430 |
-
), $site_url);
|
431 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-right"></div>
|
432 |
-
</a>
|
433 |
-
</td>
|
434 |
-
</tr>
|
435 |
-
</table>
|
436 |
-
</td>
|
437 |
-
</tr>
|
438 |
-
<tr class="cell_body" align="center" height="10%" style="background-color:<?php echo $weekdays_bg_color; ?> !important;width:<?php echo $calendar_width; ?>px">
|
439 |
-
<?php if ($weekstart == "su") { ?>
|
440 |
-
<td style="font-family:<?php echo $font_weekday; ?>;background-color:<?php echo $weekday_su_bg_color; ?> !important;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
441 |
-
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
442 |
-
</td>
|
443 |
-
<?php } ?>
|
444 |
-
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
445 |
-
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Mo', 'sp_calendar'); ?> </b></div>
|
446 |
-
</td>
|
447 |
-
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
448 |
-
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Tu', 'sp_calendar'); ?> </b></div>
|
449 |
-
</td>
|
450 |
-
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
451 |
-
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('We', 'sp_calendar'); ?> </b></div>
|
452 |
-
</td>
|
453 |
-
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
454 |
-
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Th', 'sp_calendar'); ?> </b></div>
|
455 |
-
</td>
|
456 |
-
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
457 |
-
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Fr', 'sp_calendar'); ?> </b></div>
|
458 |
-
</td>
|
459 |
-
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
460 |
-
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Sa', 'sp_calendar'); ?> </b></div>
|
461 |
-
</td>
|
462 |
-
<?php if ($weekstart == "mo") { ?>
|
463 |
-
<td style="font-family:<?php echo $font_weekday; ?>;background-color:<?php echo $weekday_su_bg_color; ?> !important;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
464 |
-
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
465 |
-
</td>
|
466 |
-
<?php } ?>
|
467 |
-
</tr>
|
468 |
-
<?php
|
469 |
-
|
470 |
-
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
471 |
-
if ($weekstart == "su") {
|
472 |
-
$month_first_weekday++;
|
473 |
-
if ($month_first_weekday == 8) {
|
474 |
-
$month_first_weekday = 1;
|
475 |
-
}
|
476 |
-
}
|
477 |
-
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
478 |
-
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
479 |
-
$weekday_i = $month_first_weekday;
|
480 |
-
$last_month_days = $last_month_days - $weekday_i + 2;
|
481 |
-
$percent = 1;
|
482 |
-
$sum = $month_days - 8 + $month_first_weekday;
|
483 |
-
if ($sum % 7 <> 0) {
|
484 |
-
$percent = $percent + 1;
|
485 |
-
}
|
486 |
-
$sum = $sum - ($sum % 7);
|
487 |
-
$percent = $percent + ($sum / 7);
|
488 |
-
$percent = 107 / $percent;
|
489 |
-
|
490 |
-
$all_calendar_files = php_getdays(1, $calendar_id, $date, $theme_id, $widget);
|
491 |
-
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
492 |
-
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
493 |
-
$array_days = $all_calendar_files[0]['array_days'];
|
494 |
-
|
495 |
-
$array_days1 = $all_calendar_files[0]['array_days1'];
|
496 |
-
$title = $all_calendar_files[0]['title'];
|
497 |
-
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
498 |
-
echo ' <tr class="cell_body" height="' . $percent . 'px" style="line-height:' . $percent . 'px">';
|
499 |
-
for ($i = 1; $i < $weekday_i; $i++) {
|
500 |
-
echo ' <td class="caltext_color_other_months" style="text-align:center;">' . $last_month_days . '</td>';
|
501 |
-
$last_month_days = $last_month_days + 1;
|
502 |
-
}
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
for ($i = 1; $i <= $month_days; $i++) {
|
507 |
-
if (isset($title[$i])) {
|
508 |
-
$ev_title = explode('</p>', $title[$i]);
|
509 |
-
array_pop($ev_title);
|
510 |
-
$k = count($ev_title);
|
511 |
-
$ev_id = explode('<br>', $ev_ids[$i]);
|
512 |
-
array_pop($ev_id);
|
513 |
-
$ev_ids_inline = implode(',', $ev_id);
|
514 |
-
}
|
515 |
-
else
|
516 |
-
$k=0;
|
517 |
-
|
518 |
-
if(isset($ev_ids_inline)){
|
519 |
-
if(preg_match("/^[0-9\,]+$/", $ev_ids_inline))
|
520 |
-
$query = $wpdb->prepare ("SELECT DISTINCT sec.color FROM " . $wpdb->prefix . "spidercalendar_event AS se JOIN
|
521 |
-
" . $wpdb->prefix . "spidercalendar_event_category AS sec ON se.category=sec.id WHERE se.published='1' AND sec.published='1' AND se.calendar=%d AND se.id IN (".$ev_ids_inline.") ",$calendar_id);
|
522 |
-
$categ_color=$wpdb->get_results($query);
|
523 |
-
}
|
524 |
-
|
525 |
-
if (($weekday_i % 7 == 0 and $weekstart == "mo") or ($weekday_i % 7 == 1 and $weekstart == "su")) {
|
526 |
-
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
527 |
-
|
528 |
-
echo ' <td class="cala_day" style="background-color:' . $bg_color_selected . ' !important;text-align:center;padding:0; margin:0;line-height:inherit;">
|
529 |
-
<div class="calborder_day" style="text-align:center; width:' . $cell_width . 'px; margin:0; padding:0;">
|
530 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-decoration:underline;"
|
531 |
-
href="' . add_query_arg(array(
|
532 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
533 |
-
'theme_id' => $theme_id,
|
534 |
-
'calendar_id' => $calendar_id,
|
535 |
-
'ev_ids' => $ev_ids_inline,
|
536 |
-
'eventID' => $ev_id[0],
|
537 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
538 |
-
'many_sp_calendar' => $many_sp_calendar,
|
539 |
-
'widget' => $widget,
|
540 |
-
'TB_iframe' => 1,
|
541 |
-
'tbWidth' => $popup_width,
|
542 |
-
'tbHeight' => $popup_height,
|
543 |
-
), $site_url) . '"><b>' . $i . '</b>
|
544 |
-
</a>
|
545 |
-
</div>
|
546 |
-
</td>';
|
547 |
-
}
|
548 |
-
elseif ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
549 |
-
if (in_array($i, $array_days)) {
|
550 |
-
if (in_array ($i, $array_days1)) {
|
551 |
-
echo '
|
552 |
-
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ' !important;text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
553 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . ';text-align:center;text-decoration:underline;"
|
554 |
-
href="' . add_query_arg(array(
|
555 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
556 |
-
'theme_id' => $theme_id,
|
557 |
-
'calendar_id' => $calendar_id,
|
558 |
-
'ev_ids' => $ev_ids_inline,
|
559 |
-
'eventID' => $ev_id[0],
|
560 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
561 |
-
'many_sp_calendar' => $many_sp_calendar,
|
562 |
-
'widget' => $widget,
|
563 |
-
'TB_iframe' => 1,
|
564 |
-
'tbWidth' => $popup_width,
|
565 |
-
'tbHeight' => $popup_height,
|
566 |
-
), $site_url) . '"><b>' . $i . '</b>
|
567 |
-
</a>';
|
568 |
-
echo '<table style="width:100%; border:0;margin: 0"><tr>';
|
569 |
-
foreach($categ_color as $color){
|
570 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
571 |
-
}
|
572 |
-
echo '</tr></table>';
|
573 |
-
echo '</td>';
|
574 |
-
}
|
575 |
-
else {
|
576 |
-
echo '
|
577 |
-
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ' !important;text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
578 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . ';text-align:center;text-decoration:underline;"
|
579 |
-
href="' . add_query_arg(array(
|
580 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
581 |
-
'theme_id' => $theme_id,
|
582 |
-
'calendar_id' => $calendar_id,
|
583 |
-
'ev_ids' => $ev_ids_inline,
|
584 |
-
'eventID' => $ev_id[0],
|
585 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
586 |
-
'many_sp_calendar' => $many_sp_calendar,
|
587 |
-
'widget' => $widget,
|
588 |
-
'TB_iframe' => 1,
|
589 |
-
'tbWidth' => $popup_width,
|
590 |
-
'tbHeight' => $popup_height,
|
591 |
-
), $site_url) . '"><b>' . $i . '</b>
|
592 |
-
</a>';
|
593 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
594 |
-
foreach($categ_color as $color){
|
595 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
596 |
-
}
|
597 |
-
echo '</tr></table>';
|
598 |
-
echo '</td>';
|
599 |
-
}
|
600 |
-
}
|
601 |
-
else {
|
602 |
-
echo '
|
603 |
-
<td class="calsun_days" style="color:' . $text_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
604 |
-
<b>' . $i . '</b>
|
605 |
-
</td>';
|
606 |
-
}
|
607 |
-
}
|
608 |
-
else {
|
609 |
-
if (in_array ($i, $array_days)) {
|
610 |
-
if (in_array ($i, $array_days1)) {
|
611 |
-
|
612 |
-
echo '
|
613 |
-
<td class="cala_day" style="background-color:' . $evented_color_bg . ' !important;text-align:center;padding:0; margin:0;line-height:inherit;">
|
614 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . ';text-align:center;text-decoration:underline;"
|
615 |
-
href="' . add_query_arg(array(
|
616 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
617 |
-
'theme_id' => $theme_id,
|
618 |
-
'calendar_id' => $calendar_id,
|
619 |
-
'ev_ids' => $ev_ids_inline,
|
620 |
-
'eventID' => $ev_id[0],
|
621 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
622 |
-
'many_sp_calendar' => $many_sp_calendar,
|
623 |
-
'widget' => $widget,
|
624 |
-
'TB_iframe' => 1,
|
625 |
-
'tbWidth' => $popup_width,
|
626 |
-
'tbHeight' => $popup_height,
|
627 |
-
'cat_id' => $cat_ids
|
628 |
-
), $site_url) . '"><b>' . $i . '</b>
|
629 |
-
</a>';
|
630 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
631 |
-
foreach($categ_color as $color){
|
632 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
633 |
-
}
|
634 |
-
echo '</tr></table>';
|
635 |
-
echo '</td>';
|
636 |
-
}
|
637 |
-
else {
|
638 |
-
echo '
|
639 |
-
<td class="cala_day" style="background-color:' . $evented_color_bg . ' !important;text-align:center;padding:0; margin:0;line-height:inherit;">
|
640 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . ';text-align:center;text-decoration:underline;"
|
641 |
-
href="' . add_query_arg(array(
|
642 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
643 |
-
'theme_id' => $theme_id,
|
644 |
-
'calendar_id' => $calendar_id,
|
645 |
-
'ev_ids' => $ev_ids_inline,
|
646 |
-
'eventID' => $ev_id[0],
|
647 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
648 |
-
'many_sp_calendar' => $many_sp_calendar,
|
649 |
-
'widget' => $widget,
|
650 |
-
'TB_iframe' => 1,
|
651 |
-
'tbWidth' => $popup_width,
|
652 |
-
'tbHeight' => $popup_height,
|
653 |
-
'cat_id' => $cat_ids
|
654 |
-
), $site_url) . '"><b>' . $i . '</b>
|
655 |
-
</a>';
|
656 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
657 |
-
foreach($categ_color as $color){
|
658 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
659 |
-
}
|
660 |
-
echo '</tr></table>';
|
661 |
-
echo '</td>';
|
662 |
-
}
|
663 |
-
}
|
664 |
-
else {
|
665 |
-
echo '
|
666 |
-
<td class="calsun_days" style="text-align:center;padding:0; margin:0;line-height:inherit;">
|
667 |
-
<b>' . $i . '</b>
|
668 |
-
</td>';
|
669 |
-
}
|
670 |
-
}
|
671 |
-
}
|
672 |
-
elseif ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
673 |
-
|
674 |
-
if (in_array ($i,$array_days)) {
|
675 |
-
|
676 |
-
echo ' <td style="background-color:' . $bg_color_selected . ' !important;text-align:center;padding:0; margin:0;line-height:inherit;">
|
677 |
-
<div class="calborder_day" style="text-align:center; width:' . $cell_width . 'px; margin:0; padding:0;">
|
678 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-decoration:underline;"
|
679 |
-
href="' . add_query_arg(array(
|
680 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
681 |
-
'theme_id' => $theme_id,
|
682 |
-
'calendar_id' => $calendar_id,
|
683 |
-
'ev_ids' => $ev_ids_inline,
|
684 |
-
'eventID' => $ev_id[0],
|
685 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
686 |
-
'many_sp_calendar' => $many_sp_calendar,
|
687 |
-
'widget' => $widget,
|
688 |
-
'TB_iframe' => 1,
|
689 |
-
'tbWidth' => $popup_width,
|
690 |
-
'tbHeight' => $popup_height,
|
691 |
-
'cat_id' => $cat_ids
|
692 |
-
), $site_url) . '"><b>' . $i . '</b>
|
693 |
-
</a>';
|
694 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
695 |
-
foreach($categ_color as $color){
|
696 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
697 |
-
}
|
698 |
-
echo '</tr></table>';
|
699 |
-
echo '</td>';
|
700 |
-
}
|
701 |
-
|
702 |
-
else {
|
703 |
-
|
704 |
-
echo '<td style="text-align:center; color:' . $text_color_selected . ';padding:0; margin:0; line-height:inherit; border: 2px solid ' . $border_day . '">
|
705 |
-
<b>' . $i . '</b>
|
706 |
-
</td>';
|
707 |
-
}
|
708 |
-
|
709 |
-
}
|
710 |
-
else {
|
711 |
-
if ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
712 |
-
|
713 |
-
|
714 |
-
if (in_array ($i, $array_days)) {
|
715 |
-
|
716 |
-
|
717 |
-
if (in_array ($i, $array_days1)) {
|
718 |
-
echo '
|
719 |
-
<td class="cala_day" style="color:' . $text_color_selected . ' !important;background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
720 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-align:center;text-decoration:underline;"
|
721 |
-
href="' . add_query_arg(array(
|
722 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
723 |
-
'theme_id' => $theme_id,
|
724 |
-
'calendar_id' => $calendar_id,
|
725 |
-
'ev_ids' => $ev_ids_inline,
|
726 |
-
'eventID' => $ev_id[0],
|
727 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
728 |
-
'many_sp_calendar' => $many_sp_calendar,
|
729 |
-
'widget' => $widget,
|
730 |
-
'TB_iframe' => 1,
|
731 |
-
'tbWidth' => $popup_width,
|
732 |
-
'tbHeight' => $popup_height,
|
733 |
-
'cat_id' => $cat_ids
|
734 |
-
), $site_url) . '"><b>' . $i . '</b>
|
735 |
-
</a>';
|
736 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
737 |
-
foreach($categ_color as $color){
|
738 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
739 |
-
}
|
740 |
-
echo '</tr></table>';
|
741 |
-
echo '</td>';
|
742 |
-
}
|
743 |
-
else {
|
744 |
-
echo '
|
745 |
-
<td class="cala_day" style="color:' . $text_color_selected . ' !important;background-color:' . $bg_color_selected . ' !important;text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
746 |
-
<a id="cur_day" class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-align:center;text-decoration:underline;"
|
747 |
-
href="' . add_query_arg(array(
|
748 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
749 |
-
'theme_id' => $theme_id,
|
750 |
-
'calendar_id' => $calendar_id,
|
751 |
-
'ev_ids' => $ev_ids_inline,
|
752 |
-
'eventID' => $ev_id[0],
|
753 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
754 |
-
'many_sp_calendar' => $many_sp_calendar,
|
755 |
-
'widget' => $widget,
|
756 |
-
'TB_iframe' => 1,
|
757 |
-
'tbWidth' => $popup_width,
|
758 |
-
'tbHeight' => $popup_height,
|
759 |
-
'cat_id' => $cat_ids
|
760 |
-
), $site_url) . '"><b>' . $i . '</b></a>';
|
761 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
762 |
-
foreach($categ_color as $color){
|
763 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
764 |
-
}
|
765 |
-
echo '</tr></table>';
|
766 |
-
echo '</td>';
|
767 |
-
}
|
768 |
-
}
|
769 |
-
else {
|
770 |
-
|
771 |
-
echo '<td style="text-align:center; color:' . $text_color_selected . ';padding:0; margin:0; line-height:inherit; border: 2px solid ' . $border_day . '">
|
772 |
-
<b>' . $i . '</b>
|
773 |
-
</td>';
|
774 |
-
}
|
775 |
-
}
|
776 |
-
elseif (in_array($i, $array_days)) {
|
777 |
-
|
778 |
-
if (in_array ($i, $array_days1)) {
|
779 |
-
echo '<td class="cala_day" style="background-color:' . $evented_color_bg . ' !important;text-align:center;padding:0; margin:0;line-height:inherit;">
|
780 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . '; text-align:center;text-decoration:underline;"
|
781 |
-
href="' . add_query_arg(array(
|
782 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
783 |
-
'theme_id' => $theme_id,
|
784 |
-
'calendar_id' => $calendar_id,
|
785 |
-
'ev_ids' => $ev_ids_inline,
|
786 |
-
'eventID' => $ev_id[0],
|
787 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
788 |
-
'many_sp_calendar' => $many_sp_calendar,
|
789 |
-
'widget' => $widget,
|
790 |
-
'TB_iframe' => 1,
|
791 |
-
'tbWidth' => $popup_width,
|
792 |
-
'tbHeight' => $popup_height,
|
793 |
-
'cat_id' => $cat_ids
|
794 |
-
), $site_url) . '"><b>' . $i . '</b>
|
795 |
-
</a>';
|
796 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
797 |
-
foreach($categ_color as $color){
|
798 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
799 |
-
}
|
800 |
-
echo '</tr></table>';
|
801 |
-
echo '</td>';
|
802 |
-
}
|
803 |
-
else {
|
804 |
-
echo '<td class="cala_day" style="background-color:' . $evented_color_bg . ' !important;text-align:center;padding:0; margin:0;line-height:inherit;">
|
805 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . '; text-align:center;text-decoration:underline;"
|
806 |
-
href="' . add_query_arg(array(
|
807 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
808 |
-
'theme_id' => $theme_id,
|
809 |
-
'calendar_id' => $calendar_id,
|
810 |
-
'ev_ids' => $ev_ids_inline,
|
811 |
-
'eventID' => $ev_id[0],
|
812 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
813 |
-
'many_sp_calendar' => $many_sp_calendar,
|
814 |
-
'widget' => $widget,
|
815 |
-
'TB_iframe' => 1,
|
816 |
-
'tbWidth' => $popup_width,
|
817 |
-
'tbHeight' => $popup_height,
|
818 |
-
'cat_id' => $cat_ids
|
819 |
-
), $site_url) . '"><b>' . $i . '</b></a>
|
820 |
-
';
|
821 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
822 |
-
foreach($categ_color as $color){
|
823 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
824 |
-
}
|
825 |
-
echo '</tr></table>';
|
826 |
-
echo '</td>';
|
827 |
-
}
|
828 |
-
}
|
829 |
-
else {
|
830 |
-
echo ' <td style="text-align:center; color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:inherit;">
|
831 |
-
<b>' . $i . '</b>
|
832 |
-
</td>';
|
833 |
-
}
|
834 |
-
}
|
835 |
-
if ($weekday_i % 7 == 0 && $i <> $month_days) {
|
836 |
-
echo '</tr>
|
837 |
-
<tr class="cell_body" height="' . $percent . 'px" style="line-height:' . $percent . 'px">';
|
838 |
-
$weekday_i = 0;
|
839 |
-
}
|
840 |
-
$weekday_i++;
|
841 |
-
}
|
842 |
-
$weekday_i;
|
843 |
-
$next_i = 1;
|
844 |
-
if ($weekday_i != 1) {
|
845 |
-
for ($i = $weekday_i; $i <= 7; $i++) {
|
846 |
-
echo ' <td class="caltext_color_other_months" style="text-align:center;">' . $next_i . '</td>';
|
847 |
-
$next_i++;
|
848 |
-
}
|
849 |
-
}
|
850 |
-
echo ' </tr>';
|
851 |
-
?>
|
852 |
-
<tr style="font-family: <?php echo $font_year; ?>;">
|
853 |
-
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
854 |
-
echo add_query_arg(array(
|
855 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
856 |
-
'theme_id' => $theme_id,
|
857 |
-
'calendar' => $calendar_id,
|
858 |
-
'select' => $view_select,
|
859 |
-
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
860 |
-
'many_sp_calendar' => $many_sp_calendar,
|
861 |
-
'widget' => $widget,
|
862 |
-
'cat_id' => '',
|
863 |
-
'cat_ids' => $cat_ids,
|
864 |
-
'TB_iframe' => 1,
|
865 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important">
|
866 |
-
<?php echo ($year - 1); ?>
|
867 |
-
</td>
|
868 |
-
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
869 |
-
<?php echo $year; ?>
|
870 |
-
</td>
|
871 |
-
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
872 |
-
echo add_query_arg(array(
|
873 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
874 |
-
'theme_id' => $theme_id,
|
875 |
-
'calendar' => $calendar_id,
|
876 |
-
'select' => $view_select,
|
877 |
-
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
878 |
-
'many_sp_calendar' => $many_sp_calendar,
|
879 |
-
'widget' => $widget,
|
880 |
-
'cat_id' => '',
|
881 |
-
'cat_ids' => $cat_ids,
|
882 |
-
'TB_iframe' => 1,
|
883 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important;color:<?php echo $year_font_color; ?> !important">
|
884 |
-
<?php echo ($year + 1); ?>
|
885 |
-
</td>
|
886 |
-
</tr>
|
887 |
-
</table>
|
888 |
-
<input type="text" value="1" name="day" style="display:none" />
|
889 |
-
</form>
|
890 |
-
</td>
|
891 |
-
</tr>
|
892 |
-
</table>
|
893 |
-
</div>
|
894 |
-
<style>
|
895 |
-
#calendar_<?php echo $many_sp_calendar; ?> table{
|
896 |
-
width: 100%;
|
897 |
-
}
|
898 |
-
|
899 |
-
.spider_categories_widget{
|
900 |
-
display:inline-block;
|
901 |
-
cursor:pointer;
|
902 |
-
}
|
903 |
-
|
904 |
-
.spider_categories_widget p{
|
905 |
-
color: #fff;
|
906 |
-
padding: 2px 10px !important;
|
907 |
-
margin: 2px 0 !important;
|
908 |
-
font-size: 13px;
|
909 |
-
}
|
910 |
-
</style>
|
911 |
-
<?php
|
912 |
-
|
913 |
-
//reindex cat_ids_array
|
914 |
-
|
915 |
-
$re_cat_ids_array = array_values($cat_ids_array);
|
916 |
-
|
917 |
-
for($i=0; $i<count($re_cat_ids_array); $i++)
|
918 |
-
{
|
919 |
-
echo'
|
920 |
-
<style>
|
921 |
-
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
922 |
-
{
|
923 |
-
text-decoration:underline;
|
924 |
-
cursor:pointer;
|
925 |
-
|
926 |
-
}
|
927 |
-
|
928 |
-
</style>';
|
929 |
-
|
930 |
-
}
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
if($cat_ids=='')
|
935 |
-
$cat_ids='';
|
936 |
-
if($show_cat){
|
937 |
-
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none; margin-top: 10px;">';
|
938 |
-
|
939 |
-
foreach($categories as $category)
|
940 |
-
{
|
941 |
-
|
942 |
-
?>
|
943 |
-
|
944 |
-
<li class="spider_categories_widget"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
945 |
-
'action' => 'spiderbigcalendar_month_widget',
|
946 |
-
'theme_id' => $theme_id,
|
947 |
-
'calendar' => $calendar_id,
|
948 |
-
'select' => $view_select,
|
949 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
950 |
-
'many_sp_calendar' => $many_sp_calendar,
|
951 |
-
'cat_id' => $category->id,
|
952 |
-
'cat_ids' => $cat_ids,
|
953 |
-
'widget' => $widget,
|
954 |
-
), $site_url);?>','<?php echo $many_sp_calendar ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
955 |
-
<?php
|
956 |
-
}
|
957 |
-
if (!empty($categories)) {
|
958 |
-
?>
|
959 |
-
<li class="spider_categories_widget"><p id="category0" style="background-color:#<?php echo str_replace('#','',$bg); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
960 |
-
'action' => 'spiderbigcalendar_month_widget',
|
961 |
-
'theme_id' => $theme_id,
|
962 |
-
'calendar' => $calendar_id,
|
963 |
-
'select' => $view_select,
|
964 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
965 |
-
'many_sp_calendar' => $many_sp_calendar,
|
966 |
-
'cat_id' => '',
|
967 |
-
'cat_ids' => '',
|
968 |
-
'widget' => $widget,
|
969 |
-
), $site_url);?>','<?php echo $many_sp_calendar ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
970 |
-
<?php echo '</ul>';
|
971 |
-
}
|
972 |
-
} ?>
|
973 |
-
</body>
|
974 |
-
</html>
|
975 |
-
<?php
|
976 |
-
die();
|
977 |
-
}
|
978 |
-
|
979 |
?>
|
1 |
+
<?php
|
2 |
+
function big_calendar_month_widget() {
|
3 |
+
require_once("frontend_functions.php");
|
4 |
+
global $wpdb;
|
5 |
+
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
+
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
+
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
+
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 1);
|
9 |
+
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
10 |
+
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
+
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
12 |
+
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
13 |
+
$site_url = get_admin_url().'admin-ajax.php';
|
14 |
+
///////////////////////////////////////////////////////////////////////////////////
|
15 |
+
|
16 |
+
if($cat_ids=='')
|
17 |
+
$cat_ids .= $cat_id.',';
|
18 |
+
else
|
19 |
+
$cat_ids .= ','.$cat_id.',';
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
24 |
+
|
25 |
+
function getelementcountinarray($array , $element)
|
26 |
+
{
|
27 |
+
$t=0;
|
28 |
+
|
29 |
+
for($i=0; $i<count($array); $i++)
|
30 |
+
{
|
31 |
+
if($element==$array[$i])
|
32 |
+
$t++;
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
return $t;
|
38 |
+
|
39 |
+
}
|
40 |
+
|
41 |
+
function getelementindexinarray($array , $element)
|
42 |
+
{
|
43 |
+
|
44 |
+
$t='';
|
45 |
+
|
46 |
+
for($i=0; $i<count($array); $i++)
|
47 |
+
{
|
48 |
+
if($element==$array[$i])
|
49 |
+
$t.=$i.',';
|
50 |
+
|
51 |
+
}
|
52 |
+
|
53 |
+
return $t;
|
54 |
+
|
55 |
+
|
56 |
+
}
|
57 |
+
$cat_ids_array = explode(',',$cat_ids);
|
58 |
+
|
59 |
+
|
60 |
+
|
61 |
+
if($cat_id!='')
|
62 |
+
{
|
63 |
+
|
64 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
65 |
+
{
|
66 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
67 |
+
$index_array = explode(',' , $index_in_line);
|
68 |
+
array_pop ($index_array);
|
69 |
+
for($j=0; $j<count($index_array); $j++)
|
70 |
+
unset($cat_ids_array[$index_array[$j]]);
|
71 |
+
$cat_ids = implode(',',$cat_ids_array);
|
72 |
+
}
|
73 |
+
}
|
74 |
+
else
|
75 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
76 |
+
|
77 |
+
|
78 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
79 |
+
|
80 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
81 |
+
$weekstart = $theme->week_start_day;
|
82 |
+
$bg = '#' . str_replace('#','',$theme->header_bgcolor);
|
83 |
+
$bg_color_selected = '#' . str_replace('#','',$theme->bg_color_selected);
|
84 |
+
$color_arrow = '#' . str_replace('#','',$theme->arrow_color);
|
85 |
+
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
86 |
+
$evented_color_bg = '#' . str_replace('#','',$theme->bg_color_this_month_evented);
|
87 |
+
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
88 |
+
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
89 |
+
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
90 |
+
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
91 |
+
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
92 |
+
$text_color_selected = '#' . str_replace('#','',$theme->text_color_selected);
|
93 |
+
$border_day = '#' . str_replace('#','',$theme->border_day);
|
94 |
+
$calendar_width = $theme->width;
|
95 |
+
$calendar_bg = '#' . str_replace('#','',$theme->footer_bgcolor);
|
96 |
+
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
97 |
+
$weekday_su_bg_color = '#' . str_replace('#','',$theme->su_bg_color);
|
98 |
+
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
99 |
+
$year_font_size = $theme->year_font_size;
|
100 |
+
$year_font_color = '#' . str_replace('#','',$theme->year_font_color);
|
101 |
+
$year_tabs_bg_color = '#' . str_replace('#','',$theme->year_tabs_bg_color);
|
102 |
+
$font_year = $theme->font_year;
|
103 |
+
$font_month = $theme->font_month;
|
104 |
+
$font_day = $theme->font_day;
|
105 |
+
$font_weekday = $theme->font_weekday;
|
106 |
+
$show_cat = $theme->show_cat;
|
107 |
+
$popup_width = $theme->popup_width;
|
108 |
+
$popup_height = $theme->popup_height;
|
109 |
+
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
110 |
+
|
111 |
+
__('January', 'sp_calendar');
|
112 |
+
__('February', 'sp_calendar');
|
113 |
+
__('March', 'sp_calendar');
|
114 |
+
__('April', 'sp_calendar');
|
115 |
+
__('May', 'sp_calendar');
|
116 |
+
__('June', 'sp_calendar');
|
117 |
+
__('July', 'sp_calendar');
|
118 |
+
__('August', 'sp_calendar');
|
119 |
+
__('September', 'sp_calendar');
|
120 |
+
__('October', 'sp_calendar');
|
121 |
+
__('November', 'sp_calendar');
|
122 |
+
__('December', 'sp_calendar');
|
123 |
+
if ($date != '') {
|
124 |
+
$date_REFERER = $date;
|
125 |
+
}
|
126 |
+
else {
|
127 |
+
$date_REFERER = date("Y-m");
|
128 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
129 |
+
}
|
130 |
+
|
131 |
+
$year_REFERER = substr($date_REFERER, 0, 4);
|
132 |
+
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
133 |
+
$day_REFERER = substr($date_REFERER, 8, 2);
|
134 |
+
|
135 |
+
$year = substr($date, 0, 4);
|
136 |
+
$month = Month_name(substr($date, 5, 2));
|
137 |
+
$day = substr($date, 8, 2);
|
138 |
+
|
139 |
+
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
140 |
+
$prev_month = add_0((int) $this_month - 1);
|
141 |
+
$next_month = add_0((int) $this_month + 1);
|
142 |
+
|
143 |
+
$cell_width = $calendar_width / 7;
|
144 |
+
$cell_width = (int) $cell_width - 2;
|
145 |
+
|
146 |
+
$view = 'bigcalendarmonth_widget';
|
147 |
+
$views = explode(',', $view_select);
|
148 |
+
$defaultview = 'month';
|
149 |
+
array_pop($views);
|
150 |
+
$display = '';
|
151 |
+
if (count($views) == 0) {
|
152 |
+
$display = "display:none";
|
153 |
+
}
|
154 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
155 |
+
$display = "display:none";
|
156 |
+
}
|
157 |
+
?>
|
158 |
+
<html>
|
159 |
+
<head>
|
160 |
+
<style type='text/css'>
|
161 |
+
#calendar_<?php echo $many_sp_calendar; ?> table {
|
162 |
+
border-collapse: initial;
|
163 |
+
border:0px;
|
164 |
+
}
|
165 |
+
#TB_iframeContent{
|
166 |
+
background-color: <?php echo $show_event_bgcolor; ?>;
|
167 |
+
}
|
168 |
+
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
169 |
+
padding: 0px;
|
170 |
+
vertical-align: none;
|
171 |
+
border-top:none;
|
172 |
+
line-height: none;
|
173 |
+
text-align: none;
|
174 |
+
}
|
175 |
+
#calendar_<?php echo $many_sp_calendar; ?> .arrow-left {
|
176 |
+
width: 0px;
|
177 |
+
height: 0px;
|
178 |
+
border-top: 7px solid transparent;
|
179 |
+
border-bottom: 7px solid transparent;
|
180 |
+
border-right: 13px solid;
|
181 |
+
margin: 0 auto;
|
182 |
+
}
|
183 |
+
|
184 |
+
#calendar_<?php echo $many_sp_calendar; ?> .arrow-right {
|
185 |
+
width: 0px;
|
186 |
+
height: 0px;
|
187 |
+
border-top: 7px solid transparent;
|
188 |
+
border-bottom: 7px solid transparent;
|
189 |
+
border-left: 13px solid;
|
190 |
+
margin: 0 auto;
|
191 |
+
}
|
192 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
193 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
194 |
+
font-family: <?php echo $font_day; ?>;
|
195 |
+
}
|
196 |
+
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
197 |
+
margin-bottom: 0;
|
198 |
+
}
|
199 |
+
#calendar_<?php echo $many_sp_calendar; ?> td,
|
200 |
+
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
201 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> td,
|
202 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> tr {
|
203 |
+
border:none;
|
204 |
+
}
|
205 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
206 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
207 |
+
color: <?php echo $color_arrow; ?>;
|
208 |
+
text-decoration: none !important;
|
209 |
+
background: none;
|
210 |
+
font-size: 16px;
|
211 |
+
}
|
212 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
213 |
+
color: <?php echo $color_arrow; ?>;
|
214 |
+
text-decoration:none;
|
215 |
+
background:none;
|
216 |
+
}
|
217 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
218 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
219 |
+
text-decoration:underline;
|
220 |
+
background:none;
|
221 |
+
font-size:11px;
|
222 |
+
}
|
223 |
+
#calendar_<?php echo $many_sp_calendar; ?> a {
|
224 |
+
font-weight: normal;
|
225 |
+
}
|
226 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
227 |
+
font-size:12px;
|
228 |
+
text-decoration:none;
|
229 |
+
background:none;
|
230 |
+
}
|
231 |
+
|
232 |
+
|
233 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
234 |
+
border-spacing:0;
|
235 |
+
width:100%;
|
236 |
+
}
|
237 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
238 |
+
border-spacing: 0;
|
239 |
+
vertical-align: middle;
|
240 |
+
width: 100%;
|
241 |
+
}
|
242 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
243 |
+
background-color:<?php echo $bg; ?> !important;
|
244 |
+
text-align:center;
|
245 |
+
vertical-align: middle;
|
246 |
+
}
|
247 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
248 |
+
color:<?php echo $text_color_other_months; ?>;
|
249 |
+
}
|
250 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
251 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
252 |
+
}
|
253 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
254 |
+
color:<?php echo $sun_days; ?>;
|
255 |
+
}
|
256 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
257 |
+
border: solid <?php echo $border_day; ?> 1px;
|
258 |
+
}
|
259 |
+
#TB_window {
|
260 |
+
z-index: 10000;
|
261 |
+
}
|
262 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
263 |
+
float: right;
|
264 |
+
background-color: <?php echo $calendar_bg; ?> !important;
|
265 |
+
height: 25px;
|
266 |
+
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
267 |
+
margin-left: 2px;
|
268 |
+
text-align: center;
|
269 |
+
cursor: pointer;
|
270 |
+
position: relative;
|
271 |
+
top: 3px;
|
272 |
+
font-family: <?php echo $font_month; ?>;
|
273 |
+
font-size: 14px;
|
274 |
+
}
|
275 |
+
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
276 |
+
background: transparent !important;
|
277 |
+
}
|
278 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
279 |
+
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
280 |
+
{
|
281 |
+
width: 120px;
|
282 |
+
text-align: center;
|
283 |
+
cursor: pointer;
|
284 |
+
padding: 6px;
|
285 |
+
position: relative;
|
286 |
+
}
|
287 |
+
|
288 |
+
|
289 |
+
#drop_down_views
|
290 |
+
{
|
291 |
+
list-style-type:none !important;
|
292 |
+
position: absolute;
|
293 |
+
top: 46px;
|
294 |
+
left: -15px;
|
295 |
+
display:none;
|
296 |
+
z-index: 4545;
|
297 |
+
|
298 |
+
}
|
299 |
+
|
300 |
+
#drop_down_views >li
|
301 |
+
{
|
302 |
+
border-bottom:1px solid #fff !important;
|
303 |
+
}
|
304 |
+
|
305 |
+
|
306 |
+
#views_tabs_select
|
307 |
+
{
|
308 |
+
display:none;
|
309 |
+
}
|
310 |
+
|
311 |
+
</style>
|
312 |
+
</head>
|
313 |
+
<body>
|
314 |
+
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
315 |
+
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; height:190px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?> !important">
|
316 |
+
<tr style="background-color:#FFFFFF;">
|
317 |
+
<td style="background-color:#FFFFFF;">
|
318 |
+
<div id="views_tabs" style="<?php echo $display; ?>">
|
319 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
320 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
321 |
+
'action' => 'spiderbigcalendar_day_widget',
|
322 |
+
'theme_id' => $theme_id,
|
323 |
+
'calendar' => $calendar_id,
|
324 |
+
'select' => $view_select,
|
325 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
326 |
+
'many_sp_calendar' => $many_sp_calendar,
|
327 |
+
'cat_id' => '',
|
328 |
+
'cat_ids' => $cat_ids,
|
329 |
+
'widget' => $widget,
|
330 |
+
'rand' => $many_sp_calendar,
|
331 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Day', 'sp_calendar'); ?></span>
|
332 |
+
</div>
|
333 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;' ?>"
|
334 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
335 |
+
'action' => 'spiderbigcalendar_week_widget',
|
336 |
+
'theme_id' => $theme_id,
|
337 |
+
'calendar' => $calendar_id,
|
338 |
+
'select' => $view_select,
|
339 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
340 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
341 |
+
'many_sp_calendar' => $many_sp_calendar,
|
342 |
+
'cat_id' => '',
|
343 |
+
'cat_ids' => $cat_ids,
|
344 |
+
'widget' => $widget,
|
345 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Week', 'sp_calendar'); ?></span>
|
346 |
+
</div>
|
347 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
348 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
349 |
+
'action' => 'spiderbigcalendar_list_widget',
|
350 |
+
'theme_id' => $theme_id,
|
351 |
+
'calendar' => $calendar_id,
|
352 |
+
'select' => $view_select,
|
353 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
354 |
+
'many_sp_calendar' => $many_sp_calendar,
|
355 |
+
'cat_id' => '',
|
356 |
+
'cat_ids' => $cat_ids,
|
357 |
+
'widget' => $widget,
|
358 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('List', 'sp_calendar'); ?></span>
|
359 |
+
</div>
|
360 |
+
<div class="views" style="margin-left: 0px;margin-right: 2px;<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
361 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
362 |
+
'action' => 'spiderbigcalendar_month_widget',
|
363 |
+
'theme_id' => $theme_id,
|
364 |
+
'calendar' => $calendar_id,
|
365 |
+
'select' => $view_select,
|
366 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
367 |
+
'many_sp_calendar' => $many_sp_calendar,
|
368 |
+
'cat_id' => '',
|
369 |
+
'cat_ids' => $cat_ids,
|
370 |
+
'widget' => $widget,
|
371 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="position:relative;top:15%;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
372 |
+
</div>
|
373 |
+
</div>
|
374 |
+
</td>
|
375 |
+
</tr>
|
376 |
+
<tr>
|
377 |
+
<td width="100%" style="padding:0; margin:0;">
|
378 |
+
<form action="" method="get" style="background:none; margin:0; padding:0;">
|
379 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>" height="190">
|
380 |
+
<tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
|
381 |
+
<td class="calbg" colspan="7" style="background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');margin:0; padding:0;background-repeat: no-repeat;background-size: 100% 100%;" >
|
382 |
+
<?php //MONTH TABLE ?>
|
383 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
|
384 |
+
<tr>
|
385 |
+
<td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
386 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
387 |
+
if (Month_num($month) == 1) {
|
388 |
+
$needed_date = ($year - 1) . '-12';
|
389 |
+
}
|
390 |
+
else {
|
391 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
392 |
+
}
|
393 |
+
echo add_query_arg(array(
|
394 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
395 |
+
'theme_id' => $theme_id,
|
396 |
+
'calendar' => $calendar_id,
|
397 |
+
'select' => $view_select,
|
398 |
+
'date' => $needed_date,
|
399 |
+
'many_sp_calendar' => $many_sp_calendar,
|
400 |
+
'cat_id' => '',
|
401 |
+
'cat_ids' => $cat_ids,
|
402 |
+
'widget' => $widget,
|
403 |
+
), $site_url);
|
404 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-left"></div>
|
405 |
+
</a>
|
406 |
+
</td>
|
407 |
+
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
408 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
409 |
+
<span style="font-size:<?php echo $year_font_size; ?>px;?>; color:<?php echo $text_color_month; ?>;"><?php echo __($month, 'sp_calendar'); ?></span>
|
410 |
+
</td>
|
411 |
+
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
412 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
413 |
+
if (Month_num($month) == 12) {
|
414 |
+
|
415 |
+
$needed_date = ($year + 1) . '-01';
|
416 |
+
}
|
417 |
+
else {
|
418 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
419 |
+
}
|
420 |
+
echo add_query_arg(array(
|
421 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
422 |
+
'theme_id' => $theme_id,
|
423 |
+
'calendar' => $calendar_id,
|
424 |
+
'select' => $view_select,
|
425 |
+
'date' => $needed_date,
|
426 |
+
'many_sp_calendar' => $many_sp_calendar,
|
427 |
+
'cat_id' => '',
|
428 |
+
'cat_ids' => $cat_ids,
|
429 |
+
'widget' => $widget,
|
430 |
+
), $site_url);
|
431 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-right"></div>
|
432 |
+
</a>
|
433 |
+
</td>
|
434 |
+
</tr>
|
435 |
+
</table>
|
436 |
+
</td>
|
437 |
+
</tr>
|
438 |
+
<tr class="cell_body" align="center" height="10%" style="background-color:<?php echo $weekdays_bg_color; ?> !important;width:<?php echo $calendar_width; ?>px">
|
439 |
+
<?php if ($weekstart == "su") { ?>
|
440 |
+
<td style="font-family:<?php echo $font_weekday; ?>;background-color:<?php echo $weekday_su_bg_color; ?> !important;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
441 |
+
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
442 |
+
</td>
|
443 |
+
<?php } ?>
|
444 |
+
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
445 |
+
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Mo', 'sp_calendar'); ?> </b></div>
|
446 |
+
</td>
|
447 |
+
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
448 |
+
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Tu', 'sp_calendar'); ?> </b></div>
|
449 |
+
</td>
|
450 |
+
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
451 |
+
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('We', 'sp_calendar'); ?> </b></div>
|
452 |
+
</td>
|
453 |
+
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
454 |
+
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Th', 'sp_calendar'); ?> </b></div>
|
455 |
+
</td>
|
456 |
+
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
457 |
+
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Fr', 'sp_calendar'); ?> </b></div>
|
458 |
+
</td>
|
459 |
+
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
460 |
+
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Sa', 'sp_calendar'); ?> </b></div>
|
461 |
+
</td>
|
462 |
+
<?php if ($weekstart == "mo") { ?>
|
463 |
+
<td style="font-family:<?php echo $font_weekday; ?>;background-color:<?php echo $weekday_su_bg_color; ?> !important;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
464 |
+
<div class="calbottom_border" style="text-align:center; width:<?php echo $cell_width; ?>px; margin:0; padding:0;"><b> <?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
465 |
+
</td>
|
466 |
+
<?php } ?>
|
467 |
+
</tr>
|
468 |
+
<?php
|
469 |
+
|
470 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
471 |
+
if ($weekstart == "su") {
|
472 |
+
$month_first_weekday++;
|
473 |
+
if ($month_first_weekday == 8) {
|
474 |
+
$month_first_weekday = 1;
|
475 |
+
}
|
476 |
+
}
|
477 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
478 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
479 |
+
$weekday_i = $month_first_weekday;
|
480 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
481 |
+
$percent = 1;
|
482 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
483 |
+
if ($sum % 7 <> 0) {
|
484 |
+
$percent = $percent + 1;
|
485 |
+
}
|
486 |
+
$sum = $sum - ($sum % 7);
|
487 |
+
$percent = $percent + ($sum / 7);
|
488 |
+
$percent = 107 / $percent;
|
489 |
+
|
490 |
+
$all_calendar_files = php_getdays(1, $calendar_id, $date, $theme_id, $widget);
|
491 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
492 |
+
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
493 |
+
$array_days = $all_calendar_files[0]['array_days'];
|
494 |
+
|
495 |
+
$array_days1 = $all_calendar_files[0]['array_days1'];
|
496 |
+
$title = $all_calendar_files[0]['title'];
|
497 |
+
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
498 |
+
echo ' <tr class="cell_body" height="' . $percent . 'px" style="line-height:' . $percent . 'px">';
|
499 |
+
for ($i = 1; $i < $weekday_i; $i++) {
|
500 |
+
echo ' <td class="caltext_color_other_months" style="text-align:center;">' . $last_month_days . '</td>';
|
501 |
+
$last_month_days = $last_month_days + 1;
|
502 |
+
}
|
503 |
+
|
504 |
+
|
505 |
+
|
506 |
+
for ($i = 1; $i <= $month_days; $i++) {
|
507 |
+
if (isset($title[$i])) {
|
508 |
+
$ev_title = explode('</p>', $title[$i]);
|
509 |
+
array_pop($ev_title);
|
510 |
+
$k = count($ev_title);
|
511 |
+
$ev_id = explode('<br>', $ev_ids[$i]);
|
512 |
+
array_pop($ev_id);
|
513 |
+
$ev_ids_inline = implode(',', $ev_id);
|
514 |
+
}
|
515 |
+
else
|
516 |
+
$k=0;
|
517 |
+
|
518 |
+
if(isset($ev_ids_inline)){
|
519 |
+
if(preg_match("/^[0-9\,]+$/", $ev_ids_inline))
|
520 |
+
$query = $wpdb->prepare ("SELECT DISTINCT sec.color FROM " . $wpdb->prefix . "spidercalendar_event AS se JOIN
|
521 |
+
" . $wpdb->prefix . "spidercalendar_event_category AS sec ON se.category=sec.id WHERE se.published='1' AND sec.published='1' AND se.calendar=%d AND se.id IN (".$ev_ids_inline.") ",$calendar_id);
|
522 |
+
$categ_color=$wpdb->get_results($query);
|
523 |
+
}
|
524 |
+
|
525 |
+
if (($weekday_i % 7 == 0 and $weekstart == "mo") or ($weekday_i % 7 == 1 and $weekstart == "su")) {
|
526 |
+
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
527 |
+
|
528 |
+
echo ' <td class="cala_day" style="background-color:' . $bg_color_selected . ' !important;text-align:center;padding:0; margin:0;line-height:inherit;">
|
529 |
+
<div class="calborder_day" style="text-align:center; width:' . $cell_width . 'px; margin:0; padding:0;">
|
530 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-decoration:underline;"
|
531 |
+
href="' . add_query_arg(array(
|
532 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
533 |
+
'theme_id' => $theme_id,
|
534 |
+
'calendar_id' => $calendar_id,
|
535 |
+
'ev_ids' => $ev_ids_inline,
|
536 |
+
'eventID' => $ev_id[0],
|
537 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
538 |
+
'many_sp_calendar' => $many_sp_calendar,
|
539 |
+
'widget' => $widget,
|
540 |
+
'TB_iframe' => 1,
|
541 |
+
'tbWidth' => $popup_width,
|
542 |
+
'tbHeight' => $popup_height,
|
543 |
+
), $site_url) . '"><b>' . $i . '</b>
|
544 |
+
</a>
|
545 |
+
</div>
|
546 |
+
</td>';
|
547 |
+
}
|
548 |
+
elseif ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
549 |
+
if (in_array($i, $array_days)) {
|
550 |
+
if (in_array ($i, $array_days1)) {
|
551 |
+
echo '
|
552 |
+
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ' !important;text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
553 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . ';text-align:center;text-decoration:underline;"
|
554 |
+
href="' . add_query_arg(array(
|
555 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
556 |
+
'theme_id' => $theme_id,
|
557 |
+
'calendar_id' => $calendar_id,
|
558 |
+
'ev_ids' => $ev_ids_inline,
|
559 |
+
'eventID' => $ev_id[0],
|
560 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
561 |
+
'many_sp_calendar' => $many_sp_calendar,
|
562 |
+
'widget' => $widget,
|
563 |
+
'TB_iframe' => 1,
|
564 |
+
'tbWidth' => $popup_width,
|
565 |
+
'tbHeight' => $popup_height,
|
566 |
+
), $site_url) . '"><b>' . $i . '</b>
|
567 |
+
</a>';
|
568 |
+
echo '<table style="width:100%; border:0;margin: 0"><tr>';
|
569 |
+
foreach($categ_color as $color){
|
570 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
571 |
+
}
|
572 |
+
echo '</tr></table>';
|
573 |
+
echo '</td>';
|
574 |
+
}
|
575 |
+
else {
|
576 |
+
echo '
|
577 |
+
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ' !important;text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
578 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . ';text-align:center;text-decoration:underline;"
|
579 |
+
href="' . add_query_arg(array(
|
580 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
581 |
+
'theme_id' => $theme_id,
|
582 |
+
'calendar_id' => $calendar_id,
|
583 |
+
'ev_ids' => $ev_ids_inline,
|
584 |
+
'eventID' => $ev_id[0],
|
585 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
586 |
+
'many_sp_calendar' => $many_sp_calendar,
|
587 |
+
'widget' => $widget,
|
588 |
+
'TB_iframe' => 1,
|
589 |
+
'tbWidth' => $popup_width,
|
590 |
+
'tbHeight' => $popup_height,
|
591 |
+
), $site_url) . '"><b>' . $i . '</b>
|
592 |
+
</a>';
|
593 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
594 |
+
foreach($categ_color as $color){
|
595 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
596 |
+
}
|
597 |
+
echo '</tr></table>';
|
598 |
+
echo '</td>';
|
599 |
+
}
|
600 |
+
}
|
601 |
+
else {
|
602 |
+
echo '
|
603 |
+
<td class="calsun_days" style="color:' . $text_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
604 |
+
<b>' . $i . '</b>
|
605 |
+
</td>';
|
606 |
+
}
|
607 |
+
}
|
608 |
+
else {
|
609 |
+
if (in_array ($i, $array_days)) {
|
610 |
+
if (in_array ($i, $array_days1)) {
|
611 |
+
|
612 |
+
echo '
|
613 |
+
<td class="cala_day" style="background-color:' . $evented_color_bg . ' !important;text-align:center;padding:0; margin:0;line-height:inherit;">
|
614 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . ';text-align:center;text-decoration:underline;"
|
615 |
+
href="' . add_query_arg(array(
|
616 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
617 |
+
'theme_id' => $theme_id,
|
618 |
+
'calendar_id' => $calendar_id,
|
619 |
+
'ev_ids' => $ev_ids_inline,
|
620 |
+
'eventID' => $ev_id[0],
|
621 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
622 |
+
'many_sp_calendar' => $many_sp_calendar,
|
623 |
+
'widget' => $widget,
|
624 |
+
'TB_iframe' => 1,
|
625 |
+
'tbWidth' => $popup_width,
|
626 |
+
'tbHeight' => $popup_height,
|
627 |
+
'cat_id' => $cat_ids
|
628 |
+
), $site_url) . '"><b>' . $i . '</b>
|
629 |
+
</a>';
|
630 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
631 |
+
foreach($categ_color as $color){
|
632 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
633 |
+
}
|
634 |
+
echo '</tr></table>';
|
635 |
+
echo '</td>';
|
636 |
+
}
|
637 |
+
else {
|
638 |
+
echo '
|
639 |
+
<td class="cala_day" style="background-color:' . $evented_color_bg . ' !important;text-align:center;padding:0; margin:0;line-height:inherit;">
|
640 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . ';text-align:center;text-decoration:underline;"
|
641 |
+
href="' . add_query_arg(array(
|
642 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
643 |
+
'theme_id' => $theme_id,
|
644 |
+
'calendar_id' => $calendar_id,
|
645 |
+
'ev_ids' => $ev_ids_inline,
|
646 |
+
'eventID' => $ev_id[0],
|
647 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
648 |
+
'many_sp_calendar' => $many_sp_calendar,
|
649 |
+
'widget' => $widget,
|
650 |
+
'TB_iframe' => 1,
|
651 |
+
'tbWidth' => $popup_width,
|
652 |
+
'tbHeight' => $popup_height,
|
653 |
+
'cat_id' => $cat_ids
|
654 |
+
), $site_url) . '"><b>' . $i . '</b>
|
655 |
+
</a>';
|
656 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
657 |
+
foreach($categ_color as $color){
|
658 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
659 |
+
}
|
660 |
+
echo '</tr></table>';
|
661 |
+
echo '</td>';
|
662 |
+
}
|
663 |
+
}
|
664 |
+
else {
|
665 |
+
echo '
|
666 |
+
<td class="calsun_days" style="text-align:center;padding:0; margin:0;line-height:inherit;">
|
667 |
+
<b>' . $i . '</b>
|
668 |
+
</td>';
|
669 |
+
}
|
670 |
+
}
|
671 |
+
}
|
672 |
+
elseif ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
673 |
+
|
674 |
+
if (in_array ($i,$array_days)) {
|
675 |
+
|
676 |
+
echo ' <td style="background-color:' . $bg_color_selected . ' !important;text-align:center;padding:0; margin:0;line-height:inherit;">
|
677 |
+
<div class="calborder_day" style="text-align:center; width:' . $cell_width . 'px; margin:0; padding:0;">
|
678 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-decoration:underline;"
|
679 |
+
href="' . add_query_arg(array(
|
680 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
681 |
+
'theme_id' => $theme_id,
|
682 |
+
'calendar_id' => $calendar_id,
|
683 |
+
'ev_ids' => $ev_ids_inline,
|
684 |
+
'eventID' => $ev_id[0],
|
685 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
686 |
+
'many_sp_calendar' => $many_sp_calendar,
|
687 |
+
'widget' => $widget,
|
688 |
+
'TB_iframe' => 1,
|
689 |
+
'tbWidth' => $popup_width,
|
690 |
+
'tbHeight' => $popup_height,
|
691 |
+
'cat_id' => $cat_ids
|
692 |
+
), $site_url) . '"><b>' . $i . '</b>
|
693 |
+
</a>';
|
694 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
695 |
+
foreach($categ_color as $color){
|
696 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
697 |
+
}
|
698 |
+
echo '</tr></table>';
|
699 |
+
echo '</td>';
|
700 |
+
}
|
701 |
+
|
702 |
+
else {
|
703 |
+
|
704 |
+
echo '<td style="text-align:center; color:' . $text_color_selected . ';padding:0; margin:0; line-height:inherit; border: 2px solid ' . $border_day . '">
|
705 |
+
<b>' . $i . '</b>
|
706 |
+
</td>';
|
707 |
+
}
|
708 |
+
|
709 |
+
}
|
710 |
+
else {
|
711 |
+
if ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
712 |
+
|
713 |
+
|
714 |
+
if (in_array ($i, $array_days)) {
|
715 |
+
|
716 |
+
|
717 |
+
if (in_array ($i, $array_days1)) {
|
718 |
+
echo '
|
719 |
+
<td class="cala_day" style="color:' . $text_color_selected . ' !important;background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
720 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-align:center;text-decoration:underline;"
|
721 |
+
href="' . add_query_arg(array(
|
722 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
723 |
+
'theme_id' => $theme_id,
|
724 |
+
'calendar_id' => $calendar_id,
|
725 |
+
'ev_ids' => $ev_ids_inline,
|
726 |
+
'eventID' => $ev_id[0],
|
727 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
728 |
+
'many_sp_calendar' => $many_sp_calendar,
|
729 |
+
'widget' => $widget,
|
730 |
+
'TB_iframe' => 1,
|
731 |
+
'tbWidth' => $popup_width,
|
732 |
+
'tbHeight' => $popup_height,
|
733 |
+
'cat_id' => $cat_ids
|
734 |
+
), $site_url) . '"><b>' . $i . '</b>
|
735 |
+
</a>';
|
736 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
737 |
+
foreach($categ_color as $color){
|
738 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
739 |
+
}
|
740 |
+
echo '</tr></table>';
|
741 |
+
echo '</td>';
|
742 |
+
}
|
743 |
+
else {
|
744 |
+
echo '
|
745 |
+
<td class="cala_day" style="color:' . $text_color_selected . ' !important;background-color:' . $bg_color_selected . ' !important;text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
746 |
+
<a id="cur_day" class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-align:center;text-decoration:underline;"
|
747 |
+
href="' . add_query_arg(array(
|
748 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
749 |
+
'theme_id' => $theme_id,
|
750 |
+
'calendar_id' => $calendar_id,
|
751 |
+
'ev_ids' => $ev_ids_inline,
|
752 |
+
'eventID' => $ev_id[0],
|
753 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
754 |
+
'many_sp_calendar' => $many_sp_calendar,
|
755 |
+
'widget' => $widget,
|
756 |
+
'TB_iframe' => 1,
|
757 |
+
'tbWidth' => $popup_width,
|
758 |
+
'tbHeight' => $popup_height,
|
759 |
+
'cat_id' => $cat_ids
|
760 |
+
), $site_url) . '"><b>' . $i . '</b></a>';
|
761 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
762 |
+
foreach($categ_color as $color){
|
763 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
764 |
+
}
|
765 |
+
echo '</tr></table>';
|
766 |
+
echo '</td>';
|
767 |
+
}
|
768 |
+
}
|
769 |
+
else {
|
770 |
+
|
771 |
+
echo '<td style="text-align:center; color:' . $text_color_selected . ';padding:0; margin:0; line-height:inherit; border: 2px solid ' . $border_day . '">
|
772 |
+
<b>' . $i . '</b>
|
773 |
+
</td>';
|
774 |
+
}
|
775 |
+
}
|
776 |
+
elseif (in_array($i, $array_days)) {
|
777 |
+
|
778 |
+
if (in_array ($i, $array_days1)) {
|
779 |
+
echo '<td class="cala_day" style="background-color:' . $evented_color_bg . ' !important;text-align:center;padding:0; margin:0;line-height:inherit;">
|
780 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . '; text-align:center;text-decoration:underline;"
|
781 |
+
href="' . add_query_arg(array(
|
782 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
783 |
+
'theme_id' => $theme_id,
|
784 |
+
'calendar_id' => $calendar_id,
|
785 |
+
'ev_ids' => $ev_ids_inline,
|
786 |
+
'eventID' => $ev_id[0],
|
787 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
788 |
+
'many_sp_calendar' => $many_sp_calendar,
|
789 |
+
'widget' => $widget,
|
790 |
+
'TB_iframe' => 1,
|
791 |
+
'tbWidth' => $popup_width,
|
792 |
+
'tbHeight' => $popup_height,
|
793 |
+
'cat_id' => $cat_ids
|
794 |
+
), $site_url) . '"><b>' . $i . '</b>
|
795 |
+
</a>';
|
796 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
797 |
+
foreach($categ_color as $color){
|
798 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
799 |
+
}
|
800 |
+
echo '</tr></table>';
|
801 |
+
echo '</td>';
|
802 |
+
}
|
803 |
+
else {
|
804 |
+
echo '<td class="cala_day" style="background-color:' . $evented_color_bg . ' !important;text-align:center;padding:0; margin:0;line-height:inherit;">
|
805 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . '; text-align:center;text-decoration:underline;"
|
806 |
+
href="' . add_query_arg(array(
|
807 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
808 |
+
'theme_id' => $theme_id,
|
809 |
+
'calendar_id' => $calendar_id,
|
810 |
+
'ev_ids' => $ev_ids_inline,
|
811 |
+
'eventID' => $ev_id[0],
|
812 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
813 |
+
'many_sp_calendar' => $many_sp_calendar,
|
814 |
+
'widget' => $widget,
|
815 |
+
'TB_iframe' => 1,
|
816 |
+
'tbWidth' => $popup_width,
|
817 |
+
'tbHeight' => $popup_height,
|
818 |
+
'cat_id' => $cat_ids
|
819 |
+
), $site_url) . '"><b>' . $i . '</b></a>
|
820 |
+
';
|
821 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
822 |
+
foreach($categ_color as $color){
|
823 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.str_replace('#','',$color->color).'; display:table-cell;"></td>';
|
824 |
+
}
|
825 |
+
echo '</tr></table>';
|
826 |
+
echo '</td>';
|
827 |
+
}
|
828 |
+
}
|
829 |
+
else {
|
830 |
+
echo ' <td style="text-align:center; color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:inherit;">
|
831 |
+
<b>' . $i . '</b>
|
832 |
+
</td>';
|
833 |
+
}
|
834 |
+
}
|
835 |
+
if ($weekday_i % 7 == 0 && $i <> $month_days) {
|
836 |
+
echo '</tr>
|
837 |
+
<tr class="cell_body" height="' . $percent . 'px" style="line-height:' . $percent . 'px">';
|
838 |
+
$weekday_i = 0;
|
839 |
+
}
|
840 |
+
$weekday_i++;
|
841 |
+
}
|
842 |
+
$weekday_i;
|
843 |
+
$next_i = 1;
|
844 |
+
if ($weekday_i != 1) {
|
845 |
+
for ($i = $weekday_i; $i <= 7; $i++) {
|
846 |
+
echo ' <td class="caltext_color_other_months" style="text-align:center;">' . $next_i . '</td>';
|
847 |
+
$next_i++;
|
848 |
+
}
|
849 |
+
}
|
850 |
+
echo ' </tr>';
|
851 |
+
?>
|
852 |
+
<tr style="font-family: <?php echo $font_year; ?>;">
|
853 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
854 |
+
echo add_query_arg(array(
|
855 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
856 |
+
'theme_id' => $theme_id,
|
857 |
+
'calendar' => $calendar_id,
|
858 |
+
'select' => $view_select,
|
859 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
860 |
+
'many_sp_calendar' => $many_sp_calendar,
|
861 |
+
'widget' => $widget,
|
862 |
+
'cat_id' => '',
|
863 |
+
'cat_ids' => $cat_ids,
|
864 |
+
'TB_iframe' => 1,
|
865 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important">
|
866 |
+
<?php echo ($year - 1); ?>
|
867 |
+
</td>
|
868 |
+
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
869 |
+
<?php echo $year; ?>
|
870 |
+
</td>
|
871 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
872 |
+
echo add_query_arg(array(
|
873 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
874 |
+
'theme_id' => $theme_id,
|
875 |
+
'calendar' => $calendar_id,
|
876 |
+
'select' => $view_select,
|
877 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
878 |
+
'many_sp_calendar' => $many_sp_calendar,
|
879 |
+
'widget' => $widget,
|
880 |
+
'cat_id' => '',
|
881 |
+
'cat_ids' => $cat_ids,
|
882 |
+
'TB_iframe' => 1,
|
883 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important;color:<?php echo $year_font_color; ?> !important">
|
884 |
+
<?php echo ($year + 1); ?>
|
885 |
+
</td>
|
886 |
+
</tr>
|
887 |
+
</table>
|
888 |
+
<input type="text" value="1" name="day" style="display:none" />
|
889 |
+
</form>
|
890 |
+
</td>
|
891 |
+
</tr>
|
892 |
+
</table>
|
893 |
+
</div>
|
894 |
+
<style>
|
895 |
+
#calendar_<?php echo $many_sp_calendar; ?> table{
|
896 |
+
width: 100%;
|
897 |
+
}
|
898 |
+
|
899 |
+
.spider_categories_widget{
|
900 |
+
display:inline-block;
|
901 |
+
cursor:pointer;
|
902 |
+
}
|
903 |
+
|
904 |
+
.spider_categories_widget p{
|
905 |
+
color: #fff;
|
906 |
+
padding: 2px 10px !important;
|
907 |
+
margin: 2px 0 !important;
|
908 |
+
font-size: 13px;
|
909 |
+
}
|
910 |
+
</style>
|
911 |
+
<?php
|
912 |
+
|
913 |
+
//reindex cat_ids_array
|
914 |
+
|
915 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
916 |
+
|
917 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
918 |
+
{
|
919 |
+
echo'
|
920 |
+
<style>
|
921 |
+
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
922 |
+
{
|
923 |
+
text-decoration:underline;
|
924 |
+
cursor:pointer;
|
925 |
+
|
926 |
+
}
|
927 |
+
|
928 |
+
</style>';
|
929 |
+
|
930 |
+
}
|
931 |
+
|
932 |
+
|
933 |
+
|
934 |
+
if($cat_ids=='')
|
935 |
+
$cat_ids='';
|
936 |
+
if($show_cat){
|
937 |
+
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none; margin-top: 10px;">';
|
938 |
+
|
939 |
+
foreach($categories as $category)
|
940 |
+
{
|
941 |
+
|
942 |
+
?>
|
943 |
+
|
944 |
+
<li class="spider_categories_widget"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
945 |
+
'action' => 'spiderbigcalendar_month_widget',
|
946 |
+
'theme_id' => $theme_id,
|
947 |
+
'calendar' => $calendar_id,
|
948 |
+
'select' => $view_select,
|
949 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
950 |
+
'many_sp_calendar' => $many_sp_calendar,
|
951 |
+
'cat_id' => $category->id,
|
952 |
+
'cat_ids' => $cat_ids,
|
953 |
+
'widget' => $widget,
|
954 |
+
), $site_url);?>','<?php echo $many_sp_calendar ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
955 |
+
<?php
|
956 |
+
}
|
957 |
+
if (!empty($categories)) {
|
958 |
+
?>
|
959 |
+
<li class="spider_categories_widget"><p id="category0" style="background-color:#<?php echo str_replace('#','',$bg); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
960 |
+
'action' => 'spiderbigcalendar_month_widget',
|
961 |
+
'theme_id' => $theme_id,
|
962 |
+
'calendar' => $calendar_id,
|
963 |
+
'select' => $view_select,
|
964 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
965 |
+
'many_sp_calendar' => $many_sp_calendar,
|
966 |
+
'cat_id' => '',
|
967 |
+
'cat_ids' => '',
|
968 |
+
'widget' => $widget,
|
969 |
+
), $site_url);?>','<?php echo $many_sp_calendar ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
970 |
+
<?php echo '</ul>';
|
971 |
+
}
|
972 |
+
} ?>
|
973 |
+
</body>
|
974 |
+
</html>
|
975 |
+
<?php
|
976 |
+
die();
|
977 |
+
}
|
978 |
+
|
979 |
?>
|
front_end/bigcalendarweek.php
CHANGED
@@ -1,1070 +1,1070 @@
|
|
1 |
-
<?php
|
2 |
-
function big_calendar_week() {
|
3 |
-
require_once("frontend_functions.php");
|
4 |
-
global $wpdb;
|
5 |
-
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
-
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
-
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
-
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 30);
|
9 |
-
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
10 |
-
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
-
$months = (isset($_GET['months']) ? esc_html($_GET['months']) : '');
|
12 |
-
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
13 |
-
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
14 |
-
$site_url = get_admin_url().'admin-ajax.php';
|
15 |
-
///////////////////////////////////////////////////////////////////////////////////
|
16 |
-
|
17 |
-
if($cat_ids=='')
|
18 |
-
$cat_ids .= $cat_id.',';
|
19 |
-
else
|
20 |
-
$cat_ids .= ','.$cat_id.',';
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
25 |
-
|
26 |
-
function getelementcountinarray($array , $element)
|
27 |
-
{
|
28 |
-
$t=0;
|
29 |
-
|
30 |
-
for($i=0; $i<count($array); $i++)
|
31 |
-
{
|
32 |
-
if($element==$array[$i])
|
33 |
-
$t++;
|
34 |
-
|
35 |
-
}
|
36 |
-
|
37 |
-
|
38 |
-
return $t;
|
39 |
-
|
40 |
-
}
|
41 |
-
|
42 |
-
function getelementindexinarray($array , $element)
|
43 |
-
{
|
44 |
-
|
45 |
-
$t='';
|
46 |
-
|
47 |
-
for($i=0; $i<count($array); $i++)
|
48 |
-
{
|
49 |
-
if($element==$array[$i])
|
50 |
-
$t.=$i.',';
|
51 |
-
|
52 |
-
}
|
53 |
-
|
54 |
-
return $t;
|
55 |
-
|
56 |
-
|
57 |
-
}
|
58 |
-
$cat_ids_array = explode(',',$cat_ids);
|
59 |
-
|
60 |
-
if($cat_id!='')
|
61 |
-
{
|
62 |
-
|
63 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
64 |
-
{
|
65 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
66 |
-
$index_array = explode(',' , $index_in_line);
|
67 |
-
array_pop ($index_array);
|
68 |
-
for($j=0; $j<count($index_array); $j++)
|
69 |
-
unset($cat_ids_array[$index_array[$j]]);
|
70 |
-
$cat_ids = implode(',',$cat_ids_array);
|
71 |
-
}
|
72 |
-
}
|
73 |
-
else
|
74 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
75 |
-
|
76 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
77 |
-
|
78 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
79 |
-
$cal_width = $theme->width;
|
80 |
-
$bg_top = '#' . str_replace('#','',$theme->bg_top);
|
81 |
-
$bg_bottom = '#' . str_replace('#','',$theme->bg_bottom);
|
82 |
-
$border_color = '#' . str_replace('#','',$theme->border_color);
|
83 |
-
$text_color_year = '#' . str_replace('#','',$theme->text_color_year);
|
84 |
-
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
85 |
-
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
86 |
-
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
87 |
-
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
88 |
-
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
89 |
-
$evented_color_bg = (isset($theme->bg_color_this_month_evented) ?'#' . str_replace('#','',$theme->bg_color_this_month_evented) : '');
|
90 |
-
$color_arrow_year = '#' . str_replace('#','',$theme->arrow_color_year);
|
91 |
-
$color_arrow_month = '#' . str_replace('#','',$theme->arrow_color_month);
|
92 |
-
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
93 |
-
$event_title_color = '#' . str_replace('#','',$theme->event_title_color);
|
94 |
-
$current_day_border_color = '#' . str_replace('#','',$theme->current_day_border_color);
|
95 |
-
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
96 |
-
$cell_height = $theme->cell_height;
|
97 |
-
$popup_width = $theme->popup_width;
|
98 |
-
$popup_height = $theme->popup_height;
|
99 |
-
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
100 |
-
$sundays_font_size = $theme->sundays_font_size;
|
101 |
-
$other_days_font_size = $theme->other_days_font_size;
|
102 |
-
$weekdays_font_size = $theme->weekdays_font_size;
|
103 |
-
$border_width = $theme->border_width;
|
104 |
-
$top_height = $theme->top_height;
|
105 |
-
$bg_color_other_months = '#' . str_replace('#','',$theme->bg_color_other_months);
|
106 |
-
$sundays_bg_color = '#' . str_replace('#','',$theme->sundays_bg_color);
|
107 |
-
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
108 |
-
$weekstart = $theme->week_start_day;
|
109 |
-
$weekday_sunday_bg_color = '#' . str_replace('#','',$theme->weekday_sunday_bg_color);
|
110 |
-
$border_radius = $theme->border_radius;
|
111 |
-
$border_radius2 = $border_radius-$border_width;
|
112 |
-
$week_days_cell_height = $theme->week_days_cell_height;
|
113 |
-
$year_font_size = $theme->year_font_size;
|
114 |
-
$month_font_size = $theme->month_font_size;
|
115 |
-
$show_cat = $theme->show_cat;
|
116 |
-
$arrow_size = $theme->arrow_size;
|
117 |
-
$arrow_size_hover = $arrow_size;
|
118 |
-
$next_month_text_color = '#' . str_replace('#','',$theme->next_month_text_color);
|
119 |
-
$prev_month_text_color = '#' . str_replace('#','',$theme->prev_month_text_color);
|
120 |
-
$next_month_arrow_color = '#' . str_replace('#','',$theme->next_month_arrow_color);
|
121 |
-
$prev_month_arrow_color = '#' . str_replace('#','',$theme->prev_month_arrow_color);
|
122 |
-
$next_month_font_size = $theme->next_month_font_size;
|
123 |
-
$prev_month_font_size = $theme->prev_month_font_size;
|
124 |
-
$month_type = $theme->month_type;
|
125 |
-
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
126 |
-
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
127 |
-
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
128 |
-
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
129 |
-
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
130 |
-
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
131 |
-
$date_font_size = $theme->date_font_size;
|
132 |
-
$event_num_font_size = $theme->event_num_font_size;
|
133 |
-
$event_table_height = $theme->event_table_height;
|
134 |
-
$date_height = $theme->date_height;
|
135 |
-
$day_month_font_size = $theme->day_month_font_size;
|
136 |
-
$week_font_size = $theme->week_font_size;
|
137 |
-
$day_month_font_color = '#' . str_replace('#','',$theme->day_month_font_color);
|
138 |
-
$week_font_color = '#' . str_replace('#','',$theme->week_font_color);
|
139 |
-
$views_tabs_bg_color = '#' . str_replace('#','',$theme->views_tabs_bg_color);
|
140 |
-
$views_tabs_text_color = '#' . str_replace('#','',$theme->views_tabs_text_color);
|
141 |
-
$views_tabs_font_size = $theme->views_tabs_font_size;
|
142 |
-
$header_format = (isset($theme->header_format) ? $theme->header_format : 'w/d/m/y');
|
143 |
-
|
144 |
-
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
145 |
-
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
146 |
-
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
147 |
-
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
148 |
-
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
149 |
-
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
150 |
-
$date_font_size = $theme->date_font_size;
|
151 |
-
$event_num_font_size = $theme->event_num_font_size;
|
152 |
-
$show_numbers_for_events = $theme->day_start;
|
153 |
-
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
154 |
-
|
155 |
-
|
156 |
-
__('January', 'sp_calendar');
|
157 |
-
__('February', 'sp_calendar');
|
158 |
-
__('March', 'sp_calendar');
|
159 |
-
__('April', 'sp_calendar');
|
160 |
-
__('May', 'sp_calendar');
|
161 |
-
__('June', 'sp_calendar');
|
162 |
-
__('July', 'sp_calendar');
|
163 |
-
__('August', 'sp_calendar');
|
164 |
-
__('September', 'sp_calendar');
|
165 |
-
__('October', 'sp_calendar');
|
166 |
-
__('November', 'sp_calendar');
|
167 |
-
__('December', 'sp_calendar');
|
168 |
-
if ($cell_height == '') {
|
169 |
-
$cell_height = 70;
|
170 |
-
}
|
171 |
-
if ($cal_width == '') {
|
172 |
-
$cal_width = 700;
|
173 |
-
}
|
174 |
-
|
175 |
-
if ($date != '') {
|
176 |
-
$date_REFERER = $date;
|
177 |
-
}
|
178 |
-
else {
|
179 |
-
$date_REFERER = date("Y-m");
|
180 |
-
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
181 |
-
}
|
182 |
-
$year_REFERER = substr($date_REFERER, 0, 4);
|
183 |
-
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
184 |
-
$day_REFERER = substr($date_REFERER, 8, 2);
|
185 |
-
|
186 |
-
$year = substr($date, 0, 4);
|
187 |
-
$month = Month_name(substr($date, 5, 2));
|
188 |
-
$day = substr($date, 8, 2);
|
189 |
-
|
190 |
-
$cell_width = $cal_width / 7;
|
191 |
-
|
192 |
-
$week_days = array();
|
193 |
-
$d = new DateTime($date);
|
194 |
-
$weekday = $d->format('w');
|
195 |
-
// Monday=0, Sunday=6.
|
196 |
-
$diff = ($weekday == 0 ? 6 : $weekday - 1);
|
197 |
-
if ($weekstart == "su") {
|
198 |
-
$diff = $diff + 1;
|
199 |
-
}
|
200 |
-
$d->modify("-$diff day");
|
201 |
-
$d->modify("-1 day");
|
202 |
-
$prev_date = $d->format('Y-m-d');
|
203 |
-
$d->modify("+1 day");
|
204 |
-
$week_days[] = $d->format('Y-m-d');
|
205 |
-
for ($i = 1; $i < 7; $i++) {
|
206 |
-
$d->modify('+1 day');
|
207 |
-
$week_days[] = $d->format('Y-m-d');
|
208 |
-
}
|
209 |
-
if ($weekstart == "su") {
|
210 |
-
$d->modify('+2 day');
|
211 |
-
}
|
212 |
-
else {
|
213 |
-
$d->modify('+1 day');
|
214 |
-
}
|
215 |
-
$next_date = $d->format('Y-m-d');
|
216 |
-
$prev_month = add_0((int) substr($prev_date, 5, 2) - 1);
|
217 |
-
$this_month = add_0((int) substr($prev_date, 5, 2));
|
218 |
-
$next_month = add_0((int) substr($prev_date, 5, 2) + 1);
|
219 |
-
if ($next_month == '13') {
|
220 |
-
$next_month = '01';
|
221 |
-
}
|
222 |
-
if ($prev_month == '00') {
|
223 |
-
$prev_month = '12';
|
224 |
-
}
|
225 |
-
|
226 |
-
$activedatestr1 = "";
|
227 |
-
$activedatestr2 = "";
|
228 |
-
$view = 'bigcalendarweek';
|
229 |
-
$views = explode(',', $view_select);
|
230 |
-
$defaultview = 'week';
|
231 |
-
array_pop($views);
|
232 |
-
$display = '';
|
233 |
-
if (count($views) == 0) {
|
234 |
-
$display = "display:none";
|
235 |
-
}
|
236 |
-
if(count($views) == 1 && $views[0] == $defaultview) {
|
237 |
-
$display = "display:none";
|
238 |
-
}
|
239 |
-
|
240 |
-
$date_format_array = explode('/', $header_format);
|
241 |
-
for ($i = 0; $i < 4; $i++) {
|
242 |
-
if (isset($date_format_array[$i]) && ($date_format_array[$i] == 'w' || $date_format_array[$i] == 'y'))
|
243 |
-
unset($date_format_array[$i]);
|
244 |
-
if (isset($date_format_array[$i]) && $date_format_array[$i] == 'm')
|
245 |
-
$date_format_array[$i] = 'F';
|
246 |
-
}
|
247 |
-
$header_date_format = implode(' ', $date_format_array);
|
248 |
-
$start_month = date($header_date_format, strtotime($week_days[0]));
|
249 |
-
$end_month = date($header_date_format, strtotime($week_days[6]));
|
250 |
-
$exp_start_month = explode(' ', $start_month);
|
251 |
-
$exp_end_month = explode(' ', $end_month);
|
252 |
-
for($j = 0; $j < count($exp_start_month); $j++){
|
253 |
-
$activedatestr1 .= __($exp_start_month[$j], 'sp_calendar') . ' ';
|
254 |
-
}
|
255 |
-
for($j = 0; $j < count($exp_end_month); $j++){
|
256 |
-
$activedatestr2 .= __($exp_end_month[$j], 'sp_calendar') . ' ';
|
257 |
-
}
|
258 |
-
$activedatestr = $activedatestr1 . '- ' . $activedatestr2;
|
259 |
-
?>
|
260 |
-
<html>
|
261 |
-
<head>
|
262 |
-
<style type='text/css'>
|
263 |
-
|
264 |
-
#afterbig<?php echo $many_sp_calendar; ?> table,
|
265 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
266 |
-
font-family: Segoe UI;
|
267 |
-
border: 0;
|
268 |
-
}
|
269 |
-
|
270 |
-
.week_list:last-child{
|
271 |
-
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
272 |
-
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
273 |
-
border-radius:<?php echo $border_radius2; ?>px !important;
|
274 |
-
border-bottom-left-radius: <?php echo $border_radius2; ?>px !important;
|
275 |
-
}
|
276 |
-
#TB_iframeContent{
|
277 |
-
background-color: <?php echo $show_event_bgcolor; ?>;
|
278 |
-
}
|
279 |
-
|
280 |
-
.general_table table table:last-child .week_list .week_ev{
|
281 |
-
border-bottom-left-radius:<?php echo $border_radius2?>px;
|
282 |
-
|
283 |
-
}
|
284 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-left {
|
285 |
-
width: 0px;
|
286 |
-
height: 0px;
|
287 |
-
border-top: 15px solid transparent;
|
288 |
-
border-bottom: 15px solid transparent;
|
289 |
-
border-right: 20px solid;
|
290 |
-
margin: 0 auto;
|
291 |
-
}
|
292 |
-
|
293 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-right {
|
294 |
-
width: 0px;
|
295 |
-
height: 0px;
|
296 |
-
border-top: 15px solid transparent;
|
297 |
-
border-bottom: 15px solid transparent;
|
298 |
-
border-left: 20px solid;
|
299 |
-
margin: 0 auto;
|
300 |
-
}
|
301 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-right{
|
302 |
-
border-top: 5px solid transparent;
|
303 |
-
border-bottom: 5px solid transparent;
|
304 |
-
border-left: 8px solid;
|
305 |
-
left: 5px;
|
306 |
-
position: relative;
|
307 |
-
}
|
308 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-down{
|
309 |
-
width: 0px;
|
310 |
-
height: 0px;
|
311 |
-
border-left: 5px solid transparent;
|
312 |
-
border-right: 5px solid transparent;
|
313 |
-
border-top: 8px solid;
|
314 |
-
}
|
315 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
316 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
317 |
-
#spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
318 |
-
border: none !important;
|
319 |
-
}
|
320 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
321 |
-
border-radius: <?php echo $border_radius; ?>px !important;
|
322 |
-
}
|
323 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
324 |
-
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
325 |
-
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
326 |
-
}
|
327 |
-
|
328 |
-
.general_table table tr:last-child >td:last-child{
|
329 |
-
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
330 |
-
border-top-right-radius: <?php echo $border_radius2 ?>px;
|
331 |
-
}
|
332 |
-
|
333 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
334 |
-
#bigcalendar .cala_arrow a:visited {
|
335 |
-
text-decoration: none !important;
|
336 |
-
box-shadow: none !important;
|
337 |
-
background: none !important;
|
338 |
-
font-size: <?php echo $arrow_size; ?>px !important;
|
339 |
-
}
|
340 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow {
|
341 |
-
vertical-align: middle !important;
|
342 |
-
}
|
343 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
344 |
-
font-size: <?php echo $arrow_size_hover; ?>px !important;
|
345 |
-
text-decoration: none !important;
|
346 |
-
background: none !important;
|
347 |
-
}
|
348 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
349 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
350 |
-
text-decoration: none !important;
|
351 |
-
background: none !important;
|
352 |
-
font-size: 12px !important;
|
353 |
-
color: red;
|
354 |
-
}
|
355 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
356 |
-
text-decoration: none !important;
|
357 |
-
background: none !important;
|
358 |
-
}
|
359 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
360 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
361 |
-
<?php echo 'vertical-align:top !important;'; ?>
|
362 |
-
}
|
363 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
364 |
-
vertical-align: middle !important;
|
365 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
366 |
-
}
|
367 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
368 |
-
font-size: <?php echo $weekdays_font_size; ?>px !important;
|
369 |
-
}
|
370 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
371 |
-
border-spacing: 0 !important;
|
372 |
-
width: 100% !important;
|
373 |
-
}
|
374 |
-
.calyear_table table #bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
375 |
-
border-spacing: 0 !important;
|
376 |
-
width: 100% !important;
|
377 |
-
}
|
378 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg, #bigcalendar .calbg td {
|
379 |
-
text-align: center !important;
|
380 |
-
width: 14% !important;
|
381 |
-
}
|
382 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
383 |
-
color: <?php echo $text_color_other_months; ?> !important;
|
384 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
385 |
-
<?php echo 'vertical-align:top !important;'; ?>
|
386 |
-
}
|
387 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
388 |
-
color: <?php echo $text_color_this_month_unevented; ?> !important;
|
389 |
-
}
|
390 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
391 |
-
font-size: 24px !important;
|
392 |
-
font-weight: bold !important;
|
393 |
-
color: <?php echo $text_color_year; ?> !important;
|
394 |
-
}
|
395 |
-
.general_table table, .general_table td, .general_table tr {
|
396 |
-
border: inherit !important;
|
397 |
-
vertical-align: initial !important;
|
398 |
-
border-collapse: inherit !important;
|
399 |
-
margin: inherit !important;
|
400 |
-
padding: inherit !important;
|
401 |
-
}
|
402 |
-
.general_table {
|
403 |
-
border-collapse: inherit !important;
|
404 |
-
margin: inherit !important;
|
405 |
-
}
|
406 |
-
.general_table p {
|
407 |
-
margin: inherit !important;
|
408 |
-
padding: inherit !important;
|
409 |
-
}
|
410 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
411 |
-
color: <?php echo $sun_days; ?> !important;
|
412 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
413 |
-
<?php echo 'vertical-align:top !important; text-align:left !important;'; ?>
|
414 |
-
background-color: <?php echo $sundays_bg_color; ?> !important;
|
415 |
-
}
|
416 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbottom_border {
|
417 |
-
|
418 |
-
}
|
419 |
-
#TB_window {
|
420 |
-
z-index: 10000;
|
421 |
-
}
|
422 |
-
|
423 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> td {
|
424 |
-
vertical-align: middle !important;
|
425 |
-
}
|
426 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table {
|
427 |
-
border-collapse: initial;
|
428 |
-
border:0px;
|
429 |
-
max-width: none;
|
430 |
-
}
|
431 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table tr:hover td {
|
432 |
-
background: none;
|
433 |
-
}
|
434 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
435 |
-
padding: 0px;
|
436 |
-
vertical-align: none;
|
437 |
-
border-top:none;
|
438 |
-
line-height: none;
|
439 |
-
text-align: none;
|
440 |
-
background: transparent;
|
441 |
-
}
|
442 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
443 |
-
margin-bottom:0;
|
444 |
-
}
|
445 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
446 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
447 |
-
#spiderCalendarTitlesList td,
|
448 |
-
#spiderCalendarTitlesList tr {
|
449 |
-
border:none;
|
450 |
-
}
|
451 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
452 |
-
border-radius: <?php echo $border_radius; ?>px;
|
453 |
-
}
|
454 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
455 |
-
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
456 |
-
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
457 |
-
}
|
458 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
459 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
460 |
-
text-decoration:none !important;
|
461 |
-
background:none;
|
462 |
-
font-size: <?php echo $arrow_size; ?>px;
|
463 |
-
}
|
464 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
465 |
-
text-decoration:none;
|
466 |
-
background:none;
|
467 |
-
}
|
468 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
469 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
470 |
-
text-decoration:none;
|
471 |
-
background:none;
|
472 |
-
font-size:12px;
|
473 |
-
color:red;
|
474 |
-
}
|
475 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
476 |
-
text-decoration:none;
|
477 |
-
background:none;
|
478 |
-
}
|
479 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
480 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
481 |
-
vertical-align:top;
|
482 |
-
}
|
483 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
484 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
485 |
-
}
|
486 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
487 |
-
font-size:<?php echo $weekdays_font_size; ?>px;
|
488 |
-
}
|
489 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
490 |
-
border-spacing:0;
|
491 |
-
width:100%;
|
492 |
-
}
|
493 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
494 |
-
border-spacing:0;
|
495 |
-
width:100%;
|
496 |
-
}
|
497 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
498 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
|
499 |
-
text-align:center;
|
500 |
-
width:14%;
|
501 |
-
}
|
502 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
503 |
-
color:<?php echo $text_color_other_months; ?>;
|
504 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
505 |
-
vertical-align:top;
|
506 |
-
}
|
507 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
508 |
-
color:<?php echo $text_color_this_month_unevented; ?>;
|
509 |
-
}
|
510 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
511 |
-
font-size:24px;
|
512 |
-
font-weight:bold;
|
513 |
-
color:<?php echo $text_color_year; ?>;
|
514 |
-
}
|
515 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
516 |
-
color:<?php echo $sun_days; ?>;
|
517 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
518 |
-
vertical-align:top;
|
519 |
-
text-align:left;
|
520 |
-
background-color:<?php echo $sundays_bg_color; ?> !important;
|
521 |
-
}
|
522 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
523 |
-
float: right;
|
524 |
-
background-color: <?php echo $views_tabs_bg_color; ?> !important;
|
525 |
-
min-height: 25px;
|
526 |
-
min-width: 70px;
|
527 |
-
margin-left: 2px;
|
528 |
-
text-align: center;
|
529 |
-
cursor:pointer;
|
530 |
-
position: relative;
|
531 |
-
top: 5px;
|
532 |
-
}
|
533 |
-
#afterbig<?php echo $many_sp_calendar; ?> .views span,
|
534 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
535 |
-
line-height: 30px;
|
536 |
-
}
|
537 |
-
|
538 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
539 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
540 |
-
{
|
541 |
-
|
542 |
-
background-color: <?php echo $views_tabs_bg_color?> !important;
|
543 |
-
width: 120px;
|
544 |
-
text-align: center;
|
545 |
-
cursor: pointer;
|
546 |
-
padding: 6px;
|
547 |
-
position: relative;
|
548 |
-
}
|
549 |
-
|
550 |
-
|
551 |
-
#drop_down_views
|
552 |
-
{
|
553 |
-
list-style-type:none !important;
|
554 |
-
position: absolute;
|
555 |
-
top: 46px;
|
556 |
-
left: 0px;
|
557 |
-
display:none;
|
558 |
-
z-index: 4545;
|
559 |
-
margin-left: 0;
|
560 |
-
}
|
561 |
-
|
562 |
-
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
563 |
-
{
|
564 |
-
background: <?php echo $bg_top ?> !important;
|
565 |
-
}
|
566 |
-
|
567 |
-
#drop_down_views >li
|
568 |
-
{
|
569 |
-
border-bottom:1px solid #fff !important;
|
570 |
-
}
|
571 |
-
|
572 |
-
|
573 |
-
#views_tabs_select
|
574 |
-
{
|
575 |
-
display:none;
|
576 |
-
}
|
577 |
-
|
578 |
-
</style>
|
579 |
-
</head>
|
580 |
-
<body>
|
581 |
-
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
582 |
-
<div style="width:100%;">
|
583 |
-
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
584 |
-
<tr>
|
585 |
-
<td>
|
586 |
-
<div id="views_tabs" style="width: 100%;<?php echo $display; ?>">
|
587 |
-
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
588 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
589 |
-
'action' => 'spiderbigcalendar_day',
|
590 |
-
'theme_id' => $theme_id,
|
591 |
-
'calendar' => $calendar_id,
|
592 |
-
'select' => $view_select,
|
593 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
594 |
-
'many_sp_calendar' => $many_sp_calendar,
|
595 |
-
'cat_id' => '',
|
596 |
-
'cat_ids' => $cat_ids,
|
597 |
-
'widget' => $widget,
|
598 |
-
'rand' => $many_sp_calendar,
|
599 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Day', 'sp_calendar'); ?></span>
|
600 |
-
</div>
|
601 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
602 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
603 |
-
'action' => 'spiderbigcalendar_week',
|
604 |
-
'theme_id' => $theme_id,
|
605 |
-
'calendar' => $calendar_id,
|
606 |
-
'select' => $view_select,
|
607 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
608 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
609 |
-
'many_sp_calendar' => $many_sp_calendar,
|
610 |
-
'cat_id' => '',
|
611 |
-
'cat_ids' => $cat_ids,
|
612 |
-
'widget' => $widget,
|
613 |
-
'rand' => $many_sp_calendar,
|
614 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Week', 'sp_calendar'); ?></span>
|
615 |
-
</div>
|
616 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ' !important;top:0;' ?>"
|
617 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
618 |
-
'action' => 'spiderbigcalendar_list',
|
619 |
-
'theme_id' => $theme_id,
|
620 |
-
'calendar' => $calendar_id,
|
621 |
-
'select' => $view_select,
|
622 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
623 |
-
'many_sp_calendar' => $many_sp_calendar,
|
624 |
-
'cat_id' => '',
|
625 |
-
'cat_ids' => $cat_ids,
|
626 |
-
'widget' => $widget,
|
627 |
-
'rand' => $many_sp_calendar,
|
628 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('List', 'sp_calendar'); ?></span>
|
629 |
-
</div>
|
630 |
-
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
631 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
632 |
-
'action' => 'spiderbigcalendar_month',
|
633 |
-
'theme_id' => $theme_id,
|
634 |
-
'calendar' => $calendar_id,
|
635 |
-
'select' => $view_select,
|
636 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
637 |
-
'many_sp_calendar' => $many_sp_calendar,
|
638 |
-
'cat_id' => '',
|
639 |
-
'cat_ids' => $cat_ids,
|
640 |
-
'widget' => $widget,
|
641 |
-
'rand' => $many_sp_calendar,
|
642 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative;color:<?php echo $views_tabs_text_color; ?>;font-size:<?php echo $views_tabs_font_size; ?>px"><?php echo __('Month', 'sp_calendar'); ?></span>
|
643 |
-
</div>
|
644 |
-
</div>
|
645 |
-
<div id="views_tabs_select" style="display:none" >
|
646 |
-
<div id="views_select" style="background-color:<?php echo $bg_top?> !important;color:<?php echo $views_tabs_text_color ?> !important;font-size:<?php echo $views_tabs_font_size ?>px">
|
647 |
-
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
648 |
-
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
649 |
-
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
650 |
-
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
651 |
-
<div class="arrow-right show_arrow"></div>
|
652 |
-
<div class="arrow-down"></div>
|
653 |
-
</div>
|
654 |
-
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
655 |
-
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
656 |
-
<div class="views_select"
|
657 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
658 |
-
'action' => 'spiderbigcalendar_day',
|
659 |
-
'theme_id' => $theme_id,
|
660 |
-
'calendar' => $calendar_id,
|
661 |
-
'select' => $view_select,
|
662 |
-
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
663 |
-
'many_sp_calendar' => $many_sp_calendar,
|
664 |
-
'cat_id' => '',
|
665 |
-
'cat_ids' => $cat_ids,
|
666 |
-
'widget' => $widget,
|
667 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
668 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
669 |
-
</div>
|
670 |
-
</li>
|
671 |
-
|
672 |
-
<li <?php if($view=='bigcalendarweek'):?> class="active" <?php endif; ?> style="<?php if(!in_array('week',$views) AND $defaultview!='week' ) echo 'display:none;' ; ?>" ><div class="views_select"
|
673 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
674 |
-
'action' => 'spiderbigcalendar_week',
|
675 |
-
'theme_id' => $theme_id,
|
676 |
-
'calendar' => $calendar_id,
|
677 |
-
'select' => $view_select,
|
678 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
679 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
680 |
-
'many_sp_calendar' => $many_sp_calendar,
|
681 |
-
'cat_id' => '',
|
682 |
-
'cat_ids' => $cat_ids,
|
683 |
-
'widget' => $widget,
|
684 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
685 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
686 |
-
</div>
|
687 |
-
</li>
|
688 |
-
|
689 |
-
<li <?php if($view=='bigcalendarlist'):?> class="active" <?php endif; ?> style="<?php if(!in_array('list',$views) AND $defaultview!='list' ) echo 'display:none;' ;?>"><div class="views_select"
|
690 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
691 |
-
'action' => 'spiderbigcalendar_list',
|
692 |
-
'theme_id' => $theme_id,
|
693 |
-
'calendar' => $calendar_id,
|
694 |
-
'select' => $view_select,
|
695 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
696 |
-
'many_sp_calendar' => $many_sp_calendar,
|
697 |
-
'cat_id' => '',
|
698 |
-
'cat_ids' => $cat_ids,
|
699 |
-
'widget' => $widget,
|
700 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
701 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
702 |
-
</div>
|
703 |
-
</li>
|
704 |
-
|
705 |
-
<li <?php if($view=='bigcalendarmonth'):?> class="active" <?php endif; ?> style="<?php if(!in_array('month',$views) AND $defaultview!='month' ) echo 'display:none;'; ?>"><div class="views_select"
|
706 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
707 |
-
'action' => 'spiderbigcalendar_month',
|
708 |
-
'theme_id' => $theme_id,
|
709 |
-
'calendar' => $calendar_id,
|
710 |
-
'select' => $view_select,
|
711 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
712 |
-
'many_sp_calendar' => $many_sp_calendar,
|
713 |
-
'cat_id' => '',
|
714 |
-
'cat_ids' => $cat_ids,
|
715 |
-
'widget' => $widget,
|
716 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
717 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Month</span></div></li>
|
718 |
-
|
719 |
-
</ul>
|
720 |
-
</div>
|
721 |
-
</td>
|
722 |
-
</tr>
|
723 |
-
<tr>
|
724 |
-
<td>
|
725 |
-
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width:100%;border:<?php echo $border_color; ?> solid <?php echo $border_width; ?>px; margin:0; padding:0;background-color:<?php echo $bg_bottom; ?> !important;">
|
726 |
-
<tr>
|
727 |
-
<td width="100%" style="padding:0; margin:0">
|
728 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;">
|
729 |
-
<tr style="height:40px; width:100%;">
|
730 |
-
<td class="top_table" align="center" colspan="7" style="position: relative;padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
731 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width:100%; height:<?php echo $top_height; ?>px;">
|
732 |
-
<tr>
|
733 |
-
<td style="width:100%;vertical-align:center">
|
734 |
-
<table style="width:100%;">
|
735 |
-
<tr>
|
736 |
-
<td width="15%">
|
737 |
-
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
738 |
-
echo add_query_arg(array(
|
739 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
740 |
-
'theme_id' => $theme_id,
|
741 |
-
'calendar' => $calendar_id,
|
742 |
-
'select' => $view_select,
|
743 |
-
'date' => ($year - 1) . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
744 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
745 |
-
'many_sp_calendar' => $many_sp_calendar,
|
746 |
-
'cat_id' => '',
|
747 |
-
'cat_ids' => $cat_ids,
|
748 |
-
'widget' => $widget,
|
749 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color: <?php echo hex_to_rgb($views_tabs_bg_color, 0.4) ?>;">
|
750 |
-
<span style="font-size:18px; color:#FFF"><?php echo $year - 1; ?></span>
|
751 |
-
</div>
|
752 |
-
</td>
|
753 |
-
<td class="cala_arrow" width="11%" style="text-align:right;margin:0px;padding: 0px 30px 0px 0px !important;">
|
754 |
-
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>;" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
755 |
-
echo add_query_arg(array(
|
756 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
757 |
-
'theme_id' => $theme_id,
|
758 |
-
'calendar' => $calendar_id,
|
759 |
-
'select' => $view_select,
|
760 |
-
'date' => $prev_date,
|
761 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
762 |
-
'many_sp_calendar' => $many_sp_calendar,
|
763 |
-
'cat_id' => '',
|
764 |
-
'cat_ids' => $cat_ids,
|
765 |
-
'widget' => $widget,
|
766 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❰
|
767 |
-
</a>
|
768 |
-
</td>
|
769 |
-
<td style="text-align:center; margin:0;" width="40%">
|
770 |
-
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
771 |
-
<span style="line-height: 30px;font-family:arial; color:<?php echo $text_color_month; ?>; font-size:<?php echo $month_font_size; ?>px;text-shadow: 1px 1px black;"><?php echo $activedatestr; ?></span>
|
772 |
-
</td>
|
773 |
-
<td style="margin:0; padding: 0px 0px 0px 30px !important; text-align:left" width="11%" class="cala_arrow">
|
774 |
-
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
775 |
-
echo add_query_arg(array(
|
776 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
777 |
-
'theme_id' => $theme_id,
|
778 |
-
'calendar' => $calendar_id,
|
779 |
-
'select' => $view_select,
|
780 |
-
'date' => $next_date,
|
781 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
782 |
-
'many_sp_calendar' => $many_sp_calendar,
|
783 |
-
'cat_id' => '',
|
784 |
-
'cat_ids' => $cat_ids,
|
785 |
-
'widget' => $widget,
|
786 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❱
|
787 |
-
</a>
|
788 |
-
</td>
|
789 |
-
<td width="15%">
|
790 |
-
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
791 |
-
echo add_query_arg(array(
|
792 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
793 |
-
'theme_id' => $theme_id,
|
794 |
-
'calendar' => $calendar_id,
|
795 |
-
'select' => $view_select,
|
796 |
-
'date' => ($year + 1) . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
797 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
798 |
-
'many_sp_calendar' => $many_sp_calendar,
|
799 |
-
'cat_id' => '',
|
800 |
-
'cat_ids' => $cat_ids,
|
801 |
-
'widget' => $widget,
|
802 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color: <?php echo hex_to_rgb($views_tabs_bg_color, 0.4) ?>;">
|
803 |
-
<span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
|
804 |
-
</div>
|
805 |
-
</td>
|
806 |
-
</tr>
|
807 |
-
</table>
|
808 |
-
</td>
|
809 |
-
</tr>
|
810 |
-
</table>
|
811 |
-
</td>
|
812 |
-
|
813 |
-
</tr>
|
814 |
-
</tr>
|
815 |
-
<tr>
|
816 |
-
<td>
|
817 |
-
<?php
|
818 |
-
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
819 |
-
if ($weekstart == "su") {
|
820 |
-
$month_first_weekday++;
|
821 |
-
if ($month_first_weekday == 8) {
|
822 |
-
$month_first_weekday = 1;
|
823 |
-
}
|
824 |
-
}
|
825 |
-
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
826 |
-
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
827 |
-
$last_month_days_count = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
828 |
-
$weekday_i = $month_first_weekday;
|
829 |
-
$last_month_days = $last_month_days - $weekday_i + 2;
|
830 |
-
$percent = 1;
|
831 |
-
$sum = $month_days - 8 + $month_first_weekday;
|
832 |
-
if ($sum % 7 <> 0) {
|
833 |
-
$percent = $percent + 1;
|
834 |
-
}
|
835 |
-
$sum = $sum - ($sum % 7);
|
836 |
-
$percent = $percent + ($sum / 7);
|
837 |
-
$percent = 107 / $percent;
|
838 |
-
|
839 |
-
$all_calendar_files = php_getdays_for_three_months($calendar_id, $date, $months, $theme_id, $widget);
|
840 |
-
|
841 |
-
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
842 |
-
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
843 |
-
|
844 |
-
$all_array_days = $all_calendar_files[0]['all_array_days'];
|
845 |
-
$all_array_days1 = $all_calendar_files[0]['all_array_days1'];
|
846 |
-
$all_title = $all_calendar_files[0]['all_title'];
|
847 |
-
$all_ev_ids = $all_calendar_files[0]['all_ev_ids'];
|
848 |
-
|
849 |
-
$prev_month = substr($months, 0, 2);
|
850 |
-
$this_month = substr($months, 3, 2);
|
851 |
-
$next_month = substr($months, 6, 2);
|
852 |
-
$array_days = array();
|
853 |
-
for ($i = 0; $i <= 6; $i++) {
|
854 |
-
$day=substr($week_days[$i],8,2);
|
855 |
-
$month=substr($week_days[$i],5,2);
|
856 |
-
$year=substr($week_days[$i],0,4);
|
857 |
-
|
858 |
-
switch($month)
|
859 |
-
{
|
860 |
-
case $prev_month:
|
861 |
-
$array_days=$all_array_days[0];
|
862 |
-
$array_days1=$all_array_days1[0];
|
863 |
-
$title=$all_title[0];
|
864 |
-
$ev_ids=$all_ev_ids[0];
|
865 |
-
break;
|
866 |
-
|
867 |
-
case $this_month:
|
868 |
-
$array_days=$all_array_days[1];
|
869 |
-
$array_days1=$all_array_days1[1];
|
870 |
-
$title=$all_title[1];
|
871 |
-
$ev_ids=$all_ev_ids[1];
|
872 |
-
break;
|
873 |
-
|
874 |
-
case $next_month:
|
875 |
-
$array_days=$all_array_days[2];
|
876 |
-
$array_days1=$all_array_days1[2];
|
877 |
-
$title=$all_title[2];
|
878 |
-
$ev_ids=$all_ev_ids[2];
|
879 |
-
break;
|
880 |
-
|
881 |
-
}
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
sort($array_days, SORT_NUMERIC);
|
886 |
-
$week_day = date('D', mktime(0, 0, 0, $month, (int) $day, $year));
|
887 |
-
$month_name = month_name($month);
|
888 |
-
echo '<table style="width:100%;border-spacing:0;">
|
889 |
-
<tr>
|
890 |
-
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . ' !important; color:#6E7276">
|
891 |
-
<span style="padding-left:10px; font-size:' . $date_font_size . 'px; color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
892 |
-
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . __($month_name,'sp_calendar') . ' ' . (int) $day . ')</span>
|
893 |
-
</td>
|
894 |
-
<tr>
|
895 |
-
<td>';
|
896 |
-
if (in_array((int) $day, $array_days)) {
|
897 |
-
foreach($title as $key => $value) {
|
898 |
-
if ($key == (int) $day) {
|
899 |
-
$ev_id = explode('<br>', $ev_ids[$key]);
|
900 |
-
array_pop($ev_id);
|
901 |
-
$ev_ids_inline = implode(',', $ev_id);
|
902 |
-
$ev_title = explode('</p>', $value);
|
903 |
-
array_pop($ev_title);
|
904 |
-
for ($j = 0; $j < count($ev_title); $j++) {
|
905 |
-
$queryy =$wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
906 |
-
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
907 |
-
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d",$calendar,$ev_id[$j]);
|
908 |
-
|
909 |
-
$cat_color = $wpdb->get_row($queryy);
|
910 |
-
|
911 |
-
if (($j + 1) % 2 == 0) {
|
912 |
-
$color = $event_num_bg_color2;
|
913 |
-
$table_color = $event_bg_color2;
|
914 |
-
}
|
915 |
-
else {
|
916 |
-
$color = $event_num_bg_color1;
|
917 |
-
$table_color = $event_bg_color1;
|
918 |
-
}
|
919 |
-
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color=$bg_top;};
|
920 |
-
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . ' !important" class="week_list">
|
921 |
-
<tr>
|
922 |
-
<td class="week_ev" style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color: #' . str_replace('#','',$cat_color->color) . ' !important;color:' . $event_num_color . ' !important">' . (($show_numbers_for_events) ? ($j + 1) : '') . '</td>
|
923 |
-
<td>
|
924 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:15px;background:none;color:' . $event_title_color . ';"
|
925 |
-
href="' . add_query_arg(array(
|
926 |
-
'action' => 'spidercalendarbig',
|
927 |
-
'theme_id' => $theme_id,
|
928 |
-
'calendar_id' => $calendar_id,
|
929 |
-
'ev_ids' => $ev_ids_inline,
|
930 |
-
'eventID' => $ev_id[$j],
|
931 |
-
'date' => $year . '-' . $month . '-' . (int) $day,
|
932 |
-
'many_sp_calendar' => $many_sp_calendar,
|
933 |
-
'widget' => $widget,
|
934 |
-
'TB_iframe' => 1,
|
935 |
-
'tbWidth' => $popup_width,
|
936 |
-
'tbHeight' => $popup_height,
|
937 |
-
), $site_url) . '"><b>' . $ev_title[$j] . '</b>
|
938 |
-
</a>
|
939 |
-
</td>
|
940 |
-
</tr>
|
941 |
-
</table>';
|
942 |
-
}
|
943 |
-
}
|
944 |
-
}
|
945 |
-
}
|
946 |
-
else {
|
947 |
-
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '" class="week_list">
|
948 |
-
<tr>
|
949 |
-
<td class="week_ev" style="font-size:22px; font-weight:bold; width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ' !important;color:' . $event_num_color . ' !important"></td>
|
950 |
-
<td><p style="color:' . $event_title_color . '; border:none"> ' . __('There are no events on this date', 'sp_calendar') . '</p></td>
|
951 |
-
</tr>
|
952 |
-
</table>';
|
953 |
-
}
|
954 |
-
echo '</td></tr></table>';
|
955 |
-
}
|
956 |
-
?>
|
957 |
-
</td>
|
958 |
-
</tr>
|
959 |
-
</table>
|
960 |
-
</tr>
|
961 |
-
</table>
|
962 |
-
</td>
|
963 |
-
</tr>
|
964 |
-
</table>
|
965 |
-
</div>
|
966 |
-
<style>
|
967 |
-
@media only screen and (max-width : 640px) {
|
968 |
-
#views_tabs ,#drop_down_views
|
969 |
-
{
|
970 |
-
display:none;
|
971 |
-
}
|
972 |
-
|
973 |
-
#views_tabs_select
|
974 |
-
{
|
975 |
-
display:block !important;
|
976 |
-
}
|
977 |
-
}
|
978 |
-
|
979 |
-
@media only screen and (max-width : 968px) {
|
980 |
-
#cats >li
|
981 |
-
{
|
982 |
-
float:none;
|
983 |
-
}
|
984 |
-
}
|
985 |
-
|
986 |
-
.spider_categories{
|
987 |
-
display:inline-block;
|
988 |
-
cursor:pointer;
|
989 |
-
}
|
990 |
-
|
991 |
-
.spider_categories p{
|
992 |
-
color: #fff;
|
993 |
-
padding: 2px 10px !important;
|
994 |
-
margin: 2px 0 !important;
|
995 |
-
font-size: 14px;
|
996 |
-
font-weight: 600;
|
997 |
-
}
|
998 |
-
</style>
|
999 |
-
<?php
|
1000 |
-
|
1001 |
-
//reindex cat_ids_array
|
1002 |
-
$re_cat_ids_array = array_values($cat_ids_array);
|
1003 |
-
|
1004 |
-
for($i=0; $i<count($re_cat_ids_array); $i++)
|
1005 |
-
{
|
1006 |
-
echo'
|
1007 |
-
<style>
|
1008 |
-
#cats #category'.$re_cat_ids_array[$i].'
|
1009 |
-
{
|
1010 |
-
text-decoration:underline;
|
1011 |
-
cursor:pointer;
|
1012 |
-
|
1013 |
-
}
|
1014 |
-
|
1015 |
-
</style>';
|
1016 |
-
|
1017 |
-
}
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
if($cat_ids=='')
|
1022 |
-
$cat_ids='';
|
1023 |
-
if($show_cat){
|
1024 |
-
echo '<ul id="cats" style="list-style-type:none; padding: 0;">';
|
1025 |
-
|
1026 |
-
foreach($categories as $category)
|
1027 |
-
{
|
1028 |
-
|
1029 |
-
?>
|
1030 |
-
|
1031 |
-
<li class="spider_categories"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1032 |
-
'action' => 'spiderbigcalendar_week',
|
1033 |
-
'theme_id' => $theme_id,
|
1034 |
-
'calendar' => $calendar_id,
|
1035 |
-
'select' => $view_select,
|
1036 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
1037 |
-
'date' => $year . '-' . $month . '-' . add_0($day),
|
1038 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1039 |
-
'cat_id' => $category->id,
|
1040 |
-
'cat_ids' => $cat_ids,
|
1041 |
-
'widget' => $widget,
|
1042 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1043 |
-
|
1044 |
-
|
1045 |
-
<?php
|
1046 |
-
}
|
1047 |
-
if (!empty($categories)) {
|
1048 |
-
?>
|
1049 |
-
<li class="spider_categories"><p id="category0" style="background-color:#<?php echo str_replace('#','',$bg_top); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1050 |
-
'action' => 'spiderbigcalendar_week',
|
1051 |
-
'theme_id' => $theme_id,
|
1052 |
-
'calendar' => $calendar_id,
|
1053 |
-
'select' => $view_select,
|
1054 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
1055 |
-
'date' => $year . '-' . $month . '-' . add_0($day),
|
1056 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1057 |
-
'cat_id' => '',
|
1058 |
-
'cat_ids' => '',
|
1059 |
-
'widget' => $widget,
|
1060 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
1061 |
-
<?php echo '</ul>';
|
1062 |
-
}
|
1063 |
-
} ?>
|
1064 |
-
</body>
|
1065 |
-
</html>
|
1066 |
-
<?php
|
1067 |
-
die();
|
1068 |
-
}
|
1069 |
-
|
1070 |
?>
|
1 |
+
<?php
|
2 |
+
function big_calendar_week() {
|
3 |
+
require_once("frontend_functions.php");
|
4 |
+
global $wpdb;
|
5 |
+
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
+
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
+
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
+
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 30);
|
9 |
+
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
10 |
+
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
+
$months = (isset($_GET['months']) ? esc_html($_GET['months']) : '');
|
12 |
+
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
13 |
+
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
14 |
+
$site_url = get_admin_url().'admin-ajax.php';
|
15 |
+
///////////////////////////////////////////////////////////////////////////////////
|
16 |
+
|
17 |
+
if($cat_ids=='')
|
18 |
+
$cat_ids .= $cat_id.',';
|
19 |
+
else
|
20 |
+
$cat_ids .= ','.$cat_id.',';
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
25 |
+
|
26 |
+
function getelementcountinarray($array , $element)
|
27 |
+
{
|
28 |
+
$t=0;
|
29 |
+
|
30 |
+
for($i=0; $i<count($array); $i++)
|
31 |
+
{
|
32 |
+
if($element==$array[$i])
|
33 |
+
$t++;
|
34 |
+
|
35 |
+
}
|
36 |
+
|
37 |
+
|
38 |
+
return $t;
|
39 |
+
|
40 |
+
}
|
41 |
+
|
42 |
+
function getelementindexinarray($array , $element)
|
43 |
+
{
|
44 |
+
|
45 |
+
$t='';
|
46 |
+
|
47 |
+
for($i=0; $i<count($array); $i++)
|
48 |
+
{
|
49 |
+
if($element==$array[$i])
|
50 |
+
$t.=$i.',';
|
51 |
+
|
52 |
+
}
|
53 |
+
|
54 |
+
return $t;
|
55 |
+
|
56 |
+
|
57 |
+
}
|
58 |
+
$cat_ids_array = explode(',',$cat_ids);
|
59 |
+
|
60 |
+
if($cat_id!='')
|
61 |
+
{
|
62 |
+
|
63 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
64 |
+
{
|
65 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
66 |
+
$index_array = explode(',' , $index_in_line);
|
67 |
+
array_pop ($index_array);
|
68 |
+
for($j=0; $j<count($index_array); $j++)
|
69 |
+
unset($cat_ids_array[$index_array[$j]]);
|
70 |
+
$cat_ids = implode(',',$cat_ids_array);
|
71 |
+
}
|
72 |
+
}
|
73 |
+
else
|
74 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
75 |
+
|
76 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
77 |
+
|
78 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
79 |
+
$cal_width = $theme->width;
|
80 |
+
$bg_top = '#' . str_replace('#','',$theme->bg_top);
|
81 |
+
$bg_bottom = '#' . str_replace('#','',$theme->bg_bottom);
|
82 |
+
$border_color = '#' . str_replace('#','',$theme->border_color);
|
83 |
+
$text_color_year = '#' . str_replace('#','',$theme->text_color_year);
|
84 |
+
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
85 |
+
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
86 |
+
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
87 |
+
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
88 |
+
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
89 |
+
$evented_color_bg = (isset($theme->bg_color_this_month_evented) ?'#' . str_replace('#','',$theme->bg_color_this_month_evented) : '');
|
90 |
+
$color_arrow_year = '#' . str_replace('#','',$theme->arrow_color_year);
|
91 |
+
$color_arrow_month = '#' . str_replace('#','',$theme->arrow_color_month);
|
92 |
+
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
93 |
+
$event_title_color = '#' . str_replace('#','',$theme->event_title_color);
|
94 |
+
$current_day_border_color = '#' . str_replace('#','',$theme->current_day_border_color);
|
95 |
+
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
96 |
+
$cell_height = $theme->cell_height;
|
97 |
+
$popup_width = $theme->popup_width;
|
98 |
+
$popup_height = $theme->popup_height;
|
99 |
+
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
100 |
+
$sundays_font_size = $theme->sundays_font_size;
|
101 |
+
$other_days_font_size = $theme->other_days_font_size;
|
102 |
+
$weekdays_font_size = $theme->weekdays_font_size;
|
103 |
+
$border_width = $theme->border_width;
|
104 |
+
$top_height = $theme->top_height;
|
105 |
+
$bg_color_other_months = '#' . str_replace('#','',$theme->bg_color_other_months);
|
106 |
+
$sundays_bg_color = '#' . str_replace('#','',$theme->sundays_bg_color);
|
107 |
+
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
108 |
+
$weekstart = $theme->week_start_day;
|
109 |
+
$weekday_sunday_bg_color = '#' . str_replace('#','',$theme->weekday_sunday_bg_color);
|
110 |
+
$border_radius = $theme->border_radius;
|
111 |
+
$border_radius2 = $border_radius-$border_width;
|
112 |
+
$week_days_cell_height = $theme->week_days_cell_height;
|
113 |
+
$year_font_size = $theme->year_font_size;
|
114 |
+
$month_font_size = $theme->month_font_size;
|
115 |
+
$show_cat = $theme->show_cat;
|
116 |
+
$arrow_size = $theme->arrow_size;
|
117 |
+
$arrow_size_hover = $arrow_size;
|
118 |
+
$next_month_text_color = '#' . str_replace('#','',$theme->next_month_text_color);
|
119 |
+
$prev_month_text_color = '#' . str_replace('#','',$theme->prev_month_text_color);
|
120 |
+
$next_month_arrow_color = '#' . str_replace('#','',$theme->next_month_arrow_color);
|
121 |
+
$prev_month_arrow_color = '#' . str_replace('#','',$theme->prev_month_arrow_color);
|
122 |
+
$next_month_font_size = $theme->next_month_font_size;
|
123 |
+
$prev_month_font_size = $theme->prev_month_font_size;
|
124 |
+
$month_type = $theme->month_type;
|
125 |
+
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
126 |
+
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
127 |
+
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
128 |
+
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
129 |
+
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
130 |
+
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
131 |
+
$date_font_size = $theme->date_font_size;
|
132 |
+
$event_num_font_size = $theme->event_num_font_size;
|
133 |
+
$event_table_height = $theme->event_table_height;
|
134 |
+
$date_height = $theme->date_height;
|
135 |
+
$day_month_font_size = $theme->day_month_font_size;
|
136 |
+
$week_font_size = $theme->week_font_size;
|
137 |
+
$day_month_font_color = '#' . str_replace('#','',$theme->day_month_font_color);
|
138 |
+
$week_font_color = '#' . str_replace('#','',$theme->week_font_color);
|
139 |
+
$views_tabs_bg_color = '#' . str_replace('#','',$theme->views_tabs_bg_color);
|
140 |
+
$views_tabs_text_color = '#' . str_replace('#','',$theme->views_tabs_text_color);
|
141 |
+
$views_tabs_font_size = $theme->views_tabs_font_size;
|
142 |
+
$header_format = (isset($theme->header_format) ? $theme->header_format : 'w/d/m/y');
|
143 |
+
|
144 |
+
$date_bg_color = '#' . str_replace('#','',$theme->date_bg_color);
|
145 |
+
$event_bg_color1 = '#' . str_replace('#','',$theme->event_bg_color1);
|
146 |
+
$event_bg_color2 = '#' . str_replace('#','',$theme->event_bg_color2);
|
147 |
+
$event_num_bg_color1 = '#' . str_replace('#','',$theme->event_num_bg_color1);
|
148 |
+
$event_num_bg_color2 = '#' . str_replace('#','',$theme->event_num_bg_color2);
|
149 |
+
$event_num_color = '#' . str_replace('#','',$theme->event_num_color);
|
150 |
+
$date_font_size = $theme->date_font_size;
|
151 |
+
$event_num_font_size = $theme->event_num_font_size;
|
152 |
+
$show_numbers_for_events = $theme->day_start;
|
153 |
+
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
154 |
+
|
155 |
+
|
156 |
+
__('January', 'sp_calendar');
|
157 |
+
__('February', 'sp_calendar');
|
158 |
+
__('March', 'sp_calendar');
|
159 |
+
__('April', 'sp_calendar');
|
160 |
+
__('May', 'sp_calendar');
|
161 |
+
__('June', 'sp_calendar');
|
162 |
+
__('July', 'sp_calendar');
|
163 |
+
__('August', 'sp_calendar');
|
164 |
+
__('September', 'sp_calendar');
|
165 |
+
__('October', 'sp_calendar');
|
166 |
+
__('November', 'sp_calendar');
|
167 |
+
__('December', 'sp_calendar');
|
168 |
+
if ($cell_height == '') {
|
169 |
+
$cell_height = 70;
|
170 |
+
}
|
171 |
+
if ($cal_width == '') {
|
172 |
+
$cal_width = 700;
|
173 |
+
}
|
174 |
+
|
175 |
+
if ($date != '') {
|
176 |
+
$date_REFERER = $date;
|
177 |
+
}
|
178 |
+
else {
|
179 |
+
$date_REFERER = date("Y-m");
|
180 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
181 |
+
}
|
182 |
+
$year_REFERER = substr($date_REFERER, 0, 4);
|
183 |
+
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
184 |
+
$day_REFERER = substr($date_REFERER, 8, 2);
|
185 |
+
|
186 |
+
$year = substr($date, 0, 4);
|
187 |
+
$month = Month_name(substr($date, 5, 2));
|
188 |
+
$day = substr($date, 8, 2);
|
189 |
+
|
190 |
+
$cell_width = $cal_width / 7;
|
191 |
+
|
192 |
+
$week_days = array();
|
193 |
+
$d = new DateTime($date);
|
194 |
+
$weekday = $d->format('w');
|
195 |
+
// Monday=0, Sunday=6.
|
196 |
+
$diff = ($weekday == 0 ? 6 : $weekday - 1);
|
197 |
+
if ($weekstart == "su") {
|
198 |
+
$diff = $diff + 1;
|
199 |
+
}
|
200 |
+
$d->modify("-$diff day");
|
201 |
+
$d->modify("-1 day");
|
202 |
+
$prev_date = $d->format('Y-m-d');
|
203 |
+
$d->modify("+1 day");
|
204 |
+
$week_days[] = $d->format('Y-m-d');
|
205 |
+
for ($i = 1; $i < 7; $i++) {
|
206 |
+
$d->modify('+1 day');
|
207 |
+
$week_days[] = $d->format('Y-m-d');
|
208 |
+
}
|
209 |
+
if ($weekstart == "su") {
|
210 |
+
$d->modify('+2 day');
|
211 |
+
}
|
212 |
+
else {
|
213 |
+
$d->modify('+1 day');
|
214 |
+
}
|
215 |
+
$next_date = $d->format('Y-m-d');
|
216 |
+
$prev_month = add_0((int) substr($prev_date, 5, 2) - 1);
|
217 |
+
$this_month = add_0((int) substr($prev_date, 5, 2));
|
218 |
+
$next_month = add_0((int) substr($prev_date, 5, 2) + 1);
|
219 |
+
if ($next_month == '13') {
|
220 |
+
$next_month = '01';
|
221 |
+
}
|
222 |
+
if ($prev_month == '00') {
|
223 |
+
$prev_month = '12';
|
224 |
+
}
|
225 |
+
|
226 |
+
$activedatestr1 = "";
|
227 |
+
$activedatestr2 = "";
|
228 |
+
$view = 'bigcalendarweek';
|
229 |
+
$views = explode(',', $view_select);
|
230 |
+
$defaultview = 'week';
|
231 |
+
array_pop($views);
|
232 |
+
$display = '';
|
233 |
+
if (count($views) == 0) {
|
234 |
+
$display = "display:none";
|
235 |
+
}
|
236 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
237 |
+
$display = "display:none";
|
238 |
+
}
|
239 |
+
|
240 |
+
$date_format_array = explode('/', $header_format);
|
241 |
+
for ($i = 0; $i < 4; $i++) {
|
242 |
+
if (isset($date_format_array[$i]) && ($date_format_array[$i] == 'w' || $date_format_array[$i] == 'y'))
|
243 |
+
unset($date_format_array[$i]);
|
244 |
+
if (isset($date_format_array[$i]) && $date_format_array[$i] == 'm')
|
245 |
+
$date_format_array[$i] = 'F';
|
246 |
+
}
|
247 |
+
$header_date_format = implode(' ', $date_format_array);
|
248 |
+
$start_month = date($header_date_format, strtotime($week_days[0]));
|
249 |
+
$end_month = date($header_date_format, strtotime($week_days[6]));
|
250 |
+
$exp_start_month = explode(' ', $start_month);
|
251 |
+
$exp_end_month = explode(' ', $end_month);
|
252 |
+
for($j = 0; $j < count($exp_start_month); $j++){
|
253 |
+
$activedatestr1 .= __($exp_start_month[$j], 'sp_calendar') . ' ';
|
254 |
+
}
|
255 |
+
for($j = 0; $j < count($exp_end_month); $j++){
|
256 |
+
$activedatestr2 .= __($exp_end_month[$j], 'sp_calendar') . ' ';
|
257 |
+
}
|
258 |
+
$activedatestr = $activedatestr1 . '- ' . $activedatestr2;
|
259 |
+
?>
|
260 |
+
<html>
|
261 |
+
<head>
|
262 |
+
<style type='text/css'>
|
263 |
+
|
264 |
+
#afterbig<?php echo $many_sp_calendar; ?> table,
|
265 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
266 |
+
font-family: Segoe UI;
|
267 |
+
border: 0;
|
268 |
+
}
|
269 |
+
|
270 |
+
.week_list:last-child{
|
271 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
272 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
273 |
+
border-radius:<?php echo $border_radius2; ?>px !important;
|
274 |
+
border-bottom-left-radius: <?php echo $border_radius2; ?>px !important;
|
275 |
+
}
|
276 |
+
#TB_iframeContent{
|
277 |
+
background-color: <?php echo $show_event_bgcolor; ?>;
|
278 |
+
}
|
279 |
+
|
280 |
+
.general_table table table:last-child .week_list .week_ev{
|
281 |
+
border-bottom-left-radius:<?php echo $border_radius2?>px;
|
282 |
+
|
283 |
+
}
|
284 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-left {
|
285 |
+
width: 0px;
|
286 |
+
height: 0px;
|
287 |
+
border-top: 15px solid transparent;
|
288 |
+
border-bottom: 15px solid transparent;
|
289 |
+
border-right: 20px solid;
|
290 |
+
margin: 0 auto;
|
291 |
+
}
|
292 |
+
|
293 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .arrow-right {
|
294 |
+
width: 0px;
|
295 |
+
height: 0px;
|
296 |
+
border-top: 15px solid transparent;
|
297 |
+
border-bottom: 15px solid transparent;
|
298 |
+
border-left: 20px solid;
|
299 |
+
margin: 0 auto;
|
300 |
+
}
|
301 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-right{
|
302 |
+
border-top: 5px solid transparent;
|
303 |
+
border-bottom: 5px solid transparent;
|
304 |
+
border-left: 8px solid;
|
305 |
+
left: 5px;
|
306 |
+
position: relative;
|
307 |
+
}
|
308 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select .arrow-down{
|
309 |
+
width: 0px;
|
310 |
+
height: 0px;
|
311 |
+
border-left: 5px solid transparent;
|
312 |
+
border-right: 5px solid transparent;
|
313 |
+
border-top: 8px solid;
|
314 |
+
}
|
315 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
316 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
317 |
+
#spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
318 |
+
border: none !important;
|
319 |
+
}
|
320 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
321 |
+
border-radius: <?php echo $border_radius; ?>px !important;
|
322 |
+
}
|
323 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
324 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
325 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
326 |
+
}
|
327 |
+
|
328 |
+
.general_table table tr:last-child >td:last-child{
|
329 |
+
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
330 |
+
border-top-right-radius: <?php echo $border_radius2 ?>px;
|
331 |
+
}
|
332 |
+
|
333 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
334 |
+
#bigcalendar .cala_arrow a:visited {
|
335 |
+
text-decoration: none !important;
|
336 |
+
box-shadow: none !important;
|
337 |
+
background: none !important;
|
338 |
+
font-size: <?php echo $arrow_size; ?>px !important;
|
339 |
+
}
|
340 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow {
|
341 |
+
vertical-align: middle !important;
|
342 |
+
}
|
343 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
344 |
+
font-size: <?php echo $arrow_size_hover; ?>px !important;
|
345 |
+
text-decoration: none !important;
|
346 |
+
background: none !important;
|
347 |
+
}
|
348 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
349 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
350 |
+
text-decoration: none !important;
|
351 |
+
background: none !important;
|
352 |
+
font-size: 12px !important;
|
353 |
+
color: red;
|
354 |
+
}
|
355 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
356 |
+
text-decoration: none !important;
|
357 |
+
background: none !important;
|
358 |
+
}
|
359 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
360 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
361 |
+
<?php echo 'vertical-align:top !important;'; ?>
|
362 |
+
}
|
363 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
364 |
+
vertical-align: middle !important;
|
365 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
366 |
+
}
|
367 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
368 |
+
font-size: <?php echo $weekdays_font_size; ?>px !important;
|
369 |
+
}
|
370 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
371 |
+
border-spacing: 0 !important;
|
372 |
+
width: 100% !important;
|
373 |
+
}
|
374 |
+
.calyear_table table #bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
375 |
+
border-spacing: 0 !important;
|
376 |
+
width: 100% !important;
|
377 |
+
}
|
378 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg, #bigcalendar .calbg td {
|
379 |
+
text-align: center !important;
|
380 |
+
width: 14% !important;
|
381 |
+
}
|
382 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
383 |
+
color: <?php echo $text_color_other_months; ?> !important;
|
384 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
385 |
+
<?php echo 'vertical-align:top !important;'; ?>
|
386 |
+
}
|
387 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
388 |
+
color: <?php echo $text_color_this_month_unevented; ?> !important;
|
389 |
+
}
|
390 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
391 |
+
font-size: 24px !important;
|
392 |
+
font-weight: bold !important;
|
393 |
+
color: <?php echo $text_color_year; ?> !important;
|
394 |
+
}
|
395 |
+
.general_table table, .general_table td, .general_table tr {
|
396 |
+
border: inherit !important;
|
397 |
+
vertical-align: initial !important;
|
398 |
+
border-collapse: inherit !important;
|
399 |
+
margin: inherit !important;
|
400 |
+
padding: inherit !important;
|
401 |
+
}
|
402 |
+
.general_table {
|
403 |
+
border-collapse: inherit !important;
|
404 |
+
margin: inherit !important;
|
405 |
+
}
|
406 |
+
.general_table p {
|
407 |
+
margin: inherit !important;
|
408 |
+
padding: inherit !important;
|
409 |
+
}
|
410 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
411 |
+
color: <?php echo $sun_days; ?> !important;
|
412 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
413 |
+
<?php echo 'vertical-align:top !important; text-align:left !important;'; ?>
|
414 |
+
background-color: <?php echo $sundays_bg_color; ?> !important;
|
415 |
+
}
|
416 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbottom_border {
|
417 |
+
|
418 |
+
}
|
419 |
+
#TB_window {
|
420 |
+
z-index: 10000;
|
421 |
+
}
|
422 |
+
|
423 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td {
|
424 |
+
vertical-align: middle !important;
|
425 |
+
}
|
426 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table {
|
427 |
+
border-collapse: initial;
|
428 |
+
border:0px;
|
429 |
+
max-width: none;
|
430 |
+
}
|
431 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table tr:hover td {
|
432 |
+
background: none;
|
433 |
+
}
|
434 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
435 |
+
padding: 0px;
|
436 |
+
vertical-align: none;
|
437 |
+
border-top:none;
|
438 |
+
line-height: none;
|
439 |
+
text-align: none;
|
440 |
+
background: transparent;
|
441 |
+
}
|
442 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
443 |
+
margin-bottom:0;
|
444 |
+
}
|
445 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
446 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
447 |
+
#spiderCalendarTitlesList td,
|
448 |
+
#spiderCalendarTitlesList tr {
|
449 |
+
border:none;
|
450 |
+
}
|
451 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
452 |
+
border-radius: <?php echo $border_radius; ?>px;
|
453 |
+
}
|
454 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
455 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
456 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
457 |
+
}
|
458 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
459 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
460 |
+
text-decoration:none !important;
|
461 |
+
background:none;
|
462 |
+
font-size: <?php echo $arrow_size; ?>px;
|
463 |
+
}
|
464 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
465 |
+
text-decoration:none;
|
466 |
+
background:none;
|
467 |
+
}
|
468 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
469 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
470 |
+
text-decoration:none;
|
471 |
+
background:none;
|
472 |
+
font-size:12px;
|
473 |
+
color:red;
|
474 |
+
}
|
475 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
476 |
+
text-decoration:none;
|
477 |
+
background:none;
|
478 |
+
}
|
479 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
480 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
481 |
+
vertical-align:top;
|
482 |
+
}
|
483 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
484 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
485 |
+
}
|
486 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
487 |
+
font-size:<?php echo $weekdays_font_size; ?>px;
|
488 |
+
}
|
489 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
490 |
+
border-spacing:0;
|
491 |
+
width:100%;
|
492 |
+
}
|
493 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
494 |
+
border-spacing:0;
|
495 |
+
width:100%;
|
496 |
+
}
|
497 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
498 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
|
499 |
+
text-align:center;
|
500 |
+
width:14%;
|
501 |
+
}
|
502 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
503 |
+
color:<?php echo $text_color_other_months; ?>;
|
504 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
505 |
+
vertical-align:top;
|
506 |
+
}
|
507 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
508 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
509 |
+
}
|
510 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
511 |
+
font-size:24px;
|
512 |
+
font-weight:bold;
|
513 |
+
color:<?php echo $text_color_year; ?>;
|
514 |
+
}
|
515 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
516 |
+
color:<?php echo $sun_days; ?>;
|
517 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
518 |
+
vertical-align:top;
|
519 |
+
text-align:left;
|
520 |
+
background-color:<?php echo $sundays_bg_color; ?> !important;
|
521 |
+
}
|
522 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
523 |
+
float: right;
|
524 |
+
background-color: <?php echo $views_tabs_bg_color; ?> !important;
|
525 |
+
min-height: 25px;
|
526 |
+
min-width: 70px;
|
527 |
+
margin-left: 2px;
|
528 |
+
text-align: center;
|
529 |
+
cursor:pointer;
|
530 |
+
position: relative;
|
531 |
+
top: 5px;
|
532 |
+
}
|
533 |
+
#afterbig<?php echo $many_sp_calendar; ?> .views span,
|
534 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
535 |
+
line-height: 30px;
|
536 |
+
}
|
537 |
+
|
538 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
539 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
540 |
+
{
|
541 |
+
|
542 |
+
background-color: <?php echo $views_tabs_bg_color?> !important;
|
543 |
+
width: 120px;
|
544 |
+
text-align: center;
|
545 |
+
cursor: pointer;
|
546 |
+
padding: 6px;
|
547 |
+
position: relative;
|
548 |
+
}
|
549 |
+
|
550 |
+
|
551 |
+
#drop_down_views
|
552 |
+
{
|
553 |
+
list-style-type:none !important;
|
554 |
+
position: absolute;
|
555 |
+
top: 46px;
|
556 |
+
left: 0px;
|
557 |
+
display:none;
|
558 |
+
z-index: 4545;
|
559 |
+
margin-left: 0;
|
560 |
+
}
|
561 |
+
|
562 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
563 |
+
{
|
564 |
+
background: <?php echo $bg_top ?> !important;
|
565 |
+
}
|
566 |
+
|
567 |
+
#drop_down_views >li
|
568 |
+
{
|
569 |
+
border-bottom:1px solid #fff !important;
|
570 |
+
}
|
571 |
+
|
572 |
+
|
573 |
+
#views_tabs_select
|
574 |
+
{
|
575 |
+
display:none;
|
576 |
+
}
|
577 |
+
|
578 |
+
</style>
|
579 |
+
</head>
|
580 |
+
<body>
|
581 |
+
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>" class="wdc_calendar">
|
582 |
+
<div style="width:100%;">
|
583 |
+
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
584 |
+
<tr>
|
585 |
+
<td>
|
586 |
+
<div id="views_tabs" style="width: 100%;<?php echo $display; ?>">
|
587 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
588 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
589 |
+
'action' => 'spiderbigcalendar_day',
|
590 |
+
'theme_id' => $theme_id,
|
591 |
+
'calendar' => $calendar_id,
|
592 |
+
'select' => $view_select,
|
593 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
594 |
+
'many_sp_calendar' => $many_sp_calendar,
|
595 |
+
'cat_id' => '',
|
596 |
+
'cat_ids' => $cat_ids,
|
597 |
+
'widget' => $widget,
|
598 |
+
'rand' => $many_sp_calendar,
|
599 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Day', 'sp_calendar'); ?></span>
|
600 |
+
</div>
|
601 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
602 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
603 |
+
'action' => 'spiderbigcalendar_week',
|
604 |
+
'theme_id' => $theme_id,
|
605 |
+
'calendar' => $calendar_id,
|
606 |
+
'select' => $view_select,
|
607 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
608 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
609 |
+
'many_sp_calendar' => $many_sp_calendar,
|
610 |
+
'cat_id' => '',
|
611 |
+
'cat_ids' => $cat_ids,
|
612 |
+
'widget' => $widget,
|
613 |
+
'rand' => $many_sp_calendar,
|
614 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('Week', 'sp_calendar'); ?></span>
|
615 |
+
</div>
|
616 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ' !important;top:0;' ?>"
|
617 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
618 |
+
'action' => 'spiderbigcalendar_list',
|
619 |
+
'theme_id' => $theme_id,
|
620 |
+
'calendar' => $calendar_id,
|
621 |
+
'select' => $view_select,
|
622 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
623 |
+
'many_sp_calendar' => $many_sp_calendar,
|
624 |
+
'cat_id' => '',
|
625 |
+
'cat_ids' => $cat_ids,
|
626 |
+
'widget' => $widget,
|
627 |
+
'rand' => $many_sp_calendar,
|
628 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative; color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px"><?php echo __('List', 'sp_calendar'); ?></span>
|
629 |
+
</div>
|
630 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ' !important;top:0;'; ?>"
|
631 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
632 |
+
'action' => 'spiderbigcalendar_month',
|
633 |
+
'theme_id' => $theme_id,
|
634 |
+
'calendar' => $calendar_id,
|
635 |
+
'select' => $view_select,
|
636 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
637 |
+
'many_sp_calendar' => $many_sp_calendar,
|
638 |
+
'cat_id' => '',
|
639 |
+
'cat_ids' => $cat_ids,
|
640 |
+
'widget' => $widget,
|
641 |
+
'rand' => $many_sp_calendar,
|
642 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="top: -3px; position: relative;color:<?php echo $views_tabs_text_color; ?>;font-size:<?php echo $views_tabs_font_size; ?>px"><?php echo __('Month', 'sp_calendar'); ?></span>
|
643 |
+
</div>
|
644 |
+
</div>
|
645 |
+
<div id="views_tabs_select" style="display:none" >
|
646 |
+
<div id="views_select" style="background-color:<?php echo $bg_top?> !important;color:<?php echo $views_tabs_text_color ?> !important;font-size:<?php echo $views_tabs_font_size ?>px">
|
647 |
+
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
648 |
+
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
649 |
+
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
650 |
+
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
651 |
+
<div class="arrow-right show_arrow"></div>
|
652 |
+
<div class="arrow-down"></div>
|
653 |
+
</div>
|
654 |
+
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
655 |
+
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
656 |
+
<div class="views_select"
|
657 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
658 |
+
'action' => 'spiderbigcalendar_day',
|
659 |
+
'theme_id' => $theme_id,
|
660 |
+
'calendar' => $calendar_id,
|
661 |
+
'select' => $view_select,
|
662 |
+
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
663 |
+
'many_sp_calendar' => $many_sp_calendar,
|
664 |
+
'cat_id' => '',
|
665 |
+
'cat_ids' => $cat_ids,
|
666 |
+
'widget' => $widget,
|
667 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
668 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
669 |
+
</div>
|
670 |
+
</li>
|
671 |
+
|
672 |
+
<li <?php if($view=='bigcalendarweek'):?> class="active" <?php endif; ?> style="<?php if(!in_array('week',$views) AND $defaultview!='week' ) echo 'display:none;' ; ?>" ><div class="views_select"
|
673 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
674 |
+
'action' => 'spiderbigcalendar_week',
|
675 |
+
'theme_id' => $theme_id,
|
676 |
+
'calendar' => $calendar_id,
|
677 |
+
'select' => $view_select,
|
678 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
679 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
680 |
+
'many_sp_calendar' => $many_sp_calendar,
|
681 |
+
'cat_id' => '',
|
682 |
+
'cat_ids' => $cat_ids,
|
683 |
+
'widget' => $widget,
|
684 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
685 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
686 |
+
</div>
|
687 |
+
</li>
|
688 |
+
|
689 |
+
<li <?php if($view=='bigcalendarlist'):?> class="active" <?php endif; ?> style="<?php if(!in_array('list',$views) AND $defaultview!='list' ) echo 'display:none;' ;?>"><div class="views_select"
|
690 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
691 |
+
'action' => 'spiderbigcalendar_list',
|
692 |
+
'theme_id' => $theme_id,
|
693 |
+
'calendar' => $calendar_id,
|
694 |
+
'select' => $view_select,
|
695 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
696 |
+
'many_sp_calendar' => $many_sp_calendar,
|
697 |
+
'cat_id' => '',
|
698 |
+
'cat_ids' => $cat_ids,
|
699 |
+
'widget' => $widget,
|
700 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
701 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
702 |
+
</div>
|
703 |
+
</li>
|
704 |
+
|
705 |
+
<li <?php if($view=='bigcalendarmonth'):?> class="active" <?php endif; ?> style="<?php if(!in_array('month',$views) AND $defaultview!='month' ) echo 'display:none;'; ?>"><div class="views_select"
|
706 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
707 |
+
'action' => 'spiderbigcalendar_month',
|
708 |
+
'theme_id' => $theme_id,
|
709 |
+
'calendar' => $calendar_id,
|
710 |
+
'select' => $view_select,
|
711 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
712 |
+
'many_sp_calendar' => $many_sp_calendar,
|
713 |
+
'cat_id' => '',
|
714 |
+
'cat_ids' => $cat_ids,
|
715 |
+
'widget' => $widget,
|
716 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
717 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Month</span></div></li>
|
718 |
+
|
719 |
+
</ul>
|
720 |
+
</div>
|
721 |
+
</td>
|
722 |
+
</tr>
|
723 |
+
<tr>
|
724 |
+
<td>
|
725 |
+
<table cellpadding="0" cellspacing="0" class="general_table" style="border-spacing:0; width:100%;border:<?php echo $border_color; ?> solid <?php echo $border_width; ?>px; margin:0; padding:0;background-color:<?php echo $bg_bottom; ?> !important;">
|
726 |
+
<tr>
|
727 |
+
<td width="100%" style="padding:0; margin:0">
|
728 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;">
|
729 |
+
<tr style="height:40px; width:100%;">
|
730 |
+
<td class="top_table" align="center" colspan="7" style="position: relative;padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
731 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calyear_table" style="margin:0; padding:0; text-align:center; width:100%; height:<?php echo $top_height; ?>px;">
|
732 |
+
<tr>
|
733 |
+
<td style="width:100%;vertical-align:center">
|
734 |
+
<table style="width:100%;">
|
735 |
+
<tr>
|
736 |
+
<td width="15%">
|
737 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
738 |
+
echo add_query_arg(array(
|
739 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
740 |
+
'theme_id' => $theme_id,
|
741 |
+
'calendar' => $calendar_id,
|
742 |
+
'select' => $view_select,
|
743 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
744 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
745 |
+
'many_sp_calendar' => $many_sp_calendar,
|
746 |
+
'cat_id' => '',
|
747 |
+
'cat_ids' => $cat_ids,
|
748 |
+
'widget' => $widget,
|
749 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color: <?php echo hex_to_rgb($views_tabs_bg_color, 0.4) ?>;">
|
750 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year - 1; ?></span>
|
751 |
+
</div>
|
752 |
+
</td>
|
753 |
+
<td class="cala_arrow" width="11%" style="text-align:right;margin:0px;padding: 0px 30px 0px 0px !important;">
|
754 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>;" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
755 |
+
echo add_query_arg(array(
|
756 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
757 |
+
'theme_id' => $theme_id,
|
758 |
+
'calendar' => $calendar_id,
|
759 |
+
'select' => $view_select,
|
760 |
+
'date' => $prev_date,
|
761 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
762 |
+
'many_sp_calendar' => $many_sp_calendar,
|
763 |
+
'cat_id' => '',
|
764 |
+
'cat_ids' => $cat_ids,
|
765 |
+
'widget' => $widget,
|
766 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❰
|
767 |
+
</a>
|
768 |
+
</td>
|
769 |
+
<td style="text-align:center; margin:0;" width="40%">
|
770 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
771 |
+
<span style="line-height: 30px;font-family:arial; color:<?php echo $text_color_month; ?>; font-size:<?php echo $month_font_size; ?>px;text-shadow: 1px 1px black;"><?php echo $activedatestr; ?></span>
|
772 |
+
</td>
|
773 |
+
<td style="margin:0; padding: 0px 0px 0px 30px !important; text-align:left" width="11%" class="cala_arrow">
|
774 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
775 |
+
echo add_query_arg(array(
|
776 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
777 |
+
'theme_id' => $theme_id,
|
778 |
+
'calendar' => $calendar_id,
|
779 |
+
'select' => $view_select,
|
780 |
+
'date' => $next_date,
|
781 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
782 |
+
'many_sp_calendar' => $many_sp_calendar,
|
783 |
+
'cat_id' => '',
|
784 |
+
'cat_ids' => $cat_ids,
|
785 |
+
'widget' => $widget,
|
786 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">❱
|
787 |
+
</a>
|
788 |
+
</td>
|
789 |
+
<td width="15%">
|
790 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
791 |
+
echo add_query_arg(array(
|
792 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
793 |
+
'theme_id' => $theme_id,
|
794 |
+
'calendar' => $calendar_id,
|
795 |
+
'select' => $view_select,
|
796 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
797 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
798 |
+
'many_sp_calendar' => $many_sp_calendar,
|
799 |
+
'cat_id' => '',
|
800 |
+
'cat_ids' => $cat_ids,
|
801 |
+
'widget' => $widget,
|
802 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color: <?php echo hex_to_rgb($views_tabs_bg_color, 0.4) ?>;">
|
803 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
|
804 |
+
</div>
|
805 |
+
</td>
|
806 |
+
</tr>
|
807 |
+
</table>
|
808 |
+
</td>
|
809 |
+
</tr>
|
810 |
+
</table>
|
811 |
+
</td>
|
812 |
+
|
813 |
+
</tr>
|
814 |
+
</tr>
|
815 |
+
<tr>
|
816 |
+
<td>
|
817 |
+
<?php
|
818 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
819 |
+
if ($weekstart == "su") {
|
820 |
+
$month_first_weekday++;
|
821 |
+
if ($month_first_weekday == 8) {
|
822 |
+
$month_first_weekday = 1;
|
823 |
+
}
|
824 |
+
}
|
825 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
826 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
827 |
+
$last_month_days_count = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
828 |
+
$weekday_i = $month_first_weekday;
|
829 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
830 |
+
$percent = 1;
|
831 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
832 |
+
if ($sum % 7 <> 0) {
|
833 |
+
$percent = $percent + 1;
|
834 |
+
}
|
835 |
+
$sum = $sum - ($sum % 7);
|
836 |
+
$percent = $percent + ($sum / 7);
|
837 |
+
$percent = 107 / $percent;
|
838 |
+
|
839 |
+
$all_calendar_files = php_getdays_for_three_months($calendar_id, $date, $months, $theme_id, $widget);
|
840 |
+
|
841 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
842 |
+
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
843 |
+
|
844 |
+
$all_array_days = $all_calendar_files[0]['all_array_days'];
|
845 |
+
$all_array_days1 = $all_calendar_files[0]['all_array_days1'];
|
846 |
+
$all_title = $all_calendar_files[0]['all_title'];
|
847 |
+
$all_ev_ids = $all_calendar_files[0]['all_ev_ids'];
|
848 |
+
|
849 |
+
$prev_month = substr($months, 0, 2);
|
850 |
+
$this_month = substr($months, 3, 2);
|
851 |
+
$next_month = substr($months, 6, 2);
|
852 |
+
$array_days = array();
|
853 |
+
for ($i = 0; $i <= 6; $i++) {
|
854 |
+
$day=substr($week_days[$i],8,2);
|
855 |
+
$month=substr($week_days[$i],5,2);
|
856 |
+
$year=substr($week_days[$i],0,4);
|
857 |
+
|
858 |
+
switch($month)
|
859 |
+
{
|
860 |
+
case $prev_month:
|
861 |
+
$array_days=$all_array_days[0];
|
862 |
+
$array_days1=$all_array_days1[0];
|
863 |
+
$title=$all_title[0];
|
864 |
+
$ev_ids=$all_ev_ids[0];
|
865 |
+
break;
|
866 |
+
|
867 |
+
case $this_month:
|
868 |
+
$array_days=$all_array_days[1];
|
869 |
+
$array_days1=$all_array_days1[1];
|
870 |
+
$title=$all_title[1];
|
871 |
+
$ev_ids=$all_ev_ids[1];
|
872 |
+
break;
|
873 |
+
|
874 |
+
case $next_month:
|
875 |
+
$array_days=$all_array_days[2];
|
876 |
+
$array_days1=$all_array_days1[2];
|
877 |
+
$title=$all_title[2];
|
878 |
+
$ev_ids=$all_ev_ids[2];
|
879 |
+
break;
|
880 |
+
|
881 |
+
}
|
882 |
+
|
883 |
+
|
884 |
+
|
885 |
+
sort($array_days, SORT_NUMERIC);
|
886 |
+
$week_day = date('D', mktime(0, 0, 0, $month, (int) $day, $year));
|
887 |
+
$month_name = month_name($month);
|
888 |
+
echo '<table style="width:100%;border-spacing:0;">
|
889 |
+
<tr>
|
890 |
+
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . ' !important; color:#6E7276">
|
891 |
+
<span style="padding-left:10px; font-size:' . $date_font_size . 'px; color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
892 |
+
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . __($month_name,'sp_calendar') . ' ' . (int) $day . ')</span>
|
893 |
+
</td>
|
894 |
+
<tr>
|
895 |
+
<td>';
|
896 |
+
if (in_array((int) $day, $array_days)) {
|
897 |
+
foreach($title as $key => $value) {
|
898 |
+
if ($key == (int) $day) {
|
899 |
+
$ev_id = explode('<br>', $ev_ids[$key]);
|
900 |
+
array_pop($ev_id);
|
901 |
+
$ev_ids_inline = implode(',', $ev_id);
|
902 |
+
$ev_title = explode('</p>', $value);
|
903 |
+
array_pop($ev_title);
|
904 |
+
for ($j = 0; $j < count($ev_title); $j++) {
|
905 |
+
$queryy =$wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
906 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
907 |
+
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d",$calendar,$ev_id[$j]);
|
908 |
+
|
909 |
+
$cat_color = $wpdb->get_row($queryy);
|
910 |
+
|
911 |
+
if (($j + 1) % 2 == 0) {
|
912 |
+
$color = $event_num_bg_color2;
|
913 |
+
$table_color = $event_bg_color2;
|
914 |
+
}
|
915 |
+
else {
|
916 |
+
$color = $event_num_bg_color1;
|
917 |
+
$table_color = $event_bg_color1;
|
918 |
+
}
|
919 |
+
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color=$bg_top;};
|
920 |
+
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . ' !important" class="week_list">
|
921 |
+
<tr>
|
922 |
+
<td class="week_ev" style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color: #' . str_replace('#','',$cat_color->color) . ' !important;color:' . $event_num_color . ' !important">' . (($show_numbers_for_events) ? ($j + 1) : '') . '</td>
|
923 |
+
<td>
|
924 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:15px;background:none;color:' . $event_title_color . ';"
|
925 |
+
href="' . add_query_arg(array(
|
926 |
+
'action' => 'spidercalendarbig',
|
927 |
+
'theme_id' => $theme_id,
|
928 |
+
'calendar_id' => $calendar_id,
|
929 |
+
'ev_ids' => $ev_ids_inline,
|
930 |
+
'eventID' => $ev_id[$j],
|
931 |
+
'date' => $year . '-' . $month . '-' . (int) $day,
|
932 |
+
'many_sp_calendar' => $many_sp_calendar,
|
933 |
+
'widget' => $widget,
|
934 |
+
'TB_iframe' => 1,
|
935 |
+
'tbWidth' => $popup_width,
|
936 |
+
'tbHeight' => $popup_height,
|
937 |
+
), $site_url) . '"><b>' . $ev_title[$j] . '</b>
|
938 |
+
</a>
|
939 |
+
</td>
|
940 |
+
</tr>
|
941 |
+
</table>';
|
942 |
+
}
|
943 |
+
}
|
944 |
+
}
|
945 |
+
}
|
946 |
+
else {
|
947 |
+
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '" class="week_list">
|
948 |
+
<tr>
|
949 |
+
<td class="week_ev" style="font-size:22px; font-weight:bold; width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ' !important;color:' . $event_num_color . ' !important"></td>
|
950 |
+
<td><p style="color:' . $event_title_color . '; border:none"> ' . __('There are no events on this date', 'sp_calendar') . '</p></td>
|
951 |
+
</tr>
|
952 |
+
</table>';
|
953 |
+
}
|
954 |
+
echo '</td></tr></table>';
|
955 |
+
}
|
956 |
+
?>
|
957 |
+
</td>
|
958 |
+
</tr>
|
959 |
+
</table>
|
960 |
+
</tr>
|
961 |
+
</table>
|
962 |
+
</td>
|
963 |
+
</tr>
|
964 |
+
</table>
|
965 |
+
</div>
|
966 |
+
<style>
|
967 |
+
@media only screen and (max-width : 640px) {
|
968 |
+
#views_tabs ,#drop_down_views
|
969 |
+
{
|
970 |
+
display:none;
|
971 |
+
}
|
972 |
+
|
973 |
+
#views_tabs_select
|
974 |
+
{
|
975 |
+
display:block !important;
|
976 |
+
}
|
977 |
+
}
|
978 |
+
|
979 |
+
@media only screen and (max-width : 968px) {
|
980 |
+
#cats >li
|
981 |
+
{
|
982 |
+
float:none;
|
983 |
+
}
|
984 |
+
}
|
985 |
+
|
986 |
+
.spider_categories{
|
987 |
+
display:inline-block;
|
988 |
+
cursor:pointer;
|
989 |
+
}
|
990 |
+
|
991 |
+
.spider_categories p{
|
992 |
+
color: #fff;
|
993 |
+
padding: 2px 10px !important;
|
994 |
+
margin: 2px 0 !important;
|
995 |
+
font-size: 14px;
|
996 |
+
font-weight: 600;
|
997 |
+
}
|
998 |
+
</style>
|
999 |
+
<?php
|
1000 |
+
|
1001 |
+
//reindex cat_ids_array
|
1002 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
1003 |
+
|
1004 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
1005 |
+
{
|
1006 |
+
echo'
|
1007 |
+
<style>
|
1008 |
+
#cats #category'.$re_cat_ids_array[$i].'
|
1009 |
+
{
|
1010 |
+
text-decoration:underline;
|
1011 |
+
cursor:pointer;
|
1012 |
+
|
1013 |
+
}
|
1014 |
+
|
1015 |
+
</style>';
|
1016 |
+
|
1017 |
+
}
|
1018 |
+
|
1019 |
+
|
1020 |
+
|
1021 |
+
if($cat_ids=='')
|
1022 |
+
$cat_ids='';
|
1023 |
+
if($show_cat){
|
1024 |
+
echo '<ul id="cats" style="list-style-type:none; padding: 0;">';
|
1025 |
+
|
1026 |
+
foreach($categories as $category)
|
1027 |
+
{
|
1028 |
+
|
1029 |
+
?>
|
1030 |
+
|
1031 |
+
<li class="spider_categories"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1032 |
+
'action' => 'spiderbigcalendar_week',
|
1033 |
+
'theme_id' => $theme_id,
|
1034 |
+
'calendar' => $calendar_id,
|
1035 |
+
'select' => $view_select,
|
1036 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
1037 |
+
'date' => $year . '-' . $month . '-' . add_0($day),
|
1038 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1039 |
+
'cat_id' => $category->id,
|
1040 |
+
'cat_ids' => $cat_ids,
|
1041 |
+
'widget' => $widget,
|
1042 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1043 |
+
|
1044 |
+
|
1045 |
+
<?php
|
1046 |
+
}
|
1047 |
+
if (!empty($categories)) {
|
1048 |
+
?>
|
1049 |
+
<li class="spider_categories"><p id="category0" style="background-color:#<?php echo str_replace('#','',$bg_top); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1050 |
+
'action' => 'spiderbigcalendar_week',
|
1051 |
+
'theme_id' => $theme_id,
|
1052 |
+
'calendar' => $calendar_id,
|
1053 |
+
'select' => $view_select,
|
1054 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
1055 |
+
'date' => $year . '-' . $month . '-' . add_0($day),
|
1056 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1057 |
+
'cat_id' => '',
|
1058 |
+
'cat_ids' => '',
|
1059 |
+
'widget' => $widget,
|
1060 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
1061 |
+
<?php echo '</ul>';
|
1062 |
+
}
|
1063 |
+
} ?>
|
1064 |
+
</body>
|
1065 |
+
</html>
|
1066 |
+
<?php
|
1067 |
+
die();
|
1068 |
+
}
|
1069 |
+
|
1070 |
?>
|
front_end/bigcalendarweek_widget.php
CHANGED
@@ -1,747 +1,747 @@
|
|
1 |
-
<?php
|
2 |
-
function big_calendar_week_widget() {
|
3 |
-
require_once("frontend_functions.php");
|
4 |
-
global $wpdb;
|
5 |
-
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
-
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
-
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
-
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 1);
|
9 |
-
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
10 |
-
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
-
$months = (isset($_GET['months']) ? esc_html($_GET['months']) : '');
|
12 |
-
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
13 |
-
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
14 |
-
$site_url = get_admin_url().'admin-ajax.php';
|
15 |
-
///////////////////////////////////////////////////////////////////////////////////
|
16 |
-
|
17 |
-
if($cat_ids=='')
|
18 |
-
$cat_ids .= $cat_id.',';
|
19 |
-
else
|
20 |
-
$cat_ids .= ','.$cat_id.',';
|
21 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
22 |
-
|
23 |
-
|
24 |
-
function getelementcountinarray($array , $element)
|
25 |
-
{
|
26 |
-
$t=0;
|
27 |
-
|
28 |
-
for($i=0; $i<count($array); $i++)
|
29 |
-
{
|
30 |
-
if($element==$array[$i])
|
31 |
-
$t++;
|
32 |
-
|
33 |
-
}
|
34 |
-
|
35 |
-
|
36 |
-
return $t;
|
37 |
-
|
38 |
-
}
|
39 |
-
|
40 |
-
function getelementindexinarray($array , $element)
|
41 |
-
{
|
42 |
-
|
43 |
-
$t='';
|
44 |
-
|
45 |
-
for($i=0; $i<count($array); $i++)
|
46 |
-
{
|
47 |
-
if($element==$array[$i])
|
48 |
-
$t.=$i.',';
|
49 |
-
|
50 |
-
}
|
51 |
-
|
52 |
-
return $t;
|
53 |
-
|
54 |
-
|
55 |
-
}
|
56 |
-
$cat_ids_array = explode(',',$cat_ids);
|
57 |
-
|
58 |
-
|
59 |
-
if($cat_id!='')
|
60 |
-
{
|
61 |
-
|
62 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
63 |
-
{
|
64 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
65 |
-
$index_array = explode(',' , $index_in_line);
|
66 |
-
array_pop ($index_array);
|
67 |
-
for($j=0; $j<count($index_array); $j++)
|
68 |
-
unset($cat_ids_array[$index_array[$j]]);
|
69 |
-
$cat_ids = implode(',',$cat_ids_array);
|
70 |
-
}
|
71 |
-
}
|
72 |
-
else
|
73 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
74 |
-
|
75 |
-
|
76 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
77 |
-
|
78 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
79 |
-
$weekstart = $theme->week_start_day;
|
80 |
-
$bg = '#' . str_replace('#','',$theme->header_bgcolor);
|
81 |
-
$bg_color_selected = '#' . str_replace('#','',$theme->bg_color_selected);
|
82 |
-
$color_arrow = '#' . str_replace('#','',$theme->arrow_color);
|
83 |
-
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
84 |
-
$evented_color_bg = '#' . str_replace('#','',$theme->bg_color_this_month_evented);
|
85 |
-
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
86 |
-
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
87 |
-
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
88 |
-
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
89 |
-
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
90 |
-
$text_color_selected = '#' . str_replace('#','',$theme->text_color_selected);
|
91 |
-
$border_day = '#' . str_replace('#','',$theme->border_day);
|
92 |
-
$calendar_width = $theme->width;
|
93 |
-
$calendar_bg = '#' . str_replace('#','',$theme->footer_bgcolor);
|
94 |
-
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
95 |
-
$weekday_su_bg_color = '#' . str_replace('#','',$theme->su_bg_color);
|
96 |
-
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
97 |
-
$year_font_size = $theme->year_font_size;
|
98 |
-
$year_font_color = '#' . str_replace('#','',$theme->year_font_color);
|
99 |
-
$year_tabs_bg_color = '#' . str_replace('#','',$theme->year_tabs_bg_color);
|
100 |
-
$font_year = $theme->font_year;
|
101 |
-
$font_month = $theme->font_month;
|
102 |
-
$font_day = $theme->font_day;
|
103 |
-
$font_weekday = $theme->font_weekday;
|
104 |
-
$ev_title_color = '#' . str_replace('#','',$theme->ev_title_color);
|
105 |
-
$show_cat = $theme->show_cat;
|
106 |
-
$popup_width = $theme->popup_width;
|
107 |
-
$popup_height = $theme->popup_height;
|
108 |
-
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
109 |
-
__('January', 'sp_calendar');
|
110 |
-
__('February', 'sp_calendar');
|
111 |
-
__('March', 'sp_calendar');
|
112 |
-
__('April', 'sp_calendar');
|
113 |
-
__('May', 'sp_calendar');
|
114 |
-
__('June', 'sp_calendar');
|
115 |
-
__('July', 'sp_calendar');
|
116 |
-
__('August', 'sp_calendar');
|
117 |
-
__('September', 'sp_calendar');
|
118 |
-
__('October', 'sp_calendar');
|
119 |
-
__('November', 'sp_calendar');
|
120 |
-
__('December', 'sp_calendar');
|
121 |
-
if ($date != '') {
|
122 |
-
$date_REFERER = $date;
|
123 |
-
}
|
124 |
-
else {
|
125 |
-
$date_REFERER = date("Y-m");
|
126 |
-
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
127 |
-
}
|
128 |
-
$year_REFERER = substr($date_REFERER, 0, 4);
|
129 |
-
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
130 |
-
$day_REFERER = substr($date_REFERER, 8, 2);
|
131 |
-
|
132 |
-
$year = substr($date, 0, 4);
|
133 |
-
$month = Month_name(substr($date, 5, 2));
|
134 |
-
$month_year = Month_name(substr($date, 5, 2));
|
135 |
-
$day = substr($date, 8, 2);
|
136 |
-
$cell_width = $calendar_width / 7;
|
137 |
-
$cell_width = (int) $cell_width - 2;
|
138 |
-
|
139 |
-
$week_days = array();
|
140 |
-
$d = new DateTime($date);
|
141 |
-
$weekday = $d->format('w');
|
142 |
-
// Monday=0, Sunday=6.
|
143 |
-
$diff = ($weekday == 0 ? 6 : $weekday - 1);
|
144 |
-
if ($weekstart == "su") {
|
145 |
-
$diff = $diff + 1;
|
146 |
-
}
|
147 |
-
$d->modify("-$diff day");
|
148 |
-
$d->modify("-1 day");
|
149 |
-
$prev_date = $d->format('Y-m-d');
|
150 |
-
$d->modify("+1 day");
|
151 |
-
$week_days[] = $d->format('Y-m-d');
|
152 |
-
for ($i = 1; $i < 7; $i++) {
|
153 |
-
$d->modify('+1 day');
|
154 |
-
$week_days[] = $d->format('Y-m-d');
|
155 |
-
}
|
156 |
-
if ($weekstart == "su") {
|
157 |
-
$d->modify('+2 day');
|
158 |
-
}
|
159 |
-
else {
|
160 |
-
$d->modify('+1 day');
|
161 |
-
}
|
162 |
-
$next_date = $d->format('Y-m-d');
|
163 |
-
$prev_month = add_0((int) substr($prev_date, 5, 2) - 1);
|
164 |
-
$this_month = add_0((int) substr($prev_date, 5, 2));
|
165 |
-
$next_month = add_0((int) substr($prev_date, 5, 2) + 1);
|
166 |
-
if ($next_month == '13') {
|
167 |
-
$next_month = '01';
|
168 |
-
}
|
169 |
-
if ($prev_month == '00') {
|
170 |
-
$prev_month = '12';
|
171 |
-
}
|
172 |
-
$view = 'bigcalendarweek_widget';
|
173 |
-
$views = explode(',', $view_select);
|
174 |
-
$defaultview = 'week';
|
175 |
-
array_pop($views);
|
176 |
-
$display = '';
|
177 |
-
if (count($views) == 0) {
|
178 |
-
$display = "display:none";
|
179 |
-
}
|
180 |
-
if(count($views) == 1 && $views[0] == $defaultview) {
|
181 |
-
$display = "display:none";
|
182 |
-
}
|
183 |
-
?>
|
184 |
-
<html>
|
185 |
-
<head>
|
186 |
-
<style type='text/css'>
|
187 |
-
#calendar_<?php echo $many_sp_calendar; ?> table {
|
188 |
-
border-collapse: initial;
|
189 |
-
border:0px;
|
190 |
-
margin: 0;
|
191 |
-
}
|
192 |
-
#TB_iframeContent{
|
193 |
-
background-color: <?php echo $show_event_bgcolor; ?>;
|
194 |
-
}
|
195 |
-
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
196 |
-
padding: 0px;
|
197 |
-
vertical-align: none;
|
198 |
-
border-top:none;
|
199 |
-
line-height: none;
|
200 |
-
text-align: none;
|
201 |
-
}
|
202 |
-
#calendar_<?php echo $many_sp_calendar; ?> .arrow-left {
|
203 |
-
width: 0px;
|
204 |
-
height: 0px;
|
205 |
-
border-top: 7px solid transparent;
|
206 |
-
border-bottom: 7px solid transparent;
|
207 |
-
border-right: 13px solid;
|
208 |
-
margin: 0 auto;
|
209 |
-
}
|
210 |
-
|
211 |
-
#calendar_<?php echo $many_sp_calendar; ?> .arrow-right {
|
212 |
-
width: 0px;
|
213 |
-
height: 0px;
|
214 |
-
border-top: 7px solid transparent;
|
215 |
-
border-bottom: 7px solid transparent;
|
216 |
-
border-left: 13px solid;
|
217 |
-
margin: 0 auto;
|
218 |
-
}
|
219 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
220 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
221 |
-
font-family: <?php echo $font_day; ?>;
|
222 |
-
}
|
223 |
-
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
224 |
-
margin-bottom: 0;
|
225 |
-
}
|
226 |
-
#calendar_<?php echo $many_sp_calendar; ?> td,
|
227 |
-
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
228 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> td,
|
229 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> tr {
|
230 |
-
border:none;
|
231 |
-
}
|
232 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
233 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
234 |
-
color: <?php echo $color_arrow; ?>;
|
235 |
-
text-decoration: none !important;
|
236 |
-
background: none;
|
237 |
-
font-size: 16px;
|
238 |
-
}
|
239 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
240 |
-
color: <?php echo $color_arrow; ?>;
|
241 |
-
text-decoration:none;
|
242 |
-
background:none;
|
243 |
-
}
|
244 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
245 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
246 |
-
text-decoration:underline;
|
247 |
-
background:none;
|
248 |
-
font-size:11px;
|
249 |
-
}
|
250 |
-
#calendar_<?php echo $many_sp_calendar; ?> a {
|
251 |
-
font-weight: normal;
|
252 |
-
}
|
253 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
254 |
-
font-size:12px;
|
255 |
-
text-decoration:none;
|
256 |
-
background:none;
|
257 |
-
}
|
258 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
259 |
-
border-spacing:0;
|
260 |
-
width:100%;
|
261 |
-
}
|
262 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
263 |
-
border-spacing: 0;
|
264 |
-
vertical-align: middle;
|
265 |
-
width: 100%;
|
266 |
-
}
|
267 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
268 |
-
background-color:<?php echo $bg; ?> !important;
|
269 |
-
text-align:center;
|
270 |
-
vertical-align: middle;
|
271 |
-
}
|
272 |
-
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
273 |
-
color:<?php echo $text_color_other_months; ?>;
|
274 |
-
}
|
275 |
-
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
276 |
-
color:<?php echo $text_color_this_month_unevented; ?>;
|
277 |
-
}
|
278 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calfont_year {
|
279 |
-
font-size:24px;
|
280 |
-
font-weight:bold;
|
281 |
-
}
|
282 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
283 |
-
color:<?php echo $sun_days; ?>;
|
284 |
-
}
|
285 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
286 |
-
border: solid <?php echo $border_day; ?> 1px;
|
287 |
-
}
|
288 |
-
#TB_window {
|
289 |
-
z-index: 10000;
|
290 |
-
}
|
291 |
-
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
292 |
-
float: right;
|
293 |
-
background-color: <?php echo $calendar_bg; ?> !important;
|
294 |
-
height: 25px;
|
295 |
-
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
296 |
-
margin-left: 2px;
|
297 |
-
text-align: center;
|
298 |
-
cursor:pointer;
|
299 |
-
position: relative;
|
300 |
-
top: 3px;
|
301 |
-
font-family: <?php echo $font_month; ?>;
|
302 |
-
font-size: 14px;
|
303 |
-
}
|
304 |
-
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
305 |
-
background: transparent !important;
|
306 |
-
}
|
307 |
-
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
308 |
-
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
309 |
-
{
|
310 |
-
width: 120px;
|
311 |
-
text-align: center;
|
312 |
-
cursor: pointer;
|
313 |
-
padding: 6px;
|
314 |
-
position: relative;
|
315 |
-
}
|
316 |
-
|
317 |
-
|
318 |
-
#drop_down_views
|
319 |
-
{
|
320 |
-
list-style-type:none !important;
|
321 |
-
position: absolute;
|
322 |
-
top: 46px;
|
323 |
-
left: -15px;
|
324 |
-
display:none;
|
325 |
-
z-index: 4545;
|
326 |
-
|
327 |
-
}
|
328 |
-
|
329 |
-
#drop_down_views >li
|
330 |
-
{
|
331 |
-
border-bottom:1px solid #fff !important;
|
332 |
-
}
|
333 |
-
|
334 |
-
|
335 |
-
#views_tabs_select
|
336 |
-
{
|
337 |
-
display:none;
|
338 |
-
}
|
339 |
-
</style>
|
340 |
-
</head>
|
341 |
-
<body>
|
342 |
-
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
343 |
-
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?> !important">
|
344 |
-
<tr style="background-color:#FFFFFF;">
|
345 |
-
<td style="background-color:#FFFFFF;">
|
346 |
-
<div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
|
347 |
-
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
348 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
349 |
-
'action' => 'spiderbigcalendar_day_widget',
|
350 |
-
'theme_id' => $theme_id,
|
351 |
-
'calendar' => $calendar_id,
|
352 |
-
'select' => $view_select,
|
353 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
354 |
-
'many_sp_calendar' => $many_sp_calendar,
|
355 |
-
'cat_id' => '',
|
356 |
-
'cat_ids' => $cat_ids,
|
357 |
-
'widget' => $widget,
|
358 |
-
'TB_iframe' => 1,
|
359 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Day', 'sp_calendar'); ?></span>
|
360 |
-
</div>
|
361 |
-
<div class="views" style="margin-left: 3px;margin-right: 1px;<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;' ?>"
|
362 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
363 |
-
'action' => 'spiderbigcalendar_week_widget',
|
364 |
-
'theme_id' => $theme_id,
|
365 |
-
'calendar' => $calendar_id,
|
366 |
-
'select' => $view_select,
|
367 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
368 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
369 |
-
'many_sp_calendar' => $many_sp_calendar,
|
370 |
-
'cat_id' => '',
|
371 |
-
'cat_ids' => $cat_ids,
|
372 |
-
'widget' => $widget,
|
373 |
-
'TB_iframe' => 1,
|
374 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Week', 'sp_calendar'); ?></span>
|
375 |
-
</div>
|
376 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;' ?>"
|
377 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
378 |
-
'action' => 'spiderbigcalendar_list_widget',
|
379 |
-
'theme_id' => $theme_id,
|
380 |
-
'calendar' => $calendar_id,
|
381 |
-
'select' => $view_select,
|
382 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
383 |
-
'many_sp_calendar' => $many_sp_calendar,
|
384 |
-
'cat_id' => '',
|
385 |
-
'cat_ids' => $cat_ids,
|
386 |
-
'widget' => $widget,
|
387 |
-
'TB_iframe' => 1,
|
388 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('List', 'sp_calendar'); ?></span>
|
389 |
-
</div>
|
390 |
-
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
391 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
392 |
-
'action' => 'spiderbigcalendar_month_widget',
|
393 |
-
'theme_id' => $theme_id,
|
394 |
-
'calendar' => $calendar_id,
|
395 |
-
'select' => $view_select,
|
396 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
397 |
-
'many_sp_calendar' => $many_sp_calendar,
|
398 |
-
'cat_id' => '',
|
399 |
-
'cat_ids' => $cat_ids,
|
400 |
-
'widget' => $widget,
|
401 |
-
'TB_iframe' => 1,
|
402 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
403 |
-
</div>
|
404 |
-
</div>
|
405 |
-
</td>
|
406 |
-
</tr>
|
407 |
-
<tr>
|
408 |
-
<td width="100%" style="padding:0; margin:0;">
|
409 |
-
<form action="" method="get" style="background:none; margin:0; padding:0;">
|
410 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>">
|
411 |
-
<tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
|
412 |
-
<td class="calbg" colspan="7" style="background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');margin:0; padding:0;background-repeat: no-repeat;background-size: 100% 100%;" >
|
413 |
-
<?php //MONTH TABLE ?>
|
414 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
|
415 |
-
<tr>
|
416 |
-
<td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
417 |
-
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
418 |
-
if (Month_num($month) == 1) {
|
419 |
-
$needed_date = ($year - 1) . '-12';
|
420 |
-
}
|
421 |
-
else {
|
422 |
-
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
423 |
-
}
|
424 |
-
echo add_query_arg(array(
|
425 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
426 |
-
'theme_id' => $theme_id,
|
427 |
-
'calendar' => $calendar_id,
|
428 |
-
'select' => $view_select,
|
429 |
-
'date' => $prev_date,
|
430 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
431 |
-
'many_sp_calendar' => $many_sp_calendar,
|
432 |
-
'cat_id' => '',
|
433 |
-
'cat_ids' => $cat_ids,
|
434 |
-
'widget' => $widget,
|
435 |
-
'TB_iframe' => 1,
|
436 |
-
), $site_url);
|
437 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-left"></div>
|
438 |
-
</a>
|
439 |
-
</td>
|
440 |
-
<?php
|
441 |
-
$weekstartday = substr($week_days[0],8,2);
|
442 |
-
$weekendday = substr($week_days[6],8,2);
|
443 |
-
$startmonth = substr($week_days[0],5,2);
|
444 |
-
$endmonth = substr($week_days[6],5,2);
|
445 |
-
|
446 |
-
$startmonth_name = month_name($startmonth);
|
447 |
-
$endmonth_name = month_name($endmonth); ?>
|
448 |
-
<td style="text-align:center; margin:0;" width="40%">
|
449 |
-
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
450 |
-
<span style="line-height: 30px;font-family:arial; color:<?php echo $text_color_month; ?>; font-size:<?php echo $year_font_size; ?>px;"><?php echo __($startmonth_name,'sp_calendar').' '. $weekstartday . ' - ' . __($endmonth_name,'sp_calendar') .' '. $weekendday; ?></span>
|
451 |
-
</td>
|
452 |
-
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
453 |
-
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
454 |
-
if (Month_num($month) == 12) {
|
455 |
-
$needed_date = ($year + 1) . '-01';
|
456 |
-
}
|
457 |
-
else {
|
458 |
-
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
459 |
-
}
|
460 |
-
echo add_query_arg(array(
|
461 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
462 |
-
'theme_id' => $theme_id,
|
463 |
-
'calendar' => $calendar_id,
|
464 |
-
'select' => $view_select,
|
465 |
-
'date' => $next_date,
|
466 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
467 |
-
'many_sp_calendar' => $many_sp_calendar,
|
468 |
-
'cat_id' => '',
|
469 |
-
'cat_ids' => $cat_ids,
|
470 |
-
'widget' => $widget,
|
471 |
-
'TB_iframe' => 1,
|
472 |
-
), $site_url);
|
473 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-right"></div>
|
474 |
-
</a>
|
475 |
-
</td>
|
476 |
-
</tr>
|
477 |
-
</table>
|
478 |
-
</td>
|
479 |
-
</tr>
|
480 |
-
|
481 |
-
<tr>
|
482 |
-
<td colspan="7">
|
483 |
-
<?php
|
484 |
-
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
485 |
-
if ($weekstart == "su") {
|
486 |
-
$month_first_weekday++;
|
487 |
-
if ($month_first_weekday == 8) {
|
488 |
-
$month_first_weekday = 1;
|
489 |
-
}
|
490 |
-
}
|
491 |
-
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
492 |
-
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
493 |
-
$last_month_days_count = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
494 |
-
$weekday_i = $month_first_weekday;
|
495 |
-
$last_month_days = $last_month_days - $weekday_i + 2;
|
496 |
-
$percent = 1;
|
497 |
-
$sum = $month_days - 8 + $month_first_weekday;
|
498 |
-
if ($sum % 7 <> 0) {
|
499 |
-
$percent = $percent + 1;
|
500 |
-
}
|
501 |
-
$sum = $sum - ($sum % 7);
|
502 |
-
$percent = $percent + ($sum / 7);
|
503 |
-
$percent = 107 / $percent;
|
504 |
-
|
505 |
-
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
506 |
-
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
507 |
-
$all_calendar_files = php_getdays_for_three_months($calendar_id, $date, $months, $theme_id, $widget);
|
508 |
-
|
509 |
-
$all_array_days = $all_calendar_files[0]['all_array_days'];
|
510 |
-
$all_array_days1 = $all_calendar_files[0]['all_array_days1'];
|
511 |
-
$all_title = $all_calendar_files[0]['all_title'];
|
512 |
-
$all_ev_ids = $all_calendar_files[0]['all_ev_ids'];
|
513 |
-
|
514 |
-
$prev_month = substr($months, 0, 2);
|
515 |
-
$this_month = substr($months, 3, 2);
|
516 |
-
$next_month = substr($months, 6, 2);
|
517 |
-
$array_days = array();
|
518 |
-
for ($i = 0; $i <= 6; $i++) {
|
519 |
-
$day = substr($week_days[$i], 8, 2);
|
520 |
-
$month = substr($week_days[$i], 5, 2);
|
521 |
-
$year = substr($week_days[$i], 0, 4);
|
522 |
-
switch($month) {
|
523 |
-
case $prev_month:
|
524 |
-
$array_days = $all_array_days[0];
|
525 |
-
$array_days1 = $all_array_days1[0];
|
526 |
-
$title = $all_title[0];
|
527 |
-
$ev_ids = $all_ev_ids[0];
|
528 |
-
break;
|
529 |
-
|
530 |
-
case $this_month:
|
531 |
-
$array_days = $all_array_days[1];
|
532 |
-
$array_days1 = $all_array_days1[1];
|
533 |
-
$title = $all_title[1];
|
534 |
-
$ev_ids = $all_ev_ids[1];
|
535 |
-
break;
|
536 |
-
|
537 |
-
case $next_month:
|
538 |
-
$array_days = $all_array_days[2];
|
539 |
-
$array_days1 = $all_array_days1[2];
|
540 |
-
$title = $all_title[2];
|
541 |
-
$ev_ids = $all_ev_ids[2];
|
542 |
-
break;
|
543 |
-
}
|
544 |
-
sort($array_days, SORT_NUMERIC);
|
545 |
-
$week_day = date('D', mktime(0, 0, 0, $month, (int) $day, $year));
|
546 |
-
$month_name = month_name($month);
|
547 |
-
echo '<table style="width:100%;border-spacing:0;">
|
548 |
-
<tr>
|
549 |
-
<td style="height:14px;font-size:12px; padding-left:10px; background-color:#D6D4D5 !important; color:#6E7276">
|
550 |
-
<span style="padding-left:10px; font-size:12px; color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
|
551 |
-
<span style="font-size:12px;color:#949394;">(' . __($month_name,'sp_calendar') . ' ' . (int) $day . ')</span>
|
552 |
-
</td>
|
553 |
-
<tr>
|
554 |
-
<td>';
|
555 |
-
if (in_array((int) $day, $array_days)) {
|
556 |
-
foreach($title as $key => $value) {
|
557 |
-
if ($key == (int) $day) {
|
558 |
-
$ev_id = explode('<br>', $ev_ids[$key]);
|
559 |
-
array_pop($ev_id);
|
560 |
-
$ev_ids_inline = implode(',', $ev_id);
|
561 |
-
$ev_title = explode('</p>', $value);
|
562 |
-
array_pop($ev_title);
|
563 |
-
for ($j = 0; $j < count($ev_title); $j++) {
|
564 |
-
$queryy = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
565 |
-
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
566 |
-
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d",$calendar,$ev_id[$j]);
|
567 |
-
|
568 |
-
$cat_color = $wpdb->get_row($queryy);
|
569 |
-
|
570 |
-
if (($j + 1) % 2 == 0) {
|
571 |
-
$color = $bg;
|
572 |
-
$table_color = $calendar_bg;
|
573 |
-
}
|
574 |
-
else {
|
575 |
-
$color = $bg;
|
576 |
-
$table_color = $calendar_bg;
|
577 |
-
}
|
578 |
-
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color=$bg;};
|
579 |
-
echo '<table style="height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . ' !important">
|
580 |
-
<tr>
|
581 |
-
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color: #' . str_replace('#','',$cat_color->color) . ' !important;color:' . $calendar_bg . ' !important">' . ($j + 1) . '</td>
|
582 |
-
<td>
|
583 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:15px;background:none;color:' . $ev_title_color . ';"
|
584 |
-
href="' . add_query_arg(array(
|
585 |
-
'action' => 'spidercalendarbig',
|
586 |
-
'theme_id' => $theme_id,
|
587 |
-
'calendar_id' => $calendar_id,
|
588 |
-
'ev_ids' => $ev_ids_inline,
|
589 |
-
'eventID' => $ev_id[$j],
|
590 |
-
'date' => $year . '-' . $month . '-' . (int) $day,
|
591 |
-
'many_sp_calendar' => $many_sp_calendar,
|
592 |
-
'widget' => $widget,
|
593 |
-
'TB_iframe' => 1,
|
594 |
-
'tbWidth' => $popup_width,
|
595 |
-
'tbHeight' => $popup_height,
|
596 |
-
), $site_url) . '"><b>' . $ev_title[$j] . '</b>
|
597 |
-
</a>
|
598 |
-
</td>
|
599 |
-
</tr>
|
600 |
-
</table>';
|
601 |
-
}
|
602 |
-
}
|
603 |
-
}
|
604 |
-
}
|
605 |
-
else {
|
606 |
-
echo '<table style="height:14px;border-spacing:0;width: 100%;background-color:#D6D4D5;">
|
607 |
-
<tr>
|
608 |
-
<td style="font-size:22px; font-weight:bold; width:15px;text-align:center;background-color:' . $bg . ' !important;color:#949394;"></td>
|
609 |
-
<td><p style="font-size:12px;color:' . $bg . '; border:none"> ' . __('There are no events on this date', 'sp_calendar') . '</p></td>
|
610 |
-
</tr>
|
611 |
-
</table>';
|
612 |
-
}
|
613 |
-
echo '</td></tr></table>';
|
614 |
-
}
|
615 |
-
?>
|
616 |
-
</td>
|
617 |
-
</tr>
|
618 |
-
<tr style="height:<?php echo $year_font_size + 2; ?>px; font-family: <?php echo $font_year; ?>;">
|
619 |
-
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
620 |
-
echo add_query_arg(array(
|
621 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
622 |
-
'theme_id' => $theme_id,
|
623 |
-
'calendar' => $calendar_id,
|
624 |
-
'select' => $view_select,
|
625 |
-
'date' => ($year - 1) . '-' . add_0((Month_num($month_year))),
|
626 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
627 |
-
'many_sp_calendar' => $many_sp_calendar,
|
628 |
-
'widget' => $widget,
|
629 |
-
'cat_id' => '',
|
630 |
-
'cat_ids' => $cat_ids,
|
631 |
-
'TB_iframe' => 1,
|
632 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important">
|
633 |
-
<?php echo ($year - 1); ?>
|
634 |
-
</td>
|
635 |
-
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
636 |
-
<?php echo $year; ?>
|
637 |
-
</td>
|
638 |
-
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
639 |
-
echo add_query_arg(array(
|
640 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
641 |
-
'theme_id' => $theme_id,
|
642 |
-
'calendar' => $calendar_id,
|
643 |
-
'select' => $view_select,
|
644 |
-
'date' => ($year + 1) . '-' . add_0((Month_num($month_year))),
|
645 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
646 |
-
'many_sp_calendar' => $many_sp_calendar,
|
647 |
-
'widget' => $widget,
|
648 |
-
'cat_id' => '',
|
649 |
-
'cat_ids' => $cat_ids,
|
650 |
-
'TB_iframe' => 1,
|
651 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important;color:<?php echo $year_font_color; ?> !important">
|
652 |
-
<?php echo ($year + 1); ?>
|
653 |
-
</td>
|
654 |
-
</tr>
|
655 |
-
</table>
|
656 |
-
<input type="text" value="1" name="day" style="display:none" />
|
657 |
-
</form>
|
658 |
-
</td>
|
659 |
-
</tr>
|
660 |
-
</table>
|
661 |
-
</div>
|
662 |
-
<style>
|
663 |
-
#calendar_<?php echo $many_sp_calendar; ?> table{
|
664 |
-
width: 100%;
|
665 |
-
}
|
666 |
-
.spider_categories_widget{
|
667 |
-
display:inline-block;
|
668 |
-
cursor:pointer;
|
669 |
-
}
|
670 |
-
|
671 |
-
.spider_categories_widget p{
|
672 |
-
color: #fff;
|
673 |
-
padding: 2px 10px !important;
|
674 |
-
margin: 2px 0 !important;
|
675 |
-
font-size: 13px;
|
676 |
-
}
|
677 |
-
</style>
|
678 |
-
<?php
|
679 |
-
|
680 |
-
//reindex cat_ids_array
|
681 |
-
$re_cat_ids_array = array_values($cat_ids_array);
|
682 |
-
|
683 |
-
for($i=0; $i<count($re_cat_ids_array); $i++)
|
684 |
-
{
|
685 |
-
echo'
|
686 |
-
<style>
|
687 |
-
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
688 |
-
{
|
689 |
-
text-decoration:underline;
|
690 |
-
cursor:pointer;
|
691 |
-
|
692 |
-
}
|
693 |
-
|
694 |
-
</style>';
|
695 |
-
|
696 |
-
}
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
if($cat_ids=='')
|
701 |
-
$cat_ids='';
|
702 |
-
if($show_cat){
|
703 |
-
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none; margin-top: 10px;">';
|
704 |
-
|
705 |
-
foreach($categories as $category)
|
706 |
-
{
|
707 |
-
?>
|
708 |
-
<li class="spider_categories_widget"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
709 |
-
'action' => 'spiderbigcalendar_week_widget',
|
710 |
-
'theme_id' => $theme_id,
|
711 |
-
'calendar' => $calendar_id,
|
712 |
-
'select' => $view_select,
|
713 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
714 |
-
'date' => $year . '-' . $month . '-' . add_0($day),
|
715 |
-
'many_sp_calendar' => $many_sp_calendar,
|
716 |
-
'cat_id' => $category->id,
|
717 |
-
'cat_ids' => $cat_ids,
|
718 |
-
'widget' => $widget,
|
719 |
-
'TB_iframe' => 1,
|
720 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
721 |
-
<?php
|
722 |
-
}
|
723 |
-
if (!empty($categories)) {
|
724 |
-
?>
|
725 |
-
<li class="spider_categories_widget"><p id="category0" style="background-color:#<?php echo str_replace('#','',$bg); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
726 |
-
'action' => 'spiderbigcalendar_week_widget',
|
727 |
-
'theme_id' => $theme_id,
|
728 |
-
'calendar' => $calendar_id,
|
729 |
-
'select' => $view_select,
|
730 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
731 |
-
'date' => $year . '-' . $month . '-' . add_0($day),
|
732 |
-
'many_sp_calendar' => $many_sp_calendar,
|
733 |
-
'cat_id' => '',
|
734 |
-
'cat_ids' => '',
|
735 |
-
'widget' => $widget,
|
736 |
-
'TB_iframe' => 1,
|
737 |
-
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
738 |
-
<?php echo '</ul>';
|
739 |
-
}
|
740 |
-
} ?>
|
741 |
-
</body>
|
742 |
-
</html>
|
743 |
-
<?php
|
744 |
-
die();
|
745 |
-
}
|
746 |
-
|
747 |
?>
|
1 |
+
<?php
|
2 |
+
function big_calendar_week_widget() {
|
3 |
+
require_once("frontend_functions.php");
|
4 |
+
global $wpdb;
|
5 |
+
$widget = ((isset($_GET['widget']) && (int) $_GET['widget']) ? (int) $_GET['widget'] : 0);
|
6 |
+
$many_sp_calendar = ((isset($_GET['many_sp_calendar']) && is_numeric(esc_html($_GET['many_sp_calendar']))) ? esc_html($_GET['many_sp_calendar']) : 1);
|
7 |
+
$calendar_id = (isset($_GET['calendar']) ? (int) $_GET['calendar'] : '');
|
8 |
+
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : 1);
|
9 |
+
$date = ((isset($_GET['date']) && IsDate_inputed(esc_html($_GET['date']))) ? esc_html($_GET['date']) : '');
|
10 |
+
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
+
$months = (isset($_GET['months']) ? esc_html($_GET['months']) : '');
|
12 |
+
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
13 |
+
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
14 |
+
$site_url = get_admin_url().'admin-ajax.php';
|
15 |
+
///////////////////////////////////////////////////////////////////////////////////
|
16 |
+
|
17 |
+
if($cat_ids=='')
|
18 |
+
$cat_ids .= $cat_id.',';
|
19 |
+
else
|
20 |
+
$cat_ids .= ','.$cat_id.',';
|
21 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
22 |
+
|
23 |
+
|
24 |
+
function getelementcountinarray($array , $element)
|
25 |
+
{
|
26 |
+
$t=0;
|
27 |
+
|
28 |
+
for($i=0; $i<count($array); $i++)
|
29 |
+
{
|
30 |
+
if($element==$array[$i])
|
31 |
+
$t++;
|
32 |
+
|
33 |
+
}
|
34 |
+
|
35 |
+
|
36 |
+
return $t;
|
37 |
+
|
38 |
+
}
|
39 |
+
|
40 |
+
function getelementindexinarray($array , $element)
|
41 |
+
{
|
42 |
+
|
43 |
+
$t='';
|
44 |
+
|
45 |
+
for($i=0; $i<count($array); $i++)
|
46 |
+
{
|
47 |
+
if($element==$array[$i])
|
48 |
+
$t.=$i.',';
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
return $t;
|
53 |
+
|
54 |
+
|
55 |
+
}
|
56 |
+
$cat_ids_array = explode(',',$cat_ids);
|
57 |
+
|
58 |
+
|
59 |
+
if($cat_id!='')
|
60 |
+
{
|
61 |
+
|
62 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
63 |
+
{
|
64 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
65 |
+
$index_array = explode(',' , $index_in_line);
|
66 |
+
array_pop ($index_array);
|
67 |
+
for($j=0; $j<count($index_array); $j++)
|
68 |
+
unset($cat_ids_array[$index_array[$j]]);
|
69 |
+
$cat_ids = implode(',',$cat_ids_array);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
else
|
73 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
74 |
+
|
75 |
+
|
76 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
77 |
+
|
78 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
79 |
+
$weekstart = $theme->week_start_day;
|
80 |
+
$bg = '#' . str_replace('#','',$theme->header_bgcolor);
|
81 |
+
$bg_color_selected = '#' . str_replace('#','',$theme->bg_color_selected);
|
82 |
+
$color_arrow = '#' . str_replace('#','',$theme->arrow_color);
|
83 |
+
$evented_color = '#' . str_replace('#','',$theme->text_color_this_month_evented);
|
84 |
+
$evented_color_bg = '#' . str_replace('#','',$theme->bg_color_this_month_evented);
|
85 |
+
$sun_days = '#' . str_replace('#','',$theme->text_color_sun_days);
|
86 |
+
$text_color_other_months = '#' . str_replace('#','',$theme->text_color_other_months);
|
87 |
+
$text_color_this_month_unevented = '#' . str_replace('#','',$theme->text_color_this_month_unevented);
|
88 |
+
$text_color_month = '#' . str_replace('#','',$theme->text_color_month);
|
89 |
+
$color_week_days = '#' . str_replace('#','',$theme->text_color_week_days);
|
90 |
+
$text_color_selected = '#' . str_replace('#','',$theme->text_color_selected);
|
91 |
+
$border_day = '#' . str_replace('#','',$theme->border_day);
|
92 |
+
$calendar_width = $theme->width;
|
93 |
+
$calendar_bg = '#' . str_replace('#','',$theme->footer_bgcolor);
|
94 |
+
$weekdays_bg_color = '#' . str_replace('#','',$theme->weekdays_bg_color);
|
95 |
+
$weekday_su_bg_color = '#' . str_replace('#','',$theme->su_bg_color);
|
96 |
+
$cell_border_color = '#' . str_replace('#','',$theme->cell_border_color);
|
97 |
+
$year_font_size = $theme->year_font_size;
|
98 |
+
$year_font_color = '#' . str_replace('#','',$theme->year_font_color);
|
99 |
+
$year_tabs_bg_color = '#' . str_replace('#','',$theme->year_tabs_bg_color);
|
100 |
+
$font_year = $theme->font_year;
|
101 |
+
$font_month = $theme->font_month;
|
102 |
+
$font_day = $theme->font_day;
|
103 |
+
$font_weekday = $theme->font_weekday;
|
104 |
+
$ev_title_color = '#' . str_replace('#','',$theme->ev_title_color);
|
105 |
+
$show_cat = $theme->show_cat;
|
106 |
+
$popup_width = $theme->popup_width;
|
107 |
+
$popup_height = $theme->popup_height;
|
108 |
+
$show_event_bgcolor = '#' . str_replace('#','',$theme->show_event_bgcolor);
|
109 |
+
__('January', 'sp_calendar');
|
110 |
+
__('February', 'sp_calendar');
|
111 |
+
__('March', 'sp_calendar');
|
112 |
+
__('April', 'sp_calendar');
|
113 |
+
__('May', 'sp_calendar');
|
114 |
+
__('June', 'sp_calendar');
|
115 |
+
__('July', 'sp_calendar');
|
116 |
+
__('August', 'sp_calendar');
|
117 |
+
__('September', 'sp_calendar');
|
118 |
+
__('October', 'sp_calendar');
|
119 |
+
__('November', 'sp_calendar');
|
120 |
+
__('December', 'sp_calendar');
|
121 |
+
if ($date != '') {
|
122 |
+
$date_REFERER = $date;
|
123 |
+
}
|
124 |
+
else {
|
125 |
+
$date_REFERER = date("Y-m");
|
126 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
127 |
+
}
|
128 |
+
$year_REFERER = substr($date_REFERER, 0, 4);
|
129 |
+
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
130 |
+
$day_REFERER = substr($date_REFERER, 8, 2);
|
131 |
+
|
132 |
+
$year = substr($date, 0, 4);
|
133 |
+
$month = Month_name(substr($date, 5, 2));
|
134 |
+
$month_year = Month_name(substr($date, 5, 2));
|
135 |
+
$day = substr($date, 8, 2);
|
136 |
+
$cell_width = $calendar_width / 7;
|
137 |
+
$cell_width = (int) $cell_width - 2;
|
138 |
+
|
139 |
+
$week_days = array();
|
140 |
+
$d = new DateTime($date);
|
141 |
+
$weekday = $d->format('w');
|
142 |
+
// Monday=0, Sunday=6.
|
143 |
+
$diff = ($weekday == 0 ? 6 : $weekday - 1);
|
144 |
+
if ($weekstart == "su") {
|
145 |
+
$diff = $diff + 1;
|
146 |
+
}
|
147 |
+
$d->modify("-$diff day");
|
148 |
+
$d->modify("-1 day");
|
149 |
+
$prev_date = $d->format('Y-m-d');
|
150 |
+
$d->modify("+1 day");
|
151 |
+
$week_days[] = $d->format('Y-m-d');
|
152 |
+
for ($i = 1; $i < 7; $i++) {
|
153 |
+
$d->modify('+1 day');
|
154 |
+
$week_days[] = $d->format('Y-m-d');
|
155 |
+
}
|
156 |
+
if ($weekstart == "su") {
|
157 |
+
$d->modify('+2 day');
|
158 |
+
}
|
159 |
+
else {
|
160 |
+
$d->modify('+1 day');
|
161 |
+
}
|
162 |
+
$next_date = $d->format('Y-m-d');
|
163 |
+
$prev_month = add_0((int) substr($prev_date, 5, 2) - 1);
|
164 |
+
$this_month = add_0((int) substr($prev_date, 5, 2));
|
165 |
+
$next_month = add_0((int) substr($prev_date, 5, 2) + 1);
|
166 |
+
if ($next_month == '13') {
|
167 |
+
$next_month = '01';
|
168 |
+
}
|
169 |
+
if ($prev_month == '00') {
|
170 |
+
$prev_month = '12';
|
171 |
+
}
|
172 |
+
$view = 'bigcalendarweek_widget';
|
173 |
+
$views = explode(',', $view_select);
|
174 |
+
$defaultview = 'week';
|
175 |
+
array_pop($views);
|
176 |
+
$display = '';
|
177 |
+
if (count($views) == 0) {
|
178 |
+
$display = "display:none";
|
179 |
+
}
|
180 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
181 |
+
$display = "display:none";
|
182 |
+
}
|
183 |
+
?>
|
184 |
+
<html>
|
185 |
+
<head>
|
186 |
+
<style type='text/css'>
|
187 |
+
#calendar_<?php echo $many_sp_calendar; ?> table {
|
188 |
+
border-collapse: initial;
|
189 |
+
border:0px;
|
190 |
+
margin: 0;
|
191 |
+
}
|
192 |
+
#TB_iframeContent{
|
193 |
+
background-color: <?php echo $show_event_bgcolor; ?>;
|
194 |
+
}
|
195 |
+
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
196 |
+
padding: 0px;
|
197 |
+
vertical-align: none;
|
198 |
+
border-top:none;
|
199 |
+
line-height: none;
|
200 |
+
text-align: none;
|
201 |
+
}
|
202 |
+
#calendar_<?php echo $many_sp_calendar; ?> .arrow-left {
|
203 |
+
width: 0px;
|
204 |
+
height: 0px;
|
205 |
+
border-top: 7px solid transparent;
|
206 |
+
border-bottom: 7px solid transparent;
|
207 |
+
border-right: 13px solid;
|
208 |
+
margin: 0 auto;
|
209 |
+
}
|
210 |
+
|
211 |
+
#calendar_<?php echo $many_sp_calendar; ?> .arrow-right {
|
212 |
+
width: 0px;
|
213 |
+
height: 0px;
|
214 |
+
border-top: 7px solid transparent;
|
215 |
+
border-bottom: 7px solid transparent;
|
216 |
+
border-left: 13px solid;
|
217 |
+
margin: 0 auto;
|
218 |
+
}
|
219 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
220 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
221 |
+
font-family: <?php echo $font_day; ?>;
|
222 |
+
}
|
223 |
+
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
224 |
+
margin-bottom: 0;
|
225 |
+
}
|
226 |
+
#calendar_<?php echo $many_sp_calendar; ?> td,
|
227 |
+
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
228 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> td,
|
229 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> tr {
|
230 |
+
border:none;
|
231 |
+
}
|
232 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
233 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
234 |
+
color: <?php echo $color_arrow; ?>;
|
235 |
+
text-decoration: none !important;
|
236 |
+
background: none;
|
237 |
+
font-size: 16px;
|
238 |
+
}
|
239 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
240 |
+
color: <?php echo $color_arrow; ?>;
|
241 |
+
text-decoration:none;
|
242 |
+
background:none;
|
243 |
+
}
|
244 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
245 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
246 |
+
text-decoration:underline;
|
247 |
+
background:none;
|
248 |
+
font-size:11px;
|
249 |
+
}
|
250 |
+
#calendar_<?php echo $many_sp_calendar; ?> a {
|
251 |
+
font-weight: normal;
|
252 |
+
}
|
253 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
254 |
+
font-size:12px;
|
255 |
+
text-decoration:none;
|
256 |
+
background:none;
|
257 |
+
}
|
258 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
259 |
+
border-spacing:0;
|
260 |
+
width:100%;
|
261 |
+
}
|
262 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
263 |
+
border-spacing: 0;
|
264 |
+
vertical-align: middle;
|
265 |
+
width: 100%;
|
266 |
+
}
|
267 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
268 |
+
background-color:<?php echo $bg; ?> !important;
|
269 |
+
text-align:center;
|
270 |
+
vertical-align: middle;
|
271 |
+
}
|
272 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
273 |
+
color:<?php echo $text_color_other_months; ?>;
|
274 |
+
}
|
275 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
276 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
277 |
+
}
|
278 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calfont_year {
|
279 |
+
font-size:24px;
|
280 |
+
font-weight:bold;
|
281 |
+
}
|
282 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
283 |
+
color:<?php echo $sun_days; ?>;
|
284 |
+
}
|
285 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
286 |
+
border: solid <?php echo $border_day; ?> 1px;
|
287 |
+
}
|
288 |
+
#TB_window {
|
289 |
+
z-index: 10000;
|
290 |
+
}
|
291 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
292 |
+
float: right;
|
293 |
+
background-color: <?php echo $calendar_bg; ?> !important;
|
294 |
+
height: 25px;
|
295 |
+
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
296 |
+
margin-left: 2px;
|
297 |
+
text-align: center;
|
298 |
+
cursor:pointer;
|
299 |
+
position: relative;
|
300 |
+
top: 3px;
|
301 |
+
font-family: <?php echo $font_month; ?>;
|
302 |
+
font-size: 14px;
|
303 |
+
}
|
304 |
+
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
305 |
+
background: transparent !important;
|
306 |
+
}
|
307 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
308 |
+
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
309 |
+
{
|
310 |
+
width: 120px;
|
311 |
+
text-align: center;
|
312 |
+
cursor: pointer;
|
313 |
+
padding: 6px;
|
314 |
+
position: relative;
|
315 |
+
}
|
316 |
+
|
317 |
+
|
318 |
+
#drop_down_views
|
319 |
+
{
|
320 |
+
list-style-type:none !important;
|
321 |
+
position: absolute;
|
322 |
+
top: 46px;
|
323 |
+
left: -15px;
|
324 |
+
display:none;
|
325 |
+
z-index: 4545;
|
326 |
+
|
327 |
+
}
|
328 |
+
|
329 |
+
#drop_down_views >li
|
330 |
+
{
|
331 |
+
border-bottom:1px solid #fff !important;
|
332 |
+
}
|
333 |
+
|
334 |
+
|
335 |
+
#views_tabs_select
|
336 |
+
{
|
337 |
+
display:none;
|
338 |
+
}
|
339 |
+
</style>
|
340 |
+
</head>
|
341 |
+
<body>
|
342 |
+
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
343 |
+
<table cellpadding="0" cellspacing="0" style="border-spacing:0; width:<?php echo $calendar_width; ?>px; margin:0; padding:0;background-color:<?php echo $calendar_bg; ?> !important">
|
344 |
+
<tr style="background-color:#FFFFFF;">
|
345 |
+
<td style="background-color:#FFFFFF;">
|
346 |
+
<div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
|
347 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
348 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
349 |
+
'action' => 'spiderbigcalendar_day_widget',
|
350 |
+
'theme_id' => $theme_id,
|
351 |
+
'calendar' => $calendar_id,
|
352 |
+
'select' => $view_select,
|
353 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
354 |
+
'many_sp_calendar' => $many_sp_calendar,
|
355 |
+
'cat_id' => '',
|
356 |
+
'cat_ids' => $cat_ids,
|
357 |
+
'widget' => $widget,
|
358 |
+
'TB_iframe' => 1,
|
359 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Day', 'sp_calendar'); ?></span>
|
360 |
+
</div>
|
361 |
+
<div class="views" style="margin-left: 3px;margin-right: 1px;<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;' ?>"
|
362 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
363 |
+
'action' => 'spiderbigcalendar_week_widget',
|
364 |
+
'theme_id' => $theme_id,
|
365 |
+
'calendar' => $calendar_id,
|
366 |
+
'select' => $view_select,
|
367 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
368 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
369 |
+
'many_sp_calendar' => $many_sp_calendar,
|
370 |
+
'cat_id' => '',
|
371 |
+
'cat_ids' => $cat_ids,
|
372 |
+
'widget' => $widget,
|
373 |
+
'TB_iframe' => 1,
|
374 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Week', 'sp_calendar'); ?></span>
|
375 |
+
</div>
|
376 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;' ?>"
|
377 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
378 |
+
'action' => 'spiderbigcalendar_list_widget',
|
379 |
+
'theme_id' => $theme_id,
|
380 |
+
'calendar' => $calendar_id,
|
381 |
+
'select' => $view_select,
|
382 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
383 |
+
'many_sp_calendar' => $many_sp_calendar,
|
384 |
+
'cat_id' => '',
|
385 |
+
'cat_ids' => $cat_ids,
|
386 |
+
'widget' => $widget,
|
387 |
+
'TB_iframe' => 1,
|
388 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('List', 'sp_calendar'); ?></span>
|
389 |
+
</div>
|
390 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ' !important;height:28px;top:0;'; ?>"
|
391 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
392 |
+
'action' => 'spiderbigcalendar_month_widget',
|
393 |
+
'theme_id' => $theme_id,
|
394 |
+
'calendar' => $calendar_id,
|
395 |
+
'select' => $view_select,
|
396 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
397 |
+
'many_sp_calendar' => $many_sp_calendar,
|
398 |
+
'cat_id' => '',
|
399 |
+
'cat_ids' => $cat_ids,
|
400 |
+
'widget' => $widget,
|
401 |
+
'TB_iframe' => 1,
|
402 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" ><span style="line-height: 2;color:<?php echo $text_color_month; ?>;"><?php echo __('Month', 'sp_calendar'); ?></span>
|
403 |
+
</div>
|
404 |
+
</div>
|
405 |
+
</td>
|
406 |
+
</tr>
|
407 |
+
<tr>
|
408 |
+
<td width="100%" style="padding:0; margin:0;">
|
409 |
+
<form action="" method="get" style="background:none; margin:0; padding:0;">
|
410 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>">
|
411 |
+
<tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
|
412 |
+
<td class="calbg" colspan="7" style="background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');margin:0; padding:0;background-repeat: no-repeat;background-size: 100% 100%;" >
|
413 |
+
<?php //MONTH TABLE ?>
|
414 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
|
415 |
+
<tr>
|
416 |
+
<td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
417 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
418 |
+
if (Month_num($month) == 1) {
|
419 |
+
$needed_date = ($year - 1) . '-12';
|
420 |
+
}
|
421 |
+
else {
|
422 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
423 |
+
}
|
424 |
+
echo add_query_arg(array(
|
425 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
426 |
+
'theme_id' => $theme_id,
|
427 |
+
'calendar' => $calendar_id,
|
428 |
+
'select' => $view_select,
|
429 |
+
'date' => $prev_date,
|
430 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
431 |
+
'many_sp_calendar' => $many_sp_calendar,
|
432 |
+
'cat_id' => '',
|
433 |
+
'cat_ids' => $cat_ids,
|
434 |
+
'widget' => $widget,
|
435 |
+
'TB_iframe' => 1,
|
436 |
+
), $site_url);
|
437 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-left"></div>
|
438 |
+
</a>
|
439 |
+
</td>
|
440 |
+
<?php
|
441 |
+
$weekstartday = substr($week_days[0],8,2);
|
442 |
+
$weekendday = substr($week_days[6],8,2);
|
443 |
+
$startmonth = substr($week_days[0],5,2);
|
444 |
+
$endmonth = substr($week_days[6],5,2);
|
445 |
+
|
446 |
+
$startmonth_name = month_name($startmonth);
|
447 |
+
$endmonth_name = month_name($endmonth); ?>
|
448 |
+
<td style="text-align:center; margin:0;" width="40%">
|
449 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
450 |
+
<span style="line-height: 30px;font-family:arial; color:<?php echo $text_color_month; ?>; font-size:<?php echo $year_font_size; ?>px;"><?php echo __($startmonth_name,'sp_calendar').' '. $weekstartday . ' - ' . __($endmonth_name,'sp_calendar') .' '. $weekendday; ?></span>
|
451 |
+
</td>
|
452 |
+
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
453 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
454 |
+
if (Month_num($month) == 12) {
|
455 |
+
$needed_date = ($year + 1) . '-01';
|
456 |
+
}
|
457 |
+
else {
|
458 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
459 |
+
}
|
460 |
+
echo add_query_arg(array(
|
461 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
462 |
+
'theme_id' => $theme_id,
|
463 |
+
'calendar' => $calendar_id,
|
464 |
+
'select' => $view_select,
|
465 |
+
'date' => $next_date,
|
466 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
467 |
+
'many_sp_calendar' => $many_sp_calendar,
|
468 |
+
'cat_id' => '',
|
469 |
+
'cat_ids' => $cat_ids,
|
470 |
+
'widget' => $widget,
|
471 |
+
'TB_iframe' => 1,
|
472 |
+
), $site_url);
|
473 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><div class="arrow-right"></div>
|
474 |
+
</a>
|
475 |
+
</td>
|
476 |
+
</tr>
|
477 |
+
</table>
|
478 |
+
</td>
|
479 |
+
</tr>
|
480 |
+
|
481 |
+
<tr>
|
482 |
+
<td colspan="7">
|
483 |
+
<?php
|
484 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
485 |
+
if ($weekstart == "su") {
|
486 |
+
$month_first_weekday++;
|
487 |
+
if ($month_first_weekday == 8) {
|
488 |
+
$month_first_weekday = 1;
|
489 |
+
}
|
490 |
+
}
|
491 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
492 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
493 |
+
$last_month_days_count = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
494 |
+
$weekday_i = $month_first_weekday;
|
495 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
496 |
+
$percent = 1;
|
497 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
498 |
+
if ($sum % 7 <> 0) {
|
499 |
+
$percent = $percent + 1;
|
500 |
+
}
|
501 |
+
$sum = $sum - ($sum % 7);
|
502 |
+
$percent = $percent + ($sum / 7);
|
503 |
+
$percent = 107 / $percent;
|
504 |
+
|
505 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
506 |
+
$calendar = (isset($_GET['calendar']) ? (int)$_GET['calendar'] : '');
|
507 |
+
$all_calendar_files = php_getdays_for_three_months($calendar_id, $date, $months, $theme_id, $widget);
|
508 |
+
|
509 |
+
$all_array_days = $all_calendar_files[0]['all_array_days'];
|
510 |
+
$all_array_days1 = $all_calendar_files[0]['all_array_days1'];
|
511 |
+
$all_title = $all_calendar_files[0]['all_title'];
|
512 |
+
$all_ev_ids = $all_calendar_files[0]['all_ev_ids'];
|
513 |
+
|
514 |
+
$prev_month = substr($months, 0, 2);
|
515 |
+
$this_month = substr($months, 3, 2);
|
516 |
+
$next_month = substr($months, 6, 2);
|
517 |
+
$array_days = array();
|
518 |
+
for ($i = 0; $i <= 6; $i++) {
|
519 |
+
$day = substr($week_days[$i], 8, 2);
|
520 |
+
$month = substr($week_days[$i], 5, 2);
|
521 |
+
$year = substr($week_days[$i], 0, 4);
|
522 |
+
switch($month) {
|
523 |
+
case $prev_month:
|
524 |
+
$array_days = $all_array_days[0];
|
525 |
+
$array_days1 = $all_array_days1[0];
|
526 |
+
$title = $all_title[0];
|
527 |
+
$ev_ids = $all_ev_ids[0];
|
528 |
+
break;
|
529 |
+
|
530 |
+
case $this_month:
|
531 |
+
$array_days = $all_array_days[1];
|
532 |
+
$array_days1 = $all_array_days1[1];
|
533 |
+
$title = $all_title[1];
|
534 |
+
$ev_ids = $all_ev_ids[1];
|
535 |
+
break;
|
536 |
+
|
537 |
+
case $next_month:
|
538 |
+
$array_days = $all_array_days[2];
|
539 |
+
$array_days1 = $all_array_days1[2];
|
540 |
+
$title = $all_title[2];
|
541 |
+
$ev_ids = $all_ev_ids[2];
|
542 |
+
break;
|
543 |
+
}
|
544 |
+
sort($array_days, SORT_NUMERIC);
|
545 |
+
$week_day = date('D', mktime(0, 0, 0, $month, (int) $day, $year));
|
546 |
+
$month_name = month_name($month);
|
547 |
+
echo '<table style="width:100%;border-spacing:0;">
|
548 |
+
<tr>
|
549 |
+
<td style="height:14px;font-size:12px; padding-left:10px; background-color:#D6D4D5 !important; color:#6E7276">
|
550 |
+
<span style="padding-left:10px; font-size:12px; color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
|
551 |
+
<span style="font-size:12px;color:#949394;">(' . __($month_name,'sp_calendar') . ' ' . (int) $day . ')</span>
|
552 |
+
</td>
|
553 |
+
<tr>
|
554 |
+
<td>';
|
555 |
+
if (in_array((int) $day, $array_days)) {
|
556 |
+
foreach($title as $key => $value) {
|
557 |
+
if ($key == (int) $day) {
|
558 |
+
$ev_id = explode('<br>', $ev_ids[$key]);
|
559 |
+
array_pop($ev_id);
|
560 |
+
$ev_ids_inline = implode(',', $ev_id);
|
561 |
+
$ev_title = explode('</p>', $value);
|
562 |
+
array_pop($ev_title);
|
563 |
+
for ($j = 0; $j < count($ev_title); $j++) {
|
564 |
+
$queryy = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
565 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
566 |
+
" . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=%d",$calendar,$ev_id[$j]);
|
567 |
+
|
568 |
+
$cat_color = $wpdb->get_row($queryy);
|
569 |
+
|
570 |
+
if (($j + 1) % 2 == 0) {
|
571 |
+
$color = $bg;
|
572 |
+
$table_color = $calendar_bg;
|
573 |
+
}
|
574 |
+
else {
|
575 |
+
$color = $bg;
|
576 |
+
$table_color = $calendar_bg;
|
577 |
+
}
|
578 |
+
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color=$bg;};
|
579 |
+
echo '<table style="height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . ' !important">
|
580 |
+
<tr>
|
581 |
+
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color: #' . str_replace('#','',$cat_color->color) . ' !important;color:' . $calendar_bg . ' !important">' . ($j + 1) . '</td>
|
582 |
+
<td>
|
583 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:15px;background:none;color:' . $ev_title_color . ';"
|
584 |
+
href="' . add_query_arg(array(
|
585 |
+
'action' => 'spidercalendarbig',
|
586 |
+
'theme_id' => $theme_id,
|
587 |
+
'calendar_id' => $calendar_id,
|
588 |
+
'ev_ids' => $ev_ids_inline,
|
589 |
+
'eventID' => $ev_id[$j],
|
590 |
+
'date' => $year . '-' . $month . '-' . (int) $day,
|
591 |
+
'many_sp_calendar' => $many_sp_calendar,
|
592 |
+
'widget' => $widget,
|
593 |
+
'TB_iframe' => 1,
|
594 |
+
'tbWidth' => $popup_width,
|
595 |
+
'tbHeight' => $popup_height,
|
596 |
+
), $site_url) . '"><b>' . $ev_title[$j] . '</b>
|
597 |
+
</a>
|
598 |
+
</td>
|
599 |
+
</tr>
|
600 |
+
</table>';
|
601 |
+
}
|
602 |
+
}
|
603 |
+
}
|
604 |
+
}
|
605 |
+
else {
|
606 |
+
echo '<table style="height:14px;border-spacing:0;width: 100%;background-color:#D6D4D5;">
|
607 |
+
<tr>
|
608 |
+
<td style="font-size:22px; font-weight:bold; width:15px;text-align:center;background-color:' . $bg . ' !important;color:#949394;"></td>
|
609 |
+
<td><p style="font-size:12px;color:' . $bg . '; border:none"> ' . __('There are no events on this date', 'sp_calendar') . '</p></td>
|
610 |
+
</tr>
|
611 |
+
</table>';
|
612 |
+
}
|
613 |
+
echo '</td></tr></table>';
|
614 |
+
}
|
615 |
+
?>
|
616 |
+
</td>
|
617 |
+
</tr>
|
618 |
+
<tr style="height:<?php echo $year_font_size + 2; ?>px; font-family: <?php echo $font_year; ?>;">
|
619 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
620 |
+
echo add_query_arg(array(
|
621 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
622 |
+
'theme_id' => $theme_id,
|
623 |
+
'calendar' => $calendar_id,
|
624 |
+
'select' => $view_select,
|
625 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month_year))),
|
626 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
627 |
+
'many_sp_calendar' => $many_sp_calendar,
|
628 |
+
'widget' => $widget,
|
629 |
+
'cat_id' => '',
|
630 |
+
'cat_ids' => $cat_ids,
|
631 |
+
'TB_iframe' => 1,
|
632 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important">
|
633 |
+
<?php echo ($year - 1); ?>
|
634 |
+
</td>
|
635 |
+
<td colspan="3" style="font-size:<?php echo $year_font_size + 2; ?>px;color:<?php echo $year_font_color; ?>;text-align: center;border-right:1px solid <?php echo $cell_border_color; ?>;border-left:1px solid <?php echo $cell_border_color; ?>">
|
636 |
+
<?php echo $year; ?>
|
637 |
+
</td>
|
638 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
639 |
+
echo add_query_arg(array(
|
640 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
641 |
+
'theme_id' => $theme_id,
|
642 |
+
'calendar' => $calendar_id,
|
643 |
+
'select' => $view_select,
|
644 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month_year))),
|
645 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
646 |
+
'many_sp_calendar' => $many_sp_calendar,
|
647 |
+
'widget' => $widget,
|
648 |
+
'cat_id' => '',
|
649 |
+
'cat_ids' => $cat_ids,
|
650 |
+
'TB_iframe' => 1,
|
651 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="cursor:pointer;font-size:<?php echo $year_font_size; ?>px;text-align: center;background-color:<?php echo $year_tabs_bg_color; ?> !important;color:<?php echo $year_font_color; ?> !important">
|
652 |
+
<?php echo ($year + 1); ?>
|
653 |
+
</td>
|
654 |
+
</tr>
|
655 |
+
</table>
|
656 |
+
<input type="text" value="1" name="day" style="display:none" />
|
657 |
+
</form>
|
658 |
+
</td>
|
659 |
+
</tr>
|
660 |
+
</table>
|
661 |
+
</div>
|
662 |
+
<style>
|
663 |
+
#calendar_<?php echo $many_sp_calendar; ?> table{
|
664 |
+
width: 100%;
|
665 |
+
}
|
666 |
+
.spider_categories_widget{
|
667 |
+
display:inline-block;
|
668 |
+
cursor:pointer;
|
669 |
+
}
|
670 |
+
|
671 |
+
.spider_categories_widget p{
|
672 |
+
color: #fff;
|
673 |
+
padding: 2px 10px !important;
|
674 |
+
margin: 2px 0 !important;
|
675 |
+
font-size: 13px;
|
676 |
+
}
|
677 |
+
</style>
|
678 |
+
<?php
|
679 |
+
|
680 |
+
//reindex cat_ids_array
|
681 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
682 |
+
|
683 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
684 |
+
{
|
685 |
+
echo'
|
686 |
+
<style>
|
687 |
+
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
688 |
+
{
|
689 |
+
text-decoration:underline;
|
690 |
+
cursor:pointer;
|
691 |
+
|
692 |
+
}
|
693 |
+
|
694 |
+
</style>';
|
695 |
+
|
696 |
+
}
|
697 |
+
|
698 |
+
|
699 |
+
|
700 |
+
if($cat_ids=='')
|
701 |
+
$cat_ids='';
|
702 |
+
if($show_cat){
|
703 |
+
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none; margin-top: 10px;">';
|
704 |
+
|
705 |
+
foreach($categories as $category)
|
706 |
+
{
|
707 |
+
?>
|
708 |
+
<li class="spider_categories_widget"><p id="category<?php echo $category->id ?>" style="background-color:#<?php echo str_replace('#','',$category->color); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
709 |
+
'action' => 'spiderbigcalendar_week_widget',
|
710 |
+
'theme_id' => $theme_id,
|
711 |
+
'calendar' => $calendar_id,
|
712 |
+
'select' => $view_select,
|
713 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
714 |
+
'date' => $year . '-' . $month . '-' . add_0($day),
|
715 |
+
'many_sp_calendar' => $many_sp_calendar,
|
716 |
+
'cat_id' => $category->id,
|
717 |
+
'cat_ids' => $cat_ids,
|
718 |
+
'widget' => $widget,
|
719 |
+
'TB_iframe' => 1,
|
720 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
721 |
+
<?php
|
722 |
+
}
|
723 |
+
if (!empty($categories)) {
|
724 |
+
?>
|
725 |
+
<li class="spider_categories_widget"><p id="category0" style="background-color:#<?php echo str_replace('#','',$bg); ?> !important" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
726 |
+
'action' => 'spiderbigcalendar_week_widget',
|
727 |
+
'theme_id' => $theme_id,
|
728 |
+
'calendar' => $calendar_id,
|
729 |
+
'select' => $view_select,
|
730 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
731 |
+
'date' => $year . '-' . $month . '-' . add_0($day),
|
732 |
+
'many_sp_calendar' => $many_sp_calendar,
|
733 |
+
'cat_id' => '',
|
734 |
+
'cat_ids' => '',
|
735 |
+
'widget' => $widget,
|
736 |
+
'TB_iframe' => 1,
|
737 |
+
), $site_url);?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"><?php echo __('All categories', 'sp_calendar'); ?></p></li>
|
738 |
+
<?php echo '</ul>';
|
739 |
+
}
|
740 |
+
} ?>
|
741 |
+
</body>
|
742 |
+
</html>
|
743 |
+
<?php
|
744 |
+
die();
|
745 |
+
}
|
746 |
+
|
747 |
?>
|
front_end/frontend_functions.php
CHANGED
@@ -1,1144 +1,1144 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function IsDate_inputed($str) {
|
4 |
-
if (is_array($str)) {
|
5 |
-
return;
|
6 |
-
}
|
7 |
-
$stamp = strtotime($str);
|
8 |
-
if (!is_numeric($stamp)) {
|
9 |
-
return FALSE;
|
10 |
-
}
|
11 |
-
$month = date('m', $stamp);
|
12 |
-
$day = date('d', $stamp);
|
13 |
-
$year = date('Y', $stamp);
|
14 |
-
if (checkdate($month, $day, $year)) {
|
15 |
-
return TRUE;
|
16 |
-
}
|
17 |
-
return FALSE;
|
18 |
-
}
|
19 |
-
function php_Month_num($month_name) {
|
20 |
-
for ($month_num = 1; $month_num <= 12; $month_num++) {
|
21 |
-
if (date("F", mktime(0, 0, 0, $month_num, 1, 0)) == $month_name) {
|
22 |
-
if ($month_num < 10) {
|
23 |
-
return '0' . $month_num;
|
24 |
-
}
|
25 |
-
else {
|
26 |
-
return $month_num;
|
27 |
-
}
|
28 |
-
}
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
function php_GetNextDate($beginDate, $repeat) {
|
33 |
-
return date('n/j/Y',strtotime($beginDate.' +'.$repeat.' day'));
|
34 |
-
}
|
35 |
-
|
36 |
-
function php_daysDifference($beginDate, $endDate) {
|
37 |
-
//explode the date by "-" and storing to array
|
38 |
-
$date_parts1 = explode("-", $beginDate);
|
39 |
-
$date_parts2 = explode("-", $endDate);
|
40 |
-
//gregoriantojd() Converts a Gregorian date to Julian Day Count
|
41 |
-
$start_date = mktime(0,0,0,$date_parts1[1], $date_parts1[2], $date_parts1[0]);
|
42 |
-
$end_date = mktime(0,0,0,$date_parts2[1], $date_parts2[2], $date_parts2[0]);
|
43 |
-
$diff= floor(($end_date - $start_date)/86400);
|
44 |
-
return $diff;
|
45 |
-
}
|
46 |
-
|
47 |
-
function php_getdays($show_numbers_for_events, $calendar, $date, $theme_id, $widget) {
|
48 |
-
global $wpdb;
|
49 |
-
$row = $wpdb->get_row($wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where published=1 and id=%d",$calendar));
|
50 |
-
date_default_timezone_set ($row->def_zone);
|
51 |
-
$year = substr($date, 0, 4);
|
52 |
-
$month = substr($date, 5, 2);
|
53 |
-
if ($widget) {
|
54 |
-
$show_time = 0;
|
55 |
-
$day_start = 0;
|
56 |
-
}
|
57 |
-
else {
|
58 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
59 |
-
$show_time = $theme->show_time;
|
60 |
-
$day_start = $theme->day_start;
|
61 |
-
}
|
62 |
-
|
63 |
-
$cat_id = (isset($_GET['cat_id']) ? esc_html($_GET['cat_id']) : '');
|
64 |
-
$cat_ids = (isset($_GET['cat_ids']) ? esc_html($_GET['cat_ids']) : '');
|
65 |
-
|
66 |
-
|
67 |
-
if($cat_ids=='')
|
68 |
-
$cat_ids .= $cat_id.',';
|
69 |
-
else
|
70 |
-
$cat_ids .= ','.$cat_id.',';
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
75 |
-
|
76 |
-
$cat_ids_array = explode(',',$cat_ids);
|
77 |
-
|
78 |
-
|
79 |
-
if($cat_id!='')
|
80 |
-
{
|
81 |
-
|
82 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
83 |
-
{
|
84 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
85 |
-
$index_array = explode(',' , $index_in_line);
|
86 |
-
array_pop ($index_array);
|
87 |
-
for($j=0; $j<count($index_array); $j++)
|
88 |
-
unset($cat_ids_array[$index_array[$j]]);
|
89 |
-
$cat_ids = implode(',',$cat_ids_array);
|
90 |
-
}
|
91 |
-
}
|
92 |
-
else
|
93 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
94 |
-
|
95 |
-
if($row->time_format==0)
|
96 |
-
{
|
97 |
-
$order_by = "ORDER BY " . $wpdb->prefix . "spidercalendar_event.time ASC";
|
98 |
-
}
|
99 |
-
else{
|
100 |
-
$order_by = " ORDER BY STR_TO_DATE( SUBSTRING( time, 1, 7 ) , '%h:%i%p' )";
|
101 |
-
}
|
102 |
-
|
103 |
-
if($cat_ids!='' and preg_match("/^[0-9\,]+$/", $cat_ids)) {
|
104 |
-
$query = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event.*," . $wpdb->prefix . "spidercalendar_event_category.color from " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category = " . $wpdb->prefix . "spidercalendar_event_category.id where " . $wpdb->prefix . "spidercalendar_event_category.published=1 and " . $wpdb->prefix . "spidercalendar_event.category IN (".$cat_ids.") and " . $wpdb->prefix . "spidercalendar_event.published=1 and ( ( (date<=%s or date like %s) and (date_end>=%s ) or date_end='0000-00-00' ) or ( date_end is Null and date like %s ) ) and calendar=%d", substr( $date,0,7).'-01',substr( $date,0,7)."%",substr( $date,0,7).'-01',substr( $date,0,7)."%",$calendar);
|
105 |
-
}
|
106 |
-
else{
|
107 |
-
$query = $wpdb->prepare("SELECT * from " . $wpdb->prefix . "spidercalendar_event where published=1 and ( ( (date<=%s or date like %s) and date_end>=%s) or ( date_end is Null and date like %s ) ) and calendar=%d ", "" . substr($date, 0, 7) . "-01", "" . substr($date, 0, 7) . "%", "" . substr($date, 0, 7) . "-01", "" . substr($date, 0, 7) . "%", $calendar);
|
108 |
-
}
|
109 |
-
$rows = $wpdb->get_results($query." ".$order_by);
|
110 |
-
|
111 |
-
|
112 |
-
$id_array = array();
|
113 |
-
$s = count($rows);
|
114 |
-
$id_array = array();
|
115 |
-
$array_days = array();
|
116 |
-
$array_days1 = array();
|
117 |
-
$title = array();
|
118 |
-
$ev_ids = array();
|
119 |
-
for ($i = 1; $i <= $s; $i++) {
|
120 |
-
$date_month = (int)substr($rows[$i - 1]->date, 5, 2);
|
121 |
-
$date_end_month = (int)substr($rows[$i - 1]->date_end, 5, 2);
|
122 |
-
$date_day = (int)substr($rows[$i - 1]->date, 8, 2);
|
123 |
-
$date_end_day = (int)substr($rows[$i - 1]->date_end, 8, 2);
|
124 |
-
$date_year_month = (int)(substr($rows[$i - 1]->date, 0, 4) . substr($rows[$i - 1]->date, 5, 2));
|
125 |
-
$date_end_year_month = (int)(substr($rows[$i - 1]->date_end, 0, 4) . substr($rows[$i - 1]->date_end, 5, 2));
|
126 |
-
$year_month = (int)($year . $month);
|
127 |
-
$repeat = $rows[$i - 1]->repeat;
|
128 |
-
if ($repeat == "") {
|
129 |
-
$repeat = 1;
|
130 |
-
}
|
131 |
-
$start_date = $rows[$i - 1]->date;
|
132 |
-
$weekly = $rows[$i - 1]->week;
|
133 |
-
$weekly_array = explode(',', $weekly);
|
134 |
-
$date_days = array();
|
135 |
-
$weekdays_start = array();
|
136 |
-
$weekdays = array();
|
137 |
-
|
138 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
139 |
-
//////////////////////// NO Repeat /////////////////////////////////////////////////////////////////////////////////////////////
|
140 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
141 |
-
if ($rows[$i - 1]->repeat_method == 'no_repeat') {
|
142 |
-
$date_days[] = $date_day;
|
143 |
-
}
|
144 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
145 |
-
//////////////////////// Repeat Daily ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
146 |
-
if ($rows[$i - 1]->repeat_method == 'daily') {
|
147 |
-
$t = php_daysDifference($rows[$i - 1]->date, $rows[$i - 1]->date_end);
|
148 |
-
for ($k = 1; $k <= $t / $repeat; $k++) {
|
149 |
-
$next_date = php_GetNextDate($start_date, $repeat);
|
150 |
-
$next_date_array = explode('/', $next_date);
|
151 |
-
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
152 |
-
$date_days[0] = $date_day;
|
153 |
-
if ((int)$month == $next_date_array[0] && (int)$year == $next_date_array[2])
|
154 |
-
$date_days[] = $next_date_array[1];
|
155 |
-
$start_date = date("Y-m-d", mktime(0, 0, 0, $next_date_array[0], $next_date_array[1], $next_date_array[2]));
|
156 |
-
}
|
157 |
-
}
|
158 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
159 |
-
//////////////////////// Repeat Weekly ///////////////////////////////////////////////////////////////////////////////////////////
|
160 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
161 |
-
if ($rows[$i - 1]->repeat_method == 'weekly') {
|
162 |
-
for ($j = 0; $j <= 6; $j++) {
|
163 |
-
if (in_array(date("D", mktime(0, 0, 0, $date_month, $date_day + $j, substr($rows[$i - 1]->date, 0, 4))), $weekly_array)) {
|
164 |
-
$weekdays_start[] = $date_day + $j;
|
165 |
-
}
|
166 |
-
}
|
167 |
-
for ($p = 0; $p < count($weekly_array) - 1; $p++) {
|
168 |
-
$start_date = substr($rows[$i - 1]->date, 0, 8) . $weekdays_start[$p];
|
169 |
-
$t = php_daysDifference($rows[$i - 1]->date, $rows[$i - 1]->date_end);
|
170 |
-
$r = 0;
|
171 |
-
|
172 |
-
for ($k = 1; $k < $t / $repeat; $k++) {
|
173 |
-
$start_date_array[] = $start_date;
|
174 |
-
|
175 |
-
if($date_month == (int)$month) $next_date = date('n/j/Y', strtotime($start_date));
|
176 |
-
else $next_date = php_GetNextDate($start_date, $repeat * 7);
|
177 |
-
|
178 |
-
$next_date_array = explode('/', $next_date);
|
179 |
-
|
180 |
-
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
181 |
-
$date_days[0] = $weekdays_start[$p];
|
182 |
-
|
183 |
-
|
184 |
-
if (($next_date_array[2] . '-' . add_0($next_date_array[0]) . '-' . add_0($next_date_array[1]) > $rows[$i - 1]->date_end) || ($next_date_array[0] > (int)$month && $next_date_array[2] == (int)$year) || ($next_date_array[2] > (int)$year))
|
185 |
-
break;
|
186 |
-
|
187 |
-
|
188 |
-
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
189 |
-
$date_days[0] = $weekdays_start[$p];
|
190 |
-
if ((int)$month == $next_date_array[0] && (int)$year == $next_date_array[2])
|
191 |
-
|
192 |
-
$weekdays[] = $next_date_array[1];
|
193 |
-
|
194 |
-
|
195 |
-
$start_date = date("Y-m-d", mktime(0, 0, 0, $next_date_array[0], $next_date_array[1], $next_date_array[2]));
|
196 |
-
|
197 |
-
|
198 |
-
}
|
199 |
-
$date_days = array_merge($weekdays, $date_days);
|
200 |
-
}
|
201 |
-
$repeat = $repeat * 7;
|
202 |
-
}
|
203 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
204 |
-
//////////////////////// Repeat Monthly ///////////////////////////////////////////////////////////////////////////////////////////
|
205 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
206 |
-
if ($rows[$i - 1]->repeat_method == 'monthly') {
|
207 |
-
$xxxxx = 13;
|
208 |
-
$year_dif_count = (int)$year - (int)substr($rows[$i - 1]->date, 0, 4);
|
209 |
-
$mount_dif_count = 12 - (int)substr($rows[$i - 1]->date, 5, 2) + (($year_dif_count - 1) * 12);
|
210 |
-
if ($year_dif_count > 0)
|
211 |
-
for ($my_serch_month = 1; $my_serch_month <= 12; $my_serch_month++) {
|
212 |
-
if ((($mount_dif_count + $my_serch_month) % $rows[$i - 1]->repeat) == 0) {
|
213 |
-
$xxxxx = $my_serch_month;
|
214 |
-
break;
|
215 |
-
}
|
216 |
-
}
|
217 |
-
if ($xxxxx != 13) {
|
218 |
-
if ($xxxxx < 10) {
|
219 |
-
$xxxxx = '0' . $xxxxx;
|
220 |
-
}
|
221 |
-
}
|
222 |
-
$month_days = date('t', mktime(0, 0, 0, $month, $date_day, $year));
|
223 |
-
if ($date_month < (int)$month or (int)substr($date_year_month, 0, 4) < $year)
|
224 |
-
$date_day = 1;
|
225 |
-
if ($year > (int)substr($date_year_month, 0, 4))
|
226 |
-
$date_year_month = $year . $xxxxx;
|
227 |
-
$p = (int)substr($date_year_month, 4, 2);
|
228 |
-
if ((int)substr($date_year_month, 0, 4) != (int)substr($date_end_year_month, 0, 4))
|
229 |
-
$end = (int)substr($date_end_year_month, 4, 2) + 12;
|
230 |
-
else
|
231 |
-
$end = (int)substr($date_end_year_month, 4, 2);
|
232 |
-
for ($k = 1; $k <= $end; $k++) {
|
233 |
-
if ((int)$month == $p and $rows[$i - 1]->month_type == 1) {
|
234 |
-
$date_days[0] = $rows[$i - 1]->month;
|
235 |
-
}
|
236 |
-
if ($p == (int)$month and $rows[$i - 1]->month_type == 2) {
|
237 |
-
if ($rows[$i - 1]->monthly_list != 'last') {
|
238 |
-
for ($j = $rows[$i - 1]->monthly_list; $j < $rows[$i - 1]->monthly_list + 7; $j++) {
|
239 |
-
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
240 |
-
if ($j >= $date_day) {
|
241 |
-
$date_days[0] = $j;
|
242 |
-
}
|
243 |
-
}
|
244 |
-
}
|
245 |
-
}
|
246 |
-
else {
|
247 |
-
for ($j = 1; $j <= $month_days; $j++) {
|
248 |
-
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
249 |
-
if ($j >= $date_day) {
|
250 |
-
$date_days[0] = $j;
|
251 |
-
}
|
252 |
-
}
|
253 |
-
}
|
254 |
-
}
|
255 |
-
}
|
256 |
-
if ($year > (int)substr($date_year_month, 0, 4)) {
|
257 |
-
$p = 1;
|
258 |
-
}
|
259 |
-
$p = $p + $repeat;
|
260 |
-
}
|
261 |
-
$repeat = 32;
|
262 |
-
}
|
263 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
264 |
-
//////////////////////// Repeat Yearly ///////////////////////////////////////////////////////////////////////////////////////////
|
265 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
266 |
-
if ($rows[$i - 1]->repeat_method == 'yearly') {
|
267 |
-
$month_days = date('t', mktime(0, 0, 0, $month, $date_day, $year));
|
268 |
-
$end = substr($date_end_year_month, 0, 4) - substr($date_year_month, 0, 4) + 1;
|
269 |
-
if (substr($date_year_month, 0, 4) < $year) {
|
270 |
-
$date_day = 1;
|
271 |
-
}
|
272 |
-
for ($k = 0; $k <= $end; $k += $repeat) {
|
273 |
-
if ((int)$month == $rows[$i - 1]->year_month and $rows[$i - 1]->month_type == 1 and $year == substr($date_year_month, 0, 4) + $k) {
|
274 |
-
$date_days[0] = $rows[$i - 1]->month;
|
275 |
-
}
|
276 |
-
}
|
277 |
-
for ($k = 0; $k <= $end; $k += $repeat) {
|
278 |
-
if ((int)$month == $rows[$i - 1]->year_month and $rows[$i - 1]->month_type == 2 and $year == substr($date_year_month, 0, 4) + $k) {
|
279 |
-
if ($rows[$i - 1]->monthly_list != 'last') {
|
280 |
-
for ($j = $rows[$i - 1]->monthly_list; $j < $rows[$i - 1]->monthly_list + 7; $j++) {
|
281 |
-
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
282 |
-
$date_days[0] = $j;
|
283 |
-
}
|
284 |
-
}
|
285 |
-
}
|
286 |
-
else {
|
287 |
-
for ($j = 1; $j <= $month_days; $j++) {
|
288 |
-
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
289 |
-
$date_days[0] = $j;
|
290 |
-
}
|
291 |
-
}
|
292 |
-
}
|
293 |
-
}
|
294 |
-
}
|
295 |
-
$repeat = 32;
|
296 |
-
}
|
297 |
-
$used = array();
|
298 |
-
foreach ($date_days as $date_day) {
|
299 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
300 |
-
//////////////////////// Convert am/pm ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
301 |
-
/* */
|
302 |
-
|
303 |
-
if ($date_month == $month) {
|
304 |
-
if (in_array($date_day, $used)) {
|
305 |
-
continue;
|
306 |
-
}
|
307 |
-
else {
|
308 |
-
array_push($used, $date_day);
|
309 |
-
}
|
310 |
-
if (in_array($date_day, $array_days)) {
|
311 |
-
$key = array_search($date_day, $array_days);
|
312 |
-
$title_num[$date_day]++;
|
313 |
-
if ($rows[$i - 1]->text_for_date != "")
|
314 |
-
$array_days1[$key] = $date_day;
|
315 |
-
$c = $title_num[$date_day];
|
316 |
-
$list = '<p>' . (($show_numbers_for_events and $day_start) ? '' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '') : '');
|
317 |
-
|
318 |
-
|
319 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
320 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
321 |
-
}
|
322 |
-
else {
|
323 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
324 |
-
}
|
325 |
-
$title[$date_day] = $title[$date_day] . $list;
|
326 |
-
$ev_ids[$date_day] = $ev_ids[$date_day] . $rows[$i - 1]->id . '<br>';
|
327 |
-
}
|
328 |
-
else {
|
329 |
-
|
330 |
-
$array_days[] = $date_day;
|
331 |
-
$key = array_search($date_day, $array_days);
|
332 |
-
if ($rows[$i - 1]->text_for_date != "")
|
333 |
-
$array_days1[$key] = $date_day;
|
334 |
-
$title_num[$date_day] = 1;
|
335 |
-
$c = 1;
|
336 |
-
|
337 |
-
$list = '<p>' . (($show_numbers_for_events and $day_start) ? '<b>' . $c . '.</b> ' : '');
|
338 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
339 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
340 |
-
}
|
341 |
-
else {
|
342 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
343 |
-
}
|
344 |
-
$title[$date_day] = $list;
|
345 |
-
$ev_ids[$date_day] = $rows[$i - 1]->id . '<br>';
|
346 |
-
}
|
347 |
-
}
|
348 |
-
if ($date_end_month > 0 and $date_year_month == $date_end_year_month and $date_end_year_month == $year_month)
|
349 |
-
for ($j = $date_day; $j <= $date_end_day; $j = $j + $repeat) {
|
350 |
-
if (in_array($j, $used)) {
|
351 |
-
continue;
|
352 |
-
}
|
353 |
-
else {
|
354 |
-
array_push($used, $j);
|
355 |
-
}
|
356 |
-
if (in_array($j, $array_days)) {
|
357 |
-
$key = array_search($j, $array_days);
|
358 |
-
$title_num[$j]++;
|
359 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
360 |
-
$array_days1[$key] = $j;
|
361 |
-
}
|
362 |
-
$c = $title_num[$j];
|
363 |
-
$list = '<p>' . (($show_numbers_for_events and $day_start) ? '<b>' . $c . '.</b> ' : '');
|
364 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
365 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
366 |
-
}
|
367 |
-
else {
|
368 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
369 |
-
}
|
370 |
-
$title[$j] = $title[$j] . $list;
|
371 |
-
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
372 |
-
}
|
373 |
-
else {
|
374 |
-
$array_days[] = $j;
|
375 |
-
$key = array_search($j, $array_days);
|
376 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
377 |
-
$array_days1[$key] = $j;
|
378 |
-
}
|
379 |
-
$title_num[$j] = 1;
|
380 |
-
$c = 1;
|
381 |
-
$list = '<p>' . (($show_numbers_for_events and $day_start) ? '<b>' . $c . '.</b> ' : '');
|
382 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
383 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
384 |
-
}
|
385 |
-
else {
|
386 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
387 |
-
}
|
388 |
-
$title[$j] = $list;
|
389 |
-
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
390 |
-
}
|
391 |
-
}
|
392 |
-
if ($date_end_month > 0 and $date_year_month < $date_end_year_month and $date_year_month == $year_month)
|
393 |
-
for ($j = $date_day; $j <= 31; $j = $j + $repeat) {
|
394 |
-
if (in_array($j, $used)) {
|
395 |
-
continue;
|
396 |
-
}
|
397 |
-
else {
|
398 |
-
array_push($used, $j);
|
399 |
-
}
|
400 |
-
if (in_array($j, $array_days)) {
|
401 |
-
$key = array_search($j, $array_days);
|
402 |
-
$title_num[$j]++;
|
403 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
404 |
-
$array_days1[$key] = $j;
|
405 |
-
}
|
406 |
-
$c = $title_num[$j];
|
407 |
-
$list = '<p>' . (($show_numbers_for_events and $day_start) ? '<b>' . $c . '.</b> ' : '');
|
408 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
409 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
410 |
-
}
|
411 |
-
else {
|
412 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
413 |
-
}
|
414 |
-
$title[$j] = $title[$j] . $list;
|
415 |
-
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
416 |
-
}
|
417 |
-
else {
|
418 |
-
$array_days[] = $j;
|
419 |
-
$key = array_search($j, $array_days);
|
420 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
421 |
-
$array_days1[$key] = $j;
|
422 |
-
}
|
423 |
-
$title_num[$j] = 1;
|
424 |
-
$c = 1;
|
425 |
-
$list = '<p>' . (($show_numbers_for_events and $day_start) ? '<b>' . $c . '.</b> ' : '');
|
426 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
427 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
428 |
-
}
|
429 |
-
else {
|
430 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
431 |
-
}
|
432 |
-
$title[$j] = $list;
|
433 |
-
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
434 |
-
}
|
435 |
-
}
|
436 |
-
if ($date_end_month > 0 and $date_year_month < $date_end_year_month and $date_end_year_month == $year_month)
|
437 |
-
for ($j = $date_day; $j <= $date_end_day; $j = $j + $repeat) {
|
438 |
-
if (in_array($j, $used)) {
|
439 |
-
continue;
|
440 |
-
}
|
441 |
-
else {
|
442 |
-
array_push($used, $j);
|
443 |
-
}
|
444 |
-
if (in_array($j, $array_days)) {
|
445 |
-
$key = array_search($j, $array_days);
|
446 |
-
$title_num[$j]++;
|
447 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
448 |
-
$array_days1[$key] = $j;
|
449 |
-
}
|
450 |
-
$c = $title_num[$j];
|
451 |
-
$list = '<p>' . (($show_numbers_for_events and $day_start) ? '<b>' . $c . '.</b> ' : '');
|
452 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
453 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
454 |
-
}
|
455 |
-
else {
|
456 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
457 |
-
}
|
458 |
-
$title[$j] = $title[$j] . $list;
|
459 |
-
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
460 |
-
}
|
461 |
-
else {
|
462 |
-
$array_days[] = $j;
|
463 |
-
$key = array_search($j, $array_days);
|
464 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
465 |
-
$array_days1[$key] = $j;
|
466 |
-
}
|
467 |
-
$title_num[$j] = 1;
|
468 |
-
$c = 1;
|
469 |
-
$list = '<p>' . (($show_numbers_for_events and $d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|