Version Description
bug fixed
Download this release
Release Info
Developer | webdorado |
Plugin | Calendar by WD – Responsive Event Calendar |
Version | 1.4.10 |
Comparing to | |
See all releases |
Code changes from version 1.4.9 to 1.4.10
- Theme_functions.php +518 -512
- calendar.php +1 -1
- calendar_functions.html.php +2280 -2280
- calendar_functions.php +689 -673
- front_end/bigcalendarday.php +1011 -1009
- front_end/bigcalendarday_widget.php +709 -708
- front_end/bigcalendarlist.php +961 -959
- front_end/bigcalendarlist_widget.php +667 -666
- front_end/bigcalendarmonth.php +1297 -1297
- front_end/bigcalendarmonth_widget.php +987 -987
- front_end/bigcalendarweek.php +1035 -1032
- front_end/bigcalendarweek_widget.php +745 -744
- front_end/frontend_functions.php +776 -1132
Theme_functions.php
CHANGED
@@ -1,513 +1,519 @@
|
|
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 = " ORDER BY title ASC";
|
13 |
-
$sort["default_style"] = "manage-column column-autor sortable desc";
|
14 |
-
$sort["sortid_by"] = "title";
|
15 |
-
$sort["custom_style"] = "manage-column column-title sorted asc";
|
16 |
-
$sort["1_or_2"] = "2";
|
17 |
-
if (isset($_POST['page_number'])) {
|
18 |
-
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
19 |
-
$sort["sortid_by"] = esc_html($_POST['order_by']);
|
20 |
-
}
|
21 |
-
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
22 |
-
$sort["custom_style"] = "manage-column column-title sorted asc";
|
23 |
-
$sort["1_or_2"] = "2";
|
24 |
-
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
25 |
-
}
|
26 |
-
else {
|
27 |
-
$sort["custom_style"] = "manage-column column-title sorted desc";
|
28 |
-
$sort["1_or_2"] = "1";
|
29 |
-
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
30 |
-
}
|
31 |
-
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
32 |
-
$limit = (esc_html($_POST['page_number']) - 1) * 20;
|
33 |
-
}
|
34 |
-
else {
|
35 |
-
$limit = 0;
|
36 |
-
}
|
37 |
-
}
|
38 |
-
else {
|
39 |
-
$limit = 0;
|
40 |
-
}
|
41 |
-
if (isset($_POST['search_events_by_title'])) {
|
42 |
-
$search_tag = esc_html($_POST['search_events_by_title']);
|
43 |
-
}
|
44 |
-
else {
|
45 |
-
$search_tag = "";
|
46 |
-
}
|
47 |
-
if ($search_tag) {
|
48 |
-
$where = ' WHERE title LIKE "
|
49 |
-
}
|
50 |
-
else {
|
51 |
-
$where = '';
|
52 |
-
}
|
53 |
-
// get the total number of records
|
54 |
-
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_theme" .
|
55 |
-
$total = $wpdb->get_var($query);
|
56 |
-
$pageNav['total'] = $total;
|
57 |
-
$pageNav['limit'] = $limit / 20 + 1;
|
58 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_theme" . $where . " " . $order . " " . " LIMIT
|
59 |
-
$rows = $wpdb->get_results($query);
|
60 |
-
html_show_theme_calendar($rows, $pageNav, $sort);
|
61 |
-
}
|
62 |
-
|
63 |
-
function apply_theme_calendar($id) {
|
64 |
-
global $wpdb;
|
65 |
-
$title = ((isset($_POST["title"])) ? esc_html(stripslashes($_POST["title"])) : '');
|
66 |
-
$width = ((isset($_POST["width"])) ? esc_html($_POST["width"]) : '');
|
67 |
-
$week_start_day = ((isset($_POST["week_start_day"])) ? esc_html($_POST["week_start_day"]) : '');
|
68 |
-
$border_color = ((isset($_POST["border_color"])) ? esc_html($_POST["border_color"]) : '');
|
69 |
-
$border_radius = ((isset($_POST["border_radius"])) ? esc_html($_POST["border_radius"]) : '');
|
70 |
-
$border_width = ((isset($_POST["border_width"])) ? esc_html($_POST["border_width"]) : '');
|
71 |
-
$
|
72 |
-
$
|
73 |
-
$
|
74 |
-
$
|
75 |
-
$
|
76 |
-
$
|
77 |
-
$
|
78 |
-
$
|
79 |
-
$
|
80 |
-
$
|
81 |
-
$
|
82 |
-
$
|
83 |
-
$
|
84 |
-
$
|
85 |
-
$
|
86 |
-
$
|
87 |
-
$
|
88 |
-
$
|
89 |
-
$
|
90 |
-
$
|
91 |
-
$
|
92 |
-
$
|
93 |
-
$
|
94 |
-
$
|
95 |
-
$
|
96 |
-
$
|
97 |
-
$
|
98 |
-
$
|
99 |
-
$
|
100 |
-
$
|
101 |
-
$
|
102 |
-
$
|
103 |
-
$
|
104 |
-
$
|
105 |
-
$
|
106 |
-
$
|
107 |
-
$
|
108 |
-
$
|
109 |
-
$
|
110 |
-
$
|
111 |
-
$
|
112 |
-
$
|
113 |
-
$
|
114 |
-
$
|
115 |
-
$
|
116 |
-
$
|
117 |
-
$
|
118 |
-
$
|
119 |
-
$
|
120 |
-
$
|
121 |
-
$
|
122 |
-
$
|
123 |
-
$
|
124 |
-
$
|
125 |
-
$
|
126 |
-
$
|
127 |
-
$
|
128 |
-
$
|
129 |
-
$
|
130 |
-
$
|
131 |
-
$
|
132 |
-
$
|
133 |
-
$
|
134 |
-
$
|
135 |
-
$
|
136 |
-
$
|
137 |
-
$
|
138 |
-
$
|
139 |
-
$
|
140 |
-
$
|
141 |
-
$
|
142 |
-
$
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
'
|
147 |
-
'
|
148 |
-
'
|
149 |
-
'
|
150 |
-
'
|
151 |
-
'
|
152 |
-
'
|
153 |
-
|
154 |
-
'
|
155 |
-
'
|
156 |
-
'
|
157 |
-
'
|
158 |
-
'
|
159 |
-
'
|
160 |
-
'
|
161 |
-
'
|
162 |
-
'
|
163 |
-
'
|
164 |
-
'
|
165 |
-
'
|
166 |
-
'
|
167 |
-
'
|
168 |
-
'
|
169 |
-
'
|
170 |
-
'
|
171 |
-
'
|
172 |
-
'
|
173 |
-
'
|
174 |
-
'
|
175 |
-
'
|
176 |
-
'
|
177 |
-
'
|
178 |
-
'
|
179 |
-
'
|
180 |
-
'
|
181 |
-
'
|
182 |
-
'
|
183 |
-
'
|
184 |
-
'
|
185 |
-
'
|
186 |
-
'
|
187 |
-
'
|
188 |
-
'
|
189 |
-
'
|
190 |
-
'
|
191 |
-
'
|
192 |
-
'
|
193 |
-
'
|
194 |
-
'
|
195 |
-
'
|
196 |
-
'
|
197 |
-
'
|
198 |
-
'
|
199 |
-
'
|
200 |
-
'
|
201 |
-
'
|
202 |
-
'
|
203 |
-
'
|
204 |
-
'
|
205 |
-
'
|
206 |
-
'
|
207 |
-
'
|
208 |
-
'
|
209 |
-
'
|
210 |
-
'
|
211 |
-
'
|
212 |
-
'
|
213 |
-
'
|
214 |
-
'
|
215 |
-
'
|
216 |
-
'
|
217 |
-
'
|
218 |
-
'
|
219 |
-
'
|
220 |
-
'
|
221 |
-
'
|
222 |
-
'
|
223 |
-
'
|
224 |
-
|
225 |
-
'
|
226 |
-
|
227 |
-
'%
|
228 |
-
'%s',
|
229 |
-
'%s',
|
230 |
-
'%s',
|
231 |
-
'%s',
|
232 |
-
'%s',
|
233 |
-
'%s',
|
234 |
-
|
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 |
-
'%s',
|
255 |
-
'%s',
|
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 |
-
'%s',
|
276 |
-
'%s',
|
277 |
-
'%s',
|
278 |
-
'%s',
|
279 |
-
'%s',
|
280 |
-
'%s',
|
281 |
-
'%s',
|
282 |
-
'%
|
283 |
-
'%
|
284 |
-
'%s',
|
285 |
-
'%
|
286 |
-
'%
|
287 |
-
'%s',
|
288 |
-
'%s',
|
289 |
-
'%s',
|
290 |
-
'%s',
|
291 |
-
'%s',
|
292 |
-
'%s',
|
293 |
-
'%s',
|
294 |
-
'%s',
|
295 |
-
'%s',
|
296 |
-
'%s',
|
297 |
-
'%s',
|
298 |
-
'%s',
|
299 |
-
'%s',
|
300 |
-
'%s',
|
301 |
-
'%s',
|
302 |
-
'%s',
|
303 |
-
'%
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
'
|
313 |
-
'
|
314 |
-
'
|
315 |
-
'
|
316 |
-
'
|
317 |
-
'
|
318 |
-
'
|
319 |
-
'
|
320 |
-
'
|
321 |
-
'
|
322 |
-
'
|
323 |
-
'
|
324 |
-
'
|
325 |
-
'
|
326 |
-
'
|
327 |
-
'
|
328 |
-
'
|
329 |
-
'
|
330 |
-
'
|
331 |
-
'
|
332 |
-
'
|
333 |
-
'
|
334 |
-
'
|
335 |
-
'
|
336 |
-
'
|
337 |
-
'
|
338 |
-
'
|
339 |
-
'
|
340 |
-
'
|
341 |
-
'
|
342 |
-
'
|
343 |
-
'
|
344 |
-
'
|
345 |
-
'
|
346 |
-
'
|
347 |
-
'
|
348 |
-
'
|
349 |
-
'
|
350 |
-
'
|
351 |
-
'
|
352 |
-
'
|
353 |
-
'
|
354 |
-
'
|
355 |
-
'
|
356 |
-
'
|
357 |
-
'
|
358 |
-
'
|
359 |
-
'
|
360 |
-
'
|
361 |
-
'
|
362 |
-
'
|
363 |
-
'
|
364 |
-
'
|
365 |
-
'
|
366 |
-
'
|
367 |
-
'
|
368 |
-
'
|
369 |
-
'
|
370 |
-
'
|
371 |
-
'
|
372 |
-
'
|
373 |
-
'
|
374 |
-
'
|
375 |
-
'
|
376 |
-
'
|
377 |
-
'
|
378 |
-
'
|
379 |
-
'
|
380 |
-
'
|
381 |
-
'
|
382 |
-
'
|
383 |
-
'
|
384 |
-
'
|
385 |
-
'
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
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 |
-
'%s',
|
418 |
-
'%s',
|
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 |
-
'%s',
|
439 |
-
'%s',
|
440 |
-
'%s',
|
441 |
-
'%s',
|
442 |
-
'%s',
|
443 |
-
'%
|
444 |
-
'%
|
445 |
-
'%s',
|
446 |
-
'%s',
|
447 |
-
'%s',
|
448 |
-
'%
|
449 |
-
'%
|
450 |
-
'%s',
|
451 |
-
'%s',
|
452 |
-
'%s',
|
453 |
-
'%s',
|
454 |
-
'%s',
|
455 |
-
'%s',
|
456 |
-
'%s',
|
457 |
-
'%s',
|
458 |
-
'%s',
|
459 |
-
'%s',
|
460 |
-
'%s',
|
461 |
-
'%s',
|
462 |
-
'%s',
|
463 |
-
'%s',
|
464 |
-
'%
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
}
|
473 |
-
|
474 |
-
?>
|
475 |
-
<div class="updated"><p><strong>
|
476 |
-
<?php
|
477 |
-
return
|
478 |
-
}
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
}
|
512 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
?>
|
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 = " ORDER BY title ASC";
|
13 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
14 |
+
$sort["sortid_by"] = "title";
|
15 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
16 |
+
$sort["1_or_2"] = "2";
|
17 |
+
if (isset($_POST['page_number'])) {
|
18 |
+
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
19 |
+
$sort["sortid_by"] = esc_sql(esc_html($_POST['order_by']));
|
20 |
+
}
|
21 |
+
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
22 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
23 |
+
$sort["1_or_2"] = "2";
|
24 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
25 |
+
}
|
26 |
+
else {
|
27 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
28 |
+
$sort["1_or_2"] = "1";
|
29 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
30 |
+
}
|
31 |
+
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
32 |
+
$limit = (esc_html($_POST['page_number']) - 1) * 20;
|
33 |
+
}
|
34 |
+
else {
|
35 |
+
$limit = 0;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
else {
|
39 |
+
$limit = 0;
|
40 |
+
}
|
41 |
+
if (isset($_POST['search_events_by_title'])) {
|
42 |
+
$search_tag = esc_html($_POST['search_events_by_title']);
|
43 |
+
}
|
44 |
+
else {
|
45 |
+
$search_tag = "";
|
46 |
+
}
|
47 |
+
if ($search_tag) {
|
48 |
+
$where = ' WHERE title LIKE "%%' . like_escape($search_tag) . '%%"';
|
49 |
+
}
|
50 |
+
else {
|
51 |
+
$where = '';
|
52 |
+
}
|
53 |
+
// get the total number of records
|
54 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_theme" . str_replace('%%','%',$where);
|
55 |
+
$total = $wpdb->get_var($query);
|
56 |
+
$pageNav['total'] = $total;
|
57 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
58 |
+
$query = $wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_theme" . $where . " " . $order . " " . " LIMIT %d,20",$limit);
|
59 |
+
$rows = $wpdb->get_results( $query);
|
60 |
+
html_show_theme_calendar($rows, $pageNav, $sort);
|
61 |
+
}
|
62 |
+
|
63 |
+
function apply_theme_calendar($id) {
|
64 |
+
global $wpdb;
|
65 |
+
$title = ((isset($_POST["title"])) ? esc_html(stripslashes($_POST["title"])) : '');
|
66 |
+
$width = ((isset($_POST["width"])) ? esc_html($_POST["width"]) : '');
|
67 |
+
$week_start_day = ((isset($_POST["week_start_day"])) ? esc_html($_POST["week_start_day"]) : '');
|
68 |
+
$border_color = ((isset($_POST["border_color"])) ? esc_html($_POST["border_color"]) : '');
|
69 |
+
$border_radius = ((isset($_POST["border_radius"])) ? esc_html($_POST["border_radius"]) : '');
|
70 |
+
$border_width = ((isset($_POST["border_width"])) ? esc_html($_POST["border_width"]) : '');
|
71 |
+
$show_cat = ((isset($_POST["show_cat"])) ? esc_html($_POST["show_cat"]) : '');
|
72 |
+
$top_height = ((isset($_POST["top_height"])) ? esc_html($_POST["top_height"]) : '');
|
73 |
+
$bg_top = ((isset($_POST["bg_top"])) ? esc_html($_POST["bg_top"]) : '');
|
74 |
+
$year_font_size = ((isset($_POST["year_font_size"])) ? esc_html($_POST["year_font_size"]) : '');
|
75 |
+
$text_color_year = ((isset($_POST["text_color_year"])) ? esc_html($_POST["text_color_year"]) : '');
|
76 |
+
$arrow_color_year = ((isset($_POST["arrow_color_year"])) ? esc_html($_POST["arrow_color_year"]) : '');
|
77 |
+
$month_type = ((isset($_POST["month_type"])) ? esc_html($_POST["month_type"]) : '');
|
78 |
+
$month_font_size = ((isset($_POST["month_font_size"])) ? esc_html($_POST["month_font_size"]) : '');
|
79 |
+
$text_color_month = ((isset($_POST["text_color_month"])) ? esc_html($_POST["text_color_month"]) : '');
|
80 |
+
$arrow_color_month = ((isset($_POST["arrow_color_month"])) ? esc_html($_POST["arrow_color_month"]) : '');
|
81 |
+
$next_month_text_color = ((isset($_POST["next_month_text_color"])) ? esc_html($_POST["next_month_text_color"]) : '');
|
82 |
+
$next_month_font_size = ((isset($_POST["next_month_font_size"])) ? esc_html($_POST["next_month_font_size"]) : '');
|
83 |
+
$next_month_arrow_color = ((isset($_POST["next_month_arrow_color"])) ? esc_html($_POST["next_month_arrow_color"]) : '');
|
84 |
+
$prev_month_text_color = ((isset($_POST["prev_month_text_color"])) ? esc_html($_POST["prev_month_text_color"]) : '');
|
85 |
+
$prev_month_font_size = ((isset($_POST["prev_month_font_size"])) ? esc_html($_POST["prev_month_font_size"]) : '');
|
86 |
+
$prev_month_arrow_color = ((isset($_POST["prev_month_arrow_color"])) ? esc_html($_POST["prev_month_arrow_color"]) : '');
|
87 |
+
$arrow_size = ((isset($_POST["arrow_size"])) ? esc_html($_POST["arrow_size"]) : '');
|
88 |
+
$text_color_week_days = ((isset($_POST["text_color_week_days"])) ? esc_html($_POST["text_color_week_days"]) : '');
|
89 |
+
$week_days_cell_height = ((isset($_POST["week_days_cell_height"])) ? esc_html($_POST["week_days_cell_height"]) : '');
|
90 |
+
$weekdays_bg_color = ((isset($_POST["weekdays_bg_color"])) ? esc_html($_POST["weekdays_bg_color"]) : '');
|
91 |
+
$weekday_sunday_bg_color = ((isset($_POST["weekday_sunday_bg_color"])) ? esc_html($_POST["weekday_sunday_bg_color"]) : '');
|
92 |
+
$weekdays_font_size = ((isset($_POST["weekdays_font_size"])) ? esc_html($_POST["weekdays_font_size"]) : '');
|
93 |
+
$bg_bottom = ((isset($_POST["bg_bottom"])) ? esc_html($_POST["bg_bottom"]) : '');
|
94 |
+
$cell_height = ((isset($_POST["cell_height"])) ? esc_html($_POST["cell_height"]) : '');
|
95 |
+
$text_color_other_months = ((isset($_POST["text_color_other_months"])) ? esc_html($_POST["text_color_other_months"]) : '');
|
96 |
+
$bg_color_other_months = ((isset($_POST["bg_color_other_months"])) ? esc_html($_POST["bg_color_other_months"]) : '');
|
97 |
+
$text_color_this_month_unevented = ((isset($_POST["text_color_this_month_unevented"])) ? esc_html($_POST["text_color_this_month_unevented"]) : '');
|
98 |
+
$text_color_this_month_evented = ((isset($_POST["text_color_this_month_evented"])) ? esc_html($_POST["text_color_this_month_evented"]) : '');
|
99 |
+
$bg_color_this_month_evented = ((isset($_POST["bg_color_this_month_evented"])) ? esc_html($_POST["bg_color_this_month_evented"]) : '');
|
100 |
+
$event_title_color = ((isset($_POST["event_title_color"])) ? esc_html($_POST["event_title_color"]) : '');
|
101 |
+
$current_day_border_color = ((isset($_POST["current_day_border_color"])) ? esc_html($_POST["current_day_border_color"]) : '');
|
102 |
+
$cell_border_color = ((isset($_POST["cell_border_color"])) ? esc_html($_POST["cell_border_color"]) : '');
|
103 |
+
$text_color_sun_days = ((isset($_POST["text_color_sun_days"])) ? esc_html($_POST["text_color_sun_days"]) : '');
|
104 |
+
$sundays_bg_color = ((isset($_POST["sundays_bg_color"])) ? esc_html($_POST["sundays_bg_color"]) : '');
|
105 |
+
$sundays_font_size = ((isset($_POST["sundays_font_size"])) ? esc_html($_POST["sundays_font_size"]) : '');
|
106 |
+
$other_days_font_size = ((isset($_POST["other_days_font_size"])) ? esc_html($_POST["other_days_font_size"]) : '');
|
107 |
+
$show_time = ((isset($_POST["show_time"])) ? esc_html($_POST["show_time"]) : '');
|
108 |
+
$show_event = ((isset($_POST["show_event"])) ? esc_html($_POST["show_event"]) : '');
|
109 |
+
$date_format = ((isset($_POST["date_format"])) ? esc_html($_POST["date_format"]) : '');
|
110 |
+
$title_color = ((isset($_POST["title_color"])) ? esc_html($_POST["title_color"]) : '');
|
111 |
+
$title_font_size = ((isset($_POST["title_font_size"])) ? esc_html($_POST["title_font_size"]) : '');
|
112 |
+
$title_font = ((isset($_POST["title_font"])) ? esc_html($_POST["title_font"]) : '');
|
113 |
+
$title_style = ((isset($_POST["title_style"])) ? esc_html($_POST["title_style"]) : '');
|
114 |
+
$date_color = ((isset($_POST["date_color"])) ? esc_html($_POST["date_color"]) : '');
|
115 |
+
$date_size = ((isset($_POST["date_size"])) ? esc_html($_POST["date_size"]) : '');
|
116 |
+
$date_font = ((isset($_POST["date_font"])) ? esc_html($_POST["date_font"]) : '');
|
117 |
+
$date_style = ((isset($_POST["date_style"])) ? esc_html($_POST["date_style"]) : '');
|
118 |
+
$next_prev_event_bgcolor = ((isset($_POST["next_prev_event_bgcolor"])) ? esc_html($_POST["next_prev_event_bgcolor"]) : '');
|
119 |
+
$next_prev_event_arrowcolor = ((isset($_POST["next_prev_event_arrowcolor"])) ? esc_html($_POST["next_prev_event_arrowcolor"]) : '');
|
120 |
+
$show_event_bgcolor = ((isset($_POST["show_event_bgcolor"])) ? esc_html($_POST["show_event_bgcolor"]) : '');
|
121 |
+
$popup_width = ((isset($_POST["popup_width"])) ? esc_html($_POST["popup_width"]) : '');
|
122 |
+
$popup_height = ((isset($_POST["popup_height"])) ? esc_html($_POST["popup_height"]) : '');
|
123 |
+
$number_of_shown_evetns = ((isset($_POST["number_of_shown_evetns"])) ? esc_html($_POST["number_of_shown_evetns"]) : '');
|
124 |
+
$show_repeat = ((isset($_POST["show_repeat"])) ? esc_html($_POST["show_repeat"]) : '');
|
125 |
+
$day_start = ((isset($_POST["show_event"])) ? esc_html($_POST["show_event"]) : '');
|
126 |
+
$views_tabs_font_size = ((isset($_POST["views_tabs_font_size"])) ? esc_html($_POST["views_tabs_font_size"]) : '');
|
127 |
+
$views_tabs_text_color = ((isset($_POST["views_tabs_text_color"])) ? esc_html($_POST["views_tabs_text_color"]) : '');
|
128 |
+
$views_tabs_bg_color = ((isset($_POST["views_tabs_bg_color"])) ? esc_html($_POST["views_tabs_bg_color"]) : '');
|
129 |
+
$day_month_font_color = ((isset($_POST["day_month_font_color"])) ? esc_html($_POST["day_month_font_color"]) : '');
|
130 |
+
$week_font_color = ((isset($_POST["week_font_color"])) ? esc_html($_POST["week_font_color"]) : '');
|
131 |
+
$day_month_font_size = ((isset($_POST["day_month_font_size"])) ? esc_html($_POST["day_month_font_size"]) : '');
|
132 |
+
$week_font_size = ((isset($_POST["week_font_size"])) ? esc_html($_POST["week_font_size"]) : '');
|
133 |
+
$ev_title_bg_color = ((isset($_POST["ev_title_bg_color"])) ? esc_html($_POST["ev_title_bg_color"]) : '');
|
134 |
+
$date_height = ((isset($_POST["date_height"])) ? esc_html($_POST["date_height"]) : '');
|
135 |
+
$event_table_height = ((isset($_POST["event_table_height"])) ? esc_html($_POST["event_table_height"]) : '');
|
136 |
+
$event_num_font_size = ((isset($_POST["event_num_font_size"])) ? esc_html($_POST["event_num_font_size"]) : '');
|
137 |
+
$date_font_size = ((isset($_POST["date_font_size"])) ? esc_html($_POST["date_font_size"]) : '');
|
138 |
+
$event_num_color = ((isset($_POST["event_num_color"])) ? esc_html($_POST["event_num_color"]) : '');
|
139 |
+
$event_num_bg_color2 = ((isset($_POST["event_num_bg_color2"])) ? esc_html($_POST["event_num_bg_color2"]) : '');
|
140 |
+
$event_num_bg_color1 = ((isset($_POST["event_num_bg_color1"])) ? esc_html($_POST["event_num_bg_color1"]) : '');
|
141 |
+
$event_bg_color2 = ((isset($_POST["event_bg_color2"])) ? esc_html($_POST["event_bg_color2"]) : '');
|
142 |
+
$event_bg_color1 = ((isset($_POST["event_bg_color1"])) ? esc_html($_POST["event_bg_color1"]) : '');
|
143 |
+
$date_bg_color = ((isset($_POST["date_bg_color"])) ? esc_html($_POST["date_bg_color"]) : '');
|
144 |
+
if ($id === -1) {
|
145 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_theme', array(
|
146 |
+
'id' => NULL,
|
147 |
+
'title' => $title,
|
148 |
+
'width' => $width,
|
149 |
+
'week_start_day' => $week_start_day,
|
150 |
+
'border_color' => $border_color,
|
151 |
+
'border_radius' => $border_radius,
|
152 |
+
'border_width' => $border_width,
|
153 |
+
'show_cat' => $show_cat,
|
154 |
+
'top_height' => $top_height,
|
155 |
+
'bg_top' => $bg_top,
|
156 |
+
'year_font_size' => $year_font_size,
|
157 |
+
'text_color_year' => $text_color_year,
|
158 |
+
'arrow_color_year' => $arrow_color_year,
|
159 |
+
'month_type' => $month_type,
|
160 |
+
'month_font_size' => $month_font_size,
|
161 |
+
'text_color_month' => $text_color_month,
|
162 |
+
'arrow_color_month' => $arrow_color_month,
|
163 |
+
'next_month_text_color' => $next_month_text_color,
|
164 |
+
'next_month_font_size' => $next_month_font_size,
|
165 |
+
'next_month_arrow_color' => $next_month_arrow_color,
|
166 |
+
'prev_month_text_color' => $prev_month_text_color,
|
167 |
+
'prev_month_font_size' => $prev_month_font_size,
|
168 |
+
'prev_month_arrow_color' => $prev_month_arrow_color,
|
169 |
+
'arrow_size' => $arrow_size,
|
170 |
+
'text_color_week_days' => $text_color_week_days,
|
171 |
+
'week_days_cell_height' => $week_days_cell_height,
|
172 |
+
'weekdays_bg_color' => $weekdays_bg_color,
|
173 |
+
'weekday_sunday_bg_color' => $weekday_sunday_bg_color,
|
174 |
+
'weekdays_font_size' => $weekdays_font_size,
|
175 |
+
'bg_bottom' => $bg_bottom,
|
176 |
+
'cell_height' => $cell_height,
|
177 |
+
'text_color_other_months' => $text_color_other_months,
|
178 |
+
'bg_color_other_months' => $bg_color_other_months,
|
179 |
+
'text_color_this_month_unevented' => $text_color_this_month_unevented,
|
180 |
+
'text_color_this_month_evented' => $text_color_this_month_evented,
|
181 |
+
'bg_color_this_month_evented' => $bg_color_this_month_evented,
|
182 |
+
'event_title_color' => $event_title_color,
|
183 |
+
'current_day_border_color' => $current_day_border_color,
|
184 |
+
'cell_border_color' => $cell_border_color,
|
185 |
+
'text_color_sun_days' => $text_color_sun_days,
|
186 |
+
'sundays_bg_color' => $sundays_bg_color,
|
187 |
+
'sundays_font_size' => $sundays_font_size,
|
188 |
+
'other_days_font_size' => $other_days_font_size,
|
189 |
+
'show_time' => $show_time,
|
190 |
+
'date_format' => $date_format,
|
191 |
+
'title_color' => $title_color,
|
192 |
+
'title_font_size' => $title_font_size,
|
193 |
+
'title_font' => $title_font,
|
194 |
+
'title_style' => $title_style,
|
195 |
+
'date_color' => $date_color,
|
196 |
+
'date_size' => $date_size,
|
197 |
+
'date_font' => $date_font,
|
198 |
+
'date_style' => $date_style,
|
199 |
+
'next_prev_event_bgcolor' => $next_prev_event_bgcolor,
|
200 |
+
'next_prev_event_arrowcolor' => $next_prev_event_arrowcolor,
|
201 |
+
'show_event_bgcolor' => $show_event_bgcolor,
|
202 |
+
'popup_width' => $popup_width,
|
203 |
+
'popup_height' => $popup_height,
|
204 |
+
'number_of_shown_evetns' => $number_of_shown_evetns,
|
205 |
+
'show_repeat' => $show_repeat,
|
206 |
+
'day_start' => $show_event,
|
207 |
+
'views_tabs_font_size' => $views_tabs_font_size,
|
208 |
+
'views_tabs_text_color' => $views_tabs_text_color,
|
209 |
+
'views_tabs_bg_color' => $views_tabs_bg_color,
|
210 |
+
'day_month_font_color' => $day_month_font_color,
|
211 |
+
'week_font_color' => $week_font_color,
|
212 |
+
'day_month_font_size' => $day_month_font_size,
|
213 |
+
'week_font_size' => $week_font_size,
|
214 |
+
'ev_title_bg_color' => $ev_title_bg_color,
|
215 |
+
'date_height' => $date_height,
|
216 |
+
'event_table_height' => $event_table_height,
|
217 |
+
'event_num_font_size' => $event_num_font_size,
|
218 |
+
'date_font_size' => $date_font_size,
|
219 |
+
'event_num_color' => $event_num_color,
|
220 |
+
'event_num_bg_color2' => $event_num_bg_color2,
|
221 |
+
'event_num_bg_color1' => $event_num_bg_color1,
|
222 |
+
'event_bg_color2' => $event_bg_color2,
|
223 |
+
'event_bg_color1' => $event_bg_color1,
|
224 |
+
'date_bg_color' => $date_bg_color,
|
225 |
+
'day_start' => $show_event,
|
226 |
+
), array(
|
227 |
+
'%d',
|
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 |
+
'%s',
|
255 |
+
'%s',
|
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 |
+
'%s',
|
276 |
+
'%s',
|
277 |
+
'%s',
|
278 |
+
'%s',
|
279 |
+
'%s',
|
280 |
+
'%s',
|
281 |
+
'%s',
|
282 |
+
'%s',
|
283 |
+
'%s',
|
284 |
+
'%s',
|
285 |
+
'%d',
|
286 |
+
'%d',
|
287 |
+
'%s',
|
288 |
+
'%s',
|
289 |
+
'%s',
|
290 |
+
'%s',
|
291 |
+
'%s',
|
292 |
+
'%s',
|
293 |
+
'%s',
|
294 |
+
'%s',
|
295 |
+
'%s',
|
296 |
+
'%s',
|
297 |
+
'%s',
|
298 |
+
'%s',
|
299 |
+
'%s',
|
300 |
+
'%s',
|
301 |
+
'%s',
|
302 |
+
'%s',
|
303 |
+
'%s',
|
304 |
+
'%s',
|
305 |
+
'%s',
|
306 |
+
'%d',
|
307 |
+
'%d'
|
308 |
+
));
|
309 |
+
}
|
310 |
+
else {
|
311 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_theme', array(
|
312 |
+
'title' => $title,
|
313 |
+
'width' => $width,
|
314 |
+
'week_start_day' => $week_start_day,
|
315 |
+
'border_color' => $border_color,
|
316 |
+
'border_radius' => $border_radius,
|
317 |
+
'border_width' => $border_width,
|
318 |
+
'top_height' => $top_height,
|
319 |
+
'bg_top' => $bg_top,
|
320 |
+
'year_font_size' => $year_font_size,
|
321 |
+
'text_color_year' => $text_color_year,
|
322 |
+
'arrow_color_year' => $arrow_color_year,
|
323 |
+
'month_type' => $month_type,
|
324 |
+
'month_font_size' => $month_font_size,
|
325 |
+
'text_color_month' => $text_color_month,
|
326 |
+
'arrow_color_month' => $arrow_color_month,
|
327 |
+
'next_month_text_color' => $next_month_text_color,
|
328 |
+
'next_month_font_size' => $next_month_font_size,
|
329 |
+
'next_month_arrow_color' => $next_month_arrow_color,
|
330 |
+
'prev_month_text_color' => $prev_month_text_color,
|
331 |
+
'prev_month_font_size' => $prev_month_font_size,
|
332 |
+
'prev_month_arrow_color' => $prev_month_arrow_color,
|
333 |
+
'arrow_size' => $arrow_size,
|
334 |
+
'text_color_week_days' => $text_color_week_days,
|
335 |
+
'week_days_cell_height' => $week_days_cell_height,
|
336 |
+
'weekdays_bg_color' => $weekdays_bg_color,
|
337 |
+
'weekday_sunday_bg_color' => $weekday_sunday_bg_color,
|
338 |
+
'weekdays_font_size' => $weekdays_font_size,
|
339 |
+
'bg_bottom' => $bg_bottom,
|
340 |
+
'cell_height' => $cell_height,
|
341 |
+
'text_color_other_months' => $text_color_other_months,
|
342 |
+
'bg_color_other_months' => $bg_color_other_months,
|
343 |
+
'text_color_this_month_unevented' => $text_color_this_month_unevented,
|
344 |
+
'text_color_this_month_evented' => $text_color_this_month_evented,
|
345 |
+
'bg_color_this_month_evented' => $bg_color_this_month_evented,
|
346 |
+
'event_title_color' => $event_title_color,
|
347 |
+
'current_day_border_color' => $current_day_border_color,
|
348 |
+
'cell_border_color' => $cell_border_color,
|
349 |
+
'text_color_sun_days' => $text_color_sun_days,
|
350 |
+
'sundays_bg_color' => $sundays_bg_color,
|
351 |
+
'sundays_font_size' => $sundays_font_size,
|
352 |
+
'other_days_font_size' => $other_days_font_size,
|
353 |
+
'show_time' => $show_time,
|
354 |
+
'date_format' => $date_format,
|
355 |
+
'title_color' => $title_color,
|
356 |
+
'title_font_size' => $title_font_size,
|
357 |
+
'title_font' => $title_font,
|
358 |
+
'title_style' => $title_style,
|
359 |
+
'date_color' => $date_color,
|
360 |
+
'date_size' => $date_size,
|
361 |
+
'date_font' => $date_font,
|
362 |
+
'date_style' => $date_style,
|
363 |
+
'next_prev_event_bgcolor' => $next_prev_event_bgcolor,
|
364 |
+
'next_prev_event_arrowcolor' => $next_prev_event_arrowcolor,
|
365 |
+
'show_event_bgcolor' => $show_event_bgcolor,
|
366 |
+
'popup_width' => $popup_width,
|
367 |
+
'popup_height' => $popup_height,
|
368 |
+
'number_of_shown_evetns' => $number_of_shown_evetns,
|
369 |
+
'show_repeat' => $show_repeat,
|
370 |
+
'day_start' => $show_event,
|
371 |
+
'views_tabs_font_size' => $views_tabs_font_size,
|
372 |
+
'views_tabs_text_color' => $views_tabs_text_color,
|
373 |
+
'views_tabs_bg_color' => $views_tabs_bg_color,
|
374 |
+
'day_month_font_color' => $day_month_font_color,
|
375 |
+
'week_font_color' => $week_font_color,
|
376 |
+
'day_month_font_size' => $day_month_font_size,
|
377 |
+
'week_font_size' => $week_font_size,
|
378 |
+
'ev_title_bg_color' => $ev_title_bg_color,
|
379 |
+
'date_height' => $date_height,
|
380 |
+
'event_table_height' => $event_table_height,
|
381 |
+
'event_num_font_size' => $event_num_font_size,
|
382 |
+
'date_font_size' => $date_font_size,
|
383 |
+
'event_num_color' => $event_num_color,
|
384 |
+
'event_num_bg_color2' => $event_num_bg_color2,
|
385 |
+
'event_num_bg_color1' => $event_num_bg_color1,
|
386 |
+
'event_bg_color2' => $event_bg_color2,
|
387 |
+
'event_bg_color1' => $event_bg_color1,
|
388 |
+
'date_bg_color' => $date_bg_color,
|
389 |
+
'day_start' => $show_event,
|
390 |
+
'show_cat' => $show_cat,
|
391 |
+
), array('id' => $id), array(
|
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 |
+
'%s',
|
418 |
+
'%s',
|
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 |
+
'%s',
|
439 |
+
'%s',
|
440 |
+
'%s',
|
441 |
+
'%s',
|
442 |
+
'%s',
|
443 |
+
'%s',
|
444 |
+
'%s',
|
445 |
+
'%s',
|
446 |
+
'%s',
|
447 |
+
'%s',
|
448 |
+
'%d',
|
449 |
+
'%d',
|
450 |
+
'%s',
|
451 |
+
'%s',
|
452 |
+
'%s',
|
453 |
+
'%s',
|
454 |
+
'%s',
|
455 |
+
'%s',
|
456 |
+
'%s',
|
457 |
+
'%s',
|
458 |
+
'%s',
|
459 |
+
'%s',
|
460 |
+
'%s',
|
461 |
+
'%s',
|
462 |
+
'%s',
|
463 |
+
'%s',
|
464 |
+
'%s',
|
465 |
+
'%s',
|
466 |
+
'%s',
|
467 |
+
'%s',
|
468 |
+
'%s',
|
469 |
+
'%d',
|
470 |
+
'%d',
|
471 |
+
), array('%d'));
|
472 |
+
}
|
473 |
+
if ($save_or_no === FALSE) {
|
474 |
+
?>
|
475 |
+
<div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
|
476 |
+
<?php
|
477 |
+
return FALSE;
|
478 |
+
}
|
479 |
+
else {
|
480 |
+
?>
|
481 |
+
<div class="updated"><p><strong>Theme Saved.</strong></p></div>
|
482 |
+
<?php
|
483 |
+
return TRUE;
|
484 |
+
}
|
485 |
+
}
|
486 |
+
|
487 |
+
function edit_theme_calendar($id) {
|
488 |
+
global $wpdb;
|
489 |
+
if ($id == 0) {
|
490 |
+
$row = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=1');
|
491 |
+
}
|
492 |
+
else {
|
493 |
+
$row = $wpdb->get_row($wpdb->prepare ('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d' , $id ));
|
494 |
+
}
|
495 |
+
html_edit_theme_calendar($row, $id);
|
496 |
+
}
|
497 |
+
|
498 |
+
function remove_theme_calendar($id) {
|
499 |
+
if ($id > 0 && $id < 18) {
|
500 |
+
?>
|
501 |
+
<div id="message" class="error"><p>You can't delete deafult theme.</p></div>
|
502 |
+
<?php
|
503 |
+
return FALSE;
|
504 |
+
}
|
505 |
+
global $wpdb;
|
506 |
+
$sql_remove_tag = $wpdb->prepare ( "DELETE FROM " . $wpdb->prefix . "spidercalendar_theme WHERE id=%d", $id );
|
507 |
+
if (!$wpdb->query($sql_remove_tag)) {
|
508 |
+
?>
|
509 |
+
<div id="message" class="error"><p>Spider Calendar Theme Not Deleted</p></div>
|
510 |
+
<?php
|
511 |
+
}
|
512 |
+
else {
|
513 |
+
?>
|
514 |
+
<div class="updated"><p><strong>Item Deleted.</strong></p></div>
|
515 |
+
<?php
|
516 |
+
}
|
517 |
+
}
|
518 |
+
|
519 |
?>
|
calendar.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Spider Event Calendar
|
5 |
Plugin URI: http://web-dorado.com/products/wordpress-calendar.html
|
6 |
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.
|
7 |
-
Version: 1.4.
|
8 |
Author: http://web-dorado.com/
|
9 |
License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
*/
|
4 |
Plugin Name: Spider Event Calendar
|
5 |
Plugin URI: http://web-dorado.com/products/wordpress-calendar.html
|
6 |
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.
|
7 |
+
Version: 1.4.10
|
8 |
Author: http://web-dorado.com/
|
9 |
License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
*/
|
calendar_functions.html.php
CHANGED
@@ -1,2281 +1,2281 @@
|
|
1 |
-
<?php
|
2 |
-
if (function_exists('current_user_can')) {
|
3 |
-
if (!current_user_can('manage_options')) {
|
4 |
-
die('Access Denied');
|
5 |
-
}
|
6 |
-
}
|
7 |
-
function html_show_spider_calendar($rows, $pageNav, $sort) {
|
8 |
-
?>
|
9 |
-
<script language="javascript">
|
10 |
-
function confirmation(href, title) {
|
11 |
-
var answer = confirm("Are you sure you want to delete '" + title + "'?")
|
12 |
-
if (answer) {
|
13 |
-
document.getElementById('admin_form').action = href;
|
14 |
-
document.getElementById('admin_form').submit();
|
15 |
-
}
|
16 |
-
}
|
17 |
-
function ordering(name, as_or_desc) {
|
18 |
-
document.getElementById('asc_or_desc').value = as_or_desc;
|
19 |
-
document.getElementById('order_by').value = name;
|
20 |
-
document.getElementById('admin_form').submit();
|
21 |
-
}
|
22 |
-
function submit_form_id(x) {
|
23 |
-
var val = x.options[x.selectedIndex].value;
|
24 |
-
document.getElementById("id_for_playlist").value = val;
|
25 |
-
document.getElementById("admin_form").submit();
|
26 |
-
}
|
27 |
-
function doNothing() {
|
28 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
29 |
-
if (keyCode == 13) {
|
30 |
-
if (!e) var e = window.event;
|
31 |
-
e.cancelBubble = true;
|
32 |
-
e.returnValue = false;
|
33 |
-
if (e.stopPropagation) {
|
34 |
-
e.stopPropagation();
|
35 |
-
e.preventDefault();
|
36 |
-
}
|
37 |
-
}
|
38 |
-
}
|
39 |
-
var show_one_cal = 1;
|
40 |
-
var get_cal_id = 0;
|
41 |
-
function show_calendar_inline(cal_id) {
|
42 |
-
if (show_one_cal == 1) {
|
43 |
-
show_one_cal = 0;
|
44 |
-
jQuery.ajax({
|
45 |
-
type:'POST',
|
46 |
-
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineedit') ?>',
|
47 |
-
data:{calendar_id:cal_id},
|
48 |
-
dataType:'html',
|
49 |
-
success:function (data) {
|
50 |
-
cancel_qiucik_edit(get_cal_id);
|
51 |
-
var edit_cal_tr = document.createElement("tr")
|
52 |
-
edit_cal_tr.innerHTML = data;
|
53 |
-
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')
|
54 |
-
edit_cal_tr.setAttribute('id', 'edit_calendar-' + cal_id);
|
55 |
-
|
56 |
-
document.getElementById('Calendar-' + cal_id).style.display = "none";
|
57 |
-
document.getElementById('calendar_body').appendChild(edit_cal_tr);
|
58 |
-
document.getElementById('calendar_body').insertBefore(edit_cal_tr, document.getElementById('Calendar-' + cal_id));
|
59 |
-
get_cal_id = cal_id;
|
60 |
-
show_one_cal = 1
|
61 |
-
}
|
62 |
-
});
|
63 |
-
}
|
64 |
-
}
|
65 |
-
function cancel_qiucik_edit(cal_id) {
|
66 |
-
if (document.getElementById('edit_calendar-' + cal_id)) {
|
67 |
-
var tr = document.getElementById('edit_calendar-' + cal_id);
|
68 |
-
tr.parentNode.removeChild(tr);
|
69 |
-
document.getElementById('Calendar-' + cal_id).style.display = "";
|
70 |
-
}
|
71 |
-
}
|
72 |
-
function updae_inline_sp_calendar(cal_id) {
|
73 |
-
var cal_title = document.getElementById('calendar_title').value;
|
74 |
-
var cal_12_format = getCheckedValue(document.getElementsByName('time_format'));
|
75 |
-
var def_year = document.getElementById('def_year').value;
|
76 |
-
var def_month = document.getElementById('def_month').value;
|
77 |
-
document.getElementById('imig_for_waiting').style.display = "block";
|
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('imig_for_waiting').style.display = "none";
|
92 |
-
document.getElementById('Calendar-' + cal_id).innerHTML = data;
|
93 |
-
cancel_qiucik_edit(cal_id);
|
94 |
-
}
|
95 |
-
else {
|
96 |
-
alert('ERROR PLEAS INSTALL PLUGIN AGAIN');
|
97 |
-
cancel_qiucik_edit(cal_id);
|
98 |
-
}
|
99 |
-
}
|
100 |
-
});
|
101 |
-
}
|
102 |
-
function getCheckedValue(radioObj) {
|
103 |
-
if (!radioObj)
|
104 |
-
return "";
|
105 |
-
var radioLength = radioObj.length;
|
106 |
-
if (radioLength == undefined)
|
107 |
-
if (radioObj.checked)
|
108 |
-
return radioObj.value;
|
109 |
-
else
|
110 |
-
return "";
|
111 |
-
for (var i = 0; i < radioLength; i++) {
|
112 |
-
if (radioObj[i].checked) {
|
113 |
-
return radioObj[i].value;
|
114 |
-
}
|
115 |
-
}
|
116 |
-
return "";
|
117 |
-
}
|
118 |
-
</script>
|
119 |
-
<form method="post"
|
120 |
-
<table cellspacing="10" width="100%" id="calendar_table">
|
121 |
-
<tr>
|
122 |
-
<td width="100%" style="font-size:14px; font-weight:bold">
|
123 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
124 |
-
<br />
|
125 |
-
This section allows you to create calendars. You can add unlimited number of calendars.
|
126 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
127 |
-
</td>
|
128 |
-
<td colspan="7" align="right" style="font-size:16px;">
|
129 |
-
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
130 |
-
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
131 |
-
Get the full version
|
132 |
-
</a>
|
133 |
-
</td>
|
134 |
-
</tr>
|
135 |
-
<tr>
|
136 |
-
<td style="width:210px"><h2>Calendar Manager</h2></td>
|
137 |
-
<td style="width:90px; text-align:right;">
|
138 |
-
<p class="submit" style="padding:0px; text-align:left">
|
139 |
-
<input type="button" value="Add a Calendar" name="custom_parametrs"
|
140 |
-
</p>
|
141 |
-
</td>
|
142 |
-
<td style="text-align:right;font-size:16px;padding:20px; padding-right:50px">
|
143 |
-
</td>
|
144 |
-
</tr>
|
145 |
-
</table>
|
146 |
-
<?php
|
147 |
-
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
148 |
-
$serch_value = $_POST['search_events_by_title'];
|
149 |
-
}
|
150 |
-
else {
|
151 |
-
$serch_value = "";
|
152 |
-
}
|
153 |
-
$serch_fields = '
|
154 |
-
<div class="alignleft actions">
|
155 |
-
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
156 |
-
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()">
|
157 |
-
</div>
|
158 |
-
<div class="alignleft actions">
|
159 |
-
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
160 |
-
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
161 |
-
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=SpiderCalendar\'" class="button-secondary action">
|
162 |
-
</div>';
|
163 |
-
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
164 |
-
?>
|
165 |
-
<table class="wp-list-table widefat fixed pages" style="width:95%">
|
166 |
-
<thead>
|
167 |
-
<TR>
|
168 |
-
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
169 |
-
<a href="javascript:ordering('id',<?php echo(($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
170 |
-
<span>ID</span>
|
171 |
-
<span class="sorting-indicator"></span>
|
172 |
-
</a>
|
173 |
-
</th>
|
174 |
-
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
175 |
-
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
176 |
-
<span>Title</span>
|
177 |
-
<span class="sorting-indicator"></span>
|
178 |
-
</a>
|
179 |
-
</th>
|
180 |
-
<th style="width:100px">Manage Events</th>
|
181 |
-
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
182 |
-
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
183 |
-
<span>Published</span>
|
184 |
-
<span class="sorting-indicator"></span>
|
185 |
-
</a>
|
186 |
-
</th>
|
187 |
-
</TR>
|
188 |
-
</thead>
|
189 |
-
<tbody id="calendar_body">
|
190 |
-
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
191 |
-
<tr id="Calendar-<?php echo $rows[$i]->id; ?>" class=" hentry alternate iedit author-self" style="display:table-row;">
|
192 |
-
<td><?php echo $rows[$i]->id; ?></td>
|
193 |
-
<td class="post-title page-title column-title">
|
194 |
-
<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>
|
195 |
-
<div class="row-actions">
|
196 |
-
<span class="edit">
|
197 |
-
<a href="admin.php?page=SpiderCalendar&task=edit_calendar&id=<?php echo $rows[$i]->id; ?>" title="Edit This Calendar">Edit</a> | </span>
|
198 |
-
<span class="inline hide-if-no-js">
|
199 |
-
<a href="#" class="editinline"
|
200 |
-
<span class="trash">
|
201 |
-
<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>
|
202 |
-
</div>
|
203 |
-
</td>
|
204 |
-
<td><a href="admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=<?php echo $rows[$i]->id; ?>">Manage events</a></td>
|
205 |
-
<td><a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?>
|
206 |
-
href="admin.php?page=SpiderCalendar&task=published&id=<?php echo $rows[$i]->id; ?>"><?php if ($rows[$i]->published) echo 'Yes'; else echo 'No'; ?></a>
|
207 |
-
</td>
|
208 |
-
</tr>
|
209 |
-
<?php } ?>
|
210 |
-
</tbody>
|
211 |
-
</table>
|
212 |
-
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo $_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 $_POST['asc_or_desc'];?>"/>
|
214 |
-
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo $_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 |
-
<table width="95%">
|
268 |
-
<tr>
|
269 |
-
<td width="100%" style="font-size:14px; font-weight:bold">
|
270 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
271 |
-
<br />
|
272 |
-
This section allows you to create calendars. You can add unlimited number of calendars.
|
273 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
274 |
-
</td>
|
275 |
-
<td colspan="7" align="right" style="font-size:16px;">
|
276 |
-
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
277 |
-
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
278 |
-
Get the full version
|
279 |
-
</a>
|
280 |
-
</td>
|
281 |
-
</tr>
|
282 |
-
<tr>
|
283 |
-
<td width="100%"><h2>Add Calendar</h2></td>
|
284 |
-
<td align="right"><input type="button"
|
285 |
-
<td align="right"><input type="button"
|
286 |
-
<td align="right"><input type="button"
|
287 |
-
</tr>
|
288 |
-
</table>
|
289 |
-
|
290 |
-
<form
|
291 |
-
<table class="form-table" style="width:400px">
|
292 |
-
<tr>
|
293 |
-
<td class="key"><label for="name">Title: </label></td>
|
294 |
-
<td><input type="text" name="title" id="title" size="30" value=""/></td>
|
295 |
-
</tr>
|
296 |
-
<tr>
|
297 |
-
<td class="key"><label for="def_year">Default Year: </label></td>
|
298 |
-
<td><input type="text" name="def_year" id="def_year" size="30" value=""/></td>
|
299 |
-
</tr>
|
300 |
-
<tr>
|
301 |
-
<td class="key"><label for="def_month">Default Month: </label></td>
|
302 |
-
<td>
|
303 |
-
<select id="def_month" name="def_month">
|
304 |
-
<option selected="selected" value="">Current</option>
|
305 |
-
<?php
|
306 |
-
$month_array = array(
|
307 |
-
'01' => 'January',
|
308 |
-
'02' => 'February',
|
309 |
-
'03' => 'March',
|
310 |
-
'04' => 'April',
|
311 |
-
'05' => 'May',
|
312 |
-
'06' => 'June',
|
313 |
-
'07' => 'July',
|
314 |
-
'08' => 'August',
|
315 |
-
'09' => 'September',
|
316 |
-
'10' => 'October',
|
317 |
-
'11' => 'November',
|
318 |
-
'12' => 'December',
|
319 |
-
);
|
320 |
-
foreach ($month_array as $key => $def_month) {
|
321 |
-
?>
|
322 |
-
<option value="<?php echo $key;?>"><?php echo $def_month;?></option>
|
323 |
-
<?php
|
324 |
-
}
|
325 |
-
?>
|
326 |
-
</select>
|
327 |
-
</td>
|
328 |
-
</tr>
|
329 |
-
<tr>
|
330 |
-
<td class="key"><label for="name">Use 12-hour time format: </label></td>
|
331 |
-
<td>
|
332 |
-
<input type="radio" name="time_format" id="time_format0" value="0" checked="checked" class="inputbox">
|
333 |
-
<label for="time_format0">No</label>
|
334 |
-
<input type="radio" name="time_format" id="time_format1" value="1" class="inputbox">
|
335 |
-
<label for="time_format1">Yes</label>
|
336 |
-
</td>
|
337 |
-
</tr>
|
338 |
-
<tr>
|
339 |
-
<td class="key"><label for="published">Published: </label></td>
|
340 |
-
<td>
|
341 |
-
<input type="radio" name="published" id="published0" value="0" class="inputbox">
|
342 |
-
<label for="published0">No</label>
|
343 |
-
<input type="radio" name="published" id="published1" value="1" checked="checked" class="inputbox">
|
344 |
-
<label for="published1">Yes</label>
|
345 |
-
</td>
|
346 |
-
</tr>
|
347 |
-
</table>
|
348 |
-
<input type="hidden" name="option" value="com_spidercalendar"/>
|
349 |
-
<input type="hidden" name="id" value=""/>
|
350 |
-
<input type="hidden" name="cid[]" value=""/>
|
351 |
-
<input type="hidden" name="task" value=""/>
|
352 |
-
</form>
|
353 |
-
<?php
|
354 |
-
}
|
355 |
-
|
356 |
-
function html_edit_spider_calendar($row) {
|
357 |
-
?>
|
358 |
-
<script language="javascript" type="text/javascript">
|
359 |
-
function submitbutton(pressbutton) {
|
360 |
-
var form = document.adminForm;
|
361 |
-
if (pressbutton == 'cancel_calendar') {
|
362 |
-
submitform(pressbutton);
|
363 |
-
return;
|
364 |
-
}
|
365 |
-
submitform(pressbutton);
|
366 |
-
}
|
367 |
-
function submitform(pressbutton) {
|
368 |
-
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
369 |
-
if (document.getElementById('title').value == "") {
|
370 |
-
alert('Provide calendar title:');
|
371 |
-
}
|
372 |
-
else {
|
373 |
-
document.getElementById('adminForm').submit();
|
374 |
-
}
|
375 |
-
}
|
376 |
-
function doNothing() {
|
377 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
378 |
-
if (keyCode == 13) {
|
379 |
-
if (!e) {
|
380 |
-
var e = window.event;
|
381 |
-
}
|
382 |
-
e.cancelBubble = true;
|
383 |
-
e.returnValue = false;
|
384 |
-
if (e.stopPropagation) {
|
385 |
-
e.stopPropagation();
|
386 |
-
e.preventDefault();
|
387 |
-
}
|
388 |
-
}
|
389 |
-
}
|
390 |
-
</script>
|
391 |
-
<style>
|
392 |
-
.calendar .button {
|
393 |
-
display: table-cell !important;
|
394 |
-
}
|
395 |
-
.wd_button{
|
396 |
-
border: 1px solid #D5D5D5 !important;
|
397 |
-
border-radius: 10px;
|
398 |
-
width: 30px;
|
399 |
-
height: 25px;
|
400 |
-
}
|
401 |
-
</style>
|
402 |
-
<table width="95%">
|
403 |
-
<tr>
|
404 |
-
<td width="100%" style="font-size:14px; font-weight:bold">
|
405 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
406 |
-
<br />
|
407 |
-
This section allows you to create calendars. You can add unlimited number of calendars.
|
408 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
409 |
-
</td>
|
410 |
-
<td colspan="7" align="right" style="font-size:16px;">
|
411 |
-
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
412 |
-
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
413 |
-
Get the full version
|
414 |
-
</a>
|
415 |
-
</td>
|
416 |
-
</tr>
|
417 |
-
<tr>
|
418 |
-
<td width="100%"><h2>Calendar - <?php echo $row->title; ?></h2></td>
|
419 |
-
<td align="right"><input type="button"
|
420 |
-
<td align="right"><input type="button"
|
421 |
-
<td align="right"><input type="button"
|
422 |
-
</tr>
|
423 |
-
</table>
|
424 |
-
|
425 |
-
<form
|
426 |
-
<table class="form-table" style="width:400px">
|
427 |
-
<tr>
|
428 |
-
<td class="key"><label for="name">Title: </label></td>
|
429 |
-
<td><input type="text" name="title" id="title" size="30" value="<?php echo $row->title; ?>"/></td>
|
430 |
-
</tr>
|
431 |
-
<tr>
|
432 |
-
<td class="key"><label for="name">Default Year: </label></td>
|
433 |
-
<td><input type="text" name="def_year" id="def_year" size="30" value="<?php echo $row->def_year; ?>"/></td>
|
434 |
-
</tr>
|
435 |
-
<tr>
|
436 |
-
<td class="key"><label for="name">Default Month: </label></td>
|
437 |
-
<td>
|
438 |
-
<select id="def_month" name="def_month">
|
439 |
-
<?php
|
440 |
-
$month_array = array(
|
441 |
-
'' => 'Current',
|
442 |
-
'01' => 'January',
|
443 |
-
'02' => 'February',
|
444 |
-
'03' => 'March',
|
445 |
-
'04' => 'April',
|
446 |
-
'05' => 'May',
|
447 |
-
'06' => 'June',
|
448 |
-
'07' => 'July',
|
449 |
-
'08' => 'August',
|
450 |
-
'09' => 'September',
|
451 |
-
'10' => 'October',
|
452 |
-
'11' => 'November',
|
453 |
-
'12' => 'December',
|
454 |
-
);
|
455 |
-
foreach ($month_array as $key => $def_month) {
|
456 |
-
?>
|
457 |
-
<option <?php echo (($row->def_month == $key) ? 'selected="selected"' : ''); ?> value="<?php echo $key; ?>"><?php echo $def_month; ?></option>
|
458 |
-
<?php
|
459 |
-
}
|
460 |
-
?>
|
461 |
-
</select>
|
462 |
-
</td>
|
463 |
-
</tr>
|
464 |
-
<tr>
|
465 |
-
<td class="key"><label for="name">Use 12 hours time format: </label></td>
|
466 |
-
<td>
|
467 |
-
<input type="radio" name="time_format" id="time_format0" value="0" <?php cheched($row->time_format, '0'); ?> class="inputbox">
|
468 |
-
<label for="time_format0">No</label>
|
469 |
-
<input type="radio" name="time_format" id="time_format1" value="1" <?php cheched($row->time_format, '1'); ?> class="inputbox">
|
470 |
-
<label for="time_format1">Yes</label>
|
471 |
-
</td>
|
472 |
-
</tr>
|
473 |
-
<tr>
|
474 |
-
<td class="key"><label for="published">Published:</label></td>
|
475 |
-
<td>
|
476 |
-
<input type="radio" name="published" id="published0" value="0" <?php cheched($row->published, '0'); ?> class="inputbox">
|
477 |
-
<label for="published0">No</label>
|
478 |
-
<input type="radio" name="published" id="published1" value="1" <?php cheched($row->published, '1'); ?> class="inputbox">
|
479 |
-
<label for="published1">Yes</label>
|
480 |
-
</td>
|
481 |
-
</tr>
|
482 |
-
</table>
|
483 |
-
<input type="hidden" name="option" value="com_spidercalendar"/>
|
484 |
-
<input type="hidden" name="id" value="<?php echo $row->id; ?>"/>
|
485 |
-
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
486 |
-
<input type="hidden" name="task" value=""/>
|
487 |
-
</form>
|
488 |
-
<?php
|
489 |
-
}
|
490 |
-
|
491 |
-
function cheched($row, $y) {
|
492 |
-
if ($row == $y) {
|
493 |
-
echo 'checked="checked"';
|
494 |
-
}
|
495 |
-
}
|
496 |
-
|
497 |
-
function selectted($row, $y) {
|
498 |
-
if ($row == $y) {
|
499 |
-
echo 'selected="selected"';
|
500 |
-
}
|
501 |
-
}
|
502 |
-
|
503 |
-
function show_event_category($rows, $pageNav, $sort){
|
504 |
-
global $wpdb;
|
505 |
-
?>
|
506 |
-
<script language="javascript">
|
507 |
-
function confirmation(href, title) {
|
508 |
-
var answer = confirm("Are you sure you want to delete '" + title + "'?")
|
509 |
-
if (answer) {
|
510 |
-
document.getElementById('admin_form').action = href;
|
511 |
-
document.getElementById('admin_form').submit();
|
512 |
-
}
|
513 |
-
}
|
514 |
-
function ordering(name, as_or_desc) {
|
515 |
-
document.getElementById('asc_or_desc').value = as_or_desc;
|
516 |
-
document.getElementById('order_by').value = name;
|
517 |
-
document.getElementById('admin_form').submit();
|
518 |
-
}
|
519 |
-
function submit_form_id(x) {
|
520 |
-
var val = x.options[x.selectedIndex].value;
|
521 |
-
document.getElementById("id_for_playlist").value = val;
|
522 |
-
document.getElementById("admin_form").submit();
|
523 |
-
}
|
524 |
-
function doNothing() {
|
525 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
526 |
-
if (keyCode == 13) {
|
527 |
-
if (!e) var e = window.event;
|
528 |
-
e.cancelBubble = true;
|
529 |
-
e.returnValue = false;
|
530 |
-
if (e.stopPropagation) {
|
531 |
-
e.stopPropagation();
|
532 |
-
e.preventDefault();
|
533 |
-
}
|
534 |
-
}
|
535 |
-
}
|
536 |
-
var show_one_cal = 1;
|
537 |
-
var get_cal_id = 0;
|
538 |
-
function show_calendar_inline(cal_id) {
|
539 |
-
if (show_one_cal == 1) {
|
540 |
-
show_one_cal = 0;
|
541 |
-
jQuery.ajax({
|
542 |
-
type:'POST',
|
543 |
-
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineedit') ?>',
|
544 |
-
data:{calendar_id:cal_id},
|
545 |
-
dataType:'html',
|
546 |
-
success:function (data) {
|
547 |
-
cancel_qiucik_edit(get_cal_id);
|
548 |
-
var edit_cal_tr = document.createElement("tr")
|
549 |
-
edit_cal_tr.innerHTML = data;
|
550 |
-
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')
|
551 |
-
edit_cal_tr.setAttribute('id', 'edit_calendar-' + cal_id);
|
552 |
-
|
553 |
-
document.getElementById('Calendar-' + cal_id).style.display = "none";
|
554 |
-
document.getElementById('calendar_body').appendChild(edit_cal_tr);
|
555 |
-
document.getElementById('calendar_body').insertBefore(edit_cal_tr, document.getElementById('Calendar-' + cal_id));
|
556 |
-
get_cal_id = cal_id;
|
557 |
-
show_one_cal = 1
|
558 |
-
}
|
559 |
-
});
|
560 |
-
}
|
561 |
-
}
|
562 |
-
function cancel_qiucik_edit(cal_id) {
|
563 |
-
if (document.getElementById('edit_calendar-' + cal_id)) {
|
564 |
-
var tr = document.getElementById('edit_calendar-' + cal_id);
|
565 |
-
tr.parentNode.removeChild(tr);
|
566 |
-
document.getElementById('Calendar-' + cal_id).style.display = "";
|
567 |
-
}
|
568 |
-
}
|
569 |
-
function updae_inline_sp_calendar(cal_id) {
|
570 |
-
var cal_title = document.getElementById('calendar_title').value;
|
571 |
-
var cal_12_format = getCheckedValue(document.getElementsByName('time_format'));
|
572 |
-
var def_year = document.getElementById('def_year').value;
|
573 |
-
var def_month = document.getElementById('def_month').value;
|
574 |
-
document.getElementById('imig_for_waiting').style.display = "block";
|
575 |
-
jQuery.ajax({
|
576 |
-
type:'POST',
|
577 |
-
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineupdate') ?>',
|
578 |
-
data:{
|
579 |
-
calendar_id:cal_id,
|
580 |
-
calendar_title:cal_title,
|
581 |
-
us_12_format_sp_calendar:cal_12_format,
|
582 |
-
default_year:def_year,
|
583 |
-
default_month:def_month
|
584 |
-
},
|
585 |
-
dataType:'html',
|
586 |
-
success:function (data) {
|
587 |
-
if (data) {
|
588 |
-
document.getElementById('imig_for_waiting').style.display = "none";
|
589 |
-
document.getElementById('Calendar-' + cal_id).innerHTML = data;
|
590 |
-
cancel_qiucik_edit(cal_id);
|
591 |
-
}
|
592 |
-
else {
|
593 |
-
alert('ERROR PLEAS INSTALL PLUGIN AGAIN');
|
594 |
-
cancel_qiucik_edit(cal_id);
|
595 |
-
}
|
596 |
-
}
|
597 |
-
});
|
598 |
-
}
|
599 |
-
function getCheckedValue(radioObj) {
|
600 |
-
if (!radioObj)
|
601 |
-
return "";
|
602 |
-
var radioLength = radioObj.length;
|
603 |
-
if (radioLength == undefined)
|
604 |
-
if (radioObj.checked)
|
605 |
-
return radioObj.value;
|
606 |
-
else
|
607 |
-
return "";
|
608 |
-
for (var i = 0; i < radioLength; i++) {
|
609 |
-
if (radioObj[i].checked) {
|
610 |
-
return radioObj[i].value;
|
611 |
-
}
|
612 |
-
}
|
613 |
-
return "";
|
614 |
-
}
|
615 |
-
</script>
|
616 |
-
<form method="post"
|
617 |
-
<table cellspacing="10" width="100%" id="category_table">
|
618 |
-
<tr>
|
619 |
-
<td width="100%" style="font-size:14px; font-weight:bold">
|
620 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
621 |
-
<br />
|
622 |
-
This section allows you to create event categories. You can add unlimited number of categories.
|
623 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-4.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
624 |
-
</td>
|
625 |
-
<td colspan="7" align="right" style="font-size:16px;">
|
626 |
-
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
627 |
-
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
628 |
-
Get the full version
|
629 |
-
</a>
|
630 |
-
</td>
|
631 |
-
</tr>
|
632 |
-
|
633 |
-
<tr>
|
634 |
-
<td style="width:210px"><h2>Event Category</h2></td>
|
635 |
-
<td style="width:90px; text-align:right;">
|
636 |
-
<p class="submit" style="padding:0px; text-align:left">
|
637 |
-
<input type="button" value="Add a Category" name="custom_parametrs"
|
638 |
-
</p>
|
639 |
-
</td>
|
640 |
-
<td style="text-align:right;font-size:16px;padding:20px; padding-right:50px">
|
641 |
-
</td>
|
642 |
-
</tr>
|
643 |
-
</table>
|
644 |
-
<?php
|
645 |
-
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
646 |
-
$serch_value = $_POST['search_cat_by_title'];
|
647 |
-
}
|
648 |
-
else {
|
649 |
-
$serch_value = "";
|
650 |
-
}
|
651 |
-
$serch_fields = '
|
652 |
-
<div class="alignleft actions" >
|
653 |
-
<label for="search_cat_by_title" style="font-size:14px">Title: </label>
|
654 |
-
<input type="text" name="search_cat_by_title" value="' . $serch_value . '" id="search_cat_by_title" onchange="clear_serch_texts()">
|
655 |
-
</div>
|
656 |
-
<div class="alignleft actions">
|
657 |
-
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
658 |
-
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
659 |
-
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=spider_calendar_event_category\'" class="button-secondary action">
|
660 |
-
</div>';
|
661 |
-
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
662 |
-
?>
|
663 |
-
<table class="wp-list-table widefat fixed pages" style="width:95%">
|
664 |
-
<thead>
|
665 |
-
<TR>
|
666 |
-
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
667 |
-
<a href="javascript:ordering('id',<?php echo(($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
668 |
-
<span>ID</span>
|
669 |
-
<span class="sorting-indicator"></span>
|
670 |
-
</a>
|
671 |
-
</th>
|
672 |
-
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
673 |
-
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
674 |
-
<span>Title</span>
|
675 |
-
<span class="sorting-indicator"></span>
|
676 |
-
</a>
|
677 |
-
</th>
|
678 |
-
<th scope="col" id="description" class="<?php echo (($sort["sortid_by"] == "description") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
679 |
-
<a href="javascript:ordering('description',<?php echo (($sort["sortid_by"] == "description") ? $sort["1_or_2"] : "1"); ?>)">
|
680 |
-
<span>Description</span>
|
681 |
-
<span class="sorting-indicator"></span>
|
682 |
-
</a>
|
683 |
-
</th>
|
684 |
-
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
685 |
-
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
686 |
-
<span>Published</span>
|
687 |
-
<span class="sorting-indicator"></span>
|
688 |
-
</a>
|
689 |
-
</th>
|
690 |
-
</TR>
|
691 |
-
</thead>
|
692 |
-
<tbody id="category_body">
|
693 |
-
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
694 |
-
<tr id="Calendar-<?php echo $rows[$i]->id; ?>" class=" hentry alternate iedit author-self" style="display:table-row;">
|
695 |
-
<td><?php echo $rows[$i]->id; ?></td>
|
696 |
-
<td class="post-title page-title column-title">
|
697 |
-
<?php echo $rows[$i]->title; ?></a>
|
698 |
-
|
699 |
-
<div class="row-actions">
|
700 |
-
<span class="edit">
|
701 |
-
<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>
|
702 |
-
<span class="trash">
|
703 |
-
<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>
|
704 |
-
</div>
|
705 |
-
</td>
|
706 |
-
<td><?php echo $rows[$i]->description; ?></td>
|
707 |
-
<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; ?>"><?php if ($rows[$i]->published) echo 'Yes'; else echo 'No'; ?></a>
|
708 |
-
</td>
|
709 |
-
</tr>
|
710 |
-
<?php } ?>
|
711 |
-
</tbody>
|
712 |
-
</table>
|
713 |
-
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo $_POST['id_for_playlist'];?>"/>
|
714 |
-
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc'];?>"/>
|
715 |
-
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo $_POST['order_by'];?>"/>
|
716 |
-
<?php
|
717 |
-
?>
|
718 |
-
</form>
|
719 |
-
<?php
|
720 |
-
|
721 |
-
}
|
722 |
-
|
723 |
-
function edit_event_category($id){
|
724 |
-
global $wpdb;
|
725 |
-
$row=$wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE id
|
726 |
-
?>
|
727 |
-
|
728 |
-
<script language="javascript" type="text/javascript">
|
729 |
-
<!--
|
730 |
-
function submitbutton(pressbutton) {
|
731 |
-
document.getElementById('adminForm').action = "admin.php?page=spider_calendar_event_category&task=" + pressbutton+"&id=<?php echo $id?>";
|
732 |
-
if (document.getElementById('cat_title').value == "") {
|
733 |
-
alert('Provide the category title:');
|
734 |
-
}
|
735 |
-
else {
|
736 |
-
document.getElementById('adminForm').submit();
|
737 |
-
}
|
738 |
-
}
|
739 |
-
</script>
|
740 |
-
|
741 |
-
<table>
|
742 |
-
<tr>
|
743 |
-
<td align="right"><input type="button"
|
744 |
-
<td align="right"><input type="button"
|
745 |
-
<td align="right"><input type="button"
|
746 |
-
</td>
|
747 |
-
</tr>
|
748 |
-
</table>
|
749 |
-
|
750 |
-
|
751 |
-
<form action="" method="post" name="adminForm" id="adminForm">
|
752 |
-
<div class="width-45 fltlft ">
|
753 |
-
<fieldset class="adminform" >
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
<table class="admintable" >
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
<tr>
|
763 |
-
<td class="key" ><label for="message"><?php echo 'Category title'; ?>:</label> </td>
|
764 |
-
<td>
|
765 |
-
|
766 |
-
<input type="text" name="title" value="<?php if(isset($row->title)) echo htmlspecialchars($row->title);
|
767 |
-
?>" id="cat_title"/>
|
768 |
-
</td>
|
769 |
-
</tr>
|
770 |
-
|
771 |
-
<tr>
|
772 |
-
<td class="key" ><label for="message"><?php echo 'Category Color'; ?>:</label> </td>
|
773 |
-
|
774 |
-
<td><input type="text" name="color" id="color" class="color" style="width:134px;" value="<?php if(isset($row->color)) echo htmlspecialchars($row->color);
|
775 |
-
?>"/></td>
|
776 |
-
</tr>
|
777 |
-
|
778 |
-
|
779 |
-
<tr>
|
780 |
-
<td class="key"><label for="message"> <?php echo 'Description'; ?>:</label></td>
|
781 |
-
<td ><div id="poststuff" style="width:100% !important;">
|
782 |
-
|
783 |
-
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
784 |
-
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor(stripslashes($row->description),"description","title" ); ?>
|
785 |
-
</div>
|
786 |
-
<?php }else{
|
787 |
-
if(isset($row->description)) $desc1 = $row->description;
|
788 |
-
else $desc1 = "";
|
789 |
-
wp_editor($desc1, "description"); }?>
|
790 |
-
|
791 |
-
</div>
|
792 |
-
</div></td>
|
793 |
-
|
794 |
-
</tr>
|
795 |
-
|
796 |
-
<tr>
|
797 |
-
<td class="key" ><label for="message"><?php echo 'Published'; ?>:</label> </td>
|
798 |
-
|
799 |
-
<td>
|
800 |
-
<input type="radio" name="published" id="published0" value="0" <?php if(isset($row->published)) cheched($row->published, '0'); ?> class="inputbox">
|
801 |
-
<label for="published0">No</label>
|
802 |
-
<input type="radio" name="published" id="published1" value="1" <?php if(isset($row->published)) cheched($row->published, '1'); ?> class="inputbox">
|
803 |
-
<label for="published1">Yes</label>
|
804 |
-
</td>
|
805 |
-
</tr>
|
806 |
-
|
807 |
-
</table>
|
808 |
-
|
809 |
-
</fieldset >
|
810 |
-
</div>
|
811 |
-
<input type="hidden" name="id" value="<?php echo $id ?>" />
|
812 |
-
</form>
|
813 |
-
<?php
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
}
|
818 |
-
|
819 |
-
|
820 |
-
function html_upcoming_widget($rows, $pageNav, $sort){
|
821 |
-
require_once("spidercalendar_upcoming_events_widget.php");
|
822 |
-
global $wpdb;
|
823 |
-
$input_id=$_GET['id_input'];
|
824 |
-
$w_id = $_GET['w_id'];
|
825 |
-
$tbody_id='event'.$w_id;
|
826 |
-
$calendar_id=$_GET['upcalendar_id'];
|
827 |
-
?><html>
|
828 |
-
<head>
|
829 |
-
<link rel="stylesheet" id="thickbox-css" href="<?php echo plugins_url("elements/calendar-jos.css", __FILE__) ?>" type="text/css" media="all">
|
830 |
-
<?php wp_print_scripts("Canlendar_upcoming");
|
831 |
-
wp_print_scripts("calendnar-setup_upcoming");
|
832 |
-
wp_print_scripts("calenndar_function_upcoming");
|
833 |
-
?>
|
834 |
-
|
835 |
-
<style>
|
836 |
-
.calendar .button {
|
837 |
-
display: table-cell !important;
|
838 |
-
}
|
839 |
-
|
840 |
-
.wd_button{
|
841 |
-
border: 1px solid #D5D5D5 !important;
|
842 |
-
border-radius: 10px;
|
843 |
-
width: 30px;
|
844 |
-
height: 25px;
|
845 |
-
}
|
846 |
-
}
|
847 |
-
input[type=checkbox]:checked:before,
|
848 |
-
th.sorted.asc .sorting-indicator:before, th.desc:hover span.sorting-indicator:before,
|
849 |
-
th.sorted.desc .sorting-indicator:before, th.asc:hover span.sorting-indicator:before{
|
850 |
-
content: close-quote !important;
|
851 |
-
}
|
852 |
-
|
853 |
-
</style>
|
854 |
-
<script language="javascript">
|
855 |
-
function ordering(name, as_or_desc) {
|
856 |
-
document.getElementById('asc_or_desc').value = as_or_desc;
|
857 |
-
document.getElementById('order_by').value = name;
|
858 |
-
document.getElementById('admin_form').submit();
|
859 |
-
}
|
860 |
-
function submit_form_id(x) {
|
861 |
-
var val = x.options[x.selectedIndex].value;
|
862 |
-
document.getElementById("id_for_playlist").value = val;
|
863 |
-
document.getElementById("admin_form").submit();
|
864 |
-
}
|
865 |
-
|
866 |
-
function doNothing() {
|
867 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
868 |
-
if (keyCode == 13) {
|
869 |
-
if (!e) {
|
870 |
-
var e = window.event;
|
871 |
-
}
|
872 |
-
e.cancelBubble = true;
|
873 |
-
e.returnValue = false;
|
874 |
-
if (e.stopPropagation) {
|
875 |
-
e.stopPropagation();
|
876 |
-
e.preventDefault();
|
877 |
-
}
|
878 |
-
}
|
879 |
-
}
|
880 |
-
|
881 |
-
|
882 |
-
function isChecked(isitchecked){
|
883 |
-
if (isitchecked == true){
|
884 |
-
document.adminForm.boxchecked.value++;
|
885 |
-
}
|
886 |
-
else {
|
887 |
-
document.adminForm.boxchecked.value--;
|
888 |
-
}
|
889 |
-
}
|
890 |
-
|
891 |
-
|
892 |
-
function checkAll( n, fldName ) {
|
893 |
-
|
894 |
-
if (!fldName) {
|
895 |
-
|
896 |
-
fldName = 'cb';
|
897 |
-
|
898 |
-
}
|
899 |
-
|
900 |
-
var f = document.admin_form;
|
901 |
-
|
902 |
-
var c = f.toggle.checked;
|
903 |
-
|
904 |
-
var n2 = 0;
|
905 |
-
|
906 |
-
for (i=0; i < n; i++) {
|
907 |
-
|
908 |
-
cb = eval( 'f.' + fldName + '' + i );
|
909 |
-
|
910 |
-
if (cb) {
|
911 |
-
|
912 |
-
cb.checked = c;
|
913 |
-
|
914 |
-
n2++;
|
915 |
-
|
916 |
-
}
|
917 |
-
|
918 |
-
}
|
919 |
-
|
920 |
-
if (c) {
|
921 |
-
|
922 |
-
document.admin_form.boxchecked.value = n2;
|
923 |
-
|
924 |
-
} else {
|
925 |
-
|
926 |
-
document.admin_form.boxchecked.value = 0;
|
927 |
-
|
928 |
-
}
|
929 |
-
|
930 |
-
}
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
function select_events()
|
936 |
-
|
937 |
-
{
|
938 |
-
var id =[];
|
939 |
-
var title =[];
|
940 |
-
|
941 |
-
for(i=0; i<<?php echo count($rows)?>; i++)
|
942 |
-
if(document.getElementById("p"+i))
|
943 |
-
if(document.getElementById("p"+i).checked)
|
944 |
-
{
|
945 |
-
id.push(document.getElementById("p"+i).value);
|
946 |
-
title.push(document.getElementById("title_"+i).value);
|
947 |
-
|
948 |
-
}
|
949 |
-
window.parent.jSelectEvents('<?php echo $input_id ?>','<?php echo $tbody_id ?>','<?php echo $w_id ?>',id, title);
|
950 |
-
}
|
951 |
-
|
952 |
-
|
953 |
-
</script>
|
954 |
-
<?php
|
955 |
-
|
956 |
-
|
957 |
-
if(get_bloginfo( 'version' )>3.3){
|
958 |
-
|
959 |
-
?>
|
960 |
-
|
961 |
-
<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">
|
962 |
-
|
963 |
-
<?php
|
964 |
-
|
965 |
-
}
|
966 |
-
|
967 |
-
else
|
968 |
-
|
969 |
-
{
|
970 |
-
|
971 |
-
?>
|
972 |
-
|
973 |
-
<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">
|
974 |
-
|
975 |
-
<?php
|
976 |
-
|
977 |
-
}
|
978 |
-
|
979 |
-
?>
|
980 |
-
|
981 |
-
<link rel="stylesheet" id="thickbox-css" href="<?php echo bloginfo('url')?>/wp-includes/js/thickbox/thickbox.css?ver=20111117" type="text/css" media="all">
|
982 |
-
|
983 |
-
<!---- <link rel="stylesheet" id="colors-css" href="<?php echo bloginfo('url')?>/wp-admin/css/colors-classic.css?ver=20111206" type="text/css" media="all"> --->
|
984 |
-
</head>
|
985 |
-
<body>
|
986 |
-
<form method="post"
|
987 |
-
<table cellspacing="10" width="100%">
|
988 |
-
|
989 |
-
<tr>
|
990 |
-
<td width="100%"><h2>Event Manager</h2></td></td>
|
991 |
-
<td align="right" width="100%">
|
992 |
-
|
993 |
-
<button
|
994 |
-
</td>
|
995 |
-
</tr>
|
996 |
-
</table>
|
997 |
-
<?php
|
998 |
-
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
999 |
-
$serch_value = $_POST['search_events_by_title'];
|
1000 |
-
}
|
1001 |
-
else {
|
1002 |
-
$serch_value = "";
|
1003 |
-
}
|
1004 |
-
$startdate = (isset($_POST["startdate"]) ? esc_html($_POST["startdate"]) : '');
|
1005 |
-
$enddate = (isset($_POST["enddate"]) ? esc_html($_POST["enddate"]) : '');
|
1006 |
-
$serch_fields = '
|
1007 |
-
<div class="alignleft actions">
|
1008 |
-
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
1009 |
-
<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;"/>
|
1010 |
-
</div>
|
1011 |
-
<div class="alignleft actions">
|
1012 |
-
From: <input class="inputbox" type="text" style="width: 90px;border: 1px solid #DCDCEC;" name="startdate" id="startdate" size="10" maxlength="10" value="' . $startdate . '" />
|
1013 |
-
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'startdate\',\'%Y-%m-%d\');">
|
1014 |
-
To: <input class="inputbox" type="text" style="width: 90px;border: 1px solid #DCDCEC;" name="enddate" id="enddate" size="10" maxlength="10" value="' . $enddate . '">
|
1015 |
-
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'enddate\',\'%Y-%m-%d\');">
|
1016 |
-
</div>
|
1017 |
-
<div class="alignleft actions">
|
1018 |
-
<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">
|
1019 |
-
<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">
|
1020 |
-
</div>';
|
1021 |
-
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
1022 |
-
?>
|
1023 |
-
<style>
|
1024 |
-
.sorting-indicator {
|
1025 |
-
width: 7px;
|
1026 |
-
height: 4px;
|
1027 |
-
margin-top: 8px;
|
1028 |
-
margin-left: 7px;
|
1029 |
-
background-image: url('images/sort.gif');
|
1030 |
-
background-repeat: no-repeat;
|
1031 |
-
}
|
1032 |
-
.wd_button{
|
1033 |
-
border: 1px solid #D5D5D5 !important;
|
1034 |
-
border-radius: 10px;
|
1035 |
-
width: 30px;
|
1036 |
-
height: 25px;
|
1037 |
-
}
|
1038 |
-
</style>
|
1039 |
-
<table class="wp-list-table widefat fixed pages" style="width:100%">
|
1040 |
-
<thead>
|
1041 |
-
<TR>
|
1042 |
-
<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);">
|
1043 |
-
<a href="javascript:ordering('id',<?php echo (($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
1044 |
-
<span>ID</span>
|
1045 |
-
<span class="sorting-indicator"></span>
|
1046 |
-
</a>
|
1047 |
-
</th>
|
1048 |
-
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);" width="20" class="manage-column column-cb check-column">
|
1049 |
-
|
1050 |
-
<input style="border: 1px solid #DCDCEC;-webkit-appearance: checkbox;" type="checkbox" name="toggle" id="toggle" value=""
|
1051 |
-
|
1052 |
-
</th>
|
1053 |
-
<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"]); ?>">
|
1054 |
-
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
1055 |
-
<span>Title</span>
|
1056 |
-
<span class="sorting-indicator"></span>
|
1057 |
-
</a>
|
1058 |
-
</th>
|
1059 |
-
<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"]); ?>">
|
1060 |
-
<a href="javascript:ordering('date',<?php echo (($sort["sortid_by"] == "date") ? $sort["1_or_2"] : "1"); ?>)">
|
1061 |
-
<span>Date</span>
|
1062 |
-
<span class="sorting-indicator"></span>
|
1063 |
-
</a>
|
1064 |
-
</th>
|
1065 |
-
<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"]); ?>">
|
1066 |
-
<a href="javascript:ordering('time',<?php echo (($sort["sortid_by"] == "time") ? $sort["1_or_2"] : "1"); ?>)">
|
1067 |
-
<span>Time</span>
|
1068 |
-
<span class="sorting-indicator"></span>
|
1069 |
-
</a>
|
1070 |
-
</th>
|
1071 |
-
</TR>
|
1072 |
-
</thead>
|
1073 |
-
<tbody>
|
1074 |
-
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
1075 |
-
<tr>
|
1076 |
-
|
1077 |
-
<td style="border-bottom: 1px solid #DCDCEC;"><?php echo $rows[$i]->id; ?></td>
|
1078 |
-
<td style="border-bottom: 1px solid #DCDCEC;">
|
1079 |
-
<input style="border: 1px solid #DCDCEC;-webkit-appearance: checkbox;" type="checkbox" id="p<?php echo $i?>" value="<?php echo $rows[$i]->id;?>" />
|
1080 |
-
<input type="hidden" id="title_<?php echo $i?>" value="<?php echo htmlspecialchars($rows[$i]->title);?>" />
|
1081 |
-
</td>
|
1082 |
-
<td style="border-bottom: 1px solid #DCDCEC;"><a href="<?php echo admin_url('admin-ajax.php') ?>?action=upcoming"
|
1083 |
-
</td>
|
1084 |
-
<td style="border-bottom: 1px solid #DCDCEC;"><?php if ($rows[$i]->date_end != '0000-00-00' && $rows[$i]->date_end != '2070-12-12') echo $rows[$i]->date . ' - ' . $rows[$i]->date_end; else echo $rows[$i]->date; ?></td>
|
1085 |
-
<td style="border-bottom: 1px solid #DCDCEC;"><?php echo $rows[$i]->time ?></td>
|
1086 |
-
</tr>
|
1087 |
-
<?php } ?>
|
1088 |
-
</tbody>
|
1089 |
-
</table>
|
1090 |
-
<input type="hidden" name="boxchecked" value="0">
|
1091 |
-
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc']; ?>"/>
|
1092 |
-
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo $_POST['order_by']; ?>"/>
|
1093 |
-
<?php
|
1094 |
-
?>
|
1095 |
-
</form>
|
1096 |
-
</body>
|
1097 |
-
</html>
|
1098 |
-
<?php
|
1099 |
-
die();
|
1100 |
-
}
|
1101 |
-
|
1102 |
-
// Events.
|
1103 |
-
function html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name) {
|
1104 |
-
global $wpdb;
|
1105 |
-
?>
|
1106 |
-
<style>
|
1107 |
-
.calendar .button {
|
1108 |
-
display: table-cell !important;
|
1109 |
-
}
|
1110 |
-
.wd_button{
|
1111 |
-
border: 1px solid #D5D5D5 !important;
|
1112 |
-
border-radius: 10px;
|
1113 |
-
width: 30px;
|
1114 |
-
height: 25px;
|
1115 |
-
}
|
1116 |
-
</style>
|
1117 |
-
<script language="javascript">
|
1118 |
-
function ordering(name, as_or_desc) {
|
1119 |
-
document.getElementById('asc_or_desc').value = as_or_desc;
|
1120 |
-
document.getElementById('order_by').value = name;
|
1121 |
-
document.getElementById('admin_form').submit();
|
1122 |
-
}
|
1123 |
-
function doNothing() {
|
1124 |
-
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
1125 |
-
if (keyCode == 13) {
|
1126 |
-
if (!e) {
|
1127 |
-
var e = window.event;
|
1128 |
-
}
|
1129 |
-
e.cancelBubble = true;
|
1130 |
-
e.returnValue = false;
|
1131 |
-
if (e.stopPropagation) {
|
1132 |
-
e.stopPropagation();
|
1133 |
-
e.preventDefault();
|
1134 |
-
}
|
1135 |
-
}
|
1136 |
-
}
|
1137 |
-
</script>
|
1138 |
-
<form method="post"
|
1139 |
-
<table cellspacing="10" width="95%">
|
1140 |
-
<tr>
|
1141 |
-
<td width="100%" style="font-size:14px; font-weight:bold">
|
1142 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a><br>
|
1143 |
-
This section allows you to create/edit the events of a particular calendar.<br/> You can add
|
1144 |
-
unlimited number of events for each calendar.
|
1145 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
1146 |
-
</td>
|
1147 |
-
<td colspan="7" align="right" style="font-size:16px;">
|
1148 |
-
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
1149 |
-
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
1150 |
-
Get the full version
|
1151 |
-
</a>
|
1152 |
-
</td>
|
1153 |
-
</tr>
|
1154 |
-
<tr>
|
1155 |
-
<td width="100%"><h2>Event Manager for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
1156 |
-
<td>
|
1157 |
-
<p class="submit" style="padding:0px; text-align:left">
|
1158 |
-
<input class="button-primary" type="button" value="Add an Event" name="custom_parametrs"
|
1159 |
-
</p>
|
1160 |
-
</td>
|
1161 |
-
<td>
|
1162 |
-
<p class="submit" style="padding:0px; text-align:left">
|
1163 |
-
<input type="button" class="button-primary" value="Back" name="custom_parametrs"
|
1164 |
-
</p>
|
1165 |
-
</td>
|
1166 |
-
</tr>
|
1167 |
-
</table>
|
1168 |
-
<?php
|
1169 |
-
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
1170 |
-
$serch_value = $_POST['search_events_by_title'];
|
1171 |
-
}
|
1172 |
-
else {
|
1173 |
-
$serch_value = "";
|
1174 |
-
}
|
1175 |
-
$startdate = (isset($_POST["startdate"]) ? esc_html($_POST["startdate"]) : '');
|
1176 |
-
$enddate = (isset($_POST["enddate"]) ? esc_html($_POST["enddate"]) : '');
|
1177 |
-
$serch_fields = '
|
1178 |
-
<div class="alignleft actions">
|
1179 |
-
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
1180 |
-
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()" />
|
1181 |
-
</div>
|
1182 |
-
<div class="alignleft actions">
|
1183 |
-
From: <input style="width: 90px;" class="inputbox" type="text" name="startdate" id="startdate" size="10" maxlength="10" value="' . $startdate . '" />
|
1184 |
-
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'startdate\',\'%Y-%m-%d\');">
|
1185 |
-
To: <input style="width: 90px;" class="inputbox" type="text" name="enddate" id="enddate" size="10" maxlength="10" value="' . $enddate . '">
|
1186 |
-
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'enddate\',\'%Y-%m-%d\');">
|
1187 |
-
</div>
|
1188 |
-
<div class="alignleft actions">
|
1189 |
-
<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">
|
1190 |
-
<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">
|
1191 |
-
</div>';
|
1192 |
-
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
1193 |
-
?>
|
1194 |
-
<table class="wp-list-table widefat fixed pages" style="width:95%">
|
1195 |
-
<thead>
|
1196 |
-
<TR>
|
1197 |
-
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
1198 |
-
<a href="javascript:ordering('id',<?php echo (($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
1199 |
-
<span>ID</span>
|
1200 |
-
<span class="sorting-indicator"></span>
|
1201 |
-
</a>
|
1202 |
-
</th>
|
1203 |
-
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1204 |
-
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
1205 |
-
<span>Title</span>
|
1206 |
-
<span class="sorting-indicator"></span>
|
1207 |
-
</a>
|
1208 |
-
</th>
|
1209 |
-
<th scope="col" id="date" class="<?php echo (($sort["sortid_by"] == "date") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1210 |
-
<a href="javascript:ordering('date',<?php echo (($sort["sortid_by"] == "date") ? $sort["1_or_2"] : "1"); ?>)">
|
1211 |
-
<span>Date</span>
|
1212 |
-
<span class="sorting-indicator"></span>
|
1213 |
-
</a>
|
1214 |
-
</th>
|
1215 |
-
<th scope="col" id="time" class="<?php echo (($sort["sortid_by"] == "time") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1216 |
-
<a href="javascript:ordering('time',<?php echo (($sort["sortid_by"] == "time") ? $sort["1_or_2"] : "1"); ?>)">
|
1217 |
-
<span>Time</span>
|
1218 |
-
<span class="sorting-indicator"></span>
|
1219 |
-
</a>
|
1220 |
-
</th>
|
1221 |
-
<th scope="col" id="cattitle" class="<?php echo (($sort["sortid_by"] == "cattitle") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1222 |
-
<a href="javascript:ordering('cattitle',<?php echo (($sort["sortid_by"] == "cattitle") ? $sort["1_or_2"] : "1"); ?>)">
|
1223 |
-
<span>Category</span>
|
1224 |
-
<span class="sorting-indicator"></span>
|
1225 |
-
</a>
|
1226 |
-
</th>
|
1227 |
-
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
1228 |
-
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
1229 |
-
<span>Published</span>
|
1230 |
-
<span class="sorting-indicator"></span>
|
1231 |
-
</a>
|
1232 |
-
</th>
|
1233 |
-
<th style="width:80px">Edit</th>
|
1234 |
-
<th style="width:80px">Delete</th>
|
1235 |
-
</TR>
|
1236 |
-
</thead>
|
1237 |
-
<tbody>
|
1238 |
-
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
1239 |
-
<tr>
|
1240 |
-
<td><?php echo $rows[$i]->id; ?></td>
|
1241 |
-
<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>
|
1242 |
-
</td>
|
1243 |
-
<td><?php if ($rows[$i]->date_end != '0000-00-00' && $rows[$i]->date_end != '2070-12-12') echo $rows[$i]->date . ' - ' . $rows[$i]->date_end; else echo $rows[$i]->date; ?></td>
|
1244 |
-
<td><?php echo $rows[$i]->time ?></td>
|
1245 |
-
<td><?php echo $rows[$i]->cattitle ?></td>
|
1246 |
-
<td><a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?>
|
1247 |
-
href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=published_event&id=<?php echo $rows[$i]->id; ?>"><?php if ($rows[$i]->published)
|
1248 |
-
echo 'Yes'; else echo 'No'; ?></a>
|
1249 |
-
</td>
|
1250 |
-
<td>
|
1251 |
-
<a href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=edit_event&id=<?php echo $rows[$i]->id; ?>">Edit</a>
|
1252 |
-
</td>
|
1253 |
-
<td>
|
1254 |
-
<a href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=remove_event&id=<?php echo $rows[$i]->id; ?>">Delete</a>
|
1255 |
-
</td>
|
1256 |
-
</tr>
|
1257 |
-
<?php } ?>
|
1258 |
-
</tbody>
|
1259 |
-
</table>
|
1260 |
-
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo $_POST['id_for_playlist']; ?>"/>
|
1261 |
-
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc']; ?>"/>
|
1262 |
-
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo $_POST['order_by']; ?>"/>
|
1263 |
-
<?php
|
1264 |
-
?>
|
1265 |
-
</form>
|
1266 |
-
|
1267 |
-
<?php
|
1268 |
-
}
|
1269 |
-
|
1270 |
-
function html_add_spider_event($calendar_id, $cal_name) {
|
1271 |
-
?>
|
1272 |
-
<style>
|
1273 |
-
.calendar .button {
|
1274 |
-
display: table-cell !important;
|
1275 |
-
}
|
1276 |
-
.wd_button{
|
1277 |
-
border: 1px solid #D5D5D5 !important;
|
1278 |
-
border-radius: 10px;
|
1279 |
-
width: 30px;
|
1280 |
-
height: 25px;
|
1281 |
-
}
|
1282 |
-
</style>
|
1283 |
-
<script language="javascript" type="text/javascript">
|
1284 |
-
function submitbutton(pressbutton) {
|
1285 |
-
var form = document.adminForm;
|
1286 |
-
if (pressbutton == 'cancel_event') {
|
1287 |
-
submitform(pressbutton);
|
1288 |
-
return;
|
1289 |
-
}
|
1290 |
-
if (form.date.value.search(/^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/)) {
|
1291 |
-
alert('Invalid Date');
|
1292 |
-
}
|
1293 |
-
else if (form.selhour_from.value == "" && form.selminute_from.value == "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1294 |
-
submitform(pressbutton);
|
1295 |
-
}
|
1296 |
-
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1297 |
-
submitform(pressbutton);
|
1298 |
-
}
|
1299 |
-
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value != "" && form.selminute_to.value != "") {
|
1300 |
-
submitform(pressbutton);
|
1301 |
-
}
|
1302 |
-
|
1303 |
-
else {
|
1304 |
-
alert('Invalid Time');
|
1305 |
-
}
|
1306 |
-
}
|
1307 |
-
|
1308 |
-
|
1309 |
-
function submitform(pressbutton) {
|
1310 |
-
|
1311 |
-
if (document.getElementById('title').value == "") {
|
1312 |
-
alert('Provide the title:');
|
1313 |
-
}
|
1314 |
-
else {
|
1315 |
-
document.getElementById('adminForm').submit();
|
1316 |
-
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
1317 |
-
document.getElementById('adminForm').submit();
|
1318 |
-
}
|
1319 |
-
}
|
1320 |
-
function checkhour(id,event) {
|
1321 |
-
if (typeof(event) != 'undefined') {
|
1322 |
-
var e = event; // for trans-browser compatibility
|
1323 |
-
var charCode = e.which || e.keyCode;
|
1324 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1325 |
-
return false;
|
1326 |
-
}
|
1327 |
-
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1328 |
-
hour = parseFloat(hour);
|
1329 |
-
if (document.getSelection() != '') {
|
1330 |
-
return true;
|
1331 |
-
}
|
1332 |
-
if ((hour < 0) || (hour > 23)) {
|
1333 |
-
return false;
|
1334 |
-
}
|
1335 |
-
}
|
1336 |
-
return true;
|
1337 |
-
}
|
1338 |
-
function check12hour(id,event) {
|
1339 |
-
if (typeof(event) != 'undefined') {
|
1340 |
-
var e = event; // for trans-browser compatibility
|
1341 |
-
var charCode = e.which || e.keyCode;
|
1342 |
-
input = document.getElementById(id);
|
1343 |
-
if (charCode == 48 && input.value.length == 0) {
|
1344 |
-
return false;
|
1345 |
-
}
|
1346 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1347 |
-
return false;
|
1348 |
-
}
|
1349 |
-
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1350 |
-
hour = parseFloat(hour);
|
1351 |
-
if (document.getSelection() != '') {
|
1352 |
-
return true;
|
1353 |
-
}
|
1354 |
-
if ((hour < 0) || (hour > 12)) {
|
1355 |
-
return false;
|
1356 |
-
}
|
1357 |
-
}
|
1358 |
-
return true;
|
1359 |
-
}
|
1360 |
-
function checknumber(id,event) {
|
1361 |
-
if (typeof(event) != 'undefined') {
|
1362 |
-
var e = event; // for trans-browser compatibility
|
1363 |
-
var charCode = e.which || e.keyCode;
|
1364 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1365 |
-
return false;
|
1366 |
-
}
|
1367 |
-
}
|
1368 |
-
return true;
|
1369 |
-
}
|
1370 |
-
function checkminute(id,event) {
|
1371 |
-
if (typeof(event) != 'undefined') {
|
1372 |
-
var e = event; // for trans-browser compatibility
|
1373 |
-
var charCode = e.which || e.keyCode;
|
1374 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1375 |
-
return false;
|
1376 |
-
}
|
1377 |
-
minute = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1378 |
-
minute = parseFloat(minute);
|
1379 |
-
if (document.getSelection() != '') {
|
1380 |
-
return true;
|
1381 |
-
}
|
1382 |
-
if ((minute < 0) || (minute > 59)) {
|
1383 |
-
return false;
|
1384 |
-
}
|
1385 |
-
}
|
1386 |
-
return true;
|
1387 |
-
}
|
1388 |
-
function add_0(id) {
|
1389 |
-
input = document.getElementById(id);
|
1390 |
-
if (input.value.length == 1) {
|
1391 |
-
input.value = '0' + input.value;
|
1392 |
-
input.setAttribute("value", input.value);
|
1393 |
-
}
|
1394 |
-
}
|
1395 |
-
function change_type(type) {
|
1396 |
-
if (document.getElementById('daily1').value == '') {
|
1397 |
-
document.getElementById('daily1').value = 1;
|
1398 |
-
}
|
1399 |
-
else {
|
1400 |
-
document.getElementById('repeat_input').removeAttribute('style');
|
1401 |
-
}
|
1402 |
-
if (document.getElementById('weekly1').value == '') {
|
1403 |
-
document.getElementById('weekly1').value = 1;
|
1404 |
-
}
|
1405 |
-
if (document.getElementById('monthly1').value == '') {
|
1406 |
-
document.getElementById('monthly1').value = 1;
|
1407 |
-
}
|
1408 |
-
if (document.getElementById('yearly1').value == '') {
|
1409 |
-
document.getElementById('yearly1').value = 1;
|
1410 |
-
}
|
1411 |
-
switch (type) {
|
1412 |
-
case 'no_repeat':
|
1413 |
-
document.getElementById('daily').setAttribute('style', 'display:none');
|
1414 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1415 |
-
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1416 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1417 |
-
document.getElementById('month').value = '';
|
1418 |
-
document.getElementById('date_end').value = '';
|
1419 |
-
document.getElementById('repeat_until').setAttribute('style', 'display:none');
|
1420 |
-
break;
|
1421 |
-
|
1422 |
-
case 'daily':
|
1423 |
-
document.getElementById('daily').removeAttribute('style');
|
1424 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1425 |
-
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1426 |
-
document.getElementById('repeat').innerHTML = 'Day(s)';
|
1427 |
-
document.getElementById('repeat_input').value = document.getElementById('daily1').value;
|
1428 |
-
document.getElementById('month').value = '';
|
1429 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1430 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
1431 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1432 |
-
return input_value('daily1')
|
1433 |
-
};
|
1434 |
-
break;
|
1435 |
-
|
1436 |
-
case 'weekly':
|
1437 |
-
document.getElementById('daily').removeAttribute('style');
|
1438 |
-
document.getElementById('weekly').removeAttribute('style');
|
1439 |
-
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1440 |
-
document.getElementById('repeat').innerHTML = 'Week(s) on :';
|
1441 |
-
document.getElementById('repeat_input').value = document.getElementById('weekly1').value;
|
1442 |
-
document.getElementById('month').value = '';
|
1443 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1444 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
1445 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1446 |
-
return input_value('weekly1')
|
1447 |
-
};
|
1448 |
-
break;
|
1449 |
-
|
1450 |
-
case 'monthly':
|
1451 |
-
document.getElementById('daily').removeAttribute('style');
|
1452 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1453 |
-
document.getElementById('monthly').removeAttribute('style');
|
1454 |
-
document.getElementById('repeat').innerHTML = 'Month(s)'
|
1455 |
-
document.getElementById('repeat_input').value = document.getElementById('monthly1').value;
|
1456 |
-
document.getElementById('month').value = '';
|
1457 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1458 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
1459 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1460 |
-
return input_value('monthly1')
|
1461 |
-
};
|
1462 |
-
|
1463 |
-
break;
|
1464 |
-
|
1465 |
-
case 'yearly':
|
1466 |
-
document.getElementById('daily').removeAttribute('style');
|
1467 |
-
document.getElementById('year_month').removeAttribute('style');
|
1468 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1469 |
-
document.getElementById('monthly').removeAttribute('style');
|
1470 |
-
document.getElementById('repeat').innerHTML = 'Year(s) in ';
|
1471 |
-
document.getElementById('repeat_input').value = document.getElementById('yearly1').value;
|
1472 |
-
document.getElementById('month').value = '';
|
1473 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
1474 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1475 |
-
return input_value('yearly1')
|
1476 |
-
};
|
1477 |
-
break;
|
1478 |
-
}
|
1479 |
-
}
|
1480 |
-
function week_value() {
|
1481 |
-
var value = '';
|
1482 |
-
for (i = 1; i <= 7; i++) {
|
1483 |
-
if (document.getElementById('week_' + i).checked) {
|
1484 |
-
value = value + document.getElementById('week_' + i).value + ',';
|
1485 |
-
}
|
1486 |
-
}
|
1487 |
-
document.getElementById('week').value = value;
|
1488 |
-
}
|
1489 |
-
function input_repeat() {
|
1490 |
-
if (document.getElementById('repeat_input').value == 1) {
|
1491 |
-
document.getElementById('repeat_input').value = '';
|
1492 |
-
}
|
1493 |
-
document.getElementById('repeat_input').removeAttribute('style');
|
1494 |
-
}
|
1495 |
-
function radio_month() {
|
1496 |
-
if (document.getElementById('radio1').checked == true) {
|
1497 |
-
document.getElementById('monthly_list').disabled = true;
|
1498 |
-
document.getElementById('month_week').disabled = true;
|
1499 |
-
document.getElementById('month').disabled = false;
|
1500 |
-
}
|
1501 |
-
else {
|
1502 |
-
document.getElementById('month').disabled = true;
|
1503 |
-
document.getElementById('monthly_list').disabled = false;
|
1504 |
-
document.getElementById('month_week').disabled = false;
|
1505 |
-
}
|
1506 |
-
}
|
1507 |
-
function input_value(id) {
|
1508 |
-
document.getElementById(id).value = document.getElementById('repeat_input').value;
|
1509 |
-
}
|
1510 |
-
</script>
|
1511 |
-
<style>
|
1512 |
-
fieldset {
|
1513 |
-
border: 2px solid #4f9bc6;
|
1514 |
-
width: 100%;
|
1515 |
-
background: #fafbfd;
|
1516 |
-
padding: 13px;
|
1517 |
-
margin-top: 20px;
|
1518 |
-
-webkit-border-radius: 8px;
|
1519 |
-
-moz-border-radius: 8px;
|
1520 |
-
border-radius: 8px;
|
1521 |
-
|
1522 |
-
}
|
1523 |
-
.wd_button{
|
1524 |
-
border: 1px solid #D5D5D5 !important;
|
1525 |
-
border-radius: 10px;
|
1526 |
-
width: 30px;
|
1527 |
-
height: 25px;
|
1528 |
-
}
|
1529 |
-
</style>
|
1530 |
-
<table width="95%">
|
1531 |
-
<tr>
|
1532 |
-
<td width="100%" style="font-size:14px; font-weight:bold">
|
1533 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
1534 |
-
<br />
|
1535 |
-
This section allows you to create/edit the events of a particular calendar.<br/> You can add unlimited number of events for each calendar.
|
1536 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
1537 |
-
</td>
|
1538 |
-
</tr>
|
1539 |
-
<tbody>
|
1540 |
-
<tr>
|
1541 |
-
<td width="100%"><h2>Add an event for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
1542 |
-
<td align="right"><input type="button"
|
1543 |
-
<td align="right"><input type="button"
|
1544 |
-
<td align="right"><input type="button"
|
1545 |
-
</tr>
|
1546 |
-
</tbody>
|
1547 |
-
</table>
|
1548 |
-
<?php
|
1549 |
-
global $wpdb;
|
1550 |
-
$calendar = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id
|
1551 |
-
|
1552 |
-
|
1553 |
-
$query1 = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.category, " . $wpdb->prefix . "spidercalendar_event_category.title
|
1554 |
-
FROM " . $wpdb->prefix . "spidercalendar_event
|
1555 |
-
JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
1556 |
-
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id;");
|
1557 |
-
|
1558 |
-
$query2 = $wpdb->get_results("SELECT title,id FROM " . $wpdb->prefix . "spidercalendar_event_category");
|
1559 |
-
|
1560 |
-
?>
|
1561 |
-
<form action="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>" method="post" id="adminForm" name="adminForm">
|
1562 |
-
<table width="95%">
|
1563 |
-
<tr>
|
1564 |
-
<td style="width:45%">
|
1565 |
-
<div style="width:95%">
|
1566 |
-
<fieldset class="adminform">
|
1567 |
-
<legend>Event Details</legend>
|
1568 |
-
<table class="admintable">
|
1569 |
-
<tr>
|
1570 |
-
<td class="key"><label for="title">Title: </label></td>
|
1571 |
-
<td><input type="text" id="title" name="title" size="41"/></td>
|
1572 |
-
</tr>
|
1573 |
-
|
1574 |
-
<tr>
|
1575 |
-
<td class="key"><label for="category">Select Category: </label></td>
|
1576 |
-
<td>
|
1577 |
-
<select id="category" name="category" style="width:240px">
|
1578 |
-
<option value="0">--Select Category--</option>
|
1579 |
-
<?php foreach ($query2 as $key => $category) {
|
1580 |
-
?>
|
1581 |
-
<option value="<?php echo $category->id; ?>"><?php if(isset($category)) echo $category->title ?></option>
|
1582 |
-
<?php
|
1583 |
-
}
|
1584 |
-
?>
|
1585 |
-
</select>
|
1586 |
-
</td>
|
1587 |
-
</tr>
|
1588 |
-
<tr>
|
1589 |
-
<td class="key"><label for="date">Date: </label></td>
|
1590 |
-
<td>
|
1591 |
-
<input style="width:90px" class="inputbox" type="text" name="date" id="date" size="10" maxlength="10" value="" />
|
1592 |
-
<input type="reset" class="wd_button" value="..."
|
1593 |
-
</td>
|
1594 |
-
</tr>
|
1595 |
-
<tr>
|
1596 |
-
<td class="key"><label for="selhour_from">Time: </label></td>
|
1597 |
-
<?php if ($calendar->time_format == 1) { ?>
|
1598 |
-
<td>
|
1599 |
-
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
1600 |
-
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
1601 |
-
<select id="select_from" name="select_from">
|
1602 |
-
<option selected="selected">AM</option>
|
1603 |
-
<option>PM</option>
|
1604 |
-
</select>
|
1605 |
-
<span style="font-size:12px"> - </span>
|
1606 |
-
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
1607 |
-
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
1608 |
-
<select id="select_to" name="select_to">
|
1609 |
-
<option>AM</option>
|
1610 |
-
<option>PM</option>
|
1611 |
-
</select>
|
1612 |
-
</td>
|
1613 |
-
<?php } if ($calendar->time_format == 0) { ?>
|
1614 |
-
<td>
|
1615 |
-
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
1616 |
-
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
1617 |
-
<span style="font-size:12px"> - </span>
|
1618 |
-
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
1619 |
-
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
1620 |
-
</td>
|
1621 |
-
<?php }?>
|
1622 |
-
</tr>
|
1623 |
-
<tr>
|
1624 |
-
<td class="key"><label for="poststuff">Note: </label></td>
|
1625 |
-
<td>
|
1626 |
-
<div id="poststuff" style="width:100% !important;">
|
1627 |
-
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
1628 |
-
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
|
1629 |
-
<?php the_editor(stripslashes(""),"text_for_date","title" ); ?>
|
1630 |
-
</div>
|
1631 |
-
<?php }else{
|
1632 |
-
wp_editor("", "text_for_date"); }?>
|
1633 |
-
</div>
|
1634 |
-
</div>
|
1635 |
-
</td>
|
1636 |
-
</tr>
|
1637 |
-
<tr>
|
1638 |
-
<td class="key"><label for="published1">Published: </label></td>
|
1639 |
-
<td>
|
1640 |
-
<input type="radio" name="published" id="published0" value="0" class="inputbox">
|
1641 |
-
<label for="published0">No</label>
|
1642 |
-
<input type="radio" name="published" id="published1" value="1" checked="checked" class="inputbox">
|
1643 |
-
<label for="published1">Yes</label>
|
1644 |
-
</td>
|
1645 |
-
</tr>
|
1646 |
-
</table>
|
1647 |
-
</fieldset>
|
1648 |
-
</div>
|
1649 |
-
</td>
|
1650 |
-
<td style="padding-left:25px; vertical-align:top !important; width:45%">
|
1651 |
-
<div style="width:100%">
|
1652 |
-
<fieldset class="adminform" style="margin-left: -25px;"><legend>Repeat Event</legend>
|
1653 |
-
<table>
|
1654 |
-
<tr>
|
1655 |
-
<td valign="top">
|
1656 |
-
<input type="radio" id="no_repeat_type" value="no_repeat" name="repeat_method" checked="checked"
|
1657 |
-
<label for="no_repeat_type">Don't repeat this event</label>
|
1658 |
-
<br/>
|
1659 |
-
<input type="radio" id="daily_type" value="daily" name="repeat_method"
|
1660 |
-
<label for="daily_type">Repeat daily</label>
|
1661 |
-
<br/>
|
1662 |
-
<input type="radio" id="weekly_type" value="weekly" name="repeat_method"
|
1663 |
-
<label for="weekly_type">Repeat weekly</label>
|
1664 |
-
<br/>
|
1665 |
-
<input type="radio" id="monthly_type" value="monthly" name="repeat_method"
|
1666 |
-
<label for="monthly_type">Repeat monthly</label>
|
1667 |
-
<br/>
|
1668 |
-
<input type="radio" id="yearly_type" value="yearly" name="repeat_method"
|
1669 |
-
<label for="yearly_type">Repeat yearly</label>
|
1670 |
-
<br/>
|
1671 |
-
</td>
|
1672 |
-
<td style="padding-left:10px" valign="top">
|
1673 |
-
<div id="daily" style="display:none">Repeat every
|
1674 |
-
<input type="text" id="repeat_input" size="5" name="repeat"
|
1675 |
-
<label id="repeat"></label>
|
1676 |
-
<label id="year_month" style="display:none;">
|
1677 |
-
<select name="year_month" id="year_month" class="inputbox">
|
1678 |
-
<option value="1" selected="selected">January</option>
|
1679 |
-
<option value="2">February</option>
|
1680 |
-
<option value="3">March</option>
|
1681 |
-
<option value="4">April</option>
|
1682 |
-
<option value="5">May</option>
|
1683 |
-
<option value="6">June</option>
|
1684 |
-
<option value="7">July</option>
|
1685 |
-
<option value="8">August</option>
|
1686 |
-
<option value="9">September</option>
|
1687 |
-
<option value="10">October</option>
|
1688 |
-
<option value="11">November</option>
|
1689 |
-
<option value="12">December</option>
|
1690 |
-
</select>
|
1691 |
-
</label>
|
1692 |
-
</div>
|
1693 |
-
<br/>
|
1694 |
-
<input type="hidden" id="daily1"/>
|
1695 |
-
<input type="hidden" id="weekly1"/>
|
1696 |
-
<input type="hidden" id="monthly1"/>
|
1697 |
-
<input type="hidden" id="yearly1"/>
|
1698 |
-
<div class="key" id="weekly" style="display:none">
|
1699 |
-
<input type="checkbox" value="Mon" id="week_1"
|
1700 |
-
<input type="checkbox" value="Tue" id="week_2"
|
1701 |
-
<input type="checkbox" value="Wed" id="week_3"
|
1702 |
-
<input type="checkbox" value="Thu" id="week_4"
|
1703 |
-
<input type="checkbox" value="Fri" id="week_5"
|
1704 |
-
<input type="checkbox" value="Sat" id="week_6"
|
1705 |
-
<input type="checkbox" value="Sun" id="week_7"
|
1706 |
-
<input type="hidden" name="week" id="week"/>
|
1707 |
-
</div>
|
1708 |
-
<br/>
|
1709 |
-
<div class="key" id="monthly" style="display:none">
|
1710 |
-
<input type="radio" id="radio1"
|
1711 |
-
<input type="text"
|
1712 |
-
<input type="radio" id="radio2"
|
1713 |
-
<select name="monthly_list" id="monthly_list" class="inputbox">
|
1714 |
-
<option value="1">First</option>
|
1715 |
-
<option value="8">Second</option>
|
1716 |
-
<option value="15">Third</option>
|
1717 |
-
<option value="22">Fourth</option>
|
1718 |
-
<option value="last">Last</option>
|
1719 |
-
</select>
|
1720 |
-
<select name="month_week" id="month_week" class="inputbox">
|
1721 |
-
<option value="Mon">Monday</option>
|
1722 |
-
<option value="Tue">Tuesday</option>
|
1723 |
-
<option value="Wed">Wednesday</option>
|
1724 |
-
<option value="Thu">Thursday</option>
|
1725 |
-
<option value="Fri">Friday</option>
|
1726 |
-
<option value="Sat">Saturday</option>
|
1727 |
-
<option value="Sun">Sunday</option>
|
1728 |
-
</select>
|
1729 |
-
</div>
|
1730 |
-
<br/>
|
1731 |
-
<script>
|
1732 |
-
window.onload = radio_month();
|
1733 |
-
</script>
|
1734 |
-
</td>
|
1735 |
-
</tr>
|
1736 |
-
<tr id="repeat_until" style="display:none">
|
1737 |
-
<td>Repeat until: </td>
|
1738 |
-
<td>
|
1739 |
-
<input style="width:90px" class="inputbox" type="text" name="date_end" id="date_end" size="10" maxlength="10" value=""/>
|
1740 |
-
<input type="reset" class="wd_button" value="..."
|
1741 |
-
</td>
|
1742 |
-
</tr>
|
1743 |
-
</table>
|
1744 |
-
</fieldset>
|
1745 |
-
</div>
|
1746 |
-
</td>
|
1747 |
-
</tr>
|
1748 |
-
</table>
|
1749 |
-
<input type="hidden" name="option" value="com_spidercalendar"/>
|
1750 |
-
<input type="hidden" name="task" value=""/>
|
1751 |
-
<input type="hidden" name="calendar" value=""/>
|
1752 |
-
</form>
|
1753 |
-
<?php
|
1754 |
-
}
|
1755 |
-
|
1756 |
-
function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
1757 |
-
global $wpdb;
|
1758 |
-
$calendar = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where id
|
1759 |
-
|
1760 |
-
?>
|
1761 |
-
<style>
|
1762 |
-
.calendar .button {
|
1763 |
-
display: table-cell !important;
|
1764 |
-
}
|
1765 |
-
fieldset {
|
1766 |
-
border: 2px solid #4f9bc6; /*#CCA383 1462a5*/
|
1767 |
-
width: 100%;
|
1768 |
-
background: #fafbfd;
|
1769 |
-
padding: 13px;
|
1770 |
-
margin-top: 20px;
|
1771 |
-
-webkit-border-radius: 8px;
|
1772 |
-
-moz-border-radius: 8px;
|
1773 |
-
border-radius: 8px;
|
1774 |
-
}
|
1775 |
-
.wd_button{
|
1776 |
-
border: 1px solid #D5D5D5 !important;
|
1777 |
-
border-radius: 10px;
|
1778 |
-
width: 30px;
|
1779 |
-
height: 25px;
|
1780 |
-
}
|
1781 |
-
</style>
|
1782 |
-
<script language="javascript" type="text/javascript">
|
1783 |
-
function submitform(pressbutton) {
|
1784 |
-
if (document.getElementById('title').value == "") {
|
1785 |
-
alert('Provide the title:');
|
1786 |
-
}
|
1787 |
-
else {
|
1788 |
-
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
1789 |
-
document.getElementById('adminForm').submit();
|
1790 |
-
}
|
1791 |
-
}
|
1792 |
-
function submitbutton(pressbutton) {
|
1793 |
-
var form = document.adminForm;
|
1794 |
-
if (pressbutton == 'cancel_event') {
|
1795 |
-
submitform(pressbutton);
|
1796 |
-
return;
|
1797 |
-
}
|
1798 |
-
if (form.date.value.search(/^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/)) {
|
1799 |
-
alert('Invalid Date');
|
1800 |
-
}
|
1801 |
-
else if (form.date.value.search(/^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/)) {
|
1802 |
-
alert('Invalid Date');
|
1803 |
-
}
|
1804 |
-
else if (form.selhour_from.value == "" && form.selminute_from.value == "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1805 |
-
submitform(pressbutton);
|
1806 |
-
}
|
1807 |
-
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1808 |
-
submitform(pressbutton);
|
1809 |
-
}
|
1810 |
-
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value != "" && form.selminute_to.value != "") {
|
1811 |
-
submitform(pressbutton);
|
1812 |
-
}
|
1813 |
-
else {
|
1814 |
-
alert('Invalid Time');
|
1815 |
-
}
|
1816 |
-
}
|
1817 |
-
function checkhour(id,event) {
|
1818 |
-
if (typeof(event) != 'undefined') {
|
1819 |
-
var e = event; // for trans-browser compatibility
|
1820 |
-
var charCode = e.which || e.keyCode;
|
1821 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1822 |
-
return false;
|
1823 |
-
}
|
1824 |
-
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1825 |
-
hour = parseFloat(hour);
|
1826 |
-
if (document.getSelection() != '') {
|
1827 |
-
return true;
|
1828 |
-
}
|
1829 |
-
if ((hour < 0) || (hour > 23)) {
|
1830 |
-
return false;
|
1831 |
-
}
|
1832 |
-
}
|
1833 |
-
return true;
|
1834 |
-
}
|
1835 |
-
function check12hour(id,event) {
|
1836 |
-
if (typeof(event) != 'undefined') {
|
1837 |
-
var e = event; // for trans-browser compatibility
|
1838 |
-
var charCode = e.which || e.keyCode;
|
1839 |
-
input = document.getElementById(id);
|
1840 |
-
if (charCode == 48 && input.value.length == 0) {
|
1841 |
-
return false;
|
1842 |
-
}
|
1843 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1844 |
-
return false;
|
1845 |
-
}
|
1846 |
-
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1847 |
-
hour = parseFloat(hour);
|
1848 |
-
if (document.getSelection() != '') {
|
1849 |
-
return true;
|
1850 |
-
}
|
1851 |
-
if ((hour < 0) || (hour > 12)) {
|
1852 |
-
return false;
|
1853 |
-
}
|
1854 |
-
}
|
1855 |
-
return true;
|
1856 |
-
}
|
1857 |
-
function checknumber(id,event) {
|
1858 |
-
if (typeof(event) != 'undefined') {
|
1859 |
-
var e = event; // for trans-browser compatibility
|
1860 |
-
var charCode = e.which || e.keyCode;
|
1861 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1862 |
-
return false;
|
1863 |
-
}
|
1864 |
-
}
|
1865 |
-
return true;
|
1866 |
-
}
|
1867 |
-
function checkminute(id,event) {
|
1868 |
-
if (typeof(event) != 'undefined') {
|
1869 |
-
var e = event; // for trans-browser compatibility
|
1870 |
-
var charCode = e.which || e.keyCode;
|
1871 |
-
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1872 |
-
return false;
|
1873 |
-
}
|
1874 |
-
minute = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1875 |
-
minute = parseFloat(minute);
|
1876 |
-
if (document.getSelection() != '') {
|
1877 |
-
return true;
|
1878 |
-
}
|
1879 |
-
if ((minute < 0) || (minute > 59)) {
|
1880 |
-
return false;
|
1881 |
-
}
|
1882 |
-
}
|
1883 |
-
return true;
|
1884 |
-
}
|
1885 |
-
function add_0(id) {
|
1886 |
-
input = document.getElementById(id);
|
1887 |
-
if (input.value.length == 1) {
|
1888 |
-
input.value = '0' + input.value;
|
1889 |
-
input.setAttribute("value", input.value);
|
1890 |
-
}
|
1891 |
-
}
|
1892 |
-
function change_type(type) {
|
1893 |
-
if (document.getElementById('daily1').value == '') {
|
1894 |
-
document.getElementById('daily1').value = 1;
|
1895 |
-
}
|
1896 |
-
if (document.getElementById('weekly1').value == '') {
|
1897 |
-
document.getElementById('weekly1').value = 1;
|
1898 |
-
}
|
1899 |
-
if (document.getElementById('monthly1').value == '') {
|
1900 |
-
document.getElementById('monthly1').value = 1;
|
1901 |
-
}
|
1902 |
-
if (document.getElementById('yearly1').value == '') {
|
1903 |
-
document.getElementById('yearly1').value = 1;
|
1904 |
-
}
|
1905 |
-
switch (type) {
|
1906 |
-
case 'no_repeat':
|
1907 |
-
document.getElementById('daily').setAttribute('style', 'display:none');
|
1908 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1909 |
-
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1910 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1911 |
-
document.getElementById('repeat_until').setAttribute('style', 'display:none');
|
1912 |
-
document.getElementById('month').value = '';
|
1913 |
-
document.getElementById('date_end').value = ''
|
1914 |
-
break;
|
1915 |
-
|
1916 |
-
case 'daily':
|
1917 |
-
document.getElementById('daily').removeAttribute('style');
|
1918 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
1919 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1920 |
-
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1921 |
-
document.getElementById('repeat').innerHTML = 'Day(s)';
|
1922 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1923 |
-
return input_value('daily1')
|
1924 |
-
};
|
1925 |
-
document.getElementById('month').value = '';
|
1926 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1927 |
-
document.getElementById('repeat_input').value = document.getElementById('daily1').value;
|
1928 |
-
break;
|
1929 |
-
|
1930 |
-
case 'weekly':
|
1931 |
-
document.getElementById('daily').removeAttribute('style');
|
1932 |
-
document.getElementById('weekly').removeAttribute('style');
|
1933 |
-
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1934 |
-
document.getElementById('repeat').innerHTML = 'Week(s) on :';
|
1935 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1936 |
-
return input_value('weekly1')
|
1937 |
-
};
|
1938 |
-
document.getElementById('month').value = '';
|
1939 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1940 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
1941 |
-
document.getElementById('repeat_input').value = document.getElementById('weekly1').value;
|
1942 |
-
break;
|
1943 |
-
|
1944 |
-
case 'monthly':
|
1945 |
-
document.getElementById('daily').removeAttribute('style');
|
1946 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1947 |
-
document.getElementById('monthly').removeAttribute('style');
|
1948 |
-
document.getElementById('repeat').innerHTML = 'Month(s)'
|
1949 |
-
document.getElementById('repeat_input').value = document.getElementById('monthly1').value;
|
1950 |
-
document.getElementById('month').value = '';
|
1951 |
-
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1952 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
1953 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1954 |
-
return input_value('monthly1')
|
1955 |
-
};
|
1956 |
-
break;
|
1957 |
-
|
1958 |
-
case 'yearly':
|
1959 |
-
document.getElementById('daily').removeAttribute('style');
|
1960 |
-
document.getElementById('year_month').removeAttribute('style');
|
1961 |
-
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1962 |
-
document.getElementById('monthly').removeAttribute('style');
|
1963 |
-
document.getElementById('repeat').innerHTML = 'Year(s) in ';
|
1964 |
-
document.getElementById('repeat_input').value = document.getElementById('yearly1').value;
|
1965 |
-
document.getElementById('month').value = '';
|
1966 |
-
document.getElementById('repeat_until').removeAttribute('style');
|
1967 |
-
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1968 |
-
return input_value('yearly1')
|
1969 |
-
};
|
1970 |
-
break;
|
1971 |
-
}
|
1972 |
-
}
|
1973 |
-
function week_value() {
|
1974 |
-
var value = '';
|
1975 |
-
for (i = 1; i <= 7; i++) {
|
1976 |
-
if (document.getElementById('week_' + i).checked) {
|
1977 |
-
value = value + document.getElementById('week_' + i).value + ',';
|
1978 |
-
}
|
1979 |
-
}
|
1980 |
-
document.getElementById('week').value = value;
|
1981 |
-
}
|
1982 |
-
function radio_month() {
|
1983 |
-
if (document.getElementById('radio1').checked == true) {
|
1984 |
-
document.getElementById('monthly_list').disabled = true;
|
1985 |
-
document.getElementById('month_week').disabled = true;
|
1986 |
-
document.getElementById('month').disabled = false;
|
1987 |
-
}
|
1988 |
-
else {
|
1989 |
-
document.getElementById('month').disabled = true;
|
1990 |
-
document.getElementById('monthly_list').disabled = false;
|
1991 |
-
document.getElementById('month_week').disabled = false;
|
1992 |
-
}
|
1993 |
-
}
|
1994 |
-
function input_value(id) {
|
1995 |
-
document.getElementById(id).value = document.getElementById('repeat_input').value;
|
1996 |
-
}
|
1997 |
-
</script>
|
1998 |
-
<?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");
|
1999 |
-
|
2000 |
-
$query2 = $wpdb->get_results("SELECT title,id FROM " . $wpdb->prefix . "spidercalendar_event_category");
|
2001 |
-
?>
|
2002 |
-
<table width="95%">
|
2003 |
-
<tr>
|
2004 |
-
<td width="100%" style="font-size:14px; font-weight:bold">
|
2005 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
2006 |
-
<br />
|
2007 |
-
This section allows you to create/edit the events of a particular calendar.<br/> You can add unlimited number of events for each calendar.
|
2008 |
-
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
2009 |
-
</td>
|
2010 |
-
</tr>
|
2011 |
-
<tbody>
|
2012 |
-
<tr>
|
2013 |
-
<td width="100%"><h2>Edit an event for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
2014 |
-
<td align="right"><input type="button"
|
2015 |
-
<td align="right"><input type="button"
|
2016 |
-
<td align="right"><input type="button"
|
2017 |
-
</tr>
|
2018 |
-
</tbody>
|
2019 |
-
</table>
|
2020 |
-
|
2021 |
-
<form action="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm">
|
2022 |
-
<table width="95%">
|
2023 |
-
<tr>
|
2024 |
-
<td style="width:45%">
|
2025 |
-
<div style="width:95%">
|
2026 |
-
<fieldset class="adminform">
|
2027 |
-
<legend>Event Details</legend>
|
2028 |
-
<table class="admintable">
|
2029 |
-
<tr>
|
2030 |
-
<td class="key"><label for="message">Title: </label></td>
|
2031 |
-
<td><input type="text" id="title" name="title" size="41" value="<?php echo htmlspecialchars($row->title, ENT_QUOTES); ?>"/></td>
|
2032 |
-
</tr>
|
2033 |
-
<tr>
|
2034 |
-
<td class="key"><label for="category">Select Category: </label></td>
|
2035 |
-
<td>
|
2036 |
-
<select id="category" name="category" style="width:240px">
|
2037 |
-
<option value="0" <?php if ($row->category == "0") echo 'selected="selected"'; ?>><?php if(isset($category)) echo $category->title ?>--Select Category--</option>
|
2038 |
-
<?php foreach ($query2 as $key => $category) {
|
2039 |
-
?>
|
2040 |
-
<option value="<?php echo $category->id; ?>" <?php if ( $category->id == $row->category ) echo 'selected="selected"'; ?>><?php if(isset($category)) echo $category->title ?></option>
|
2041 |
-
<?php
|
2042 |
-
}
|
2043 |
-
?>
|
2044 |
-
|
2045 |
-
</select>
|
2046 |
-
</td>
|
2047 |
-
</tr>
|
2048 |
-
|
2049 |
-
<tr>
|
2050 |
-
<td class="key"><label for="message">Date: </label></td>
|
2051 |
-
<td>
|
2052 |
-
<input class="inputbox" style="width:90px" type="text" name="date" id="date" size="10" maxlength="10" value="<?php echo $row->date; ?>"/>
|
2053 |
-
<?php
|
2054 |
-
if ($row->date_end == '0000-00-00') {
|
2055 |
-
$row->date_end = "";
|
2056 |
-
}
|
2057 |
-
?>
|
2058 |
-
<input type="reset" class="wd_button" value="..."
|
2059 |
-
</td>
|
2060 |
-
</tr>
|
2061 |
-
<tr>
|
2062 |
-
<td class="key"><label for="message">Time: </label></td>
|
2063 |
-
<td>
|
2064 |
-
<?php
|
2065 |
-
if (!$row->time) {
|
2066 |
-
$from[0] = "";
|
2067 |
-
$from[1] = "";
|
2068 |
-
$to[0] = "";
|
2069 |
-
$to[1] = "";
|
2070 |
-
}
|
2071 |
-
else {
|
2072 |
-
$from_to = explode("-", $row->time);
|
2073 |
-
$from = explode(":", $from_to[0]);
|
2074 |
-
if (isset($from_to[1])) {
|
2075 |
-
$to = explode(":", $from_to[1]);
|
2076 |
-
}
|
2077 |
-
else {
|
2078 |
-
$to[0] = "";
|
2079 |
-
$to[1] = "";
|
2080 |
-
}
|
2081 |
-
}
|
2082 |
-
?>
|
2083 |
-
<?php if ($calendar->time_format == 0) { ?>
|
2084 |
-
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
2085 |
-
onkeypress="return checkhour('selhour_from',event)" value="<?php echo $from[0]; ?>" title="from"
|
2086 |
-
onblur="add_0('selhour_from')"/> <b>:</b>
|
2087 |
-
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
2088 |
-
onkeypress="return checkminute('selminute_from',event)" value="<?php echo substr($from[1], 0, 2); ?>"
|
2089 |
-
title="from"
|
2090 |
-
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
2091 |
-
onkeypress="return checkhour('selhour_to',event)" value="<?php echo $to[0]; ?>" title="to"
|
2092 |
-
onblur="add_0('selhour_to')"/> <b>:</b>
|
2093 |
-
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
2094 |
-
onkeypress="return checkminute('selminute_to',event)" value="<?php echo substr($to[1], 0, 2); ?>"
|
2095 |
-
title="to"
|
2096 |
-
<?php }
|
2097 |
-
if ($calendar->time_format == 1) { ?>
|
2098 |
-
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
2099 |
-
onkeypress="return check12hour('selhour_from',event)" value="<?php echo $from[0]; ?>" title="from"
|
2100 |
-
onblur="add_0('selhour_from')"/> <b>:</b>
|
2101 |
-
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
2102 |
-
onkeypress="return checkminute('selminute_from',event)" value="<?php echo substr($from[1], 0, 2); ?>"
|
2103 |
-
title="from"
|
2104 |
-
<select id="select_from" name="select_from">
|
2105 |
-
<option <?php if (substr($from[1], 2, 2) == "AM")
|
2106 |
-
echo 'selected="selected"'; ?>>AM
|
2107 |
-
</option>
|
2108 |
-
<option <?php if (substr($from[1], 2, 2) == "PM")
|
2109 |
-
echo 'selected="selected"'; ?>>PM
|
2110 |
-
</option>
|
2111 |
-
</select>
|
2112 |
-
<span style="font-size:12px"> - </span>
|
2113 |
-
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
2114 |
-
onkeypress="return check12hour('selhour_to',event)" value="<?php echo $to[0]; ?>" title="to"
|
2115 |
-
onblur="add_0('selhour_to')"/> <b>:</b>
|
2116 |
-
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
2117 |
-
onkeypress="return checkminute('selminute_to',event)" value="<?php echo substr($to[1], 0, 2); ?>"
|
2118 |
-
title="to"
|
2119 |
-
<select id="select_to" name="select_to">
|
2120 |
-
<option <?php if (substr($to[1], 2, 2) == "AM")
|
2121 |
-
echo 'selected="selected"'; ?>>AM
|
2122 |
-
</option>
|
2123 |
-
<option <?php if (substr($to[1], 2, 2) == "PM")
|
2124 |
-
echo 'selected="selected"'; ?>>PM
|
2125 |
-
</option>
|
2126 |
-
</select>
|
2127 |
-
<?php }?>
|
2128 |
-
</td>
|
2129 |
-
</tr>
|
2130 |
-
<tr>
|
2131 |
-
<td class="key"><label for="note">Note: </label></td>
|
2132 |
-
<td>
|
2133 |
-
<div id="poststuff" style="width:100% !important;">
|
2134 |
-
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
2135 |
-
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor(stripslashes($row->description),"text_for_date","title" ); ?>
|
2136 |
-
</div>
|
2137 |
-
<?php }else{
|
2138 |
-
if(isset($row->text_for_date)) $desc1 = $row->text_for_date;
|
2139 |
-
else $desc1 = "";
|
2140 |
-
wp_editor($desc1, "text_for_date"); }?>
|
2141 |
-
</div>
|
2142 |
-
</div>
|
2143 |
-
</td>
|
2144 |
-
</tr>
|
2145 |
-
<tr>
|
2146 |
-
<td class="key"><label for="note">Published: </label></td>
|
2147 |
-
<td>
|
2148 |
-
<input type="radio" name="published" id="published0" value="0" <?php cheched($row->published, '0'); ?> class="inputbox">
|
2149 |
-
<label for="published0">No</label>
|
2150 |
-
<input type="radio" name="published" id="published1" value="1" <?php cheched($row->published, '1'); ?> class="inputbox">
|
2151 |
-
<label for="published1">Yes</label>
|
2152 |
-
</td>
|
2153 |
-
</tr>
|
2154 |
-
</table>
|
2155 |
-
</fieldset>
|
2156 |
-
</div>
|
2157 |
-
</td>
|
2158 |
-
<td style="padding-left:25px; vertical-align:top !important; width:45%">
|
2159 |
-
<div style="width:100%">
|
2160 |
-
<fieldset class="adminform" style="margin-left: -25px;">
|
2161 |
-
<legend>Repeat Event</legend>
|
2162 |
-
<table>
|
2163 |
-
<tr>
|
2164 |
-
<td valign="top">
|
2165 |
-
<input type="radio" value="no_repeat" id="no_repeat_type" name="repeat_method" <?php if ($row->repeat_method == 'no_repeat')
|
2166 |
-
echo 'checked="checked"' ?> checked="checked"
|
2167 |
-
<label for="no_repeat_type">Don't repeat this event</label><br/>
|
2168 |
-
|
2169 |
-
<input type="radio" value="daily" id="daily_type" name="repeat_method" <?php if ($row->repeat_method == 'daily')
|
2170 |
-
echo 'checked="checked"' ?> onchange="change_type('daily')"/>
|
2171 |
-
<label for="daily_type">Repeat daily</label><br/>
|
2172 |
-
|
2173 |
-
<input type="radio" value="weekly" id="weekly_type" name="repeat_method" <?php if ($row->repeat_method == 'weekly')
|
2174 |
-
echo 'checked="checked"' ?>
|
2175 |
-
<label for="weekly_type">Repeat weekly</label>
|
2176 |
-
<br/>
|
2177 |
-
<input type="radio" value="monthly" id="monthly_type" name="repeat_method" <?php if ($row->repeat_method == 'monthly')
|
2178 |
-
echo 'checked="checked"'?>
|
2179 |
-
<label for="monthly_type">Repeat monthly</label>
|
2180 |
-
<br/>
|
2181 |
-
<input type="radio" value="yearly" id="yearly_type" name="repeat_method" <?php if ($row->repeat_method == 'yearly')
|
2182 |
-
echo 'checked="checked"' ?>
|
2183 |
-
<label for="yearly_type">Repeat yearly</label>
|
2184 |
-
<br/>
|
2185 |
-
</td>
|
2186 |
-
<td style="padding-left:10px" valign="top">
|
2187 |
-
<div id="daily" style="display:<?php if ($row->repeat_method == 'no_repeat') echo 'none'; ?>">
|
2188 |
-
Repeat every <input type="text" id="repeat_input" size="5" name="repeat"
|
2189 |
-
<label id="repeat"><?php if ($row->repeat_method == 'daily')
|
2190 |
-
echo 'Day(s)';
|
2191 |
-
if ($row->repeat_method == 'weekly')
|
2192 |
-
echo 'Week(s) on :';
|
2193 |
-
if ($row->repeat_method == 'monthly')
|
2194 |
-
echo 'Month(s)';
|
2195 |
-
if ($row->repeat_method == 'yearly')
|
2196 |
-
echo 'Year(s) in';
|
2197 |
-
?></label>
|
2198 |
-
<label id="year_month" style="display:<?php if ($row->repeat_method != 'yearly') echo 'none'; ?>">
|
2199 |
-
<select name="year_month" id="year_month" class="inputbox">
|
2200 |
-
<option value="1" <?php echo selectted($row->year_month, '1'); ?>>January</option>
|
2201 |
-
<option value="2" <?php echo selectted($row->year_month, '2'); ?>>February</option>
|
2202 |
-
<option value="3" <?php echo selectted($row->year_month, '3'); ?>>March</option>
|
2203 |
-
<option value="4" <?php echo selectted($row->year_month, '4'); ?>>April</option>
|
2204 |
-
<option value="5" <?php echo selectted($row->year_month, '5'); ?>>May</option>
|
2205 |
-
<option value="6" <?php echo selectted($row->year_month, '6'); ?>>June</option>
|
2206 |
-
<option value="7" <?php echo selectted($row->year_month, '7'); ?>>July</option>
|
2207 |
-
<option value="8" <?php echo selectted($row->year_month, '8'); ?>>August</option>
|
2208 |
-
<option value="9" <?php echo selectted($row->year_month, '9'); ?>>September</option>
|
2209 |
-
<option value="10" <?php echo selectted($row->year_month, '10'); ?>>October</option>
|
2210 |
-
<option value="11" <?php echo selectted($row->year_month, '11'); ?>>November</option>
|
2211 |
-
<option value="12" <?php echo selectted($row->year_month, '12'); ?>>December</option>
|
2212 |
-
</select></label>
|
2213 |
-
<input type="hidden" value="<?php if ($row->repeat_method == 'daily') echo $row->repeat; ?>" id="daily1"/>
|
2214 |
-
<input type="hidden" value="<?php if ($row->repeat_method == 'weekly') echo $row->repeat; ?>" id="weekly1"/>
|
2215 |
-
<input type="hidden" value="<?php if ($row->repeat_method == 'monthly') echo $row->repeat; ?>" id="monthly1"/>
|
2216 |
-
<input type="hidden" value="<?php if ($row->repeat_method == 'yearly') echo $row->repeat; ?>" id="yearly1"/>
|
2217 |
-
</div>
|
2218 |
-
<br/>
|
2219 |
-
<div class="key" id="weekly" style="display:<?php if ($row->repeat_method != 'weekly') echo 'none'; ?>">
|
2220 |
-
<input type="checkbox" value="Mon" id="week_1"
|
2221 |
-
<input type="checkbox" value="Tue" id="week_2"
|
2222 |
-
<input type="checkbox" value="Wed" id="week_3"
|
2223 |
-
<input type="checkbox" value="Thu" id="week_4"
|
2224 |
-
<input type="checkbox" value="Fri" id="week_5"
|
2225 |
-
<input type="checkbox" value="Sat" id="week_6"
|
2226 |
-
<input type="checkbox" value="Sun" id="week_7"
|
2227 |
-
<input type="hidden" name="week" id="week" value="<?php echo $row->week ?>"/>
|
2228 |
-
</div>
|
2229 |
-
<br/>
|
2230 |
-
<div class="key" id="monthly" style="display:<?php if ($row->repeat_method != 'monthly' && $row->repeat_method != 'yearly') echo 'none'; ?>">
|
2231 |
-
<input type="radio" id="radio1" name="month_type"
|
2232 |
-
echo 'checked="checked"' ?> />on the: <input type="text" name="month" size="3"
|
2233 |
-
value="<?php echo $row->month; ?>"/><br/>
|
2234 |
-
<input type="radio" id="radio2" name="month_type"
|
2235 |
-
<select name="monthly_list" id="monthly_list" class="inputbox">
|
2236 |
-
<option <?php echo selectted($row->monthly_list, '1'); ?> value="1">First</option>
|
2237 |
-
<option <?php echo selectted($row->monthly_list, '8'); ?> value="8">Second</option>
|
2238 |
-
<option <?php echo selectted($row->monthly_list, '15'); ?> value="15">Third</option>
|
2239 |
-
<option <?php echo selectted($row->monthly_list, '22'); ?> value="22">Fourth</option>
|
2240 |
-
<option <?php echo selectted($row->monthly_list, 'last'); ?> value="last">Last</option>
|
2241 |
-
</select>
|
2242 |
-
<select name="month_week" id="month_week" class="inputbox">
|
2243 |
-
<option <?php echo selectted($row->month_week, 'Mon'); ?> value="Mon">Monday</option>
|
2244 |
-
<option <?php echo selectted($row->month_week, 'Tue'); ?> value="Tue">Tuesday</option>
|
2245 |
-
<option <?php echo selectted($row->month_week, 'Wed'); ?> value="Wed">Wednesday</option>
|
2246 |
-
<option <?php echo selectted($row->month_week, 'Thu'); ?> value="Thu">Thursday</option>
|
2247 |
-
<option <?php echo selectted($row->month_week, 'Fri'); ?> value="Fri">Friday</option>
|
2248 |
-
<option <?php echo selectted($row->month_week, 'Sat'); ?> value="Sat">Saturday</option>
|
2249 |
-
<option <?php echo selectted($row->month_week, 'Sun'); ?> value="Sun">Sunday</option>
|
2250 |
-
</select>
|
2251 |
-
</div>
|
2252 |
-
<br/>
|
2253 |
-
<script>
|
2254 |
-
window.onload = radio_month();
|
2255 |
-
</script>
|
2256 |
-
</td>
|
2257 |
-
</tr>
|
2258 |
-
<tr id="repeat_until" style="display:<?php if ($row->repeat_method == 'no_repeat') echo 'none'; ?>">
|
2259 |
-
<td>Repeat until: </td>
|
2260 |
-
<?php
|
2261 |
-
if ($row->date_end == '2070-12-12') {
|
2262 |
-
$row->date_end = '';
|
2263 |
-
}
|
2264 |
-
?>
|
2265 |
-
<td>
|
2266 |
-
<input style="width:90px" class="inputbox" type="text" name="date_end" id="date_end" size="10" maxlength="10" value="<?php echo $row->date_end; ?>"/>
|
2267 |
-
<input type="reset" class="wd_button" value="..."
|
2268 |
-
</td>
|
2269 |
-
</tr>
|
2270 |
-
</table>
|
2271 |
-
</fieldset>
|
2272 |
-
</div>
|
2273 |
-
</td>
|
2274 |
-
</tr>
|
2275 |
-
</table>
|
2276 |
-
<input type="hidden" name="option" value="com_spidercalendar"/>
|
2277 |
-
<input type="hidden" name="id" value="<?php echo $row->id; ?>"/>
|
2278 |
-
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
2279 |
-
<input type="hidden" name="task" value="event"/>
|
2280 |
-
<input type="hidden" name="calendar" value=""/>
|
2281 |
</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 |
+
function html_show_spider_calendar($rows, $pageNav, $sort) {
|
8 |
+
?>
|
9 |
+
<script language="javascript">
|
10 |
+
function confirmation(href, title) {
|
11 |
+
var answer = confirm("Are you sure you want to delete '" + title + "'?")
|
12 |
+
if (answer) {
|
13 |
+
document.getElementById('admin_form').action = href;
|
14 |
+
document.getElementById('admin_form').submit();
|
15 |
+
}
|
16 |
+
}
|
17 |
+
function ordering(name, as_or_desc) {
|
18 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
19 |
+
document.getElementById('order_by').value = name;
|
20 |
+
document.getElementById('admin_form').submit();
|
21 |
+
}
|
22 |
+
function submit_form_id(x) {
|
23 |
+
var val = x.options[x.selectedIndex].value;
|
24 |
+
document.getElementById("id_for_playlist").value = val;
|
25 |
+
document.getElementById("admin_form").submit();
|
26 |
+
}
|
27 |
+
function doNothing() {
|
28 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
29 |
+
if (keyCode == 13) {
|
30 |
+
if (!e) var e = window.event;
|
31 |
+
e.cancelBubble = true;
|
32 |
+
e.returnValue = false;
|
33 |
+
if (e.stopPropagation) {
|
34 |
+
e.stopPropagation();
|
35 |
+
e.preventDefault();
|
36 |
+
}
|
37 |
+
}
|
38 |
+
}
|
39 |
+
var show_one_cal = 1;
|
40 |
+
var get_cal_id = 0;
|
41 |
+
function show_calendar_inline(cal_id) {
|
42 |
+
if (show_one_cal == 1) {
|
43 |
+
show_one_cal = 0;
|
44 |
+
jQuery.ajax({
|
45 |
+
type:'POST',
|
46 |
+
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineedit') ?>',
|
47 |
+
data:{calendar_id:cal_id},
|
48 |
+
dataType:'html',
|
49 |
+
success:function (data) {
|
50 |
+
cancel_qiucik_edit(get_cal_id);
|
51 |
+
var edit_cal_tr = document.createElement("tr")
|
52 |
+
edit_cal_tr.innerHTML = data;
|
53 |
+
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')
|
54 |
+
edit_cal_tr.setAttribute('id', 'edit_calendar-' + cal_id);
|
55 |
+
|
56 |
+
document.getElementById('Calendar-' + cal_id).style.display = "none";
|
57 |
+
document.getElementById('calendar_body').appendChild(edit_cal_tr);
|
58 |
+
document.getElementById('calendar_body').insertBefore(edit_cal_tr, document.getElementById('Calendar-' + cal_id));
|
59 |
+
get_cal_id = cal_id;
|
60 |
+
show_one_cal = 1
|
61 |
+
}
|
62 |
+
});
|
63 |
+
}
|
64 |
+
}
|
65 |
+
function cancel_qiucik_edit(cal_id) {
|
66 |
+
if (document.getElementById('edit_calendar-' + cal_id)) {
|
67 |
+
var tr = document.getElementById('edit_calendar-' + cal_id);
|
68 |
+
tr.parentNode.removeChild(tr);
|
69 |
+
document.getElementById('Calendar-' + cal_id).style.display = "";
|
70 |
+
}
|
71 |
+
}
|
72 |
+
function updae_inline_sp_calendar(cal_id) {
|
73 |
+
var cal_title = document.getElementById('calendar_title').value;
|
74 |
+
var cal_12_format = getCheckedValue(document.getElementsByName('time_format'));
|
75 |
+
var def_year = document.getElementById('def_year').value;
|
76 |
+
var def_month = document.getElementById('def_month').value;
|
77 |
+
document.getElementById('imig_for_waiting').style.display = "block";
|
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('imig_for_waiting').style.display = "none";
|
92 |
+
document.getElementById('Calendar-' + cal_id).innerHTML = data;
|
93 |
+
cancel_qiucik_edit(cal_id);
|
94 |
+
}
|
95 |
+
else {
|
96 |
+
alert('ERROR PLEAS INSTALL PLUGIN AGAIN');
|
97 |
+
cancel_qiucik_edit(cal_id);
|
98 |
+
}
|
99 |
+
}
|
100 |
+
});
|
101 |
+
}
|
102 |
+
function getCheckedValue(radioObj) {
|
103 |
+
if (!radioObj)
|
104 |
+
return "";
|
105 |
+
var radioLength = radioObj.length;
|
106 |
+
if (radioLength == undefined)
|
107 |
+
if (radioObj.checked)
|
108 |
+
return radioObj.value;
|
109 |
+
else
|
110 |
+
return "";
|
111 |
+
for (var i = 0; i < radioLength; i++) {
|
112 |
+
if (radioObj[i].checked) {
|
113 |
+
return radioObj[i].value;
|
114 |
+
}
|
115 |
+
}
|
116 |
+
return "";
|
117 |
+
}
|
118 |
+
</script>
|
119 |
+
<form method="post" onKeyPress="doNothing()" action="admin.php?page=SpiderCalendar" id="admin_form" name="admin_form">
|
120 |
+
<table cellspacing="10" width="100%" id="calendar_table">
|
121 |
+
<tr>
|
122 |
+
<td width="100%" style="font-size:14px; font-weight:bold">
|
123 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
124 |
+
<br />
|
125 |
+
This section allows you to create calendars. You can add unlimited number of calendars.
|
126 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
127 |
+
</td>
|
128 |
+
<td colspan="7" align="right" style="font-size:16px;">
|
129 |
+
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
130 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
131 |
+
Get the full version
|
132 |
+
</a>
|
133 |
+
</td>
|
134 |
+
</tr>
|
135 |
+
<tr>
|
136 |
+
<td style="width:210px"><h2>Calendar Manager</h2></td>
|
137 |
+
<td style="width:90px; text-align:right;">
|
138 |
+
<p class="submit" style="padding:0px; text-align:left">
|
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 |
+
<td style="text-align:right;font-size:16px;padding:20px; padding-right:50px">
|
143 |
+
</td>
|
144 |
+
</tr>
|
145 |
+
</table>
|
146 |
+
<?php
|
147 |
+
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
148 |
+
$serch_value = $_POST['search_events_by_title'];
|
149 |
+
}
|
150 |
+
else {
|
151 |
+
$serch_value = "";
|
152 |
+
}
|
153 |
+
$serch_fields = '
|
154 |
+
<div class="alignleft actions">
|
155 |
+
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
156 |
+
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()">
|
157 |
+
</div>
|
158 |
+
<div class="alignleft actions">
|
159 |
+
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
160 |
+
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
161 |
+
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=SpiderCalendar\'" class="button-secondary action">
|
162 |
+
</div>';
|
163 |
+
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
164 |
+
?>
|
165 |
+
<table class="wp-list-table widefat fixed pages" style="width:95%">
|
166 |
+
<thead>
|
167 |
+
<TR>
|
168 |
+
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
169 |
+
<a href="javascript:ordering('id',<?php echo(($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
170 |
+
<span>ID</span>
|
171 |
+
<span class="sorting-indicator"></span>
|
172 |
+
</a>
|
173 |
+
</th>
|
174 |
+
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
175 |
+
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
176 |
+
<span>Title</span>
|
177 |
+
<span class="sorting-indicator"></span>
|
178 |
+
</a>
|
179 |
+
</th>
|
180 |
+
<th style="width:100px">Manage Events</th>
|
181 |
+
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
182 |
+
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
183 |
+
<span>Published</span>
|
184 |
+
<span class="sorting-indicator"></span>
|
185 |
+
</a>
|
186 |
+
</th>
|
187 |
+
</TR>
|
188 |
+
</thead>
|
189 |
+
<tbody id="calendar_body">
|
190 |
+
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
191 |
+
<tr id="Calendar-<?php echo $rows[$i]->id; ?>" class=" hentry alternate iedit author-self" style="display:table-row;">
|
192 |
+
<td><?php echo $rows[$i]->id; ?></td>
|
193 |
+
<td class="post-title page-title column-title">
|
194 |
+
<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>
|
195 |
+
<div class="row-actions">
|
196 |
+
<span class="edit">
|
197 |
+
<a href="admin.php?page=SpiderCalendar&task=edit_calendar&id=<?php echo $rows[$i]->id; ?>" title="Edit This Calendar">Edit</a> | </span>
|
198 |
+
<span class="inline hide-if-no-js">
|
199 |
+
<a href="#" class="editinline" onClick="show_calendar_inline(<?php echo $rows[$i]->id; ?>)" title="Edit This Calendar Inline">Quick Edit</a> | </span>
|
200 |
+
<span class="trash">
|
201 |
+
<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>
|
202 |
+
</div>
|
203 |
+
</td>
|
204 |
+
<td><a href="admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id=<?php echo $rows[$i]->id; ?>">Manage events</a></td>
|
205 |
+
<td><a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?>
|
206 |
+
href="admin.php?page=SpiderCalendar&task=published&id=<?php echo $rows[$i]->id; ?>"><?php if ($rows[$i]->published) echo 'Yes'; else echo 'No'; ?></a>
|
207 |
+
</td>
|
208 |
+
</tr>
|
209 |
+
<?php } ?>
|
210 |
+
</tbody>
|
211 |
+
</table>
|
212 |
+
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo $_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 $_POST['asc_or_desc'];?>"/>
|
214 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo $_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 |
+
<table width="95%">
|
268 |
+
<tr>
|
269 |
+
<td width="100%" style="font-size:14px; font-weight:bold">
|
270 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
271 |
+
<br />
|
272 |
+
This section allows you to create calendars. You can add unlimited number of calendars.
|
273 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
274 |
+
</td>
|
275 |
+
<td colspan="7" align="right" style="font-size:16px;">
|
276 |
+
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
277 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
278 |
+
Get the full version
|
279 |
+
</a>
|
280 |
+
</td>
|
281 |
+
</tr>
|
282 |
+
<tr>
|
283 |
+
<td width="100%"><h2>Add Calendar</h2></td>
|
284 |
+
<td align="right"><input type="button" onClick="submitbutton('Save')" value="Save" class="button-secondary action"></td>
|
285 |
+
<td align="right"><input type="button" onClick="submitbutton('Apply')" value="Apply" class="button-secondary action"></td>
|
286 |
+
<td align="right"><input type="button" onClick="window.location.href='admin.php?page=SpiderCalendar'" value="Cancel" class="button-secondary action"></td>
|
287 |
+
</tr>
|
288 |
+
</table>
|
289 |
+
|
290 |
+
<form onKeyPress="doNothing()" action="admin.php?page=SpiderCalendar" method="post" name="adminForm" id="adminForm">
|
291 |
+
<table class="form-table" style="width:400px">
|
292 |
+
<tr>
|
293 |
+
<td class="key"><label for="name">Title: </label></td>
|
294 |
+
<td><input type="text" name="title" id="title" size="30" value=""/></td>
|
295 |
+
</tr>
|
296 |
+
<tr>
|
297 |
+
<td class="key"><label for="def_year">Default Year: </label></td>
|
298 |
+
<td><input type="text" name="def_year" id="def_year" size="30" value=""/></td>
|
299 |
+
</tr>
|
300 |
+
<tr>
|
301 |
+
<td class="key"><label for="def_month">Default Month: </label></td>
|
302 |
+
<td>
|
303 |
+
<select id="def_month" name="def_month">
|
304 |
+
<option selected="selected" value="">Current</option>
|
305 |
+
<?php
|
306 |
+
$month_array = array(
|
307 |
+
'01' => 'January',
|
308 |
+
'02' => 'February',
|
309 |
+
'03' => 'March',
|
310 |
+
'04' => 'April',
|
311 |
+
'05' => 'May',
|
312 |
+
'06' => 'June',
|
313 |
+
'07' => 'July',
|
314 |
+
'08' => 'August',
|
315 |
+
'09' => 'September',
|
316 |
+
'10' => 'October',
|
317 |
+
'11' => 'November',
|
318 |
+
'12' => 'December',
|
319 |
+
);
|
320 |
+
foreach ($month_array as $key => $def_month) {
|
321 |
+
?>
|
322 |
+
<option value="<?php echo $key;?>"><?php echo $def_month;?></option>
|
323 |
+
<?php
|
324 |
+
}
|
325 |
+
?>
|
326 |
+
</select>
|
327 |
+
</td>
|
328 |
+
</tr>
|
329 |
+
<tr>
|
330 |
+
<td class="key"><label for="name">Use 12-hour time format: </label></td>
|
331 |
+
<td>
|
332 |
+
<input type="radio" name="time_format" id="time_format0" value="0" checked="checked" class="inputbox">
|
333 |
+
<label for="time_format0">No</label>
|
334 |
+
<input type="radio" name="time_format" id="time_format1" value="1" class="inputbox">
|
335 |
+
<label for="time_format1">Yes</label>
|
336 |
+
</td>
|
337 |
+
</tr>
|
338 |
+
<tr>
|
339 |
+
<td class="key"><label for="published">Published: </label></td>
|
340 |
+
<td>
|
341 |
+
<input type="radio" name="published" id="published0" value="0" class="inputbox">
|
342 |
+
<label for="published0">No</label>
|
343 |
+
<input type="radio" name="published" id="published1" value="1" checked="checked" class="inputbox">
|
344 |
+
<label for="published1">Yes</label>
|
345 |
+
</td>
|
346 |
+
</tr>
|
347 |
+
</table>
|
348 |
+
<input type="hidden" name="option" value="com_spidercalendar"/>
|
349 |
+
<input type="hidden" name="id" value=""/>
|
350 |
+
<input type="hidden" name="cid[]" value=""/>
|
351 |
+
<input type="hidden" name="task" value=""/>
|
352 |
+
</form>
|
353 |
+
<?php
|
354 |
+
}
|
355 |
+
|
356 |
+
function html_edit_spider_calendar($row) {
|
357 |
+
?>
|
358 |
+
<script language="javascript" type="text/javascript">
|
359 |
+
function submitbutton(pressbutton) {
|
360 |
+
var form = document.adminForm;
|
361 |
+
if (pressbutton == 'cancel_calendar') {
|
362 |
+
submitform(pressbutton);
|
363 |
+
return;
|
364 |
+
}
|
365 |
+
submitform(pressbutton);
|
366 |
+
}
|
367 |
+
function submitform(pressbutton) {
|
368 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
369 |
+
if (document.getElementById('title').value == "") {
|
370 |
+
alert('Provide calendar title:');
|
371 |
+
}
|
372 |
+
else {
|
373 |
+
document.getElementById('adminForm').submit();
|
374 |
+
}
|
375 |
+
}
|
376 |
+
function doNothing() {
|
377 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
378 |
+
if (keyCode == 13) {
|
379 |
+
if (!e) {
|
380 |
+
var e = window.event;
|
381 |
+
}
|
382 |
+
e.cancelBubble = true;
|
383 |
+
e.returnValue = false;
|
384 |
+
if (e.stopPropagation) {
|
385 |
+
e.stopPropagation();
|
386 |
+
e.preventDefault();
|
387 |
+
}
|
388 |
+
}
|
389 |
+
}
|
390 |
+
</script>
|
391 |
+
<style>
|
392 |
+
.calendar .button {
|
393 |
+
display: table-cell !important;
|
394 |
+
}
|
395 |
+
.wd_button{
|
396 |
+
border: 1px solid #D5D5D5 !important;
|
397 |
+
border-radius: 10px;
|
398 |
+
width: 30px;
|
399 |
+
height: 25px;
|
400 |
+
}
|
401 |
+
</style>
|
402 |
+
<table width="95%">
|
403 |
+
<tr>
|
404 |
+
<td width="100%" style="font-size:14px; font-weight:bold">
|
405 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
406 |
+
<br />
|
407 |
+
This section allows you to create calendars. You can add unlimited number of calendars.
|
408 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
409 |
+
</td>
|
410 |
+
<td colspan="7" align="right" style="font-size:16px;">
|
411 |
+
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
412 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
413 |
+
Get the full version
|
414 |
+
</a>
|
415 |
+
</td>
|
416 |
+
</tr>
|
417 |
+
<tr>
|
418 |
+
<td width="100%"><h2>Calendar - <?php echo $row->title; ?></h2></td>
|
419 |
+
<td align="right"><input type="button" onClick="submitbutton('Save')" value="Save" class="button-secondary action"></td>
|
420 |
+
<td align="right"><input type="button" onClick="submitbutton('Apply')" value="Apply" class="button-secondary action"></td>
|
421 |
+
<td align="right"><input type="button" onClick="window.location.href='admin.php?page=SpiderCalendar'" value="Cancel" class="button-secondary action"></td>
|
422 |
+
</tr>
|
423 |
+
</table>
|
424 |
+
|
425 |
+
<form onKeyPress="doNothing()" action="admin.php?page=SpiderCalendar&id=<?php echo $row->id; ?>" method="post" name="adminForm" id="adminForm">
|
426 |
+
<table class="form-table" style="width:400px">
|
427 |
+
<tr>
|
428 |
+
<td class="key"><label for="name">Title: </label></td>
|
429 |
+
<td><input type="text" name="title" id="title" size="30" value="<?php echo $row->title; ?>"/></td>
|
430 |
+
</tr>
|
431 |
+
<tr>
|
432 |
+
<td class="key"><label for="name">Default Year: </label></td>
|
433 |
+
<td><input type="text" name="def_year" id="def_year" size="30" value="<?php echo $row->def_year; ?>"/></td>
|
434 |
+
</tr>
|
435 |
+
<tr>
|
436 |
+
<td class="key"><label for="name">Default Month: </label></td>
|
437 |
+
<td>
|
438 |
+
<select id="def_month" name="def_month">
|
439 |
+
<?php
|
440 |
+
$month_array = array(
|
441 |
+
'' => 'Current',
|
442 |
+
'01' => 'January',
|
443 |
+
'02' => 'February',
|
444 |
+
'03' => 'March',
|
445 |
+
'04' => 'April',
|
446 |
+
'05' => 'May',
|
447 |
+
'06' => 'June',
|
448 |
+
'07' => 'July',
|
449 |
+
'08' => 'August',
|
450 |
+
'09' => 'September',
|
451 |
+
'10' => 'October',
|
452 |
+
'11' => 'November',
|
453 |
+
'12' => 'December',
|
454 |
+
);
|
455 |
+
foreach ($month_array as $key => $def_month) {
|
456 |
+
?>
|
457 |
+
<option <?php echo (($row->def_month == $key) ? 'selected="selected"' : ''); ?> value="<?php echo $key; ?>"><?php echo $def_month; ?></option>
|
458 |
+
<?php
|
459 |
+
}
|
460 |
+
?>
|
461 |
+
</select>
|
462 |
+
</td>
|
463 |
+
</tr>
|
464 |
+
<tr>
|
465 |
+
<td class="key"><label for="name">Use 12 hours time format: </label></td>
|
466 |
+
<td>
|
467 |
+
<input type="radio" name="time_format" id="time_format0" value="0" <?php cheched($row->time_format, '0'); ?> class="inputbox">
|
468 |
+
<label for="time_format0">No</label>
|
469 |
+
<input type="radio" name="time_format" id="time_format1" value="1" <?php cheched($row->time_format, '1'); ?> class="inputbox">
|
470 |
+
<label for="time_format1">Yes</label>
|
471 |
+
</td>
|
472 |
+
</tr>
|
473 |
+
<tr>
|
474 |
+
<td class="key"><label for="published">Published:</label></td>
|
475 |
+
<td>
|
476 |
+
<input type="radio" name="published" id="published0" value="0" <?php cheched($row->published, '0'); ?> class="inputbox">
|
477 |
+
<label for="published0">No</label>
|
478 |
+
<input type="radio" name="published" id="published1" value="1" <?php cheched($row->published, '1'); ?> class="inputbox">
|
479 |
+
<label for="published1">Yes</label>
|
480 |
+
</td>
|
481 |
+
</tr>
|
482 |
+
</table>
|
483 |
+
<input type="hidden" name="option" value="com_spidercalendar"/>
|
484 |
+
<input type="hidden" name="id" value="<?php echo $row->id; ?>"/>
|
485 |
+
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
486 |
+
<input type="hidden" name="task" value=""/>
|
487 |
+
</form>
|
488 |
+
<?php
|
489 |
+
}
|
490 |
+
|
491 |
+
function cheched($row, $y) {
|
492 |
+
if ($row == $y) {
|
493 |
+
echo 'checked="checked"';
|
494 |
+
}
|
495 |
+
}
|
496 |
+
|
497 |
+
function selectted($row, $y) {
|
498 |
+
if ($row == $y) {
|
499 |
+
echo 'selected="selected"';
|
500 |
+
}
|
501 |
+
}
|
502 |
+
|
503 |
+
function show_event_category($rows, $pageNav, $sort){
|
504 |
+
global $wpdb;
|
505 |
+
?>
|
506 |
+
<script language="javascript">
|
507 |
+
function confirmation(href, title) {
|
508 |
+
var answer = confirm("Are you sure you want to delete '" + title + "'?")
|
509 |
+
if (answer) {
|
510 |
+
document.getElementById('admin_form').action = href;
|
511 |
+
document.getElementById('admin_form').submit();
|
512 |
+
}
|
513 |
+
}
|
514 |
+
function ordering(name, as_or_desc) {
|
515 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
516 |
+
document.getElementById('order_by').value = name;
|
517 |
+
document.getElementById('admin_form').submit();
|
518 |
+
}
|
519 |
+
function submit_form_id(x) {
|
520 |
+
var val = x.options[x.selectedIndex].value;
|
521 |
+
document.getElementById("id_for_playlist").value = val;
|
522 |
+
document.getElementById("admin_form").submit();
|
523 |
+
}
|
524 |
+
function doNothing() {
|
525 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
526 |
+
if (keyCode == 13) {
|
527 |
+
if (!e) var e = window.event;
|
528 |
+
e.cancelBubble = true;
|
529 |
+
e.returnValue = false;
|
530 |
+
if (e.stopPropagation) {
|
531 |
+
e.stopPropagation();
|
532 |
+
e.preventDefault();
|
533 |
+
}
|
534 |
+
}
|
535 |
+
}
|
536 |
+
var show_one_cal = 1;
|
537 |
+
var get_cal_id = 0;
|
538 |
+
function show_calendar_inline(cal_id) {
|
539 |
+
if (show_one_cal == 1) {
|
540 |
+
show_one_cal = 0;
|
541 |
+
jQuery.ajax({
|
542 |
+
type:'POST',
|
543 |
+
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineedit') ?>',
|
544 |
+
data:{calendar_id:cal_id},
|
545 |
+
dataType:'html',
|
546 |
+
success:function (data) {
|
547 |
+
cancel_qiucik_edit(get_cal_id);
|
548 |
+
var edit_cal_tr = document.createElement("tr")
|
549 |
+
edit_cal_tr.innerHTML = data;
|
550 |
+
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')
|
551 |
+
edit_cal_tr.setAttribute('id', 'edit_calendar-' + cal_id);
|
552 |
+
|
553 |
+
document.getElementById('Calendar-' + cal_id).style.display = "none";
|
554 |
+
document.getElementById('calendar_body').appendChild(edit_cal_tr);
|
555 |
+
document.getElementById('calendar_body').insertBefore(edit_cal_tr, document.getElementById('Calendar-' + cal_id));
|
556 |
+
get_cal_id = cal_id;
|
557 |
+
show_one_cal = 1
|
558 |
+
}
|
559 |
+
});
|
560 |
+
}
|
561 |
+
}
|
562 |
+
function cancel_qiucik_edit(cal_id) {
|
563 |
+
if (document.getElementById('edit_calendar-' + cal_id)) {
|
564 |
+
var tr = document.getElementById('edit_calendar-' + cal_id);
|
565 |
+
tr.parentNode.removeChild(tr);
|
566 |
+
document.getElementById('Calendar-' + cal_id).style.display = "";
|
567 |
+
}
|
568 |
+
}
|
569 |
+
function updae_inline_sp_calendar(cal_id) {
|
570 |
+
var cal_title = document.getElementById('calendar_title').value;
|
571 |
+
var cal_12_format = getCheckedValue(document.getElementsByName('time_format'));
|
572 |
+
var def_year = document.getElementById('def_year').value;
|
573 |
+
var def_month = document.getElementById('def_month').value;
|
574 |
+
document.getElementById('imig_for_waiting').style.display = "block";
|
575 |
+
jQuery.ajax({
|
576 |
+
type:'POST',
|
577 |
+
url:'<?php echo admin_url('admin-ajax.php?action=spidercalendarinlineupdate') ?>',
|
578 |
+
data:{
|
579 |
+
calendar_id:cal_id,
|
580 |
+
calendar_title:cal_title,
|
581 |
+
us_12_format_sp_calendar:cal_12_format,
|
582 |
+
default_year:def_year,
|
583 |
+
default_month:def_month
|
584 |
+
},
|
585 |
+
dataType:'html',
|
586 |
+
success:function (data) {
|
587 |
+
if (data) {
|
588 |
+
document.getElementById('imig_for_waiting').style.display = "none";
|
589 |
+
document.getElementById('Calendar-' + cal_id).innerHTML = data;
|
590 |
+
cancel_qiucik_edit(cal_id);
|
591 |
+
}
|
592 |
+
else {
|
593 |
+
alert('ERROR PLEAS INSTALL PLUGIN AGAIN');
|
594 |
+
cancel_qiucik_edit(cal_id);
|
595 |
+
}
|
596 |
+
}
|
597 |
+
});
|
598 |
+
}
|
599 |
+
function getCheckedValue(radioObj) {
|
600 |
+
if (!radioObj)
|
601 |
+
return "";
|
602 |
+
var radioLength = radioObj.length;
|
603 |
+
if (radioLength == undefined)
|
604 |
+
if (radioObj.checked)
|
605 |
+
return radioObj.value;
|
606 |
+
else
|
607 |
+
return "";
|
608 |
+
for (var i = 0; i < radioLength; i++) {
|
609 |
+
if (radioObj[i].checked) {
|
610 |
+
return radioObj[i].value;
|
611 |
+
}
|
612 |
+
}
|
613 |
+
return "";
|
614 |
+
}
|
615 |
+
</script>
|
616 |
+
<form method="post" onKeyPress="doNothing()" action="admin.php?page=spider_calendar_event_category" id="admin_form" name="admin_form">
|
617 |
+
<table cellspacing="10" width="100%" id="category_table">
|
618 |
+
<tr>
|
619 |
+
<td width="100%" style="font-size:14px; font-weight:bold">
|
620 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
621 |
+
<br />
|
622 |
+
This section allows you to create event categories. You can add unlimited number of categories.
|
623 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-4.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
624 |
+
</td>
|
625 |
+
<td colspan="7" align="right" style="font-size:16px;">
|
626 |
+
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
627 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
628 |
+
Get the full version
|
629 |
+
</a>
|
630 |
+
</td>
|
631 |
+
</tr>
|
632 |
+
|
633 |
+
<tr>
|
634 |
+
<td style="width:210px"><h2>Event Category</h2></td>
|
635 |
+
<td style="width:90px; text-align:right;">
|
636 |
+
<p class="submit" style="padding:0px; text-align:left">
|
637 |
+
<input type="button" value="Add a Category" name="custom_parametrs" onClick="window.location.href='admin.php?page=spider_calendar_event_category&task=add_category'"/>
|
638 |
+
</p>
|
639 |
+
</td>
|
640 |
+
<td style="text-align:right;font-size:16px;padding:20px; padding-right:50px">
|
641 |
+
</td>
|
642 |
+
</tr>
|
643 |
+
</table>
|
644 |
+
<?php
|
645 |
+
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
646 |
+
$serch_value = $_POST['search_cat_by_title'];
|
647 |
+
}
|
648 |
+
else {
|
649 |
+
$serch_value = "";
|
650 |
+
}
|
651 |
+
$serch_fields = '
|
652 |
+
<div class="alignleft actions" >
|
653 |
+
<label for="search_cat_by_title" style="font-size:14px">Title: </label>
|
654 |
+
<input type="text" name="search_cat_by_title" value="' . $serch_value . '" id="search_cat_by_title" onchange="clear_serch_texts()">
|
655 |
+
</div>
|
656 |
+
<div class="alignleft actions">
|
657 |
+
<input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
|
658 |
+
document.getElementById(\'admin_form\').submit();" class="button-secondary action">
|
659 |
+
<input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=spider_calendar_event_category\'" class="button-secondary action">
|
660 |
+
</div>';
|
661 |
+
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
662 |
+
?>
|
663 |
+
<table class="wp-list-table widefat fixed pages" style="width:95%">
|
664 |
+
<thead>
|
665 |
+
<TR>
|
666 |
+
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
667 |
+
<a href="javascript:ordering('id',<?php echo(($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
668 |
+
<span>ID</span>
|
669 |
+
<span class="sorting-indicator"></span>
|
670 |
+
</a>
|
671 |
+
</th>
|
672 |
+
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
673 |
+
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
674 |
+
<span>Title</span>
|
675 |
+
<span class="sorting-indicator"></span>
|
676 |
+
</a>
|
677 |
+
</th>
|
678 |
+
<th scope="col" id="description" class="<?php echo (($sort["sortid_by"] == "description") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
679 |
+
<a href="javascript:ordering('description',<?php echo (($sort["sortid_by"] == "description") ? $sort["1_or_2"] : "1"); ?>)">
|
680 |
+
<span>Description</span>
|
681 |
+
<span class="sorting-indicator"></span>
|
682 |
+
</a>
|
683 |
+
</th>
|
684 |
+
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
685 |
+
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
686 |
+
<span>Published</span>
|
687 |
+
<span class="sorting-indicator"></span>
|
688 |
+
</a>
|
689 |
+
</th>
|
690 |
+
</TR>
|
691 |
+
</thead>
|
692 |
+
<tbody id="category_body">
|
693 |
+
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
694 |
+
<tr id="Calendar-<?php echo $rows[$i]->id; ?>" class=" hentry alternate iedit author-self" style="display:table-row;">
|
695 |
+
<td><?php echo $rows[$i]->id; ?></td>
|
696 |
+
<td class="post-title page-title column-title">
|
697 |
+
<?php echo $rows[$i]->title; ?></a>
|
698 |
+
|
699 |
+
<div class="row-actions">
|
700 |
+
<span class="edit">
|
701 |
+
<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>
|
702 |
+
<span class="trash">
|
703 |
+
<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>
|
704 |
+
</div>
|
705 |
+
</td>
|
706 |
+
<td><?php echo $rows[$i]->description; ?></td>
|
707 |
+
<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; ?>"><?php if ($rows[$i]->published) echo 'Yes'; else echo 'No'; ?></a>
|
708 |
+
</td>
|
709 |
+
</tr>
|
710 |
+
<?php } ?>
|
711 |
+
</tbody>
|
712 |
+
</table>
|
713 |
+
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo $_POST['id_for_playlist'];?>"/>
|
714 |
+
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc'];?>"/>
|
715 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo $_POST['order_by'];?>"/>
|
716 |
+
<?php
|
717 |
+
?>
|
718 |
+
</form>
|
719 |
+
<?php
|
720 |
+
|
721 |
+
}
|
722 |
+
|
723 |
+
function edit_event_category($id){
|
724 |
+
global $wpdb;
|
725 |
+
$row=$wpdb->get_row($wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE id=%d" , $id ));
|
726 |
+
?>
|
727 |
+
|
728 |
+
<script language="javascript" type="text/javascript">
|
729 |
+
<!--
|
730 |
+
function submitbutton(pressbutton) {
|
731 |
+
document.getElementById('adminForm').action = "admin.php?page=spider_calendar_event_category&task=" + pressbutton+"&id=<?php echo $id?>";
|
732 |
+
if (document.getElementById('cat_title').value == "") {
|
733 |
+
alert('Provide the category title:');
|
734 |
+
}
|
735 |
+
else {
|
736 |
+
document.getElementById('adminForm').submit();
|
737 |
+
}
|
738 |
+
}
|
739 |
+
</script>
|
740 |
+
|
741 |
+
<table>
|
742 |
+
<tr>
|
743 |
+
<td align="right"><input type="button" onClick="submitbutton('save_category_event')" value="Save" class="button-secondary action"></td>
|
744 |
+
<td align="right"><input type="button" onClick="submitbutton('apply_event_category')" value="Apply" class="button-secondary action"></td>
|
745 |
+
<td align="right"><input type="button" onClick="window.location.href='admin.php?page=spider_calendar_event_category'" value="Cancel" class="button-secondary action">
|
746 |
+
</td>
|
747 |
+
</tr>
|
748 |
+
</table>
|
749 |
+
|
750 |
+
|
751 |
+
<form action="" method="post" name="adminForm" id="adminForm">
|
752 |
+
<div class="width-45 fltlft ">
|
753 |
+
<fieldset class="adminform" >
|
754 |
+
|
755 |
+
|
756 |
+
|
757 |
+
|
758 |
+
<table class="admintable" >
|
759 |
+
|
760 |
+
|
761 |
+
|
762 |
+
<tr>
|
763 |
+
<td class="key" ><label for="message"><?php echo 'Category title'; ?>:</label> </td>
|
764 |
+
<td>
|
765 |
+
|
766 |
+
<input type="text" name="title" value="<?php if(isset($row->title)) echo htmlspecialchars($row->title);
|
767 |
+
?>" id="cat_title"/>
|
768 |
+
</td>
|
769 |
+
</tr>
|
770 |
+
|
771 |
+
<tr>
|
772 |
+
<td class="key" ><label for="message"><?php echo 'Category Color'; ?>:</label> </td>
|
773 |
+
|
774 |
+
<td><input type="text" name="color" id="color" class="color" style="width:134px;" value="<?php if(isset($row->color)) echo htmlspecialchars($row->color);
|
775 |
+
?>"/></td>
|
776 |
+
</tr>
|
777 |
+
|
778 |
+
|
779 |
+
<tr>
|
780 |
+
<td class="key"><label for="message"> <?php echo 'Description'; ?>:</label></td>
|
781 |
+
<td ><div id="poststuff" style="width:100% !important;">
|
782 |
+
|
783 |
+
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
784 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor(stripslashes($row->description),"description","title" ); ?>
|
785 |
+
</div>
|
786 |
+
<?php }else{
|
787 |
+
if(isset($row->description)) $desc1 = $row->description;
|
788 |
+
else $desc1 = "";
|
789 |
+
wp_editor($desc1, "description"); }?>
|
790 |
+
|
791 |
+
</div>
|
792 |
+
</div></td>
|
793 |
+
|
794 |
+
</tr>
|
795 |
+
|
796 |
+
<tr>
|
797 |
+
<td class="key" ><label for="message"><?php echo 'Published'; ?>:</label> </td>
|
798 |
+
|
799 |
+
<td>
|
800 |
+
<input type="radio" name="published" id="published0" value="0" <?php if(isset($row->published)) cheched($row->published, '0'); ?> class="inputbox">
|
801 |
+
<label for="published0">No</label>
|
802 |
+
<input type="radio" name="published" id="published1" value="1" <?php if(isset($row->published)) cheched($row->published, '1'); ?> class="inputbox">
|
803 |
+
<label for="published1">Yes</label>
|
804 |
+
</td>
|
805 |
+
</tr>
|
806 |
+
|
807 |
+
</table>
|
808 |
+
|
809 |
+
</fieldset >
|
810 |
+
</div>
|
811 |
+
<input type="hidden" name="id" value="<?php echo $id ?>" />
|
812 |
+
</form>
|
813 |
+
<?php
|
814 |
+
|
815 |
+
|
816 |
+
|
817 |
+
}
|
818 |
+
|
819 |
+
|
820 |
+
function html_upcoming_widget($rows, $pageNav, $sort){
|
821 |
+
require_once("spidercalendar_upcoming_events_widget.php");
|
822 |
+
global $wpdb;
|
823 |
+
$input_id=$_GET['id_input'];
|
824 |
+
$w_id = $_GET['w_id'];
|
825 |
+
$tbody_id='event'.$w_id;
|
826 |
+
$calendar_id=$_GET['upcalendar_id'];
|
827 |
+
?><html>
|
828 |
+
<head>
|
829 |
+
<link rel="stylesheet" id="thickbox-css" href="<?php echo plugins_url("elements/calendar-jos.css", __FILE__) ?>" type="text/css" media="all">
|
830 |
+
<?php wp_print_scripts("Canlendar_upcoming");
|
831 |
+
wp_print_scripts("calendnar-setup_upcoming");
|
832 |
+
wp_print_scripts("calenndar_function_upcoming");
|
833 |
+
?>
|
834 |
+
|
835 |
+
<style>
|
836 |
+
.calendar .button {
|
837 |
+
display: table-cell !important;
|
838 |
+
}
|
839 |
+
|
840 |
+
.wd_button{
|
841 |
+
border: 1px solid #D5D5D5 !important;
|
842 |
+
border-radius: 10px;
|
843 |
+
width: 30px;
|
844 |
+
height: 25px;
|
845 |
+
}
|
846 |
+
}
|
847 |
+
input[type=checkbox]:checked:before,
|
848 |
+
th.sorted.asc .sorting-indicator:before, th.desc:hover span.sorting-indicator:before,
|
849 |
+
th.sorted.desc .sorting-indicator:before, th.asc:hover span.sorting-indicator:before{
|
850 |
+
content: close-quote !important;
|
851 |
+
}
|
852 |
+
|
853 |
+
</style>
|
854 |
+
<script language="javascript">
|
855 |
+
function ordering(name, as_or_desc) {
|
856 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
857 |
+
document.getElementById('order_by').value = name;
|
858 |
+
document.getElementById('admin_form').submit();
|
859 |
+
}
|
860 |
+
function submit_form_id(x) {
|
861 |
+
var val = x.options[x.selectedIndex].value;
|
862 |
+
document.getElementById("id_for_playlist").value = val;
|
863 |
+
document.getElementById("admin_form").submit();
|
864 |
+
}
|
865 |
+
|
866 |
+
function doNothing() {
|
867 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
868 |
+
if (keyCode == 13) {
|
869 |
+
if (!e) {
|
870 |
+
var e = window.event;
|
871 |
+
}
|
872 |
+
e.cancelBubble = true;
|
873 |
+
e.returnValue = false;
|
874 |
+
if (e.stopPropagation) {
|
875 |
+
e.stopPropagation();
|
876 |
+
e.preventDefault();
|
877 |
+
}
|
878 |
+
}
|
879 |
+
}
|
880 |
+
|
881 |
+
|
882 |
+
function isChecked(isitchecked){
|
883 |
+
if (isitchecked == true){
|
884 |
+
document.adminForm.boxchecked.value++;
|
885 |
+
}
|
886 |
+
else {
|
887 |
+
document.adminForm.boxchecked.value--;
|
888 |
+
}
|
889 |
+
}
|
890 |
+
|
891 |
+
|
892 |
+
function checkAll( n, fldName ) {
|
893 |
+
|
894 |
+
if (!fldName) {
|
895 |
+
|
896 |
+
fldName = 'cb';
|
897 |
+
|
898 |
+
}
|
899 |
+
|
900 |
+
var f = document.admin_form;
|
901 |
+
|
902 |
+
var c = f.toggle.checked;
|
903 |
+
|
904 |
+
var n2 = 0;
|
905 |
+
|
906 |
+
for (i=0; i < n; i++) {
|
907 |
+
|
908 |
+
cb = eval( 'f.' + fldName + '' + i );
|
909 |
+
|
910 |
+
if (cb) {
|
911 |
+
|
912 |
+
cb.checked = c;
|
913 |
+
|
914 |
+
n2++;
|
915 |
+
|
916 |
+
}
|
917 |
+
|
918 |
+
}
|
919 |
+
|
920 |
+
if (c) {
|
921 |
+
|
922 |
+
document.admin_form.boxchecked.value = n2;
|
923 |
+
|
924 |
+
} else {
|
925 |
+
|
926 |
+
document.admin_form.boxchecked.value = 0;
|
927 |
+
|
928 |
+
}
|
929 |
+
|
930 |
+
}
|
931 |
+
|
932 |
+
|
933 |
+
|
934 |
+
|
935 |
+
function select_events()
|
936 |
+
|
937 |
+
{
|
938 |
+
var id =[];
|
939 |
+
var title =[];
|
940 |
+
|
941 |
+
for(i=0; i<<?php echo count($rows)?>; i++)
|
942 |
+
if(document.getElementById("p"+i))
|
943 |
+
if(document.getElementById("p"+i).checked)
|
944 |
+
{
|
945 |
+
id.push(document.getElementById("p"+i).value);
|
946 |
+
title.push(document.getElementById("title_"+i).value);
|
947 |
+
|
948 |
+
}
|
949 |
+
window.parent.jSelectEvents('<?php echo $input_id ?>','<?php echo $tbody_id ?>','<?php echo $w_id ?>',id, title);
|
950 |
+
}
|
951 |
+
|
952 |
+
|
953 |
+
</script>
|
954 |
+
<?php
|
955 |
+
|
956 |
+
|
957 |
+
if(get_bloginfo( 'version' )>3.3){
|
958 |
+
|
959 |
+
?>
|
960 |
+
|
961 |
+
<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">
|
962 |
+
|
963 |
+
<?php
|
964 |
+
|
965 |
+
}
|
966 |
+
|
967 |
+
else
|
968 |
+
|
969 |
+
{
|
970 |
+
|
971 |
+
?>
|
972 |
+
|
973 |
+
<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">
|
974 |
+
|
975 |
+
<?php
|
976 |
+
|
977 |
+
}
|
978 |
+
|
979 |
+
?>
|
980 |
+
|
981 |
+
<link rel="stylesheet" id="thickbox-css" href="<?php echo bloginfo('url')?>/wp-includes/js/thickbox/thickbox.css?ver=20111117" type="text/css" media="all">
|
982 |
+
|
983 |
+
<!---- <link rel="stylesheet" id="colors-css" href="<?php echo bloginfo('url')?>/wp-admin/css/colors-classic.css?ver=20111206" type="text/css" media="all"> --->
|
984 |
+
</head>
|
985 |
+
<body>
|
986 |
+
<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">
|
987 |
+
<table cellspacing="10" width="100%">
|
988 |
+
|
989 |
+
<tr>
|
990 |
+
<td width="100%"><h2>Event Manager</h2></td></td>
|
991 |
+
<td align="right" width="100%">
|
992 |
+
|
993 |
+
<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>
|
994 |
+
</td>
|
995 |
+
</tr>
|
996 |
+
</table>
|
997 |
+
<?php
|
998 |
+
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
999 |
+
$serch_value = $_POST['search_events_by_title'];
|
1000 |
+
}
|
1001 |
+
else {
|
1002 |
+
$serch_value = "";
|
1003 |
+
}
|
1004 |
+
$startdate = (isset($_POST["startdate"]) ? esc_html($_POST["startdate"]) : '');
|
1005 |
+
$enddate = (isset($_POST["enddate"]) ? esc_html($_POST["enddate"]) : '');
|
1006 |
+
$serch_fields = '
|
1007 |
+
<div class="alignleft actions">
|
1008 |
+
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
1009 |
+
<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;"/>
|
1010 |
+
</div>
|
1011 |
+
<div class="alignleft actions">
|
1012 |
+
From: <input class="inputbox" type="text" style="width: 90px;border: 1px solid #DCDCEC;" name="startdate" id="startdate" size="10" maxlength="10" value="' . $startdate . '" />
|
1013 |
+
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'startdate\',\'%Y-%m-%d\');">
|
1014 |
+
To: <input class="inputbox" type="text" style="width: 90px;border: 1px solid #DCDCEC;" name="enddate" id="enddate" size="10" maxlength="10" value="' . $enddate . '">
|
1015 |
+
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'enddate\',\'%Y-%m-%d\');">
|
1016 |
+
</div>
|
1017 |
+
<div class="alignleft actions">
|
1018 |
+
<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">
|
1019 |
+
<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">
|
1020 |
+
</div>';
|
1021 |
+
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
1022 |
+
?>
|
1023 |
+
<style>
|
1024 |
+
.sorting-indicator {
|
1025 |
+
width: 7px;
|
1026 |
+
height: 4px;
|
1027 |
+
margin-top: 8px;
|
1028 |
+
margin-left: 7px;
|
1029 |
+
background-image: url('images/sort.gif');
|
1030 |
+
background-repeat: no-repeat;
|
1031 |
+
}
|
1032 |
+
.wd_button{
|
1033 |
+
border: 1px solid #D5D5D5 !important;
|
1034 |
+
border-radius: 10px;
|
1035 |
+
width: 30px;
|
1036 |
+
height: 25px;
|
1037 |
+
}
|
1038 |
+
</style>
|
1039 |
+
<table class="wp-list-table widefat fixed pages" style="width:100%">
|
1040 |
+
<thead>
|
1041 |
+
<TR>
|
1042 |
+
<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);">
|
1043 |
+
<a href="javascript:ordering('id',<?php echo (($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
1044 |
+
<span>ID</span>
|
1045 |
+
<span class="sorting-indicator"></span>
|
1046 |
+
</a>
|
1047 |
+
</th>
|
1048 |
+
<th style="background-image: linear-gradient(to top, #EFF8FF, #F7FCFE);" width="20" class="manage-column column-cb check-column">
|
1049 |
+
|
1050 |
+
<input style="border: 1px solid #DCDCEC;-webkit-appearance: checkbox;" type="checkbox" name="toggle" id="toggle" value="" onClick="checkAll(<?php echo count($rows)?>, 'p')">
|
1051 |
+
|
1052 |
+
</th>
|
1053 |
+
<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"]); ?>">
|
1054 |
+
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
1055 |
+
<span>Title</span>
|
1056 |
+
<span class="sorting-indicator"></span>
|
1057 |
+
</a>
|
1058 |
+
</th>
|
1059 |
+
<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"]); ?>">
|
1060 |
+
<a href="javascript:ordering('date',<?php echo (($sort["sortid_by"] == "date") ? $sort["1_or_2"] : "1"); ?>)">
|
1061 |
+
<span>Date</span>
|
1062 |
+
<span class="sorting-indicator"></span>
|
1063 |
+
</a>
|
1064 |
+
</th>
|
1065 |
+
<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"]); ?>">
|
1066 |
+
<a href="javascript:ordering('time',<?php echo (($sort["sortid_by"] == "time") ? $sort["1_or_2"] : "1"); ?>)">
|
1067 |
+
<span>Time</span>
|
1068 |
+
<span class="sorting-indicator"></span>
|
1069 |
+
</a>
|
1070 |
+
</th>
|
1071 |
+
</TR>
|
1072 |
+
</thead>
|
1073 |
+
<tbody>
|
1074 |
+
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
1075 |
+
<tr>
|
1076 |
+
|
1077 |
+
<td style="border-bottom: 1px solid #DCDCEC;"><?php echo $rows[$i]->id; ?></td>
|
1078 |
+
<td style="border-bottom: 1px solid #DCDCEC;">
|
1079 |
+
<input style="border: 1px solid #DCDCEC;-webkit-appearance: checkbox;" type="checkbox" id="p<?php echo $i?>" value="<?php echo $rows[$i]->id;?>" />
|
1080 |
+
<input type="hidden" id="title_<?php echo $i?>" value="<?php echo htmlspecialchars($rows[$i]->title);?>" />
|
1081 |
+
</td>
|
1082 |
+
<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>
|
1083 |
+
</td>
|
1084 |
+
<td style="border-bottom: 1px solid #DCDCEC;"><?php if ($rows[$i]->date_end != '0000-00-00' && $rows[$i]->date_end != '2070-12-12') echo $rows[$i]->date . ' - ' . $rows[$i]->date_end; else echo $rows[$i]->date; ?></td>
|
1085 |
+
<td style="border-bottom: 1px solid #DCDCEC;"><?php echo $rows[$i]->time ?></td>
|
1086 |
+
</tr>
|
1087 |
+
<?php } ?>
|
1088 |
+
</tbody>
|
1089 |
+
</table>
|
1090 |
+
<input type="hidden" name="boxchecked" value="0">
|
1091 |
+
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc']; ?>"/>
|
1092 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo $_POST['order_by']; ?>"/>
|
1093 |
+
<?php
|
1094 |
+
?>
|
1095 |
+
</form>
|
1096 |
+
</body>
|
1097 |
+
</html>
|
1098 |
+
<?php
|
1099 |
+
die();
|
1100 |
+
}
|
1101 |
+
|
1102 |
+
// Events.
|
1103 |
+
function html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name) {
|
1104 |
+
global $wpdb;
|
1105 |
+
?>
|
1106 |
+
<style>
|
1107 |
+
.calendar .button {
|
1108 |
+
display: table-cell !important;
|
1109 |
+
}
|
1110 |
+
.wd_button{
|
1111 |
+
border: 1px solid #D5D5D5 !important;
|
1112 |
+
border-radius: 10px;
|
1113 |
+
width: 30px;
|
1114 |
+
height: 25px;
|
1115 |
+
}
|
1116 |
+
</style>
|
1117 |
+
<script language="javascript">
|
1118 |
+
function ordering(name, as_or_desc) {
|
1119 |
+
document.getElementById('asc_or_desc').value = as_or_desc;
|
1120 |
+
document.getElementById('order_by').value = name;
|
1121 |
+
document.getElementById('admin_form').submit();
|
1122 |
+
}
|
1123 |
+
function doNothing() {
|
1124 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
1125 |
+
if (keyCode == 13) {
|
1126 |
+
if (!e) {
|
1127 |
+
var e = window.event;
|
1128 |
+
}
|
1129 |
+
e.cancelBubble = true;
|
1130 |
+
e.returnValue = false;
|
1131 |
+
if (e.stopPropagation) {
|
1132 |
+
e.stopPropagation();
|
1133 |
+
e.preventDefault();
|
1134 |
+
}
|
1135 |
+
}
|
1136 |
+
}
|
1137 |
+
</script>
|
1138 |
+
<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">
|
1139 |
+
<table cellspacing="10" width="95%">
|
1140 |
+
<tr>
|
1141 |
+
<td width="100%" style="font-size:14px; font-weight:bold">
|
1142 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a><br>
|
1143 |
+
This section allows you to create/edit the events of a particular calendar.<br/> You can add
|
1144 |
+
unlimited number of events for each calendar.
|
1145 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
1146 |
+
</td>
|
1147 |
+
<td colspan="7" align="right" style="font-size:16px;">
|
1148 |
+
<a href="http://web-dorado.com/files/fromSpiderCalendarWP.php" target="_blank" style="color:red; text-decoration:none;">
|
1149 |
+
<img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="http://web-dorado.com/files/fromSpiderCalendarWP.php" width="215"><br />
|
1150 |
+
Get the full version
|
1151 |
+
</a>
|
1152 |
+
</td>
|
1153 |
+
</tr>
|
1154 |
+
<tr>
|
1155 |
+
<td width="100%"><h2>Event Manager for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
1156 |
+
<td>
|
1157 |
+
<p class="submit" style="padding:0px; text-align:left">
|
1158 |
+
<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; ?>'"/>
|
1159 |
+
</p>
|
1160 |
+
</td>
|
1161 |
+
<td>
|
1162 |
+
<p class="submit" style="padding:0px; text-align:left">
|
1163 |
+
<input type="button" class="button-primary" value="Back" name="custom_parametrs" onClick="window.location.href='admin.php?page=SpiderCalendar'"/>
|
1164 |
+
</p>
|
1165 |
+
</td>
|
1166 |
+
</tr>
|
1167 |
+
</table>
|
1168 |
+
<?php
|
1169 |
+
if (isset($_POST['serch_or_not']) && ($_POST['serch_or_not'] == "search")) {
|
1170 |
+
$serch_value = $_POST['search_events_by_title'];
|
1171 |
+
}
|
1172 |
+
else {
|
1173 |
+
$serch_value = "";
|
1174 |
+
}
|
1175 |
+
$startdate = (isset($_POST["startdate"]) ? esc_html($_POST["startdate"]) : '');
|
1176 |
+
$enddate = (isset($_POST["enddate"]) ? esc_html($_POST["enddate"]) : '');
|
1177 |
+
$serch_fields = '
|
1178 |
+
<div class="alignleft actions">
|
1179 |
+
<label for="search_events_by_title" style="font-size:14px">Title: </label>
|
1180 |
+
<input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()" />
|
1181 |
+
</div>
|
1182 |
+
<div class="alignleft actions">
|
1183 |
+
From: <input style="width: 90px;" class="inputbox" type="text" name="startdate" id="startdate" size="10" maxlength="10" value="' . $startdate . '" />
|
1184 |
+
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'startdate\',\'%Y-%m-%d\');">
|
1185 |
+
To: <input style="width: 90px;" class="inputbox" type="text" name="enddate" id="enddate" size="10" maxlength="10" value="' . $enddate . '">
|
1186 |
+
<input type="reset" class="wd_button" value="..." onclick="return showCalendar(\'enddate\',\'%Y-%m-%d\');">
|
1187 |
+
</div>
|
1188 |
+
<div class="alignleft actions">
|
1189 |
+
<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">
|
1190 |
+
<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">
|
1191 |
+
</div>';
|
1192 |
+
print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
|
1193 |
+
?>
|
1194 |
+
<table class="wp-list-table widefat fixed pages" style="width:95%">
|
1195 |
+
<thead>
|
1196 |
+
<TR>
|
1197 |
+
<th scope="col" id="id" class="<?php echo (($sort["sortid_by"] == "id") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:50px">
|
1198 |
+
<a href="javascript:ordering('id',<?php echo (($sort["sortid_by"] == "id") ? $sort["1_or_2"] : "1"); ?>)">
|
1199 |
+
<span>ID</span>
|
1200 |
+
<span class="sorting-indicator"></span>
|
1201 |
+
</a>
|
1202 |
+
</th>
|
1203 |
+
<th scope="col" id="title" class="<?php echo (($sort["sortid_by"] == "title") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1204 |
+
<a href="javascript:ordering('title',<?php echo (($sort["sortid_by"] == "title") ? $sort["1_or_2"] : "1"); ?>)">
|
1205 |
+
<span>Title</span>
|
1206 |
+
<span class="sorting-indicator"></span>
|
1207 |
+
</a>
|
1208 |
+
</th>
|
1209 |
+
<th scope="col" id="date" class="<?php echo (($sort["sortid_by"] == "date") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1210 |
+
<a href="javascript:ordering('date',<?php echo (($sort["sortid_by"] == "date") ? $sort["1_or_2"] : "1"); ?>)">
|
1211 |
+
<span>Date</span>
|
1212 |
+
<span class="sorting-indicator"></span>
|
1213 |
+
</a>
|
1214 |
+
</th>
|
1215 |
+
<th scope="col" id="time" class="<?php echo (($sort["sortid_by"] == "time") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1216 |
+
<a href="javascript:ordering('time',<?php echo (($sort["sortid_by"] == "time") ? $sort["1_or_2"] : "1"); ?>)">
|
1217 |
+
<span>Time</span>
|
1218 |
+
<span class="sorting-indicator"></span>
|
1219 |
+
</a>
|
1220 |
+
</th>
|
1221 |
+
<th scope="col" id="cattitle" class="<?php echo (($sort["sortid_by"] == "cattitle") ? $sort["custom_style"] : $sort["default_style"]); ?>">
|
1222 |
+
<a href="javascript:ordering('cattitle',<?php echo (($sort["sortid_by"] == "cattitle") ? $sort["1_or_2"] : "1"); ?>)">
|
1223 |
+
<span>Category</span>
|
1224 |
+
<span class="sorting-indicator"></span>
|
1225 |
+
</a>
|
1226 |
+
</th>
|
1227 |
+
<th scope="col" id="published" class="<?php echo (($sort["sortid_by"] == "published") ? $sort["custom_style"] : $sort["default_style"]); ?>" style="width:100px">
|
1228 |
+
<a href="javascript:ordering('published',<?php echo (($sort["sortid_by"] == "published") ? $sort["1_or_2"] : "1"); ?>)">
|
1229 |
+
<span>Published</span>
|
1230 |
+
<span class="sorting-indicator"></span>
|
1231 |
+
</a>
|
1232 |
+
</th>
|
1233 |
+
<th style="width:80px">Edit</th>
|
1234 |
+
<th style="width:80px">Delete</th>
|
1235 |
+
</TR>
|
1236 |
+
</thead>
|
1237 |
+
<tbody>
|
1238 |
+
<?php for ($i = 0; $i < count($rows); $i++) { ?>
|
1239 |
+
<tr>
|
1240 |
+
<td><?php echo $rows[$i]->id; ?></td>
|
1241 |
+
<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>
|
1242 |
+
</td>
|
1243 |
+
<td><?php if ($rows[$i]->date_end != '0000-00-00' && $rows[$i]->date_end != '2070-12-12') echo $rows[$i]->date . ' - ' . $rows[$i]->date_end; else echo $rows[$i]->date; ?></td>
|
1244 |
+
<td><?php echo $rows[$i]->time ?></td>
|
1245 |
+
<td><?php echo $rows[$i]->cattitle ?></td>
|
1246 |
+
<td><a <?php if (!$rows[$i]->published) echo 'style="color:#C00"'; ?>
|
1247 |
+
href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=published_event&id=<?php echo $rows[$i]->id; ?>"><?php if ($rows[$i]->published)
|
1248 |
+
echo 'Yes'; else echo 'No'; ?></a>
|
1249 |
+
</td>
|
1250 |
+
<td>
|
1251 |
+
<a href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=edit_event&id=<?php echo $rows[$i]->id; ?>">Edit</a>
|
1252 |
+
</td>
|
1253 |
+
<td>
|
1254 |
+
<a href="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&task=remove_event&id=<?php echo $rows[$i]->id; ?>">Delete</a>
|
1255 |
+
</td>
|
1256 |
+
</tr>
|
1257 |
+
<?php } ?>
|
1258 |
+
</tbody>
|
1259 |
+
</table>
|
1260 |
+
<input type="hidden" name="id_for_playlist" id="id_for_playlist" value="<?php if (isset($_POST['id_for_playlist'])) echo $_POST['id_for_playlist']; ?>"/>
|
1261 |
+
<input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc']; ?>"/>
|
1262 |
+
<input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by'])) echo $_POST['order_by']; ?>"/>
|
1263 |
+
<?php
|
1264 |
+
?>
|
1265 |
+
</form>
|
1266 |
+
|
1267 |
+
<?php
|
1268 |
+
}
|
1269 |
+
|
1270 |
+
function html_add_spider_event($calendar_id, $cal_name) {
|
1271 |
+
?>
|
1272 |
+
<style>
|
1273 |
+
.calendar .button {
|
1274 |
+
display: table-cell !important;
|
1275 |
+
}
|
1276 |
+
.wd_button{
|
1277 |
+
border: 1px solid #D5D5D5 !important;
|
1278 |
+
border-radius: 10px;
|
1279 |
+
width: 30px;
|
1280 |
+
height: 25px;
|
1281 |
+
}
|
1282 |
+
</style>
|
1283 |
+
<script language="javascript" type="text/javascript">
|
1284 |
+
function submitbutton(pressbutton) {
|
1285 |
+
var form = document.adminForm;
|
1286 |
+
if (pressbutton == 'cancel_event') {
|
1287 |
+
submitform(pressbutton);
|
1288 |
+
return;
|
1289 |
+
}
|
1290 |
+
if (form.date.value.search(/^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/)) {
|
1291 |
+
alert('Invalid Date');
|
1292 |
+
}
|
1293 |
+
else if (form.selhour_from.value == "" && form.selminute_from.value == "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1294 |
+
submitform(pressbutton);
|
1295 |
+
}
|
1296 |
+
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1297 |
+
submitform(pressbutton);
|
1298 |
+
}
|
1299 |
+
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value != "" && form.selminute_to.value != "") {
|
1300 |
+
submitform(pressbutton);
|
1301 |
+
}
|
1302 |
+
|
1303 |
+
else {
|
1304 |
+
alert('Invalid Time');
|
1305 |
+
}
|
1306 |
+
}
|
1307 |
+
|
1308 |
+
|
1309 |
+
function submitform(pressbutton) {
|
1310 |
+
|
1311 |
+
if (document.getElementById('title').value == "") {
|
1312 |
+
alert('Provide the title:');
|
1313 |
+
}
|
1314 |
+
else {
|
1315 |
+
document.getElementById('adminForm').submit();
|
1316 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
1317 |
+
document.getElementById('adminForm').submit();
|
1318 |
+
}
|
1319 |
+
}
|
1320 |
+
function checkhour(id,event) {
|
1321 |
+
if (typeof(event) != 'undefined') {
|
1322 |
+
var e = event; // for trans-browser compatibility
|
1323 |
+
var charCode = e.which || e.keyCode;
|
1324 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1325 |
+
return false;
|
1326 |
+
}
|
1327 |
+
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1328 |
+
hour = parseFloat(hour);
|
1329 |
+
if (document.getSelection() != '') {
|
1330 |
+
return true;
|
1331 |
+
}
|
1332 |
+
if ((hour < 0) || (hour > 23)) {
|
1333 |
+
return false;
|
1334 |
+
}
|
1335 |
+
}
|
1336 |
+
return true;
|
1337 |
+
}
|
1338 |
+
function check12hour(id,event) {
|
1339 |
+
if (typeof(event) != 'undefined') {
|
1340 |
+
var e = event; // for trans-browser compatibility
|
1341 |
+
var charCode = e.which || e.keyCode;
|
1342 |
+
input = document.getElementById(id);
|
1343 |
+
if (charCode == 48 && input.value.length == 0) {
|
1344 |
+
return false;
|
1345 |
+
}
|
1346 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1347 |
+
return false;
|
1348 |
+
}
|
1349 |
+
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1350 |
+
hour = parseFloat(hour);
|
1351 |
+
if (document.getSelection() != '') {
|
1352 |
+
return true;
|
1353 |
+
}
|
1354 |
+
if ((hour < 0) || (hour > 12)) {
|
1355 |
+
return false;
|
1356 |
+
}
|
1357 |
+
}
|
1358 |
+
return true;
|
1359 |
+
}
|
1360 |
+
function checknumber(id,event) {
|
1361 |
+
if (typeof(event) != 'undefined') {
|
1362 |
+
var e = event; // for trans-browser compatibility
|
1363 |
+
var charCode = e.which || e.keyCode;
|
1364 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1365 |
+
return false;
|
1366 |
+
}
|
1367 |
+
}
|
1368 |
+
return true;
|
1369 |
+
}
|
1370 |
+
function checkminute(id,event) {
|
1371 |
+
if (typeof(event) != 'undefined') {
|
1372 |
+
var e = event; // for trans-browser compatibility
|
1373 |
+
var charCode = e.which || e.keyCode;
|
1374 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1375 |
+
return false;
|
1376 |
+
}
|
1377 |
+
minute = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1378 |
+
minute = parseFloat(minute);
|
1379 |
+
if (document.getSelection() != '') {
|
1380 |
+
return true;
|
1381 |
+
}
|
1382 |
+
if ((minute < 0) || (minute > 59)) {
|
1383 |
+
return false;
|
1384 |
+
}
|
1385 |
+
}
|
1386 |
+
return true;
|
1387 |
+
}
|
1388 |
+
function add_0(id) {
|
1389 |
+
input = document.getElementById(id);
|
1390 |
+
if (input.value.length == 1) {
|
1391 |
+
input.value = '0' + input.value;
|
1392 |
+
input.setAttribute("value", input.value);
|
1393 |
+
}
|
1394 |
+
}
|
1395 |
+
function change_type(type) {
|
1396 |
+
if (document.getElementById('daily1').value == '') {
|
1397 |
+
document.getElementById('daily1').value = 1;
|
1398 |
+
}
|
1399 |
+
else {
|
1400 |
+
document.getElementById('repeat_input').removeAttribute('style');
|
1401 |
+
}
|
1402 |
+
if (document.getElementById('weekly1').value == '') {
|
1403 |
+
document.getElementById('weekly1').value = 1;
|
1404 |
+
}
|
1405 |
+
if (document.getElementById('monthly1').value == '') {
|
1406 |
+
document.getElementById('monthly1').value = 1;
|
1407 |
+
}
|
1408 |
+
if (document.getElementById('yearly1').value == '') {
|
1409 |
+
document.getElementById('yearly1').value = 1;
|
1410 |
+
}
|
1411 |
+
switch (type) {
|
1412 |
+
case 'no_repeat':
|
1413 |
+
document.getElementById('daily').setAttribute('style', 'display:none');
|
1414 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1415 |
+
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1416 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1417 |
+
document.getElementById('month').value = '';
|
1418 |
+
document.getElementById('date_end').value = '';
|
1419 |
+
document.getElementById('repeat_until').setAttribute('style', 'display:none');
|
1420 |
+
break;
|
1421 |
+
|
1422 |
+
case 'daily':
|
1423 |
+
document.getElementById('daily').removeAttribute('style');
|
1424 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1425 |
+
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1426 |
+
document.getElementById('repeat').innerHTML = 'Day(s)';
|
1427 |
+
document.getElementById('repeat_input').value = document.getElementById('daily1').value;
|
1428 |
+
document.getElementById('month').value = '';
|
1429 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1430 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
1431 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1432 |
+
return input_value('daily1')
|
1433 |
+
};
|
1434 |
+
break;
|
1435 |
+
|
1436 |
+
case 'weekly':
|
1437 |
+
document.getElementById('daily').removeAttribute('style');
|
1438 |
+
document.getElementById('weekly').removeAttribute('style');
|
1439 |
+
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1440 |
+
document.getElementById('repeat').innerHTML = 'Week(s) on :';
|
1441 |
+
document.getElementById('repeat_input').value = document.getElementById('weekly1').value;
|
1442 |
+
document.getElementById('month').value = '';
|
1443 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1444 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
1445 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1446 |
+
return input_value('weekly1')
|
1447 |
+
};
|
1448 |
+
break;
|
1449 |
+
|
1450 |
+
case 'monthly':
|
1451 |
+
document.getElementById('daily').removeAttribute('style');
|
1452 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1453 |
+
document.getElementById('monthly').removeAttribute('style');
|
1454 |
+
document.getElementById('repeat').innerHTML = 'Month(s)'
|
1455 |
+
document.getElementById('repeat_input').value = document.getElementById('monthly1').value;
|
1456 |
+
document.getElementById('month').value = '';
|
1457 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1458 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
1459 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1460 |
+
return input_value('monthly1')
|
1461 |
+
};
|
1462 |
+
|
1463 |
+
break;
|
1464 |
+
|
1465 |
+
case 'yearly':
|
1466 |
+
document.getElementById('daily').removeAttribute('style');
|
1467 |
+
document.getElementById('year_month').removeAttribute('style');
|
1468 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1469 |
+
document.getElementById('monthly').removeAttribute('style');
|
1470 |
+
document.getElementById('repeat').innerHTML = 'Year(s) in ';
|
1471 |
+
document.getElementById('repeat_input').value = document.getElementById('yearly1').value;
|
1472 |
+
document.getElementById('month').value = '';
|
1473 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
1474 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1475 |
+
return input_value('yearly1')
|
1476 |
+
};
|
1477 |
+
break;
|
1478 |
+
}
|
1479 |
+
}
|
1480 |
+
function week_value() {
|
1481 |
+
var value = '';
|
1482 |
+
for (i = 1; i <= 7; i++) {
|
1483 |
+
if (document.getElementById('week_' + i).checked) {
|
1484 |
+
value = value + document.getElementById('week_' + i).value + ',';
|
1485 |
+
}
|
1486 |
+
}
|
1487 |
+
document.getElementById('week').value = value;
|
1488 |
+
}
|
1489 |
+
function input_repeat() {
|
1490 |
+
if (document.getElementById('repeat_input').value == 1) {
|
1491 |
+
document.getElementById('repeat_input').value = '';
|
1492 |
+
}
|
1493 |
+
document.getElementById('repeat_input').removeAttribute('style');
|
1494 |
+
}
|
1495 |
+
function radio_month() {
|
1496 |
+
if (document.getElementById('radio1').checked == true) {
|
1497 |
+
document.getElementById('monthly_list').disabled = true;
|
1498 |
+
document.getElementById('month_week').disabled = true;
|
1499 |
+
document.getElementById('month').disabled = false;
|
1500 |
+
}
|
1501 |
+
else {
|
1502 |
+
document.getElementById('month').disabled = true;
|
1503 |
+
document.getElementById('monthly_list').disabled = false;
|
1504 |
+
document.getElementById('month_week').disabled = false;
|
1505 |
+
}
|
1506 |
+
}
|
1507 |
+
function input_value(id) {
|
1508 |
+
document.getElementById(id).value = document.getElementById('repeat_input').value;
|
1509 |
+
}
|
1510 |
+
</script>
|
1511 |
+
<style>
|
1512 |
+
fieldset {
|
1513 |
+
border: 2px solid #4f9bc6;
|
1514 |
+
width: 100%;
|
1515 |
+
background: #fafbfd;
|
1516 |
+
padding: 13px;
|
1517 |
+
margin-top: 20px;
|
1518 |
+
-webkit-border-radius: 8px;
|
1519 |
+
-moz-border-radius: 8px;
|
1520 |
+
border-radius: 8px;
|
1521 |
+
|
1522 |
+
}
|
1523 |
+
.wd_button{
|
1524 |
+
border: 1px solid #D5D5D5 !important;
|
1525 |
+
border-radius: 10px;
|
1526 |
+
width: 30px;
|
1527 |
+
height: 25px;
|
1528 |
+
}
|
1529 |
+
</style>
|
1530 |
+
<table width="95%">
|
1531 |
+
<tr>
|
1532 |
+
<td width="100%" style="font-size:14px; font-weight:bold">
|
1533 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
1534 |
+
<br />
|
1535 |
+
This section allows you to create/edit the events of a particular calendar.<br/> You can add unlimited number of events for each calendar.
|
1536 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
1537 |
+
</td>
|
1538 |
+
</tr>
|
1539 |
+
<tbody>
|
1540 |
+
<tr>
|
1541 |
+
<td width="100%"><h2>Add an event for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
1542 |
+
<td align="right"><input type="button" onClick="submitbutton('save_event')" value="Save" class="button-secondary action"></td>
|
1543 |
+
<td align="right"><input type="button" onClick="submitbutton('apply_event')" value="Apply" class="button-secondary action"></td>
|
1544 |
+
<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>
|
1545 |
+
</tr>
|
1546 |
+
</tbody>
|
1547 |
+
</table>
|
1548 |
+
<?php
|
1549 |
+
global $wpdb;
|
1550 |
+
$calendar = $wpdb->get_row($wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id=%d", $calendar_id ));
|
1551 |
+
|
1552 |
+
|
1553 |
+
$query1 = $wpdb->get_results("SELECT " . $wpdb->prefix . "spidercalendar_event.category, " . $wpdb->prefix . "spidercalendar_event_category.title
|
1554 |
+
FROM " . $wpdb->prefix . "spidercalendar_event
|
1555 |
+
JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
1556 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id;");
|
1557 |
+
|
1558 |
+
$query2 = $wpdb->get_results("SELECT title,id FROM " . $wpdb->prefix . "spidercalendar_event_category");
|
1559 |
+
|
1560 |
+
?>
|
1561 |
+
<form action="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>" method="post" id="adminForm" name="adminForm">
|
1562 |
+
<table width="95%">
|
1563 |
+
<tr>
|
1564 |
+
<td style="width:45%">
|
1565 |
+
<div style="width:95%">
|
1566 |
+
<fieldset class="adminform">
|
1567 |
+
<legend>Event Details</legend>
|
1568 |
+
<table class="admintable">
|
1569 |
+
<tr>
|
1570 |
+
<td class="key"><label for="title">Title: </label></td>
|
1571 |
+
<td><input type="text" id="title" name="title" size="41"/></td>
|
1572 |
+
</tr>
|
1573 |
+
|
1574 |
+
<tr>
|
1575 |
+
<td class="key"><label for="category">Select Category: </label></td>
|
1576 |
+
<td>
|
1577 |
+
<select id="category" name="category" style="width:240px">
|
1578 |
+
<option value="0">--Select Category--</option>
|
1579 |
+
<?php foreach ($query2 as $key => $category) {
|
1580 |
+
?>
|
1581 |
+
<option value="<?php echo $category->id; ?>"><?php if(isset($category)) echo $category->title ?></option>
|
1582 |
+
<?php
|
1583 |
+
}
|
1584 |
+
?>
|
1585 |
+
</select>
|
1586 |
+
</td>
|
1587 |
+
</tr>
|
1588 |
+
<tr>
|
1589 |
+
<td class="key"><label for="date">Date: </label></td>
|
1590 |
+
<td>
|
1591 |
+
<input style="width:90px" class="inputbox" type="text" name="date" id="date" size="10" maxlength="10" value="" />
|
1592 |
+
<input type="reset" class="wd_button" value="..." onClick="return showCalendar('date','%Y-%m-%d');" style="width: 31px;" />
|
1593 |
+
</td>
|
1594 |
+
</tr>
|
1595 |
+
<tr>
|
1596 |
+
<td class="key"><label for="selhour_from">Time: </label></td>
|
1597 |
+
<?php if ($calendar->time_format == 1) { ?>
|
1598 |
+
<td>
|
1599 |
+
<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>
|
1600 |
+
<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"/>
|
1601 |
+
<select id="select_from" name="select_from">
|
1602 |
+
<option selected="selected">AM</option>
|
1603 |
+
<option>PM</option>
|
1604 |
+
</select>
|
1605 |
+
<span style="font-size:12px"> - </span>
|
1606 |
+
<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>
|
1607 |
+
<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"/>
|
1608 |
+
<select id="select_to" name="select_to">
|
1609 |
+
<option>AM</option>
|
1610 |
+
<option>PM</option>
|
1611 |
+
</select>
|
1612 |
+
</td>
|
1613 |
+
<?php } if ($calendar->time_format == 0) { ?>
|
1614 |
+
<td>
|
1615 |
+
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right" onKeyPress="return checkhour('selhour_from',event)" value="" title="from" onBlur="add_0('selhour_from')"/> <b>:</b>
|
1616 |
+
<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')"/>
|
1617 |
+
<span style="font-size:12px"> - </span>
|
1618 |
+
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right" onKeyPress="return checkhour('selhour_to',event)" value="" title="to" onBlur="add_0('selhour_to')"/> <b>:</b>
|
1619 |
+
<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')"/>
|
1620 |
+
</td>
|
1621 |
+
<?php }?>
|
1622 |
+
</tr>
|
1623 |
+
<tr>
|
1624 |
+
<td class="key"><label for="poststuff">Note: </label></td>
|
1625 |
+
<td>
|
1626 |
+
<div id="poststuff" style="width:100% !important;">
|
1627 |
+
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
1628 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
|
1629 |
+
<?php the_editor(stripslashes(""),"text_for_date","title" ); ?>
|
1630 |
+
</div>
|
1631 |
+
<?php }else{
|
1632 |
+
wp_editor("", "text_for_date"); }?>
|
1633 |
+
</div>
|
1634 |
+
</div>
|
1635 |
+
</td>
|
1636 |
+
</tr>
|
1637 |
+
<tr>
|
1638 |
+
<td class="key"><label for="published1">Published: </label></td>
|
1639 |
+
<td>
|
1640 |
+
<input type="radio" name="published" id="published0" value="0" class="inputbox">
|
1641 |
+
<label for="published0">No</label>
|
1642 |
+
<input type="radio" name="published" id="published1" value="1" checked="checked" class="inputbox">
|
1643 |
+
<label for="published1">Yes</label>
|
1644 |
+
</td>
|
1645 |
+
</tr>
|
1646 |
+
</table>
|
1647 |
+
</fieldset>
|
1648 |
+
</div>
|
1649 |
+
</td>
|
1650 |
+
<td style="padding-left:25px; vertical-align:top !important; width:45%">
|
1651 |
+
<div style="width:100%">
|
1652 |
+
<fieldset class="adminform" style="margin-left: -25px;"><legend>Repeat Event</legend>
|
1653 |
+
<table>
|
1654 |
+
<tr>
|
1655 |
+
<td valign="top">
|
1656 |
+
<input type="radio" id="no_repeat_type" value="no_repeat" name="repeat_method" checked="checked" onChange="change_type('no_repeat')">
|
1657 |
+
<label for="no_repeat_type">Don't repeat this event</label>
|
1658 |
+
<br/>
|
1659 |
+
<input type="radio" id="daily_type" value="daily" name="repeat_method" onChange="change_type('daily');">
|
1660 |
+
<label for="daily_type">Repeat daily</label>
|
1661 |
+
<br/>
|
1662 |
+
<input type="radio" id="weekly_type" value="weekly" name="repeat_method" onChange="change_type('weekly');">
|
1663 |
+
<label for="weekly_type">Repeat weekly</label>
|
1664 |
+
<br/>
|
1665 |
+
<input type="radio" id="monthly_type" value="monthly" name="repeat_method" onChange="change_type('monthly');">
|
1666 |
+
<label for="monthly_type">Repeat monthly</label>
|
1667 |
+
<br/>
|
1668 |
+
<input type="radio" id="yearly_type" value="yearly" name="repeat_method" onChange="change_type('yearly');">
|
1669 |
+
<label for="yearly_type">Repeat yearly</label>
|
1670 |
+
<br/>
|
1671 |
+
</td>
|
1672 |
+
<td style="padding-left:10px" valign="top">
|
1673 |
+
<div id="daily" style="display:none">Repeat every
|
1674 |
+
<input type="text" id="repeat_input" size="5" name="repeat" onClick="return input_repeat()" onKeyPress="return checknumber(repeat_input)" value="1"/>
|
1675 |
+
<label id="repeat"></label>
|
1676 |
+
<label id="year_month" style="display:none;">
|
1677 |
+
<select name="year_month" id="year_month" class="inputbox">
|
1678 |
+
<option value="1" selected="selected">January</option>
|
1679 |
+
<option value="2">February</option>
|
1680 |
+
<option value="3">March</option>
|
1681 |
+
<option value="4">April</option>
|
1682 |
+
<option value="5">May</option>
|
1683 |
+
<option value="6">June</option>
|
1684 |
+
<option value="7">July</option>
|
1685 |
+
<option value="8">August</option>
|
1686 |
+
<option value="9">September</option>
|
1687 |
+
<option value="10">October</option>
|
1688 |
+
<option value="11">November</option>
|
1689 |
+
<option value="12">December</option>
|
1690 |
+
</select>
|
1691 |
+
</label>
|
1692 |
+
</div>
|
1693 |
+
<br/>
|
1694 |
+
<input type="hidden" id="daily1"/>
|
1695 |
+
<input type="hidden" id="weekly1"/>
|
1696 |
+
<input type="hidden" id="monthly1"/>
|
1697 |
+
<input type="hidden" id="yearly1"/>
|
1698 |
+
<div class="key" id="weekly" style="display:none">
|
1699 |
+
<input type="checkbox" value="Mon" id="week_1" onChange="week_value()"/>Mon
|
1700 |
+
<input type="checkbox" value="Tue" id="week_2" onChange="week_value()"/>Tue
|
1701 |
+
<input type="checkbox" value="Wed" id="week_3" onChange="week_value()"/>Wed
|
1702 |
+
<input type="checkbox" value="Thu" id="week_4" onChange="week_value()"/>Thu
|
1703 |
+
<input type="checkbox" value="Fri" id="week_5" onChange="week_value()"/>Fri
|
1704 |
+
<input type="checkbox" value="Sat" id="week_6" onChange="week_value()"/>Sat
|
1705 |
+
<input type="checkbox" value="Sun" id="week_7" onChange="week_value()"/>Sun
|
1706 |
+
<input type="hidden" name="week" id="week"/>
|
1707 |
+
</div>
|
1708 |
+
<br/>
|
1709 |
+
<div class="key" id="monthly" style="display:none">
|
1710 |
+
<input type="radio" id="radio1" onChange="radio_month()" name="month_type" value="1" checked="checked"/>on the:
|
1711 |
+
<input type="text" onKeyPress="return checknumber(month)" name="month" size="3" id="month"/><br/>
|
1712 |
+
<input type="radio" id="radio2" onChange="radio_month()" name="month_type" value="2"/>on the:
|
1713 |
+
<select name="monthly_list" id="monthly_list" class="inputbox">
|
1714 |
+
<option value="1">First</option>
|
1715 |
+
<option value="8">Second</option>
|
1716 |
+
<option value="15">Third</option>
|
1717 |
+
<option value="22">Fourth</option>
|
1718 |
+
<option value="last">Last</option>
|
1719 |
+
</select>
|
1720 |
+
<select name="month_week" id="month_week" class="inputbox">
|
1721 |
+
<option value="Mon">Monday</option>
|
1722 |
+
<option value="Tue">Tuesday</option>
|
1723 |
+
<option value="Wed">Wednesday</option>
|
1724 |
+
<option value="Thu">Thursday</option>
|
1725 |
+
<option value="Fri">Friday</option>
|
1726 |
+
<option value="Sat">Saturday</option>
|
1727 |
+
<option value="Sun">Sunday</option>
|
1728 |
+
</select>
|
1729 |
+
</div>
|
1730 |
+
<br/>
|
1731 |
+
<script>
|
1732 |
+
window.onload = radio_month();
|
1733 |
+
</script>
|
1734 |
+
</td>
|
1735 |
+
</tr>
|
1736 |
+
<tr id="repeat_until" style="display:none">
|
1737 |
+
<td>Repeat until: </td>
|
1738 |
+
<td>
|
1739 |
+
<input style="width:90px" class="inputbox" type="text" name="date_end" id="date_end" size="10" maxlength="10" value=""/>
|
1740 |
+
<input type="reset" class="wd_button" value="..." onClick="return showCalendar('date_end','%Y-%m-%d');"/>
|
1741 |
+
</td>
|
1742 |
+
</tr>
|
1743 |
+
</table>
|
1744 |
+
</fieldset>
|
1745 |
+
</div>
|
1746 |
+
</td>
|
1747 |
+
</tr>
|
1748 |
+
</table>
|
1749 |
+
<input type="hidden" name="option" value="com_spidercalendar"/>
|
1750 |
+
<input type="hidden" name="task" value=""/>
|
1751 |
+
<input type="hidden" name="calendar" value=""/>
|
1752 |
+
</form>
|
1753 |
+
<?php
|
1754 |
+
}
|
1755 |
+
|
1756 |
+
function html_edit_spider_event($row, $calendar_id, $id, $cal_name) {
|
1757 |
+
global $wpdb;
|
1758 |
+
$calendar = $wpdb->get_row($wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where id=%d", $calendar_id ));
|
1759 |
+
|
1760 |
+
?>
|
1761 |
+
<style>
|
1762 |
+
.calendar .button {
|
1763 |
+
display: table-cell !important;
|
1764 |
+
}
|
1765 |
+
fieldset {
|
1766 |
+
border: 2px solid #4f9bc6; /*#CCA383 1462a5*/
|
1767 |
+
width: 100%;
|
1768 |
+
background: #fafbfd;
|
1769 |
+
padding: 13px;
|
1770 |
+
margin-top: 20px;
|
1771 |
+
-webkit-border-radius: 8px;
|
1772 |
+
-moz-border-radius: 8px;
|
1773 |
+
border-radius: 8px;
|
1774 |
+
}
|
1775 |
+
.wd_button{
|
1776 |
+
border: 1px solid #D5D5D5 !important;
|
1777 |
+
border-radius: 10px;
|
1778 |
+
width: 30px;
|
1779 |
+
height: 25px;
|
1780 |
+
}
|
1781 |
+
</style>
|
1782 |
+
<script language="javascript" type="text/javascript">
|
1783 |
+
function submitform(pressbutton) {
|
1784 |
+
if (document.getElementById('title').value == "") {
|
1785 |
+
alert('Provide the title:');
|
1786 |
+
}
|
1787 |
+
else {
|
1788 |
+
document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
|
1789 |
+
document.getElementById('adminForm').submit();
|
1790 |
+
}
|
1791 |
+
}
|
1792 |
+
function submitbutton(pressbutton) {
|
1793 |
+
var form = document.adminForm;
|
1794 |
+
if (pressbutton == 'cancel_event') {
|
1795 |
+
submitform(pressbutton);
|
1796 |
+
return;
|
1797 |
+
}
|
1798 |
+
if (form.date.value.search(/^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/)) {
|
1799 |
+
alert('Invalid Date');
|
1800 |
+
}
|
1801 |
+
else if (form.date.value.search(/^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/)) {
|
1802 |
+
alert('Invalid Date');
|
1803 |
+
}
|
1804 |
+
else if (form.selhour_from.value == "" && form.selminute_from.value == "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1805 |
+
submitform(pressbutton);
|
1806 |
+
}
|
1807 |
+
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value == "" && form.selminute_to.value == "") {
|
1808 |
+
submitform(pressbutton);
|
1809 |
+
}
|
1810 |
+
else if (form.selhour_from.value != "" && form.selminute_from.value != "" && form.selhour_to.value != "" && form.selminute_to.value != "") {
|
1811 |
+
submitform(pressbutton);
|
1812 |
+
}
|
1813 |
+
else {
|
1814 |
+
alert('Invalid Time');
|
1815 |
+
}
|
1816 |
+
}
|
1817 |
+
function checkhour(id,event) {
|
1818 |
+
if (typeof(event) != 'undefined') {
|
1819 |
+
var e = event; // for trans-browser compatibility
|
1820 |
+
var charCode = e.which || e.keyCode;
|
1821 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1822 |
+
return false;
|
1823 |
+
}
|
1824 |
+
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1825 |
+
hour = parseFloat(hour);
|
1826 |
+
if (document.getSelection() != '') {
|
1827 |
+
return true;
|
1828 |
+
}
|
1829 |
+
if ((hour < 0) || (hour > 23)) {
|
1830 |
+
return false;
|
1831 |
+
}
|
1832 |
+
}
|
1833 |
+
return true;
|
1834 |
+
}
|
1835 |
+
function check12hour(id,event) {
|
1836 |
+
if (typeof(event) != 'undefined') {
|
1837 |
+
var e = event; // for trans-browser compatibility
|
1838 |
+
var charCode = e.which || e.keyCode;
|
1839 |
+
input = document.getElementById(id);
|
1840 |
+
if (charCode == 48 && input.value.length == 0) {
|
1841 |
+
return false;
|
1842 |
+
}
|
1843 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1844 |
+
return false;
|
1845 |
+
}
|
1846 |
+
hour = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1847 |
+
hour = parseFloat(hour);
|
1848 |
+
if (document.getSelection() != '') {
|
1849 |
+
return true;
|
1850 |
+
}
|
1851 |
+
if ((hour < 0) || (hour > 12)) {
|
1852 |
+
return false;
|
1853 |
+
}
|
1854 |
+
}
|
1855 |
+
return true;
|
1856 |
+
}
|
1857 |
+
function checknumber(id,event) {
|
1858 |
+
if (typeof(event) != 'undefined') {
|
1859 |
+
var e = event; // for trans-browser compatibility
|
1860 |
+
var charCode = e.which || e.keyCode;
|
1861 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1862 |
+
return false;
|
1863 |
+
}
|
1864 |
+
}
|
1865 |
+
return true;
|
1866 |
+
}
|
1867 |
+
function checkminute(id,event) {
|
1868 |
+
if (typeof(event) != 'undefined') {
|
1869 |
+
var e = event; // for trans-browser compatibility
|
1870 |
+
var charCode = e.which || e.keyCode;
|
1871 |
+
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
|
1872 |
+
return false;
|
1873 |
+
}
|
1874 |
+
minute = "" + document.getElementById(id).value + String.fromCharCode(e.charCode);
|
1875 |
+
minute = parseFloat(minute);
|
1876 |
+
if (document.getSelection() != '') {
|
1877 |
+
return true;
|
1878 |
+
}
|
1879 |
+
if ((minute < 0) || (minute > 59)) {
|
1880 |
+
return false;
|
1881 |
+
}
|
1882 |
+
}
|
1883 |
+
return true;
|
1884 |
+
}
|
1885 |
+
function add_0(id) {
|
1886 |
+
input = document.getElementById(id);
|
1887 |
+
if (input.value.length == 1) {
|
1888 |
+
input.value = '0' + input.value;
|
1889 |
+
input.setAttribute("value", input.value);
|
1890 |
+
}
|
1891 |
+
}
|
1892 |
+
function change_type(type) {
|
1893 |
+
if (document.getElementById('daily1').value == '') {
|
1894 |
+
document.getElementById('daily1').value = 1;
|
1895 |
+
}
|
1896 |
+
if (document.getElementById('weekly1').value == '') {
|
1897 |
+
document.getElementById('weekly1').value = 1;
|
1898 |
+
}
|
1899 |
+
if (document.getElementById('monthly1').value == '') {
|
1900 |
+
document.getElementById('monthly1').value = 1;
|
1901 |
+
}
|
1902 |
+
if (document.getElementById('yearly1').value == '') {
|
1903 |
+
document.getElementById('yearly1').value = 1;
|
1904 |
+
}
|
1905 |
+
switch (type) {
|
1906 |
+
case 'no_repeat':
|
1907 |
+
document.getElementById('daily').setAttribute('style', 'display:none');
|
1908 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1909 |
+
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1910 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1911 |
+
document.getElementById('repeat_until').setAttribute('style', 'display:none');
|
1912 |
+
document.getElementById('month').value = '';
|
1913 |
+
document.getElementById('date_end').value = ''
|
1914 |
+
break;
|
1915 |
+
|
1916 |
+
case 'daily':
|
1917 |
+
document.getElementById('daily').removeAttribute('style');
|
1918 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
1919 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1920 |
+
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1921 |
+
document.getElementById('repeat').innerHTML = 'Day(s)';
|
1922 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1923 |
+
return input_value('daily1')
|
1924 |
+
};
|
1925 |
+
document.getElementById('month').value = '';
|
1926 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1927 |
+
document.getElementById('repeat_input').value = document.getElementById('daily1').value;
|
1928 |
+
break;
|
1929 |
+
|
1930 |
+
case 'weekly':
|
1931 |
+
document.getElementById('daily').removeAttribute('style');
|
1932 |
+
document.getElementById('weekly').removeAttribute('style');
|
1933 |
+
document.getElementById('monthly').setAttribute('style', 'display:none');
|
1934 |
+
document.getElementById('repeat').innerHTML = 'Week(s) on :';
|
1935 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1936 |
+
return input_value('weekly1')
|
1937 |
+
};
|
1938 |
+
document.getElementById('month').value = '';
|
1939 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1940 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
1941 |
+
document.getElementById('repeat_input').value = document.getElementById('weekly1').value;
|
1942 |
+
break;
|
1943 |
+
|
1944 |
+
case 'monthly':
|
1945 |
+
document.getElementById('daily').removeAttribute('style');
|
1946 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1947 |
+
document.getElementById('monthly').removeAttribute('style');
|
1948 |
+
document.getElementById('repeat').innerHTML = 'Month(s)'
|
1949 |
+
document.getElementById('repeat_input').value = document.getElementById('monthly1').value;
|
1950 |
+
document.getElementById('month').value = '';
|
1951 |
+
document.getElementById('year_month').setAttribute('style', 'display:none');
|
1952 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
1953 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1954 |
+
return input_value('monthly1')
|
1955 |
+
};
|
1956 |
+
break;
|
1957 |
+
|
1958 |
+
case 'yearly':
|
1959 |
+
document.getElementById('daily').removeAttribute('style');
|
1960 |
+
document.getElementById('year_month').removeAttribute('style');
|
1961 |
+
document.getElementById('weekly').setAttribute('style', 'display:none');
|
1962 |
+
document.getElementById('monthly').removeAttribute('style');
|
1963 |
+
document.getElementById('repeat').innerHTML = 'Year(s) in ';
|
1964 |
+
document.getElementById('repeat_input').value = document.getElementById('yearly1').value;
|
1965 |
+
document.getElementById('month').value = '';
|
1966 |
+
document.getElementById('repeat_until').removeAttribute('style');
|
1967 |
+
document.getElementById('repeat_input').onchange = function onchange(event) {
|
1968 |
+
return input_value('yearly1')
|
1969 |
+
};
|
1970 |
+
break;
|
1971 |
+
}
|
1972 |
+
}
|
1973 |
+
function week_value() {
|
1974 |
+
var value = '';
|
1975 |
+
for (i = 1; i <= 7; i++) {
|
1976 |
+
if (document.getElementById('week_' + i).checked) {
|
1977 |
+
value = value + document.getElementById('week_' + i).value + ',';
|
1978 |
+
}
|
1979 |
+
}
|
1980 |
+
document.getElementById('week').value = value;
|
1981 |
+
}
|
1982 |
+
function radio_month() {
|
1983 |
+
if (document.getElementById('radio1').checked == true) {
|
1984 |
+
document.getElementById('monthly_list').disabled = true;
|
1985 |
+
document.getElementById('month_week').disabled = true;
|
1986 |
+
document.getElementById('month').disabled = false;
|
1987 |
+
}
|
1988 |
+
else {
|
1989 |
+
document.getElementById('month').disabled = true;
|
1990 |
+
document.getElementById('monthly_list').disabled = false;
|
1991 |
+
document.getElementById('month_week').disabled = false;
|
1992 |
+
}
|
1993 |
+
}
|
1994 |
+
function input_value(id) {
|
1995 |
+
document.getElementById(id).value = document.getElementById('repeat_input').value;
|
1996 |
+
}
|
1997 |
+
</script>
|
1998 |
+
<?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");
|
1999 |
+
|
2000 |
+
$query2 = $wpdb->get_results("SELECT title,id FROM " . $wpdb->prefix . "spidercalendar_event_category");
|
2001 |
+
?>
|
2002 |
+
<table width="95%">
|
2003 |
+
<tr>
|
2004 |
+
<td width="100%" style="font-size:14px; font-weight:bold">
|
2005 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
|
2006 |
+
<br />
|
2007 |
+
This section allows you to create/edit the events of a particular calendar.<br/> You can add unlimited number of events for each calendar.
|
2008 |
+
<a href="http://web-dorado.com/spider-calendar-wordpress-guide-step-3.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
|
2009 |
+
</td>
|
2010 |
+
</tr>
|
2011 |
+
<tbody>
|
2012 |
+
<tr>
|
2013 |
+
<td width="100%"><h2>Edit an event for calendar <font style="color:red"><?php echo $cal_name; ?></font></h2></td>
|
2014 |
+
<td align="right"><input type="button" onClick="submitbutton('save_event')" value="Save" class="button-secondary action"></td>
|
2015 |
+
<td align="right"><input type="button" onClick="submitbutton('apply_event')" value="Apply" class="button-secondary action"></td>
|
2016 |
+
<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>
|
2017 |
+
</tr>
|
2018 |
+
</tbody>
|
2019 |
+
</table>
|
2020 |
+
|
2021 |
+
<form action="admin.php?page=SpiderCalendar&calendar_id=<?php echo $calendar_id; ?>&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm">
|
2022 |
+
<table width="95%">
|
2023 |
+
<tr>
|
2024 |
+
<td style="width:45%">
|
2025 |
+
<div style="width:95%">
|
2026 |
+
<fieldset class="adminform">
|
2027 |
+
<legend>Event Details</legend>
|
2028 |
+
<table class="admintable">
|
2029 |
+
<tr>
|
2030 |
+
<td class="key"><label for="message">Title: </label></td>
|
2031 |
+
<td><input type="text" id="title" name="title" size="41" value="<?php echo htmlspecialchars($row->title, ENT_QUOTES); ?>"/></td>
|
2032 |
+
</tr>
|
2033 |
+
<tr>
|
2034 |
+
<td class="key"><label for="category">Select Category: </label></td>
|
2035 |
+
<td>
|
2036 |
+
<select id="category" name="category" style="width:240px">
|
2037 |
+
<option value="0" <?php if ($row->category == "0") echo 'selected="selected"'; ?>><?php if(isset($category)) echo $category->title ?>--Select Category--</option>
|
2038 |
+
<?php foreach ($query2 as $key => $category) {
|
2039 |
+
?>
|
2040 |
+
<option value="<?php echo $category->id; ?>" <?php if ( $category->id == $row->category ) echo 'selected="selected"'; ?>><?php if(isset($category)) echo $category->title ?></option>
|
2041 |
+
<?php
|
2042 |
+
}
|
2043 |
+
?>
|
2044 |
+
|
2045 |
+
</select>
|
2046 |
+
</td>
|
2047 |
+
</tr>
|
2048 |
+
|
2049 |
+
<tr>
|
2050 |
+
<td class="key"><label for="message">Date: </label></td>
|
2051 |
+
<td>
|
2052 |
+
<input class="inputbox" style="width:90px" type="text" name="date" id="date" size="10" maxlength="10" value="<?php echo $row->date; ?>"/>
|
2053 |
+
<?php
|
2054 |
+
if ($row->date_end == '0000-00-00') {
|
2055 |
+
$row->date_end = "";
|
2056 |
+
}
|
2057 |
+
?>
|
2058 |
+
<input type="reset" class="wd_button" value="..." onClick="return showCalendar('date','%Y-%m-%d');"/>
|
2059 |
+
</td>
|
2060 |
+
</tr>
|
2061 |
+
<tr>
|
2062 |
+
<td class="key"><label for="message">Time: </label></td>
|
2063 |
+
<td>
|
2064 |
+
<?php
|
2065 |
+
if (!$row->time) {
|
2066 |
+
$from[0] = "";
|
2067 |
+
$from[1] = "";
|
2068 |
+
$to[0] = "";
|
2069 |
+
$to[1] = "";
|
2070 |
+
}
|
2071 |
+
else {
|
2072 |
+
$from_to = explode("-", $row->time);
|
2073 |
+
$from = explode(":", $from_to[0]);
|
2074 |
+
if (isset($from_to[1])) {
|
2075 |
+
$to = explode(":", $from_to[1]);
|
2076 |
+
}
|
2077 |
+
else {
|
2078 |
+
$to[0] = "";
|
2079 |
+
$to[1] = "";
|
2080 |
+
}
|
2081 |
+
}
|
2082 |
+
?>
|
2083 |
+
<?php if ($calendar->time_format == 0) { ?>
|
2084 |
+
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
2085 |
+
onkeypress="return checkhour('selhour_from',event)" value="<?php echo $from[0]; ?>" title="from"
|
2086 |
+
onblur="add_0('selhour_from')"/> <b>:</b>
|
2087 |
+
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
2088 |
+
onkeypress="return checkminute('selminute_from',event)" value="<?php echo substr($from[1], 0, 2); ?>"
|
2089 |
+
title="from" onBlur="add_0('selminute_from')"/> <span style="font-size:12px"> - </span>
|
2090 |
+
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
2091 |
+
onkeypress="return checkhour('selhour_to',event)" value="<?php echo $to[0]; ?>" title="to"
|
2092 |
+
onblur="add_0('selhour_to')"/> <b>:</b>
|
2093 |
+
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
2094 |
+
onkeypress="return checkminute('selminute_to',event)" value="<?php echo substr($to[1], 0, 2); ?>"
|
2095 |
+
title="to" onBlur="add_0('selminute_to')"/>
|
2096 |
+
<?php }
|
2097 |
+
if ($calendar->time_format == 1) { ?>
|
2098 |
+
<input type="text" id="selhour_from" name="selhour_from" size="1" style="text-align:right"
|
2099 |
+
onkeypress="return check12hour('selhour_from',event)" value="<?php echo $from[0]; ?>" title="from"
|
2100 |
+
onblur="add_0('selhour_from')"/> <b>:</b>
|
2101 |
+
<input type="text" id="selminute_from" name="selminute_from" size="1" style="text-align:right"
|
2102 |
+
onkeypress="return checkminute('selminute_from',event)" value="<?php echo substr($from[1], 0, 2); ?>"
|
2103 |
+
title="from" onBlur="add_0('selminute_from')"/>
|
2104 |
+
<select id="select_from" name="select_from">
|
2105 |
+
<option <?php if (substr($from[1], 2, 2) == "AM")
|
2106 |
+
echo 'selected="selected"'; ?>>AM
|
2107 |
+
</option>
|
2108 |
+
<option <?php if (substr($from[1], 2, 2) == "PM")
|
2109 |
+
echo 'selected="selected"'; ?>>PM
|
2110 |
+
</option>
|
2111 |
+
</select>
|
2112 |
+
<span style="font-size:12px"> - </span>
|
2113 |
+
<input type="text" id="selhour_to" name="selhour_to" size="1" style="text-align:right"
|
2114 |
+
onkeypress="return check12hour('selhour_to',event)" value="<?php echo $to[0]; ?>" title="to"
|
2115 |
+
onblur="add_0('selhour_to')"/> <b>:</b>
|
2116 |
+
<input type="text" id="selminute_to" name="selminute_to" size="1" style="text-align:right"
|
2117 |
+
onkeypress="return checkminute('selminute_to',event)" value="<?php echo substr($to[1], 0, 2); ?>"
|
2118 |
+
title="to" onBlur="add_0('selminute_to')"/>
|
2119 |
+
<select id="select_to" name="select_to">
|
2120 |
+
<option <?php if (substr($to[1], 2, 2) == "AM")
|
2121 |
+
echo 'selected="selected"'; ?>>AM
|
2122 |
+
</option>
|
2123 |
+
<option <?php if (substr($to[1], 2, 2) == "PM")
|
2124 |
+
echo 'selected="selected"'; ?>>PM
|
2125 |
+
</option>
|
2126 |
+
</select>
|
2127 |
+
<?php }?>
|
2128 |
+
</td>
|
2129 |
+
</tr>
|
2130 |
+
<tr>
|
2131 |
+
<td class="key"><label for="note">Note: </label></td>
|
2132 |
+
<td>
|
2133 |
+
<div id="poststuff" style="width:100% !important;">
|
2134 |
+
<?php if(version_compare(get_bloginfo('version'),3.3)<0) {?>
|
2135 |
+
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"><?php the_editor(stripslashes($row->description),"text_for_date","title" ); ?>
|
2136 |
+
</div>
|
2137 |
+
<?php }else{
|
2138 |
+
if(isset($row->text_for_date)) $desc1 = $row->text_for_date;
|
2139 |
+
else $desc1 = "";
|
2140 |
+
wp_editor($desc1, "text_for_date"); }?>
|
2141 |
+
</div>
|
2142 |
+
</div>
|
2143 |
+
</td>
|
2144 |
+
</tr>
|
2145 |
+
<tr>
|
2146 |
+
<td class="key"><label for="note">Published: </label></td>
|
2147 |
+
<td>
|
2148 |
+
<input type="radio" name="published" id="published0" value="0" <?php cheched($row->published, '0'); ?> class="inputbox">
|
2149 |
+
<label for="published0">No</label>
|
2150 |
+
<input type="radio" name="published" id="published1" value="1" <?php cheched($row->published, '1'); ?> class="inputbox">
|
2151 |
+
<label for="published1">Yes</label>
|
2152 |
+
</td>
|
2153 |
+
</tr>
|
2154 |
+
</table>
|
2155 |
+
</fieldset>
|
2156 |
+
</div>
|
2157 |
+
</td>
|
2158 |
+
<td style="padding-left:25px; vertical-align:top !important; width:45%">
|
2159 |
+
<div style="width:100%">
|
2160 |
+
<fieldset class="adminform" style="margin-left: -25px;">
|
2161 |
+
<legend>Repeat Event</legend>
|
2162 |
+
<table>
|
2163 |
+
<tr>
|
2164 |
+
<td valign="top">
|
2165 |
+
<input type="radio" value="no_repeat" id="no_repeat_type" name="repeat_method" <?php if ($row->repeat_method == 'no_repeat')
|
2166 |
+
echo 'checked="checked"' ?> checked="checked" onChange="change_type('no_repeat')"/>
|
2167 |
+
<label for="no_repeat_type">Don't repeat this event</label><br/>
|
2168 |
+
|
2169 |
+
<input type="radio" value="daily" id="daily_type" name="repeat_method" <?php if ($row->repeat_method == 'daily')
|
2170 |
+
echo 'checked="checked"' ?> onchange="change_type('daily')"/>
|
2171 |
+
<label for="daily_type">Repeat daily</label><br/>
|
2172 |
+
|
2173 |
+
<input type="radio" value="weekly" id="weekly_type" name="repeat_method" <?php if ($row->repeat_method == 'weekly')
|
2174 |
+
echo 'checked="checked"' ?> onChange="change_type('weekly')"/>
|
2175 |
+
<label for="weekly_type">Repeat weekly</label>
|
2176 |
+
<br/>
|
2177 |
+
<input type="radio" value="monthly" id="monthly_type" name="repeat_method" <?php if ($row->repeat_method == 'monthly')
|
2178 |
+
echo 'checked="checked"'?> onChange="change_type('monthly')"/>
|
2179 |
+
<label for="monthly_type">Repeat monthly</label>
|
2180 |
+
<br/>
|
2181 |
+
<input type="radio" value="yearly" id="yearly_type" name="repeat_method" <?php if ($row->repeat_method == 'yearly')
|
2182 |
+
echo 'checked="checked"' ?> onChange="change_type('yearly')"/>
|
2183 |
+
<label for="yearly_type">Repeat yearly</label>
|
2184 |
+
<br/>
|
2185 |
+
</td>
|
2186 |
+
<td style="padding-left:10px" valign="top">
|
2187 |
+
<div id="daily" style="display:<?php if ($row->repeat_method == 'no_repeat') echo 'none'; ?>">
|
2188 |
+
Repeat every <input type="text" id="repeat_input" size="5" name="repeat" onKeyPress="return checknumber(repeat_input)" value="<?php echo $row->repeat ?>"/>
|
2189 |
+
<label id="repeat"><?php if ($row->repeat_method == 'daily')
|
2190 |
+
echo 'Day(s)';
|
2191 |
+
if ($row->repeat_method == 'weekly')
|
2192 |
+
echo 'Week(s) on :';
|
2193 |
+
if ($row->repeat_method == 'monthly')
|
2194 |
+
echo 'Month(s)';
|
2195 |
+
if ($row->repeat_method == 'yearly')
|
2196 |
+
echo 'Year(s) in';
|
2197 |
+
?></label>
|
2198 |
+
<label id="year_month" style="display:<?php if ($row->repeat_method != 'yearly') echo 'none'; ?>">
|
2199 |
+
<select name="year_month" id="year_month" class="inputbox">
|
2200 |
+
<option value="1" <?php echo selectted($row->year_month, '1'); ?>>January</option>
|
2201 |
+
<option value="2" <?php echo selectted($row->year_month, '2'); ?>>February</option>
|
2202 |
+
<option value="3" <?php echo selectted($row->year_month, '3'); ?>>March</option>
|
2203 |
+
<option value="4" <?php echo selectted($row->year_month, '4'); ?>>April</option>
|
2204 |
+
<option value="5" <?php echo selectted($row->year_month, '5'); ?>>May</option>
|
2205 |
+
<option value="6" <?php echo selectted($row->year_month, '6'); ?>>June</option>
|
2206 |
+
<option value="7" <?php echo selectted($row->year_month, '7'); ?>>July</option>
|
2207 |
+
<option value="8" <?php echo selectted($row->year_month, '8'); ?>>August</option>
|
2208 |
+
<option value="9" <?php echo selectted($row->year_month, '9'); ?>>September</option>
|
2209 |
+
<option value="10" <?php echo selectted($row->year_month, '10'); ?>>October</option>
|
2210 |
+
<option value="11" <?php echo selectted($row->year_month, '11'); ?>>November</option>
|
2211 |
+
<option value="12" <?php echo selectted($row->year_month, '12'); ?>>December</option>
|
2212 |
+
</select></label>
|
2213 |
+
<input type="hidden" value="<?php if ($row->repeat_method == 'daily') echo $row->repeat; ?>" id="daily1"/>
|
2214 |
+
<input type="hidden" value="<?php if ($row->repeat_method == 'weekly') echo $row->repeat; ?>" id="weekly1"/>
|
2215 |
+
<input type="hidden" value="<?php if ($row->repeat_method == 'monthly') echo $row->repeat; ?>" id="monthly1"/>
|
2216 |
+
<input type="hidden" value="<?php if ($row->repeat_method == 'yearly') echo $row->repeat; ?>" id="yearly1"/>
|
2217 |
+
</div>
|
2218 |
+
<br/>
|
2219 |
+
<div class="key" id="weekly" style="display:<?php if ($row->repeat_method != 'weekly') echo 'none'; ?>">
|
2220 |
+
<input type="checkbox" value="Mon" id="week_1" onChange="week_value()" <?php if (in_array('Mon', explode(',', $row->week))) echo 'checked="checked"' ?> />Mon
|
2221 |
+
<input type="checkbox" value="Tue" id="week_2" onChange="week_value()" <?php if (in_array('Tue', explode(',', $row->week))) echo 'checked="checked"' ?> />Tue
|
2222 |
+
<input type="checkbox" value="Wed" id="week_3" onChange="week_value()" <?php if (in_array('Wed', explode(',', $row->week))) echo 'checked="checked"' ?> />Wed
|
2223 |
+
<input type="checkbox" value="Thu" id="week_4" onChange="week_value()" <?php if (in_array('Thu', explode(',', $row->week))) echo 'checked="checked"' ?> />Thu
|
2224 |
+
<input type="checkbox" value="Fri" id="week_5" onChange="week_value()" <?php if (in_array('Fri', explode(',', $row->week))) echo 'checked="checked"' ?> />Fri
|
2225 |
+
<input type="checkbox" value="Sat" id="week_6" onChange="week_value()" <?php if (in_array('Sat', explode(',', $row->week))) echo 'checked="checked"' ?> />Sat
|
2226 |
+
<input type="checkbox" value="Sun" id="week_7" onChange="week_value()" <?php if (in_array('Sun', explode(',', $row->week))) echo 'checked="checked"' ?> />Sun
|
2227 |
+
<input type="hidden" name="week" id="week" value="<?php echo $row->week ?>"/>
|
2228 |
+
</div>
|
2229 |
+
<br/>
|
2230 |
+
<div class="key" id="monthly" style="display:<?php if ($row->repeat_method != 'monthly' && $row->repeat_method != 'yearly') echo 'none'; ?>">
|
2231 |
+
<input type="radio" id="radio1" name="month_type" onChange="radio_month()" value="1" checked="checked" <?php if ($row->month_type == 1)
|
2232 |
+
echo 'checked="checked"' ?> />on the: <input type="text" name="month" size="3" onKeyPress="return checknumber(month)" id="month"
|
2233 |
+
value="<?php echo $row->month; ?>"/><br/>
|
2234 |
+
<input type="radio" id="radio2" name="month_type" onChange="radio_month()" value="2" <?php if ($row->month_type == 2) echo 'checked="checked"'; ?> />on the:
|
2235 |
+
<select name="monthly_list" id="monthly_list" class="inputbox">
|
2236 |
+
<option <?php echo selectted($row->monthly_list, '1'); ?> value="1">First</option>
|
2237 |
+
<option <?php echo selectted($row->monthly_list, '8'); ?> value="8">Second</option>
|
2238 |
+
<option <?php echo selectted($row->monthly_list, '15'); ?> value="15">Third</option>
|
2239 |
+
<option <?php echo selectted($row->monthly_list, '22'); ?> value="22">Fourth</option>
|
2240 |
+
<option <?php echo selectted($row->monthly_list, 'last'); ?> value="last">Last</option>
|
2241 |
+
</select>
|
2242 |
+
<select name="month_week" id="month_week" class="inputbox">
|
2243 |
+
<option <?php echo selectted($row->month_week, 'Mon'); ?> value="Mon">Monday</option>
|
2244 |
+
<option <?php echo selectted($row->month_week, 'Tue'); ?> value="Tue">Tuesday</option>
|
2245 |
+
<option <?php echo selectted($row->month_week, 'Wed'); ?> value="Wed">Wednesday</option>
|
2246 |
+
<option <?php echo selectted($row->month_week, 'Thu'); ?> value="Thu">Thursday</option>
|
2247 |
+
<option <?php echo selectted($row->month_week, 'Fri'); ?> value="Fri">Friday</option>
|
2248 |
+
<option <?php echo selectted($row->month_week, 'Sat'); ?> value="Sat">Saturday</option>
|
2249 |
+
<option <?php echo selectted($row->month_week, 'Sun'); ?> value="Sun">Sunday</option>
|
2250 |
+
</select>
|
2251 |
+
</div>
|
2252 |
+
<br/>
|
2253 |
+
<script>
|
2254 |
+
window.onload = radio_month();
|
2255 |
+
</script>
|
2256 |
+
</td>
|
2257 |
+
</tr>
|
2258 |
+
<tr id="repeat_until" style="display:<?php if ($row->repeat_method == 'no_repeat') echo 'none'; ?>">
|
2259 |
+
<td>Repeat until: </td>
|
2260 |
+
<?php
|
2261 |
+
if ($row->date_end == '2070-12-12') {
|
2262 |
+
$row->date_end = '';
|
2263 |
+
}
|
2264 |
+
?>
|
2265 |
+
<td>
|
2266 |
+
<input style="width:90px" class="inputbox" type="text" name="date_end" id="date_end" size="10" maxlength="10" value="<?php echo $row->date_end; ?>"/>
|
2267 |
+
<input type="reset" class="wd_button" value="..." onClick="return showCalendar('date_end','%Y-%m-%d');"/>
|
2268 |
+
</td>
|
2269 |
+
</tr>
|
2270 |
+
</table>
|
2271 |
+
</fieldset>
|
2272 |
+
</div>
|
2273 |
+
</td>
|
2274 |
+
</tr>
|
2275 |
+
</table>
|
2276 |
+
<input type="hidden" name="option" value="com_spidercalendar"/>
|
2277 |
+
<input type="hidden" name="id" value="<?php echo $row->id; ?>"/>
|
2278 |
+
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
|
2279 |
+
<input type="hidden" name="task" value="event"/>
|
2280 |
+
<input type="hidden" name="calendar" value=""/>
|
2281 |
</form> <?php } ?>
|
calendar_functions.php
CHANGED
@@ -1,673 +1,689 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
$
|
20 |
-
$sort["
|
21 |
-
$sort["
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
$
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
$
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
$
|
70 |
-
|
71 |
-
$
|
72 |
-
|
73 |
-
$
|
74 |
-
|
75 |
-
$
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
$
|
87 |
-
|
88 |
-
$sort["
|
89 |
-
$sort["
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
$
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
$
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
$
|
130 |
-
$
|
131 |
-
$
|
132 |
-
$
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
$
|
142 |
-
$sort["
|
143 |
-
$sort["
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
$
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
$
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
$
|
184 |
-
$
|
185 |
-
$
|
186 |
-
|
187 |
-
$
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
}
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
'
|
247 |
-
|
248 |
-
'
|
249 |
-
'
|
250 |
-
'
|
251 |
-
|
252 |
-
'%
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
$publish =
|
268 |
-
$publish_unpublish = 'Category
|
269 |
-
}
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
'
|
303 |
-
'
|
304 |
-
|
305 |
-
|
306 |
-
))
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
$
|
323 |
-
$
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
'
|
334 |
-
'
|
335 |
-
|
336 |
-
'
|
337 |
-
'
|
338 |
-
'
|
339 |
-
'
|
340 |
-
'
|
341 |
-
|
342 |
-
'%
|
343 |
-
'%
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
'
|
349 |
-
'
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
'
|
357 |
-
'
|
358 |
-
'
|
359 |
-
'
|
360 |
-
'
|
361 |
-
'
|
362 |
-
'
|
363 |
-
))
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
$
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
$sort["
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
$
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
}
|
444 |
-
|
445 |
-
$
|
446 |
-
}
|
447 |
-
|
448 |
-
$
|
449 |
-
}
|
450 |
-
|
451 |
-
$
|
452 |
-
}
|
453 |
-
if (
|
454 |
-
$where
|
455 |
-
}
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
$
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
$
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
$
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
$
|
493 |
-
$
|
494 |
-
$
|
495 |
-
$
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
$
|
503 |
-
$
|
504 |
-
$
|
505 |
-
$
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
$
|
510 |
-
$
|
511 |
-
$
|
512 |
-
$
|
513 |
-
$
|
514 |
-
$
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
'
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
'
|
539 |
-
|
540 |
-
'
|
541 |
-
'
|
542 |
-
'
|
543 |
-
'
|
544 |
-
'
|
545 |
-
'
|
546 |
-
|
547 |
-
'
|
548 |
-
|
549 |
-
'
|
550 |
-
'
|
551 |
-
'
|
552 |
-
'
|
553 |
-
'
|
554 |
-
'
|
555 |
-
'
|
556 |
-
|
557 |
-
'%
|
558 |
-
|
559 |
-
'%s',
|
560 |
-
'%s',
|
561 |
-
'%
|
562 |
-
'%s',
|
563 |
-
'%s',
|
564 |
-
'%
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
'
|
570 |
-
|
571 |
-
'
|
572 |
-
'
|
573 |
-
'
|
574 |
-
'
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
'
|
580 |
-
|
581 |
-
'
|
582 |
-
'
|
583 |
-
'
|
584 |
-
'
|
585 |
-
|
586 |
-
'
|
587 |
-
|
588 |
-
'
|
589 |
-
'
|
590 |
-
'
|
591 |
-
'
|
592 |
-
'
|
593 |
-
'
|
594 |
-
'
|
595 |
-
|
596 |
-
'%s',
|
597 |
-
|
598 |
-
'%s',
|
599 |
-
'%
|
600 |
-
'%s',
|
601 |
-
'%s'
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
}
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
}
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 spider_upcoming(){
|
14 |
+
if(isset($_GET['upcalendar_id']))
|
15 |
+
$calendar_id=(int)$_GET['upcalendar_id'];
|
16 |
+
else $calendar_id="0";
|
17 |
+
|
18 |
+
global $wpdb;
|
19 |
+
$order = " ORDER BY title ASC";
|
20 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
21 |
+
$sort["sortid_by"] = "title";
|
22 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
23 |
+
$sort["1_or_2"] = "2";
|
24 |
+
if (isset($_POST['page_number'])) {
|
25 |
+
if (esc_html($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
26 |
+
if (isset($_POST['order_by'])) {
|
27 |
+
$sort["sortid_by"] = esc_sql(esc_html($_POST['order_by']));
|
28 |
+
}
|
29 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
30 |
+
$sort["1_or_2"] = "2";
|
31 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
32 |
+
}
|
33 |
+
else {
|
34 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
35 |
+
$sort["1_or_2"] = "1";
|
36 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
37 |
+
}
|
38 |
+
if ($_POST['page_number']) {
|
39 |
+
$limit = (esc_html($_POST['page_number'])- 1) * 20;
|
40 |
+
}
|
41 |
+
else {
|
42 |
+
$limit = 0;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
else {
|
46 |
+
$limit = 0;
|
47 |
+
}
|
48 |
+
if (isset($_POST['search_events_by_title'])) {
|
49 |
+
$search_tag = esc_html($_POST['search_events_by_title']);
|
50 |
+
}
|
51 |
+
else {
|
52 |
+
$search_tag = "";
|
53 |
+
}
|
54 |
+
|
55 |
+
if ($search_tag) {
|
56 |
+
$where = ' AND ' . $wpdb->prefix . 'spidercalendar_event.title LIKE "%%' . like_escape($search_tag) . '%%"';
|
57 |
+
}
|
58 |
+
else {
|
59 |
+
$where = '';
|
60 |
+
}
|
61 |
+
if (isset($_POST['startdate']) && esc_html($_POST['startdate'])) {
|
62 |
+
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date > \'' . esc_sql(esc_html($_POST['startdate'])) . '\' ';
|
63 |
+
}
|
64 |
+
if (isset($_POST['enddate']) && esc_html($_POST['enddate'])) {
|
65 |
+
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date < \'' . esc_sql(esc_html($_POST['enddate'])) . '\' ';
|
66 |
+
}
|
67 |
+
// Get the total number of records.
|
68 |
+
|
69 |
+
$query = $wpdb->prepare ("SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=%d " . $where . " ",$calendar_id );
|
70 |
+
|
71 |
+
$total = $wpdb->get_var($query);
|
72 |
+
$pageNav['total'] = $total;
|
73 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
74 |
+
|
75 |
+
$query = $wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=%d " . $where . " " . $order . " " . " LIMIT %d,20",$calendar_id,$limit);
|
76 |
+
|
77 |
+
$rows=$wpdb->get_results($query);
|
78 |
+
|
79 |
+
|
80 |
+
html_upcoming_widget($rows, $pageNav, $sort);
|
81 |
+
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
function show_spider_calendar() {
|
86 |
+
global $wpdb;
|
87 |
+
$order = " ORDER BY title ASC";
|
88 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
89 |
+
$sort["sortid_by"] = "title";
|
90 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
91 |
+
$sort["1_or_2"] = "2";
|
92 |
+
if (isset($_POST['page_number'])) {
|
93 |
+
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
94 |
+
$sort["sortid_by"] = esc_sql(esc_html($_POST['order_by']));
|
95 |
+
}
|
96 |
+
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
97 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
98 |
+
$sort["1_or_2"] = "2";
|
99 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
100 |
+
}
|
101 |
+
else {
|
102 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
103 |
+
$sort["1_or_2"] = "1";
|
104 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
105 |
+
}
|
106 |
+
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
107 |
+
$limit = (esc_html($_POST['page_number']) - 1) * 20;
|
108 |
+
}
|
109 |
+
else {
|
110 |
+
$limit = 0;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
else {
|
114 |
+
$limit = 0;
|
115 |
+
}
|
116 |
+
if (isset($_POST['search_events_by_title'])) {
|
117 |
+
$search_tag = esc_html($_POST['search_events_by_title']);
|
118 |
+
}
|
119 |
+
else {
|
120 |
+
$search_tag = "";
|
121 |
+
}
|
122 |
+
if ($search_tag) {
|
123 |
+
$where = ' WHERE title LIKE "%%' . like_escape($search_tag) . '%%"';
|
124 |
+
}
|
125 |
+
else {
|
126 |
+
$where = ' ';
|
127 |
+
}
|
128 |
+
// Get the total number of records.
|
129 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_calendar" . str_replace('%%','%',$where);
|
130 |
+
$total = $wpdb->get_var($query);
|
131 |
+
$pageNav['total'] = $total;
|
132 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
133 |
+
$query = $wpdb->prepare ( "SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar" . $where . " " . $order . " " . " LIMIT %d,20",$limit);
|
134 |
+
$rows = $wpdb->get_results($query);
|
135 |
+
// display function
|
136 |
+
html_show_spider_calendar($rows, $pageNav, $sort);
|
137 |
+
}
|
138 |
+
|
139 |
+
function show_event_cat(){
|
140 |
+
global $wpdb;
|
141 |
+
$order = " ORDER BY title ASC";
|
142 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
143 |
+
$sort["sortid_by"] = "title";
|
144 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
145 |
+
$sort["1_or_2"] = "2";
|
146 |
+
if (isset($_POST['page_number'])) {
|
147 |
+
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
148 |
+
$sort["sortid_by"] = esc_sql( esc_html($_POST['order_by']));
|
149 |
+
}
|
150 |
+
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
151 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
152 |
+
$sort["1_or_2"] = "2";
|
153 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
154 |
+
}
|
155 |
+
else {
|
156 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
157 |
+
$sort["1_or_2"] = "1";
|
158 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
159 |
+
}
|
160 |
+
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
161 |
+
$limit = (esc_html($_POST['page_number']) - 1) * 20;
|
162 |
+
}
|
163 |
+
else {
|
164 |
+
$limit = 0;
|
165 |
+
}
|
166 |
+
}
|
167 |
+
else {
|
168 |
+
$limit = 0;
|
169 |
+
}
|
170 |
+
if (isset($_POST['search_cat_by_title'])) {
|
171 |
+
$search_tag = esc_html($_POST['search_cat_by_title']);
|
172 |
+
}
|
173 |
+
else {
|
174 |
+
$search_tag = "";
|
175 |
+
}
|
176 |
+
if ($search_tag) {
|
177 |
+
$where = ' WHERE title LIKE "%%' . like_escape($search_tag) . '%%"';
|
178 |
+
}
|
179 |
+
else {
|
180 |
+
$where = ' ';
|
181 |
+
}
|
182 |
+
// Get the total number of records.
|
183 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event_category" . str_replace('%%','%',$where);
|
184 |
+
$total = $wpdb->get_var($query);
|
185 |
+
$pageNav['total'] = $total;
|
186 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
187 |
+
$query =$wpdb->prepare ( "SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category" . $where . " " . $order . " " . " LIMIT %d,20",$limit);
|
188 |
+
|
189 |
+
$rows = $wpdb->get_results($query);
|
190 |
+
// display function
|
191 |
+
show_event_category($rows, $pageNav, $sort);
|
192 |
+
|
193 |
+
}
|
194 |
+
|
195 |
+
|
196 |
+
// Edit calendar.
|
197 |
+
function edit_spider_calendar($id) {
|
198 |
+
global $wpdb;
|
199 |
+
$row = $wpdb->get_row($wpdb->prepare ('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE id=%d',$id));
|
200 |
+
html_edit_spider_calendar($row);
|
201 |
+
}
|
202 |
+
|
203 |
+
// Delete calendar.
|
204 |
+
function remove_spider_calendar($id) {
|
205 |
+
global $wpdb;
|
206 |
+
$sql_remov_vid = $wpdb->prepare ("DELETE FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id=%d", $id);
|
207 |
+
$sql_remov_eve = $wpdb->prepare ("DELETE FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=%d", $id);
|
208 |
+
if (!$wpdb->query($sql_remov_vid)) {
|
209 |
+
?>
|
210 |
+
<div id="message" class="error"><p>Calendar Not Deleted.</p></div>
|
211 |
+
<?php
|
212 |
+
}
|
213 |
+
else {
|
214 |
+
?>
|
215 |
+
<div class="updated"><p><strong>Calendar Deleted.</strong></p></div>
|
216 |
+
<?php
|
217 |
+
$count_eve = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE `calendar`="%d"', $id));
|
218 |
+
if ($count_eve) {
|
219 |
+
if (!$wpdb->query($sql_remov_eve)) {
|
220 |
+
?>
|
221 |
+
<div id="message" class="error"><p>Events Not Deleted.</p></div>
|
222 |
+
<?php
|
223 |
+
}
|
224 |
+
}
|
225 |
+
}
|
226 |
+
}
|
227 |
+
|
228 |
+
|
229 |
+
//Save Category Event
|
230 |
+
|
231 |
+
function save_spider_category_event() {
|
232 |
+
/*
|
233 |
+
if (!$id) {
|
234 |
+
echo '<h1 style="color:#00C">Error. ID does not exist.</h1>';
|
235 |
+
exit;
|
236 |
+
}
|
237 |
+
*/
|
238 |
+
if(isset($_POST['title'])){
|
239 |
+
$title = (isset($_POST["title"]) ? esc_html(stripslashes($_POST["title"])) : '');
|
240 |
+
$published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
|
241 |
+
$color = (isset($_POST["color"]) ? esc_html(stripslashes($_POST["color"])) : '');
|
242 |
+
$description = (isset($_POST["description"]) ? esc_html(stripslashes($_POST["description"])) : '');
|
243 |
+
global $wpdb;
|
244 |
+
|
245 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_event_category', array(
|
246 |
+
'id' => NULL,
|
247 |
+
'title' => $title,
|
248 |
+
'published' => $published,
|
249 |
+
'color' => $color,
|
250 |
+
'description' => $description,
|
251 |
+
), array(
|
252 |
+
'%d',
|
253 |
+
'%s',
|
254 |
+
'%d',
|
255 |
+
'%s',
|
256 |
+
'%s'
|
257 |
+
));
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
|
262 |
+
// Publish/Unpublish category.
|
263 |
+
function spider_category_published($id) {
|
264 |
+
global $wpdb;
|
265 |
+
$publish = $wpdb->get_var($wpdb->prepare('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_event_category WHERE `id`="%d"', $id));
|
266 |
+
if ($publish) {
|
267 |
+
$publish = 0;
|
268 |
+
$publish_unpublish = 'Category unpublished.';
|
269 |
+
}
|
270 |
+
else {
|
271 |
+
$publish = 1;
|
272 |
+
$publish_unpublish = 'Category published.';
|
273 |
+
}
|
274 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event_category', array(
|
275 |
+
'published' => $publish,
|
276 |
+
), array('id' => $id), array(
|
277 |
+
'%d',
|
278 |
+
));
|
279 |
+
|
280 |
+
if ($save_or_no !== FALSE) {
|
281 |
+
?>
|
282 |
+
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
283 |
+
<?php
|
284 |
+
$location_cal = admin_url('admin.php?page=spider_calendar_event_category');
|
285 |
+
header('Location: '.$location_cal.'');
|
286 |
+
}
|
287 |
+
}
|
288 |
+
|
289 |
+
|
290 |
+
//Apply category event
|
291 |
+
|
292 |
+
function apply_spider_category_event($id) {
|
293 |
+
|
294 |
+
$title = (isset($_POST["title"]) ? esc_html(stripslashes($_POST["title"])) : '');
|
295 |
+
$published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
|
296 |
+
$color = (isset($_POST["color"]) ? esc_html(stripslashes($_POST["color"])) : '');
|
297 |
+
$description = (isset($_POST["description"]) ? esc_html(stripslashes($_POST["description"])) : '');
|
298 |
+
global $wpdb;
|
299 |
+
|
300 |
+
|
301 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event_category', array(
|
302 |
+
'title' => $title,
|
303 |
+
'published' => $published,
|
304 |
+
'color' => $color,
|
305 |
+
'description' => $description,
|
306 |
+
), array('id' => $_POST['id']), array(
|
307 |
+
'%s',
|
308 |
+
'%d',
|
309 |
+
'%s',
|
310 |
+
'%s'
|
311 |
+
));
|
312 |
+
|
313 |
+
}
|
314 |
+
|
315 |
+
// Save calendar.
|
316 |
+
function apply_spider_calendar($id) {
|
317 |
+
if (!$id) {
|
318 |
+
echo '<h1 style="color:#00C">Error. ID does not exist.</h1>';
|
319 |
+
exit;
|
320 |
+
}
|
321 |
+
if(isset($_POST['title'])){
|
322 |
+
$title = (isset($_POST["title"]) ? esc_html(stripslashes($_POST["title"])) : '');
|
323 |
+
$user_type = (isset($_POST["user_type"]) ? esc_html($_POST["user_type"]) : '');
|
324 |
+
$time_format = (isset($_POST["time_format"]) ? (int) $_POST["time_format"] : 0);
|
325 |
+
$def_year = (isset($_POST["def_year"]) ? esc_html($_POST["def_year"]) : '');
|
326 |
+
$def_month = (isset($_POST["def_month"]) ? esc_html($_POST["def_month"]) : '');
|
327 |
+
$allow_publish = (isset($_POST["allow_publish"]) ? esc_html($_POST["allow_publish"]) : '');
|
328 |
+
$published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
|
329 |
+
global $wpdb;
|
330 |
+
if ($id === -1) {
|
331 |
+
|
332 |
+
$save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_calendar', array(
|
333 |
+
'id' => NULL,
|
334 |
+
'title' => $title,
|
335 |
+
'gid' => $user_type,
|
336 |
+
'def_year' => $def_year,
|
337 |
+
'def_month' => $def_month,
|
338 |
+
'time_format' => $time_format,
|
339 |
+
'allow_publish' => $allow_publish,
|
340 |
+
'published' => $published,
|
341 |
+
), array(
|
342 |
+
'%d',
|
343 |
+
'%s',
|
344 |
+
'%s',
|
345 |
+
'%s',
|
346 |
+
'%s',
|
347 |
+
'%s',
|
348 |
+
'%s',
|
349 |
+
'%d'
|
350 |
+
));
|
351 |
+
|
352 |
+
}
|
353 |
+
else {
|
354 |
+
|
355 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_calendar', array(
|
356 |
+
'title' => $title,
|
357 |
+
'gid' => $user_type,
|
358 |
+
'time_format' => $time_format,
|
359 |
+
'def_year' => $def_year,
|
360 |
+
'def_month' => $def_month,
|
361 |
+
'allow_publish' => $allow_publish,
|
362 |
+
'published' => $published,
|
363 |
+
), array('id' => $id), array(
|
364 |
+
'%s',
|
365 |
+
'%s',
|
366 |
+
'%d',
|
367 |
+
'%s',
|
368 |
+
'%s',
|
369 |
+
'%s',
|
370 |
+
'%d'
|
371 |
+
));
|
372 |
+
|
373 |
+
}
|
374 |
+
if ($save_or_no === FALSE) {
|
375 |
+
?>
|
376 |
+
<div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
|
377 |
+
<?php
|
378 |
+
return FALSE;
|
379 |
+
}
|
380 |
+
else {
|
381 |
+
?>
|
382 |
+
<div class="updated"><p><strong>Calendar Saved.</strong></p></div>
|
383 |
+
<?php
|
384 |
+
return TRUE;
|
385 |
+
}
|
386 |
+
}
|
387 |
+
}
|
388 |
+
|
389 |
+
// Publish/Unpublish calendar.
|
390 |
+
function spider_calendar_published($id) {
|
391 |
+
global $wpdb;
|
392 |
+
$publish = $wpdb->get_var($wpdb->prepare('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $id));
|
393 |
+
if ($publish) {
|
394 |
+
$publish = 0;
|
395 |
+
$publish_unpublish = 'Calendar unpublished.';
|
396 |
+
}
|
397 |
+
else {
|
398 |
+
$publish = 1;
|
399 |
+
$publish_unpublish = 'Calendar published.';
|
400 |
+
}
|
401 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_calendar', array(
|
402 |
+
'published' => $publish,
|
403 |
+
), array('id' => $id), array(
|
404 |
+
'%d',
|
405 |
+
));
|
406 |
+
if ($save_or_no !== FALSE) {
|
407 |
+
?>
|
408 |
+
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
409 |
+
<?php
|
410 |
+
$location_cal = admin_url('admin.php?page=SpiderCalendar');
|
411 |
+
header('Location: '.$location_cal.'');
|
412 |
+
}
|
413 |
+
}
|
414 |
+
|
415 |
+
// Event in table
|
416 |
+
function show_spider_event($calendar_id) {
|
417 |
+
global $wpdb;
|
418 |
+
$order = " ORDER BY title ASC";
|
419 |
+
$sort["default_style"] = "manage-column column-autor sortable desc";
|
420 |
+
$sort["sortid_by"] = "title";
|
421 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
422 |
+
$sort["1_or_2"] = "2";
|
423 |
+
if (isset($_POST['page_number'])) {
|
424 |
+
if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
|
425 |
+
$sort["sortid_by"] =esc_sql( esc_html($_POST['order_by']));
|
426 |
+
}
|
427 |
+
if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
|
428 |
+
$sort["custom_style"] = "manage-column column-title sorted asc";
|
429 |
+
$sort["1_or_2"] = "2";
|
430 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " ASC";
|
431 |
+
}
|
432 |
+
else {
|
433 |
+
$sort["custom_style"] = "manage-column column-title sorted desc";
|
434 |
+
$sort["1_or_2"] = "1";
|
435 |
+
$order = "ORDER BY " . $sort["sortid_by"] . " DESC";
|
436 |
+
}
|
437 |
+
if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
|
438 |
+
$limit = (esc_html($_POST['page_number']) - 1) * 20;
|
439 |
+
}
|
440 |
+
else {
|
441 |
+
$limit = 0;
|
442 |
+
}
|
443 |
+
}
|
444 |
+
else {
|
445 |
+
$limit = 0;
|
446 |
+
}
|
447 |
+
if (isset($_POST['search_events_by_title'])) {
|
448 |
+
$search_tag = esc_html($_POST['search_events_by_title']);
|
449 |
+
}
|
450 |
+
else {
|
451 |
+
$search_tag = "";
|
452 |
+
}
|
453 |
+
if ($search_tag) {
|
454 |
+
$where = ' AND ' . $wpdb->prefix . 'spidercalendar_event.title LIKE "%%' . like_escape($search_tag) . '%%"';
|
455 |
+
}
|
456 |
+
else {
|
457 |
+
$where = '';
|
458 |
+
}
|
459 |
+
if (isset($_POST['startdate']) && esc_html($_POST['startdate'])) {
|
460 |
+
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date > \'' . esc_sql( esc_html($_POST['startdate']) ) . '\' ';
|
461 |
+
}
|
462 |
+
if (isset($_POST['enddate']) && $_POST['enddate']) {
|
463 |
+
$where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date < \'' .esc_sql( esc_html($_POST['enddate']) ). '\' ';
|
464 |
+
}
|
465 |
+
// Get the total number of records.
|
466 |
+
$query = $wpdb->prepare ("SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=%d " . $where . " ", $calendar_id);
|
467 |
+
$total = $wpdb->get_var($query);
|
468 |
+
$pageNav['total'] = $total;
|
469 |
+
$pageNav['limit'] = $limit / 20 + 1;
|
470 |
+
|
471 |
+
$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
|
472 |
+
WHERE calendar=%d " . $where . " " . $order . " " . " LIMIT %d,20",$calendar_id,$limit);
|
473 |
+
|
474 |
+
$rows = $wpdb->get_results($query);
|
475 |
+
$cal_name = $wpdb->get_var($wpdb->prepare('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $calendar_id));
|
476 |
+
html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name);
|
477 |
+
}
|
478 |
+
|
479 |
+
|
480 |
+
// Add an event.
|
481 |
+
function add_spider_event($calendar_id) {
|
482 |
+
global $wpdb;
|
483 |
+
$cal_name = $wpdb->get_var($wpdb->prepare('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $calendar_id));
|
484 |
+
html_add_spider_event($calendar_id, $cal_name);
|
485 |
+
}
|
486 |
+
|
487 |
+
// Edit event.
|
488 |
+
function edit_spider_event($calendar_id, $id) {
|
489 |
+
global $wpdb;
|
490 |
+
$row = $wpdb->get_row($wpdb->prepare ('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE id=%d', $id ));
|
491 |
+
$calendar = $row->calendar;
|
492 |
+
$query = $wpdb->prepare ('SELECT title FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE id=%d' , $calendar);
|
493 |
+
$calendar_name = $wpdb->get_var($query);
|
494 |
+
$cal_name = $wpdb->get_var($wpdb->prepare('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $calendar_id));
|
495 |
+
html_edit_spider_event($row, $calendar_id, $id, $cal_name);
|
496 |
+
}
|
497 |
+
|
498 |
+
// Save event.
|
499 |
+
function apply_spider_event($calendar_id, $id) {
|
500 |
+
global $wpdb;
|
501 |
+
if(isset($_POST['title'])){
|
502 |
+
$title = ((isset($_POST['title'])) ? esc_html(stripslashes($_POST['title'])) : '');
|
503 |
+
$category = ((isset($_POST['category'])) ? esc_html(stripslashes($_POST['category'])) : '');
|
504 |
+
$text_for_date = ((isset($_POST['text_for_date'])) ? stripslashes($_POST['text_for_date']) : '');
|
505 |
+
$published = ((isset($_POST['published'])) ? (int) $_POST['published'] : 1);
|
506 |
+
$repeat = ((isset($_POST['repeat'])) ? esc_html($_POST['repeat']) : '');
|
507 |
+
$week = ((isset($_POST['week'])) ? esc_html($_POST['week']) : '');
|
508 |
+
$month = ((isset($_POST['month'])) ? esc_html($_POST['month']) : '');
|
509 |
+
$monthly_list = ((isset($_POST['monthly_list'])) ? esc_html($_POST['monthly_list']) : '');
|
510 |
+
$month_type = ((isset($_POST['month_type'])) ? esc_html($_POST['month_type']) : '');
|
511 |
+
$month_week = ((isset($_POST['month_week'])) ? esc_html($_POST['month_week']) : '');
|
512 |
+
$year_month = ((isset($_POST['year_month'])) ? esc_html($_POST['year_month']) : '');
|
513 |
+
$repeat_method = ((isset($_POST['repeat_method'])) ? esc_html($_POST['repeat_method']) : 'no_repeat');
|
514 |
+
$date = ((isset($_POST['date'])) ? esc_html($_POST['date']) : '');
|
515 |
+
$date_end = ((isset($_POST['date_end'])) ? esc_html($_POST['date_end']) : '');
|
516 |
+
if ($date_end == '' && $repeat_method != 'no_repeat') {
|
517 |
+
$date_end = '2070-12-12';
|
518 |
+
}
|
519 |
+
$select_from = ((isset($_POST['select_from'])) ? esc_html($_POST['select_from']) : '');
|
520 |
+
$select_to = ((isset($_POST['select_to'])) ? esc_html($_POST['select_to']) : '');
|
521 |
+
$selhour_from = ((isset($_POST['selhour_from'])) ? esc_html($_POST['selhour_from']) : '');
|
522 |
+
$selhour_to = ((isset($_POST['selhour_to'])) ? esc_html($_POST['selhour_to']) : '');
|
523 |
+
$selminute_from = ((isset($_POST['selminute_from'])) ? esc_html($_POST['selminute_from']) : '');
|
524 |
+
$selminute_to = ((isset($_POST['selminute_to'])) ? esc_html($_POST['selminute_to']) : '');
|
525 |
+
if ($selhour_from) {
|
526 |
+
if ($selhour_to) {
|
527 |
+
$time = $selhour_from . ':' . $selminute_from . '' . $select_from . '-' . $selhour_to . ':' . $selminute_to . '' . $select_to;
|
528 |
+
}
|
529 |
+
else {
|
530 |
+
$time = $selhour_from . ':' . $selminute_from . ' ' . $select_from;
|
531 |
+
}
|
532 |
+
}
|
533 |
+
else {
|
534 |
+
$time = '';
|
535 |
+
}
|
536 |
+
if ($id === -1) {
|
537 |
+
$save = $wpdb->insert($wpdb->prefix . 'spidercalendar_event', array(
|
538 |
+
'id' => NULL,
|
539 |
+
'category' => $category,
|
540 |
+
'title' => $title,
|
541 |
+
'time' => $time,
|
542 |
+
'calendar' => $calendar_id,
|
543 |
+
'date' => $date,
|
544 |
+
'text_for_date' => $text_for_date,
|
545 |
+
'published' => $published,
|
546 |
+
'repeat' => $repeat,
|
547 |
+
'week' => $week,
|
548 |
+
'date_end' => $date_end,
|
549 |
+
'month' => $month,
|
550 |
+
'monthly_list' => $monthly_list,
|
551 |
+
'month_week' => $month_week,
|
552 |
+
'month_type' => $month_type,
|
553 |
+
'year_month' => $year_month,
|
554 |
+
'repeat_method' => $repeat_method,
|
555 |
+
'userID' => ''
|
556 |
+
), array(
|
557 |
+
'%d',
|
558 |
+
'%s',
|
559 |
+
'%s',
|
560 |
+
'%s',
|
561 |
+
'%d',
|
562 |
+
'%s',
|
563 |
+
'%s',
|
564 |
+
'%d',
|
565 |
+
'%s',
|
566 |
+
'%s',
|
567 |
+
'%s',
|
568 |
+
'%s',
|
569 |
+
'%s',
|
570 |
+
'%s',
|
571 |
+
'%s',
|
572 |
+
'%s',
|
573 |
+
'%s',
|
574 |
+
'%s'
|
575 |
+
));
|
576 |
+
}
|
577 |
+
else {
|
578 |
+
$save = $wpdb->update($wpdb->prefix . 'spidercalendar_event', array(
|
579 |
+
'title' => $title,
|
580 |
+
'category' => $category,
|
581 |
+
'time' => $time,
|
582 |
+
'calendar' => $calendar_id,
|
583 |
+
'date' => $date,
|
584 |
+
'text_for_date' => $text_for_date,
|
585 |
+
'published' => $published,
|
586 |
+
'repeat' => $repeat,
|
587 |
+
'week' => $week,
|
588 |
+
'date_end' => $date_end,
|
589 |
+
'month' => $month,
|
590 |
+
'monthly_list' => $monthly_list,
|
591 |
+
'month_type' => $month_type,
|
592 |
+
'month_week' => $month_week,
|
593 |
+
'year_month' => $year_month,
|
594 |
+
'repeat_method' => $repeat_method
|
595 |
+
), array('id' => $id), array(
|
596 |
+
'%s',
|
597 |
+
'%d',
|
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 |
+
));
|
613 |
+
}
|
614 |
+
if ($save !== FALSE) {
|
615 |
+
?>
|
616 |
+
<div class="updated"><p><strong>Item Saved.</strong></p></div>
|
617 |
+
<?php
|
618 |
+
return TRUE;
|
619 |
+
}
|
620 |
+
else {
|
621 |
+
?>
|
622 |
+
<div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
|
623 |
+
<?php
|
624 |
+
return FALSE;
|
625 |
+
}
|
626 |
+
}
|
627 |
+
}
|
628 |
+
|
629 |
+
// Publish/Unpublish event.
|
630 |
+
function published_spider_event($calendar_id, $id) {
|
631 |
+
echo $calendar_id."kuku";
|
632 |
+
global $wpdb;
|
633 |
+
$publish = $wpdb->get_var($wpdb->prepare('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE `id`="%d"', $id));
|
634 |
+
if ($publish) {
|
635 |
+
$publish = 0;
|
636 |
+
$publish_unpublish = 'Event unpublished.';
|
637 |
+
}
|
638 |
+
else {
|
639 |
+
$publish = 1;
|
640 |
+
$publish_unpublish = 'Event published.';
|
641 |
+
}
|
642 |
+
$save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event', array(
|
643 |
+
'published' => $publish,
|
644 |
+
), array('id' => $id), array(
|
645 |
+
'%d',
|
646 |
+
));
|
647 |
+
if ($save_or_no !== FALSE) {
|
648 |
+
?>
|
649 |
+
<div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
|
650 |
+
<?php
|
651 |
+
$location_cal = admin_url('admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id='.$calendar_id.'');
|
652 |
+
header('Location: '.$location_cal.'');
|
653 |
+
}
|
654 |
+
|
655 |
+
}
|
656 |
+
|
657 |
+
// Delete event.
|
658 |
+
function remove_spider_event($calendar_id, $id) {
|
659 |
+
global $wpdb;
|
660 |
+
$sql_remove_vid = $wpdb->prepare ("DELETE FROM " . $wpdb->prefix . "spidercalendar_event WHERE id=%d" , $id );
|
661 |
+
if (!$wpdb->query($sql_remove_vid)) {
|
662 |
+
?>
|
663 |
+
<div id="message" class="error"><p>Event Not Deleted.</p></div>
|
664 |
+
<?php
|
665 |
+
}
|
666 |
+
else {
|
667 |
+
?>
|
668 |
+
<div class="updated"><p><strong>Event Deleted.</strong></p></div>
|
669 |
+
<?php
|
670 |
+
}
|
671 |
+
}
|
672 |
+
|
673 |
+
|
674 |
+
// Delete event.
|
675 |
+
function remove_category_event($id) {
|
676 |
+
global $wpdb;
|
677 |
+
$sql_remove_vid = $wpdb->prepare ("DELETE FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE id=%d", $id );
|
678 |
+
if (!$wpdb->query($sql_remove_vid)) {
|
679 |
+
?>
|
680 |
+
<div id="message" class="error"><p>Event Category Not Deleted.</p></div>
|
681 |
+
<?php
|
682 |
+
}
|
683 |
+
else {
|
684 |
+
?>
|
685 |
+
<div class="updated"><p><strong>Event Category Deleted.</strong></p></div>
|
686 |
+
<?php
|
687 |
+
}
|
688 |
+
}
|
689 |
+
?>
|
front_end/bigcalendarday.php
CHANGED
@@ -1,1010 +1,1012 @@
|
|
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'] : 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 |
-
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
-
|
13 |
-
///////////////////////////////////////////////////////////////////////////////////
|
14 |
-
|
15 |
-
|
16 |
-
if(isset($_GET['cat_id']))
|
17 |
-
$cat_id = $_GET['cat_id'];
|
18 |
-
else $cat_id = "";
|
19 |
-
|
20 |
-
if(isset($_GET['cat_ids']))
|
21 |
-
$cat_ids = $_GET['cat_ids'];
|
22 |
-
else $cat_ids = "";
|
23 |
-
|
24 |
-
|
25 |
-
if($cat_ids=='')
|
26 |
-
$cat_ids .= $cat_id.',';
|
27 |
-
else
|
28 |
-
$cat_ids .= ','.$cat_id.',';
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
33 |
-
|
34 |
-
|
35 |
-
function getelementcountinarray($array , $element)
|
36 |
-
{
|
37 |
-
$t=0;
|
38 |
-
|
39 |
-
for($i=0; $i<count($array); $i++)
|
40 |
-
{
|
41 |
-
if($element==$array[$i])
|
42 |
-
$t++;
|
43 |
-
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
return $t;
|
48 |
-
|
49 |
-
}
|
50 |
-
|
51 |
-
function getelementindexinarray($array , $element)
|
52 |
-
{
|
53 |
-
|
54 |
-
$t='';
|
55 |
-
|
56 |
-
for($i=0; $i<count($array); $i++)
|
57 |
-
{
|
58 |
-
if($element==$array[$i])
|
59 |
-
$t.=$i.',';
|
60 |
-
|
61 |
-
}
|
62 |
-
|
63 |
-
return $t;
|
64 |
-
|
65 |
-
|
66 |
-
}
|
67 |
-
$cat_ids_array = explode(',',$cat_ids);
|
68 |
-
|
69 |
-
|
70 |
-
if($cat_id!='')
|
71 |
-
{
|
72 |
-
|
73 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
74 |
-
{
|
75 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
76 |
-
$index_array = explode(',' , $index_in_line);
|
77 |
-
array_pop ($index_array);
|
78 |
-
for($j=0; $j<count($index_array); $j++)
|
79 |
-
unset($cat_ids_array[$index_array[$j]]);
|
80 |
-
$cat_ids = implode(',',$cat_ids_array);
|
81 |
-
}
|
82 |
-
}
|
83 |
-
else
|
84 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
85 |
-
|
86 |
-
|
87 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
88 |
-
|
89 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
90 |
-
$cal_width = $theme->width;
|
91 |
-
$
|
92 |
-
$
|
93 |
-
$
|
94 |
-
$
|
95 |
-
$
|
96 |
-
$
|
97 |
-
$
|
98 |
-
$
|
99 |
-
$
|
100 |
-
$
|
101 |
-
$
|
102 |
-
$
|
103 |
-
$
|
104 |
-
$
|
105 |
-
$
|
106 |
-
$
|
107 |
-
$
|
108 |
-
$
|
109 |
-
$
|
110 |
-
$
|
111 |
-
$
|
112 |
-
$
|
113 |
-
$
|
114 |
-
$
|
115 |
-
$
|
116 |
-
$
|
117 |
-
$
|
118 |
-
$
|
119 |
-
$
|
120 |
-
$
|
121 |
-
$
|
122 |
-
$
|
123 |
-
$
|
124 |
-
$
|
125 |
-
$
|
126 |
-
$
|
127 |
-
$
|
128 |
-
$
|
129 |
-
$
|
130 |
-
$
|
131 |
-
$
|
132 |
-
$
|
133 |
-
$
|
134 |
-
$
|
135 |
-
$
|
136 |
-
$
|
137 |
-
$
|
138 |
-
$
|
139 |
-
$
|
140 |
-
$
|
141 |
-
$
|
142 |
-
$
|
143 |
-
$
|
144 |
-
$
|
145 |
-
$
|
146 |
-
$
|
147 |
-
$
|
148 |
-
$
|
149 |
-
$
|
150 |
-
$
|
151 |
-
$
|
152 |
-
$
|
153 |
-
|
154 |
-
|
155 |
-
__('
|
156 |
-
__('
|
157 |
-
__('
|
158 |
-
__('
|
159 |
-
__('
|
160 |
-
__('
|
161 |
-
__('
|
162 |
-
__('
|
163 |
-
__('
|
164 |
-
__('
|
165 |
-
__('
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
$
|
178 |
-
|
179 |
-
|
180 |
-
$
|
181 |
-
$
|
182 |
-
|
183 |
-
|
184 |
-
$
|
185 |
-
$
|
186 |
-
|
187 |
-
|
188 |
-
$
|
189 |
-
$
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
$
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
$
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
$
|
202 |
-
$
|
203 |
-
|
204 |
-
|
205 |
-
$
|
206 |
-
$
|
207 |
-
|
208 |
-
$
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
border-top-
|
221 |
-
border-radius: <?php echo $border_radius2 ?>px !important;
|
222 |
-
border-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
border-top-
|
234 |
-
|
235 |
-
|
236 |
-
.general_table table table:last-child .
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
border-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
<?php echo
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
<?php echo
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
font-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
<?php echo
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
border:
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
#bigcalendar<?php echo $many_sp_calendar; ?>
|
353 |
-
#
|
354 |
-
#spiderCalendarTitlesList
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
border-top-
|
363 |
-
|
364 |
-
|
365 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
font-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
min-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
#bigcalendar<?php echo $many_sp_calendar; ?>
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
<div style="
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
'
|
496 |
-
'
|
497 |
-
'
|
498 |
-
'
|
499 |
-
'
|
500 |
-
'
|
501 |
-
|
502 |
-
'
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
'
|
511 |
-
'
|
512 |
-
'
|
513 |
-
'
|
514 |
-
'
|
515 |
-
'
|
516 |
-
'
|
517 |
-
|
518 |
-
'
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
'
|
527 |
-
'
|
528 |
-
'
|
529 |
-
'
|
530 |
-
'
|
531 |
-
'
|
532 |
-
|
533 |
-
'
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
'
|
542 |
-
'
|
543 |
-
'
|
544 |
-
'
|
545 |
-
'
|
546 |
-
'
|
547 |
-
|
548 |
-
'
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
<div
|
556 |
-
|
557 |
-
<?php if($view=='
|
558 |
-
<?php if($view=='
|
559 |
-
<?php if($view=='
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
<
|
564 |
-
<
|
565 |
-
|
566 |
-
|
567 |
-
'
|
568 |
-
'
|
569 |
-
'
|
570 |
-
'
|
571 |
-
'
|
572 |
-
'
|
573 |
-
|
574 |
-
'
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
</
|
579 |
-
</
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
'
|
585 |
-
'
|
586 |
-
'
|
587 |
-
'
|
588 |
-
'
|
589 |
-
'
|
590 |
-
'
|
591 |
-
|
592 |
-
'
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
</
|
597 |
-
</
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
'
|
603 |
-
'
|
604 |
-
'
|
605 |
-
'
|
606 |
-
'
|
607 |
-
'
|
608 |
-
|
609 |
-
'
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
</
|
614 |
-
</
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
'
|
620 |
-
'
|
621 |
-
'
|
622 |
-
'
|
623 |
-
'
|
624 |
-
'
|
625 |
-
|
626 |
-
'
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
</
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
'
|
651 |
-
'
|
652 |
-
'
|
653 |
-
'
|
654 |
-
'
|
655 |
-
'
|
656 |
-
|
657 |
-
'
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
'
|
686 |
-
'
|
687 |
-
'
|
688 |
-
'
|
689 |
-
'
|
690 |
-
'
|
691 |
-
|
692 |
-
'
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
<
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
'
|
727 |
-
'
|
728 |
-
'
|
729 |
-
'
|
730 |
-
'
|
731 |
-
'
|
732 |
-
|
733 |
-
'
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
'
|
744 |
-
'
|
745 |
-
'
|
746 |
-
'
|
747 |
-
'
|
748 |
-
'
|
749 |
-
|
750 |
-
'
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
$
|
777 |
-
$
|
778 |
-
$
|
779 |
-
$
|
780 |
-
$
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
$
|
786 |
-
$percent =
|
787 |
-
$
|
788 |
-
$
|
789 |
-
$
|
790 |
-
$
|
791 |
-
$
|
792 |
-
$
|
793 |
-
$
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
<span style="font-size:' . $
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
<td
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
<span style="font-size:' . $
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
$
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
" . $wpdb->prefix . "spidercalendar_event.
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
$
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
$
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
<td>
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
'
|
861 |
-
'
|
862 |
-
'
|
863 |
-
'
|
864 |
-
'
|
865 |
-
'
|
866 |
-
'
|
867 |
-
'
|
868 |
-
'
|
869 |
-
'
|
870 |
-
'
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
jQuery('#
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
'
|
990 |
-
'
|
991 |
-
'
|
992 |
-
'
|
993 |
-
'
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
}
|
1009 |
-
|
|
|
|
|
1010 |
?>
|
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'] : 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 |
+
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
+
|
13 |
+
///////////////////////////////////////////////////////////////////////////////////
|
14 |
+
|
15 |
+
|
16 |
+
if(isset($_GET['cat_id']))
|
17 |
+
$cat_id = $_GET['cat_id'];
|
18 |
+
else $cat_id = "";
|
19 |
+
|
20 |
+
if(isset($_GET['cat_ids']))
|
21 |
+
$cat_ids = $_GET['cat_ids'];
|
22 |
+
else $cat_ids = "";
|
23 |
+
|
24 |
+
|
25 |
+
if($cat_ids=='')
|
26 |
+
$cat_ids .= $cat_id.',';
|
27 |
+
else
|
28 |
+
$cat_ids .= ','.$cat_id.',';
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
33 |
+
|
34 |
+
|
35 |
+
function getelementcountinarray($array , $element)
|
36 |
+
{
|
37 |
+
$t=0;
|
38 |
+
|
39 |
+
for($i=0; $i<count($array); $i++)
|
40 |
+
{
|
41 |
+
if($element==$array[$i])
|
42 |
+
$t++;
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
return $t;
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
function getelementindexinarray($array , $element)
|
52 |
+
{
|
53 |
+
|
54 |
+
$t='';
|
55 |
+
|
56 |
+
for($i=0; $i<count($array); $i++)
|
57 |
+
{
|
58 |
+
if($element==$array[$i])
|
59 |
+
$t.=$i.',';
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
+
return $t;
|
64 |
+
|
65 |
+
|
66 |
+
}
|
67 |
+
$cat_ids_array = explode(',',$cat_ids);
|
68 |
+
|
69 |
+
|
70 |
+
if($cat_id!='')
|
71 |
+
{
|
72 |
+
|
73 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
74 |
+
{
|
75 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
76 |
+
$index_array = explode(',' , $index_in_line);
|
77 |
+
array_pop ($index_array);
|
78 |
+
for($j=0; $j<count($index_array); $j++)
|
79 |
+
unset($cat_ids_array[$index_array[$j]]);
|
80 |
+
$cat_ids = implode(',',$cat_ids_array);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
else
|
84 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
85 |
+
|
86 |
+
|
87 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
88 |
+
|
89 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
90 |
+
$cal_width = $theme->width;
|
91 |
+
$show_cat = 1;
|
92 |
+
$bg_top = '#' . $theme->bg_top;
|
93 |
+
$bg_bottom = '#' . $theme->bg_bottom;
|
94 |
+
$border_color = '#' . $theme->border_color;
|
95 |
+
$text_color_year = '#' . $theme->text_color_year;
|
96 |
+
$text_color_month = '#' . $theme->text_color_month;
|
97 |
+
$color_week_days = '#' . $theme->text_color_week_days;
|
98 |
+
$text_color_other_months = '#' . $theme->text_color_other_months;
|
99 |
+
$text_color_this_month_unevented = '#' . $theme->text_color_this_month_unevented;
|
100 |
+
$evented_color = '#' . $theme->text_color_this_month_evented;
|
101 |
+
$evented_color_bg = '#' . $theme->bg_color_this_month_evented;
|
102 |
+
$color_arrow_year = '#' . $theme->arrow_color_year;
|
103 |
+
$color_arrow_month = '#' . $theme->arrow_color_month;
|
104 |
+
$sun_days = '#' . $theme->text_color_sun_days;
|
105 |
+
$event_title_color = '#' . $theme->event_title_color;
|
106 |
+
$current_day_border_color = '#' . $theme->current_day_border_color;
|
107 |
+
$cell_border_color = '#' . $theme->cell_border_color;
|
108 |
+
$cell_height = $theme->cell_height;
|
109 |
+
$popup_width = $theme->popup_width;
|
110 |
+
$popup_height = $theme->popup_height;
|
111 |
+
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
112 |
+
$sundays_font_size = $theme->sundays_font_size;
|
113 |
+
$other_days_font_size = $theme->other_days_font_size;
|
114 |
+
$weekdays_font_size = $theme->weekdays_font_size;
|
115 |
+
$border_width = $theme->border_width;
|
116 |
+
$top_height = $theme->top_height;
|
117 |
+
$bg_color_other_months = '#' . $theme->bg_color_other_months;
|
118 |
+
$sundays_bg_color = '#' . $theme->sundays_bg_color;
|
119 |
+
$weekdays_bg_color = '#' . $theme->weekdays_bg_color;
|
120 |
+
$weekstart = $theme->week_start_day;
|
121 |
+
$weekday_sunday_bg_color = '#' . $theme->weekday_sunday_bg_color;
|
122 |
+
$border_radius = $theme->border_radius;
|
123 |
+
$border_radius2 = $border_radius-$border_width;
|
124 |
+
$week_days_cell_height = $theme->week_days_cell_height;
|
125 |
+
$year_font_size = $theme->year_font_size;
|
126 |
+
$month_font_size = $theme->month_font_size;
|
127 |
+
$arrow_size = $theme->arrow_size;
|
128 |
+
$arrow_size_hover = $arrow_size + 5;
|
129 |
+
$next_month_text_color = '#' . $theme->next_month_text_color;
|
130 |
+
$prev_month_text_color = '#' . $theme->prev_month_text_color;
|
131 |
+
$next_month_arrow_color = '#' . $theme->next_month_arrow_color;
|
132 |
+
$prev_month_arrow_color = '#' . $theme->prev_month_arrow_color;
|
133 |
+
$next_month_font_size = $theme->next_month_font_size;
|
134 |
+
$prev_month_font_size = $theme->prev_month_font_size;
|
135 |
+
$month_type = $theme->month_type;
|
136 |
+
$date_bg_color = '#' . $theme->date_bg_color;
|
137 |
+
$event_bg_color1 = '#' . $theme->event_bg_color1;
|
138 |
+
$event_bg_color2 = '#' . $theme->event_bg_color2;
|
139 |
+
$event_num_bg_color1 = '#' . $theme->event_num_bg_color1;
|
140 |
+
$event_num_bg_color2 = '#' . $theme->event_num_bg_color2;
|
141 |
+
$event_num_color = '#' . $theme->event_num_color;
|
142 |
+
$date_font_size = $theme->date_font_size;
|
143 |
+
$event_num_font_size = $theme->event_num_font_size;
|
144 |
+
$event_table_height = $theme->event_table_height;
|
145 |
+
$date_height = $theme->date_height;
|
146 |
+
$day_month_font_size = $theme->day_month_font_size;
|
147 |
+
$week_font_size = $theme->week_font_size;
|
148 |
+
$day_month_font_color = '#' . $theme->day_month_font_color;
|
149 |
+
$week_font_color = '#' . $theme->week_font_color;
|
150 |
+
$views_tabs_bg_color = '#' . $theme->views_tabs_bg_color;
|
151 |
+
$views_tabs_text_color = '#' . $theme->views_tabs_text_color;
|
152 |
+
$views_tabs_font_size = $theme->views_tabs_font_size;
|
153 |
+
$show_numbers_for_events = $theme->day_start;
|
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 |
+
<style type='text/css'>
|
218 |
+
|
219 |
+
.day_ev{
|
220 |
+
border-top-left-radius: <?php echo $border_radius2 ?>px !important;
|
221 |
+
border-top-right-radius: <?php echo $border_radius2 ?>px !important;
|
222 |
+
border-radius: <?php echo $border_radius2 ?>px !important;
|
223 |
+
border-bottom-left-radius: <?php echo $border_radius2 ?>px !important;
|
224 |
+
}
|
225 |
+
|
226 |
+
#bigcalendar<?php echo $many_sp_calendar ?> td, #bigcalendar<?php echo $many_sp_calendar ?> tr, #spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
227 |
+
border: none !important;
|
228 |
+
}
|
229 |
+
#bigcalendar<?php echo $many_sp_calendar ?> . general_table {
|
230 |
+
border-radius: <?php echo $border_radius ?>px !important;
|
231 |
+
}
|
232 |
+
#bigcalendar<?php echo $many_sp_calendar ?> . top_table {
|
233 |
+
border-top-left-radius: <?php echo $border_radius2 ?>px !important;
|
234 |
+
border-top-right-radius: <?php echo $border_radius2 ?>px !important;
|
235 |
+
}
|
236 |
+
.general_table table table:last-child .day_ev:last-child td,
|
237 |
+
.general_table table table:last-child .week_list:last-child td{
|
238 |
+
border-bottom-left-radius:<?php echo $border_radius2?>px;
|
239 |
+
|
240 |
+
}
|
241 |
+
|
242 |
+
.general_table table tr:last-child >td:last-child{
|
243 |
+
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
244 |
+
border-top-right-radius: <?php echo $border_radius2 ?>px;
|
245 |
+
}
|
246 |
+
|
247 |
+
#bigcalendar<?php echo $many_sp_calendar ?> . cala_arrow a : link, #bigcalendar .cala_arrow a:visited {
|
248 |
+
text-decoration: none !important;
|
249 |
+
background: none !important;
|
250 |
+
font-size: <?php echo $arrow_size ?>px !important;
|
251 |
+
}
|
252 |
+
#bigcalendar<?php echo $many_sp_calendar ?> . cala_arrow {
|
253 |
+
vertical-align: middle !important;
|
254 |
+
}
|
255 |
+
#bigcalendar<?php echo $many_sp_calendar ?> . cala_arrow a : hover {
|
256 |
+
font-size: <?php echo $arrow_size_hover ?>px !important;
|
257 |
+
text-decoration: none !important;
|
258 |
+
background: none !important;
|
259 |
+
}
|
260 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : link, #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : visited {
|
261 |
+
text-decoration: none !important;
|
262 |
+
background: none !important;
|
263 |
+
font-size: 12px !important;
|
264 |
+
color: red;
|
265 |
+
}
|
266 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : hover {
|
267 |
+
text-decoration: none !important;
|
268 |
+
background: none !important;
|
269 |
+
}
|
270 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day {
|
271 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
272 |
+
<?php echo 'vertical-align:top !important;'; ?>
|
273 |
+
}
|
274 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . weekdays {
|
275 |
+
vertical-align: middle !important;
|
276 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
277 |
+
}
|
278 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . week_days {
|
279 |
+
font-size: <?php echo $weekdays_font_size; ?>px !important;
|
280 |
+
}
|
281 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calyear_table {
|
282 |
+
border-spacing: 0 !important;
|
283 |
+
width: 100% !important;
|
284 |
+
}
|
285 |
+
. calyear_table table #bigcalendar<?php echo $many_sp_calendar; ?> . calmonth_table {
|
286 |
+
border-spacing: 0 !important;
|
287 |
+
width: 100% !important;
|
288 |
+
}
|
289 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calbg, #bigcalendar .calbg td {
|
290 |
+
text-align: center !important;
|
291 |
+
width: 14% !important;
|
292 |
+
}
|
293 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . caltext_color_other_months {
|
294 |
+
color: <?php echo $text_color_other_months; ?> !important;
|
295 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
296 |
+
<?php echo 'vertical-align:top !important;'; ?>
|
297 |
+
}
|
298 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . caltext_color_this_month_unevented {
|
299 |
+
color: <?php echo $text_color_this_month_unevented; ?> !important;
|
300 |
+
}
|
301 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calfont_year {
|
302 |
+
font-size: 24px !important;
|
303 |
+
font-weight: bold !important;
|
304 |
+
color: <?php echo $text_color_year; ?> !important;
|
305 |
+
}
|
306 |
+
.general_table table, .general_table td, .general_table tr {
|
307 |
+
border: inherit !important;
|
308 |
+
vertical-align: initial !important;
|
309 |
+
border-collapse: inherit !important;
|
310 |
+
margin: inherit !important;
|
311 |
+
padding: inherit !important;
|
312 |
+
}
|
313 |
+
.general_table {
|
314 |
+
border-collapse: inherit !important;
|
315 |
+
margin: inherit !important;
|
316 |
+
}
|
317 |
+
.general_table p {
|
318 |
+
margin: inherit !important;
|
319 |
+
padding: inherit !important;
|
320 |
+
}
|
321 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calsun_days {
|
322 |
+
color: <?php echo $sun_days ?> !important;
|
323 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
324 |
+
<?php echo 'vertical-align:top !important; text-align:left !important;'; ?>
|
325 |
+
background-color: <?php echo $sundays_bg_color; ?> !important;
|
326 |
+
}
|
327 |
+
#TB_window {
|
328 |
+
z-index: 10000;
|
329 |
+
}
|
330 |
+
|
331 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td {
|
332 |
+
vertical-align: middle !important;
|
333 |
+
}
|
334 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table {
|
335 |
+
border-collapse: initial;
|
336 |
+
border:0px;
|
337 |
+
max-width: none;
|
338 |
+
}
|
339 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table tr:hover td {
|
340 |
+
background: none;
|
341 |
+
}
|
342 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
343 |
+
padding: 0px;
|
344 |
+
vertical-align: none;
|
345 |
+
border-top:none;
|
346 |
+
line-height: none;
|
347 |
+
text-align: none;
|
348 |
+
}
|
349 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
350 |
+
margin-bottom:0;
|
351 |
+
}
|
352 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
353 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
354 |
+
#spiderCalendarTitlesList td,
|
355 |
+
#spiderCalendarTitlesList tr {
|
356 |
+
border:none;
|
357 |
+
}
|
358 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
359 |
+
border-radius: <?php echo $border_radius; ?>px;
|
360 |
+
}
|
361 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
362 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
363 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
364 |
+
}
|
365 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
366 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
367 |
+
text-decoration:none;
|
368 |
+
background:none;
|
369 |
+
font-size: <?php echo $arrow_size; ?>px;
|
370 |
+
}
|
371 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
372 |
+
text-decoration:none;
|
373 |
+
background:none;
|
374 |
+
}
|
375 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
376 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
377 |
+
text-decoration:none;
|
378 |
+
background:none;
|
379 |
+
font-size:12px;
|
380 |
+
color:red;
|
381 |
+
}
|
382 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
383 |
+
text-decoration:none;
|
384 |
+
background:none;
|
385 |
+
}
|
386 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
387 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
388 |
+
vertical-align:top;
|
389 |
+
}
|
390 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
391 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
392 |
+
}
|
393 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
394 |
+
font-size:<?php echo $weekdays_font_size; ?>px;
|
395 |
+
}
|
396 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
397 |
+
border-spacing:0;
|
398 |
+
width:100%;
|
399 |
+
}
|
400 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
401 |
+
border-spacing:0;
|
402 |
+
width:100%;
|
403 |
+
}
|
404 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
405 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
|
406 |
+
text-align:center;
|
407 |
+
width:14%;
|
408 |
+
}
|
409 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
410 |
+
color:<?php echo $text_color_other_months; ?>;
|
411 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
412 |
+
vertical-align:top;
|
413 |
+
}
|
414 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
415 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
416 |
+
}
|
417 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
418 |
+
font-size:24px;
|
419 |
+
font-weight:bold;
|
420 |
+
color:<?php echo $text_color_year; ?>;
|
421 |
+
}
|
422 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
423 |
+
color:<?php echo $sun_days; ?>;
|
424 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
425 |
+
vertical-align:top;
|
426 |
+
text-align:left;
|
427 |
+
background-color:<?php echo $sundays_bg_color; ?>;
|
428 |
+
}
|
429 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
430 |
+
float: right;
|
431 |
+
background-color: <?php echo $views_tabs_bg_color; ?>;
|
432 |
+
min-height: 25px;
|
433 |
+
min-width: 70px;
|
434 |
+
margin-right: 2px;
|
435 |
+
text-align: center;
|
436 |
+
cursor:pointer;
|
437 |
+
position: relative;
|
438 |
+
top: 5px;
|
439 |
+
}
|
440 |
+
|
441 |
+
|
442 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
443 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
444 |
+
{
|
445 |
+
|
446 |
+
background-color: <?php echo $views_tabs_bg_color?>;
|
447 |
+
width: 120px;
|
448 |
+
text-align: center;
|
449 |
+
cursor: pointer;
|
450 |
+
padding: 6px;
|
451 |
+
position: relative;
|
452 |
+
}
|
453 |
+
|
454 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
455 |
+
padding: 7px;
|
456 |
+
}
|
457 |
+
|
458 |
+
#drop_down_views
|
459 |
+
{
|
460 |
+
list-style-type:none !important;
|
461 |
+
position: absolute;
|
462 |
+
top: 46px;
|
463 |
+
left: -15px;
|
464 |
+
display:none;
|
465 |
+
z-index: 4545;
|
466 |
+
|
467 |
+
}
|
468 |
+
|
469 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
470 |
+
{
|
471 |
+
background:<?php echo $bg_top ?>;
|
472 |
+
}
|
473 |
+
|
474 |
+
#drop_down_views >li
|
475 |
+
{
|
476 |
+
border-bottom:1px solid #fff !important;
|
477 |
+
}
|
478 |
+
|
479 |
+
|
480 |
+
#views_tabs_select
|
481 |
+
{
|
482 |
+
display:none;
|
483 |
+
}
|
484 |
+
|
485 |
+
</style>
|
486 |
+
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
487 |
+
<div style="width:100%;">
|
488 |
+
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
489 |
+
<tr>
|
490 |
+
<td>
|
491 |
+
|
492 |
+
<div id="views_tabs" style="width: 100%;<?php echo $display ?>">
|
493 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
494 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
495 |
+
'action' => 'spiderbigcalendar_day',
|
496 |
+
'theme_id' => $theme_id,
|
497 |
+
'calendar' => $calendar_id,
|
498 |
+
'select' => $view_select,
|
499 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
500 |
+
'many_sp_calendar' => $many_sp_calendar,
|
501 |
+
'cur_page_url' => $path_sp_cal,
|
502 |
+
'cat_id' => '',
|
503 |
+
'cat_ids' => $cat_ids,
|
504 |
+
'widget' => $widget,
|
505 |
+
'rand' => $many_sp_calendar,
|
506 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
507 |
+
</div>
|
508 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
509 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
510 |
+
'action' => 'spiderbigcalendar_week',
|
511 |
+
'theme_id' => $theme_id,
|
512 |
+
'calendar' => $calendar_id,
|
513 |
+
'select' => $view_select,
|
514 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
515 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
516 |
+
'many_sp_calendar' => $many_sp_calendar,
|
517 |
+
'cur_page_url' => $path_sp_cal,
|
518 |
+
'cat_id' => '',
|
519 |
+
'cat_ids' => $cat_ids,
|
520 |
+
'widget' => $widget,
|
521 |
+
'rand' => $many_sp_calendar,
|
522 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
523 |
+
</div>
|
524 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
525 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
526 |
+
'action' => 'spiderbigcalendar_list',
|
527 |
+
'theme_id' => $theme_id,
|
528 |
+
'calendar' => $calendar_id,
|
529 |
+
'select' => $view_select,
|
530 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
531 |
+
'many_sp_calendar' => $many_sp_calendar,
|
532 |
+
'cur_page_url' => $path_sp_cal,
|
533 |
+
'cat_id' => '',
|
534 |
+
'cat_ids' => $cat_ids,
|
535 |
+
'widget' => $widget,
|
536 |
+
'rand' => $many_sp_calendar,
|
537 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
538 |
+
</div>
|
539 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
540 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
541 |
+
'action' => 'spiderbigcalendar_month',
|
542 |
+
'theme_id' => $theme_id,
|
543 |
+
'calendar' => $calendar_id,
|
544 |
+
'select' => $view_select,
|
545 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
546 |
+
'many_sp_calendar' => $many_sp_calendar,
|
547 |
+
'cur_page_url' => $path_sp_cal,
|
548 |
+
'cat_id' => '',
|
549 |
+
'cat_ids' => $cat_ids,
|
550 |
+
'widget' => $widget,
|
551 |
+
'rand' => $many_sp_calendar,
|
552 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
553 |
+
</div>
|
554 |
+
</div>
|
555 |
+
<div id="views_tabs_select" style="display:none" >
|
556 |
+
<div id="views_select" style="background-color:<?php echo $bg_top?>;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
557 |
+
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
558 |
+
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
559 |
+
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
560 |
+
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
561 |
+
<span>►</span>
|
562 |
+
</div>
|
563 |
+
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
564 |
+
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
565 |
+
<div class="views_select"
|
566 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
567 |
+
'action' => 'spiderbigcalendar_day',
|
568 |
+
'theme_id' => $theme_id,
|
569 |
+
'calendar' => $calendar_id,
|
570 |
+
'select' => $view_select,
|
571 |
+
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
572 |
+
'many_sp_calendar' => $many_sp_calendar,
|
573 |
+
'cur_page_url' => $path_sp_cal,
|
574 |
+
'cat_id' => '',
|
575 |
+
'cat_ids' => $cat_ids,
|
576 |
+
'widget' => $widget,
|
577 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
578 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
579 |
+
</div>
|
580 |
+
</li>
|
581 |
+
|
582 |
+
<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"
|
583 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
584 |
+
'action' => 'spiderbigcalendar_week',
|
585 |
+
'theme_id' => $theme_id,
|
586 |
+
'calendar' => $calendar_id,
|
587 |
+
'select' => $view_select,
|
588 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
589 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
590 |
+
'many_sp_calendar' => $many_sp_calendar,
|
591 |
+
'cur_page_url' => $path_sp_cal,
|
592 |
+
'cat_id' => '',
|
593 |
+
'cat_ids' => $cat_ids,
|
594 |
+
'widget' => $widget,
|
595 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
596 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
597 |
+
</div>
|
598 |
+
</li>
|
599 |
+
|
600 |
+
<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"
|
601 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
602 |
+
'action' => 'spiderbigcalendar_list',
|
603 |
+
'theme_id' => $theme_id,
|
604 |
+
'calendar' => $calendar_id,
|
605 |
+
'select' => $view_select,
|
606 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
607 |
+
'many_sp_calendar' => $many_sp_calendar,
|
608 |
+
'cur_page_url' => $path_sp_cal,
|
609 |
+
'cat_id' => '',
|
610 |
+
'cat_ids' => $cat_ids,
|
611 |
+
'widget' => $widget,
|
612 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
613 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
614 |
+
</div>
|
615 |
+
</li>
|
616 |
+
|
617 |
+
<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"
|
618 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
619 |
+
'action' => 'spiderbigcalendar_month',
|
620 |
+
'theme_id' => $theme_id,
|
621 |
+
'calendar' => $calendar_id,
|
622 |
+
'select' => $view_select,
|
623 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
624 |
+
'many_sp_calendar' => $many_sp_calendar,
|
625 |
+
'cur_page_url' => $path_sp_cal,
|
626 |
+
'cat_id' => '',
|
627 |
+
'cat_ids' => $cat_ids,
|
628 |
+
'widget' => $widget,
|
629 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
630 |
+
<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>
|
631 |
+
|
632 |
+
</ul>
|
633 |
+
</div>
|
634 |
+
|
635 |
+
</td>
|
636 |
+
</tr>
|
637 |
+
<tr>
|
638 |
+
<td>
|
639 |
+
<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; ?>;">
|
640 |
+
<tr>
|
641 |
+
<td width="100%" style="padding:0; margin:0;">
|
642 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;" >
|
643 |
+
<tr style="height:40px; width:100%;">
|
644 |
+
<td class="top_table" align="center" colspan="7" style="z-index: 5;position: relative;background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__) ?>');padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
645 |
+
<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;">
|
646 |
+
<tr>
|
647 |
+
<td width="15%">
|
648 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
649 |
+
echo add_query_arg(array(
|
650 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
651 |
+
'theme_id' => $theme_id,
|
652 |
+
'calendar' => $calendar_id,
|
653 |
+
'select' => $view_select,
|
654 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))) . '-' . $day,
|
655 |
+
'many_sp_calendar' => $many_sp_calendar,
|
656 |
+
'cur_page_url' => $path_sp_cal,
|
657 |
+
'cat_id' => '',
|
658 |
+
'cat_ids' => $cat_ids,
|
659 |
+
'widget' => $widget,
|
660 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:102%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
661 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year - 1; ?></span>
|
662 |
+
</div>
|
663 |
+
</td>
|
664 |
+
<td style="width:100%;vertical-align:center">
|
665 |
+
<table style="width:100%;">
|
666 |
+
<tr>
|
667 |
+
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
668 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
669 |
+
|
670 |
+
if ($day == '01' && Month_num(Month_name(Month_num($month) - 1)) != '12') {
|
671 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
672 |
+
}
|
673 |
+
|
674 |
+
else
|
675 |
+
{
|
676 |
+
if (Month_num(Month_name(Month_num($month) - 1)) == '12' && $day == '01') {
|
677 |
+
|
678 |
+
$needed_date = ($year - 1) . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
679 |
+
}
|
680 |
+
else {
|
681 |
+
$needed_date = $year . '-' . add_0((Month_num($month))) . '-' . add_0($day - 1);
|
682 |
+
}
|
683 |
+
}
|
684 |
+
echo add_query_arg(array(
|
685 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
686 |
+
'theme_id' => $theme_id,
|
687 |
+
'calendar' => $calendar_id,
|
688 |
+
'select' => $view_select,
|
689 |
+
'date' => $needed_date,
|
690 |
+
'many_sp_calendar' => $many_sp_calendar,
|
691 |
+
'cur_page_url' => $path_sp_cal,
|
692 |
+
'cat_id' => '',
|
693 |
+
'cat_ids' => $cat_ids,
|
694 |
+
'widget' => $widget,
|
695 |
+
), admin_url('admin-ajax.php'));
|
696 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◀
|
697 |
+
</a>
|
698 |
+
</td>
|
699 |
+
<td style="text-align:center; margin:0;" width="40%">
|
700 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month?>"/>
|
701 |
+
<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 $day . ' ' . __($month,'sp_calendar') . ' ' . $year ?></span>
|
702 |
+
</td>
|
703 |
+
<?php
|
704 |
+
if ($day == $month_day_count && Month_num(Month_name(Month_num($month) + 1)) != '1') {
|
705 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1)) . '-01';
|
706 |
+
|
707 |
+
}
|
708 |
+
else
|
709 |
+
{
|
710 |
+
|
711 |
+
if (Month_num(Month_name(Month_num($month) + 1)) == '1' && $day == $month_day_count) {
|
712 |
+
$needed_date = ($year + 1) . '-' . add_0(Month_num($month + 1)) . '-01';
|
713 |
+
|
714 |
+
}
|
715 |
+
else {
|
716 |
+
$needed_date = $year . '-' . add_0(Month_num($month)) . '-' . add_0($day + 1);
|
717 |
+
}
|
718 |
+
}
|
719 |
+
|
720 |
+
?>
|
721 |
+
|
722 |
+
<td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
|
723 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
724 |
+
|
725 |
+
echo add_query_arg(array(
|
726 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
727 |
+
'theme_id' => $theme_id,
|
728 |
+
'calendar' => $calendar_id,
|
729 |
+
'select' => $view_select,
|
730 |
+
'date' => $needed_date,
|
731 |
+
'many_sp_calendar' => $many_sp_calendar,
|
732 |
+
'cur_page_url' => $path_sp_cal,
|
733 |
+
'cat_id' => '',
|
734 |
+
'cat_ids' => $cat_ids,
|
735 |
+
'widget' => $widget,
|
736 |
+
), admin_url('admin-ajax.php'));
|
737 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">▶
|
738 |
+
</a>
|
739 |
+
</td>
|
740 |
+
<td width="15%">
|
741 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
742 |
+
echo add_query_arg(array(
|
743 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
744 |
+
'theme_id' => $theme_id,
|
745 |
+
'calendar' => $calendar_id,
|
746 |
+
'select' => $view_select,
|
747 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month))) . '-' . $day,
|
748 |
+
'many_sp_calendar' => $many_sp_calendar,
|
749 |
+
'cur_page_url' => $path_sp_cal,
|
750 |
+
'cat_id' => '',
|
751 |
+
'cat_ids' => $cat_ids,
|
752 |
+
'widget' => $widget,
|
753 |
+
), admin_url('admin-ajax.php')); ?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:102%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
754 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
|
755 |
+
</div>
|
756 |
+
</td>
|
757 |
+
</tr>
|
758 |
+
</table>
|
759 |
+
</td>
|
760 |
+
</tr>
|
761 |
+
</table>
|
762 |
+
</td>
|
763 |
+
|
764 |
+
</tr>
|
765 |
+
</tr>
|
766 |
+
<tr>
|
767 |
+
<td>
|
768 |
+
<?php
|
769 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
770 |
+
if ($weekstart == "su") {
|
771 |
+
$month_first_weekday++;
|
772 |
+
if ($month_first_weekday == 8) {
|
773 |
+
$month_first_weekday = 1;
|
774 |
+
}
|
775 |
+
}
|
776 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
777 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
778 |
+
$weekday_i = $month_first_weekday;
|
779 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
780 |
+
$percent = 1;
|
781 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
782 |
+
if ($sum % 7 <> 0) {
|
783 |
+
$percent = $percent + 1;
|
784 |
+
}
|
785 |
+
$sum = $sum - ($sum % 7);
|
786 |
+
$percent = $percent + ($sum / 7);
|
787 |
+
$percent = 107 / $percent;
|
788 |
+
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
789 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
790 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
791 |
+
$array_days = $all_calendar_files[0]['array_days'];
|
792 |
+
$array_days1 = $all_calendar_files[0]['array_days1'];
|
793 |
+
$title = $all_calendar_files[0]['title'];
|
794 |
+
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
795 |
+
sort($array_days, SORT_NUMERIC);
|
796 |
+
if (!$array_days || !in_array((int) $day, $array_days)) {
|
797 |
+
$week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
|
798 |
+
echo '<table style="border-spacing:0;width:100%;border-bottom:1px solid ' . $cell_border_color . '">
|
799 |
+
<tr>
|
800 |
+
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
|
801 |
+
<span style="padding-left:10px; font-size:' . $week_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
802 |
+
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
|
803 |
+
</td>
|
804 |
+
</tr>
|
805 |
+
<tr>
|
806 |
+
<td>
|
807 |
+
<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">
|
808 |
+
<tr>
|
809 |
+
<td style="font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ';color:' . $event_num_color . '"></td>
|
810 |
+
<td><p style="color:' . $event_title_color . ';border:none;"> ' . __('There Is No Event In This Day', 'sp_calendar') . '</p></td>
|
811 |
+
</tr>
|
812 |
+
</table>
|
813 |
+
</td>
|
814 |
+
</tr>
|
815 |
+
</table>';
|
816 |
+
}
|
817 |
+
if (in_array((int) $day, $array_days)) {
|
818 |
+
$week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
|
819 |
+
echo '<table style="border-spacing:0;width:100%;border-bottom:1px solid ' . $cell_border_color . '">
|
820 |
+
<tr>
|
821 |
+
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
|
822 |
+
<span style="padding-left:10px; font-size:' . $date_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
823 |
+
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
|
824 |
+
</td>
|
825 |
+
<tr>
|
826 |
+
<td>';
|
827 |
+
foreach ($title as $key => $value) {
|
828 |
+
if ($key == (int) $day) {
|
829 |
+
$ev_id = explode('<br>', $ev_ids[$key]);
|
830 |
+
array_pop($ev_id);
|
831 |
+
$ev_ids_inline = implode(',', $ev_id);
|
832 |
+
$ev_title = explode('</p>', $value);
|
833 |
+
array_pop($ev_title);
|
834 |
+
for ($j = 0; $j < count($ev_title); $j++) {
|
835 |
+
|
836 |
+
|
837 |
+
$query =$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($query);
|
842 |
+
|
843 |
+
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color="";};
|
844 |
+
|
845 |
+
if (($j + 1) % 2 == 0) {
|
846 |
+
$color = $event_num_bg_color2;
|
847 |
+
$table_color = $event_bg_color2;
|
848 |
+
}
|
849 |
+
else {
|
850 |
+
$color = $event_num_bg_color1;
|
851 |
+
$table_color = $event_bg_color1;
|
852 |
+
}
|
853 |
+
|
854 |
+
echo '<table style="margin: 0;border-spacing:0;height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . ';" class="day_ev">
|
855 |
+
<tr>
|
856 |
+
<td style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $event_num_color . '">' . (($show_numbers_for_events) ? ($j + 1) : '') . '</td>
|
857 |
+
<td>
|
858 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:15px;background:none;text-decoration:none;color:' . $event_title_color . '; "
|
859 |
+
href="' . add_query_arg(array(
|
860 |
+
'action' => 'spidercalendarbig',
|
861 |
+
'theme_id' => $theme_id,
|
862 |
+
'calendar_id' => $calendar_id,
|
863 |
+
'ev_ids' => $ev_ids_inline,
|
864 |
+
'eventID' => $ev_id[$j],
|
865 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . (int) $day,
|
866 |
+
'many_sp_calendar' => $many_sp_calendar,
|
867 |
+
'cur_page_url' => $path_sp_cal,
|
868 |
+
'widget' => $widget,
|
869 |
+
'TB_iframe' => 1,
|
870 |
+
'tbWidth' => $popup_width,
|
871 |
+
'tbHeight' => $popup_height,
|
872 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $ev_title[$j] . '</b>
|
873 |
+
</a>
|
874 |
+
</td>
|
875 |
+
</tr>
|
876 |
+
</table>';
|
877 |
+
}
|
878 |
+
}
|
879 |
+
}
|
880 |
+
echo '</td></tr></table>';
|
881 |
+
}
|
882 |
+
?>
|
883 |
+
</td>
|
884 |
+
</tr>
|
885 |
+
</table>
|
886 |
+
</tr>
|
887 |
+
</table>
|
888 |
+
</td>
|
889 |
+
</tr>
|
890 |
+
</table>
|
891 |
+
|
892 |
+
<script>
|
893 |
+
|
894 |
+
jQuery(document).ready(function (){
|
895 |
+
|
896 |
+
jQuery('#views_select').click(function () {
|
897 |
+
jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
|
898 |
+
}, function () {
|
899 |
+
jQuery('#drop_down_views').stop(true, true).slideUp(500);
|
900 |
+
});
|
901 |
+
if(jQuery(window).width() > 640 )
|
902 |
+
{
|
903 |
+
jQuery('drop_down_views').hide();
|
904 |
+
}
|
905 |
+
});
|
906 |
+
</script>
|
907 |
+
|
908 |
+
|
909 |
+
<style>
|
910 |
+
|
911 |
+
@media only screen and (max-width : 640px) {
|
912 |
+
|
913 |
+
#views_tabs ,#drop_down_views
|
914 |
+
{
|
915 |
+
display:none;
|
916 |
+
}
|
917 |
+
|
918 |
+
#views_tabs_select
|
919 |
+
{
|
920 |
+
display:block !important;
|
921 |
+
}
|
922 |
+
|
923 |
+
|
924 |
+
|
925 |
+
}
|
926 |
+
|
927 |
+
@media only screen and (max-width : 968px) {
|
928 |
+
#cats >li
|
929 |
+
{
|
930 |
+
float:none;
|
931 |
+
}
|
932 |
+
|
933 |
+
|
934 |
+
|
935 |
+
}
|
936 |
+
.categories1 , .categories2
|
937 |
+
{
|
938 |
+
display:inline-block;
|
939 |
+
}
|
940 |
+
|
941 |
+
.categories2
|
942 |
+
{
|
943 |
+
position:relative;
|
944 |
+
left: -9px;
|
945 |
+
cursor:pointer;
|
946 |
+
}
|
947 |
+
.categories2:first-letter
|
948 |
+
{
|
949 |
+
color:#fff;
|
950 |
+
|
951 |
+
}
|
952 |
+
</style>
|
953 |
+
<?php
|
954 |
+
|
955 |
+
//reindex cat_ids_array
|
956 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
957 |
+
|
958 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
959 |
+
{
|
960 |
+
echo'
|
961 |
+
<style>
|
962 |
+
#cats #category'.$re_cat_ids_array[$i].'
|
963 |
+
{
|
964 |
+
text-decoration:underline;
|
965 |
+
cursor:pointer;
|
966 |
+
|
967 |
+
}
|
968 |
+
|
969 |
+
</style>';
|
970 |
+
|
971 |
+
}
|
972 |
+
|
973 |
+
|
974 |
+
|
975 |
+
if($cat_ids=='')
|
976 |
+
$cat_ids='';
|
977 |
+
|
978 |
+
if($show_cat==1)
|
979 |
+
{
|
980 |
+
echo '<ul id="cats" style="list-style-type:none;">';
|
981 |
+
|
982 |
+
|
983 |
+
foreach($categories as $category)
|
984 |
+
{
|
985 |
+
|
986 |
+
?>
|
987 |
+
|
988 |
+
<li style="float:left;"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
989 |
+
'action' => 'spiderbigcalendar_day',
|
990 |
+
'theme_id' => $theme_id,
|
991 |
+
'calendar' => $calendar_id,
|
992 |
+
'select' => $view_select,
|
993 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
|
994 |
+
'many_sp_calendar' => $many_sp_calendar,
|
995 |
+
'cur_page_url' => $path_sp_cal,
|
996 |
+
'cat_id' => $category->id,
|
997 |
+
'cat_ids' => $cat_ids,
|
998 |
+
'widget' => $widget,
|
999 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1000 |
+
|
1001 |
+
|
1002 |
+
<?php
|
1003 |
+
|
1004 |
+
|
1005 |
+
}
|
1006 |
+
|
1007 |
+
echo '</ul>';
|
1008 |
+
}
|
1009 |
+
die();
|
1010 |
+
}
|
1011 |
+
|
1012 |
?>
|
front_end/bigcalendarday_widget.php
CHANGED
@@ -1,709 +1,710 @@
|
|
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 |
-
$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 |
-
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
-
|
13 |
-
///////////////////////////////////////////////////////////////////////////////////
|
14 |
-
|
15 |
-
if(isset($_GET['cat_id']))
|
16 |
-
$cat_id = $_GET['cat_id'];
|
17 |
-
else $cat_id = "";
|
18 |
-
|
19 |
-
if(isset($_GET['cat_ids']))
|
20 |
-
$cat_ids = $_GET['cat_ids'];
|
21 |
-
else $cat_ids = "";
|
22 |
-
|
23 |
-
|
24 |
-
if($cat_ids=='')
|
25 |
-
$cat_ids .= $cat_id.',';
|
26 |
-
else
|
27 |
-
$cat_ids .= ','.$cat_id.',';
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
32 |
-
|
33 |
-
|
34 |
-
function getelementcountinarray($array , $element)
|
35 |
-
{
|
36 |
-
$t=0;
|
37 |
-
|
38 |
-
for($i=0; $i<count($array); $i++)
|
39 |
-
{
|
40 |
-
if($element==$array[$i])
|
41 |
-
$t++;
|
42 |
-
|
43 |
-
}
|
44 |
-
|
45 |
-
|
46 |
-
return $t;
|
47 |
-
|
48 |
-
}
|
49 |
-
|
50 |
-
function getelementindexinarray($array , $element)
|
51 |
-
{
|
52 |
-
|
53 |
-
$t='';
|
54 |
-
|
55 |
-
for($i=0; $i<count($array); $i++)
|
56 |
-
{
|
57 |
-
if($element==$array[$i])
|
58 |
-
$t.=$i.',';
|
59 |
-
|
60 |
-
}
|
61 |
-
|
62 |
-
return $t;
|
63 |
-
|
64 |
-
|
65 |
-
}
|
66 |
-
$cat_ids_array = explode(',',$cat_ids);
|
67 |
-
|
68 |
-
|
69 |
-
if($cat_id!='')
|
70 |
-
{
|
71 |
-
|
72 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
73 |
-
{
|
74 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
75 |
-
$index_array = explode(',' , $index_in_line);
|
76 |
-
array_pop ($index_array);
|
77 |
-
for($j=0; $j<count($index_array); $j++)
|
78 |
-
unset($cat_ids_array[$index_array[$j]]);
|
79 |
-
$cat_ids = implode(',',$cat_ids_array);
|
80 |
-
}
|
81 |
-
}
|
82 |
-
else
|
83 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
84 |
-
|
85 |
-
|
86 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
87 |
-
|
88 |
-
|
89 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
90 |
-
$weekstart = $theme->week_start_day;
|
91 |
-
$bg = '#' . $theme->header_bgcolor;
|
92 |
-
$
|
93 |
-
$
|
94 |
-
$
|
95 |
-
$
|
96 |
-
$
|
97 |
-
$
|
98 |
-
$
|
99 |
-
$
|
100 |
-
$
|
101 |
-
$
|
102 |
-
$
|
103 |
-
$
|
104 |
-
$
|
105 |
-
$
|
106 |
-
$
|
107 |
-
$
|
108 |
-
$
|
109 |
-
$
|
110 |
-
$
|
111 |
-
$
|
112 |
-
$
|
113 |
-
$
|
114 |
-
$
|
115 |
-
$
|
116 |
-
$
|
117 |
-
$
|
118 |
-
|
119 |
-
|
120 |
-
__('
|
121 |
-
__('
|
122 |
-
__('
|
123 |
-
__('
|
124 |
-
__('
|
125 |
-
__('
|
126 |
-
__('
|
127 |
-
__('
|
128 |
-
__('
|
129 |
-
__('
|
130 |
-
__('
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
//
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
$
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
$
|
147 |
-
$
|
148 |
-
|
149 |
-
|
150 |
-
$
|
151 |
-
$
|
152 |
-
|
153 |
-
|
154 |
-
$
|
155 |
-
$
|
156 |
-
|
157 |
-
|
158 |
-
$cell_width =
|
159 |
-
|
160 |
-
|
161 |
-
$
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
$
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
$
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
$
|
174 |
-
$
|
175 |
-
|
176 |
-
|
177 |
-
$
|
178 |
-
$
|
179 |
-
|
180 |
-
$
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
border:
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
#calendar_<?php echo $many_sp_calendar; ?>
|
209 |
-
#
|
210 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar ?>
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
font-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
#calendar_<?php echo $many_sp_calendar; ?>
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
'
|
339 |
-
'
|
340 |
-
'
|
341 |
-
'
|
342 |
-
'
|
343 |
-
'
|
344 |
-
|
345 |
-
'
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
'
|
354 |
-
'
|
355 |
-
'
|
356 |
-
'
|
357 |
-
'
|
358 |
-
'
|
359 |
-
'
|
360 |
-
|
361 |
-
'
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
'
|
370 |
-
'
|
371 |
-
'
|
372 |
-
'
|
373 |
-
'
|
374 |
-
'
|
375 |
-
|
376 |
-
'
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
'
|
385 |
-
'
|
386 |
-
'
|
387 |
-
'
|
388 |
-
'
|
389 |
-
'
|
390 |
-
|
391 |
-
'
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
'
|
422 |
-
'
|
423 |
-
'
|
424 |
-
'
|
425 |
-
'
|
426 |
-
'
|
427 |
-
|
428 |
-
'
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
<
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
'
|
453 |
-
'
|
454 |
-
'
|
455 |
-
'
|
456 |
-
'
|
457 |
-
'
|
458 |
-
|
459 |
-
'
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
$
|
483 |
-
$
|
484 |
-
$
|
485 |
-
$
|
486 |
-
$
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
$
|
492 |
-
$percent =
|
493 |
-
$
|
494 |
-
$
|
495 |
-
$
|
496 |
-
$
|
497 |
-
$
|
498 |
-
$
|
499 |
-
$
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
<span style="font-size:12px;color
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
<td
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
<span style="font-size:12px;color
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
$
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
" . $wpdb->prefix . "spidercalendar_event.
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
$
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
$
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
<td>
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
'
|
563 |
-
'
|
564 |
-
'
|
565 |
-
'
|
566 |
-
'
|
567 |
-
'
|
568 |
-
'
|
569 |
-
'
|
570 |
-
'
|
571 |
-
'
|
572 |
-
'
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
'
|
591 |
-
'
|
592 |
-
'
|
593 |
-
'
|
594 |
-
'
|
595 |
-
'
|
596 |
-
'
|
597 |
-
|
598 |
-
'
|
599 |
-
'
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
'
|
610 |
-
'
|
611 |
-
'
|
612 |
-
'
|
613 |
-
'
|
614 |
-
'
|
615 |
-
'
|
616 |
-
|
617 |
-
'
|
618 |
-
'
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
'
|
687 |
-
'
|
688 |
-
'
|
689 |
-
'
|
690 |
-
'
|
691 |
-
'
|
692 |
-
|
693 |
-
'
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
|
|
709 |
?>
|
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 |
+
$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 |
+
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
+
|
13 |
+
///////////////////////////////////////////////////////////////////////////////////
|
14 |
+
|
15 |
+
if(isset($_GET['cat_id']))
|
16 |
+
$cat_id = $_GET['cat_id'];
|
17 |
+
else $cat_id = "";
|
18 |
+
|
19 |
+
if(isset($_GET['cat_ids']))
|
20 |
+
$cat_ids = $_GET['cat_ids'];
|
21 |
+
else $cat_ids = "";
|
22 |
+
|
23 |
+
|
24 |
+
if($cat_ids=='')
|
25 |
+
$cat_ids .= $cat_id.',';
|
26 |
+
else
|
27 |
+
$cat_ids .= ','.$cat_id.',';
|
28 |
+
|
29 |
+
|
30 |
+
|
31 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
32 |
+
|
33 |
+
|
34 |
+
function getelementcountinarray($array , $element)
|
35 |
+
{
|
36 |
+
$t=0;
|
37 |
+
|
38 |
+
for($i=0; $i<count($array); $i++)
|
39 |
+
{
|
40 |
+
if($element==$array[$i])
|
41 |
+
$t++;
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
return $t;
|
47 |
+
|
48 |
+
}
|
49 |
+
|
50 |
+
function getelementindexinarray($array , $element)
|
51 |
+
{
|
52 |
+
|
53 |
+
$t='';
|
54 |
+
|
55 |
+
for($i=0; $i<count($array); $i++)
|
56 |
+
{
|
57 |
+
if($element==$array[$i])
|
58 |
+
$t.=$i.',';
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
return $t;
|
63 |
+
|
64 |
+
|
65 |
+
}
|
66 |
+
$cat_ids_array = explode(',',$cat_ids);
|
67 |
+
|
68 |
+
|
69 |
+
if($cat_id!='')
|
70 |
+
{
|
71 |
+
|
72 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
73 |
+
{
|
74 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
75 |
+
$index_array = explode(',' , $index_in_line);
|
76 |
+
array_pop ($index_array);
|
77 |
+
for($j=0; $j<count($index_array); $j++)
|
78 |
+
unset($cat_ids_array[$index_array[$j]]);
|
79 |
+
$cat_ids = implode(',',$cat_ids_array);
|
80 |
+
}
|
81 |
+
}
|
82 |
+
else
|
83 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
84 |
+
|
85 |
+
|
86 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
87 |
+
|
88 |
+
|
89 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
90 |
+
$weekstart = $theme->week_start_day;
|
91 |
+
$bg = '#' . $theme->header_bgcolor;
|
92 |
+
$show_cat = 1;
|
93 |
+
$bg_color_selected = '#' . $theme->bg_color_selected;
|
94 |
+
$color_arrow = '#' . $theme->arrow_color;
|
95 |
+
$evented_color = '#' . $theme->text_color_this_month_evented;
|
96 |
+
$evented_color_bg = '#' . $theme->bg_color_this_month_evented;
|
97 |
+
$sun_days = '#' . $theme->text_color_sun_days;
|
98 |
+
$text_color_other_months = '#' . $theme->text_color_other_months;
|
99 |
+
$text_color_this_month_unevented = '#' . $theme->text_color_this_month_unevented;
|
100 |
+
$text_color_month = '#' . $theme->text_color_month;
|
101 |
+
$color_week_days = '#' . $theme->text_color_week_days;
|
102 |
+
$text_color_selected = '#' . $theme->text_color_selected;
|
103 |
+
$border_day = '#' . $theme->border_day;
|
104 |
+
$calendar_width = $theme->width;
|
105 |
+
$calendar_bg = '#' . $theme->footer_bgcolor;
|
106 |
+
$weekdays_bg_color = '#' . $theme->weekdays_bg_color;
|
107 |
+
$weekday_su_bg_color = '#' . $theme->su_bg_color;
|
108 |
+
$cell_border_color = '#' . $theme->cell_border_color;
|
109 |
+
$year_font_size = $theme->year_font_size;
|
110 |
+
$year_font_color = '#' . $theme->year_font_color;
|
111 |
+
$year_tabs_bg_color = '#' . $theme->year_tabs_bg_color;
|
112 |
+
$font_year = $theme->font_year;
|
113 |
+
$font_month = $theme->font_month;
|
114 |
+
$font_day = $theme->font_day;
|
115 |
+
$font_weekday = $theme->font_weekday;
|
116 |
+
$ev_title_color = $theme->ev_title_color;
|
117 |
+
$popup_width = $theme->popup_width;
|
118 |
+
$popup_height = $theme->popup_height;
|
119 |
+
|
120 |
+
__('January', 'sp_calendar');
|
121 |
+
__('February', 'sp_calendar');
|
122 |
+
__('March', 'sp_calendar');
|
123 |
+
__('April', 'sp_calendar');
|
124 |
+
__('May', 'sp_calendar');
|
125 |
+
__('June', 'sp_calendar');
|
126 |
+
__('July', 'sp_calendar');
|
127 |
+
__('August', 'sp_calendar');
|
128 |
+
__('September', 'sp_calendar');
|
129 |
+
__('October', 'sp_calendar');
|
130 |
+
__('November', 'sp_calendar');
|
131 |
+
__('December', 'sp_calendar');
|
132 |
+
// if ($cell_height == '') {
|
133 |
+
// $cell_height = 70;
|
134 |
+
// }
|
135 |
+
// if ($cal_width == '') {
|
136 |
+
// $cal_width = 700;
|
137 |
+
// }
|
138 |
+
if ($date != '') {
|
139 |
+
$date_REFERER = $date;
|
140 |
+
}
|
141 |
+
else {
|
142 |
+
$date_REFERER = date("Y-m");
|
143 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
144 |
+
}
|
145 |
+
|
146 |
+
$year_REFERER = substr($date_REFERER, 0, 4);
|
147 |
+
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
148 |
+
$day_REFERER = substr($date_REFERER, 8, 2);
|
149 |
+
|
150 |
+
$year = substr($date, 0, 4);
|
151 |
+
$month = Month_name(substr($date, 5, 2));
|
152 |
+
$day = substr($date, 8, 2);
|
153 |
+
|
154 |
+
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
155 |
+
$prev_month = add_0((int) $this_month - 1);
|
156 |
+
$next_month = add_0((int) $this_month + 1);
|
157 |
+
|
158 |
+
$cell_width = $calendar_width / 7;
|
159 |
+
$cell_width = (int) $cell_width - 2;
|
160 |
+
|
161 |
+
$month_day_count = date('t', mktime(0, 0, 0, Month_num($month), 1, $year));
|
162 |
+
$prev_month_day_count = date('t', mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
163 |
+
|
164 |
+
if ($day > $month_day_count) {
|
165 |
+
$month = Month_name(Month_num($month) + 1);
|
166 |
+
$day = '01';
|
167 |
+
}
|
168 |
+
if ((int) $day < 1) {
|
169 |
+
$month = Month_name(Month_num($month) - 1);
|
170 |
+
$day = $prev_month_day_count;
|
171 |
+
}
|
172 |
+
|
173 |
+
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
174 |
+
$prev_month = add_0((int) $this_month - 1);
|
175 |
+
$next_month = add_0((int) $this_month + 1);
|
176 |
+
|
177 |
+
$view = 'bigcalendarday_widget';
|
178 |
+
$views = explode(',', $view_select);
|
179 |
+
$defaultview = 'day';
|
180 |
+
array_pop($views);
|
181 |
+
$display = '';
|
182 |
+
if (count($views) == 0) {
|
183 |
+
$display = "display:none";
|
184 |
+
}
|
185 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
186 |
+
$display = "display:none";
|
187 |
+
}
|
188 |
+
?>
|
189 |
+
<style type='text/css'>
|
190 |
+
#calendar_<?php echo $many_sp_calendar; ?> table {
|
191 |
+
border-collapse: initial;
|
192 |
+
border:0px;
|
193 |
+
}
|
194 |
+
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
195 |
+
padding: 0px;
|
196 |
+
vertical-align: none;
|
197 |
+
border-top:none;
|
198 |
+
line-height: none;
|
199 |
+
text-align: none;
|
200 |
+
}
|
201 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
202 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
203 |
+
font-family: <?php echo $font_day; ?>;
|
204 |
+
}
|
205 |
+
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
206 |
+
margin-bottom: 0;
|
207 |
+
}
|
208 |
+
#calendar_<?php echo $many_sp_calendar; ?> td,
|
209 |
+
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
210 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar ?> td,
|
211 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar ?> tr {
|
212 |
+
border:none;
|
213 |
+
}
|
214 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
215 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
216 |
+
color: <?php echo $color_arrow; ?>;
|
217 |
+
text-decoration: none;
|
218 |
+
background: none;
|
219 |
+
font-size: 16px;
|
220 |
+
}
|
221 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
222 |
+
color: <?php echo $color_arrow; ?>;
|
223 |
+
text-decoration:none;
|
224 |
+
background:none;
|
225 |
+
}
|
226 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
227 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
228 |
+
text-decoration:underline;
|
229 |
+
background:none;
|
230 |
+
font-size:11px;
|
231 |
+
}
|
232 |
+
#calendar_<?php echo $many_sp_calendar; ?> a {
|
233 |
+
font-weight: normal;
|
234 |
+
}
|
235 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
236 |
+
font-size:12px;
|
237 |
+
text-decoration:none;
|
238 |
+
background:none;
|
239 |
+
}
|
240 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
241 |
+
border-spacing:0;
|
242 |
+
width:100%;
|
243 |
+
}
|
244 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
245 |
+
border-spacing: 0;
|
246 |
+
vertical-align: middle;
|
247 |
+
width: 100%;
|
248 |
+
}
|
249 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
250 |
+
background-color:<?php echo $bg; ?>;
|
251 |
+
text-align:center;
|
252 |
+
vertical-align: middle;
|
253 |
+
}
|
254 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
255 |
+
color:<?php echo $text_color_other_months; ?>;
|
256 |
+
}
|
257 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
258 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
259 |
+
}
|
260 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calfont_year {
|
261 |
+
font-size:24px;
|
262 |
+
font-weight:bold;
|
263 |
+
color:<?php echo $year_font_color; ?>;
|
264 |
+
}
|
265 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
266 |
+
color:<?php echo $sun_days; ?>;
|
267 |
+
}
|
268 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
269 |
+
border: solid <?php echo $border_day; ?> 1px;
|
270 |
+
}
|
271 |
+
#TB_window {
|
272 |
+
z-index: 10000;
|
273 |
+
}
|
274 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
275 |
+
float: right;
|
276 |
+
background-color: <?php echo $calendar_bg; ?>;
|
277 |
+
height: 25px;
|
278 |
+
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
279 |
+
margin-left: 2px;
|
280 |
+
text-align: center;
|
281 |
+
cursor:pointer;
|
282 |
+
position: relative;
|
283 |
+
top: 3px;
|
284 |
+
font-family: <?php echo $font_month; ?>;
|
285 |
+
}
|
286 |
+
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
287 |
+
background: transparent !important;
|
288 |
+
}
|
289 |
+
|
290 |
+
|
291 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
292 |
+
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
293 |
+
{
|
294 |
+
|
295 |
+
background-color: ".$views_tabs_bg_color.";
|
296 |
+
width: 120px;
|
297 |
+
text-align: center;
|
298 |
+
cursor: pointer;
|
299 |
+
padding: 6px;
|
300 |
+
position: relative;
|
301 |
+
}
|
302 |
+
|
303 |
+
|
304 |
+
#drop_down_views
|
305 |
+
{
|
306 |
+
list-style-type:none !important;
|
307 |
+
position: absolute;
|
308 |
+
top: 46px;
|
309 |
+
left: -15px;
|
310 |
+
display:none;
|
311 |
+
z-index: 4545;
|
312 |
+
|
313 |
+
}
|
314 |
+
|
315 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
316 |
+
{
|
317 |
+
background:<?php echo $bg_top ?>;
|
318 |
+
}
|
319 |
+
|
320 |
+
#drop_down_views >li
|
321 |
+
{
|
322 |
+
border-bottom:1px solid #fff !important;
|
323 |
+
}
|
324 |
+
|
325 |
+
|
326 |
+
#views_tabs_select
|
327 |
+
{
|
328 |
+
display:none;
|
329 |
+
}
|
330 |
+
</style>
|
331 |
+
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
332 |
+
<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; ?>">
|
333 |
+
<tr style="background-color:#FFFFFF;">
|
334 |
+
<td style="background-color:#FFFFFF;">
|
335 |
+
<div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
|
336 |
+
<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 . ';height:28px;top:0;'; ?>"
|
337 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
338 |
+
'action' => 'spiderbigcalendar_day_widget',
|
339 |
+
'theme_id' => $theme_id,
|
340 |
+
'calendar' => $calendar_id,
|
341 |
+
'select' => $view_select,
|
342 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
343 |
+
'many_sp_calendar' => $many_sp_calendar,
|
344 |
+
'cur_page_url' => $path_sp_cal,
|
345 |
+
'cat_id' => '',
|
346 |
+
'cat_ids' => $cat_ids,
|
347 |
+
'widget' => $widget,
|
348 |
+
'TB_iframe' => 1,
|
349 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
350 |
+
</div>
|
351 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
352 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
353 |
+
'action' => 'spiderbigcalendar_week_widget',
|
354 |
+
'theme_id' => $theme_id,
|
355 |
+
'calendar' => $calendar_id,
|
356 |
+
'select' => $view_select,
|
357 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
358 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
359 |
+
'many_sp_calendar' => $many_sp_calendar,
|
360 |
+
'cur_page_url' => $path_sp_cal,
|
361 |
+
'cat_id' => '',
|
362 |
+
'cat_ids' => $cat_ids,
|
363 |
+
'widget' => $widget,
|
364 |
+
'TB_iframe' => 1,
|
365 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
366 |
+
</div>
|
367 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ';height:28px;top:0;' ?>"
|
368 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
369 |
+
'action' => 'spiderbigcalendar_list_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 |
+
'cur_page_url' => $path_sp_cal,
|
376 |
+
'cat_id' => '',
|
377 |
+
'cat_ids' => $cat_ids,
|
378 |
+
'widget' => $widget,
|
379 |
+
'TB_iframe' => 1,
|
380 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
381 |
+
</div>
|
382 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
383 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
384 |
+
'action' => 'spiderbigcalendar_month_widget',
|
385 |
+
'theme_id' => $theme_id,
|
386 |
+
'calendar' => $calendar_id,
|
387 |
+
'select' => $view_select,
|
388 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
389 |
+
'many_sp_calendar' => $many_sp_calendar,
|
390 |
+
'cur_page_url' => $path_sp_cal,
|
391 |
+
'cat_id' => '',
|
392 |
+
'cat_ids' => $cat_ids,
|
393 |
+
'widget' => $widget,
|
394 |
+
'TB_iframe' => 1,
|
395 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
396 |
+
</div>
|
397 |
+
</div>
|
398 |
+
</td>
|
399 |
+
</tr>
|
400 |
+
<tr>
|
401 |
+
<td width="100%" style="padding:0; margin:0;">
|
402 |
+
<form action="" method="get" style="background:none; margin:0; padding:0;">
|
403 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>">
|
404 |
+
<tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
|
405 |
+
<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%;" >
|
406 |
+
<?php //MONTH TABLE ?>
|
407 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
|
408 |
+
<tr>
|
409 |
+
<td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
410 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
411 |
+
if ($day == '01' && Month_num(Month_name(Month_num($month) - 1)) != '12') {
|
412 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
413 |
+
}
|
414 |
+
elseif (Month_num(Month_name(Month_num($month) - 1)) == '12' && $day == '01') {
|
415 |
+
$needed_date = ($year - 1) . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
|
416 |
+
}
|
417 |
+
else {
|
418 |
+
$needed_date = $year . '-' . add_0((Month_num($month))) . '-' . add_0($day - 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 |
+
'cur_page_url' => $path_sp_cal,
|
428 |
+
'cat_id' => '',
|
429 |
+
'cat_ids' => $cat_ids,
|
430 |
+
'widget' => $widget,
|
431 |
+
'TB_iframe' => 1,
|
432 |
+
), admin_url('admin-ajax.php'));
|
433 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◄
|
434 |
+
</a>
|
435 |
+
</td>
|
436 |
+
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
437 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
438 |
+
<span style="font-size:<?php echo $year_font_size; ?>px;?>; color:<?php echo $text_color_month; ?>;"><?php echo $day . ' ' . __($month, 'sp_calendar') . ' ' . $year ?></span>
|
439 |
+
</td>
|
440 |
+
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
441 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
442 |
+
if ($day == $month_day_count && Month_num(Month_name(Month_num($month) + 1)) != '1') {
|
443 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1)) . '-01';
|
444 |
+
}
|
445 |
+
elseif (Month_num(Month_name(Month_num($month) + 1)) == '1' && $day == $month_day_count) {
|
446 |
+
$needed_date = ($year + 1) . '-' . add_0(Month_num($month + 1)) . '-01';
|
447 |
+
}
|
448 |
+
else {
|
449 |
+
$needed_date = $year . '-' . add_0(Month_num($month)) . '-' . add_0($day + 1);
|
450 |
+
}
|
451 |
+
echo add_query_arg(array(
|
452 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
453 |
+
'theme_id' => $theme_id,
|
454 |
+
'calendar' => $calendar_id,
|
455 |
+
'select' => $view_select,
|
456 |
+
'date' => $needed_date,
|
457 |
+
'many_sp_calendar' => $many_sp_calendar,
|
458 |
+
'cur_page_url' => $path_sp_cal,
|
459 |
+
'cat_id' => '',
|
460 |
+
'cat_ids' => $cat_ids,
|
461 |
+
'widget' => $widget,
|
462 |
+
'TB_iframe' => 1,
|
463 |
+
), admin_url('admin-ajax.php'));
|
464 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">►
|
465 |
+
</a>
|
466 |
+
</td>
|
467 |
+
</tr>
|
468 |
+
</table>
|
469 |
+
</td>
|
470 |
+
</tr>
|
471 |
+
|
472 |
+
<tr>
|
473 |
+
<td colspan="7">
|
474 |
+
<?php
|
475 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
476 |
+
if ($weekstart == "su") {
|
477 |
+
$month_first_weekday++;
|
478 |
+
if ($month_first_weekday == 8) {
|
479 |
+
$month_first_weekday = 1;
|
480 |
+
}
|
481 |
+
}
|
482 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
483 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
484 |
+
$weekday_i = $month_first_weekday;
|
485 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
486 |
+
$percent = 1;
|
487 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
488 |
+
if ($sum % 7 <> 0) {
|
489 |
+
$percent = $percent + 1;
|
490 |
+
}
|
491 |
+
$sum = $sum - ($sum % 7);
|
492 |
+
$percent = $percent + ($sum / 7);
|
493 |
+
$percent = 107 / $percent;
|
494 |
+
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
495 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
496 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
497 |
+
$array_days = $all_calendar_files[0]['array_days'];
|
498 |
+
$array_days1 = $all_calendar_files[0]['array_days1'];
|
499 |
+
$title = $all_calendar_files[0]['title'];
|
500 |
+
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
501 |
+
sort($array_days, SORT_NUMERIC);
|
502 |
+
if (!$array_days || !in_array((int) $day, $array_days)) {
|
503 |
+
$week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
|
504 |
+
echo '<table style="border-spacing:0;width:100%;">
|
505 |
+
<tr>
|
506 |
+
<td style="height:14px;font-size:12px; padding-left:10px;background-color:#D6D4D5; color:#6E7276">
|
507 |
+
<span style="padding-left:10px; font-size:12px;color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
|
508 |
+
<span style="font-size:12px;color:#949394;">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
|
509 |
+
</td>
|
510 |
+
</tr>
|
511 |
+
<tr>
|
512 |
+
<td>
|
513 |
+
<table style="height:14px;border-spacing:0;width: 100%;background-color:#D6D4D5;">
|
514 |
+
<tr>
|
515 |
+
<td style="font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $bg . ';color:#949394;"></td>
|
516 |
+
<td><p style="font-size:12px;color:' . $bg . ';border:none;"> ' . __('There Is No Event In This Day', 'sp_calendar') . '</p></td>
|
517 |
+
</tr>
|
518 |
+
</table>
|
519 |
+
</td>
|
520 |
+
</tr>
|
521 |
+
</table>';
|
522 |
+
}
|
523 |
+
if (in_array((int) $day, $array_days)) {
|
524 |
+
$week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
|
525 |
+
echo '<table style="border-spacing:0;width:100%;">
|
526 |
+
<tr>
|
527 |
+
<td style="height:14px;font-size:12px; padding-left:10px;background-color:#D6D4D5; color:#6E7276">
|
528 |
+
<span style="padding-left:10px; font-size:12px;color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
|
529 |
+
<span style="font-size:12px;color:#949394;">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
|
530 |
+
</td>
|
531 |
+
<tr>
|
532 |
+
<td>';
|
533 |
+
foreach ($title as $key => $value) {
|
534 |
+
if ($key == (int) $day) {
|
535 |
+
$ev_id = explode('<br>', $ev_ids[$key]);
|
536 |
+
array_pop($ev_id);
|
537 |
+
$ev_ids_inline = implode(',', $ev_id);
|
538 |
+
$ev_title = explode('</p>', $value);
|
539 |
+
array_pop($ev_title);
|
540 |
+
for ($j = 0; $j < count($ev_title); $j++) {
|
541 |
+
$query = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
542 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
543 |
+
" . $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] );
|
544 |
+
|
545 |
+
$cat_color = $wpdb->get_row($query);
|
546 |
+
|
547 |
+
if (($j + 1) % 2 == 0) {
|
548 |
+
$color = $bg;
|
549 |
+
$table_color = $calendar_bg;
|
550 |
+
}
|
551 |
+
else {
|
552 |
+
$color = $bg;
|
553 |
+
$table_color = $calendar_bg;
|
554 |
+
}
|
555 |
+
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color="";};
|
556 |
+
echo '<table style="border-spacing:0;height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
557 |
+
<tr>
|
558 |
+
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $calendar_bg . '">' . ($j + 1) . '</td>
|
559 |
+
<td>
|
560 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:15px;background:none;text-decoration:none;color:#' . $ev_title_color . '; "
|
561 |
+
href="' . add_query_arg(array(
|
562 |
+
'action' => 'spidercalendarbig',
|
563 |
+
'theme_id' => $theme_id,
|
564 |
+
'calendar_id' => $calendar_id,
|
565 |
+
'ev_ids' => $ev_ids_inline,
|
566 |
+
'eventID' => $ev_id[$j],
|
567 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . (int) $day,
|
568 |
+
'many_sp_calendar' => $many_sp_calendar,
|
569 |
+
'cur_page_url' => $path_sp_cal,
|
570 |
+
'widget' => $widget,
|
571 |
+
'TB_iframe' => 1,
|
572 |
+
'tbWidth' => $popup_width,
|
573 |
+
'tbHeight' => $popup_height,
|
574 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $ev_title[$j] . '</b>
|
575 |
+
</a>
|
576 |
+
</td>
|
577 |
+
</tr>
|
578 |
+
</table>';
|
579 |
+
}
|
580 |
+
}
|
581 |
+
}
|
582 |
+
echo '</td></tr></table>';
|
583 |
+
}
|
584 |
+
?>
|
585 |
+
</td>
|
586 |
+
</tr>
|
587 |
+
<tr style="height:<?php echo $year_font_size + 2; ?>px; font-family: <?php echo $font_year; ?>;">
|
588 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
589 |
+
echo add_query_arg(array(
|
590 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
591 |
+
'theme_id' => $theme_id,
|
592 |
+
'calendar' => $calendar_id,
|
593 |
+
'select' => $view_select,
|
594 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))). '-' . $day,
|
595 |
+
'many_sp_calendar' => $many_sp_calendar,
|
596 |
+
'cur_page_url' => $path_sp_cal,
|
597 |
+
'widget' => $widget,
|
598 |
+
'cat_id' => '',
|
599 |
+
'cat_ids' => $cat_ids,
|
600 |
+
'TB_iframe' => 1,
|
601 |
+
), admin_url('admin-ajax.php'));?>','<?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; ?>">
|
602 |
+
<?php echo ($year - 1); ?>
|
603 |
+
</td>
|
604 |
+
<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; ?>">
|
605 |
+
<?php echo $year; ?>
|
606 |
+
</td>
|
607 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
608 |
+
echo add_query_arg(array(
|
609 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
610 |
+
'theme_id' => $theme_id,
|
611 |
+
'calendar' => $calendar_id,
|
612 |
+
'select' => $view_select,
|
613 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month))). '-' . $day,
|
614 |
+
'many_sp_calendar' => $many_sp_calendar,
|
615 |
+
'cur_page_url' => $path_sp_cal,
|
616 |
+
'widget' => $widget,
|
617 |
+
'cat_id' => '',
|
618 |
+
'cat_ids' => $cat_ids,
|
619 |
+
'TB_iframe' => 1,
|
620 |
+
), admin_url('admin-ajax.php'));?>','<?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; ?>;color:<?php echo $year_font_color; ?>">
|
621 |
+
<?php echo ($year + 1); ?>
|
622 |
+
</td>
|
623 |
+
</tr>
|
624 |
+
</table>
|
625 |
+
<input type="text" value="1" name="day" style="display:none" />
|
626 |
+
</form>
|
627 |
+
</td>
|
628 |
+
</tr>
|
629 |
+
</table>
|
630 |
+
</div>
|
631 |
+
<style>
|
632 |
+
#calendar_<?php echo $many_sp_calendar; ?> table{
|
633 |
+
width: 100%;
|
634 |
+
}
|
635 |
+
.categories1 , .categories2
|
636 |
+
{
|
637 |
+
display:inline-block;
|
638 |
+
}
|
639 |
+
|
640 |
+
.categories2
|
641 |
+
{
|
642 |
+
position:relative;
|
643 |
+
left: -9px;
|
644 |
+
cursor:pointer;
|
645 |
+
}
|
646 |
+
.categories2:first-letter
|
647 |
+
{
|
648 |
+
color:#fff;
|
649 |
+
|
650 |
+
}
|
651 |
+
</style>
|
652 |
+
<?php
|
653 |
+
|
654 |
+
//reindex cat_ids_array
|
655 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
656 |
+
|
657 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
658 |
+
{
|
659 |
+
echo'
|
660 |
+
<style>
|
661 |
+
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
662 |
+
{
|
663 |
+
text-decoration:underline;
|
664 |
+
cursor:pointer;
|
665 |
+
|
666 |
+
}
|
667 |
+
|
668 |
+
</style>';
|
669 |
+
|
670 |
+
}
|
671 |
+
|
672 |
+
|
673 |
+
|
674 |
+
if($cat_ids=='')
|
675 |
+
$cat_ids='';
|
676 |
+
|
677 |
+
if($show_cat==1){
|
678 |
+
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none;">';
|
679 |
+
|
680 |
+
foreach($categories as $category)
|
681 |
+
{
|
682 |
+
|
683 |
+
?>
|
684 |
+
|
685 |
+
<li style="height:30px"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
686 |
+
'action' => 'spiderbigcalendar_day_widget',
|
687 |
+
'theme_id' => $theme_id,
|
688 |
+
'calendar' => $calendar_id,
|
689 |
+
'select' => $view_select,
|
690 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
|
691 |
+
'many_sp_calendar' => $many_sp_calendar,
|
692 |
+
'cur_page_url' => $path_sp_cal,
|
693 |
+
'cat_id' => $category->id,
|
694 |
+
'cat_ids' => $cat_ids,
|
695 |
+
'widget' => $widget,
|
696 |
+
'TB_iframe' => 1,
|
697 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
698 |
+
|
699 |
+
|
700 |
+
<?php
|
701 |
+
|
702 |
+
|
703 |
+
}
|
704 |
+
|
705 |
+
echo '</ul>';
|
706 |
+
}
|
707 |
+
die();
|
708 |
+
}
|
709 |
+
|
710 |
?>
|
front_end/bigcalendarlist.php
CHANGED
@@ -1,960 +1,962 @@
|
|
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'] : 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 |
-
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
-
|
13 |
-
///////////////////////////////////////////////////////////////////////////////////
|
14 |
-
|
15 |
-
|
16 |
-
if(isset($_GET['cat_id']))
|
17 |
-
$cat_id = $_GET['cat_id'];
|
18 |
-
else $cat_id = "";
|
19 |
-
|
20 |
-
if(isset($_GET['cat_ids']))
|
21 |
-
$cat_ids = $_GET['cat_ids'];
|
22 |
-
else $cat_ids = "";
|
23 |
-
|
24 |
-
|
25 |
-
if($cat_ids=='')
|
26 |
-
$cat_ids .= $cat_id.',';
|
27 |
-
else
|
28 |
-
$cat_ids .= ','.$cat_id.',';
|
29 |
-
|
30 |
-
|
31 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
32 |
-
|
33 |
-
|
34 |
-
function getelementcountinarray($array , $element)
|
35 |
-
{
|
36 |
-
$t=0;
|
37 |
-
|
38 |
-
for($i=0; $i<count($array); $i++)
|
39 |
-
{
|
40 |
-
if($element==$array[$i])
|
41 |
-
$t++;
|
42 |
-
|
43 |
-
}
|
44 |
-
|
45 |
-
|
46 |
-
return $t;
|
47 |
-
|
48 |
-
}
|
49 |
-
|
50 |
-
function getelementindexinarray($array , $element)
|
51 |
-
{
|
52 |
-
|
53 |
-
$t='';
|
54 |
-
|
55 |
-
for($i=0; $i<count($array); $i++)
|
56 |
-
{
|
57 |
-
if($element==$array[$i])
|
58 |
-
$t.=$i.',';
|
59 |
-
|
60 |
-
}
|
61 |
-
|
62 |
-
return $t;
|
63 |
-
|
64 |
-
|
65 |
-
}
|
66 |
-
$cat_ids_array = explode(',',$cat_ids);
|
67 |
-
|
68 |
-
if($cat_id!='')
|
69 |
-
{
|
70 |
-
|
71 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
72 |
-
{
|
73 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
74 |
-
$index_array = explode(',' , $index_in_line);
|
75 |
-
array_pop ($index_array);
|
76 |
-
for($j=0; $j<count($index_array); $j++)
|
77 |
-
unset($cat_ids_array[$index_array[$j]]);
|
78 |
-
$cat_ids = implode(',',$cat_ids_array);
|
79 |
-
}
|
80 |
-
}
|
81 |
-
else
|
82 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
83 |
-
|
84 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
85 |
-
|
86 |
-
|
87 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
88 |
-
$cal_width = $theme->width;
|
89 |
-
$
|
90 |
-
$
|
91 |
-
$
|
92 |
-
$
|
93 |
-
$
|
94 |
-
$
|
95 |
-
$
|
96 |
-
$
|
97 |
-
$
|
98 |
-
$
|
99 |
-
$
|
100 |
-
$
|
101 |
-
$
|
102 |
-
$
|
103 |
-
$
|
104 |
-
$
|
105 |
-
$
|
106 |
-
$
|
107 |
-
$
|
108 |
-
$
|
109 |
-
$
|
110 |
-
$
|
111 |
-
$
|
112 |
-
$
|
113 |
-
$
|
114 |
-
$
|
115 |
-
$
|
116 |
-
$
|
117 |
-
$
|
118 |
-
$
|
119 |
-
$
|
120 |
-
$
|
121 |
-
$
|
122 |
-
$
|
123 |
-
$
|
124 |
-
$
|
125 |
-
$
|
126 |
-
$
|
127 |
-
$
|
128 |
-
$
|
129 |
-
$
|
130 |
-
$
|
131 |
-
$
|
132 |
-
$
|
133 |
-
$
|
134 |
-
$
|
135 |
-
$
|
136 |
-
$
|
137 |
-
$
|
138 |
-
$
|
139 |
-
$
|
140 |
-
$
|
141 |
-
$
|
142 |
-
$
|
143 |
-
$
|
144 |
-
$
|
145 |
-
$
|
146 |
-
$
|
147 |
-
$
|
148 |
-
$
|
149 |
-
$
|
150 |
-
|
151 |
-
|
152 |
-
$
|
153 |
-
$
|
154 |
-
$
|
155 |
-
$
|
156 |
-
$
|
157 |
-
$
|
158 |
-
$
|
159 |
-
$
|
160 |
-
|
161 |
-
|
162 |
-
__('
|
163 |
-
__('
|
164 |
-
__('
|
165 |
-
__('
|
166 |
-
__('
|
167 |
-
__('
|
168 |
-
__('
|
169 |
-
__('
|
170 |
-
__('
|
171 |
-
__('
|
172 |
-
__('
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
$
|
186 |
-
|
187 |
-
|
188 |
-
$
|
189 |
-
$
|
190 |
-
|
191 |
-
|
192 |
-
$
|
193 |
-
$
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
$
|
199 |
-
$
|
200 |
-
|
201 |
-
|
202 |
-
$
|
203 |
-
$
|
204 |
-
|
205 |
-
$
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
#bigcalendar<?php echo $many_sp_calendar; ?>
|
221 |
-
#
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
border-top-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
#bigcalendar .cala_arrow a:
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a :
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
<?php echo
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
#bigcalendar .calbg
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
<?php echo
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
font-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
<?php echo
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
border:
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
#bigcalendar<?php echo $many_sp_calendar; ?>
|
343 |
-
#
|
344 |
-
#spiderCalendarTitlesList
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
border-top-
|
353 |
-
|
354 |
-
|
355 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
font-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
min-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
#bigcalendar<?php echo $many_sp_calendar; ?>
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
<div style="
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
'
|
485 |
-
'
|
486 |
-
'
|
487 |
-
'
|
488 |
-
'
|
489 |
-
'
|
490 |
-
|
491 |
-
'
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
'
|
500 |
-
'
|
501 |
-
'
|
502 |
-
'
|
503 |
-
'
|
504 |
-
'
|
505 |
-
'
|
506 |
-
|
507 |
-
'
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
'
|
516 |
-
'
|
517 |
-
'
|
518 |
-
'
|
519 |
-
'
|
520 |
-
'
|
521 |
-
|
522 |
-
'
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
'
|
531 |
-
'
|
532 |
-
'
|
533 |
-
'
|
534 |
-
'
|
535 |
-
'
|
536 |
-
|
537 |
-
'
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
<div
|
546 |
-
|
547 |
-
<?php if($view=='
|
548 |
-
<?php if($view=='
|
549 |
-
<?php if($view=='
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
<
|
554 |
-
<
|
555 |
-
|
556 |
-
|
557 |
-
'
|
558 |
-
'
|
559 |
-
'
|
560 |
-
'
|
561 |
-
'
|
562 |
-
'
|
563 |
-
|
564 |
-
'
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
</
|
569 |
-
</
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
'
|
575 |
-
'
|
576 |
-
'
|
577 |
-
'
|
578 |
-
'
|
579 |
-
'
|
580 |
-
'
|
581 |
-
|
582 |
-
'
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
</
|
587 |
-
</
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
'
|
593 |
-
'
|
594 |
-
'
|
595 |
-
'
|
596 |
-
'
|
597 |
-
'
|
598 |
-
|
599 |
-
'
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
</
|
604 |
-
</
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
'
|
610 |
-
'
|
611 |
-
'
|
612 |
-
'
|
613 |
-
'
|
614 |
-
'
|
615 |
-
|
616 |
-
'
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
</
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
'
|
643 |
-
'
|
644 |
-
'
|
645 |
-
'
|
646 |
-
'
|
647 |
-
'
|
648 |
-
|
649 |
-
'
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
'
|
666 |
-
'
|
667 |
-
'
|
668 |
-
'
|
669 |
-
'
|
670 |
-
'
|
671 |
-
|
672 |
-
'
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
<
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
'
|
692 |
-
'
|
693 |
-
'
|
694 |
-
'
|
695 |
-
'
|
696 |
-
'
|
697 |
-
|
698 |
-
'
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
'
|
708 |
-
'
|
709 |
-
'
|
710 |
-
'
|
711 |
-
'
|
712 |
-
'
|
713 |
-
|
714 |
-
'
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
$
|
741 |
-
$
|
742 |
-
$
|
743 |
-
$
|
744 |
-
$
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
$
|
750 |
-
$percent =
|
751 |
-
$
|
752 |
-
|
753 |
-
|
754 |
-
$
|
755 |
-
$
|
756 |
-
$
|
757 |
-
$
|
758 |
-
$
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
<td
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
<span style="font-size:' . $
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
$
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
" . $wpdb->prefix . "spidercalendar_event.
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
$
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
$
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
<td>
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
'
|
812 |
-
'
|
813 |
-
'
|
814 |
-
'
|
815 |
-
'
|
816 |
-
'
|
817 |
-
'
|
818 |
-
'
|
819 |
-
'
|
820 |
-
'
|
821 |
-
'
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
jQuery('#
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
'
|
940 |
-
'
|
941 |
-
'
|
942 |
-
'
|
943 |
-
'
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
}
|
959 |
-
|
|
|
|
|
960 |
?>
|
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'] : 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 |
+
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
+
|
13 |
+
///////////////////////////////////////////////////////////////////////////////////
|
14 |
+
|
15 |
+
|
16 |
+
if(isset($_GET['cat_id']))
|
17 |
+
$cat_id = $_GET['cat_id'];
|
18 |
+
else $cat_id = "";
|
19 |
+
|
20 |
+
if(isset($_GET['cat_ids']))
|
21 |
+
$cat_ids = $_GET['cat_ids'];
|
22 |
+
else $cat_ids = "";
|
23 |
+
|
24 |
+
|
25 |
+
if($cat_ids=='')
|
26 |
+
$cat_ids .= $cat_id.',';
|
27 |
+
else
|
28 |
+
$cat_ids .= ','.$cat_id.',';
|
29 |
+
|
30 |
+
|
31 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
32 |
+
|
33 |
+
|
34 |
+
function getelementcountinarray($array , $element)
|
35 |
+
{
|
36 |
+
$t=0;
|
37 |
+
|
38 |
+
for($i=0; $i<count($array); $i++)
|
39 |
+
{
|
40 |
+
if($element==$array[$i])
|
41 |
+
$t++;
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
return $t;
|
47 |
+
|
48 |
+
}
|
49 |
+
|
50 |
+
function getelementindexinarray($array , $element)
|
51 |
+
{
|
52 |
+
|
53 |
+
$t='';
|
54 |
+
|
55 |
+
for($i=0; $i<count($array); $i++)
|
56 |
+
{
|
57 |
+
if($element==$array[$i])
|
58 |
+
$t.=$i.',';
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
return $t;
|
63 |
+
|
64 |
+
|
65 |
+
}
|
66 |
+
$cat_ids_array = explode(',',$cat_ids);
|
67 |
+
|
68 |
+
if($cat_id!='')
|
69 |
+
{
|
70 |
+
|
71 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
72 |
+
{
|
73 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
74 |
+
$index_array = explode(',' , $index_in_line);
|
75 |
+
array_pop ($index_array);
|
76 |
+
for($j=0; $j<count($index_array); $j++)
|
77 |
+
unset($cat_ids_array[$index_array[$j]]);
|
78 |
+
$cat_ids = implode(',',$cat_ids_array);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
else
|
82 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
83 |
+
|
84 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
85 |
+
|
86 |
+
|
87 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
88 |
+
$cal_width = $theme->width;
|
89 |
+
$show_cat = 1;
|
90 |
+
$bg_top = '#' . $theme->bg_top;
|
91 |
+
$bg_bottom = '#' . $theme->bg_bottom;
|
92 |
+
$border_color = '#' . $theme->border_color;
|
93 |
+
$text_color_year = '#' . $theme->text_color_year;
|
94 |
+
$text_color_month = '#' . $theme->text_color_month;
|
95 |
+
$color_week_days = '#' . $theme->text_color_week_days;
|
96 |
+
$text_color_other_months = '#' . $theme->text_color_other_months;
|
97 |
+
$text_color_this_month_unevented = '#' . $theme->text_color_this_month_unevented;
|
98 |
+
$evented_color = '#' . $theme->text_color_this_month_evented;
|
99 |
+
$evented_color_bg = '#' . $theme->bg_color_this_month_evented;
|
100 |
+
$color_arrow_year = '#' . $theme->arrow_color_year;
|
101 |
+
$color_arrow_month = '#' . $theme->arrow_color_month;
|
102 |
+
$sun_days = '#' . $theme->text_color_sun_days;
|
103 |
+
$event_title_color = '#' . $theme->event_title_color;
|
104 |
+
$current_day_border_color = '#' . $theme->current_day_border_color;
|
105 |
+
$cell_border_color = '#' . $theme->cell_border_color;
|
106 |
+
$cell_height = $theme->cell_height;
|
107 |
+
$popup_width = $theme->popup_width;
|
108 |
+
$popup_height = $theme->popup_height;
|
109 |
+
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
110 |
+
$sundays_font_size = $theme->sundays_font_size;
|
111 |
+
$other_days_font_size = $theme->other_days_font_size;
|
112 |
+
$weekdays_font_size = $theme->weekdays_font_size;
|
113 |
+
$border_width = $theme->border_width;
|
114 |
+
$top_height = $theme->top_height;
|
115 |
+
$bg_color_other_months = '#' . $theme->bg_color_other_months;
|
116 |
+
$sundays_bg_color = '#' . $theme->sundays_bg_color;
|
117 |
+
$weekdays_bg_color = '#' . $theme->weekdays_bg_color;
|
118 |
+
$weekstart = $theme->week_start_day;
|
119 |
+
$weekday_sunday_bg_color = '#' . $theme->weekday_sunday_bg_color;
|
120 |
+
$border_radius = $theme->border_radius;
|
121 |
+
$border_radius2 = $border_radius-$border_width;
|
122 |
+
$week_days_cell_height = $theme->week_days_cell_height;
|
123 |
+
$year_font_size = $theme->year_font_size;
|
124 |
+
$month_font_size = $theme->month_font_size;
|
125 |
+
$arrow_size = $theme->arrow_size;
|
126 |
+
$arrow_size_hover = $arrow_size + 5;
|
127 |
+
$next_month_text_color = '#' . $theme->next_month_text_color;
|
128 |
+
$prev_month_text_color = '#' . $theme->prev_month_text_color;
|
129 |
+
$next_month_arrow_color = '#' . $theme->next_month_arrow_color;
|
130 |
+
$prev_month_arrow_color = '#' . $theme->prev_month_arrow_color;
|
131 |
+
$next_month_font_size = $theme->next_month_font_size;
|
132 |
+
$prev_month_font_size = $theme->prev_month_font_size;
|
133 |
+
$month_type = $theme->month_type;
|
134 |
+
$date_bg_color = '#' . $theme->date_bg_color;
|
135 |
+
$event_bg_color1 = '#' . $theme->event_bg_color1;
|
136 |
+
$event_bg_color2 = '#' . $theme->event_bg_color2;
|
137 |
+
$event_num_bg_color1 = '#' . $theme->event_num_bg_color1;
|
138 |
+
$event_num_bg_color2 = '#' . $theme->event_num_bg_color2;
|
139 |
+
$event_num_color = '#' . $theme->event_num_color;
|
140 |
+
$date_font_size = $theme->date_font_size;
|
141 |
+
$event_num_font_size = $theme->event_num_font_size;
|
142 |
+
$event_table_height = $theme->event_table_height;
|
143 |
+
$date_height = $theme->date_height;
|
144 |
+
$day_month_font_size = $theme->day_month_font_size;
|
145 |
+
$week_font_size = $theme->week_font_size;
|
146 |
+
$day_month_font_color = '#' . $theme->day_month_font_color;
|
147 |
+
$week_font_color = '#' . $theme->week_font_color;
|
148 |
+
$views_tabs_bg_color = '#' . $theme->views_tabs_bg_color;
|
149 |
+
$views_tabs_text_color = '#' . $theme->views_tabs_text_color;
|
150 |
+
$views_tabs_font_size = $theme->views_tabs_font_size;
|
151 |
+
|
152 |
+
$date_bg_color = '#' . $theme->date_bg_color;
|
153 |
+
$event_bg_color1 = '#' . $theme->event_bg_color1;
|
154 |
+
$event_bg_color2 = '#' . $theme->event_bg_color2;
|
155 |
+
$event_num_bg_color1 = '#' . $theme->event_num_bg_color1;
|
156 |
+
$event_num_bg_color2 = '#' . $theme->event_num_bg_color2;
|
157 |
+
$event_num_color = '#' . $theme->event_num_color;
|
158 |
+
$date_font_size = $theme->date_font_size;
|
159 |
+
$event_num_font_size = $theme->event_num_font_size;
|
160 |
+
$show_numbers_for_events = $theme->day_start;
|
161 |
+
|
162 |
+
__('January', 'sp_calendar');
|
163 |
+
__('February', 'sp_calendar');
|
164 |
+
__('March', 'sp_calendar');
|
165 |
+
__('April', 'sp_calendar');
|
166 |
+
__('May', 'sp_calendar');
|
167 |
+
__('June', 'sp_calendar');
|
168 |
+
__('July', 'sp_calendar');
|
169 |
+
__('August', 'sp_calendar');
|
170 |
+
__('September', 'sp_calendar');
|
171 |
+
__('October', 'sp_calendar');
|
172 |
+
__('November', 'sp_calendar');
|
173 |
+
__('December', 'sp_calendar');
|
174 |
+
if ($cell_height == '') {
|
175 |
+
$cell_height = 70;
|
176 |
+
}
|
177 |
+
if ($cal_width == '') {
|
178 |
+
$cal_width = 700;
|
179 |
+
}
|
180 |
+
|
181 |
+
if ($date != '') {
|
182 |
+
$date_REFERER = $date;
|
183 |
+
}
|
184 |
+
else {
|
185 |
+
$date_REFERER = date("Y-m");
|
186 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
187 |
+
}
|
188 |
+
$year_REFERER = substr($date_REFERER, 0, 4);
|
189 |
+
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
190 |
+
$day_REFERER = substr($date_REFERER, 8, 2);
|
191 |
+
|
192 |
+
$year = substr($date, 0, 4);
|
193 |
+
$month = Month_name(substr($date, 5, 2));
|
194 |
+
$day = substr($date, 8, 2);
|
195 |
+
|
196 |
+
$cell_width = $cal_width / 7;
|
197 |
+
|
198 |
+
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
199 |
+
$prev_month = add_0((int) $this_month - 1);
|
200 |
+
$next_month = add_0((int) $this_month + 1);
|
201 |
+
|
202 |
+
$view = 'bigcalendarlist';
|
203 |
+
$views = explode(',', $view_select);
|
204 |
+
$defaultview = 'list';
|
205 |
+
array_pop($views);
|
206 |
+
$display = '';
|
207 |
+
if (count($views) == 0) {
|
208 |
+
$display = "display:none";
|
209 |
+
}
|
210 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
211 |
+
$display = "display:none";
|
212 |
+
}
|
213 |
+
?>
|
214 |
+
<style type='text/css'>
|
215 |
+
.general_table table table:last-child .last_table:last-child td{
|
216 |
+
border-bottom-left-radius:<?php echo $border_radius2?>px;
|
217 |
+
|
218 |
+
}
|
219 |
+
|
220 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
221 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
222 |
+
#spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
223 |
+
border: none !important;
|
224 |
+
}
|
225 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . general_table {
|
226 |
+
border-radius: <?php echo $border_radius; ?>px !important;
|
227 |
+
}
|
228 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
229 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
230 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
231 |
+
}
|
232 |
+
|
233 |
+
|
234 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow a : link,
|
235 |
+
#bigcalendar .cala_arrow a:visited {
|
236 |
+
text-decoration: none !important;
|
237 |
+
background: none !important;
|
238 |
+
font-size: <?php echo $arrow_size; ?>px !important;
|
239 |
+
}
|
240 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow {
|
241 |
+
vertical-align: middle !important;
|
242 |
+
}
|
243 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow a : hover {
|
244 |
+
font-size: <?php echo $arrow_size_hover; ?>px !important;
|
245 |
+
text-decoration: none !important;
|
246 |
+
background: none !important;
|
247 |
+
}
|
248 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : link,
|
249 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : visited {
|
250 |
+
text-decoration: none !important;
|
251 |
+
background: none !important;
|
252 |
+
font-size: 12px !important;
|
253 |
+
color: red;
|
254 |
+
}
|
255 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : hover {
|
256 |
+
text-decoration: none !important;
|
257 |
+
background: none !important;
|
258 |
+
}
|
259 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day {
|
260 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
261 |
+
<?php echo 'vertical-align:top !important;'; ?>
|
262 |
+
}
|
263 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . weekdays {
|
264 |
+
vertical-align: middle !important;
|
265 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
266 |
+
}
|
267 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . week_days {
|
268 |
+
font-size: <?php echo $weekdays_font_size; ?>px !important;
|
269 |
+
}
|
270 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calyear_table {
|
271 |
+
border-spacing: 0 !important;
|
272 |
+
width: 100% !important;
|
273 |
+
}
|
274 |
+
. calyear_table table #bigcalendar<?php echo $many_sp_calendar; ?> . calmonth_table {
|
275 |
+
border-spacing: 0 !important;
|
276 |
+
width: 100% !important;
|
277 |
+
}
|
278 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calbg,
|
279 |
+
#bigcalendar .calbg td {
|
280 |
+
text-align: center !important;
|
281 |
+
width: 14% !important;
|
282 |
+
}
|
283 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . caltext_color_other_months {
|
284 |
+
color: <?php echo $text_color_other_months; ?> !important;
|
285 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
286 |
+
<?php echo 'vertical-align:top !important;'; ?>
|
287 |
+
}
|
288 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . caltext_color_this_month_unevented {
|
289 |
+
color: <?php echo $text_color_this_month_unevented; ?> !important;
|
290 |
+
}
|
291 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calfont_year {
|
292 |
+
font-size: 24px !important;
|
293 |
+
font-weight: bold !important;
|
294 |
+
color: <?php echo $text_color_year; ?> !important;
|
295 |
+
}
|
296 |
+
.general_table table, .general_table td, .general_table tr {
|
297 |
+
border: inherit !important;
|
298 |
+
vertical-align: initial !important;
|
299 |
+
border-collapse: inherit !important;
|
300 |
+
margin: inherit !important;
|
301 |
+
padding: inherit !important;
|
302 |
+
}
|
303 |
+
.general_table {
|
304 |
+
border-collapse: inherit !important;
|
305 |
+
margin: inherit !important;
|
306 |
+
}
|
307 |
+
.general_table p {
|
308 |
+
margin: inherit !important;
|
309 |
+
padding: inherit !important;
|
310 |
+
}
|
311 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calsun_days {
|
312 |
+
color: <?php echo $sun_days; ?> !important;
|
313 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
314 |
+
<?php echo 'vertical-align:top !important; text-align:left !important;'; ?>
|
315 |
+
background-color: <?php echo $sundays_bg_color; ?> !important;
|
316 |
+
}
|
317 |
+
#TB_window {
|
318 |
+
z-index: 10000;
|
319 |
+
}
|
320 |
+
|
321 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td {
|
322 |
+
vertical-align: middle !important;
|
323 |
+
}
|
324 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table {
|
325 |
+
border-collapse: initial;
|
326 |
+
border:0px;
|
327 |
+
max-width: none;
|
328 |
+
}
|
329 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table tr:hover td {
|
330 |
+
background: none;
|
331 |
+
}
|
332 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
333 |
+
padding: 0px;
|
334 |
+
vertical-align: none;
|
335 |
+
border-top:none;
|
336 |
+
line-height: none;
|
337 |
+
text-align: none;
|
338 |
+
}
|
339 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
340 |
+
margin-bottom:0;
|
341 |
+
}
|
342 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
343 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
344 |
+
#spiderCalendarTitlesList td,
|
345 |
+
#spiderCalendarTitlesList tr {
|
346 |
+
border:none;
|
347 |
+
}
|
348 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
349 |
+
border-radius: <?php echo $border_radius; ?>px;
|
350 |
+
}
|
351 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
352 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
353 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
354 |
+
}
|
355 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
356 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
357 |
+
text-decoration:none;
|
358 |
+
background:none;
|
359 |
+
font-size: <?php echo $arrow_size; ?>px;
|
360 |
+
}
|
361 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
362 |
+
text-decoration:none;
|
363 |
+
background:none;
|
364 |
+
}
|
365 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
366 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
367 |
+
text-decoration:none;
|
368 |
+
background:none;
|
369 |
+
font-size:12px;
|
370 |
+
color:red;
|
371 |
+
}
|
372 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
373 |
+
text-decoration:none;
|
374 |
+
background:none;
|
375 |
+
}
|
376 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
377 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
378 |
+
vertical-align:top;
|
379 |
+
}
|
380 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
381 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
382 |
+
}
|
383 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
384 |
+
font-size:<?php echo $weekdays_font_size; ?>px;
|
385 |
+
}
|
386 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
387 |
+
border-spacing:0;
|
388 |
+
width:100%;
|
389 |
+
}
|
390 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
391 |
+
border-spacing:0;
|
392 |
+
width:100%;
|
393 |
+
}
|
394 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
395 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
|
396 |
+
text-align:center;
|
397 |
+
width:14%;
|
398 |
+
}
|
399 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
400 |
+
color:<?php echo $text_color_other_months; ?>;
|
401 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
402 |
+
vertical-align:top;
|
403 |
+
}
|
404 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
405 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
406 |
+
}
|
407 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
408 |
+
font-size:24px;
|
409 |
+
font-weight:bold;
|
410 |
+
color:<?php echo $text_color_year; ?>;
|
411 |
+
}
|
412 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
413 |
+
color:<?php echo $sun_days; ?>;
|
414 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
415 |
+
vertical-align:top;
|
416 |
+
text-align:left;
|
417 |
+
background-color:<?php echo $sundays_bg_color; ?>;
|
418 |
+
}
|
419 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
420 |
+
float: right;
|
421 |
+
background-color: <?php echo $views_tabs_bg_color; ?>;
|
422 |
+
min-height: 25px;
|
423 |
+
min-width: 70px;
|
424 |
+
margin-right: 2px;
|
425 |
+
text-align: center;
|
426 |
+
cursor:pointer;
|
427 |
+
position: relative;
|
428 |
+
top: 5px;
|
429 |
+
}
|
430 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
431 |
+
padding: 7px;
|
432 |
+
}
|
433 |
+
|
434 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
435 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
436 |
+
{
|
437 |
+
|
438 |
+
background-color: <?php echo $views_tabs_bg_color?>;
|
439 |
+
width: 120px;
|
440 |
+
text-align: center;
|
441 |
+
cursor: pointer;
|
442 |
+
padding: 6px;
|
443 |
+
position: relative;
|
444 |
+
}
|
445 |
+
|
446 |
+
|
447 |
+
#drop_down_views
|
448 |
+
{
|
449 |
+
list-style-type:none !important;
|
450 |
+
position: absolute;
|
451 |
+
top: 46px;
|
452 |
+
left: -15px;
|
453 |
+
display:none;
|
454 |
+
z-index: 4545;
|
455 |
+
|
456 |
+
}
|
457 |
+
|
458 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
459 |
+
{
|
460 |
+
background:<?php echo $bg_top ?>;
|
461 |
+
}
|
462 |
+
|
463 |
+
#drop_down_views >li
|
464 |
+
{
|
465 |
+
border-bottom:1px solid #fff !important;
|
466 |
+
}
|
467 |
+
|
468 |
+
|
469 |
+
#views_tabs_select
|
470 |
+
{
|
471 |
+
display:none;
|
472 |
+
}
|
473 |
+
|
474 |
+
</style>
|
475 |
+
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
476 |
+
<div style="width:100%;">
|
477 |
+
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
478 |
+
<tr>
|
479 |
+
<td>
|
480 |
+
|
481 |
+
<div id="views_tabs" style="width: 100.4%;<?php echo $display; ?>">
|
482 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
483 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
484 |
+
'action' => 'spiderbigcalendar_day',
|
485 |
+
'theme_id' => $theme_id,
|
486 |
+
'calendar' => $calendar_id,
|
487 |
+
'select' => $view_select,
|
488 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
489 |
+
'many_sp_calendar' => $many_sp_calendar,
|
490 |
+
'cur_page_url' => $path_sp_cal,
|
491 |
+
'cat_id' => '',
|
492 |
+
'cat_ids' => $cat_ids,
|
493 |
+
'widget' => $widget,
|
494 |
+
'rand' => $many_sp_calendar,
|
495 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
496 |
+
</div>
|
497 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
498 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
499 |
+
'action' => 'spiderbigcalendar_week',
|
500 |
+
'theme_id' => $theme_id,
|
501 |
+
'calendar' => $calendar_id,
|
502 |
+
'select' => $view_select,
|
503 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
504 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
505 |
+
'many_sp_calendar' => $many_sp_calendar,
|
506 |
+
'cur_page_url' => $path_sp_cal,
|
507 |
+
'cat_id' => '',
|
508 |
+
'cat_ids' => $cat_ids,
|
509 |
+
'widget' => $widget,
|
510 |
+
'rand' => $many_sp_calendar,
|
511 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
512 |
+
</div>
|
513 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
514 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
515 |
+
'action' => 'spiderbigcalendar_list',
|
516 |
+
'theme_id' => $theme_id,
|
517 |
+
'calendar' => $calendar_id,
|
518 |
+
'select' => $view_select,
|
519 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
520 |
+
'many_sp_calendar' => $many_sp_calendar,
|
521 |
+
'cur_page_url' => $path_sp_cal,
|
522 |
+
'cat_id' => '',
|
523 |
+
'cat_ids' => $cat_ids,
|
524 |
+
'widget' => $widget,
|
525 |
+
'rand' => $many_sp_calendar,
|
526 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
527 |
+
</div>
|
528 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
529 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
530 |
+
'action' => 'spiderbigcalendar_month',
|
531 |
+
'theme_id' => $theme_id,
|
532 |
+
'calendar' => $calendar_id,
|
533 |
+
'select' => $view_select,
|
534 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
535 |
+
'many_sp_calendar' => $many_sp_calendar,
|
536 |
+
'cur_page_url' => $path_sp_cal,
|
537 |
+
'cat_id' => '',
|
538 |
+
'cat_ids' => $cat_ids,
|
539 |
+
'widget' => $widget,
|
540 |
+
'rand' => $many_sp_calendar,
|
541 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
542 |
+
</div>
|
543 |
+
</div>
|
544 |
+
|
545 |
+
<div id="views_tabs_select" style="display:none" >
|
546 |
+
<div id="views_select" style="background-color:<?php echo $bg_top?>;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
547 |
+
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
548 |
+
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
549 |
+
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
550 |
+
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
551 |
+
<span>►</span>
|
552 |
+
</div>
|
553 |
+
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
554 |
+
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
555 |
+
<div class="views_select"
|
556 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
557 |
+
'action' => 'spiderbigcalendar_month',
|
558 |
+
'theme_id' => $theme_id,
|
559 |
+
'calendar' => $calendar_id,
|
560 |
+
'select' => $view_select,
|
561 |
+
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
562 |
+
'many_sp_calendar' => $many_sp_calendar,
|
563 |
+
'cur_page_url' => $path_sp_cal,
|
564 |
+
'cat_id' => '',
|
565 |
+
'cat_ids' => $cat_ids,
|
566 |
+
'widget' => $widget,
|
567 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
568 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
569 |
+
</div>
|
570 |
+
</li>
|
571 |
+
|
572 |
+
<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"
|
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 |
+
'cur_page_url' => $path_sp_cal,
|
582 |
+
'cat_id' => '',
|
583 |
+
'cat_ids' => $cat_ids,
|
584 |
+
'widget' => $widget,
|
585 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
586 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
587 |
+
</div>
|
588 |
+
</li>
|
589 |
+
|
590 |
+
<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"
|
591 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
592 |
+
'action' => 'spiderbigcalendar_list',
|
593 |
+
'theme_id' => $theme_id,
|
594 |
+
'calendar' => $calendar_id,
|
595 |
+
'select' => $view_select,
|
596 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
597 |
+
'many_sp_calendar' => $many_sp_calendar,
|
598 |
+
'cur_page_url' => $path_sp_cal,
|
599 |
+
'cat_id' => '',
|
600 |
+
'cat_ids' => $cat_ids,
|
601 |
+
'widget' => $widget,
|
602 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
603 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
604 |
+
</div>
|
605 |
+
</li>
|
606 |
+
|
607 |
+
<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"
|
608 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
609 |
+
'action' => 'spiderbigcalendar_month',
|
610 |
+
'theme_id' => $theme_id,
|
611 |
+
'calendar' => $calendar_id,
|
612 |
+
'select' => $view_select,
|
613 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
614 |
+
'many_sp_calendar' => $many_sp_calendar,
|
615 |
+
'cur_page_url' => $path_sp_cal,
|
616 |
+
'cat_id' => '',
|
617 |
+
'cat_ids' => $cat_ids,
|
618 |
+
'widget' => $widget,
|
619 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
620 |
+
<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>
|
621 |
+
|
622 |
+
</ul>
|
623 |
+
</div>
|
624 |
+
</td>
|
625 |
+
</tr>
|
626 |
+
<tr>
|
627 |
+
<td>
|
628 |
+
<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; ?>;">
|
629 |
+
<tr>
|
630 |
+
<td width="100%" style=" padding:0; margin:0">
|
631 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100.3%">
|
632 |
+
<tr style="height:40px; width:100%;">
|
633 |
+
<td class="top_table" align="center" colspan="7" style="z-index: 5;position: relative;background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');padding:0; margin:0; background-color:<?php echo $bg_top ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%; " >
|
634 |
+
<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;">
|
635 |
+
<tr>
|
636 |
+
<td style="width:100%;vertical-align:center">
|
637 |
+
<table style="width:100%;">
|
638 |
+
<tr>
|
639 |
+
<td width="15%">
|
640 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
641 |
+
echo add_query_arg(array(
|
642 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
643 |
+
'theme_id' => $theme_id,
|
644 |
+
'calendar' => $calendar_id,
|
645 |
+
'select' => $view_select,
|
646 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
647 |
+
'many_sp_calendar' => $many_sp_calendar,
|
648 |
+
'cur_page_url' => $path_sp_cal,
|
649 |
+
'cat_id' => '',
|
650 |
+
'cat_ids' => $cat_ids,
|
651 |
+
'widget' => $widget,
|
652 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
653 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year-1; ?></span>
|
654 |
+
</div>
|
655 |
+
</td>
|
656 |
+
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
657 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
658 |
+
if (Month_num($month) == 1) {
|
659 |
+
$needed_date = ($year - 1) . '-12';
|
660 |
+
}
|
661 |
+
else {
|
662 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
663 |
+
}
|
664 |
+
echo add_query_arg(array(
|
665 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
666 |
+
'theme_id' => $theme_id,
|
667 |
+
'calendar' => $calendar_id,
|
668 |
+
'select' => $view_select,
|
669 |
+
'date' => $needed_date,
|
670 |
+
'many_sp_calendar' => $many_sp_calendar,
|
671 |
+
'cur_page_url' => $path_sp_cal,
|
672 |
+
'cat_id' => '',
|
673 |
+
'cat_ids' => $cat_ids,
|
674 |
+
'widget' => $widget,
|
675 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◀
|
676 |
+
</a>
|
677 |
+
</td>
|
678 |
+
<td style="text-align:center; margin:0;" width="40%">
|
679 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month?>"/>
|
680 |
+
<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 $year . ', ' . __($month, 'sp_calendar'); ?></span>
|
681 |
+
</td>
|
682 |
+
<td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
|
683 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
684 |
+
if (Month_num($month) == 12) {
|
685 |
+
$needed_date = ($year + 1) . '-01';
|
686 |
+
}
|
687 |
+
else {
|
688 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
689 |
+
}
|
690 |
+
echo add_query_arg(array(
|
691 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
692 |
+
'theme_id' => $theme_id,
|
693 |
+
'calendar' => $calendar_id,
|
694 |
+
'select' => $view_select,
|
695 |
+
'date' => $needed_date,
|
696 |
+
'many_sp_calendar' => $many_sp_calendar,
|
697 |
+
'cur_page_url' => $path_sp_cal,
|
698 |
+
'cat_id' => '',
|
699 |
+
'cat_ids' => $cat_ids,
|
700 |
+
'widget' => $widget,
|
701 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">▶
|
702 |
+
</a>
|
703 |
+
</td>
|
704 |
+
<td width="15%">
|
705 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
706 |
+
echo add_query_arg(array(
|
707 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
708 |
+
'theme_id' => $theme_id,
|
709 |
+
'calendar' => $calendar_id,
|
710 |
+
'select' => $view_select,
|
711 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
712 |
+
'many_sp_calendar' => $many_sp_calendar,
|
713 |
+
'cur_page_url' => $path_sp_cal,
|
714 |
+
'cat_id' => '',
|
715 |
+
'cat_ids' => $cat_ids,
|
716 |
+
'widget' => $widget,
|
717 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
718 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
|
719 |
+
</div>
|
720 |
+
</td>
|
721 |
+
</tr>
|
722 |
+
</table>
|
723 |
+
</td>
|
724 |
+
</tr>
|
725 |
+
</table>
|
726 |
+
</td>
|
727 |
+
|
728 |
+
</tr>
|
729 |
+
</tr>
|
730 |
+
<tr>
|
731 |
+
<td>
|
732 |
+
<?php
|
733 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
734 |
+
if ($weekstart == "su") {
|
735 |
+
$month_first_weekday++;
|
736 |
+
if ($month_first_weekday == 8) {
|
737 |
+
$month_first_weekday = 1;
|
738 |
+
}
|
739 |
+
}
|
740 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
741 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
742 |
+
$weekday_i = $month_first_weekday;
|
743 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
744 |
+
$percent = 1;
|
745 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
746 |
+
if ($sum % 7 <> 0) {
|
747 |
+
$percent = $percent + 1;
|
748 |
+
}
|
749 |
+
$sum = $sum - ($sum % 7);
|
750 |
+
$percent = $percent + ($sum / 7);
|
751 |
+
$percent = 107 / $percent;
|
752 |
+
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
753 |
+
|
754 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
755 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
756 |
+
$array_days = $all_calendar_files[0]['array_days'];
|
757 |
+
$array_days1 = $all_calendar_files[0]['array_days1'];
|
758 |
+
$title = $all_calendar_files[0]['title'];
|
759 |
+
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
760 |
+
|
761 |
+
|
762 |
+
sort($array_days, SORT_NUMERIC);
|
763 |
+
if (!$array_days) {
|
764 |
+
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '">
|
765 |
+
<tr>
|
766 |
+
<td style="padding-left:10px; font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ';color:' . $event_num_color . '"></td>
|
767 |
+
<td><p style="color:' . $event_title_color . '; border:none"> ' . __('There Is No Event In This Month', 'sp_calendar') . '</p></td>
|
768 |
+
</tr>
|
769 |
+
</table>';
|
770 |
+
}
|
771 |
+
for ($i = 0; $i < count($array_days); $i++) {
|
772 |
+
$week_day = date('D', mktime(0, 0, 0, Month_num($month), $array_days[$i], $year));
|
773 |
+
echo '<table style="width:100%;border-spacing:0;">
|
774 |
+
<tr>
|
775 |
+
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
|
776 |
+
<span style="padding-left:10px; font-size:' . $date_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
777 |
+
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . add_0($array_days[$i]) . ' ' . __($month,'sp_calendar') . ')</span>
|
778 |
+
</td>
|
779 |
+
</tr>
|
780 |
+
<tr>
|
781 |
+
<td>';
|
782 |
+
foreach ($title as $key => $value) {
|
783 |
+
if ($key == $array_days[$i]) {
|
784 |
+
$ev_id = explode('<br>', $ev_ids[$key]);
|
785 |
+
array_pop($ev_id);
|
786 |
+
$ev_ids_inline = implode(',', $ev_id);
|
787 |
+
$ev_title = explode('</p>', $value);
|
788 |
+
array_pop($ev_title);
|
789 |
+
for ($j = 0; $j < count($ev_title); $j++) {
|
790 |
+
$queryy = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
791 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
792 |
+
" . $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]);
|
793 |
+
|
794 |
+
$cat_color = $wpdb->get_row($queryy);
|
795 |
+
|
796 |
+
if (($j + 1) % 2 == 0) {
|
797 |
+
$color = $event_num_bg_color2;
|
798 |
+
$table_color = $event_bg_color2;
|
799 |
+
}
|
800 |
+
else {
|
801 |
+
$color = $event_num_bg_color1;
|
802 |
+
$table_color = $event_bg_color1;
|
803 |
+
}
|
804 |
+
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color="";};
|
805 |
+
echo '<table class="last_table" style="overflow:hidden;height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . ';">
|
806 |
+
<tr>
|
807 |
+
<td style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $event_num_color . '">' . (($show_numbers_for_events) ? ($j + 1) : '') . '</td>
|
808 |
+
<td>
|
809 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:13px;background:none;color:' . $event_title_color . ';"
|
810 |
+
href="' . add_query_arg(array(
|
811 |
+
'action' => 'spidercalendarbig',
|
812 |
+
'theme_id' => $theme_id,
|
813 |
+
'calendar_id' => $calendar_id,
|
814 |
+
'ev_ids' => $ev_ids_inline,
|
815 |
+
'eventID' => $ev_id[$j],
|
816 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $array_days[$i],
|
817 |
+
'many_sp_calendar' => $many_sp_calendar,
|
818 |
+
'cur_page_url' => $path_sp_cal,
|
819 |
+
'widget' => $widget,
|
820 |
+
'TB_iframe' => 1,
|
821 |
+
'tbWidth' => $popup_width,
|
822 |
+
'tbHeight' => $popup_height,
|
823 |
+
), admin_url('admin-ajax.php')) . '"><b>'.$ev_title[$j].'</b>
|
824 |
+
</a>
|
825 |
+
</td>
|
826 |
+
</tr>
|
827 |
+
</table>';
|
828 |
+
}
|
829 |
+
}
|
830 |
+
}
|
831 |
+
echo '</td></tr></table>';
|
832 |
+
}
|
833 |
+
?>
|
834 |
+
</td>
|
835 |
+
</tr>
|
836 |
+
</table>
|
837 |
+
</tr>
|
838 |
+
</table>
|
839 |
+
</td>
|
840 |
+
</tr>
|
841 |
+
</table>
|
842 |
+
|
843 |
+
<script>
|
844 |
+
|
845 |
+
jQuery(document).ready(function (){
|
846 |
+
|
847 |
+
jQuery('#views_select').click(function () {
|
848 |
+
jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
|
849 |
+
}, function () {
|
850 |
+
jQuery('#drop_down_views').stop(true, true).slideUp(500);
|
851 |
+
});
|
852 |
+
if(jQuery(window).width() > 640 )
|
853 |
+
{
|
854 |
+
jQuery('drop_down_views').hide();
|
855 |
+
}
|
856 |
+
});
|
857 |
+
</script>
|
858 |
+
|
859 |
+
|
860 |
+
<style>
|
861 |
+
|
862 |
+
@media only screen and (max-width : 640px) {
|
863 |
+
|
864 |
+
#views_tabs ,#drop_down_views
|
865 |
+
{
|
866 |
+
display:none;
|
867 |
+
}
|
868 |
+
|
869 |
+
#views_tabs_select
|
870 |
+
{
|
871 |
+
display:block !important;
|
872 |
+
}
|
873 |
+
|
874 |
+
|
875 |
+
|
876 |
+
}
|
877 |
+
|
878 |
+
@media only screen and (max-width : 968px) {
|
879 |
+
#cats >li
|
880 |
+
{
|
881 |
+
float:none;
|
882 |
+
}
|
883 |
+
|
884 |
+
|
885 |
+
|
886 |
+
}
|
887 |
+
.categories1 , .categories2
|
888 |
+
{
|
889 |
+
display:inline-block;
|
890 |
+
}
|
891 |
+
|
892 |
+
.categories2
|
893 |
+
{
|
894 |
+
position:relative;
|
895 |
+
left: -9px;
|
896 |
+
cursor:pointer;
|
897 |
+
}
|
898 |
+
.categories2:first-letter
|
899 |
+
{
|
900 |
+
color:#fff;
|
901 |
+
|
902 |
+
}
|
903 |
+
</style>
|
904 |
+
<?php
|
905 |
+
|
906 |
+
//reindex cat_ids_array
|
907 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
908 |
+
|
909 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
910 |
+
{
|
911 |
+
echo'
|
912 |
+
<style>
|
913 |
+
#cats #category'.$re_cat_ids_array[$i].'
|
914 |
+
{
|
915 |
+
text-decoration:underline;
|
916 |
+
cursor:pointer;
|
917 |
+
|
918 |
+
}
|
919 |
+
|
920 |
+
</style>';
|
921 |
+
|
922 |
+
}
|
923 |
+
|
924 |
+
|
925 |
+
|
926 |
+
if($cat_ids=='')
|
927 |
+
$cat_ids='';
|
928 |
+
|
929 |
+
if($show_cat==1)
|
930 |
+
{
|
931 |
+
echo '<ul id="cats" style="list-style-type:none;">';
|
932 |
+
|
933 |
+
foreach($categories as $category)
|
934 |
+
{
|
935 |
+
|
936 |
+
?>
|
937 |
+
|
938 |
+
<li style="float:left;"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
939 |
+
'action' => 'spiderbigcalendar_list',
|
940 |
+
'theme_id' => $theme_id,
|
941 |
+
'calendar' => $calendar_id,
|
942 |
+
'select' => $view_select,
|
943 |
+
'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
|
944 |
+
'many_sp_calendar' => $many_sp_calendar,
|
945 |
+
'cur_page_url' => $path_sp_cal,
|
946 |
+
'cat_id' => $category->id,
|
947 |
+
'cat_ids' => $cat_ids,
|
948 |
+
'widget' => $widget,
|
949 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
950 |
+
|
951 |
+
|
952 |
+
<?php
|
953 |
+
|
954 |
+
|
955 |
+
}
|
956 |
+
|
957 |
+
echo '</ul>';
|
958 |
+
}
|
959 |
+
|
960 |
+
die();
|
961 |
+
}
|
962 |
?>
|
front_end/bigcalendarlist_widget.php
CHANGED
@@ -1,667 +1,668 @@
|
|
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 |
-
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
-
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
-
|
13 |
-
///////////////////////////////////////////////////////////////////////////////////
|
14 |
-
|
15 |
-
if(isset($_GET['cat_id']))
|
16 |
-
$cat_id = $_GET['cat_id'];
|
17 |
-
else $cat_id = "";
|
18 |
-
|
19 |
-
if(isset($_GET['cat_ids']))
|
20 |
-
$cat_ids = $_GET['cat_ids'];
|
21 |
-
else $cat_ids = "";
|
22 |
-
|
23 |
-
if($cat_ids=='')
|
24 |
-
$cat_ids .= $cat_id.',';
|
25 |
-
else
|
26 |
-
$cat_ids .= ','.$cat_id.',';
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
31 |
-
|
32 |
-
|
33 |
-
function getelementcountinarray($array , $element)
|
34 |
-
{
|
35 |
-
$t=0;
|
36 |
-
|
37 |
-
for($i=0; $i<count($array); $i++)
|
38 |
-
{
|
39 |
-
if($element==$array[$i])
|
40 |
-
$t++;
|
41 |
-
|
42 |
-
}
|
43 |
-
|
44 |
-
|
45 |
-
return $t;
|
46 |
-
|
47 |
-
}
|
48 |
-
|
49 |
-
function getelementindexinarray($array , $element)
|
50 |
-
{
|
51 |
-
|
52 |
-
$t='';
|
53 |
-
|
54 |
-
for($i=0; $i<count($array); $i++)
|
55 |
-
{
|
56 |
-
if($element==$array[$i])
|
57 |
-
$t.=$i.',';
|
58 |
-
|
59 |
-
}
|
60 |
-
|
61 |
-
return $t;
|
62 |
-
|
63 |
-
|
64 |
-
}
|
65 |
-
$cat_ids_array = explode(',',$cat_ids);
|
66 |
-
|
67 |
-
|
68 |
-
if($cat_id!='')
|
69 |
-
{
|
70 |
-
|
71 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
72 |
-
{
|
73 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
74 |
-
$index_array = explode(',' , $index_in_line);
|
75 |
-
array_pop ($index_array);
|
76 |
-
for($j=0; $j<count($index_array); $j++)
|
77 |
-
unset($cat_ids_array[$index_array[$j]]);
|
78 |
-
$cat_ids = implode(',',$cat_ids_array);
|
79 |
-
}
|
80 |
-
}
|
81 |
-
else
|
82 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
83 |
-
|
84 |
-
|
85 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
86 |
-
|
87 |
-
|
88 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
89 |
-
$weekstart = $theme->week_start_day;
|
90 |
-
$bg = '#' . $theme->header_bgcolor;
|
91 |
-
$
|
92 |
-
$
|
93 |
-
$
|
94 |
-
$
|
95 |
-
$
|
96 |
-
$
|
97 |
-
$
|
98 |
-
$
|
99 |
-
$
|
100 |
-
$
|
101 |
-
$
|
102 |
-
$
|
103 |
-
$
|
104 |
-
$
|
105 |
-
$
|
106 |
-
$
|
107 |
-
$
|
108 |
-
$
|
109 |
-
$
|
110 |
-
$
|
111 |
-
$
|
112 |
-
$
|
113 |
-
$
|
114 |
-
$
|
115 |
-
$
|
116 |
-
$
|
117 |
-
|
118 |
-
|
119 |
-
__('
|
120 |
-
__('
|
121 |
-
__('
|
122 |
-
__('
|
123 |
-
__('
|
124 |
-
__('
|
125 |
-
__('
|
126 |
-
__('
|
127 |
-
__('
|
128 |
-
__('
|
129 |
-
__('
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
$
|
136 |
-
|
137 |
-
|
138 |
-
$
|
139 |
-
$
|
140 |
-
|
141 |
-
|
142 |
-
$
|
143 |
-
$
|
144 |
-
|
145 |
-
|
146 |
-
$
|
147 |
-
$
|
148 |
-
|
149 |
-
|
150 |
-
$cell_width =
|
151 |
-
|
152 |
-
|
153 |
-
$
|
154 |
-
$
|
155 |
-
|
156 |
-
$
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
border:
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
#calendar_<?php echo $many_sp_calendar; ?>
|
186 |
-
#
|
187 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?>
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
font-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
#calendar_<?php echo $many_sp_calendar; ?>
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
'
|
315 |
-
'
|
316 |
-
'
|
317 |
-
'
|
318 |
-
'
|
319 |
-
'
|
320 |
-
|
321 |
-
'
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
'
|
330 |
-
'
|
331 |
-
'
|
332 |
-
'
|
333 |
-
'
|
334 |
-
'
|
335 |
-
'
|
336 |
-
|
337 |
-
'
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
'
|
346 |
-
'
|
347 |
-
'
|
348 |
-
'
|
349 |
-
'
|
350 |
-
'
|
351 |
-
|
352 |
-
'
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
'
|
361 |
-
'
|
362 |
-
'
|
363 |
-
'
|
364 |
-
'
|
365 |
-
'
|
366 |
-
|
367 |
-
'
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
'
|
395 |
-
'
|
396 |
-
'
|
397 |
-
'
|
398 |
-
'
|
399 |
-
'
|
400 |
-
|
401 |
-
'
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
<
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
'
|
423 |
-
'
|
424 |
-
'
|
425 |
-
'
|
426 |
-
'
|
427 |
-
'
|
428 |
-
|
429 |
-
'
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
$
|
453 |
-
$
|
454 |
-
$
|
455 |
-
$
|
456 |
-
$
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
$
|
462 |
-
$percent =
|
463 |
-
$
|
464 |
-
$
|
465 |
-
$
|
466 |
-
$
|
467 |
-
$
|
468 |
-
$
|
469 |
-
$
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
<td
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
<span style="font-size:12px;color
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
$
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
" . $wpdb->prefix . "spidercalendar_event.
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
$
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
$
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
<td>
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
'
|
521 |
-
'
|
522 |
-
'
|
523 |
-
'
|
524 |
-
'
|
525 |
-
'
|
526 |
-
'
|
527 |
-
'
|
528 |
-
'
|
529 |
-
'
|
530 |
-
'
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
'
|
549 |
-
'
|
550 |
-
'
|
551 |
-
'
|
552 |
-
'
|
553 |
-
'
|
554 |
-
'
|
555 |
-
|
556 |
-
'
|
557 |
-
'
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
'
|
568 |
-
'
|
569 |
-
'
|
570 |
-
'
|
571 |
-
'
|
572 |
-
'
|
573 |
-
'
|
574 |
-
|
575 |
-
'
|
576 |
-
'
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
'
|
645 |
-
'
|
646 |
-
'
|
647 |
-
'
|
648 |
-
'
|
649 |
-
'
|
650 |
-
|
651 |
-
'
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
|
|
667 |
?>
|
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 |
+
$view_select = (isset($_GET['select']) ? esc_html($_GET['select']) : 'month,');
|
11 |
+
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
+
|
13 |
+
///////////////////////////////////////////////////////////////////////////////////
|
14 |
+
|
15 |
+
if(isset($_GET['cat_id']))
|
16 |
+
$cat_id = $_GET['cat_id'];
|
17 |
+
else $cat_id = "";
|
18 |
+
|
19 |
+
if(isset($_GET['cat_ids']))
|
20 |
+
$cat_ids = $_GET['cat_ids'];
|
21 |
+
else $cat_ids = "";
|
22 |
+
|
23 |
+
if($cat_ids=='')
|
24 |
+
$cat_ids .= $cat_id.',';
|
25 |
+
else
|
26 |
+
$cat_ids .= ','.$cat_id.',';
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
31 |
+
|
32 |
+
|
33 |
+
function getelementcountinarray($array , $element)
|
34 |
+
{
|
35 |
+
$t=0;
|
36 |
+
|
37 |
+
for($i=0; $i<count($array); $i++)
|
38 |
+
{
|
39 |
+
if($element==$array[$i])
|
40 |
+
$t++;
|
41 |
+
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
return $t;
|
46 |
+
|
47 |
+
}
|
48 |
+
|
49 |
+
function getelementindexinarray($array , $element)
|
50 |
+
{
|
51 |
+
|
52 |
+
$t='';
|
53 |
+
|
54 |
+
for($i=0; $i<count($array); $i++)
|
55 |
+
{
|
56 |
+
if($element==$array[$i])
|
57 |
+
$t.=$i.',';
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
return $t;
|
62 |
+
|
63 |
+
|
64 |
+
}
|
65 |
+
$cat_ids_array = explode(',',$cat_ids);
|
66 |
+
|
67 |
+
|
68 |
+
if($cat_id!='')
|
69 |
+
{
|
70 |
+
|
71 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
72 |
+
{
|
73 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
74 |
+
$index_array = explode(',' , $index_in_line);
|
75 |
+
array_pop ($index_array);
|
76 |
+
for($j=0; $j<count($index_array); $j++)
|
77 |
+
unset($cat_ids_array[$index_array[$j]]);
|
78 |
+
$cat_ids = implode(',',$cat_ids_array);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
else
|
82 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
83 |
+
|
84 |
+
|
85 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
86 |
+
|
87 |
+
|
88 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
89 |
+
$weekstart = $theme->week_start_day;
|
90 |
+
$bg = '#' . $theme->header_bgcolor;
|
91 |
+
$show_cat = 1;
|
92 |
+
$bg_color_selected = '#' . $theme->bg_color_selected;
|
93 |
+
$color_arrow = '#' . $theme->arrow_color;
|
94 |
+
$evented_color = '#' . $theme->text_color_this_month_evented;
|
95 |
+
$evented_color_bg = '#' . $theme->bg_color_this_month_evented;
|
96 |
+
$sun_days = '#' . $theme->text_color_sun_days;
|
97 |
+
$text_color_other_months = '#' . $theme->text_color_other_months;
|
98 |
+
$text_color_this_month_unevented = '#' . $theme->text_color_this_month_unevented;
|
99 |
+
$text_color_month = '#' . $theme->text_color_month;
|
100 |
+
$color_week_days = '#' . $theme->text_color_week_days;
|
101 |
+
$text_color_selected = '#' . $theme->text_color_selected;
|
102 |
+
$border_day = '#' . $theme->border_day;
|
103 |
+
$calendar_width = $theme->width;
|
104 |
+
$calendar_bg = '#' . $theme->footer_bgcolor;
|
105 |
+
$weekdays_bg_color = '#' . $theme->weekdays_bg_color;
|
106 |
+
$weekday_su_bg_color = '#' . $theme->su_bg_color;
|
107 |
+
$cell_border_color = '#' . $theme->cell_border_color;
|
108 |
+
$year_font_size = $theme->year_font_size;
|
109 |
+
$year_font_color = '#' . $theme->year_font_color;
|
110 |
+
$year_tabs_bg_color = '#' . $theme->year_tabs_bg_color;
|
111 |
+
$font_year = $theme->font_year;
|
112 |
+
$font_month = $theme->font_month;
|
113 |
+
$font_day = $theme->font_day;
|
114 |
+
$font_weekday = $theme->font_weekday;
|
115 |
+
$ev_title_color = $theme->ev_title_color;
|
116 |
+
$popup_width = $theme->popup_width;
|
117 |
+
$popup_height = $theme->popup_height;
|
118 |
+
|
119 |
+
__('January', 'sp_calendar');
|
120 |
+
__('February', 'sp_calendar');
|
121 |
+
__('March', 'sp_calendar');
|
122 |
+
__('April', 'sp_calendar');
|
123 |
+
__('May', 'sp_calendar');
|
124 |
+
__('June', 'sp_calendar');
|
125 |
+
__('July', 'sp_calendar');
|
126 |
+
__('August', 'sp_calendar');
|
127 |
+
__('September', 'sp_calendar');
|
128 |
+
__('October', 'sp_calendar');
|
129 |
+
__('November', 'sp_calendar');
|
130 |
+
__('December', 'sp_calendar');
|
131 |
+
if ($date != '') {
|
132 |
+
$date_REFERER = $date;
|
133 |
+
}
|
134 |
+
else {
|
135 |
+
$date_REFERER = date("Y-m");
|
136 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
137 |
+
}
|
138 |
+
$year_REFERER = substr($date_REFERER, 0, 4);
|
139 |
+
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
140 |
+
$day_REFERER = substr($date_REFERER, 8, 2);
|
141 |
+
|
142 |
+
$year = substr($date, 0, 4);
|
143 |
+
$month = Month_name(substr($date, 5, 2));
|
144 |
+
$day = substr($date, 8, 2);
|
145 |
+
|
146 |
+
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
147 |
+
$prev_month = add_0((int) $this_month - 1);
|
148 |
+
$next_month = add_0((int) $this_month + 1);
|
149 |
+
|
150 |
+
$cell_width = $calendar_width / 7;
|
151 |
+
$cell_width = (int) $cell_width - 2;
|
152 |
+
|
153 |
+
$view = 'bigcalendarlist_widget';
|
154 |
+
$views = explode(',', $view_select);
|
155 |
+
$defaultview = 'list';
|
156 |
+
array_pop($views);
|
157 |
+
$display = '';
|
158 |
+
if (count($views) == 0) {
|
159 |
+
$display = "display:none";
|
160 |
+
}
|
161 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
162 |
+
$display = "display:none";
|
163 |
+
}
|
164 |
+
?>
|
165 |
+
<style type='text/css'>
|
166 |
+
#calendar_<?php echo $many_sp_calendar; ?> table {
|
167 |
+
border-collapse: initial;
|
168 |
+
border:0px;
|
169 |
+
margin: 0;
|
170 |
+
}
|
171 |
+
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
172 |
+
padding: 0px;
|
173 |
+
vertical-align: none;
|
174 |
+
border-top:none;
|
175 |
+
line-height: none;
|
176 |
+
text-align: none;
|
177 |
+
}
|
178 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
179 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
180 |
+
font-family: <?php echo $font_day; ?>;
|
181 |
+
}
|
182 |
+
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
183 |
+
margin-bottom: 0;
|
184 |
+
}
|
185 |
+
#calendar_<?php echo $many_sp_calendar; ?> td,
|
186 |
+
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
187 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> td,
|
188 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> tr {
|
189 |
+
border:none;
|
190 |
+
}
|
191 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
192 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
193 |
+
color: <?php echo $color_arrow; ?>;
|
194 |
+
text-decoration: none;
|
195 |
+
background: none;
|
196 |
+
font-size: 16px;
|
197 |
+
}
|
198 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
199 |
+
color: <?php echo $color_arrow; ?>;
|
200 |
+
text-decoration:none;
|
201 |
+
background:none;
|
202 |
+
}
|
203 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
204 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
205 |
+
text-decoration:underline;
|
206 |
+
background:none;
|
207 |
+
font-size:11px;
|
208 |
+
}
|
209 |
+
#calendar_<?php echo $many_sp_calendar; ?> a {
|
210 |
+
font-weight: normal;
|
211 |
+
}
|
212 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
213 |
+
font-size:12px;
|
214 |
+
text-decoration:none;
|
215 |
+
background:none;
|
216 |
+
}
|
217 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
218 |
+
border-spacing:0;
|
219 |
+
width:100%;
|
220 |
+
}
|
221 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
222 |
+
border-spacing: 0;
|
223 |
+
vertical-align: middle;
|
224 |
+
width: 100%;
|
225 |
+
}
|
226 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
227 |
+
background-color:<?php echo $bg; ?>;
|
228 |
+
text-align:center;
|
229 |
+
vertical-align: middle;
|
230 |
+
}
|
231 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
232 |
+
color:<?php echo $text_color_other_months; ?>;
|
233 |
+
}
|
234 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
235 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
236 |
+
}
|
237 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calfont_year {
|
238 |
+
font-size:24px;
|
239 |
+
font-weight:bold;
|
240 |
+
color:<?php echo $year_font_color; ?>;
|
241 |
+
}
|
242 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
243 |
+
color:<?php echo $sun_days; ?>;
|
244 |
+
}
|
245 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
246 |
+
border: solid <?php echo $border_day; ?> 1px;
|
247 |
+
}
|
248 |
+
#TB_window {
|
249 |
+
z-index: 10000;
|
250 |
+
}
|
251 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
252 |
+
float: right;
|
253 |
+
background-color: <?php echo $calendar_bg; ?>;
|
254 |
+
height: 25px;
|
255 |
+
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
256 |
+
margin-left: 2px;
|
257 |
+
text-align: center;
|
258 |
+
cursor:pointer;
|
259 |
+
position: relative;
|
260 |
+
top: 3px;
|
261 |
+
font-family: <?php echo $font_month; ?>;
|
262 |
+
}
|
263 |
+
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
264 |
+
background: transparent !important;
|
265 |
+
}
|
266 |
+
|
267 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
268 |
+
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
269 |
+
{
|
270 |
+
|
271 |
+
background-color: <?php $views_tabs_bg_color?>;
|
272 |
+
width: 120px;
|
273 |
+
text-align: center;
|
274 |
+
cursor: pointer;
|
275 |
+
padding: 6px;
|
276 |
+
position: relative;
|
277 |
+
}
|
278 |
+
|
279 |
+
|
280 |
+
#drop_down_views
|
281 |
+
{
|
282 |
+
list-style-type:none !important;
|
283 |
+
position: absolute;
|
284 |
+
top: 46px;
|
285 |
+
left: -15px;
|
286 |
+
display:none;
|
287 |
+
z-index: 4545;
|
288 |
+
|
289 |
+
}
|
290 |
+
|
291 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
292 |
+
{
|
293 |
+
background:<?php echo $bg_top ?>;
|
294 |
+
}
|
295 |
+
|
296 |
+
#drop_down_views >li
|
297 |
+
{
|
298 |
+
border-bottom:1px solid #fff !important;
|
299 |
+
}
|
300 |
+
|
301 |
+
|
302 |
+
#views_tabs_select
|
303 |
+
{
|
304 |
+
display:none;
|
305 |
+
}
|
306 |
+
</style>
|
307 |
+
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
308 |
+
<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; ?>">
|
309 |
+
<tr style="background-color:#FFFFFF;">
|
310 |
+
<td style="background-color:#FFFFFF;">
|
311 |
+
<div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
|
312 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
313 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
314 |
+
'action' => 'spiderbigcalendar_day_widget',
|
315 |
+
'theme_id' => $theme_id,
|
316 |
+
'calendar' => $calendar_id,
|
317 |
+
'select' => $view_select,
|
318 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
319 |
+
'many_sp_calendar' => $many_sp_calendar,
|
320 |
+
'cur_page_url' => $path_sp_cal,
|
321 |
+
'cat_id' => '',
|
322 |
+
'cat_ids' => $cat_ids,
|
323 |
+
'widget' => $widget,
|
324 |
+
'TB_iframe' => 1,
|
325 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
326 |
+
</div>
|
327 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
328 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
329 |
+
'action' => 'spiderbigcalendar_week_widget',
|
330 |
+
'theme_id' => $theme_id,
|
331 |
+
'calendar' => $calendar_id,
|
332 |
+
'select' => $view_select,
|
333 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
334 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
335 |
+
'many_sp_calendar' => $many_sp_calendar,
|
336 |
+
'cur_page_url' => $path_sp_cal,
|
337 |
+
'cat_id' => '',
|
338 |
+
'cat_ids' => $cat_ids,
|
339 |
+
'widget' => $widget,
|
340 |
+
'TB_iframe' => 1,
|
341 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
342 |
+
</div>
|
343 |
+
<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 . ';height:28px;top:0;' ?>"
|
344 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
345 |
+
'action' => 'spiderbigcalendar_list_widget',
|
346 |
+
'theme_id' => $theme_id,
|
347 |
+
'calendar' => $calendar_id,
|
348 |
+
'select' => $view_select,
|
349 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
350 |
+
'many_sp_calendar' => $many_sp_calendar,
|
351 |
+
'cur_page_url' => $path_sp_cal,
|
352 |
+
'cat_id' => '',
|
353 |
+
'cat_ids' => $cat_ids,
|
354 |
+
'widget' => $widget,
|
355 |
+
'TB_iframe' => 1,
|
356 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
357 |
+
</div>
|
358 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
359 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
360 |
+
'action' => 'spiderbigcalendar_month_widget',
|
361 |
+
'theme_id' => $theme_id,
|
362 |
+
'calendar' => $calendar_id,
|
363 |
+
'select' => $view_select,
|
364 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
365 |
+
'many_sp_calendar' => $many_sp_calendar,
|
366 |
+
'cur_page_url' => $path_sp_cal,
|
367 |
+
'cat_id' => '',
|
368 |
+
'cat_ids' => $cat_ids,
|
369 |
+
'widget' => $widget,
|
370 |
+
'TB_iframe' => 1,
|
371 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
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; ?>">
|
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 |
+
'cur_page_url' => $path_sp_cal,
|
401 |
+
'cat_id' => '',
|
402 |
+
'cat_ids' => $cat_ids,
|
403 |
+
'widget' => $widget,
|
404 |
+
'TB_iframe' => 1,
|
405 |
+
), admin_url('admin-ajax.php'));
|
406 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◄
|
407 |
+
</a>
|
408 |
+
</td>
|
409 |
+
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
410 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
411 |
+
<span style="font-size:<?php echo $year_font_size; ?>px;?>; color:<?php echo $text_color_month; ?>;"><?php echo __($month, 'sp_calendar'); ?></span>
|
412 |
+
</td>
|
413 |
+
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
414 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
415 |
+
if (Month_num($month) == 12) {
|
416 |
+
$needed_date = ($year + 1) . '-01';
|
417 |
+
}
|
418 |
+
else {
|
419 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
420 |
+
}
|
421 |
+
echo add_query_arg(array(
|
422 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
423 |
+
'theme_id' => $theme_id,
|
424 |
+
'calendar' => $calendar_id,
|
425 |
+
'select' => $view_select,
|
426 |
+
'date' => $needed_date,
|
427 |
+
'many_sp_calendar' => $many_sp_calendar,
|
428 |
+
'cur_page_url' => $path_sp_cal,
|
429 |
+
'cat_id' => '',
|
430 |
+
'cat_ids' => $cat_ids,
|
431 |
+
'widget' => $widget,
|
432 |
+
'TB_iframe' => 1,
|
433 |
+
), admin_url('admin-ajax.php'));
|
434 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">►
|
435 |
+
</a>
|
436 |
+
</td>
|
437 |
+
</tr>
|
438 |
+
</table>
|
439 |
+
</td>
|
440 |
+
</tr>
|
441 |
+
|
442 |
+
<tr>
|
443 |
+
<td colspan="7">
|
444 |
+
<?php
|
445 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
446 |
+
if ($weekstart == "su") {
|
447 |
+
$month_first_weekday++;
|
448 |
+
if ($month_first_weekday == 8) {
|
449 |
+
$month_first_weekday = 1;
|
450 |
+
}
|
451 |
+
}
|
452 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
453 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
454 |
+
$weekday_i = $month_first_weekday;
|
455 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
456 |
+
$percent = 1;
|
457 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
458 |
+
if ($sum % 7 <> 0) {
|
459 |
+
$percent = $percent + 1;
|
460 |
+
}
|
461 |
+
$sum = $sum - ($sum % 7);
|
462 |
+
$percent = $percent + ($sum / 7);
|
463 |
+
$percent = 107 / $percent;
|
464 |
+
$all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
|
465 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
466 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
467 |
+
$array_days = $all_calendar_files[0]['array_days'];
|
468 |
+
$array_days1 = $all_calendar_files[0]['array_days1'];
|
469 |
+
$title = $all_calendar_files[0]['title'];
|
470 |
+
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
471 |
+
sort($array_days, SORT_NUMERIC);
|
472 |
+
if (!$array_days) {
|
473 |
+
echo '<table style="height:14px;border-spacing:0;border-spacing:0;width: 100%;background-color:#D6D4D5;">
|
474 |
+
<tr>
|
475 |
+
<td style="padding-left:10px; font-size:12px;font-weight:bold;width:10px;text-align:center;background-color:' . $bg . ';color:#949394;"></td>
|
476 |
+
<td><p style="font-size:12px;color:' . $bg . '; border:none"> ' . __('There Is No Event In This Month', 'sp_calendar') . '</p></td>
|
477 |
+
</tr>
|
478 |
+
</table>';
|
479 |
+
}
|
480 |
+
for ($i = 0; $i < count($array_days); $i++) {
|
481 |
+
$week_day = date('D', mktime(0, 0, 0, Month_num($month), $array_days[$i], $year));
|
482 |
+
echo '<table style="width:100%; border-spacing:0;">
|
483 |
+
<tr>
|
484 |
+
<td style="height:14px;font-size:12px; padding-left:10px;background-color:#D6D4D5; color:#6E7276">
|
485 |
+
<span style="padding-left:10px; font-size:12px;color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
|
486 |
+
<span style="font-size:12px;color:#949394;">(' . add_0($array_days[$i]) . ' ' . __($month,'sp_calendar') . ')</span>
|
487 |
+
</td>
|
488 |
+
</tr>
|
489 |
+
<tr>
|
490 |
+
<td>';
|
491 |
+
foreach ($title as $key => $value) {
|
492 |
+
if ($key == $array_days[$i]) {
|
493 |
+
$ev_id = explode('<br>', $ev_ids[$key]);
|
494 |
+
array_pop($ev_id);
|
495 |
+
$ev_ids_inline = implode(',', $ev_id);
|
496 |
+
$ev_title = explode('</p>', $value);
|
497 |
+
array_pop($ev_title);
|
498 |
+
for ($j = 0; $j < count($ev_title); $j++) {
|
499 |
+
$queryy = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
500 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
501 |
+
" . $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]);
|
502 |
+
|
503 |
+
$cat_color = $wpdb->get_row($queryy);
|
504 |
+
|
505 |
+
if (($j + 1) % 2 == 0) {
|
506 |
+
$color = $bg;
|
507 |
+
$table_color = $calendar_bg;
|
508 |
+
}
|
509 |
+
else {
|
510 |
+
$color = $bg;
|
511 |
+
$table_color = $calendar_bg;
|
512 |
+
}
|
513 |
+
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color="";};
|
514 |
+
echo '<table class="last_table" style="overflow:hidden;height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
515 |
+
<tr>
|
516 |
+
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $calendar_bg . '">' . ($j +1 ) . '</td>
|
517 |
+
<td>
|
518 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:13px;background:none;color:#' . $ev_title_color . ';"
|
519 |
+
href="' . add_query_arg(array(
|
520 |
+
'action' => 'spidercalendarbig',
|
521 |
+
'theme_id' => $theme_id,
|
522 |
+
'calendar_id' => $calendar_id,
|
523 |
+
'ev_ids' => $ev_ids_inline,
|
524 |
+
'eventID' => $ev_id[$j],
|
525 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $array_days[$i],
|
526 |
+
'many_sp_calendar' => $many_sp_calendar,
|
527 |
+
'cur_page_url' => $path_sp_cal,
|
528 |
+
'widget' => $widget,
|
529 |
+
'TB_iframe' => 1,
|
530 |
+
'tbWidth' => $popup_width,
|
531 |
+
'tbHeight' => $popup_height,
|
532 |
+
), admin_url('admin-ajax.php')) . '"><b>'.$ev_title[$j].'</b>
|
533 |
+
</a>
|
534 |
+
</td>
|
535 |
+
</tr>
|
536 |
+
</table>';
|
537 |
+
}
|
538 |
+
}
|
539 |
+
}
|
540 |
+
echo '</td></tr></table>';
|
541 |
+
}
|
542 |
+
?>
|
543 |
+
</td>
|
544 |
+
</tr>
|
545 |
+
<tr style="height:<?php echo $year_font_size + 2; ?>px; font-family: <?php echo $font_year; ?>;">
|
546 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
547 |
+
echo add_query_arg(array(
|
548 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
549 |
+
'theme_id' => $theme_id,
|
550 |
+
'calendar' => $calendar_id,
|
551 |
+
'select' => $view_select,
|
552 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
553 |
+
'many_sp_calendar' => $many_sp_calendar,
|
554 |
+
'cur_page_url' => $path_sp_cal,
|
555 |
+
'widget' => $widget,
|
556 |
+
'cat_id' => '',
|
557 |
+
'cat_ids' => $cat_ids,
|
558 |
+
'TB_iframe' => 1,
|
559 |
+
), admin_url('admin-ajax.php'));?>','<?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; ?>">
|
560 |
+
<?php echo ($year - 1); ?>
|
561 |
+
</td>
|
562 |
+
<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; ?>">
|
563 |
+
<?php echo $year; ?>
|
564 |
+
</td>
|
565 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
566 |
+
echo add_query_arg(array(
|
567 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
568 |
+
'theme_id' => $theme_id,
|
569 |
+
'calendar' => $calendar_id,
|
570 |
+
'select' => $view_select,
|
571 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
572 |
+
'many_sp_calendar' => $many_sp_calendar,
|
573 |
+
'cur_page_url' => $path_sp_cal,
|
574 |
+
'widget' => $widget,
|
575 |
+
'cat_id' => '',
|
576 |
+
'cat_ids' => $cat_ids,
|
577 |
+
'TB_iframe' => 1,
|
578 |
+
), admin_url('admin-ajax.php'));?>','<?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; ?>;color:<?php echo $year_font_color; ?>">
|
579 |
+
<?php echo ($year + 1); ?>
|
580 |
+
</td>
|
581 |
+
</tr>
|
582 |
+
</table>
|
583 |
+
<input type="text" value="1" name="day" style="display:none" />
|
584 |
+
</form>
|
585 |
+
</td>
|
586 |
+
</tr>
|
587 |
+
</table>
|
588 |
+
</div>
|
589 |
+
<style>
|
590 |
+
#calendar_<?php echo $many_sp_calendar; ?> table{
|
591 |
+
width: 100%;
|
592 |
+
}
|
593 |
+
.categories1 , .categories2
|
594 |
+
{
|
595 |
+
display:inline-block;
|
596 |
+
}
|
597 |
+
|
598 |
+
.categories2
|
599 |
+
{
|
600 |
+
position:relative;
|
601 |
+
left: -9px;
|
602 |
+
cursor:pointer;
|
603 |
+
}
|
604 |
+
.categories2:first-letter
|
605 |
+
{
|
606 |
+
color:#fff;
|
607 |
+
|
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 |
+
|
635 |
+
if($show_cat==1){
|
636 |
+
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none;">';
|
637 |
+
|
638 |
+
foreach($categories as $category)
|
639 |
+
{
|
640 |
+
|
641 |
+
?>
|
642 |
+
|
643 |
+
<li style="height:30px"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
644 |
+
'action' => 'spiderbigcalendar_list_widget',
|
645 |
+
'theme_id' => $theme_id,
|
646 |
+
'calendar' => $calendar_id,
|
647 |
+
'select' => $view_select,
|
648 |
+
'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
|
649 |
+
'many_sp_calendar' => $many_sp_calendar,
|
650 |
+
'cur_page_url' => $path_sp_cal,
|
651 |
+
'cat_id' => $category->id,
|
652 |
+
'cat_ids' => $cat_ids,
|
653 |
+
'widget' => $widget,
|
654 |
+
'TB_iframe' => 1,
|
655 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
656 |
+
|
657 |
+
|
658 |
+
<?php
|
659 |
+
|
660 |
+
|
661 |
+
}
|
662 |
+
|
663 |
+
echo '</ul>';
|
664 |
+
}
|
665 |
+
die();
|
666 |
+
}
|
667 |
+
|
668 |
?>
|
front_end/bigcalendarmonth.php
CHANGED
@@ -1,1298 +1,1298 @@
|
|
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'] : 13);
|
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 |
-
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where id=".$calendar_id."";
|
13 |
-
$calendar = $wpdb->query($query);
|
14 |
-
|
15 |
-
|
16 |
-
///////////////////////////////////////////////////////////////////////////////////
|
17 |
-
|
18 |
-
if(isset($_GET['cat_id']))
|
19 |
-
$cat_id = $_GET['cat_id'];
|
20 |
-
else $cat_id = "";
|
21 |
-
|
22 |
-
if(isset($_GET['cat_ids']))
|
23 |
-
$cat_ids = $_GET['cat_ids'];
|
24 |
-
else $cat_ids = "";
|
25 |
-
|
26 |
-
|
27 |
-
if($cat_ids=='')
|
28 |
-
$cat_ids .= $cat_id.',';
|
29 |
-
else
|
30 |
-
$cat_ids .= ','.$cat_id.',';
|
31 |
-
|
32 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
33 |
-
|
34 |
-
|
35 |
-
function getelementcountinarray($array , $element)
|
36 |
-
{
|
37 |
-
$t=0;
|
38 |
-
|
39 |
-
for($i=0; $i<count($array); $i++)
|
40 |
-
{
|
41 |
-
if($element==$array[$i])
|
42 |
-
$t++;
|
43 |
-
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
return $t;
|
48 |
-
|
49 |
-
}
|
50 |
-
|
51 |
-
function getelementindexinarray($array , $element)
|
52 |
-
{
|
53 |
-
|
54 |
-
$t='';
|
55 |
-
|
56 |
-
for($i=0; $i<count($array); $i++)
|
57 |
-
{
|
58 |
-
if($element==$array[$i])
|
59 |
-
$t.=$i.',';
|
60 |
-
|
61 |
-
}
|
62 |
-
|
63 |
-
return $t;
|
64 |
-
|
65 |
-
|
66 |
-
}
|
67 |
-
$cat_ids_array = explode(',',$cat_ids);
|
68 |
-
|
69 |
-
|
70 |
-
if($cat_id!='')
|
71 |
-
{
|
72 |
-
|
73 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
74 |
-
{
|
75 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
76 |
-
$index_array = explode(',' , $index_in_line);
|
77 |
-
array_pop ($index_array);
|
78 |
-
for($j=0; $j<count($index_array); $j++)
|
79 |
-
unset($cat_ids_array[$index_array[$j]]);
|
80 |
-
$cat_ids = implode(',',$cat_ids_array);
|
81 |
-
}
|
82 |
-
}
|
83 |
-
else
|
84 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
85 |
-
|
86 |
-
|
87 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
96 |
-
$cal_width = $theme->width;
|
97 |
-
$bg_top = '#' . $theme->bg_top;
|
98 |
-
$bg_bottom = '#' . $theme->bg_bottom;
|
99 |
-
$border_color = '#' . $theme->border_color;
|
100 |
-
$text_color_year = '#' . $theme->text_color_year;
|
101 |
-
$text_color_month = '#' . $theme->text_color_month;
|
102 |
-
$color_week_days = '#' . $theme->text_color_week_days;
|
103 |
-
$text_color_other_months = '#' . $theme->text_color_other_months;
|
104 |
-
$text_color_this_month_unevented = '#' . $theme->text_color_this_month_unevented;
|
105 |
-
$evented_color = '#' . $theme->text_color_this_month_evented;
|
106 |
-
$evented_color_bg = '#' . $theme->bg_color_this_month_evented;
|
107 |
-
$color_arrow_year = '#' . $theme->arrow_color_year;
|
108 |
-
$color_arrow_month = '#' . $theme->arrow_color_month;
|
109 |
-
$sun_days = '#' . $theme->text_color_sun_days;
|
110 |
-
$event_title_color = '#' . $theme->event_title_color;
|
111 |
-
$current_day_border_color = '#' . $theme->current_day_border_color;
|
112 |
-
$cell_border_color = '#' . $theme->cell_border_color;
|
113 |
-
$cell_height = $theme->cell_height;
|
114 |
-
$popup_width = $theme->popup_width;
|
115 |
-
$popup_height = $theme->popup_height;
|
116 |
-
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
117 |
-
$sundays_font_size = $theme->sundays_font_size;
|
118 |
-
$other_days_font_size = $theme->other_days_font_size;
|
119 |
-
$weekdays_font_size = $theme->weekdays_font_size;
|
120 |
-
$border_width = $theme->border_width;
|
121 |
-
$top_height = $theme->top_height;
|
122 |
-
$bg_color_other_months = '#' . $theme->bg_color_other_months;
|
123 |
-
$sundays_bg_color = '#' . $theme->sundays_bg_color;
|
124 |
-
$weekdays_bg_color = '#' . $theme->weekdays_bg_color;
|
125 |
-
$weekstart = $theme->week_start_day;
|
126 |
-
$weekday_sunday_bg_color = '#' . $theme->weekday_sunday_bg_color;
|
127 |
-
$border_radius = $theme->border_radius;
|
128 |
-
$border_radius2 = $border_radius-$border_width;
|
129 |
-
$week_days_cell_height = $theme->week_days_cell_height;
|
130 |
-
$year_font_size = $theme->year_font_size;
|
131 |
-
$month_font_size = $theme->month_font_size;
|
132 |
-
$arrow_size = $theme->arrow_size;
|
133 |
-
$arrow_size_hover = $arrow_size + 5;
|
134 |
-
$next_month_text_color = '#' . $theme->next_month_text_color;
|
135 |
-
$prev_month_text_color = '#' . $theme->prev_month_text_color;
|
136 |
-
$next_month_arrow_color = '#' . $theme->next_month_arrow_color;
|
137 |
-
$prev_month_arrow_color = '#' . $theme->prev_month_arrow_color;
|
138 |
-
$next_month_font_size = $theme->next_month_font_size;
|
139 |
-
$prev_month_font_size = $theme->prev_month_font_size;
|
140 |
-
$month_type = $theme->month_type;
|
141 |
-
$ev_title_bg_color = '#'.$theme->ev_title_bg_color;
|
142 |
-
|
143 |
-
$date_bg_color = '#' . $theme->date_bg_color;
|
144 |
-
$event_bg_color1 = '#' . $theme->event_bg_color1;
|
145 |
-
$event_bg_color2 = '#' . $theme->event_bg_color2;
|
146 |
-
$event_num_bg_color1 = '#' . $theme->event_num_bg_color1;
|
147 |
-
$event_num_bg_color2 = '#' . $theme->event_num_bg_color2;
|
148 |
-
$event_num_color = '#' . $theme->event_num_color;
|
149 |
-
$date_font_size = $theme->date_font_size;
|
150 |
-
$event_num_font_size = $theme->event_num_font_size;
|
151 |
-
$event_table_height = $theme->event_table_height;
|
152 |
-
$date_height = $theme->date_height;
|
153 |
-
$day_month_font_size = $theme->day_month_font_size;
|
154 |
-
$week_font_size = $theme->week_font_size;
|
155 |
-
$day_month_font_color = '#' . $theme->day_month_font_color;
|
156 |
-
$week_font_color = '#' . $theme->week_font_color;
|
157 |
-
$views_tabs_bg_color = '#' . $theme->views_tabs_bg_color;
|
158 |
-
$views_tabs_text_color = '#' . $theme->views_tabs_text_color;
|
159 |
-
$views_tabs_font_size = $theme->views_tabs_font_size;
|
160 |
-
$show_numbers_for_events = $theme->day_start;
|
161 |
-
$ev_color = $theme->event_title_color;
|
162 |
-
|
163 |
-
__('January', 'sp_calendar');
|
164 |
-
__('February', 'sp_calendar');
|
165 |
-
__('March', 'sp_calendar');
|
166 |
-
__('April', 'sp_calendar');
|
167 |
-
__('May', 'sp_calendar');
|
168 |
-
__('June', 'sp_calendar');
|
169 |
-
__('July', 'sp_calendar');
|
170 |
-
__('August', 'sp_calendar');
|
171 |
-
__('September', 'sp_calendar');
|
172 |
-
__('October', 'sp_calendar');
|
173 |
-
__('November', 'sp_calendar');
|
174 |
-
__('December', 'sp_calendar');
|
175 |
-
if ($cell_height == '') {
|
176 |
-
$cell_height = 70;
|
177 |
-
}
|
178 |
-
if ($cal_width == '') {
|
179 |
-
$cal_width = 700;
|
180 |
-
}
|
181 |
-
if ($date != '') {
|
182 |
-
$date_REFERER = $date;
|
183 |
-
}
|
184 |
-
else {
|
185 |
-
$date_REFERER = date("Y-m");
|
186 |
-
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
187 |
-
}
|
188 |
-
|
189 |
-
$year_REFERER = substr($date_REFERER, 0, 4);
|
190 |
-
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
191 |
-
$day_REFERER = substr($date_REFERER, 8, 2);
|
192 |
-
|
193 |
-
$year = substr($date, 0, 4);
|
194 |
-
$month = Month_name(substr($date, 5, 2));
|
195 |
-
$day = substr($date, 8, 2);
|
196 |
-
|
197 |
-
$cell_width = $cal_width / 7;
|
198 |
-
$cell_width = (int) $cell_width - 2;
|
199 |
-
|
200 |
-
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
201 |
-
$prev_month = add_0((int) $this_month - 1);
|
202 |
-
$next_month = add_0((int) $this_month + 1);
|
203 |
-
|
204 |
-
$view = 'bigcalendarmonth';
|
205 |
-
$views = explode(',', $view_select);
|
206 |
-
$defaultview = 'month';
|
207 |
-
array_pop($views);
|
208 |
-
|
209 |
-
$display='';
|
210 |
-
|
211 |
-
if(count($views)==0)
|
212 |
-
{
|
213 |
-
$display="display:none";
|
214 |
-
echo '<style>
|
215 |
-
@media only screen and (max-width : 640px) {
|
216 |
-
|
217 |
-
#views_tabs_select
|
218 |
-
{
|
219 |
-
display:none !important;
|
220 |
-
}
|
221 |
-
}
|
222 |
-
|
223 |
-
</style>';
|
224 |
-
}
|
225 |
-
if(count($views)==1 and $views[0]==$defaultview)
|
226 |
-
{
|
227 |
-
$display="display:none";
|
228 |
-
echo '<style>
|
229 |
-
@media only screen and (max-width : 640px) {
|
230 |
-
|
231 |
-
#views_tabs_select
|
232 |
-
{
|
233 |
-
display:none !important;
|
234 |
-
}
|
235 |
-
}
|
236 |
-
|
237 |
-
</style>';
|
238 |
-
}
|
239 |
-
?>
|
240 |
-
<style type='text/css'>
|
241 |
-
|
242 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
243 |
-
border-collapse: inherit !important;
|
244 |
-
}
|
245 |
-
|
246 |
-
#TB_window {
|
247 |
-
z-index: 10000;
|
248 |
-
}
|
249 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table td {
|
250 |
-
vertical-align: middle !important;
|
251 |
-
}
|
252 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table {
|
253 |
-
border-collapse: initial;
|
254 |
-
border:0px;
|
255 |
-
max-width: none;
|
256 |
-
}
|
257 |
-
|
258 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
259 |
-
padding: 0px;
|
260 |
-
vertical-align: none;
|
261 |
-
border-top:none;
|
262 |
-
line-height: none;
|
263 |
-
text-align: none;
|
264 |
-
}
|
265 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
266 |
-
margin-bottom:0;
|
267 |
-
}
|
268 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
269 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
270 |
-
#spiderCalendarTitlesList td,
|
271 |
-
#spiderCalendarTitlesList tr {
|
272 |
-
border:none;
|
273 |
-
}
|
274 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
275 |
-
border-radius: <?php echo $border_radius; ?>px;
|
276 |
-
}
|
277 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
278 |
-
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
279 |
-
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
280 |
-
}
|
281 |
-
|
282 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:first-child{
|
283 |
-
border-bottom-left-radius: <?php echo $border_radius2; ?>px;
|
284 |
-
}
|
285 |
-
|
286 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:last-child{
|
287 |
-
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
288 |
-
}
|
289 |
-
|
290 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
291 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
292 |
-
text-decoration:none;
|
293 |
-
background:none;
|
294 |
-
font-size: <?php echo $arrow_size; ?>px;
|
295 |
-
}
|
296 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
297 |
-
text-decoration:none;
|
298 |
-
background:none;
|
299 |
-
}
|
300 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
301 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
302 |
-
text-decoration:none;
|
303 |
-
background:none;
|
304 |
-
font-size:12px;
|
305 |
-
color:red;
|
306 |
-
}
|
307 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
308 |
-
text-decoration:none;
|
309 |
-
background:none;
|
310 |
-
}
|
311 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
312 |
-
border:1px solid <?php echo $cell_border_color; ?> !important;
|
313 |
-
vertical-align:top;
|
314 |
-
}
|
315 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
316 |
-
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
317 |
-
vertical-align: middle;
|
318 |
-
}
|
319 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
320 |
-
font-size:<?php echo $weekdays_font_size; ?>px;
|
321 |
-
}
|
322 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
323 |
-
border-spacing:0;
|
324 |
-
width:100%;
|
325 |
-
}
|
326 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
327 |
-
border-spacing:0;
|
328 |
-
width:100%;
|
329 |
-
}
|
330 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
331 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
|
332 |
-
text-align:center;
|
333 |
-
width:14%;
|
334 |
-
}
|
335 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
336 |
-
color:<?php echo $text_color_other_months; ?>;
|
337 |
-
border:1px solid <?php echo $cell_border_color; ?> !important;
|
338 |
-
vertical-align:top;
|
339 |
-
}
|
340 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
341 |
-
color:<?php echo $text_color_this_month_unevented; ?>;
|
342 |
-
}
|
343 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
344 |
-
font-size:24px;
|
345 |
-
font-weight:bold;
|
346 |
-
color:<?php echo $text_color_year; ?>;
|
347 |
-
}
|
348 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
349 |
-
color:<?php echo $sun_days; ?>;
|
350 |
-
border:1px solid <?php echo $cell_border_color; ?> !important;
|
351 |
-
vertical-align:top;
|
352 |
-
text-align:left;
|
353 |
-
background-color: <?php echo $sundays_bg_color; ?>;
|
354 |
-
}
|
355 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
356 |
-
float: right;
|
357 |
-
background-color: <?php echo $views_tabs_bg_color; ?>;
|
358 |
-
min-height: 25px;
|
359 |
-
min-width: 70px;
|
360 |
-
margin-right: 2px;
|
361 |
-
text-align: center;
|
362 |
-
cursor:pointer;
|
363 |
-
position: relative;
|
364 |
-
top: 5px;
|
365 |
-
}
|
366 |
-
|
367 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
368 |
-
padding: 7px;
|
369 |
-
}
|
370 |
-
|
371 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
372 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
373 |
-
{
|
374 |
-
background-color: <?php echo $views_tabs_bg_color ?>;
|
375 |
-
width: 120px;
|
376 |
-
text-align: center;
|
377 |
-
cursor: pointer;
|
378 |
-
padding: 6px;
|
379 |
-
position: relative;
|
380 |
-
}
|
381 |
-
|
382 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
383 |
-
{
|
384 |
-
min-height: 30px;
|
385 |
-
}
|
386 |
-
|
387 |
-
#drop_down_views
|
388 |
-
{
|
389 |
-
list-style-type:none !important;
|
390 |
-
display:none;
|
391 |
-
z-index: 4545;
|
392 |
-
|
393 |
-
}
|
394 |
-
|
395 |
-
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
396 |
-
{
|
397 |
-
background:<?php echo $bg_top ?>;
|
398 |
-
}
|
399 |
-
|
400 |
-
#drop_down_views >li
|
401 |
-
{
|
402 |
-
border-bottom:1px solid #fff !important;
|
403 |
-
}
|
404 |
-
|
405 |
-
|
406 |
-
#views_tabs_select
|
407 |
-
{
|
408 |
-
display:none;
|
409 |
-
}
|
410 |
-
#cal_event p{
|
411 |
-
color:#<?php echo $ev_color;?>
|
412 |
-
}
|
413 |
-
</style>
|
414 |
-
|
415 |
-
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
416 |
-
<div style="width:100%;">
|
417 |
-
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
418 |
-
<tr>
|
419 |
-
<td>
|
420 |
-
<div id="views_tabs" style="<?php echo $display ?>;width: 100.3%;">
|
421 |
-
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ';top:0;' ?>"
|
422 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
423 |
-
'action' => 'spiderbigcalendar_day',
|
424 |
-
'theme_id' => $theme_id,
|
425 |
-
'calendar' => $calendar_id,
|
426 |
-
'select' => $view_select,
|
427 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
428 |
-
'many_sp_calendar' => $many_sp_calendar,
|
429 |
-
'cur_page_url' => $path_sp_cal,
|
430 |
-
'cat_id' => '',
|
431 |
-
'cat_ids' => $cat_ids,
|
432 |
-
'widget' => $widget,
|
433 |
-
'rand' => $many_sp_calendar,
|
434 |
-
), admin_url('admin-ajax.php'));?>','<?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>
|
435 |
-
</div>
|
436 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';top:0;' ?>"
|
437 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
438 |
-
'action' => 'spiderbigcalendar_week',
|
439 |
-
'theme_id' => $theme_id,
|
440 |
-
'calendar' => $calendar_id,
|
441 |
-
'select' => $view_select,
|
442 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
443 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
444 |
-
'many_sp_calendar' => $many_sp_calendar,
|
445 |
-
'cur_page_url' => $path_sp_cal,
|
446 |
-
'cat_id' => '',
|
447 |
-
'cat_ids' => $cat_ids,
|
448 |
-
'widget' => $widget,
|
449 |
-
'rand' => $many_sp_calendar,
|
450 |
-
), admin_url('admin-ajax.php'));?>','<?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>
|
451 |
-
</div>
|
452 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';top:0;' ?>"
|
453 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
454 |
-
'action' => 'spiderbigcalendar_list',
|
455 |
-
'theme_id' => $theme_id,
|
456 |
-
'calendar' => $calendar_id,
|
457 |
-
'select' => $view_select,
|
458 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
459 |
-
'many_sp_calendar' => $many_sp_calendar,
|
460 |
-
'cur_page_url' => $path_sp_cal,
|
461 |
-
'cat_id' => '',
|
462 |
-
'cat_ids' => $cat_ids,
|
463 |
-
'widget' => $widget,
|
464 |
-
'rand' => $many_sp_calendar,
|
465 |
-
), admin_url('admin-ajax.php'));?>','<?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>
|
466 |
-
</div>
|
467 |
-
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
468 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
469 |
-
'action' => 'spiderbigcalendar_month',
|
470 |
-
'theme_id' => $theme_id,
|
471 |
-
'calendar' => $calendar_id,
|
472 |
-
'select' => $view_select,
|
473 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
474 |
-
'many_sp_calendar' => $many_sp_calendar,
|
475 |
-
'cur_page_url' => $path_sp_cal,
|
476 |
-
'cat_id' => '',
|
477 |
-
'cat_ids' => $cat_ids,
|
478 |
-
'widget' => $widget,
|
479 |
-
'rand' => $many_sp_calendar,
|
480 |
-
), admin_url('admin-ajax.php'));?>','<?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>
|
481 |
-
</div>
|
482 |
-
</div>
|
483 |
-
|
484 |
-
<div id="views_tabs_select" style="display:none" >
|
485 |
-
<div id="views_select" style="background-color:<?php echo $bg_top?>;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
486 |
-
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
487 |
-
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
488 |
-
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
489 |
-
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
490 |
-
<span>►</span>
|
491 |
-
</div>
|
492 |
-
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
493 |
-
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
494 |
-
<div class="views_select"
|
495 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
496 |
-
'action' => 'spiderbigcalendar_day',
|
497 |
-
'theme_id' => $theme_id,
|
498 |
-
'calendar' => $calendar_id,
|
499 |
-
'select' => $view_select,
|
500 |
-
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
501 |
-
'many_sp_calendar' => $many_sp_calendar,
|
502 |
-
'cur_page_url' => $path_sp_cal,
|
503 |
-
'cat_id' => '',
|
504 |
-
'cat_ids' => $cat_ids,
|
505 |
-
'widget' => $widget,
|
506 |
-
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
507 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
508 |
-
</div>
|
509 |
-
</li>
|
510 |
-
|
511 |
-
<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"
|
512 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
513 |
-
'action' => 'spiderbigcalendar_week',
|
514 |
-
'theme_id' => $theme_id,
|
515 |
-
'calendar' => $calendar_id,
|
516 |
-
'select' => $view_select,
|
517 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
518 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
519 |
-
'many_sp_calendar' => $many_sp_calendar,
|
520 |
-
'cur_page_url' => $path_sp_cal,
|
521 |
-
'cat_id' => '',
|
522 |
-
'cat_ids' => $cat_ids,
|
523 |
-
'widget' => $widget,
|
524 |
-
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
525 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
526 |
-
</div>
|
527 |
-
</li>
|
528 |
-
|
529 |
-
<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"
|
530 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
531 |
-
'action' => 'spiderbigcalendar_list',
|
532 |
-
'theme_id' => $theme_id,
|
533 |
-
'calendar' => $calendar_id,
|
534 |
-
'select' => $view_select,
|
535 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
536 |
-
'many_sp_calendar' => $many_sp_calendar,
|
537 |
-
'cur_page_url' => $path_sp_cal,
|
538 |
-
'cat_id' => '',
|
539 |
-
'cat_ids' => $cat_ids,
|
540 |
-
'widget' => $widget,
|
541 |
-
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
542 |
-
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
543 |
-
</div>
|
544 |
-
</li>
|
545 |
-
|
546 |
-
<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"
|
547 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
548 |
-
'action' => 'spiderbigcalendar_month',
|
549 |
-
'theme_id' => $theme_id,
|
550 |
-
'calendar' => $calendar_id,
|
551 |
-
'select' => $view_select,
|
552 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
553 |
-
'many_sp_calendar' => $many_sp_calendar,
|
554 |
-
'cur_page_url' => $path_sp_cal,
|
555 |
-
'cat_id' => '',
|
556 |
-
'cat_ids' => $cat_ids,
|
557 |
-
'widget' => $widget,
|
558 |
-
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
559 |
-
<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>
|
560 |
-
|
561 |
-
</ul>
|
562 |
-
</div>
|
563 |
-
</td>
|
564 |
-
</tr>
|
565 |
-
<tr>
|
566 |
-
<td>
|
567 |
-
<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; ?>;">
|
568 |
-
<tr>
|
569 |
-
<td width="100%" style="padding:0; margin:0">
|
570 |
-
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;">
|
571 |
-
<tr style="height:40px; width:100%;">
|
572 |
-
<td class="top_table" align="center" colspan="7" style="z-index: 5;position: relative;background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
573 |
-
<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;">
|
574 |
-
<tr>
|
575 |
-
<td width="15%">
|
576 |
-
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
577 |
-
echo add_query_arg(array(
|
578 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
579 |
-
'theme_id' => $theme_id,
|
580 |
-
'calendar' => $calendar_id,
|
581 |
-
'select' => $view_select,
|
582 |
-
'date' => ($year - 1) . '-' . add_0(Month_num($month)),
|
583 |
-
'many_sp_calendar' => $many_sp_calendar,
|
584 |
-
'cur_page_url' => $path_sp_cal,
|
585 |
-
'cat_id' => '',
|
586 |
-
'cat_ids' => $cat_ids,
|
587 |
-
'widget' => $widget,
|
588 |
-
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
589 |
-
<span style="font-size:18px;color:#FFF"><?php echo $year - 1; ?></span>
|
590 |
-
</div>
|
591 |
-
</td>
|
592 |
-
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
593 |
-
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>;" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
594 |
-
if (Month_num($month) == 1) {
|
595 |
-
$needed_date = ($year - 1) . '-12';
|
596 |
-
}
|
597 |
-
else {
|
598 |
-
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
599 |
-
}
|
600 |
-
echo add_query_arg(array(
|
601 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
602 |
-
'theme_id' => $theme_id,
|
603 |
-
'calendar' => $calendar_id,
|
604 |
-
'select' => $view_select,
|
605 |
-
'date' => $needed_date,
|
606 |
-
'many_sp_calendar' => $many_sp_calendar,
|
607 |
-
'cur_page_url' => $path_sp_cal,
|
608 |
-
'cat_id' => '',
|
609 |
-
'cat_ids' => $cat_ids,
|
610 |
-
'widget' => $widget,
|
611 |
-
), admin_url('admin-ajax.php'));
|
612 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◀
|
613 |
-
</a>
|
614 |
-
</td>
|
615 |
-
<td style="text-align:center; margin:0;" width="40%">
|
616 |
-
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
617 |
-
<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 $year . ', ' . __($month, 'sp_calendar'); ?></span>
|
618 |
-
</td>
|
619 |
-
<td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
|
620 |
-
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
621 |
-
if (Month_num($month) == 12) {
|
622 |
-
$needed_date = ($year + 1) . '-01';
|
623 |
-
}
|
624 |
-
else {
|
625 |
-
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
626 |
-
}
|
627 |
-
echo add_query_arg(array(
|
628 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
629 |
-
'theme_id' => $theme_id,
|
630 |
-
'calendar' => $calendar_id,
|
631 |
-
'select' => $view_select,
|
632 |
-
'date' => $needed_date,
|
633 |
-
'many_sp_calendar' => $many_sp_calendar,
|
634 |
-
'cur_page_url' => $path_sp_cal,
|
635 |
-
'cat_id' => '',
|
636 |
-
'cat_ids' => $cat_ids,
|
637 |
-
'widget' => $widget,
|
638 |
-
), admin_url('admin-ajax.php'));
|
639 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">▶
|
640 |
-
</a>
|
641 |
-
</td>
|
642 |
-
<td width="15%">
|
643 |
-
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
644 |
-
echo add_query_arg(array(
|
645 |
-
'action' => 'spiderbigcalendar_' . $defaultview,
|
646 |
-
'theme_id' => $theme_id,
|
647 |
-
'calendar' => $calendar_id,
|
648 |
-
'select' => $view_select,
|
649 |
-
'date' => ($year + 1) . '-' . add_0(Month_num($month)),
|
650 |
-
'many_sp_calendar' => $many_sp_calendar,
|
651 |
-
'cur_page_url' => $path_sp_cal,
|
652 |
-
'cat_id' => '',
|
653 |
-
'cat_ids' => $cat_ids,
|
654 |
-
'widget' => $widget,
|
655 |
-
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
656 |
-
<span style="font-size:18px;color:#FFF"><?php echo $year + 1; ?></span>
|
657 |
-
</div>
|
658 |
-
</td>
|
659 |
-
</tr>
|
660 |
-
</table>
|
661 |
-
</td>
|
662 |
-
</tr>
|
663 |
-
<tr align="center" height="<?php echo $week_days_cell_height; ?>" style="background-color:<?php echo $weekdays_bg_color; ?>;">
|
664 |
-
<?php if ($weekstart == "su") { ?>
|
665 |
-
<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; ?>">
|
666 |
-
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
667 |
-
</td>
|
668 |
-
<?php } ?>
|
669 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
670 |
-
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Mo', 'sp_calendar'); ?> </b></div>
|
671 |
-
</td>
|
672 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
673 |
-
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Tu', 'sp_calendar'); ?> </b></div>
|
674 |
-
</td>
|
675 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
676 |
-
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('We', 'sp_calendar'); ?> </b></div>
|
677 |
-
</td>
|
678 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
679 |
-
<div class="calbottom_border" style="text-align:center;margin:0; padding:0;"><b class="week_days"><?php echo __('Th', 'sp_calendar'); ?> </b></div>
|
680 |
-
</td>
|
681 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
682 |
-
<div class="calbottom_border" style="text-align:center;margin:0; padding:0;"><b class="week_days"><?php echo __('Fr', 'sp_calendar'); ?> </b></div>
|
683 |
-
</td>
|
684 |
-
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
685 |
-
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Sa', 'sp_calendar'); ?> </b></div>
|
686 |
-
</td>
|
687 |
-
<?php if ($weekstart == "mo") { ?>
|
688 |
-
<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; ?>">
|
689 |
-
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
690 |
-
</td>
|
691 |
-
<?php } ?>
|
692 |
-
</tr>
|
693 |
-
<?php
|
694 |
-
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
695 |
-
if ($weekstart == "su") {
|
696 |
-
$month_first_weekday++;
|
697 |
-
if ($month_first_weekday == 8) {
|
698 |
-
$month_first_weekday = 1;
|
699 |
-
}
|
700 |
-
}
|
701 |
-
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
702 |
-
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
703 |
-
$weekday_i = $month_first_weekday;
|
704 |
-
$last_month_days = $last_month_days - $weekday_i + 2;
|
705 |
-
$percent = 1;
|
706 |
-
$sum = $month_days - 8 + $month_first_weekday;
|
707 |
-
if ($sum % 7 <> 0) {
|
708 |
-
$percent = $percent + 1;
|
709 |
-
}
|
710 |
-
$sum = $sum - ($sum % 7);
|
711 |
-
$percent = $percent + ($sum / 7);
|
712 |
-
$percent = 107 / $percent;
|
713 |
-
$all_calendar_files = php_getdays($show_numbers_for_events, $calendar_id, $date, $theme_id, $widget);
|
714 |
-
$array_days = $all_calendar_files[0]['array_days'];
|
715 |
-
$array_days1 = $all_calendar_files[0]['array_days1'];
|
716 |
-
$title = $all_calendar_files[0]['title'];
|
717 |
-
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
718 |
-
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
719 |
-
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
720 |
-
|
721 |
-
echo ' <tr id="days" height="' . $cell_height . '" style="line-height:15px;">';
|
722 |
-
for ($i = 1; $i < $weekday_i; $i++) {
|
723 |
-
echo ' <td class="caltext_color_other_months" style="background-color:' . $bg_color_other_months . '">
|
724 |
-
<span style="font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family: tahoma;padding-left: 5px;">' . $last_month_days . '</span>
|
725 |
-
</td>';
|
726 |
-
$last_month_days = $last_month_days + 1;
|
727 |
-
}
|
728 |
-
///////////////////////////////////////////////////////////////////////
|
729 |
-
|
730 |
-
function category_color($event_id)
|
731 |
-
{
|
732 |
-
|
733 |
-
global $wpdb;
|
734 |
-
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
735 |
-
|
736 |
-
$query = "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
|
737 |
-
|
738 |
-
|
739 |
-
$colors=$wpdb->get_results($query);
|
740 |
-
|
741 |
-
if(!empty($colors))
|
742 |
-
$color=$colors[0]->color;
|
743 |
-
else $color = "";
|
744 |
-
|
745 |
-
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : '');
|
746 |
-
|
747 |
-
return '#'.$color;
|
748 |
-
}
|
749 |
-
|
750 |
-
|
751 |
-
function style($title, $color)
|
752 |
-
{
|
753 |
-
$new_title = html_entity_decode(strip_tags($title));
|
754 |
-
|
755 |
-
$number = $new_title[0];
|
756 |
-
$first_letter =$new_title[1];
|
757 |
-
$ev_title = $title;
|
758 |
-
$color=str_replace('#','',$color);
|
759 |
-
|
760 |
-
|
761 |
-
$bg_color='rgba('.HEXDEC(SUBSTR($color, 0, 2)).','.HEXDEC(SUBSTR($color, 2, 2)).','.HEXDEC(SUBSTR($color, 4, 2)).',0.3'.')';
|
762 |
-
$event='<div id="cal_event" style="background-color:'.$bg_color.';border-left:2px solid #'.$color.' "><p>'.$ev_title.'</p></div>';
|
763 |
-
|
764 |
-
return $event;
|
765 |
-
}
|
766 |
-
|
767 |
-
/////////////////////////////////////////////////////////////////////////////
|
768 |
-
|
769 |
-
for ($i = 1; $i <= $month_days; $i++) {
|
770 |
-
if (isset($title[$i])) {
|
771 |
-
$ev_title = explode('</p>', $title[$i]);
|
772 |
-
array_pop($ev_title);
|
773 |
-
$k = count($ev_title);
|
774 |
-
$ev_id = explode('<br>', $ev_ids[$i]);
|
775 |
-
array_pop($ev_id);
|
776 |
-
$ev_ids_inline = implode(',', $ev_id);
|
777 |
-
}
|
778 |
-
else
|
779 |
-
$k=0;
|
780 |
-
|
781 |
-
$dayevent = '';
|
782 |
-
if (($weekday_i % 7 == 0 and $weekstart == "mo") or ($weekday_i % 7 == 1 and $weekstart == "su")) {
|
783 |
-
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER ) {
|
784 |
-
echo ' <td class="cala_day" style="padding:0; margin:0;line-height:15px;">
|
785 |
-
<div class="calborder_day" style=" margin:0; padding:0;">
|
786 |
-
<p style="font-size:' . $other_days_font_size . 'px;color:' . $evented_color . ';line-height:1.3;font-family: tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>';
|
787 |
-
$r = 0;
|
788 |
-
echo ' <div style="background-color:' . $ev_title_bg_color . ';">';
|
789 |
-
for ($j = 0; $j < $k; $j++) {
|
790 |
-
if(category_color($ev_id[$j])=='#')
|
791 |
-
$cat_color=$bg_top;
|
792 |
-
else
|
793 |
-
$cat_color=category_color($ev_id[$j]);
|
794 |
-
|
795 |
-
if ($r < $number_of_shown_evetns) {
|
796 |
-
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $event_title_color . ';"
|
797 |
-
href="' . add_query_arg(array(
|
798 |
-
'action' => 'spidercalendarbig',
|
799 |
-
'theme_id' => $theme_id,
|
800 |
-
'calendar_id' => $calendar_id,
|
801 |
-
'ev_ids' => $ev_ids_inline,
|
802 |
-
'eventID' => $ev_id[$j],
|
803 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
804 |
-
'many_sp_calendar' => $many_sp_calendar,
|
805 |
-
'cur_page_url' => $path_sp_cal,
|
806 |
-
'widget' => $widget,
|
807 |
-
'TB_iframe' => 1,
|
808 |
-
'tbWidth' => $popup_width,
|
809 |
-
'tbHeight' => $popup_height,
|
810 |
-
'cat_id' => $cat_ids
|
811 |
-
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
812 |
-
</a>';
|
813 |
-
}
|
814 |
-
else {
|
815 |
-
echo '
|
816 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_color . '; text-align:center;"
|
817 |
-
href="' . add_query_arg(array(
|
818 |
-
'action' => 'spiderseemore',
|
819 |
-
'theme_id' => $theme_id,
|
820 |
-
'calendar_id' => $calendar_id,
|
821 |
-
'ev_ids' => $ev_ids_inline,
|
822 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
823 |
-
'many_sp_calendar' => $many_sp_calendar,
|
824 |
-
'cur_page_url' => $path_sp_cal,
|
825 |
-
'widget' => $widget,
|
826 |
-
'TB_iframe' => 1,
|
827 |
-
'tbWidth' => $popup_width,
|
828 |
-
'tbHeight' => $popup_height,
|
829 |
-
), admin_url('admin-ajax.php')) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
830 |
-
</a>';
|
831 |
-
break;
|
832 |
-
}
|
833 |
-
$r++;
|
834 |
-
}
|
835 |
-
echo ' </div>
|
836 |
-
</div>
|
837 |
-
</td>';
|
838 |
-
|
839 |
-
}
|
840 |
-
else
|
841 |
-
if ($i ==date( 'j' ) and $month == date('F') and $year == date('Y')) {
|
842 |
-
|
843 |
-
if(!isset($border_day)) $border_day = "";
|
844 |
-
if ($i == date('j') and $month == date('F') and $year == date('Y')) { $border_day = $current_day_border_color;}
|
845 |
-
if (in_array($i,$array_days)) {
|
846 |
-
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px; border: 3px solid ' . $current_day_border_color . ' !important">
|
847 |
-
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>';
|
848 |
-
$r = 0;
|
849 |
-
echo ' <div style="background-color:' . $ev_title_bg_color . '">';
|
850 |
-
for ($j = 0; $j < $k; $j++) {
|
851 |
-
|
852 |
-
if(category_color($ev_id[$j])=='#')
|
853 |
-
$cat_color=$bg_top;
|
854 |
-
else
|
855 |
-
$cat_color=category_color($ev_id[$j]);
|
856 |
-
if ($r < $number_of_shown_evetns) {
|
857 |
-
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $event_title_color . ';"
|
858 |
-
href="' . add_query_arg(array(
|
859 |
-
'action' => 'spidercalendarbig',
|
860 |
-
'theme_id' => $theme_id,
|
861 |
-
'calendar_id' => $calendar_id,
|
862 |
-
'ev_ids' => $ev_ids_inline,
|
863 |
-
'eventID' => $ev_id[$j],
|
864 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
865 |
-
'many_sp_calendar' => $many_sp_calendar,
|
866 |
-
'cur_page_url' => $path_sp_cal,
|
867 |
-
'widget' => $widget,
|
868 |
-
'TB_iframe' => 1,
|
869 |
-
'tbWidth' => $popup_width,
|
870 |
-
'tbHeight' => $popup_height,
|
871 |
-
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
872 |
-
</a>';
|
873 |
-
}
|
874 |
-
else {
|
875 |
-
echo '
|
876 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px;background:none;color:' . $event_title_color . ';text-align:center;"
|
877 |
-
href="' . add_query_arg(array(
|
878 |
-
'action' => 'spiderseemore',
|
879 |
-
'theme_id' => $theme_id,
|
880 |
-
'calendar_id' => $calendar_id,
|
881 |
-
'ev_ids' => $ev_ids_inline,
|
882 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
883 |
-
'many_sp_calendar' => $many_sp_calendar,
|
884 |
-
'cur_page_url' => $path_sp_cal,
|
885 |
-
'widget' => $widget,
|
886 |
-
'TB_iframe' => 1,
|
887 |
-
'tbWidth' => $popup_width,
|
888 |
-
'tbHeight' => $popup_height,
|
889 |
-
), admin_url('admin-ajax.php')) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
890 |
-
</a>';
|
891 |
-
break;
|
892 |
-
}
|
893 |
-
$r++;
|
894 |
-
}
|
895 |
-
echo ' </div>
|
896 |
-
</td>';
|
897 |
-
}
|
898 |
-
else {
|
899 |
-
|
900 |
-
echo ' <td class="calsun_days" style="padding:0; font-size:' . $sundays_font_size . 'px; margin:0;line-height:1.3;font-family:tahoma;padding-left: 5px; border: 3px solid ' . $current_day_border_color . ' !important">
|
901 |
-
<b>' . $i . '</b>
|
902 |
-
</td>';
|
903 |
-
}
|
904 |
-
}
|
905 |
-
else
|
906 |
-
|
907 |
-
if (in_array($i, $array_days)) {
|
908 |
-
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px;">
|
909 |
-
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>
|
910 |
-
<div style="background-color:' . $ev_title_bg_color . '">';
|
911 |
-
$r = 0;
|
912 |
-
for ($j = 0; $j < $k; $j++) {
|
913 |
-
if(category_color($ev_id[$j])=='#')
|
914 |
-
$cat_color=$bg_top;
|
915 |
-
else
|
916 |
-
$cat_color=category_color($ev_id[$j]);
|
917 |
-
|
918 |
-
if ($r < $number_of_shown_evetns) {
|
919 |
-
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
920 |
-
href="' . add_query_arg(array(
|
921 |
-
'action' => 'spidercalendarbig',
|
922 |
-
'theme_id' => $theme_id,
|
923 |
-
'calendar_id' => $calendar_id,
|
924 |
-
'ev_ids' => $ev_ids_inline,
|
925 |
-
'eventID' => $ev_id[$j],
|
926 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
927 |
-
'many_sp_calendar' => $many_sp_calendar,
|
928 |
-
'cur_page_url' => $path_sp_cal,
|
929 |
-
'widget' => $widget,
|
930 |
-
'TB_iframe' => 1,
|
931 |
-
'tbWidth' => $popup_width,
|
932 |
-
'tbHeight' => $popup_height,
|
933 |
-
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
934 |
-
</a>';
|
935 |
-
}
|
936 |
-
else {
|
937 |
-
echo '
|
938 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_color . ';text-align:center;"
|
939 |
-
href="' . add_query_arg(array(
|
940 |
-
'action' => 'spiderseemore',
|
941 |
-
'theme_id' => $theme_id,
|
942 |
-
'calendar_id' => $calendar_id,
|
943 |
-
'ev_ids' => $ev_ids_inline,
|
944 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
945 |
-
'many_sp_calendar' => $many_sp_calendar,
|
946 |
-
'cur_page_url' => $path_sp_cal,
|
947 |
-
'widget' => $widget,
|
948 |
-
'TB_iframe' => 1,
|
949 |
-
'tbWidth' => $popup_width,
|
950 |
-
'tbHeight' => $popup_height,
|
951 |
-
), admin_url('admin-ajax.php')) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
952 |
-
</a>';
|
953 |
-
break;
|
954 |
-
}
|
955 |
-
$r++;
|
956 |
-
}
|
957 |
-
echo ' </div>
|
958 |
-
</td>';
|
959 |
-
}
|
960 |
-
else {
|
961 |
-
echo ' <td class="calsun_days" style="padding:0; margin:0;line-height:1.3;font-family: tahoma;padding-left: 5px;font-size:' . $sundays_font_size . 'px">
|
962 |
-
<b>' . $i . '</b>
|
963 |
-
</td>';
|
964 |
-
}
|
965 |
-
}
|
966 |
-
else
|
967 |
-
|
968 |
-
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
969 |
-
|
970 |
-
echo ' <td bgcolor="' . $ev_title_bg_color . '" class="cala_day" style="border: 3px solid ' . $current_day_border_color . ' !important;padding:0; margin:0;line-height:15px;">
|
971 |
-
<div class="calborder_day" style="margin:0; padding:0;">
|
972 |
-
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family: tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>
|
973 |
-
<div style="background-color:' . $ev_title_bg_color . '">';
|
974 |
-
$r = 0;
|
975 |
-
for ($j = 0; $j < $k; $j++) {
|
976 |
-
if(category_color($ev_id[$j])=='#')
|
977 |
-
$cat_color=$bg_top;
|
978 |
-
else
|
979 |
-
$cat_color=category_color($ev_id[$j]);
|
980 |
-
|
981 |
-
if ($r < $number_of_shown_evetns) {
|
982 |
-
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
983 |
-
href="' . add_query_arg(array(
|
984 |
-
'action' => 'spidercalendarbig',
|
985 |
-
'theme_id' => $theme_id,
|
986 |
-
'calendar_id' => $calendar_id,
|
987 |
-
'ev_ids' => $ev_ids_inline,
|
988 |
-
'eventID' => $ev_id[$j],
|
989 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
990 |
-
'many_sp_calendar' => $many_sp_calendar,
|
991 |
-
'cur_page_url' => $path_sp_cal,
|
992 |
-
'widget' => $widget,
|
993 |
-
'TB_iframe' => 1,
|
994 |
-
'tbWidth' => $popup_width,
|
995 |
-
'tbHeight' => $popup_height,
|
996 |
-
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
997 |
-
</a>';
|
998 |
-
}
|
999 |
-
else {
|
1000 |
-
echo '
|
1001 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_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 |
-
'cur_page_url' => $path_sp_cal,
|
1010 |
-
'widget' => $widget,
|
1011 |
-
'TB_iframe' => 1,
|
1012 |
-
'tbWidth' => $popup_width,
|
1013 |
-
'tbHeight' => $popup_height,
|
1014 |
-
), admin_url('admin-ajax.php')) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1015 |
-
</a>';
|
1016 |
-
break;
|
1017 |
-
}
|
1018 |
-
$r++;
|
1019 |
-
}
|
1020 |
-
echo ' </div>
|
1021 |
-
</div>
|
1022 |
-
</td>';
|
1023 |
-
}
|
1024 |
-
else {
|
1025 |
-
|
1026 |
-
if ($i ==date( 'j' ) and $month == date('F') and $year == date('Y')) {
|
1027 |
-
|
1028 |
-
|
1029 |
-
if (in_array ($i,$array_days)) {
|
1030 |
-
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px; border: 3px solid ' . $current_day_border_color . ' !important;">
|
1031 |
-
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>
|
1032 |
-
<div style="background-color:' . $ev_title_bg_color . '">';
|
1033 |
-
$r = 0;
|
1034 |
-
for ($j = 0; $j < $k; $j++) {
|
1035 |
-
if(category_color($ev_id[$j])=='#')
|
1036 |
-
$cat_color=$bg_top;
|
1037 |
-
else
|
1038 |
-
$cat_color=category_color($ev_id[$j]);
|
1039 |
-
|
1040 |
-
if ($r < $number_of_shown_evetns) {
|
1041 |
-
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
1042 |
-
href="' . add_query_arg(array(
|
1043 |
-
'action' => 'spidercalendarbig',
|
1044 |
-
'theme_id' => $theme_id,
|
1045 |
-
'calendar_id' => $calendar_id,
|
1046 |
-
'ev_ids' => $ev_ids_inline,
|
1047 |
-
'eventID' => $ev_id[$j],
|
1048 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1049 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1050 |
-
'cur_page_url' => $path_sp_cal,
|
1051 |
-
'widget' => $widget,
|
1052 |
-
'TB_iframe' => 1,
|
1053 |
-
'tbWidth' => $popup_width,
|
1054 |
-
'tbHeight' => $popup_height,
|
1055 |
-
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
1056 |
-
</a>';
|
1057 |
-
}
|
1058 |
-
else {
|
1059 |
-
echo '
|
1060 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none;color:' . $event_title_color . ';text-align:center;"
|
1061 |
-
href="' . add_query_arg(array(
|
1062 |
-
'action' => 'spiderseemore',
|
1063 |
-
'theme_id' => $theme_id,
|
1064 |
-
'calendar_id' => $calendar_id,
|
1065 |
-
'ev_ids' => $ev_ids_inline,
|
1066 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1067 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1068 |
-
'cur_page_url' => $path_sp_cal,
|
1069 |
-
'widget' => $widget,
|
1070 |
-
'TB_iframe' => 1,
|
1071 |
-
'tbWidth' => $popup_width,
|
1072 |
-
'tbHeight' => $popup_height,
|
1073 |
-
), admin_url('admin-ajax.php')) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1074 |
-
</a>';
|
1075 |
-
break;
|
1076 |
-
}
|
1077 |
-
$r++;
|
1078 |
-
}
|
1079 |
-
echo ' </div>
|
1080 |
-
</td>';
|
1081 |
-
}
|
1082 |
-
else {
|
1083 |
-
echo ' <td style="color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:15px; border: 3px solid ' . $current_day_border_color . ' !important; vertical-align:top;">
|
1084 |
-
<p style="font-size:'.$other_days_font_size.'px;line-height:1.3;font-family: tahoma;padding-left: 5px;">' . $i . '</p>
|
1085 |
-
</td>';
|
1086 |
-
}
|
1087 |
-
}
|
1088 |
-
else
|
1089 |
-
|
1090 |
-
if (in_array($i, $array_days)) {
|
1091 |
-
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px;">
|
1092 |
-
<p style="background-color:' . $evented_color_bg . ';background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>';
|
1093 |
-
$r = 0;
|
1094 |
-
echo ' <div>';
|
1095 |
-
for ($j = 0; $j < $k; $j++) {
|
1096 |
-
|
1097 |
-
if(category_color($ev_id[$j])=='#')
|
1098 |
-
$cat_color=$bg_top;
|
1099 |
-
else
|
1100 |
-
$cat_color=category_color($ev_id[$j]);
|
1101 |
-
|
1102 |
-
if ($r < $number_of_shown_evetns) {
|
1103 |
-
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
1104 |
-
href="' . add_query_arg(array(
|
1105 |
-
'action' => 'spidercalendarbig',
|
1106 |
-
'theme_id' => $theme_id,
|
1107 |
-
'calendar_id' => $calendar_id,
|
1108 |
-
'ev_ids' => $ev_ids_inline,
|
1109 |
-
'eventID' => $ev_id[$j],
|
1110 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1111 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1112 |
-
'cur_page_url' => $path_sp_cal,
|
1113 |
-
'widget' => $widget,
|
1114 |
-
'TB_iframe' => 1,
|
1115 |
-
'tbWidth' => $popup_width,
|
1116 |
-
'tbHeight' => $popup_height,
|
1117 |
-
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
1118 |
-
</a>';
|
1119 |
-
}
|
1120 |
-
else {
|
1121 |
-
echo ' <p><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_color . ';text-align:center;"
|
1122 |
-
href="' . add_query_arg(array(
|
1123 |
-
'action' => 'spiderseemore',
|
1124 |
-
'theme_id' => $theme_id,
|
1125 |
-
'calendar_id' => $calendar_id,
|
1126 |
-
'ev_ids' => $ev_ids_inline,
|
1127 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1128 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1129 |
-
'cur_page_url' => $path_sp_cal,
|
1130 |
-
'widget' => $widget,
|
1131 |
-
'TB_iframe' => 1,
|
1132 |
-
'tbWidth' => $popup_width,
|
1133 |
-
'tbHeight' => $popup_height,
|
1134 |
-
), admin_url('admin-ajax.php')) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1135 |
-
</a></p>';
|
1136 |
-
break;
|
1137 |
-
}
|
1138 |
-
$r++;
|
1139 |
-
}
|
1140 |
-
echo ' </div>
|
1141 |
-
</td>';
|
1142 |
-
}
|
1143 |
-
else {
|
1144 |
-
echo ' <td style=" color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:15px;border: 1px solid ' . $cell_border_color . ' !important;vertical-align:top;">
|
1145 |
-
<p style="font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;">' . $i . '</p>
|
1146 |
-
</td>';
|
1147 |
-
}
|
1148 |
-
}
|
1149 |
-
if ($weekday_i % 7 == 0 && $i <> $month_days) {
|
1150 |
-
echo ' </tr>
|
1151 |
-
<tr height="' . $cell_height . '" style="line-height:15px">';
|
1152 |
-
$weekday_i = 0;
|
1153 |
-
}
|
1154 |
-
$weekday_i += 1;
|
1155 |
-
}
|
1156 |
-
$weekday_i;
|
1157 |
-
$next_i = 1;
|
1158 |
-
if ($weekday_i != 1) {
|
1159 |
-
for ($i = $weekday_i; $i <= 7; $i++) {
|
1160 |
-
if ($i != 7) {
|
1161 |
-
echo ' <td class="caltext_color_other_months" style="font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;background-color:' . $bg_color_other_months . ';">' . $next_i . '</td>';
|
1162 |
-
}
|
1163 |
-
else {
|
1164 |
-
echo ' <td class="caltext_color_other_months" style="font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;background-color:' . $bg_color_other_months . ';">' . $next_i . '</td>';
|
1165 |
-
}
|
1166 |
-
$next_i += 1;
|
1167 |
-
}
|
1168 |
-
}
|
1169 |
-
echo ' </tr>
|
1170 |
-
</table>';
|
1171 |
-
?> <input type="text" value="1" name="day" style="display:none" />
|
1172 |
-
</td>
|
1173 |
-
</tr>
|
1174 |
-
</table>
|
1175 |
-
</td>
|
1176 |
-
</tr>
|
1177 |
-
</table>
|
1178 |
-
|
1179 |
-
<script>
|
1180 |
-
|
1181 |
-
jQuery(document).ready(function (){
|
1182 |
-
|
1183 |
-
jQuery('#views_select').click(function () {
|
1184 |
-
jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
|
1185 |
-
}, function () {
|
1186 |
-
jQuery('#drop_down_views').stop(true, true).slideUp(500);
|
1187 |
-
});
|
1188 |
-
if(jQuery(window).width() > 640 )
|
1189 |
-
{
|
1190 |
-
jQuery('drop_down_views').hide();
|
1191 |
-
}
|
1192 |
-
});
|
1193 |
-
</script>
|
1194 |
-
|
1195 |
-
|
1196 |
-
<style>
|
1197 |
-
|
1198 |
-
@media only screen and (max-width : 640px) {
|
1199 |
-
|
1200 |
-
#views_tabs ,#drop_down_views
|
1201 |
-
{
|
1202 |
-
display:none;
|
1203 |
-
}
|
1204 |
-
|
1205 |
-
#views_tabs_select
|
1206 |
-
{
|
1207 |
-
display:block !important;
|
1208 |
-
}
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
}
|
1213 |
-
|
1214 |
-
@media only screen and (max-width : 968px) {
|
1215 |
-
#cats >li
|
1216 |
-
{
|
1217 |
-
float:none;
|
1218 |
-
}
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
}
|
1223 |
-
|
1224 |
-
|
1225 |
-
.categories1 , .categories2
|
1226 |
-
{
|
1227 |
-
display:inline-block;
|
1228 |
-
}
|
1229 |
-
|
1230 |
-
.categories2
|
1231 |
-
{
|
1232 |
-
position:relative;
|
1233 |
-
left: -9px;
|
1234 |
-
cursor:pointer;
|
1235 |
-
}
|
1236 |
-
.categories2:first-letter
|
1237 |
-
{
|
1238 |
-
color:#fff;
|
1239 |
-
|
1240 |
-
}
|
1241 |
-
</style>
|
1242 |
-
<?php
|
1243 |
-
|
1244 |
-
//reindex cat_ids_array
|
1245 |
-
$re_cat_ids_array = array_values($cat_ids_array);
|
1246 |
-
|
1247 |
-
for($i=0; $i<count($re_cat_ids_array); $i++)
|
1248 |
-
{
|
1249 |
-
echo'
|
1250 |
-
<style>
|
1251 |
-
#cats #category'.$re_cat_ids_array[$i].'
|
1252 |
-
{
|
1253 |
-
text-decoration:underline;
|
1254 |
-
cursor:pointer;
|
1255 |
-
|
1256 |
-
}
|
1257 |
-
|
1258 |
-
</style>';
|
1259 |
-
|
1260 |
-
}
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
if($cat_ids=='')
|
1265 |
-
$cat_ids='';
|
1266 |
-
|
1267 |
-
|
1268 |
-
echo '<ul id="cats" style="list-style-type:none;">';
|
1269 |
-
|
1270 |
-
foreach($categories as $category)
|
1271 |
-
{
|
1272 |
-
|
1273 |
-
?>
|
1274 |
-
|
1275 |
-
<li style="float:left;"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1276 |
-
'action' => 'spiderbigcalendar_month',
|
1277 |
-
'theme_id' => $theme_id,
|
1278 |
-
'calendar' => $calendar_id,
|
1279 |
-
'select' => $view_select,
|
1280 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
1281 |
-
'many_sp_calendar' => $many_sp_calendar,
|
1282 |
-
'cur_page_url' => $path_sp_cal,
|
1283 |
-
'cat_id' => $category->id,
|
1284 |
-
'cat_ids' => $cat_ids,
|
1285 |
-
'widget' => $widget,
|
1286 |
-
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1287 |
-
|
1288 |
-
|
1289 |
-
<?php
|
1290 |
-
|
1291 |
-
|
1292 |
-
}
|
1293 |
-
|
1294 |
-
echo '</ul><br><br>';
|
1295 |
-
die();
|
1296 |
-
}
|
1297 |
-
|
1298 |
?>
|
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'] : 13);
|
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 |
+
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where id=".$calendar_id."";
|
13 |
+
$calendar = $wpdb->query($query);
|
14 |
+
|
15 |
+
|
16 |
+
///////////////////////////////////////////////////////////////////////////////////
|
17 |
+
|
18 |
+
if(isset($_GET['cat_id']))
|
19 |
+
$cat_id = $_GET['cat_id'];
|
20 |
+
else $cat_id = "";
|
21 |
+
|
22 |
+
if(isset($_GET['cat_ids']))
|
23 |
+
$cat_ids = $_GET['cat_ids'];
|
24 |
+
else $cat_ids = "";
|
25 |
+
|
26 |
+
|
27 |
+
if($cat_ids=='')
|
28 |
+
$cat_ids .= $cat_id.',';
|
29 |
+
else
|
30 |
+
$cat_ids .= ','.$cat_id.',';
|
31 |
+
|
32 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
33 |
+
|
34 |
+
|
35 |
+
function getelementcountinarray($array , $element)
|
36 |
+
{
|
37 |
+
$t=0;
|
38 |
+
|
39 |
+
for($i=0; $i<count($array); $i++)
|
40 |
+
{
|
41 |
+
if($element==$array[$i])
|
42 |
+
$t++;
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
return $t;
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
function getelementindexinarray($array , $element)
|
52 |
+
{
|
53 |
+
|
54 |
+
$t='';
|
55 |
+
|
56 |
+
for($i=0; $i<count($array); $i++)
|
57 |
+
{
|
58 |
+
if($element==$array[$i])
|
59 |
+
$t.=$i.',';
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
+
return $t;
|
64 |
+
|
65 |
+
|
66 |
+
}
|
67 |
+
$cat_ids_array = explode(',',$cat_ids);
|
68 |
+
|
69 |
+
|
70 |
+
if($cat_id!='')
|
71 |
+
{
|
72 |
+
|
73 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
74 |
+
{
|
75 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
76 |
+
$index_array = explode(',' , $index_in_line);
|
77 |
+
array_pop ($index_array);
|
78 |
+
for($j=0; $j<count($index_array); $j++)
|
79 |
+
unset($cat_ids_array[$index_array[$j]]);
|
80 |
+
$cat_ids = implode(',',$cat_ids_array);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
else
|
84 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
85 |
+
|
86 |
+
|
87 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
88 |
+
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
96 |
+
$cal_width = $theme->width;
|
97 |
+
$bg_top = '#' . $theme->bg_top;
|
98 |
+
$bg_bottom = '#' . $theme->bg_bottom;
|
99 |
+
$border_color = '#' . $theme->border_color;
|
100 |
+
$text_color_year = '#' . $theme->text_color_year;
|
101 |
+
$text_color_month = '#' . $theme->text_color_month;
|
102 |
+
$color_week_days = '#' . $theme->text_color_week_days;
|
103 |
+
$text_color_other_months = '#' . $theme->text_color_other_months;
|
104 |
+
$text_color_this_month_unevented = '#' . $theme->text_color_this_month_unevented;
|
105 |
+
$evented_color = '#' . $theme->text_color_this_month_evented;
|
106 |
+
$evented_color_bg = '#' . $theme->bg_color_this_month_evented;
|
107 |
+
$color_arrow_year = '#' . $theme->arrow_color_year;
|
108 |
+
$color_arrow_month = '#' . $theme->arrow_color_month;
|
109 |
+
$sun_days = '#' . $theme->text_color_sun_days;
|
110 |
+
$event_title_color = '#' . $theme->event_title_color;
|
111 |
+
$current_day_border_color = '#' . $theme->current_day_border_color;
|
112 |
+
$cell_border_color = '#' . $theme->cell_border_color;
|
113 |
+
$cell_height = $theme->cell_height;
|
114 |
+
$popup_width = $theme->popup_width;
|
115 |
+
$popup_height = $theme->popup_height;
|
116 |
+
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
117 |
+
$sundays_font_size = $theme->sundays_font_size;
|
118 |
+
$other_days_font_size = $theme->other_days_font_size;
|
119 |
+
$weekdays_font_size = $theme->weekdays_font_size;
|
120 |
+
$border_width = $theme->border_width;
|
121 |
+
$top_height = $theme->top_height;
|
122 |
+
$bg_color_other_months = '#' . $theme->bg_color_other_months;
|
123 |
+
$sundays_bg_color = '#' . $theme->sundays_bg_color;
|
124 |
+
$weekdays_bg_color = '#' . $theme->weekdays_bg_color;
|
125 |
+
$weekstart = $theme->week_start_day;
|
126 |
+
$weekday_sunday_bg_color = '#' . $theme->weekday_sunday_bg_color;
|
127 |
+
$border_radius = $theme->border_radius;
|
128 |
+
$border_radius2 = $border_radius-$border_width;
|
129 |
+
$week_days_cell_height = $theme->week_days_cell_height;
|
130 |
+
$year_font_size = $theme->year_font_size;
|
131 |
+
$month_font_size = $theme->month_font_size;
|
132 |
+
$arrow_size = $theme->arrow_size;
|
133 |
+
$arrow_size_hover = $arrow_size + 5;
|
134 |
+
$next_month_text_color = '#' . $theme->next_month_text_color;
|
135 |
+
$prev_month_text_color = '#' . $theme->prev_month_text_color;
|
136 |
+
$next_month_arrow_color = '#' . $theme->next_month_arrow_color;
|
137 |
+
$prev_month_arrow_color = '#' . $theme->prev_month_arrow_color;
|
138 |
+
$next_month_font_size = $theme->next_month_font_size;
|
139 |
+
$prev_month_font_size = $theme->prev_month_font_size;
|
140 |
+
$month_type = $theme->month_type;
|
141 |
+
$ev_title_bg_color = '#'.$theme->ev_title_bg_color;
|
142 |
+
|
143 |
+
$date_bg_color = '#' . $theme->date_bg_color;
|
144 |
+
$event_bg_color1 = '#' . $theme->event_bg_color1;
|
145 |
+
$event_bg_color2 = '#' . $theme->event_bg_color2;
|
146 |
+
$event_num_bg_color1 = '#' . $theme->event_num_bg_color1;
|
147 |
+
$event_num_bg_color2 = '#' . $theme->event_num_bg_color2;
|
148 |
+
$event_num_color = '#' . $theme->event_num_color;
|
149 |
+
$date_font_size = $theme->date_font_size;
|
150 |
+
$event_num_font_size = $theme->event_num_font_size;
|
151 |
+
$event_table_height = $theme->event_table_height;
|
152 |
+
$date_height = $theme->date_height;
|
153 |
+
$day_month_font_size = $theme->day_month_font_size;
|
154 |
+
$week_font_size = $theme->week_font_size;
|
155 |
+
$day_month_font_color = '#' . $theme->day_month_font_color;
|
156 |
+
$week_font_color = '#' . $theme->week_font_color;
|
157 |
+
$views_tabs_bg_color = '#' . $theme->views_tabs_bg_color;
|
158 |
+
$views_tabs_text_color = '#' . $theme->views_tabs_text_color;
|
159 |
+
$views_tabs_font_size = $theme->views_tabs_font_size;
|
160 |
+
$show_numbers_for_events = $theme->day_start;
|
161 |
+
$ev_color = $theme->event_title_color;
|
162 |
+
|
163 |
+
__('January', 'sp_calendar');
|
164 |
+
__('February', 'sp_calendar');
|
165 |
+
__('March', 'sp_calendar');
|
166 |
+
__('April', 'sp_calendar');
|
167 |
+
__('May', 'sp_calendar');
|
168 |
+
__('June', 'sp_calendar');
|
169 |
+
__('July', 'sp_calendar');
|
170 |
+
__('August', 'sp_calendar');
|
171 |
+
__('September', 'sp_calendar');
|
172 |
+
__('October', 'sp_calendar');
|
173 |
+
__('November', 'sp_calendar');
|
174 |
+
__('December', 'sp_calendar');
|
175 |
+
if ($cell_height == '') {
|
176 |
+
$cell_height = 70;
|
177 |
+
}
|
178 |
+
if ($cal_width == '') {
|
179 |
+
$cal_width = 700;
|
180 |
+
}
|
181 |
+
if ($date != '') {
|
182 |
+
$date_REFERER = $date;
|
183 |
+
}
|
184 |
+
else {
|
185 |
+
$date_REFERER = date("Y-m");
|
186 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
187 |
+
}
|
188 |
+
|
189 |
+
$year_REFERER = substr($date_REFERER, 0, 4);
|
190 |
+
$month_REFERER = Month_name(substr($date_REFERER, 5, 2));
|
191 |
+
$day_REFERER = substr($date_REFERER, 8, 2);
|
192 |
+
|
193 |
+
$year = substr($date, 0, 4);
|
194 |
+
$month = Month_name(substr($date, 5, 2));
|
195 |
+
$day = substr($date, 8, 2);
|
196 |
+
|
197 |
+
$cell_width = $cal_width / 7;
|
198 |
+
$cell_width = (int) $cell_width - 2;
|
199 |
+
|
200 |
+
$this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
|
201 |
+
$prev_month = add_0((int) $this_month - 1);
|
202 |
+
$next_month = add_0((int) $this_month + 1);
|
203 |
+
|
204 |
+
$view = 'bigcalendarmonth';
|
205 |
+
$views = explode(',', $view_select);
|
206 |
+
$defaultview = 'month';
|
207 |
+
array_pop($views);
|
208 |
+
|
209 |
+
$display='';
|
210 |
+
|
211 |
+
if(count($views)==0)
|
212 |
+
{
|
213 |
+
$display="display:none";
|
214 |
+
echo '<style>
|
215 |
+
@media only screen and (max-width : 640px) {
|
216 |
+
|
217 |
+
#views_tabs_select
|
218 |
+
{
|
219 |
+
display:none !important;
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
</style>';
|
224 |
+
}
|
225 |
+
if(count($views)==1 and $views[0]==$defaultview)
|
226 |
+
{
|
227 |
+
$display="display:none";
|
228 |
+
echo '<style>
|
229 |
+
@media only screen and (max-width : 640px) {
|
230 |
+
|
231 |
+
#views_tabs_select
|
232 |
+
{
|
233 |
+
display:none !important;
|
234 |
+
}
|
235 |
+
}
|
236 |
+
|
237 |
+
</style>';
|
238 |
+
}
|
239 |
+
?>
|
240 |
+
<style type='text/css'>
|
241 |
+
|
242 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table{
|
243 |
+
border-collapse: inherit !important;
|
244 |
+
}
|
245 |
+
|
246 |
+
#TB_window {
|
247 |
+
z-index: 10000;
|
248 |
+
}
|
249 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table td {
|
250 |
+
vertical-align: middle !important;
|
251 |
+
}
|
252 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table {
|
253 |
+
border-collapse: initial;
|
254 |
+
border:0px;
|
255 |
+
max-width: none;
|
256 |
+
}
|
257 |
+
|
258 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
259 |
+
padding: 0px;
|
260 |
+
vertical-align: none;
|
261 |
+
border-top:none;
|
262 |
+
line-height: none;
|
263 |
+
text-align: none;
|
264 |
+
}
|
265 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
266 |
+
margin-bottom:0;
|
267 |
+
}
|
268 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
269 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
270 |
+
#spiderCalendarTitlesList td,
|
271 |
+
#spiderCalendarTitlesList tr {
|
272 |
+
border:none;
|
273 |
+
}
|
274 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
275 |
+
border-radius: <?php echo $border_radius; ?>px;
|
276 |
+
}
|
277 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
278 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
279 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
280 |
+
}
|
281 |
+
|
282 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:first-child{
|
283 |
+
border-bottom-left-radius: <?php echo $border_radius2; ?>px;
|
284 |
+
}
|
285 |
+
|
286 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table table tr:last-child >td:last-child{
|
287 |
+
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
288 |
+
}
|
289 |
+
|
290 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
291 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
292 |
+
text-decoration:none;
|
293 |
+
background:none;
|
294 |
+
font-size: <?php echo $arrow_size; ?>px;
|
295 |
+
}
|
296 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
297 |
+
text-decoration:none;
|
298 |
+
background:none;
|
299 |
+
}
|
300 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
301 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
302 |
+
text-decoration:none;
|
303 |
+
background:none;
|
304 |
+
font-size:12px;
|
305 |
+
color:red;
|
306 |
+
}
|
307 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
308 |
+
text-decoration:none;
|
309 |
+
background:none;
|
310 |
+
}
|
311 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
312 |
+
border:1px solid <?php echo $cell_border_color; ?> !important;
|
313 |
+
vertical-align:top;
|
314 |
+
}
|
315 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
316 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
317 |
+
vertical-align: middle;
|
318 |
+
}
|
319 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
320 |
+
font-size:<?php echo $weekdays_font_size; ?>px;
|
321 |
+
}
|
322 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
323 |
+
border-spacing:0;
|
324 |
+
width:100%;
|
325 |
+
}
|
326 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
327 |
+
border-spacing:0;
|
328 |
+
width:100%;
|
329 |
+
}
|
330 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
|
331 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
|
332 |
+
text-align:center;
|
333 |
+
width:14%;
|
334 |
+
}
|
335 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
336 |
+
color:<?php echo $text_color_other_months; ?>;
|
337 |
+
border:1px solid <?php echo $cell_border_color; ?> !important;
|
338 |
+
vertical-align:top;
|
339 |
+
}
|
340 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
341 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
342 |
+
}
|
343 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
344 |
+
font-size:24px;
|
345 |
+
font-weight:bold;
|
346 |
+
color:<?php echo $text_color_year; ?>;
|
347 |
+
}
|
348 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
349 |
+
color:<?php echo $sun_days; ?>;
|
350 |
+
border:1px solid <?php echo $cell_border_color; ?> !important;
|
351 |
+
vertical-align:top;
|
352 |
+
text-align:left;
|
353 |
+
background-color: <?php echo $sundays_bg_color; ?>;
|
354 |
+
}
|
355 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
356 |
+
float: right;
|
357 |
+
background-color: <?php echo $views_tabs_bg_color; ?>;
|
358 |
+
min-height: 25px;
|
359 |
+
min-width: 70px;
|
360 |
+
margin-right: 2px;
|
361 |
+
text-align: center;
|
362 |
+
cursor:pointer;
|
363 |
+
position: relative;
|
364 |
+
top: 5px;
|
365 |
+
}
|
366 |
+
|
367 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
368 |
+
padding: 7px;
|
369 |
+
}
|
370 |
+
|
371 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
372 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
373 |
+
{
|
374 |
+
background-color: <?php echo $views_tabs_bg_color ?>;
|
375 |
+
width: 120px;
|
376 |
+
text-align: center;
|
377 |
+
cursor: pointer;
|
378 |
+
padding: 6px;
|
379 |
+
position: relative;
|
380 |
+
}
|
381 |
+
|
382 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
383 |
+
{
|
384 |
+
min-height: 30px;
|
385 |
+
}
|
386 |
+
|
387 |
+
#drop_down_views
|
388 |
+
{
|
389 |
+
list-style-type:none !important;
|
390 |
+
display:none;
|
391 |
+
z-index: 4545;
|
392 |
+
|
393 |
+
}
|
394 |
+
|
395 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
396 |
+
{
|
397 |
+
background:<?php echo $bg_top ?>;
|
398 |
+
}
|
399 |
+
|
400 |
+
#drop_down_views >li
|
401 |
+
{
|
402 |
+
border-bottom:1px solid #fff !important;
|
403 |
+
}
|
404 |
+
|
405 |
+
|
406 |
+
#views_tabs_select
|
407 |
+
{
|
408 |
+
display:none;
|
409 |
+
}
|
410 |
+
#cal_event p{
|
411 |
+
color:#<?php echo $ev_color;?>
|
412 |
+
}
|
413 |
+
</style>
|
414 |
+
|
415 |
+
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
416 |
+
<div style="width:100%;">
|
417 |
+
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
418 |
+
<tr>
|
419 |
+
<td>
|
420 |
+
<div id="views_tabs" style="<?php echo $display ?>;width: 100.3%;">
|
421 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ';top:0;' ?>"
|
422 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
423 |
+
'action' => 'spiderbigcalendar_day',
|
424 |
+
'theme_id' => $theme_id,
|
425 |
+
'calendar' => $calendar_id,
|
426 |
+
'select' => $view_select,
|
427 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
428 |
+
'many_sp_calendar' => $many_sp_calendar,
|
429 |
+
'cur_page_url' => $path_sp_cal,
|
430 |
+
'cat_id' => '',
|
431 |
+
'cat_ids' => $cat_ids,
|
432 |
+
'widget' => $widget,
|
433 |
+
'rand' => $many_sp_calendar,
|
434 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
435 |
+
</div>
|
436 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';top:0;' ?>"
|
437 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
438 |
+
'action' => 'spiderbigcalendar_week',
|
439 |
+
'theme_id' => $theme_id,
|
440 |
+
'calendar' => $calendar_id,
|
441 |
+
'select' => $view_select,
|
442 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
443 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
444 |
+
'many_sp_calendar' => $many_sp_calendar,
|
445 |
+
'cur_page_url' => $path_sp_cal,
|
446 |
+
'cat_id' => '',
|
447 |
+
'cat_ids' => $cat_ids,
|
448 |
+
'widget' => $widget,
|
449 |
+
'rand' => $many_sp_calendar,
|
450 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
451 |
+
</div>
|
452 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';top:0;' ?>"
|
453 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
454 |
+
'action' => 'spiderbigcalendar_list',
|
455 |
+
'theme_id' => $theme_id,
|
456 |
+
'calendar' => $calendar_id,
|
457 |
+
'select' => $view_select,
|
458 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
459 |
+
'many_sp_calendar' => $many_sp_calendar,
|
460 |
+
'cur_page_url' => $path_sp_cal,
|
461 |
+
'cat_id' => '',
|
462 |
+
'cat_ids' => $cat_ids,
|
463 |
+
'widget' => $widget,
|
464 |
+
'rand' => $many_sp_calendar,
|
465 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
466 |
+
</div>
|
467 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
468 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
469 |
+
'action' => 'spiderbigcalendar_month',
|
470 |
+
'theme_id' => $theme_id,
|
471 |
+
'calendar' => $calendar_id,
|
472 |
+
'select' => $view_select,
|
473 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
474 |
+
'many_sp_calendar' => $many_sp_calendar,
|
475 |
+
'cur_page_url' => $path_sp_cal,
|
476 |
+
'cat_id' => '',
|
477 |
+
'cat_ids' => $cat_ids,
|
478 |
+
'widget' => $widget,
|
479 |
+
'rand' => $many_sp_calendar,
|
480 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
481 |
+
</div>
|
482 |
+
</div>
|
483 |
+
|
484 |
+
<div id="views_tabs_select" style="display:none" >
|
485 |
+
<div id="views_select" style="background-color:<?php echo $bg_top?>;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
486 |
+
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
487 |
+
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
488 |
+
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
489 |
+
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
490 |
+
<span>►</span>
|
491 |
+
</div>
|
492 |
+
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
493 |
+
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
494 |
+
<div class="views_select"
|
495 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
496 |
+
'action' => 'spiderbigcalendar_day',
|
497 |
+
'theme_id' => $theme_id,
|
498 |
+
'calendar' => $calendar_id,
|
499 |
+
'select' => $view_select,
|
500 |
+
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
501 |
+
'many_sp_calendar' => $many_sp_calendar,
|
502 |
+
'cur_page_url' => $path_sp_cal,
|
503 |
+
'cat_id' => '',
|
504 |
+
'cat_ids' => $cat_ids,
|
505 |
+
'widget' => $widget,
|
506 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
507 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
508 |
+
</div>
|
509 |
+
</li>
|
510 |
+
|
511 |
+
<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"
|
512 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
513 |
+
'action' => 'spiderbigcalendar_week',
|
514 |
+
'theme_id' => $theme_id,
|
515 |
+
'calendar' => $calendar_id,
|
516 |
+
'select' => $view_select,
|
517 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
518 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
519 |
+
'many_sp_calendar' => $many_sp_calendar,
|
520 |
+
'cur_page_url' => $path_sp_cal,
|
521 |
+
'cat_id' => '',
|
522 |
+
'cat_ids' => $cat_ids,
|
523 |
+
'widget' => $widget,
|
524 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
525 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
526 |
+
</div>
|
527 |
+
</li>
|
528 |
+
|
529 |
+
<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"
|
530 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
531 |
+
'action' => 'spiderbigcalendar_list',
|
532 |
+
'theme_id' => $theme_id,
|
533 |
+
'calendar' => $calendar_id,
|
534 |
+
'select' => $view_select,
|
535 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
536 |
+
'many_sp_calendar' => $many_sp_calendar,
|
537 |
+
'cur_page_url' => $path_sp_cal,
|
538 |
+
'cat_id' => '',
|
539 |
+
'cat_ids' => $cat_ids,
|
540 |
+
'widget' => $widget,
|
541 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
542 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
543 |
+
</div>
|
544 |
+
</li>
|
545 |
+
|
546 |
+
<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"
|
547 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
548 |
+
'action' => 'spiderbigcalendar_month',
|
549 |
+
'theme_id' => $theme_id,
|
550 |
+
'calendar' => $calendar_id,
|
551 |
+
'select' => $view_select,
|
552 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
553 |
+
'many_sp_calendar' => $many_sp_calendar,
|
554 |
+
'cur_page_url' => $path_sp_cal,
|
555 |
+
'cat_id' => '',
|
556 |
+
'cat_ids' => $cat_ids,
|
557 |
+
'widget' => $widget,
|
558 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
559 |
+
<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>
|
560 |
+
|
561 |
+
</ul>
|
562 |
+
</div>
|
563 |
+
</td>
|
564 |
+
</tr>
|
565 |
+
<tr>
|
566 |
+
<td>
|
567 |
+
<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; ?>;">
|
568 |
+
<tr>
|
569 |
+
<td width="100%" style="padding:0; margin:0">
|
570 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;">
|
571 |
+
<tr style="height:40px; width:100%;">
|
572 |
+
<td class="top_table" align="center" colspan="7" style="z-index: 5;position: relative;background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
573 |
+
<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;">
|
574 |
+
<tr>
|
575 |
+
<td width="15%">
|
576 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
577 |
+
echo add_query_arg(array(
|
578 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
579 |
+
'theme_id' => $theme_id,
|
580 |
+
'calendar' => $calendar_id,
|
581 |
+
'select' => $view_select,
|
582 |
+
'date' => ($year - 1) . '-' . add_0(Month_num($month)),
|
583 |
+
'many_sp_calendar' => $many_sp_calendar,
|
584 |
+
'cur_page_url' => $path_sp_cal,
|
585 |
+
'cat_id' => '',
|
586 |
+
'cat_ids' => $cat_ids,
|
587 |
+
'widget' => $widget,
|
588 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
589 |
+
<span style="font-size:18px;color:#FFF"><?php echo $year - 1; ?></span>
|
590 |
+
</div>
|
591 |
+
</td>
|
592 |
+
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
593 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>;" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
594 |
+
if (Month_num($month) == 1) {
|
595 |
+
$needed_date = ($year - 1) . '-12';
|
596 |
+
}
|
597 |
+
else {
|
598 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
599 |
+
}
|
600 |
+
echo add_query_arg(array(
|
601 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
602 |
+
'theme_id' => $theme_id,
|
603 |
+
'calendar' => $calendar_id,
|
604 |
+
'select' => $view_select,
|
605 |
+
'date' => $needed_date,
|
606 |
+
'many_sp_calendar' => $many_sp_calendar,
|
607 |
+
'cur_page_url' => $path_sp_cal,
|
608 |
+
'cat_id' => '',
|
609 |
+
'cat_ids' => $cat_ids,
|
610 |
+
'widget' => $widget,
|
611 |
+
), admin_url('admin-ajax.php'));
|
612 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◀
|
613 |
+
</a>
|
614 |
+
</td>
|
615 |
+
<td style="text-align:center; margin:0;" width="40%">
|
616 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
617 |
+
<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 $year . ', ' . __($month, 'sp_calendar'); ?></span>
|
618 |
+
</td>
|
619 |
+
<td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
|
620 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
621 |
+
if (Month_num($month) == 12) {
|
622 |
+
$needed_date = ($year + 1) . '-01';
|
623 |
+
}
|
624 |
+
else {
|
625 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
626 |
+
}
|
627 |
+
echo add_query_arg(array(
|
628 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
629 |
+
'theme_id' => $theme_id,
|
630 |
+
'calendar' => $calendar_id,
|
631 |
+
'select' => $view_select,
|
632 |
+
'date' => $needed_date,
|
633 |
+
'many_sp_calendar' => $many_sp_calendar,
|
634 |
+
'cur_page_url' => $path_sp_cal,
|
635 |
+
'cat_id' => '',
|
636 |
+
'cat_ids' => $cat_ids,
|
637 |
+
'widget' => $widget,
|
638 |
+
), admin_url('admin-ajax.php'));
|
639 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">▶
|
640 |
+
</a>
|
641 |
+
</td>
|
642 |
+
<td width="15%">
|
643 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
644 |
+
echo add_query_arg(array(
|
645 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
646 |
+
'theme_id' => $theme_id,
|
647 |
+
'calendar' => $calendar_id,
|
648 |
+
'select' => $view_select,
|
649 |
+
'date' => ($year + 1) . '-' . add_0(Month_num($month)),
|
650 |
+
'many_sp_calendar' => $many_sp_calendar,
|
651 |
+
'cur_page_url' => $path_sp_cal,
|
652 |
+
'cat_id' => '',
|
653 |
+
'cat_ids' => $cat_ids,
|
654 |
+
'widget' => $widget,
|
655 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
656 |
+
<span style="font-size:18px;color:#FFF"><?php echo $year + 1; ?></span>
|
657 |
+
</div>
|
658 |
+
</td>
|
659 |
+
</tr>
|
660 |
+
</table>
|
661 |
+
</td>
|
662 |
+
</tr>
|
663 |
+
<tr align="center" height="<?php echo $week_days_cell_height; ?>" style="background-color:<?php echo $weekdays_bg_color; ?>;">
|
664 |
+
<?php if ($weekstart == "su") { ?>
|
665 |
+
<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; ?>">
|
666 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
667 |
+
</td>
|
668 |
+
<?php } ?>
|
669 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
670 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Mo', 'sp_calendar'); ?> </b></div>
|
671 |
+
</td>
|
672 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
673 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Tu', 'sp_calendar'); ?> </b></div>
|
674 |
+
</td>
|
675 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
676 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('We', 'sp_calendar'); ?> </b></div>
|
677 |
+
</td>
|
678 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
679 |
+
<div class="calbottom_border" style="text-align:center;margin:0; padding:0;"><b class="week_days"><?php echo __('Th', 'sp_calendar'); ?> </b></div>
|
680 |
+
</td>
|
681 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
682 |
+
<div class="calbottom_border" style="text-align:center;margin:0; padding:0;"><b class="week_days"><?php echo __('Fr', 'sp_calendar'); ?> </b></div>
|
683 |
+
</td>
|
684 |
+
<td class="weekdays" style="width:14.2857143%; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
685 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Sa', 'sp_calendar'); ?> </b></div>
|
686 |
+
</td>
|
687 |
+
<?php if ($weekstart == "mo") { ?>
|
688 |
+
<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; ?>">
|
689 |
+
<div class="calbottom_border" style="text-align:center; margin:0; padding:0;"><b class="week_days"><?php echo __('Su', 'sp_calendar'); ?> </b></div>
|
690 |
+
</td>
|
691 |
+
<?php } ?>
|
692 |
+
</tr>
|
693 |
+
<?php
|
694 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
695 |
+
if ($weekstart == "su") {
|
696 |
+
$month_first_weekday++;
|
697 |
+
if ($month_first_weekday == 8) {
|
698 |
+
$month_first_weekday = 1;
|
699 |
+
}
|
700 |
+
}
|
701 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
702 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
703 |
+
$weekday_i = $month_first_weekday;
|
704 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
705 |
+
$percent = 1;
|
706 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
707 |
+
if ($sum % 7 <> 0) {
|
708 |
+
$percent = $percent + 1;
|
709 |
+
}
|
710 |
+
$sum = $sum - ($sum % 7);
|
711 |
+
$percent = $percent + ($sum / 7);
|
712 |
+
$percent = 107 / $percent;
|
713 |
+
$all_calendar_files = php_getdays($show_numbers_for_events, $calendar_id, $date, $theme_id, $widget);
|
714 |
+
$array_days = $all_calendar_files[0]['array_days'];
|
715 |
+
$array_days1 = $all_calendar_files[0]['array_days1'];
|
716 |
+
$title = $all_calendar_files[0]['title'];
|
717 |
+
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
718 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
719 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
720 |
+
|
721 |
+
echo ' <tr id="days" height="' . $cell_height . '" style="line-height:15px;">';
|
722 |
+
for ($i = 1; $i < $weekday_i; $i++) {
|
723 |
+
echo ' <td class="caltext_color_other_months" style="background-color:' . $bg_color_other_months . '">
|
724 |
+
<span style="font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family: tahoma;padding-left: 5px;">' . $last_month_days . '</span>
|
725 |
+
</td>';
|
726 |
+
$last_month_days = $last_month_days + 1;
|
727 |
+
}
|
728 |
+
///////////////////////////////////////////////////////////////////////
|
729 |
+
|
730 |
+
function category_color($event_id)
|
731 |
+
{
|
732 |
+
|
733 |
+
global $wpdb;
|
734 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
735 |
+
|
736 |
+
$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);
|
737 |
+
|
738 |
+
|
739 |
+
$colors=$wpdb->get_results($query);
|
740 |
+
|
741 |
+
if(!empty($colors))
|
742 |
+
$color=$colors[0]->color;
|
743 |
+
else $color = "";
|
744 |
+
|
745 |
+
$theme_id = (isset($_GET['theme_id']) ? (int) $_GET['theme_id'] : '');
|
746 |
+
|
747 |
+
return '#'.$color;
|
748 |
+
}
|
749 |
+
|
750 |
+
|
751 |
+
function style($title, $color)
|
752 |
+
{
|
753 |
+
$new_title = html_entity_decode(strip_tags($title));
|
754 |
+
|
755 |
+
$number = $new_title[0];
|
756 |
+
$first_letter =$new_title[1];
|
757 |
+
$ev_title = $title;
|
758 |
+
$color=str_replace('#','',$color);
|
759 |
+
|
760 |
+
|
761 |
+
$bg_color='rgba('.HEXDEC(SUBSTR($color, 0, 2)).','.HEXDEC(SUBSTR($color, 2, 2)).','.HEXDEC(SUBSTR($color, 4, 2)).',0.3'.')';
|
762 |
+
$event='<div id="cal_event" style="background-color:'.$bg_color.';border-left:2px solid #'.$color.' "><p>'.$ev_title.'</p></div>';
|
763 |
+
|
764 |
+
return $event;
|
765 |
+
}
|
766 |
+
|
767 |
+
/////////////////////////////////////////////////////////////////////////////
|
768 |
+
|
769 |
+
for ($i = 1; $i <= $month_days; $i++) {
|
770 |
+
if (isset($title[$i])) {
|
771 |
+
$ev_title = explode('</p>', $title[$i]);
|
772 |
+
array_pop($ev_title);
|
773 |
+
$k = count($ev_title);
|
774 |
+
$ev_id = explode('<br>', $ev_ids[$i]);
|
775 |
+
array_pop($ev_id);
|
776 |
+
$ev_ids_inline = implode(',', $ev_id);
|
777 |
+
}
|
778 |
+
else
|
779 |
+
$k=0;
|
780 |
+
|
781 |
+
$dayevent = '';
|
782 |
+
if (($weekday_i % 7 == 0 and $weekstart == "mo") or ($weekday_i % 7 == 1 and $weekstart == "su")) {
|
783 |
+
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER ) {
|
784 |
+
echo ' <td class="cala_day" style="padding:0; margin:0;line-height:15px;">
|
785 |
+
<div class="calborder_day" style=" margin:0; padding:0;">
|
786 |
+
<p style="font-size:' . $other_days_font_size . 'px;color:' . $evented_color . ';line-height:1.3;font-family: tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>';
|
787 |
+
$r = 0;
|
788 |
+
echo ' <div style="background-color:' . $ev_title_bg_color . ';">';
|
789 |
+
for ($j = 0; $j < $k; $j++) {
|
790 |
+
if(category_color($ev_id[$j])=='#')
|
791 |
+
$cat_color=$bg_top;
|
792 |
+
else
|
793 |
+
$cat_color=category_color($ev_id[$j]);
|
794 |
+
|
795 |
+
if ($r < $number_of_shown_evetns) {
|
796 |
+
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $event_title_color . ';"
|
797 |
+
href="' . add_query_arg(array(
|
798 |
+
'action' => 'spidercalendarbig',
|
799 |
+
'theme_id' => $theme_id,
|
800 |
+
'calendar_id' => $calendar_id,
|
801 |
+
'ev_ids' => $ev_ids_inline,
|
802 |
+
'eventID' => $ev_id[$j],
|
803 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
804 |
+
'many_sp_calendar' => $many_sp_calendar,
|
805 |
+
'cur_page_url' => $path_sp_cal,
|
806 |
+
'widget' => $widget,
|
807 |
+
'TB_iframe' => 1,
|
808 |
+
'tbWidth' => $popup_width,
|
809 |
+
'tbHeight' => $popup_height,
|
810 |
+
'cat_id' => $cat_ids
|
811 |
+
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
812 |
+
</a>';
|
813 |
+
}
|
814 |
+
else {
|
815 |
+
echo '
|
816 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_color . '; text-align:center;"
|
817 |
+
href="' . add_query_arg(array(
|
818 |
+
'action' => 'spiderseemore',
|
819 |
+
'theme_id' => $theme_id,
|
820 |
+
'calendar_id' => $calendar_id,
|
821 |
+
'ev_ids' => $ev_ids_inline,
|
822 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
823 |
+
'many_sp_calendar' => $many_sp_calendar,
|
824 |
+
'cur_page_url' => $path_sp_cal,
|
825 |
+
'widget' => $widget,
|
826 |
+
'TB_iframe' => 1,
|
827 |
+
'tbWidth' => $popup_width,
|
828 |
+
'tbHeight' => $popup_height,
|
829 |
+
), admin_url('admin-ajax.php')) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
830 |
+
</a>';
|
831 |
+
break;
|
832 |
+
}
|
833 |
+
$r++;
|
834 |
+
}
|
835 |
+
echo ' </div>
|
836 |
+
</div>
|
837 |
+
</td>';
|
838 |
+
|
839 |
+
}
|
840 |
+
else
|
841 |
+
if ($i ==date( 'j' ) and $month == date('F') and $year == date('Y')) {
|
842 |
+
|
843 |
+
if(!isset($border_day)) $border_day = "";
|
844 |
+
if ($i == date('j') and $month == date('F') and $year == date('Y')) { $border_day = $current_day_border_color;}
|
845 |
+
if (in_array($i,$array_days)) {
|
846 |
+
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px; border: 3px solid ' . $current_day_border_color . ' !important">
|
847 |
+
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>';
|
848 |
+
$r = 0;
|
849 |
+
echo ' <div style="background-color:' . $ev_title_bg_color . '">';
|
850 |
+
for ($j = 0; $j < $k; $j++) {
|
851 |
+
|
852 |
+
if(category_color($ev_id[$j])=='#')
|
853 |
+
$cat_color=$bg_top;
|
854 |
+
else
|
855 |
+
$cat_color=category_color($ev_id[$j]);
|
856 |
+
if ($r < $number_of_shown_evetns) {
|
857 |
+
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $event_title_color . ';"
|
858 |
+
href="' . add_query_arg(array(
|
859 |
+
'action' => 'spidercalendarbig',
|
860 |
+
'theme_id' => $theme_id,
|
861 |
+
'calendar_id' => $calendar_id,
|
862 |
+
'ev_ids' => $ev_ids_inline,
|
863 |
+
'eventID' => $ev_id[$j],
|
864 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
865 |
+
'many_sp_calendar' => $many_sp_calendar,
|
866 |
+
'cur_page_url' => $path_sp_cal,
|
867 |
+
'widget' => $widget,
|
868 |
+
'TB_iframe' => 1,
|
869 |
+
'tbWidth' => $popup_width,
|
870 |
+
'tbHeight' => $popup_height,
|
871 |
+
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
872 |
+
</a>';
|
873 |
+
}
|
874 |
+
else {
|
875 |
+
echo '
|
876 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px;background:none;color:' . $event_title_color . ';text-align:center;"
|
877 |
+
href="' . add_query_arg(array(
|
878 |
+
'action' => 'spiderseemore',
|
879 |
+
'theme_id' => $theme_id,
|
880 |
+
'calendar_id' => $calendar_id,
|
881 |
+
'ev_ids' => $ev_ids_inline,
|
882 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
883 |
+
'many_sp_calendar' => $many_sp_calendar,
|
884 |
+
'cur_page_url' => $path_sp_cal,
|
885 |
+
'widget' => $widget,
|
886 |
+
'TB_iframe' => 1,
|
887 |
+
'tbWidth' => $popup_width,
|
888 |
+
'tbHeight' => $popup_height,
|
889 |
+
), admin_url('admin-ajax.php')) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
890 |
+
</a>';
|
891 |
+
break;
|
892 |
+
}
|
893 |
+
$r++;
|
894 |
+
}
|
895 |
+
echo ' </div>
|
896 |
+
</td>';
|
897 |
+
}
|
898 |
+
else {
|
899 |
+
|
900 |
+
echo ' <td class="calsun_days" style="padding:0; font-size:' . $sundays_font_size . 'px; margin:0;line-height:1.3;font-family:tahoma;padding-left: 5px; border: 3px solid ' . $current_day_border_color . ' !important">
|
901 |
+
<b>' . $i . '</b>
|
902 |
+
</td>';
|
903 |
+
}
|
904 |
+
}
|
905 |
+
else
|
906 |
+
|
907 |
+
if (in_array($i, $array_days)) {
|
908 |
+
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px;">
|
909 |
+
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>
|
910 |
+
<div style="background-color:' . $ev_title_bg_color . '">';
|
911 |
+
$r = 0;
|
912 |
+
for ($j = 0; $j < $k; $j++) {
|
913 |
+
if(category_color($ev_id[$j])=='#')
|
914 |
+
$cat_color=$bg_top;
|
915 |
+
else
|
916 |
+
$cat_color=category_color($ev_id[$j]);
|
917 |
+
|
918 |
+
if ($r < $number_of_shown_evetns) {
|
919 |
+
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
920 |
+
href="' . add_query_arg(array(
|
921 |
+
'action' => 'spidercalendarbig',
|
922 |
+
'theme_id' => $theme_id,
|
923 |
+
'calendar_id' => $calendar_id,
|
924 |
+
'ev_ids' => $ev_ids_inline,
|
925 |
+
'eventID' => $ev_id[$j],
|
926 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
927 |
+
'many_sp_calendar' => $many_sp_calendar,
|
928 |
+
'cur_page_url' => $path_sp_cal,
|
929 |
+
'widget' => $widget,
|
930 |
+
'TB_iframe' => 1,
|
931 |
+
'tbWidth' => $popup_width,
|
932 |
+
'tbHeight' => $popup_height,
|
933 |
+
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
934 |
+
</a>';
|
935 |
+
}
|
936 |
+
else {
|
937 |
+
echo '
|
938 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_color . ';text-align:center;"
|
939 |
+
href="' . add_query_arg(array(
|
940 |
+
'action' => 'spiderseemore',
|
941 |
+
'theme_id' => $theme_id,
|
942 |
+
'calendar_id' => $calendar_id,
|
943 |
+
'ev_ids' => $ev_ids_inline,
|
944 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
945 |
+
'many_sp_calendar' => $many_sp_calendar,
|
946 |
+
'cur_page_url' => $path_sp_cal,
|
947 |
+
'widget' => $widget,
|
948 |
+
'TB_iframe' => 1,
|
949 |
+
'tbWidth' => $popup_width,
|
950 |
+
'tbHeight' => $popup_height,
|
951 |
+
), admin_url('admin-ajax.php')) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
952 |
+
</a>';
|
953 |
+
break;
|
954 |
+
}
|
955 |
+
$r++;
|
956 |
+
}
|
957 |
+
echo ' </div>
|
958 |
+
</td>';
|
959 |
+
}
|
960 |
+
else {
|
961 |
+
echo ' <td class="calsun_days" style="padding:0; margin:0;line-height:1.3;font-family: tahoma;padding-left: 5px;font-size:' . $sundays_font_size . 'px">
|
962 |
+
<b>' . $i . '</b>
|
963 |
+
</td>';
|
964 |
+
}
|
965 |
+
}
|
966 |
+
else
|
967 |
+
|
968 |
+
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
969 |
+
|
970 |
+
echo ' <td bgcolor="' . $ev_title_bg_color . '" class="cala_day" style="border: 3px solid ' . $current_day_border_color . ' !important;padding:0; margin:0;line-height:15px;">
|
971 |
+
<div class="calborder_day" style="margin:0; padding:0;">
|
972 |
+
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family: tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>
|
973 |
+
<div style="background-color:' . $ev_title_bg_color . '">';
|
974 |
+
$r = 0;
|
975 |
+
for ($j = 0; $j < $k; $j++) {
|
976 |
+
if(category_color($ev_id[$j])=='#')
|
977 |
+
$cat_color=$bg_top;
|
978 |
+
else
|
979 |
+
$cat_color=category_color($ev_id[$j]);
|
980 |
+
|
981 |
+
if ($r < $number_of_shown_evetns) {
|
982 |
+
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
983 |
+
href="' . add_query_arg(array(
|
984 |
+
'action' => 'spidercalendarbig',
|
985 |
+
'theme_id' => $theme_id,
|
986 |
+
'calendar_id' => $calendar_id,
|
987 |
+
'ev_ids' => $ev_ids_inline,
|
988 |
+
'eventID' => $ev_id[$j],
|
989 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
990 |
+
'many_sp_calendar' => $many_sp_calendar,
|
991 |
+
'cur_page_url' => $path_sp_cal,
|
992 |
+
'widget' => $widget,
|
993 |
+
'TB_iframe' => 1,
|
994 |
+
'tbWidth' => $popup_width,
|
995 |
+
'tbHeight' => $popup_height,
|
996 |
+
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
997 |
+
</a>';
|
998 |
+
}
|
999 |
+
else {
|
1000 |
+
echo '
|
1001 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_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 |
+
'cur_page_url' => $path_sp_cal,
|
1010 |
+
'widget' => $widget,
|
1011 |
+
'TB_iframe' => 1,
|
1012 |
+
'tbWidth' => $popup_width,
|
1013 |
+
'tbHeight' => $popup_height,
|
1014 |
+
), admin_url('admin-ajax.php')) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1015 |
+
</a>';
|
1016 |
+
break;
|
1017 |
+
}
|
1018 |
+
$r++;
|
1019 |
+
}
|
1020 |
+
echo ' </div>
|
1021 |
+
</div>
|
1022 |
+
</td>';
|
1023 |
+
}
|
1024 |
+
else {
|
1025 |
+
|
1026 |
+
if ($i ==date( 'j' ) and $month == date('F') and $year == date('Y')) {
|
1027 |
+
|
1028 |
+
|
1029 |
+
if (in_array ($i,$array_days)) {
|
1030 |
+
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px; border: 3px solid ' . $current_day_border_color . ' !important;">
|
1031 |
+
<p style="background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>
|
1032 |
+
<div style="background-color:' . $ev_title_bg_color . '">';
|
1033 |
+
$r = 0;
|
1034 |
+
for ($j = 0; $j < $k; $j++) {
|
1035 |
+
if(category_color($ev_id[$j])=='#')
|
1036 |
+
$cat_color=$bg_top;
|
1037 |
+
else
|
1038 |
+
$cat_color=category_color($ev_id[$j]);
|
1039 |
+
|
1040 |
+
if ($r < $number_of_shown_evetns) {
|
1041 |
+
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
1042 |
+
href="' . add_query_arg(array(
|
1043 |
+
'action' => 'spidercalendarbig',
|
1044 |
+
'theme_id' => $theme_id,
|
1045 |
+
'calendar_id' => $calendar_id,
|
1046 |
+
'ev_ids' => $ev_ids_inline,
|
1047 |
+
'eventID' => $ev_id[$j],
|
1048 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1049 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1050 |
+
'cur_page_url' => $path_sp_cal,
|
1051 |
+
'widget' => $widget,
|
1052 |
+
'TB_iframe' => 1,
|
1053 |
+
'tbWidth' => $popup_width,
|
1054 |
+
'tbHeight' => $popup_height,
|
1055 |
+
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
1056 |
+
</a>';
|
1057 |
+
}
|
1058 |
+
else {
|
1059 |
+
echo '
|
1060 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none;color:' . $event_title_color . ';text-align:center;"
|
1061 |
+
href="' . add_query_arg(array(
|
1062 |
+
'action' => 'spiderseemore',
|
1063 |
+
'theme_id' => $theme_id,
|
1064 |
+
'calendar_id' => $calendar_id,
|
1065 |
+
'ev_ids' => $ev_ids_inline,
|
1066 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1067 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1068 |
+
'cur_page_url' => $path_sp_cal,
|
1069 |
+
'widget' => $widget,
|
1070 |
+
'TB_iframe' => 1,
|
1071 |
+
'tbWidth' => $popup_width,
|
1072 |
+
'tbHeight' => $popup_height,
|
1073 |
+
), admin_url('admin-ajax.php')) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1074 |
+
</a>';
|
1075 |
+
break;
|
1076 |
+
}
|
1077 |
+
$r++;
|
1078 |
+
}
|
1079 |
+
echo ' </div>
|
1080 |
+
</td>';
|
1081 |
+
}
|
1082 |
+
else {
|
1083 |
+
echo ' <td style="color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:15px; border: 3px solid ' . $current_day_border_color . ' !important; vertical-align:top;">
|
1084 |
+
<p style="font-size:'.$other_days_font_size.'px;line-height:1.3;font-family: tahoma;padding-left: 5px;">' . $i . '</p>
|
1085 |
+
</td>';
|
1086 |
+
}
|
1087 |
+
}
|
1088 |
+
else
|
1089 |
+
|
1090 |
+
if (in_array($i, $array_days)) {
|
1091 |
+
echo ' <td class="cala_day" style="background-color:' . $ev_title_bg_color . ';padding:0; margin:0;line-height:15px;">
|
1092 |
+
<p style="background-color:' . $evented_color_bg . ';background-color:' . $evented_color_bg . ';color:' . $evented_color . ';font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;text-shadow: 1px 1px white;">' . $i . '</p>';
|
1093 |
+
$r = 0;
|
1094 |
+
echo ' <div>';
|
1095 |
+
for ($j = 0; $j < $k; $j++) {
|
1096 |
+
|
1097 |
+
if(category_color($ev_id[$j])=='#')
|
1098 |
+
$cat_color=$bg_top;
|
1099 |
+
else
|
1100 |
+
$cat_color=category_color($ev_id[$j]);
|
1101 |
+
|
1102 |
+
if ($r < $number_of_shown_evetns) {
|
1103 |
+
echo ' <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none; color:' . $event_title_color . ';"
|
1104 |
+
href="' . add_query_arg(array(
|
1105 |
+
'action' => 'spidercalendarbig',
|
1106 |
+
'theme_id' => $theme_id,
|
1107 |
+
'calendar_id' => $calendar_id,
|
1108 |
+
'ev_ids' => $ev_ids_inline,
|
1109 |
+
'eventID' => $ev_id[$j],
|
1110 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1111 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1112 |
+
'cur_page_url' => $path_sp_cal,
|
1113 |
+
'widget' => $widget,
|
1114 |
+
'TB_iframe' => 1,
|
1115 |
+
'tbWidth' => $popup_width,
|
1116 |
+
'tbHeight' => $popup_height,
|
1117 |
+
), admin_url('admin-ajax.php')) . '"><b>' . style($ev_title[$j],$cat_color) . '</b>
|
1118 |
+
</a>';
|
1119 |
+
}
|
1120 |
+
else {
|
1121 |
+
echo ' <p><a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:11px; background:none; color:' . $event_title_color . ';text-align:center;"
|
1122 |
+
href="' . add_query_arg(array(
|
1123 |
+
'action' => 'spiderseemore',
|
1124 |
+
'theme_id' => $theme_id,
|
1125 |
+
'calendar_id' => $calendar_id,
|
1126 |
+
'ev_ids' => $ev_ids_inline,
|
1127 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
1128 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1129 |
+
'cur_page_url' => $path_sp_cal,
|
1130 |
+
'widget' => $widget,
|
1131 |
+
'TB_iframe' => 1,
|
1132 |
+
'tbWidth' => $popup_width,
|
1133 |
+
'tbHeight' => $popup_height,
|
1134 |
+
), admin_url('admin-ajax.php')) . '"><b>' . __('See more', 'sp_calendar') . '</b>
|
1135 |
+
</a></p>';
|
1136 |
+
break;
|
1137 |
+
}
|
1138 |
+
$r++;
|
1139 |
+
}
|
1140 |
+
echo ' </div>
|
1141 |
+
</td>';
|
1142 |
+
}
|
1143 |
+
else {
|
1144 |
+
echo ' <td style=" color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:15px;border: 1px solid ' . $cell_border_color . ' !important;vertical-align:top;">
|
1145 |
+
<p style="font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;">' . $i . '</p>
|
1146 |
+
</td>';
|
1147 |
+
}
|
1148 |
+
}
|
1149 |
+
if ($weekday_i % 7 == 0 && $i <> $month_days) {
|
1150 |
+
echo ' </tr>
|
1151 |
+
<tr height="' . $cell_height . '" style="line-height:15px">';
|
1152 |
+
$weekday_i = 0;
|
1153 |
+
}
|
1154 |
+
$weekday_i += 1;
|
1155 |
+
}
|
1156 |
+
$weekday_i;
|
1157 |
+
$next_i = 1;
|
1158 |
+
if ($weekday_i != 1) {
|
1159 |
+
for ($i = $weekday_i; $i <= 7; $i++) {
|
1160 |
+
if ($i != 7) {
|
1161 |
+
echo ' <td class="caltext_color_other_months" style="font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;background-color:' . $bg_color_other_months . ';">' . $next_i . '</td>';
|
1162 |
+
}
|
1163 |
+
else {
|
1164 |
+
echo ' <td class="caltext_color_other_months" style="font-size:' . $other_days_font_size . 'px;line-height:1.3;font-family:tahoma;padding-left: 5px;background-color:' . $bg_color_other_months . ';">' . $next_i . '</td>';
|
1165 |
+
}
|
1166 |
+
$next_i += 1;
|
1167 |
+
}
|
1168 |
+
}
|
1169 |
+
echo ' </tr>
|
1170 |
+
</table>';
|
1171 |
+
?> <input type="text" value="1" name="day" style="display:none" />
|
1172 |
+
</td>
|
1173 |
+
</tr>
|
1174 |
+
</table>
|
1175 |
+
</td>
|
1176 |
+
</tr>
|
1177 |
+
</table>
|
1178 |
+
|
1179 |
+
<script>
|
1180 |
+
|
1181 |
+
jQuery(document).ready(function (){
|
1182 |
+
|
1183 |
+
jQuery('#views_select').click(function () {
|
1184 |
+
jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
|
1185 |
+
}, function () {
|
1186 |
+
jQuery('#drop_down_views').stop(true, true).slideUp(500);
|
1187 |
+
});
|
1188 |
+
if(jQuery(window).width() > 640 )
|
1189 |
+
{
|
1190 |
+
jQuery('drop_down_views').hide();
|
1191 |
+
}
|
1192 |
+
});
|
1193 |
+
</script>
|
1194 |
+
|
1195 |
+
|
1196 |
+
<style>
|
1197 |
+
|
1198 |
+
@media only screen and (max-width : 640px) {
|
1199 |
+
|
1200 |
+
#views_tabs ,#drop_down_views
|
1201 |
+
{
|
1202 |
+
display:none;
|
1203 |
+
}
|
1204 |
+
|
1205 |
+
#views_tabs_select
|
1206 |
+
{
|
1207 |
+
display:block !important;
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
|
1211 |
+
|
1212 |
+
}
|
1213 |
+
|
1214 |
+
@media only screen and (max-width : 968px) {
|
1215 |
+
#cats >li
|
1216 |
+
{
|
1217 |
+
float:none;
|
1218 |
+
}
|
1219 |
+
|
1220 |
+
|
1221 |
+
|
1222 |
+
}
|
1223 |
+
|
1224 |
+
|
1225 |
+
.categories1 , .categories2
|
1226 |
+
{
|
1227 |
+
display:inline-block;
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
.categories2
|
1231 |
+
{
|
1232 |
+
position:relative;
|
1233 |
+
left: -9px;
|
1234 |
+
cursor:pointer;
|
1235 |
+
}
|
1236 |
+
.categories2:first-letter
|
1237 |
+
{
|
1238 |
+
color:#fff;
|
1239 |
+
|
1240 |
+
}
|
1241 |
+
</style>
|
1242 |
+
<?php
|
1243 |
+
|
1244 |
+
//reindex cat_ids_array
|
1245 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
1246 |
+
|
1247 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
1248 |
+
{
|
1249 |
+
echo'
|
1250 |
+
<style>
|
1251 |
+
#cats #category'.$re_cat_ids_array[$i].'
|
1252 |
+
{
|
1253 |
+
text-decoration:underline;
|
1254 |
+
cursor:pointer;
|
1255 |
+
|
1256 |
+
}
|
1257 |
+
|
1258 |
+
</style>';
|
1259 |
+
|
1260 |
+
}
|
1261 |
+
|
1262 |
+
|
1263 |
+
|
1264 |
+
if($cat_ids=='')
|
1265 |
+
$cat_ids='';
|
1266 |
+
|
1267 |
+
|
1268 |
+
echo '<ul id="cats" style="list-style-type:none;">';
|
1269 |
+
|
1270 |
+
foreach($categories as $category)
|
1271 |
+
{
|
1272 |
+
|
1273 |
+
?>
|
1274 |
+
|
1275 |
+
<li style="float:left;"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1276 |
+
'action' => 'spiderbigcalendar_month',
|
1277 |
+
'theme_id' => $theme_id,
|
1278 |
+
'calendar' => $calendar_id,
|
1279 |
+
'select' => $view_select,
|
1280 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
1281 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1282 |
+
'cur_page_url' => $path_sp_cal,
|
1283 |
+
'cat_id' => $category->id,
|
1284 |
+
'cat_ids' => $cat_ids,
|
1285 |
+
'widget' => $widget,
|
1286 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1287 |
+
|
1288 |
+
|
1289 |
+
<?php
|
1290 |
+
|
1291 |
+
|
1292 |
+
}
|
1293 |
+
|
1294 |
+
echo '</ul><br><br>';
|
1295 |
+
die();
|
1296 |
+
}
|
1297 |
+
|
1298 |
?>
|
front_end/bigcalendarmonth_widget.php
CHANGED
@@ -1,988 +1,988 @@
|
|
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 |
-
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
-
|
13 |
-
///////////////////////////////////////////////////////////////////////////////////
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
if(isset($_GET['cat_id']))
|
18 |
-
$cat_id = $_GET['cat_id'];
|
19 |
-
else $cat_id = "";
|
20 |
-
|
21 |
-
if(isset($_GET['cat_ids']))
|
22 |
-
$cat_ids = $_GET['cat_ids'];
|
23 |
-
else $cat_ids = "";
|
24 |
-
|
25 |
-
if($cat_ids=='')
|
26 |
-
$cat_ids .= $cat_id.',';
|
27 |
-
else
|
28 |
-
$cat_ids .= ','.$cat_id.',';
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
33 |
-
|
34 |
-
function getelementcountinarray($array , $element)
|
35 |
-
{
|
36 |
-
$t=0;
|
37 |
-
|
38 |
-
for($i=0; $i<count($array); $i++)
|
39 |
-
{
|
40 |
-
if($element==$array[$i])
|
41 |
-
$t++;
|
42 |
-
|
43 |
-
}
|
44 |
-
|
45 |
-
|
46 |
-
return $t;
|
47 |
-
|
48 |
-
}
|
49 |
-
|
50 |
-
function getelementindexinarray($array , $element)
|
51 |
-
{
|
52 |
-
|
53 |
-
$t='';
|
54 |
-
|
55 |
-
for($i=0; $i<count($array); $i++)
|
56 |
-
{
|
57 |
-
if($element==$array[$i])
|
58 |
-
$t.=$i.',';
|
59 |
-
|
60 |
-
}
|
61 |
-
|
62 |
-
return $t;
|
63 |
-
|
64 |
-
|
65 |
-
}
|
66 |
-
$cat_ids_array = explode(',',$cat_ids);
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
if($cat_id!='')
|
71 |
-
{
|
72 |
-
|
73 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
74 |
-
{
|
75 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
76 |
-
$index_array = explode(',' , $index_in_line);
|
77 |
-
array_pop ($index_array);
|
78 |
-
for($j=0; $j<count($index_array); $j++)
|
79 |
-
unset($cat_ids_array[$index_array[$j]]);
|
80 |
-
$cat_ids = implode(',',$cat_ids_array);
|
81 |
-
}
|
82 |
-
}
|
83 |
-
else
|
84 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
85 |
-
|
86 |
-
|
87 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
88 |
-
|
89 |
-
|
90 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
91 |
-
$weekstart = $theme->week_start_day;
|
92 |
-
$bg = '#' . $theme->header_bgcolor;
|
93 |
-
$bg_color_selected = '#' . $theme->bg_color_selected;
|
94 |
-
$color_arrow = '#' . $theme->arrow_color;
|
95 |
-
$evented_color = '#' . $theme->text_color_this_month_evented;
|
96 |
-
$evented_color_bg = '#' . $theme->bg_color_this_month_evented;
|
97 |
-
$sun_days = '#' . $theme->text_color_sun_days;
|
98 |
-
$text_color_other_months = '#' . $theme->text_color_other_months;
|
99 |
-
$text_color_this_month_unevented = '#' . $theme->text_color_this_month_unevented;
|
100 |
-
$text_color_month = '#' . $theme->text_color_month;
|
101 |
-
$color_week_days = '#' . $theme->text_color_week_days;
|
102 |
-
$text_color_selected = '#' . $theme->text_color_selected;
|
103 |
-
$border_day = '#' . $theme->border_day;
|
104 |
-
$calendar_width = $theme->width;
|
105 |
-
$calendar_bg = '#' . $theme->footer_bgcolor;
|
106 |
-
$weekdays_bg_color = '#' . $theme->weekdays_bg_color;
|
107 |
-
$weekday_su_bg_color = '#' . $theme->su_bg_color;
|
108 |
-
$cell_border_color = '#' . $theme->cell_border_color;
|
109 |
-
$year_font_size = $theme->year_font_size;
|
110 |
-
$year_font_color = '#' . $theme->year_font_color;
|
111 |
-
$year_tabs_bg_color = '#' . $theme->year_tabs_bg_color;
|
112 |
-
$font_year = $theme->font_year;
|
113 |
-
$font_month = $theme->font_month;
|
114 |
-
$font_day = $theme->font_day;
|
115 |
-
$font_weekday = $theme->font_weekday;
|
116 |
-
|
117 |
-
$popup_width = $theme->popup_width;
|
118 |
-
$popup_height = $theme->popup_height;
|
119 |
-
|
120 |
-
__('January', 'sp_calendar');
|
121 |
-
__('February', 'sp_calendar');
|
122 |
-
__('March', 'sp_calendar');
|
123 |
-
__('April', 'sp_calendar');
|
124 |
-
__('May', 'sp_calendar');
|
125 |
-
__('June', 'sp_calendar');
|
126 |
-
__('July', 'sp_calendar');
|
127 |
-
__('August', 'sp_calendar');
|
128 |
-
__('September', 'sp_calendar');
|
129 |
-
__('October', 'sp_calendar');
|
130 |
-
__('November', 'sp_calendar');
|
131 |
-
__('December', 'sp_calendar');
|
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 |
-
$view = 'bigcalendarmonth_widget';
|
156 |
-
$views = explode(',', $view_select);
|
157 |
-
$defaultview = 'month';
|
158 |
-
array_pop($views);
|
159 |
-
$display = '';
|
160 |
-
if (count($views) == 0) {
|
161 |
-
$display = "display:none";
|
162 |
-
}
|
163 |
-
if(count($views) == 1 && $views[0] == $defaultview) {
|
164 |
-
$display = "display:none";
|
165 |
-
}
|
166 |
-
?>
|
167 |
-
<style type='text/css'>
|
168 |
-
#calendar_<?php echo $many_sp_calendar; ?> table {
|
169 |
-
border-collapse: initial;
|
170 |
-
border:0px;
|
171 |
-
}
|
172 |
-
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
173 |
-
padding: 0px;
|
174 |
-
vertical-align: none;
|
175 |
-
border-top:none;
|
176 |
-
line-height: none;
|
177 |
-
text-align: none;
|
178 |
-
}
|
179 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
180 |
-
border:1px solid <?php echo $cell_border_color; ?>;
|
181 |
-
font-family: <?php echo $font_day; ?>;
|
182 |
-
}
|
183 |
-
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
184 |
-
margin-bottom: 0;
|
185 |
-
}
|
186 |
-
#calendar_<?php echo $many_sp_calendar; ?> td,
|
187 |
-
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
188 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> td,
|
189 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> tr {
|
190 |
-
border:none;
|
191 |
-
}
|
192 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
193 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
194 |
-
color: <?php echo $color_arrow; ?>;
|
195 |
-
text-decoration: none;
|
196 |
-
background: none;
|
197 |
-
font-size: 16px;
|
198 |
-
}
|
199 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
200 |
-
color: <?php echo $color_arrow; ?>;
|
201 |
-
text-decoration:none;
|
202 |
-
background:none;
|
203 |
-
}
|
204 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
205 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
206 |
-
text-decoration:underline;
|
207 |
-
background:none;
|
208 |
-
font-size:11px;
|
209 |
-
}
|
210 |
-
#calendar_<?php echo $many_sp_calendar; ?> a {
|
211 |
-
font-weight: normal;
|
212 |
-
}
|
213 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
214 |
-
font-size:12px;
|
215 |
-
text-decoration:none;
|
216 |
-
background:none;
|
217 |
-
}
|
218 |
-
|
219 |
-
|
220 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
221 |
-
border-spacing:0;
|
222 |
-
width:100%;
|
223 |
-
}
|
224 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
225 |
-
border-spacing: 0;
|
226 |
-
vertical-align: middle;
|
227 |
-
width: 100%;
|
228 |
-
}
|
229 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
230 |
-
background-color:<?php echo $bg; ?>;
|
231 |
-
text-align:center;
|
232 |
-
vertical-align: middle;
|
233 |
-
}
|
234 |
-
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
235 |
-
color:<?php echo $text_color_other_months; ?>;
|
236 |
-
}
|
237 |
-
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
238 |
-
color:<?php echo $text_color_this_month_unevented; ?>;
|
239 |
-
}
|
240 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
241 |
-
color:<?php echo $sun_days; ?>;
|
242 |
-
}
|
243 |
-
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
244 |
-
border: solid <?php echo $border_day; ?> 1px;
|
245 |
-
}
|
246 |
-
#TB_window {
|
247 |
-
z-index: 10000;
|
248 |
-
}
|
249 |
-
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
250 |
-
float: right;
|
251 |
-
background-color: <?php echo $calendar_bg; ?>;
|
252 |
-
height: 25px;
|
253 |
-
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
254 |
-
margin-left: 2px;
|
255 |
-
text-align: center;
|
256 |
-
cursor: pointer;
|
257 |
-
position: relative;
|
258 |
-
top: 3px;
|
259 |
-
font-family: <?php echo $font_month; ?>;
|
260 |
-
}
|
261 |
-
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
262 |
-
background: transparent !important;
|
263 |
-
}
|
264 |
-
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
265 |
-
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
266 |
-
{
|
267 |
-
|
268 |
-
background-color: <?php echo $views_tabs_bg_color?> ;
|
269 |
-
width: 120px;
|
270 |
-
text-align: center;
|
271 |
-
cursor: pointer;
|
272 |
-
padding: 6px;
|
273 |
-
position: relative;
|
274 |
-
}
|
275 |
-
|
276 |
-
|
277 |
-
#drop_down_views
|
278 |
-
{
|
279 |
-
list-style-type:none !important;
|
280 |
-
position: absolute;
|
281 |
-
top: 46px;
|
282 |
-
left: -15px;
|
283 |
-
display:none;
|
284 |
-
z-index: 4545;
|
285 |
-
|
286 |
-
}
|
287 |
-
|
288 |
-
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
289 |
-
{
|
290 |
-
background:<?php echo $bg_top ?>;
|
291 |
-
}
|
292 |
-
|
293 |
-
#drop_down_views >li
|
294 |
-
{
|
295 |
-
border-bottom:1px solid #fff !important;
|
296 |
-
}
|
297 |
-
|
298 |
-
|
299 |
-
#views_tabs_select
|
300 |
-
{
|
301 |
-
display:none;
|
302 |
-
}
|
303 |
-
|
304 |
-
</style>
|
305 |
-
|
306 |
-
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
307 |
-
<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; ?>">
|
308 |
-
<tr style="background-color:#FFFFFF;">
|
309 |
-
<td style="background-color:#FFFFFF;">
|
310 |
-
<div id="views_tabs" style="<?php echo $display; ?>">
|
311 |
-
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
312 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
313 |
-
'action' => 'spiderbigcalendar_day_widget',
|
314 |
-
'theme_id' => $theme_id,
|
315 |
-
'calendar' => $calendar_id,
|
316 |
-
'select' => $view_select,
|
317 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
318 |
-
'many_sp_calendar' => $many_sp_calendar,
|
319 |
-
'cur_page_url' => $path_sp_cal,
|
320 |
-
'cat_id' => '',
|
321 |
-
'cat_ids' => $cat_ids,
|
322 |
-
'widget' => $widget,
|
323 |
-
'rand' => $many_sp_calendar,
|
324 |
-
), admin_url('admin-ajax.php'));?>','<?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>
|
325 |
-
</div>
|
326 |
-
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ';height:28px;top:0;' ?>"
|
327 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
328 |
-
'action' => 'spiderbigcalendar_week_widget',
|
329 |
-
'theme_id' => $theme_id,
|
330 |
-
'calendar' => $calendar_id,
|
331 |
-
'select' => $view_select,
|
332 |
-
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
333 |
-
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
334 |
-
'many_sp_calendar' => $many_sp_calendar,
|
335 |
-
'cur_page_url' => $path_sp_cal,
|
336 |
-
'cat_id' => '',
|
337 |
-
'cat_ids' => $cat_ids,
|
338 |
-
'widget' => $widget,
|
339 |
-
), admin_url('admin-ajax.php'));?>','<?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>
|
340 |
-
</div>
|
341 |
-
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
342 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
343 |
-
'action' => 'spiderbigcalendar_list_widget',
|
344 |
-
'theme_id' => $theme_id,
|
345 |
-
'calendar' => $calendar_id,
|
346 |
-
'select' => $view_select,
|
347 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
348 |
-
'many_sp_calendar' => $many_sp_calendar,
|
349 |
-
'cur_page_url' => $path_sp_cal,
|
350 |
-
'cat_id' => '',
|
351 |
-
'cat_ids' => $cat_ids,
|
352 |
-
'widget' => $widget,
|
353 |
-
), admin_url('admin-ajax.php'));?>','<?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>
|
354 |
-
</div>
|
355 |
-
<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 . ';height:28px;top:0;'; ?>"
|
356 |
-
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
357 |
-
'action' => 'spiderbigcalendar_month_widget',
|
358 |
-
'theme_id' => $theme_id,
|
359 |
-
'calendar' => $calendar_id,
|
360 |
-
'select' => $view_select,
|
361 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
362 |
-
'many_sp_calendar' => $many_sp_calendar,
|
363 |
-
'cur_page_url' => $path_sp_cal,
|
364 |
-
'cat_id' => '',
|
365 |
-
'cat_ids' => $cat_ids,
|
366 |
-
'widget' => $widget,
|
367 |
-
), admin_url('admin-ajax.php'));?>','<?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>
|
368 |
-
</div>
|
369 |
-
</div>
|
370 |
-
</td>
|
371 |
-
</tr>
|
372 |
-
<tr>
|
373 |
-
<td width="100%" style="padding:0; margin:0;">
|
374 |
-
<form action="" method="get" style="background:none; margin:0; padding:0;">
|
375 |
-
<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">
|
376 |
-
<tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
|
377 |
-
<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%;" >
|
378 |
-
<?php //MONTH TABLE ?>
|
379 |
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
|
380 |
-
<tr>
|
381 |
-
<td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
382 |
-
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
383 |
-
if (Month_num($month) == 1) {
|
384 |
-
$needed_date = ($year - 1) . '-12';
|
385 |
-
}
|
386 |
-
else {
|
387 |
-
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
388 |
-
}
|
389 |
-
echo add_query_arg(array(
|
390 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
391 |
-
'theme_id' => $theme_id,
|
392 |
-
'calendar' => $calendar_id,
|
393 |
-
'select' => $view_select,
|
394 |
-
'date' => $needed_date,
|
395 |
-
'many_sp_calendar' => $many_sp_calendar,
|
396 |
-
'cur_page_url' => $path_sp_cal,
|
397 |
-
'cat_id' => '',
|
398 |
-
'cat_ids' => $cat_ids,
|
399 |
-
'widget' => $widget,
|
400 |
-
), admin_url('admin-ajax.php'));
|
401 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◄
|
402 |
-
</a>
|
403 |
-
</td>
|
404 |
-
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
405 |
-
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
406 |
-
<span style="font-size:<?php echo $year_font_size; ?>px;?>; color:<?php echo $text_color_month; ?>;"><?php echo __($month, 'sp_calendar'); ?></span>
|
407 |
-
</td>
|
408 |
-
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
409 |
-
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
410 |
-
if (Month_num($month) == 12) {
|
411 |
-
|
412 |
-
$needed_date = ($year + 1) . '-01';
|
413 |
-
}
|
414 |
-
else {
|
415 |
-
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
416 |
-
}
|
417 |
-
echo add_query_arg(array(
|
418 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
419 |
-
'theme_id' => $theme_id,
|
420 |
-
'calendar' => $calendar_id,
|
421 |
-
'select' => $view_select,
|
422 |
-
'date' => $needed_date,
|
423 |
-
'many_sp_calendar' => $many_sp_calendar,
|
424 |
-
'cur_page_url' => $path_sp_cal,
|
425 |
-
'cat_id' => '',
|
426 |
-
'cat_ids' => $cat_ids,
|
427 |
-
'widget' => $widget,
|
428 |
-
), admin_url('admin-ajax.php'));
|
429 |
-
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">►
|
430 |
-
</a>
|
431 |
-
</td>
|
432 |
-
</tr>
|
433 |
-
</table>
|
434 |
-
</td>
|
435 |
-
</tr>
|
436 |
-
<tr class="cell_body" align="center" height="10%" style="background-color:<?php echo $weekdays_bg_color; ?> !important;width:<?php echo $calendar_width; ?>px">
|
437 |
-
<?php if ($weekstart == "su") { ?>
|
438 |
-
<td style="font-family:<?php echo $font_weekday; ?>;background-color:<?php echo $weekday_su_bg_color; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
439 |
-
<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>
|
440 |
-
</td>
|
441 |
-
<?php } ?>
|
442 |
-
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
443 |
-
<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>
|
444 |
-
</td>
|
445 |
-
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
446 |
-
<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>
|
447 |
-
</td>
|
448 |
-
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
449 |
-
<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>
|
450 |
-
</td>
|
451 |
-
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
452 |
-
<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>
|
453 |
-
</td>
|
454 |
-
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
455 |
-
<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>
|
456 |
-
</td>
|
457 |
-
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
458 |
-
<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>
|
459 |
-
</td>
|
460 |
-
<?php if ($weekstart == "mo") { ?>
|
461 |
-
<td style="font-family:<?php echo $font_weekday; ?>;background-color:<?php echo $weekday_su_bg_color; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
462 |
-
<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>
|
463 |
-
</td>
|
464 |
-
<?php } ?>
|
465 |
-
</tr>
|
466 |
-
<?php
|
467 |
-
|
468 |
-
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
469 |
-
if ($weekstart == "su") {
|
470 |
-
$month_first_weekday++;
|
471 |
-
if ($month_first_weekday == 8) {
|
472 |
-
$month_first_weekday = 1;
|
473 |
-
}
|
474 |
-
}
|
475 |
-
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
476 |
-
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
477 |
-
$weekday_i = $month_first_weekday;
|
478 |
-
$last_month_days = $last_month_days - $weekday_i + 2;
|
479 |
-
$percent = 1;
|
480 |
-
$sum = $month_days - 8 + $month_first_weekday;
|
481 |
-
if ($sum % 7 <> 0) {
|
482 |
-
$percent = $percent + 1;
|
483 |
-
}
|
484 |
-
$sum = $sum - ($sum % 7);
|
485 |
-
$percent = $percent + ($sum / 7);
|
486 |
-
$percent = 107 / $percent;
|
487 |
-
|
488 |
-
$all_calendar_files = php_getdays(1, $calendar_id, $date, $theme_id, $widget);
|
489 |
-
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
490 |
-
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
491 |
-
$array_days = $all_calendar_files[0]['array_days'];
|
492 |
-
|
493 |
-
$array_days1 = $all_calendar_files[0]['array_days1'];
|
494 |
-
$title = $all_calendar_files[0]['title'];
|
495 |
-
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
496 |
-
echo ' <tr class="cell_body" height="' . $percent . 'px" style="line-height:' . $percent . 'px">';
|
497 |
-
for ($i = 1; $i < $weekday_i; $i++) {
|
498 |
-
echo ' <td class="caltext_color_other_months" style="text-align:center;">' . $last_month_days . '</td>';
|
499 |
-
$last_month_days = $last_month_days + 1;
|
500 |
-
}
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
for ($i = 1; $i <= $month_days; $i++) {
|
505 |
-
if (isset($title[$i])) {
|
506 |
-
$ev_title = explode('</p>', $title[$i]);
|
507 |
-
array_pop($ev_title);
|
508 |
-
$k = count($ev_title);
|
509 |
-
$ev_id = explode('<br>', $ev_ids[$i]);
|
510 |
-
array_pop($ev_id);
|
511 |
-
$ev_ids_inline = implode(',', $ev_id);
|
512 |
-
}
|
513 |
-
else
|
514 |
-
$k=0;
|
515 |
-
|
516 |
-
if(isset($ev_ids_inline)){
|
517 |
-
if($cat_ids!='')
|
518 |
-
$query = "SELECT DISTINCT sec.color FROM " . $wpdb->prefix . "spidercalendar_event AS se JOIN
|
519 |
-
" . $wpdb->prefix . "spidercalendar_event_category AS sec ON se.category=sec.id WHERE se.published='1' AND sec.published='1' AND se.calendar
|
520 |
-
else
|
521 |
-
$query = "SELECT DISTINCT sec.color FROM " . $wpdb->prefix . "spidercalendar_event AS se JOIN
|
522 |
-
" . $wpdb->prefix . "spidercalendar_event_category AS sec ON se.category=sec.id WHERE se.published='1' AND sec.published='1' AND se.calendar
|
523 |
-
|
524 |
-
$categ_color=$wpdb->get_results($query);
|
525 |
-
}
|
526 |
-
|
527 |
-
if (($weekday_i % 7 == 0 and $weekstart == "mo") or ($weekday_i % 7 == 1 and $weekstart == "su")) {
|
528 |
-
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
529 |
-
|
530 |
-
echo ' <td class="cala_day" style="background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
531 |
-
<div class="calborder_day" style="text-align:center; width:' . $cell_width . 'px; margin:0; padding:0;">
|
532 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-decoration:underline;"
|
533 |
-
href="' . add_query_arg(array(
|
534 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
535 |
-
'theme_id' => $theme_id,
|
536 |
-
'calendar_id' => $calendar_id,
|
537 |
-
'ev_ids' => $ev_ids_inline,
|
538 |
-
'eventID' => $ev_id[0],
|
539 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
540 |
-
'many_sp_calendar' => $many_sp_calendar,
|
541 |
-
'cur_page_url' => $path_sp_cal,
|
542 |
-
'widget' => $widget,
|
543 |
-
'TB_iframe' => 1,
|
544 |
-
'tbWidth' => $popup_width,
|
545 |
-
'tbHeight' => $popup_height,
|
546 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
547 |
-
</a>
|
548 |
-
</div>
|
549 |
-
</td>';
|
550 |
-
}
|
551 |
-
elseif ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
552 |
-
if (in_array($i, $array_days)) {
|
553 |
-
if (in_array ($i, $array_days1)) {
|
554 |
-
echo '
|
555 |
-
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
556 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . ';text-align:center;text-decoration:underline;"
|
557 |
-
href="' . add_query_arg(array(
|
558 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
559 |
-
'theme_id' => $theme_id,
|
560 |
-
'calendar_id' => $calendar_id,
|
561 |
-
'ev_ids' => $ev_ids_inline,
|
562 |
-
'eventID' => $ev_id[0],
|
563 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
564 |
-
'many_sp_calendar' => $many_sp_calendar,
|
565 |
-
'cur_page_url' => $path_sp_cal,
|
566 |
-
'widget' => $widget,
|
567 |
-
'TB_iframe' => 1,
|
568 |
-
'tbWidth' => $popup_width,
|
569 |
-
'tbHeight' => $popup_height,
|
570 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
571 |
-
</a>';
|
572 |
-
echo '<table style="width:100%; border:0;margin: 0"><tr>';
|
573 |
-
foreach($categ_color as $color){
|
574 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
575 |
-
}
|
576 |
-
echo '</tr></table>';
|
577 |
-
echo '</td>';
|
578 |
-
}
|
579 |
-
else {
|
580 |
-
echo '
|
581 |
-
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
582 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . ';text-align:center;text-decoration:underline;"
|
583 |
-
href="' . add_query_arg(array(
|
584 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
585 |
-
'theme_id' => $theme_id,
|
586 |
-
'calendar_id' => $calendar_id,
|
587 |
-
'ev_ids' => $ev_ids_inline,
|
588 |
-
'eventID' => $ev_id[0],
|
589 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
590 |
-
'many_sp_calendar' => $many_sp_calendar,
|
591 |
-
'cur_page_url' => $path_sp_cal,
|
592 |
-
'widget' => $widget,
|
593 |
-
'TB_iframe' => 1,
|
594 |
-
'tbWidth' => $popup_width,
|
595 |
-
'tbHeight' => $popup_height,
|
596 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
597 |
-
</a>';
|
598 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
599 |
-
foreach($categ_color as $color){
|
600 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
601 |
-
}
|
602 |
-
echo '</tr></table>';
|
603 |
-
echo '</td>';
|
604 |
-
}
|
605 |
-
}
|
606 |
-
else {
|
607 |
-
echo '
|
608 |
-
<td class="calsun_days" style="color:' . $text_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
609 |
-
<b>' . $i . '</b>
|
610 |
-
</td>';
|
611 |
-
}
|
612 |
-
}
|
613 |
-
else {
|
614 |
-
if (in_array ($i, $array_days)) {
|
615 |
-
if (in_array ($i, $array_days1)) {
|
616 |
-
|
617 |
-
echo '
|
618 |
-
<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
619 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . ';text-align:center;text-decoration:underline;"
|
620 |
-
href="' . add_query_arg(array(
|
621 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
622 |
-
'theme_id' => $theme_id,
|
623 |
-
'calendar_id' => $calendar_id,
|
624 |
-
'ev_ids' => $ev_ids_inline,
|
625 |
-
'eventID' => $ev_id[0],
|
626 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
627 |
-
'many_sp_calendar' => $many_sp_calendar,
|
628 |
-
'cur_page_url' => $path_sp_cal,
|
629 |
-
'widget' => $widget,
|
630 |
-
'TB_iframe' => 1,
|
631 |
-
'tbWidth' => $popup_width,
|
632 |
-
'tbHeight' => $popup_height,
|
633 |
-
'cat_id' => $cat_ids
|
634 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
635 |
-
</a>';
|
636 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
637 |
-
foreach($categ_color as $color){
|
638 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
639 |
-
}
|
640 |
-
echo '</tr></table>';
|
641 |
-
echo '</td>';
|
642 |
-
}
|
643 |
-
else {
|
644 |
-
echo '
|
645 |
-
<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
646 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . ';text-align:center;text-decoration:underline;"
|
647 |
-
href="' . add_query_arg(array(
|
648 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
649 |
-
'theme_id' => $theme_id,
|
650 |
-
'calendar_id' => $calendar_id,
|
651 |
-
'ev_ids' => $ev_ids_inline,
|
652 |
-
'eventID' => $ev_id[0],
|
653 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
654 |
-
'many_sp_calendar' => $many_sp_calendar,
|
655 |
-
'cur_page_url' => $path_sp_cal,
|
656 |
-
'widget' => $widget,
|
657 |
-
'TB_iframe' => 1,
|
658 |
-
'tbWidth' => $popup_width,
|
659 |
-
'tbHeight' => $popup_height,
|
660 |
-
'cat_id' => $cat_ids
|
661 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
662 |
-
</a>';
|
663 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
664 |
-
foreach($categ_color as $color){
|
665 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
666 |
-
}
|
667 |
-
echo '</tr></table>';
|
668 |
-
echo '</td>';
|
669 |
-
}
|
670 |
-
}
|
671 |
-
else {
|
672 |
-
echo '
|
673 |
-
<td class="calsun_days" style="text-align:center;padding:0; margin:0;line-height:inherit;">
|
674 |
-
<b>' . $i . '</b>
|
675 |
-
</td>';
|
676 |
-
}
|
677 |
-
}
|
678 |
-
}
|
679 |
-
elseif ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
680 |
-
|
681 |
-
if (in_array ($i,$array_days)) {
|
682 |
-
|
683 |
-
echo ' <td style="background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
684 |
-
<div class="calborder_day" style="text-align:center; width:' . $cell_width . 'px; margin:0; padding:0;">
|
685 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-decoration:underline;"
|
686 |
-
href="' . add_query_arg(array(
|
687 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
688 |
-
'theme_id' => $theme_id,
|
689 |
-
'calendar_id' => $calendar_id,
|
690 |
-
'ev_ids' => $ev_ids_inline,
|
691 |
-
'eventID' => $ev_id[0],
|
692 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
693 |
-
'many_sp_calendar' => $many_sp_calendar,
|
694 |
-
'cur_page_url' => $path_sp_cal,
|
695 |
-
'widget' => $widget,
|
696 |
-
'TB_iframe' => 1,
|
697 |
-
'tbWidth' => $popup_width,
|
698 |
-
'tbHeight' => $popup_height,
|
699 |
-
'cat_id' => $cat_ids
|
700 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
701 |
-
</a>';
|
702 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
703 |
-
foreach($categ_color as $color){
|
704 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
705 |
-
}
|
706 |
-
echo '</tr></table>';
|
707 |
-
echo '</td>';
|
708 |
-
}
|
709 |
-
|
710 |
-
else {
|
711 |
-
|
712 |
-
echo '<td style="text-align:center; color:' . $text_color_selected . ';padding:0; margin:0; line-height:inherit; border: 2px solid ' . $border_day . '">
|
713 |
-
<b>' . $i . '</b>
|
714 |
-
</td>';
|
715 |
-
}
|
716 |
-
|
717 |
-
}
|
718 |
-
else {
|
719 |
-
if ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
720 |
-
|
721 |
-
|
722 |
-
if (in_array ($i, $array_days)) {
|
723 |
-
|
724 |
-
|
725 |
-
if (in_array ($i, $array_days1)) {
|
726 |
-
echo '
|
727 |
-
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
728 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-align:center;text-decoration:underline;"
|
729 |
-
href="' . add_query_arg(array(
|
730 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
731 |
-
'theme_id' => $theme_id,
|
732 |
-
'calendar_id' => $calendar_id,
|
733 |
-
'ev_ids' => $ev_ids_inline,
|
734 |
-
'eventID' => $ev_id[0],
|
735 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
736 |
-
'many_sp_calendar' => $many_sp_calendar,
|
737 |
-
'cur_page_url' => $path_sp_cal,
|
738 |
-
'widget' => $widget,
|
739 |
-
'TB_iframe' => 1,
|
740 |
-
'tbWidth' => $popup_width,
|
741 |
-
'tbHeight' => $popup_height,
|
742 |
-
'cat_id' => $cat_ids
|
743 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
744 |
-
</a>';
|
745 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
746 |
-
foreach($categ_color as $color){
|
747 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
748 |
-
}
|
749 |
-
echo '</tr></table>';
|
750 |
-
echo '</td>';
|
751 |
-
}
|
752 |
-
else {
|
753 |
-
echo '
|
754 |
-
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
755 |
-
<a id="cur_day" class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-align:center;text-decoration:underline;"
|
756 |
-
href="' . add_query_arg(array(
|
757 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
758 |
-
'theme_id' => $theme_id,
|
759 |
-
'calendar_id' => $calendar_id,
|
760 |
-
'ev_ids' => $ev_ids_inline,
|
761 |
-
'eventID' => $ev_id[0],
|
762 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
763 |
-
'many_sp_calendar' => $many_sp_calendar,
|
764 |
-
'cur_page_url' => $path_sp_cal,
|
765 |
-
'widget' => $widget,
|
766 |
-
'TB_iframe' => 1,
|
767 |
-
'tbWidth' => $popup_width,
|
768 |
-
'tbHeight' => $popup_height,
|
769 |
-
'cat_id' => $cat_ids
|
770 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b></a>';
|
771 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
772 |
-
foreach($categ_color as $color){
|
773 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
774 |
-
}
|
775 |
-
echo '</tr></table>';
|
776 |
-
echo '</td>';
|
777 |
-
}
|
778 |
-
}
|
779 |
-
else {
|
780 |
-
|
781 |
-
echo '<td style="text-align:center; color:' . $text_color_selected . ';padding:0; margin:0; line-height:inherit; border: 2px solid ' . $border_day . '">
|
782 |
-
<b>' . $i . '</b>
|
783 |
-
</td>';
|
784 |
-
}
|
785 |
-
}
|
786 |
-
elseif (in_array($i, $array_days)) {
|
787 |
-
|
788 |
-
if (in_array ($i, $array_days1)) {
|
789 |
-
echo '<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
790 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . '; text-align:center;text-decoration:underline;"
|
791 |
-
href="' . add_query_arg(array(
|
792 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
793 |
-
'theme_id' => $theme_id,
|
794 |
-
'calendar_id' => $calendar_id,
|
795 |
-
'ev_ids' => $ev_ids_inline,
|
796 |
-
'eventID' => $ev_id[0],
|
797 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
798 |
-
'many_sp_calendar' => $many_sp_calendar,
|
799 |
-
'cur_page_url' => $path_sp_cal,
|
800 |
-
'widget' => $widget,
|
801 |
-
'TB_iframe' => 1,
|
802 |
-
'tbWidth' => $popup_width,
|
803 |
-
'tbHeight' => $popup_height,
|
804 |
-
'cat_id' => $cat_ids
|
805 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
806 |
-
</a>';
|
807 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
808 |
-
foreach($categ_color as $color){
|
809 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
810 |
-
}
|
811 |
-
echo '</tr></table>';
|
812 |
-
echo '</td>';
|
813 |
-
}
|
814 |
-
else {
|
815 |
-
echo '<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
816 |
-
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . '; text-align:center;text-decoration:underline;"
|
817 |
-
href="' . add_query_arg(array(
|
818 |
-
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
819 |
-
'theme_id' => $theme_id,
|
820 |
-
'calendar_id' => $calendar_id,
|
821 |
-
'ev_ids' => $ev_ids_inline,
|
822 |
-
'eventID' => $ev_id[0],
|
823 |
-
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
824 |
-
'many_sp_calendar' => $many_sp_calendar,
|
825 |
-
'cur_page_url' => $path_sp_cal,
|
826 |
-
'widget' => $widget,
|
827 |
-
'TB_iframe' => 1,
|
828 |
-
'tbWidth' => $popup_width,
|
829 |
-
'tbHeight' => $popup_height,
|
830 |
-
'cat_id' => $cat_ids
|
831 |
-
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b></a>
|
832 |
-
';
|
833 |
-
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
834 |
-
foreach($categ_color as $color){
|
835 |
-
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
836 |
-
}
|
837 |
-
echo '</tr></table>';
|
838 |
-
echo '</td>';
|
839 |
-
}
|
840 |
-
}
|
841 |
-
else {
|
842 |
-
echo ' <td style="text-align:center; color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:inherit;">
|
843 |
-
<b>' . $i . '</b>
|
844 |
-
</td>';
|
845 |
-
}
|
846 |
-
}
|
847 |
-
if ($weekday_i % 7 == 0 && $i <> $month_days) {
|
848 |
-
echo '</tr>
|
849 |
-
<tr class="cell_body" height="' . $percent . 'px" style="line-height:' . $percent . 'px">';
|
850 |
-
$weekday_i = 0;
|
851 |
-
}
|
852 |
-
$weekday_i++;
|
853 |
-
}
|
854 |
-
$weekday_i;
|
855 |
-
$next_i = 1;
|
856 |
-
if ($weekday_i != 1) {
|
857 |
-
for ($i = $weekday_i; $i <= 7; $i++) {
|
858 |
-
echo ' <td class="caltext_color_other_months" style="text-align:center;">' . $next_i . '</td>';
|
859 |
-
$next_i++;
|
860 |
-
}
|
861 |
-
}
|
862 |
-
echo ' </tr>';
|
863 |
-
?>
|
864 |
-
<tr style="font-family: <?php echo $font_year; ?>;">
|
865 |
-
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
866 |
-
echo add_query_arg(array(
|
867 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
868 |
-
'theme_id' => $theme_id,
|
869 |
-
'calendar' => $calendar_id,
|
870 |
-
'select' => $view_select,
|
871 |
-
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
872 |
-
'many_sp_calendar' => $many_sp_calendar,
|
873 |
-
'cur_page_url' => $path_sp_cal,
|
874 |
-
'widget' => $widget,
|
875 |
-
'cat_id' => '',
|
876 |
-
'cat_ids' => $cat_ids,
|
877 |
-
'TB_iframe' => 1,
|
878 |
-
), admin_url('admin-ajax.php'));?>','<?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; ?>">
|
879 |
-
<?php echo ($year - 1); ?>
|
880 |
-
</td>
|
881 |
-
<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; ?>">
|
882 |
-
<?php echo $year; ?>
|
883 |
-
</td>
|
884 |
-
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
885 |
-
echo add_query_arg(array(
|
886 |
-
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
887 |
-
'theme_id' => $theme_id,
|
888 |
-
'calendar' => $calendar_id,
|
889 |
-
'select' => $view_select,
|
890 |
-
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
891 |
-
'many_sp_calendar' => $many_sp_calendar,
|
892 |
-
'cur_page_url' => $path_sp_cal,
|
893 |
-
'widget' => $widget,
|
894 |
-
'cat_id' => '',
|
895 |
-
'cat_ids' => $cat_ids,
|
896 |
-
'TB_iframe' => 1,
|
897 |
-
), admin_url('admin-ajax.php'));?>','<?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; ?>;color:<?php echo $year_font_color; ?>">
|
898 |
-
<?php echo ($year + 1); ?>
|
899 |
-
</td>
|
900 |
-
</tr>
|
901 |
-
</table>
|
902 |
-
<input type="text" value="1" name="day" style="display:none" />
|
903 |
-
</form>
|
904 |
-
</td>
|
905 |
-
</tr>
|
906 |
-
</table>
|
907 |
-
</div>
|
908 |
-
<style>
|
909 |
-
#calendar_<?php echo $many_sp_calendar; ?> table{
|
910 |
-
width: 100%;
|
911 |
-
}
|
912 |
-
|
913 |
-
.categories1 , .categories2
|
914 |
-
{
|
915 |
-
display:inline-block;
|
916 |
-
}
|
917 |
-
|
918 |
-
.categories2
|
919 |
-
{
|
920 |
-
position:relative;
|
921 |
-
left: -9px;
|
922 |
-
cursor:pointer;
|
923 |
-
}
|
924 |
-
.categories2:first-letter
|
925 |
-
{
|
926 |
-
color:#fff;
|
927 |
-
|
928 |
-
}
|
929 |
-
</style>
|
930 |
-
<?php
|
931 |
-
|
932 |
-
//reindex cat_ids_array
|
933 |
-
|
934 |
-
$re_cat_ids_array = array_values($cat_ids_array);
|
935 |
-
|
936 |
-
for($i=0; $i<count($re_cat_ids_array); $i++)
|
937 |
-
{
|
938 |
-
echo'
|
939 |
-
<style>
|
940 |
-
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
941 |
-
{
|
942 |
-
text-decoration:underline;
|
943 |
-
cursor:pointer;
|
944 |
-
|
945 |
-
}
|
946 |
-
|
947 |
-
</style>';
|
948 |
-
|
949 |
-
}
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
if($cat_ids=='')
|
954 |
-
$cat_ids='';
|
955 |
-
|
956 |
-
|
957 |
-
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none;">';
|
958 |
-
|
959 |
-
foreach($categories as $category)
|
960 |
-
{
|
961 |
-
|
962 |
-
?>
|
963 |
-
|
964 |
-
<li style="height:30px"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
965 |
-
'action' => 'spiderbigcalendar_month_widget',
|
966 |
-
'theme_id' => $theme_id,
|
967 |
-
'calendar' => $calendar_id,
|
968 |
-
'select' => $view_select,
|
969 |
-
'date' => $year . '-' . add_0((Month_num($month))),
|
970 |
-
'many_sp_calendar' => $many_sp_calendar,
|
971 |
-
'cur_page_url' => $path_sp_cal,
|
972 |
-
'cat_id' => $category->id,
|
973 |
-
'cat_ids' => $cat_ids,
|
974 |
-
'widget' => $widget,
|
975 |
-
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
976 |
-
|
977 |
-
|
978 |
-
<?php
|
979 |
-
|
980 |
-
|
981 |
-
}
|
982 |
-
|
983 |
-
echo '</ul><br><br>';
|
984 |
-
|
985 |
-
die();
|
986 |
-
}
|
987 |
-
|
988 |
?>
|
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 |
+
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
+
|
13 |
+
///////////////////////////////////////////////////////////////////////////////////
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
if(isset($_GET['cat_id']))
|
18 |
+
$cat_id = $_GET['cat_id'];
|
19 |
+
else $cat_id = "";
|
20 |
+
|
21 |
+
if(isset($_GET['cat_ids']))
|
22 |
+
$cat_ids = $_GET['cat_ids'];
|
23 |
+
else $cat_ids = "";
|
24 |
+
|
25 |
+
if($cat_ids=='')
|
26 |
+
$cat_ids .= $cat_id.',';
|
27 |
+
else
|
28 |
+
$cat_ids .= ','.$cat_id.',';
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
33 |
+
|
34 |
+
function getelementcountinarray($array , $element)
|
35 |
+
{
|
36 |
+
$t=0;
|
37 |
+
|
38 |
+
for($i=0; $i<count($array); $i++)
|
39 |
+
{
|
40 |
+
if($element==$array[$i])
|
41 |
+
$t++;
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
return $t;
|
47 |
+
|
48 |
+
}
|
49 |
+
|
50 |
+
function getelementindexinarray($array , $element)
|
51 |
+
{
|
52 |
+
|
53 |
+
$t='';
|
54 |
+
|
55 |
+
for($i=0; $i<count($array); $i++)
|
56 |
+
{
|
57 |
+
if($element==$array[$i])
|
58 |
+
$t.=$i.',';
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
return $t;
|
63 |
+
|
64 |
+
|
65 |
+
}
|
66 |
+
$cat_ids_array = explode(',',$cat_ids);
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
if($cat_id!='')
|
71 |
+
{
|
72 |
+
|
73 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
74 |
+
{
|
75 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
76 |
+
$index_array = explode(',' , $index_in_line);
|
77 |
+
array_pop ($index_array);
|
78 |
+
for($j=0; $j<count($index_array); $j++)
|
79 |
+
unset($cat_ids_array[$index_array[$j]]);
|
80 |
+
$cat_ids = implode(',',$cat_ids_array);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
else
|
84 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
85 |
+
|
86 |
+
|
87 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
88 |
+
|
89 |
+
|
90 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
91 |
+
$weekstart = $theme->week_start_day;
|
92 |
+
$bg = '#' . $theme->header_bgcolor;
|
93 |
+
$bg_color_selected = '#' . $theme->bg_color_selected;
|
94 |
+
$color_arrow = '#' . $theme->arrow_color;
|
95 |
+
$evented_color = '#' . $theme->text_color_this_month_evented;
|
96 |
+
$evented_color_bg = '#' . $theme->bg_color_this_month_evented;
|
97 |
+
$sun_days = '#' . $theme->text_color_sun_days;
|
98 |
+
$text_color_other_months = '#' . $theme->text_color_other_months;
|
99 |
+
$text_color_this_month_unevented = '#' . $theme->text_color_this_month_unevented;
|
100 |
+
$text_color_month = '#' . $theme->text_color_month;
|
101 |
+
$color_week_days = '#' . $theme->text_color_week_days;
|
102 |
+
$text_color_selected = '#' . $theme->text_color_selected;
|
103 |
+
$border_day = '#' . $theme->border_day;
|
104 |
+
$calendar_width = $theme->width;
|
105 |
+
$calendar_bg = '#' . $theme->footer_bgcolor;
|
106 |
+
$weekdays_bg_color = '#' . $theme->weekdays_bg_color;
|
107 |
+
$weekday_su_bg_color = '#' . $theme->su_bg_color;
|
108 |
+
$cell_border_color = '#' . $theme->cell_border_color;
|
109 |
+
$year_font_size = $theme->year_font_size;
|
110 |
+
$year_font_color = '#' . $theme->year_font_color;
|
111 |
+
$year_tabs_bg_color = '#' . $theme->year_tabs_bg_color;
|
112 |
+
$font_year = $theme->font_year;
|
113 |
+
$font_month = $theme->font_month;
|
114 |
+
$font_day = $theme->font_day;
|
115 |
+
$font_weekday = $theme->font_weekday;
|
116 |
+
|
117 |
+
$popup_width = $theme->popup_width;
|
118 |
+
$popup_height = $theme->popup_height;
|
119 |
+
|
120 |
+
__('January', 'sp_calendar');
|
121 |
+
__('February', 'sp_calendar');
|
122 |
+
__('March', 'sp_calendar');
|
123 |
+
__('April', 'sp_calendar');
|
124 |
+
__('May', 'sp_calendar');
|
125 |
+
__('June', 'sp_calendar');
|
126 |
+
__('July', 'sp_calendar');
|
127 |
+
__('August', 'sp_calendar');
|
128 |
+
__('September', 'sp_calendar');
|
129 |
+
__('October', 'sp_calendar');
|
130 |
+
__('November', 'sp_calendar');
|
131 |
+
__('December', 'sp_calendar');
|
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 |
+
$view = 'bigcalendarmonth_widget';
|
156 |
+
$views = explode(',', $view_select);
|
157 |
+
$defaultview = 'month';
|
158 |
+
array_pop($views);
|
159 |
+
$display = '';
|
160 |
+
if (count($views) == 0) {
|
161 |
+
$display = "display:none";
|
162 |
+
}
|
163 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
164 |
+
$display = "display:none";
|
165 |
+
}
|
166 |
+
?>
|
167 |
+
<style type='text/css'>
|
168 |
+
#calendar_<?php echo $many_sp_calendar; ?> table {
|
169 |
+
border-collapse: initial;
|
170 |
+
border:0px;
|
171 |
+
}
|
172 |
+
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
173 |
+
padding: 0px;
|
174 |
+
vertical-align: none;
|
175 |
+
border-top:none;
|
176 |
+
line-height: none;
|
177 |
+
text-align: none;
|
178 |
+
}
|
179 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
180 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
181 |
+
font-family: <?php echo $font_day; ?>;
|
182 |
+
}
|
183 |
+
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
184 |
+
margin-bottom: 0;
|
185 |
+
}
|
186 |
+
#calendar_<?php echo $many_sp_calendar; ?> td,
|
187 |
+
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
188 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> td,
|
189 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> tr {
|
190 |
+
border:none;
|
191 |
+
}
|
192 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
193 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
194 |
+
color: <?php echo $color_arrow; ?>;
|
195 |
+
text-decoration: none;
|
196 |
+
background: none;
|
197 |
+
font-size: 16px;
|
198 |
+
}
|
199 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
200 |
+
color: <?php echo $color_arrow; ?>;
|
201 |
+
text-decoration:none;
|
202 |
+
background:none;
|
203 |
+
}
|
204 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
205 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
206 |
+
text-decoration:underline;
|
207 |
+
background:none;
|
208 |
+
font-size:11px;
|
209 |
+
}
|
210 |
+
#calendar_<?php echo $many_sp_calendar; ?> a {
|
211 |
+
font-weight: normal;
|
212 |
+
}
|
213 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
214 |
+
font-size:12px;
|
215 |
+
text-decoration:none;
|
216 |
+
background:none;
|
217 |
+
}
|
218 |
+
|
219 |
+
|
220 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
221 |
+
border-spacing:0;
|
222 |
+
width:100%;
|
223 |
+
}
|
224 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
225 |
+
border-spacing: 0;
|
226 |
+
vertical-align: middle;
|
227 |
+
width: 100%;
|
228 |
+
}
|
229 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
230 |
+
background-color:<?php echo $bg; ?>;
|
231 |
+
text-align:center;
|
232 |
+
vertical-align: middle;
|
233 |
+
}
|
234 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
235 |
+
color:<?php echo $text_color_other_months; ?>;
|
236 |
+
}
|
237 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
238 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
239 |
+
}
|
240 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
241 |
+
color:<?php echo $sun_days; ?>;
|
242 |
+
}
|
243 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
244 |
+
border: solid <?php echo $border_day; ?> 1px;
|
245 |
+
}
|
246 |
+
#TB_window {
|
247 |
+
z-index: 10000;
|
248 |
+
}
|
249 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
250 |
+
float: right;
|
251 |
+
background-color: <?php echo $calendar_bg; ?>;
|
252 |
+
height: 25px;
|
253 |
+
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
254 |
+
margin-left: 2px;
|
255 |
+
text-align: center;
|
256 |
+
cursor: pointer;
|
257 |
+
position: relative;
|
258 |
+
top: 3px;
|
259 |
+
font-family: <?php echo $font_month; ?>;
|
260 |
+
}
|
261 |
+
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
262 |
+
background: transparent !important;
|
263 |
+
}
|
264 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
265 |
+
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
266 |
+
{
|
267 |
+
|
268 |
+
background-color: <?php echo $views_tabs_bg_color?> ;
|
269 |
+
width: 120px;
|
270 |
+
text-align: center;
|
271 |
+
cursor: pointer;
|
272 |
+
padding: 6px;
|
273 |
+
position: relative;
|
274 |
+
}
|
275 |
+
|
276 |
+
|
277 |
+
#drop_down_views
|
278 |
+
{
|
279 |
+
list-style-type:none !important;
|
280 |
+
position: absolute;
|
281 |
+
top: 46px;
|
282 |
+
left: -15px;
|
283 |
+
display:none;
|
284 |
+
z-index: 4545;
|
285 |
+
|
286 |
+
}
|
287 |
+
|
288 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
289 |
+
{
|
290 |
+
background:<?php echo $bg_top ?>;
|
291 |
+
}
|
292 |
+
|
293 |
+
#drop_down_views >li
|
294 |
+
{
|
295 |
+
border-bottom:1px solid #fff !important;
|
296 |
+
}
|
297 |
+
|
298 |
+
|
299 |
+
#views_tabs_select
|
300 |
+
{
|
301 |
+
display:none;
|
302 |
+
}
|
303 |
+
|
304 |
+
</style>
|
305 |
+
|
306 |
+
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
307 |
+
<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; ?>">
|
308 |
+
<tr style="background-color:#FFFFFF;">
|
309 |
+
<td style="background-color:#FFFFFF;">
|
310 |
+
<div id="views_tabs" style="<?php echo $display; ?>">
|
311 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
312 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
313 |
+
'action' => 'spiderbigcalendar_day_widget',
|
314 |
+
'theme_id' => $theme_id,
|
315 |
+
'calendar' => $calendar_id,
|
316 |
+
'select' => $view_select,
|
317 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
318 |
+
'many_sp_calendar' => $many_sp_calendar,
|
319 |
+
'cur_page_url' => $path_sp_cal,
|
320 |
+
'cat_id' => '',
|
321 |
+
'cat_ids' => $cat_ids,
|
322 |
+
'widget' => $widget,
|
323 |
+
'rand' => $many_sp_calendar,
|
324 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
325 |
+
</div>
|
326 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek_widget') echo 'background-color:' . $bg . ';height:28px;top:0;' ?>"
|
327 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
328 |
+
'action' => 'spiderbigcalendar_week_widget',
|
329 |
+
'theme_id' => $theme_id,
|
330 |
+
'calendar' => $calendar_id,
|
331 |
+
'select' => $view_select,
|
332 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
333 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
334 |
+
'many_sp_calendar' => $many_sp_calendar,
|
335 |
+
'cur_page_url' => $path_sp_cal,
|
336 |
+
'cat_id' => '',
|
337 |
+
'cat_ids' => $cat_ids,
|
338 |
+
'widget' => $widget,
|
339 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
340 |
+
</div>
|
341 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
342 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
343 |
+
'action' => 'spiderbigcalendar_list_widget',
|
344 |
+
'theme_id' => $theme_id,
|
345 |
+
'calendar' => $calendar_id,
|
346 |
+
'select' => $view_select,
|
347 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
348 |
+
'many_sp_calendar' => $many_sp_calendar,
|
349 |
+
'cur_page_url' => $path_sp_cal,
|
350 |
+
'cat_id' => '',
|
351 |
+
'cat_ids' => $cat_ids,
|
352 |
+
'widget' => $widget,
|
353 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
354 |
+
</div>
|
355 |
+
<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 . ';height:28px;top:0;'; ?>"
|
356 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
357 |
+
'action' => 'spiderbigcalendar_month_widget',
|
358 |
+
'theme_id' => $theme_id,
|
359 |
+
'calendar' => $calendar_id,
|
360 |
+
'select' => $view_select,
|
361 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
362 |
+
'many_sp_calendar' => $many_sp_calendar,
|
363 |
+
'cur_page_url' => $path_sp_cal,
|
364 |
+
'cat_id' => '',
|
365 |
+
'cat_ids' => $cat_ids,
|
366 |
+
'widget' => $widget,
|
367 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
368 |
+
</div>
|
369 |
+
</div>
|
370 |
+
</td>
|
371 |
+
</tr>
|
372 |
+
<tr>
|
373 |
+
<td width="100%" style="padding:0; margin:0;">
|
374 |
+
<form action="" method="get" style="background:none; margin:0; padding:0;">
|
375 |
+
<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">
|
376 |
+
<tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
|
377 |
+
<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%;" >
|
378 |
+
<?php //MONTH TABLE ?>
|
379 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
|
380 |
+
<tr>
|
381 |
+
<td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
382 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
383 |
+
if (Month_num($month) == 1) {
|
384 |
+
$needed_date = ($year - 1) . '-12';
|
385 |
+
}
|
386 |
+
else {
|
387 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
388 |
+
}
|
389 |
+
echo add_query_arg(array(
|
390 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
391 |
+
'theme_id' => $theme_id,
|
392 |
+
'calendar' => $calendar_id,
|
393 |
+
'select' => $view_select,
|
394 |
+
'date' => $needed_date,
|
395 |
+
'many_sp_calendar' => $many_sp_calendar,
|
396 |
+
'cur_page_url' => $path_sp_cal,
|
397 |
+
'cat_id' => '',
|
398 |
+
'cat_ids' => $cat_ids,
|
399 |
+
'widget' => $widget,
|
400 |
+
), admin_url('admin-ajax.php'));
|
401 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◄
|
402 |
+
</a>
|
403 |
+
</td>
|
404 |
+
<td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
|
405 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
406 |
+
<span style="font-size:<?php echo $year_font_size; ?>px;?>; color:<?php echo $text_color_month; ?>;"><?php echo __($month, 'sp_calendar'); ?></span>
|
407 |
+
</td>
|
408 |
+
<td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
409 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
410 |
+
if (Month_num($month) == 12) {
|
411 |
+
|
412 |
+
$needed_date = ($year + 1) . '-01';
|
413 |
+
}
|
414 |
+
else {
|
415 |
+
$needed_date = $year . '-' . add_0((Month_num($month) + 1));
|
416 |
+
}
|
417 |
+
echo add_query_arg(array(
|
418 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
419 |
+
'theme_id' => $theme_id,
|
420 |
+
'calendar' => $calendar_id,
|
421 |
+
'select' => $view_select,
|
422 |
+
'date' => $needed_date,
|
423 |
+
'many_sp_calendar' => $many_sp_calendar,
|
424 |
+
'cur_page_url' => $path_sp_cal,
|
425 |
+
'cat_id' => '',
|
426 |
+
'cat_ids' => $cat_ids,
|
427 |
+
'widget' => $widget,
|
428 |
+
), admin_url('admin-ajax.php'));
|
429 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">►
|
430 |
+
</a>
|
431 |
+
</td>
|
432 |
+
</tr>
|
433 |
+
</table>
|
434 |
+
</td>
|
435 |
+
</tr>
|
436 |
+
<tr class="cell_body" align="center" height="10%" style="background-color:<?php echo $weekdays_bg_color; ?> !important;width:<?php echo $calendar_width; ?>px">
|
437 |
+
<?php if ($weekstart == "su") { ?>
|
438 |
+
<td style="font-family:<?php echo $font_weekday; ?>;background-color:<?php echo $weekday_su_bg_color; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
439 |
+
<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>
|
440 |
+
</td>
|
441 |
+
<?php } ?>
|
442 |
+
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
443 |
+
<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>
|
444 |
+
</td>
|
445 |
+
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
446 |
+
<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>
|
447 |
+
</td>
|
448 |
+
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
449 |
+
<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>
|
450 |
+
</td>
|
451 |
+
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
452 |
+
<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>
|
453 |
+
</td>
|
454 |
+
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
455 |
+
<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>
|
456 |
+
</td>
|
457 |
+
<td style="font-family:<?php echo $font_weekday; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
458 |
+
<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>
|
459 |
+
</td>
|
460 |
+
<?php if ($weekstart == "mo") { ?>
|
461 |
+
<td style="font-family:<?php echo $font_weekday; ?>;background-color:<?php echo $weekday_su_bg_color; ?>;width:<?php echo $cell_width; ?>px; color:<?php echo $color_week_days; ?>; margin:0; padding:0">
|
462 |
+
<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>
|
463 |
+
</td>
|
464 |
+
<?php } ?>
|
465 |
+
</tr>
|
466 |
+
<?php
|
467 |
+
|
468 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
469 |
+
if ($weekstart == "su") {
|
470 |
+
$month_first_weekday++;
|
471 |
+
if ($month_first_weekday == 8) {
|
472 |
+
$month_first_weekday = 1;
|
473 |
+
}
|
474 |
+
}
|
475 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
476 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
477 |
+
$weekday_i = $month_first_weekday;
|
478 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
479 |
+
$percent = 1;
|
480 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
481 |
+
if ($sum % 7 <> 0) {
|
482 |
+
$percent = $percent + 1;
|
483 |
+
}
|
484 |
+
$sum = $sum - ($sum % 7);
|
485 |
+
$percent = $percent + ($sum / 7);
|
486 |
+
$percent = 107 / $percent;
|
487 |
+
|
488 |
+
$all_calendar_files = php_getdays(1, $calendar_id, $date, $theme_id, $widget);
|
489 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
490 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
491 |
+
$array_days = $all_calendar_files[0]['array_days'];
|
492 |
+
|
493 |
+
$array_days1 = $all_calendar_files[0]['array_days1'];
|
494 |
+
$title = $all_calendar_files[0]['title'];
|
495 |
+
$ev_ids = $all_calendar_files[0]['ev_ids'];
|
496 |
+
echo ' <tr class="cell_body" height="' . $percent . 'px" style="line-height:' . $percent . 'px">';
|
497 |
+
for ($i = 1; $i < $weekday_i; $i++) {
|
498 |
+
echo ' <td class="caltext_color_other_months" style="text-align:center;">' . $last_month_days . '</td>';
|
499 |
+
$last_month_days = $last_month_days + 1;
|
500 |
+
}
|
501 |
+
|
502 |
+
|
503 |
+
|
504 |
+
for ($i = 1; $i <= $month_days; $i++) {
|
505 |
+
if (isset($title[$i])) {
|
506 |
+
$ev_title = explode('</p>', $title[$i]);
|
507 |
+
array_pop($ev_title);
|
508 |
+
$k = count($ev_title);
|
509 |
+
$ev_id = explode('<br>', $ev_ids[$i]);
|
510 |
+
array_pop($ev_id);
|
511 |
+
$ev_ids_inline = implode(',', $ev_id);
|
512 |
+
}
|
513 |
+
else
|
514 |
+
$k=0;
|
515 |
+
|
516 |
+
if(isset($ev_ids_inline)){
|
517 |
+
if($cat_ids!='')
|
518 |
+
$query = $wpdb->prepare ("SELECT DISTINCT sec.color FROM " . $wpdb->prefix . "spidercalendar_event AS se JOIN
|
519 |
+
" . $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 (%s) ",$calendar_id,$ev_ids_inline);
|
520 |
+
else
|
521 |
+
$query = $wpdb->prepare ("SELECT DISTINCT sec.color FROM " . $wpdb->prefix . "spidercalendar_event AS se JOIN
|
522 |
+
" . $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 (%s) ",$calendar_id,$ev_ids_inline);
|
523 |
+
|
524 |
+
$categ_color=$wpdb->get_results($query);
|
525 |
+
}
|
526 |
+
|
527 |
+
if (($weekday_i % 7 == 0 and $weekstart == "mo") or ($weekday_i % 7 == 1 and $weekstart == "su")) {
|
528 |
+
if ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
529 |
+
|
530 |
+
echo ' <td class="cala_day" style="background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
531 |
+
<div class="calborder_day" style="text-align:center; width:' . $cell_width . 'px; margin:0; padding:0;">
|
532 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-decoration:underline;"
|
533 |
+
href="' . add_query_arg(array(
|
534 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
535 |
+
'theme_id' => $theme_id,
|
536 |
+
'calendar_id' => $calendar_id,
|
537 |
+
'ev_ids' => $ev_ids_inline,
|
538 |
+
'eventID' => $ev_id[0],
|
539 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
540 |
+
'many_sp_calendar' => $many_sp_calendar,
|
541 |
+
'cur_page_url' => $path_sp_cal,
|
542 |
+
'widget' => $widget,
|
543 |
+
'TB_iframe' => 1,
|
544 |
+
'tbWidth' => $popup_width,
|
545 |
+
'tbHeight' => $popup_height,
|
546 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
547 |
+
</a>
|
548 |
+
</div>
|
549 |
+
</td>';
|
550 |
+
}
|
551 |
+
elseif ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
552 |
+
if (in_array($i, $array_days)) {
|
553 |
+
if (in_array ($i, $array_days1)) {
|
554 |
+
echo '
|
555 |
+
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
556 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . ';text-align:center;text-decoration:underline;"
|
557 |
+
href="' . add_query_arg(array(
|
558 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
559 |
+
'theme_id' => $theme_id,
|
560 |
+
'calendar_id' => $calendar_id,
|
561 |
+
'ev_ids' => $ev_ids_inline,
|
562 |
+
'eventID' => $ev_id[0],
|
563 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
564 |
+
'many_sp_calendar' => $many_sp_calendar,
|
565 |
+
'cur_page_url' => $path_sp_cal,
|
566 |
+
'widget' => $widget,
|
567 |
+
'TB_iframe' => 1,
|
568 |
+
'tbWidth' => $popup_width,
|
569 |
+
'tbHeight' => $popup_height,
|
570 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
571 |
+
</a>';
|
572 |
+
echo '<table style="width:100%; border:0;margin: 0"><tr>';
|
573 |
+
foreach($categ_color as $color){
|
574 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
575 |
+
}
|
576 |
+
echo '</tr></table>';
|
577 |
+
echo '</td>';
|
578 |
+
}
|
579 |
+
else {
|
580 |
+
echo '
|
581 |
+
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
582 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . ';text-align:center;text-decoration:underline;"
|
583 |
+
href="' . add_query_arg(array(
|
584 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
585 |
+
'theme_id' => $theme_id,
|
586 |
+
'calendar_id' => $calendar_id,
|
587 |
+
'ev_ids' => $ev_ids_inline,
|
588 |
+
'eventID' => $ev_id[0],
|
589 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
590 |
+
'many_sp_calendar' => $many_sp_calendar,
|
591 |
+
'cur_page_url' => $path_sp_cal,
|
592 |
+
'widget' => $widget,
|
593 |
+
'TB_iframe' => 1,
|
594 |
+
'tbWidth' => $popup_width,
|
595 |
+
'tbHeight' => $popup_height,
|
596 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
597 |
+
</a>';
|
598 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
599 |
+
foreach($categ_color as $color){
|
600 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
601 |
+
}
|
602 |
+
echo '</tr></table>';
|
603 |
+
echo '</td>';
|
604 |
+
}
|
605 |
+
}
|
606 |
+
else {
|
607 |
+
echo '
|
608 |
+
<td class="calsun_days" style="color:' . $text_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
609 |
+
<b>' . $i . '</b>
|
610 |
+
</td>';
|
611 |
+
}
|
612 |
+
}
|
613 |
+
else {
|
614 |
+
if (in_array ($i, $array_days)) {
|
615 |
+
if (in_array ($i, $array_days1)) {
|
616 |
+
|
617 |
+
echo '
|
618 |
+
<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
619 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . ';text-align:center;text-decoration:underline;"
|
620 |
+
href="' . add_query_arg(array(
|
621 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
622 |
+
'theme_id' => $theme_id,
|
623 |
+
'calendar_id' => $calendar_id,
|
624 |
+
'ev_ids' => $ev_ids_inline,
|
625 |
+
'eventID' => $ev_id[0],
|
626 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
627 |
+
'many_sp_calendar' => $many_sp_calendar,
|
628 |
+
'cur_page_url' => $path_sp_cal,
|
629 |
+
'widget' => $widget,
|
630 |
+
'TB_iframe' => 1,
|
631 |
+
'tbWidth' => $popup_width,
|
632 |
+
'tbHeight' => $popup_height,
|
633 |
+
'cat_id' => $cat_ids
|
634 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
635 |
+
</a>';
|
636 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
637 |
+
foreach($categ_color as $color){
|
638 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
639 |
+
}
|
640 |
+
echo '</tr></table>';
|
641 |
+
echo '</td>';
|
642 |
+
}
|
643 |
+
else {
|
644 |
+
echo '
|
645 |
+
<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
646 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . ';text-align:center;text-decoration:underline;"
|
647 |
+
href="' . add_query_arg(array(
|
648 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
649 |
+
'theme_id' => $theme_id,
|
650 |
+
'calendar_id' => $calendar_id,
|
651 |
+
'ev_ids' => $ev_ids_inline,
|
652 |
+
'eventID' => $ev_id[0],
|
653 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
654 |
+
'many_sp_calendar' => $many_sp_calendar,
|
655 |
+
'cur_page_url' => $path_sp_cal,
|
656 |
+
'widget' => $widget,
|
657 |
+
'TB_iframe' => 1,
|
658 |
+
'tbWidth' => $popup_width,
|
659 |
+
'tbHeight' => $popup_height,
|
660 |
+
'cat_id' => $cat_ids
|
661 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
662 |
+
</a>';
|
663 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
664 |
+
foreach($categ_color as $color){
|
665 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
666 |
+
}
|
667 |
+
echo '</tr></table>';
|
668 |
+
echo '</td>';
|
669 |
+
}
|
670 |
+
}
|
671 |
+
else {
|
672 |
+
echo '
|
673 |
+
<td class="calsun_days" style="text-align:center;padding:0; margin:0;line-height:inherit;">
|
674 |
+
<b>' . $i . '</b>
|
675 |
+
</td>';
|
676 |
+
}
|
677 |
+
}
|
678 |
+
}
|
679 |
+
elseif ($i == $day_REFERER and $month == $month_REFERER and $year == $year_REFERER) {
|
680 |
+
|
681 |
+
if (in_array ($i,$array_days)) {
|
682 |
+
|
683 |
+
echo ' <td style="background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
684 |
+
<div class="calborder_day" style="text-align:center; width:' . $cell_width . 'px; margin:0; padding:0;">
|
685 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-decoration:underline;"
|
686 |
+
href="' . add_query_arg(array(
|
687 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
688 |
+
'theme_id' => $theme_id,
|
689 |
+
'calendar_id' => $calendar_id,
|
690 |
+
'ev_ids' => $ev_ids_inline,
|
691 |
+
'eventID' => $ev_id[0],
|
692 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
693 |
+
'many_sp_calendar' => $many_sp_calendar,
|
694 |
+
'cur_page_url' => $path_sp_cal,
|
695 |
+
'widget' => $widget,
|
696 |
+
'TB_iframe' => 1,
|
697 |
+
'tbWidth' => $popup_width,
|
698 |
+
'tbHeight' => $popup_height,
|
699 |
+
'cat_id' => $cat_ids
|
700 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
701 |
+
</a>';
|
702 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
703 |
+
foreach($categ_color as $color){
|
704 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
705 |
+
}
|
706 |
+
echo '</tr></table>';
|
707 |
+
echo '</td>';
|
708 |
+
}
|
709 |
+
|
710 |
+
else {
|
711 |
+
|
712 |
+
echo '<td style="text-align:center; color:' . $text_color_selected . ';padding:0; margin:0; line-height:inherit; border: 2px solid ' . $border_day . '">
|
713 |
+
<b>' . $i . '</b>
|
714 |
+
</td>';
|
715 |
+
}
|
716 |
+
|
717 |
+
}
|
718 |
+
else {
|
719 |
+
if ($i == date('j') and $month == date('F') and $year == date('Y')) {
|
720 |
+
|
721 |
+
|
722 |
+
if (in_array ($i, $array_days)) {
|
723 |
+
|
724 |
+
|
725 |
+
if (in_array ($i, $array_days1)) {
|
726 |
+
echo '
|
727 |
+
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
728 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-align:center;text-decoration:underline;"
|
729 |
+
href="' . add_query_arg(array(
|
730 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
731 |
+
'theme_id' => $theme_id,
|
732 |
+
'calendar_id' => $calendar_id,
|
733 |
+
'ev_ids' => $ev_ids_inline,
|
734 |
+
'eventID' => $ev_id[0],
|
735 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
736 |
+
'many_sp_calendar' => $many_sp_calendar,
|
737 |
+
'cur_page_url' => $path_sp_cal,
|
738 |
+
'widget' => $widget,
|
739 |
+
'TB_iframe' => 1,
|
740 |
+
'tbWidth' => $popup_width,
|
741 |
+
'tbHeight' => $popup_height,
|
742 |
+
'cat_id' => $cat_ids
|
743 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
744 |
+
</a>';
|
745 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
746 |
+
foreach($categ_color as $color){
|
747 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
748 |
+
}
|
749 |
+
echo '</tr></table>';
|
750 |
+
echo '</td>';
|
751 |
+
}
|
752 |
+
else {
|
753 |
+
echo '
|
754 |
+
<td class="cala_day" style="color:' . $text_color_selected . ';background-color:' . $bg_color_selected . ';text-align:center;padding:0; margin:0;line-height:inherit; border: 2px solid ' . $border_day . '">
|
755 |
+
<a id="cur_day" class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $text_color_selected . '; text-align:center;text-decoration:underline;"
|
756 |
+
href="' . add_query_arg(array(
|
757 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
758 |
+
'theme_id' => $theme_id,
|
759 |
+
'calendar_id' => $calendar_id,
|
760 |
+
'ev_ids' => $ev_ids_inline,
|
761 |
+
'eventID' => $ev_id[0],
|
762 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
763 |
+
'many_sp_calendar' => $many_sp_calendar,
|
764 |
+
'cur_page_url' => $path_sp_cal,
|
765 |
+
'widget' => $widget,
|
766 |
+
'TB_iframe' => 1,
|
767 |
+
'tbWidth' => $popup_width,
|
768 |
+
'tbHeight' => $popup_height,
|
769 |
+
'cat_id' => $cat_ids
|
770 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b></a>';
|
771 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
772 |
+
foreach($categ_color as $color){
|
773 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
774 |
+
}
|
775 |
+
echo '</tr></table>';
|
776 |
+
echo '</td>';
|
777 |
+
}
|
778 |
+
}
|
779 |
+
else {
|
780 |
+
|
781 |
+
echo '<td style="text-align:center; color:' . $text_color_selected . ';padding:0; margin:0; line-height:inherit; border: 2px solid ' . $border_day . '">
|
782 |
+
<b>' . $i . '</b>
|
783 |
+
</td>';
|
784 |
+
}
|
785 |
+
}
|
786 |
+
elseif (in_array($i, $array_days)) {
|
787 |
+
|
788 |
+
if (in_array ($i, $array_days1)) {
|
789 |
+
echo '<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
790 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . '; text-align:center;text-decoration:underline;"
|
791 |
+
href="' . add_query_arg(array(
|
792 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
793 |
+
'theme_id' => $theme_id,
|
794 |
+
'calendar_id' => $calendar_id,
|
795 |
+
'ev_ids' => $ev_ids_inline,
|
796 |
+
'eventID' => $ev_id[0],
|
797 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
798 |
+
'many_sp_calendar' => $many_sp_calendar,
|
799 |
+
'cur_page_url' => $path_sp_cal,
|
800 |
+
'widget' => $widget,
|
801 |
+
'TB_iframe' => 1,
|
802 |
+
'tbWidth' => $popup_width,
|
803 |
+
'tbHeight' => $popup_height,
|
804 |
+
'cat_id' => $cat_ids
|
805 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b>
|
806 |
+
</a>';
|
807 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
808 |
+
foreach($categ_color as $color){
|
809 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
810 |
+
}
|
811 |
+
echo '</tr></table>';
|
812 |
+
echo '</td>';
|
813 |
+
}
|
814 |
+
else {
|
815 |
+
echo '<td class="cala_day" style="background-color:' . $evented_color_bg . ';text-align:center;padding:0; margin:0;line-height:inherit;">
|
816 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="background:none;color:' . $evented_color . '; text-align:center;text-decoration:underline;"
|
817 |
+
href="' . add_query_arg(array(
|
818 |
+
'action' => ((isset($ev_id[1])) ? 'spiderseemore' : 'spidercalendarbig'),
|
819 |
+
'theme_id' => $theme_id,
|
820 |
+
'calendar_id' => $calendar_id,
|
821 |
+
'ev_ids' => $ev_ids_inline,
|
822 |
+
'eventID' => $ev_id[0],
|
823 |
+
'date' => $year . '-' . add_0(Month_num($month)) . '-' . $i,
|
824 |
+
'many_sp_calendar' => $many_sp_calendar,
|
825 |
+
'cur_page_url' => $path_sp_cal,
|
826 |
+
'widget' => $widget,
|
827 |
+
'TB_iframe' => 1,
|
828 |
+
'tbWidth' => $popup_width,
|
829 |
+
'tbHeight' => $popup_height,
|
830 |
+
'cat_id' => $cat_ids
|
831 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $i . '</b></a>
|
832 |
+
';
|
833 |
+
echo '<table style="width:100%; border:0;margin:0;"><tr>';
|
834 |
+
foreach($categ_color as $color){
|
835 |
+
echo '<td id="cat_width" style="border:0; border-top:2px solid #'.$color->color.'; display:table-cell;"></td>';
|
836 |
+
}
|
837 |
+
echo '</tr></table>';
|
838 |
+
echo '</td>';
|
839 |
+
}
|
840 |
+
}
|
841 |
+
else {
|
842 |
+
echo ' <td style="text-align:center; color:' . $text_color_this_month_unevented . ';padding:0; margin:0; line-height:inherit;">
|
843 |
+
<b>' . $i . '</b>
|
844 |
+
</td>';
|
845 |
+
}
|
846 |
+
}
|
847 |
+
if ($weekday_i % 7 == 0 && $i <> $month_days) {
|
848 |
+
echo '</tr>
|
849 |
+
<tr class="cell_body" height="' . $percent . 'px" style="line-height:' . $percent . 'px">';
|
850 |
+
$weekday_i = 0;
|
851 |
+
}
|
852 |
+
$weekday_i++;
|
853 |
+
}
|
854 |
+
$weekday_i;
|
855 |
+
$next_i = 1;
|
856 |
+
if ($weekday_i != 1) {
|
857 |
+
for ($i = $weekday_i; $i <= 7; $i++) {
|
858 |
+
echo ' <td class="caltext_color_other_months" style="text-align:center;">' . $next_i . '</td>';
|
859 |
+
$next_i++;
|
860 |
+
}
|
861 |
+
}
|
862 |
+
echo ' </tr>';
|
863 |
+
?>
|
864 |
+
<tr style="font-family: <?php echo $font_year; ?>;">
|
865 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
866 |
+
echo add_query_arg(array(
|
867 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
868 |
+
'theme_id' => $theme_id,
|
869 |
+
'calendar' => $calendar_id,
|
870 |
+
'select' => $view_select,
|
871 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))),
|
872 |
+
'many_sp_calendar' => $many_sp_calendar,
|
873 |
+
'cur_page_url' => $path_sp_cal,
|
874 |
+
'widget' => $widget,
|
875 |
+
'cat_id' => '',
|
876 |
+
'cat_ids' => $cat_ids,
|
877 |
+
'TB_iframe' => 1,
|
878 |
+
), admin_url('admin-ajax.php'));?>','<?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; ?>">
|
879 |
+
<?php echo ($year - 1); ?>
|
880 |
+
</td>
|
881 |
+
<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; ?>">
|
882 |
+
<?php echo $year; ?>
|
883 |
+
</td>
|
884 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
885 |
+
echo add_query_arg(array(
|
886 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
887 |
+
'theme_id' => $theme_id,
|
888 |
+
'calendar' => $calendar_id,
|
889 |
+
'select' => $view_select,
|
890 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month))),
|
891 |
+
'many_sp_calendar' => $many_sp_calendar,
|
892 |
+
'cur_page_url' => $path_sp_cal,
|
893 |
+
'widget' => $widget,
|
894 |
+
'cat_id' => '',
|
895 |
+
'cat_ids' => $cat_ids,
|
896 |
+
'TB_iframe' => 1,
|
897 |
+
), admin_url('admin-ajax.php'));?>','<?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; ?>;color:<?php echo $year_font_color; ?>">
|
898 |
+
<?php echo ($year + 1); ?>
|
899 |
+
</td>
|
900 |
+
</tr>
|
901 |
+
</table>
|
902 |
+
<input type="text" value="1" name="day" style="display:none" />
|
903 |
+
</form>
|
904 |
+
</td>
|
905 |
+
</tr>
|
906 |
+
</table>
|
907 |
+
</div>
|
908 |
+
<style>
|
909 |
+
#calendar_<?php echo $many_sp_calendar; ?> table{
|
910 |
+
width: 100%;
|
911 |
+
}
|
912 |
+
|
913 |
+
.categories1 , .categories2
|
914 |
+
{
|
915 |
+
display:inline-block;
|
916 |
+
}
|
917 |
+
|
918 |
+
.categories2
|
919 |
+
{
|
920 |
+
position:relative;
|
921 |
+
left: -9px;
|
922 |
+
cursor:pointer;
|
923 |
+
}
|
924 |
+
.categories2:first-letter
|
925 |
+
{
|
926 |
+
color:#fff;
|
927 |
+
|
928 |
+
}
|
929 |
+
</style>
|
930 |
+
<?php
|
931 |
+
|
932 |
+
//reindex cat_ids_array
|
933 |
+
|
934 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
935 |
+
|
936 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
937 |
+
{
|
938 |
+
echo'
|
939 |
+
<style>
|
940 |
+
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
941 |
+
{
|
942 |
+
text-decoration:underline;
|
943 |
+
cursor:pointer;
|
944 |
+
|
945 |
+
}
|
946 |
+
|
947 |
+
</style>';
|
948 |
+
|
949 |
+
}
|
950 |
+
|
951 |
+
|
952 |
+
|
953 |
+
if($cat_ids=='')
|
954 |
+
$cat_ids='';
|
955 |
+
|
956 |
+
|
957 |
+
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none;">';
|
958 |
+
|
959 |
+
foreach($categories as $category)
|
960 |
+
{
|
961 |
+
|
962 |
+
?>
|
963 |
+
|
964 |
+
<li style="height:30px"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
965 |
+
'action' => 'spiderbigcalendar_month_widget',
|
966 |
+
'theme_id' => $theme_id,
|
967 |
+
'calendar' => $calendar_id,
|
968 |
+
'select' => $view_select,
|
969 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
970 |
+
'many_sp_calendar' => $many_sp_calendar,
|
971 |
+
'cur_page_url' => $path_sp_cal,
|
972 |
+
'cat_id' => $category->id,
|
973 |
+
'cat_ids' => $cat_ids,
|
974 |
+
'widget' => $widget,
|
975 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
976 |
+
|
977 |
+
|
978 |
+
<?php
|
979 |
+
|
980 |
+
|
981 |
+
}
|
982 |
+
|
983 |
+
echo '</ul><br><br>';
|
984 |
+
|
985 |
+
die();
|
986 |
+
}
|
987 |
+
|
988 |
?>
|
front_end/bigcalendarweek.php
CHANGED
@@ -1,1033 +1,1036 @@
|
|
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'] : 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 |
-
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
-
$months = (isset($_GET['months']) ? esc_html($_GET['months']) : '');
|
13 |
-
|
14 |
-
///////////////////////////////////////////////////////////////////////////////////
|
15 |
-
|
16 |
-
|
17 |
-
if(isset($_GET['cat_id']))
|
18 |
-
$cat_id = $_GET['cat_id'];
|
19 |
-
else $cat_id = "";
|
20 |
-
|
21 |
-
if(isset($_GET['cat_ids']))
|
22 |
-
$cat_ids = $_GET['cat_ids'];
|
23 |
-
else $cat_ids = "";
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
if($cat_ids=='')
|
28 |
-
$cat_ids .= $cat_id.',';
|
29 |
-
else
|
30 |
-
$cat_ids .= ','.$cat_id.',';
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
35 |
-
|
36 |
-
function getelementcountinarray($array , $element)
|
37 |
-
{
|
38 |
-
$t=0;
|
39 |
-
|
40 |
-
for($i=0; $i<count($array); $i++)
|
41 |
-
{
|
42 |
-
if($element==$array[$i])
|
43 |
-
$t++;
|
44 |
-
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
return $t;
|
49 |
-
|
50 |
-
}
|
51 |
-
|
52 |
-
function getelementindexinarray($array , $element)
|
53 |
-
{
|
54 |
-
|
55 |
-
$t='';
|
56 |
-
|
57 |
-
for($i=0; $i<count($array); $i++)
|
58 |
-
{
|
59 |
-
if($element==$array[$i])
|
60 |
-
$t.=$i.',';
|
61 |
-
|
62 |
-
}
|
63 |
-
|
64 |
-
return $t;
|
65 |
-
|
66 |
-
|
67 |
-
}
|
68 |
-
$cat_ids_array = explode(',',$cat_ids);
|
69 |
-
|
70 |
-
if($cat_id!='')
|
71 |
-
{
|
72 |
-
|
73 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
74 |
-
{
|
75 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
76 |
-
$index_array = explode(',' , $index_in_line);
|
77 |
-
array_pop ($index_array);
|
78 |
-
for($j=0; $j<count($index_array); $j++)
|
79 |
-
unset($cat_ids_array[$index_array[$j]]);
|
80 |
-
$cat_ids = implode(',',$cat_ids_array);
|
81 |
-
}
|
82 |
-
}
|
83 |
-
else
|
84 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
85 |
-
|
86 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
87 |
-
|
88 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
89 |
-
$cal_width = $theme->width;
|
90 |
-
$bg_top = '#' . $theme->bg_top;
|
91 |
-
$
|
92 |
-
$
|
93 |
-
$
|
94 |
-
$
|
95 |
-
$
|
96 |
-
$
|
97 |
-
$
|
98 |
-
$
|
99 |
-
$
|
100 |
-
$
|
101 |
-
$
|
102 |
-
$
|
103 |
-
$
|
104 |
-
$
|
105 |
-
$
|
106 |
-
$
|
107 |
-
$
|
108 |
-
$
|
109 |
-
$
|
110 |
-
$
|
111 |
-
$
|
112 |
-
$
|
113 |
-
$
|
114 |
-
$
|
115 |
-
$
|
116 |
-
$
|
117 |
-
$
|
118 |
-
$
|
119 |
-
$
|
120 |
-
$
|
121 |
-
$
|
122 |
-
$
|
123 |
-
$
|
124 |
-
$
|
125 |
-
$
|
126 |
-
$
|
127 |
-
$
|
128 |
-
$
|
129 |
-
$
|
130 |
-
$
|
131 |
-
$
|
132 |
-
$
|
133 |
-
$
|
134 |
-
$
|
135 |
-
$
|
136 |
-
$
|
137 |
-
$
|
138 |
-
$
|
139 |
-
$
|
140 |
-
$
|
141 |
-
$
|
142 |
-
$
|
143 |
-
$
|
144 |
-
$
|
145 |
-
$
|
146 |
-
$
|
147 |
-
$
|
148 |
-
$
|
149 |
-
$
|
150 |
-
$
|
151 |
-
$
|
152 |
-
|
153 |
-
|
154 |
-
__('
|
155 |
-
__('
|
156 |
-
__('
|
157 |
-
__('
|
158 |
-
__('
|
159 |
-
__('
|
160 |
-
__('
|
161 |
-
__('
|
162 |
-
__('
|
163 |
-
__('
|
164 |
-
__('
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
$
|
178 |
-
|
179 |
-
|
180 |
-
$
|
181 |
-
$
|
182 |
-
|
183 |
-
|
184 |
-
$
|
185 |
-
$
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
$
|
191 |
-
$
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
$d->modify("
|
199 |
-
$
|
200 |
-
$d->
|
201 |
-
$
|
202 |
-
|
203 |
-
|
204 |
-
$
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
$
|
214 |
-
$
|
215 |
-
$
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
$
|
225 |
-
$
|
226 |
-
|
227 |
-
$
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
border-top-
|
239 |
-
border-radius
|
240 |
-
border-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
#bigcalendar<?php echo $many_sp_calendar; ?>
|
250 |
-
#
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
border-top-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
border-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
#bigcalendar .cala_arrow a:
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a :
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
<?php echo
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
<?php echo
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
font-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
<?php echo
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
border:
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
#bigcalendar<?php echo $many_sp_calendar; ?>
|
378 |
-
#
|
379 |
-
#spiderCalendarTitlesList
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
border-top-
|
388 |
-
|
389 |
-
|
390 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
#bigcalendar<?php echo $many_sp_calendar; ?> .calbg
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
font-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
min-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
#bigcalendar<?php echo $many_sp_calendar; ?>
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
<div style="
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
'
|
519 |
-
'
|
520 |
-
'
|
521 |
-
'
|
522 |
-
'
|
523 |
-
'
|
524 |
-
|
525 |
-
'
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
'
|
534 |
-
'
|
535 |
-
'
|
536 |
-
'
|
537 |
-
'
|
538 |
-
'
|
539 |
-
'
|
540 |
-
|
541 |
-
'
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
'
|
550 |
-
'
|
551 |
-
'
|
552 |
-
'
|
553 |
-
'
|
554 |
-
'
|
555 |
-
|
556 |
-
'
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
'
|
565 |
-
'
|
566 |
-
'
|
567 |
-
'
|
568 |
-
'
|
569 |
-
'
|
570 |
-
|
571 |
-
'
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
<div
|
579 |
-
|
580 |
-
<?php if($view=='
|
581 |
-
<?php if($view=='
|
582 |
-
<?php if($view=='
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
<
|
587 |
-
<
|
588 |
-
|
589 |
-
|
590 |
-
'
|
591 |
-
'
|
592 |
-
'
|
593 |
-
'
|
594 |
-
'
|
595 |
-
'
|
596 |
-
|
597 |
-
'
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
</
|
602 |
-
</
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
'
|
608 |
-
'
|
609 |
-
'
|
610 |
-
'
|
611 |
-
'
|
612 |
-
'
|
613 |
-
'
|
614 |
-
|
615 |
-
'
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
</
|
620 |
-
</
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
'
|
626 |
-
'
|
627 |
-
'
|
628 |
-
'
|
629 |
-
'
|
630 |
-
'
|
631 |
-
|
632 |
-
'
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
</
|
637 |
-
</
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
'
|
643 |
-
'
|
644 |
-
'
|
645 |
-
'
|
646 |
-
'
|
647 |
-
'
|
648 |
-
|
649 |
-
'
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
</
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
'
|
676 |
-
'
|
677 |
-
'
|
678 |
-
'
|
679 |
-
'
|
680 |
-
'
|
681 |
-
'
|
682 |
-
|
683 |
-
'
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
'
|
694 |
-
'
|
695 |
-
'
|
696 |
-
'
|
697 |
-
'
|
698 |
-
'
|
699 |
-
'
|
700 |
-
|
701 |
-
'
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
$
|
709 |
-
$
|
710 |
-
$
|
711 |
-
|
712 |
-
|
713 |
-
$
|
714 |
-
|
715 |
-
|
716 |
-
<
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
'
|
723 |
-
'
|
724 |
-
'
|
725 |
-
'
|
726 |
-
'
|
727 |
-
'
|
728 |
-
'
|
729 |
-
|
730 |
-
'
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
'
|
740 |
-
'
|
741 |
-
'
|
742 |
-
'
|
743 |
-
'
|
744 |
-
'
|
745 |
-
'
|
746 |
-
|
747 |
-
'
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
$
|
774 |
-
$
|
775 |
-
$
|
776 |
-
$
|
777 |
-
$
|
778 |
-
$
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
$
|
784 |
-
$percent =
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
$
|
790 |
-
|
791 |
-
|
792 |
-
$
|
793 |
-
$
|
794 |
-
$
|
795 |
-
|
796 |
-
|
797 |
-
$
|
798 |
-
$
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
$
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
$
|
809 |
-
$
|
810 |
-
$
|
811 |
-
$
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
$
|
816 |
-
$
|
817 |
-
$
|
818 |
-
$
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
$
|
823 |
-
$
|
824 |
-
$
|
825 |
-
$
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
<span style="font-size:' . $
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
$
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
" . $wpdb->prefix . "spidercalendar_event.
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
$
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
$
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
<td>
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
'
|
875 |
-
'
|
876 |
-
'
|
877 |
-
'
|
878 |
-
'
|
879 |
-
'
|
880 |
-
'
|
881 |
-
'
|
882 |
-
'
|
883 |
-
'
|
884 |
-
'
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
<td
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
jQuery('#
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
'
|
1012 |
-
'
|
1013 |
-
'
|
1014 |
-
'
|
1015 |
-
'
|
1016 |
-
'
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
}
|
1032 |
-
|
|
|
|
|
|
|
1033 |
?>
|
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'] : 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 |
+
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
+
$months = (isset($_GET['months']) ? esc_html($_GET['months']) : '');
|
13 |
+
|
14 |
+
///////////////////////////////////////////////////////////////////////////////////
|
15 |
+
|
16 |
+
|
17 |
+
if(isset($_GET['cat_id']))
|
18 |
+
$cat_id = $_GET['cat_id'];
|
19 |
+
else $cat_id = "";
|
20 |
+
|
21 |
+
if(isset($_GET['cat_ids']))
|
22 |
+
$cat_ids = $_GET['cat_ids'];
|
23 |
+
else $cat_ids = "";
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
if($cat_ids=='')
|
28 |
+
$cat_ids .= $cat_id.',';
|
29 |
+
else
|
30 |
+
$cat_ids .= ','.$cat_id.',';
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
35 |
+
|
36 |
+
function getelementcountinarray($array , $element)
|
37 |
+
{
|
38 |
+
$t=0;
|
39 |
+
|
40 |
+
for($i=0; $i<count($array); $i++)
|
41 |
+
{
|
42 |
+
if($element==$array[$i])
|
43 |
+
$t++;
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
|
48 |
+
return $t;
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
function getelementindexinarray($array , $element)
|
53 |
+
{
|
54 |
+
|
55 |
+
$t='';
|
56 |
+
|
57 |
+
for($i=0; $i<count($array); $i++)
|
58 |
+
{
|
59 |
+
if($element==$array[$i])
|
60 |
+
$t.=$i.',';
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
return $t;
|
65 |
+
|
66 |
+
|
67 |
+
}
|
68 |
+
$cat_ids_array = explode(',',$cat_ids);
|
69 |
+
|
70 |
+
if($cat_id!='')
|
71 |
+
{
|
72 |
+
|
73 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
74 |
+
{
|
75 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
76 |
+
$index_array = explode(',' , $index_in_line);
|
77 |
+
array_pop ($index_array);
|
78 |
+
for($j=0; $j<count($index_array); $j++)
|
79 |
+
unset($cat_ids_array[$index_array[$j]]);
|
80 |
+
$cat_ids = implode(',',$cat_ids_array);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
else
|
84 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
85 |
+
|
86 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
87 |
+
|
88 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
89 |
+
$cal_width = $theme->width;
|
90 |
+
$bg_top = '#' . $theme->bg_top;
|
91 |
+
$show_cat = 1;
|
92 |
+
$bg_bottom = '#' . $theme->bg_bottom;
|
93 |
+
$border_color = '#' . $theme->border_color;
|
94 |
+
$text_color_year = '#' . $theme->text_color_year;
|
95 |
+
$text_color_month = '#' . $theme->text_color_month;
|
96 |
+
$color_week_days = '#' . $theme->text_color_week_days;
|
97 |
+
$text_color_other_months = '#' . $theme->text_color_other_months;
|
98 |
+
$text_color_this_month_unevented = '#' . $theme->text_color_this_month_unevented;
|
99 |
+
$evented_color = '#' . $theme->text_color_this_month_evented;
|
100 |
+
$evented_color_bg = '#' . $theme->bg_color_this_month_evented;
|
101 |
+
$color_arrow_year = '#' . $theme->arrow_color_year;
|
102 |
+
$color_arrow_month = '#' . $theme->arrow_color_month;
|
103 |
+
$sun_days = '#' . $theme->text_color_sun_days;
|
104 |
+
$event_title_color = '#' . $theme->event_title_color;
|
105 |
+
$current_day_border_color = '#' . $theme->current_day_border_color;
|
106 |
+
$cell_border_color = '#' . $theme->cell_border_color;
|
107 |
+
$cell_height = $theme->cell_height;
|
108 |
+
$popup_width = $theme->popup_width;
|
109 |
+
$popup_height = $theme->popup_height;
|
110 |
+
$number_of_shown_evetns = $theme->number_of_shown_evetns;
|
111 |
+
$sundays_font_size = $theme->sundays_font_size;
|
112 |
+
$other_days_font_size = $theme->other_days_font_size;
|
113 |
+
$weekdays_font_size = $theme->weekdays_font_size;
|
114 |
+
$border_width = $theme->border_width;
|
115 |
+
$top_height = $theme->top_height;
|
116 |
+
$bg_color_other_months = '#' . $theme->bg_color_other_months;
|
117 |
+
$sundays_bg_color = '#' . $theme->sundays_bg_color;
|
118 |
+
$weekdays_bg_color = '#' . $theme->weekdays_bg_color;
|
119 |
+
$weekstart = $theme->week_start_day;
|
120 |
+
$weekday_sunday_bg_color = '#' . $theme->weekday_sunday_bg_color;
|
121 |
+
$border_radius = $theme->border_radius;
|
122 |
+
$border_radius2 = $border_radius-$border_width;
|
123 |
+
$week_days_cell_height = $theme->week_days_cell_height;
|
124 |
+
$year_font_size = $theme->year_font_size;
|
125 |
+
$month_font_size = $theme->month_font_size;
|
126 |
+
$arrow_size = $theme->arrow_size;
|
127 |
+
$arrow_size_hover = $arrow_size + 5;
|
128 |
+
$next_month_text_color = '#' . $theme->next_month_text_color;
|
129 |
+
$prev_month_text_color = '#' . $theme->prev_month_text_color;
|
130 |
+
$next_month_arrow_color = '#' . $theme->next_month_arrow_color;
|
131 |
+
$prev_month_arrow_color = '#' . $theme->prev_month_arrow_color;
|
132 |
+
$next_month_font_size = $theme->next_month_font_size;
|
133 |
+
$prev_month_font_size = $theme->prev_month_font_size;
|
134 |
+
$month_type = $theme->month_type;
|
135 |
+
$date_bg_color = '#' . $theme->date_bg_color;
|
136 |
+
$event_bg_color1 = '#' . $theme->event_bg_color1;
|
137 |
+
$event_bg_color2 = '#' . $theme->event_bg_color2;
|
138 |
+
$event_num_bg_color1 = '#' . $theme->event_num_bg_color1;
|
139 |
+
$event_num_bg_color2 = '#' . $theme->event_num_bg_color2;
|
140 |
+
$event_num_color = '#' . $theme->event_num_color;
|
141 |
+
$date_font_size = $theme->date_font_size;
|
142 |
+
$event_num_font_size = $theme->event_num_font_size;
|
143 |
+
$event_table_height = $theme->event_table_height;
|
144 |
+
$date_height = $theme->date_height;
|
145 |
+
$day_month_font_size = $theme->day_month_font_size;
|
146 |
+
$week_font_size = $theme->week_font_size;
|
147 |
+
$day_month_font_color = '#' . $theme->day_month_font_color;
|
148 |
+
$week_font_color = '#' . $theme->week_font_color;
|
149 |
+
$views_tabs_bg_color = '#' . $theme->views_tabs_bg_color;
|
150 |
+
$views_tabs_text_color = '#' . $theme->views_tabs_text_color;
|
151 |
+
$views_tabs_font_size = $theme->views_tabs_font_size;
|
152 |
+
$show_numbers_for_events = $theme->day_start;
|
153 |
+
|
154 |
+
__('January', 'sp_calendar');
|
155 |
+
__('February', 'sp_calendar');
|
156 |
+
__('March', 'sp_calendar');
|
157 |
+
__('April', 'sp_calendar');
|
158 |
+
__('May', 'sp_calendar');
|
159 |
+
__('June', 'sp_calendar');
|
160 |
+
__('July', 'sp_calendar');
|
161 |
+
__('August', 'sp_calendar');
|
162 |
+
__('September', 'sp_calendar');
|
163 |
+
__('October', 'sp_calendar');
|
164 |
+
__('November', 'sp_calendar');
|
165 |
+
__('December', 'sp_calendar');
|
166 |
+
if ($cell_height == '') {
|
167 |
+
$cell_height = 70;
|
168 |
+
}
|
169 |
+
if ($cal_width == '') {
|
170 |
+
$cal_width = 700;
|
171 |
+
}
|
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 |
+
|
190 |
+
$week_days = array();
|
191 |
+
$d = new DateTime($date);
|
192 |
+
$weekday = $d->format('w');
|
193 |
+
// Monday=0, Sunday=6.
|
194 |
+
$diff = ($weekday == 0 ? 6 : $weekday - 1);
|
195 |
+
if ($weekstart == "su") {
|
196 |
+
$diff = $diff + 1;
|
197 |
+
}
|
198 |
+
$d->modify("-$diff day");
|
199 |
+
$d->modify("-1 day");
|
200 |
+
$prev_date = $d->format('Y-m-d');
|
201 |
+
$d->modify("+1 day");
|
202 |
+
$week_days[] = $d->format('Y-m-d');
|
203 |
+
for ($i = 1; $i < 7; $i++) {
|
204 |
+
$d->modify('+1 day');
|
205 |
+
$week_days[] = $d->format('Y-m-d');
|
206 |
+
}
|
207 |
+
if ($weekstart == "su") {
|
208 |
+
$d->modify('+2 day');
|
209 |
+
}
|
210 |
+
else {
|
211 |
+
$d->modify('+1 day');
|
212 |
+
}
|
213 |
+
$next_date = $d->format('Y-m-d');
|
214 |
+
$prev_month = add_0((int) substr($prev_date, 5, 2) - 1);
|
215 |
+
$this_month = add_0((int) substr($prev_date, 5, 2));
|
216 |
+
$next_month = add_0((int) substr($prev_date, 5, 2) + 1);
|
217 |
+
if ($next_month == '13') {
|
218 |
+
$next_month = '01';
|
219 |
+
}
|
220 |
+
if ($prev_month == '00') {
|
221 |
+
$prev_month = '12';
|
222 |
+
}
|
223 |
+
|
224 |
+
$view = 'bigcalendarweek';
|
225 |
+
$views = explode(',', $view_select);
|
226 |
+
$defaultview = 'week';
|
227 |
+
array_pop($views);
|
228 |
+
$display = '';
|
229 |
+
if (count($views) == 0) {
|
230 |
+
$display = "display:none";
|
231 |
+
}
|
232 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
233 |
+
$display = "display:none";
|
234 |
+
}
|
235 |
+
?>
|
236 |
+
<style type='text/css'>
|
237 |
+
.week_list:last-child{
|
238 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
239 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
240 |
+
border-radius:<?php echo $border_radius2; ?>px !important;
|
241 |
+
border-bottom-left-radius: <?php echo $border_radius2; ?>px !important;
|
242 |
+
}
|
243 |
+
|
244 |
+
.general_table table table:last-child .week_list .week_ev{
|
245 |
+
border-bottom-left-radius:<?php echo $border_radius2?>px;
|
246 |
+
|
247 |
+
}
|
248 |
+
|
249 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
250 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
251 |
+
#spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
|
252 |
+
border: none !important;
|
253 |
+
}
|
254 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . general_table {
|
255 |
+
border-radius: <?php echo $border_radius; ?>px !important;
|
256 |
+
}
|
257 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . top_table {
|
258 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px !important;
|
259 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px !important;
|
260 |
+
}
|
261 |
+
|
262 |
+
.general_table table tr:last-child >td:last-child{
|
263 |
+
border-bottom-right-radius: <?php echo $border_radius2; ?>px;
|
264 |
+
border-top-right-radius: <?php echo $border_radius2 ?>px;
|
265 |
+
}
|
266 |
+
|
267 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow a : link,
|
268 |
+
#bigcalendar .cala_arrow a:visited {
|
269 |
+
text-decoration: none !important;
|
270 |
+
background: none !important;
|
271 |
+
font-size: <?php echo $arrow_size; ?>px !important;
|
272 |
+
}
|
273 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow {
|
274 |
+
vertical-align: middle !important;
|
275 |
+
}
|
276 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow a : hover {
|
277 |
+
font-size: <?php echo $arrow_size_hover; ?>px !important;
|
278 |
+
text-decoration: none !important;
|
279 |
+
background: none !important;
|
280 |
+
}
|
281 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : link,
|
282 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : visited {
|
283 |
+
text-decoration: none !important;
|
284 |
+
background: none !important;
|
285 |
+
font-size: 12px !important;
|
286 |
+
color: red;
|
287 |
+
}
|
288 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : hover {
|
289 |
+
text-decoration: none !important;
|
290 |
+
background: none !important;
|
291 |
+
}
|
292 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . cala_day {
|
293 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
294 |
+
<?php echo 'vertical-align:top !important;'; ?>
|
295 |
+
}
|
296 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . weekdays {
|
297 |
+
vertical-align: middle !important;
|
298 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
299 |
+
}
|
300 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . week_days {
|
301 |
+
font-size: <?php echo $weekdays_font_size; ?>px !important;
|
302 |
+
}
|
303 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calyear_table {
|
304 |
+
border-spacing: 0 !important;
|
305 |
+
width: 100% !important;
|
306 |
+
}
|
307 |
+
. calyear_table table #bigcalendar<?php echo $many_sp_calendar; ?> . calmonth_table {
|
308 |
+
border-spacing: 0 !important;
|
309 |
+
width: 100% !important;
|
310 |
+
}
|
311 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calbg, #bigcalendar .calbg td {
|
312 |
+
text-align: center !important;
|
313 |
+
width: 14% !important;
|
314 |
+
}
|
315 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . caltext_color_other_months {
|
316 |
+
color: <?php echo $text_color_other_months; ?> !important;
|
317 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
318 |
+
<?php echo 'vertical-align:top !important;'; ?>
|
319 |
+
}
|
320 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . caltext_color_this_month_unevented {
|
321 |
+
color: <?php echo $text_color_this_month_unevented; ?> !important;
|
322 |
+
}
|
323 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calfont_year {
|
324 |
+
font-size: 24px !important;
|
325 |
+
font-weight: bold !important;
|
326 |
+
color: <?php echo $text_color_year; ?> !important;
|
327 |
+
}
|
328 |
+
.general_table table, .general_table td, .general_table tr {
|
329 |
+
border: inherit !important;
|
330 |
+
vertical-align: initial !important;
|
331 |
+
border-collapse: inherit !important;
|
332 |
+
margin: inherit !important;
|
333 |
+
padding: inherit !important;
|
334 |
+
}
|
335 |
+
.general_table {
|
336 |
+
border-collapse: inherit !important;
|
337 |
+
margin: inherit !important;
|
338 |
+
}
|
339 |
+
.general_table p {
|
340 |
+
margin: inherit !important;
|
341 |
+
padding: inherit !important;
|
342 |
+
}
|
343 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calsun_days {
|
344 |
+
color: <?php echo $sun_days; ?> !important;
|
345 |
+
border: 1px solid <?php echo $cell_border_color; ?> !important;
|
346 |
+
<?php echo 'vertical-align:top !important; text-align:left !important;'; ?>
|
347 |
+
background-color: <?php echo $sundays_bg_color; ?> !important;
|
348 |
+
}
|
349 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> . calbottom_border {
|
350 |
+
|
351 |
+
}
|
352 |
+
#TB_window {
|
353 |
+
z-index: 10000;
|
354 |
+
}
|
355 |
+
|
356 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td {
|
357 |
+
vertical-align: middle !important;
|
358 |
+
}
|
359 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table {
|
360 |
+
border-collapse: initial;
|
361 |
+
border:0px;
|
362 |
+
max-width: none;
|
363 |
+
}
|
364 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table tr:hover td {
|
365 |
+
background: none;
|
366 |
+
}
|
367 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> table td {
|
368 |
+
padding: 0px;
|
369 |
+
vertical-align: none;
|
370 |
+
border-top:none;
|
371 |
+
line-height: none;
|
372 |
+
text-align: none;
|
373 |
+
}
|
374 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
375 |
+
margin-bottom:0;
|
376 |
+
}
|
377 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> td,
|
378 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> tr,
|
379 |
+
#spiderCalendarTitlesList td,
|
380 |
+
#spiderCalendarTitlesList tr {
|
381 |
+
border:none;
|
382 |
+
}
|
383 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
|
384 |
+
border-radius: <?php echo $border_radius; ?>px;
|
385 |
+
}
|
386 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
|
387 |
+
border-top-left-radius: <?php echo $border_radius2; ?>px;
|
388 |
+
border-top-right-radius: <?php echo $border_radius2; ?>px;
|
389 |
+
}
|
390 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
391 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
392 |
+
text-decoration:none;
|
393 |
+
background:none;
|
394 |
+
font-size: <?php echo $arrow_size; ?>px;
|
395 |
+
}
|
396 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
397 |
+
text-decoration:none;
|
398 |
+
background:none;
|
399 |
+
}
|
400 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
401 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
402 |
+
text-decoration:none;
|
403 |
+
background:none;
|
404 |
+
font-size:12px;
|
405 |
+
color:red;
|
406 |
+
}
|
407 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
408 |
+
text-decoration:none;
|
409 |
+
background:none;
|
410 |
+
}
|
411 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
|
412 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
413 |
+
vertical-align:top;
|
414 |
+
}
|
415 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
|
416 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
417 |
+
}
|
418 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
|
419 |
+
font-size:<?php echo $weekdays_font_size; ?>px;
|
420 |
+
}
|
421 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
|
422 |
+
border-spacing:0;
|
423 |
+
width:100%;
|
424 |
+
}
|
425 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
|
426 |
+
border-spacing:0;
|
427 |
+
width:100%;
|
428 |
+
}
|
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 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
435 |
+
color:<?php echo $text_color_other_months; ?>;
|
436 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
437 |
+
vertical-align:top;
|
438 |
+
}
|
439 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
440 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
441 |
+
}
|
442 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
|
443 |
+
font-size:24px;
|
444 |
+
font-weight:bold;
|
445 |
+
color:<?php echo $text_color_year; ?>;
|
446 |
+
}
|
447 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
|
448 |
+
color:<?php echo $sun_days; ?>;
|
449 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
450 |
+
vertical-align:top;
|
451 |
+
text-align:left;
|
452 |
+
background-color:<?php echo $sundays_bg_color; ?>;
|
453 |
+
}
|
454 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views {
|
455 |
+
float: right;
|
456 |
+
background-color: <?php echo $views_tabs_bg_color; ?>;
|
457 |
+
min-height: 25px;
|
458 |
+
min-width: 70px;
|
459 |
+
margin-right: 2px;
|
460 |
+
text-align: center;
|
461 |
+
cursor:pointer;
|
462 |
+
position: relative;
|
463 |
+
top: 5px;
|
464 |
+
}
|
465 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views span{
|
466 |
+
padding: 7px;
|
467 |
+
}
|
468 |
+
|
469 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
|
470 |
+
#bigcalendar<?php echo $many_sp_calendar; ?> #views_select
|
471 |
+
{
|
472 |
+
|
473 |
+
background-color: <?php echo $views_tabs_bg_color?> ;
|
474 |
+
width: 120px;
|
475 |
+
text-align: center;
|
476 |
+
cursor: pointer;
|
477 |
+
padding: 6px;
|
478 |
+
position: relative;
|
479 |
+
}
|
480 |
+
|
481 |
+
|
482 |
+
#drop_down_views
|
483 |
+
{
|
484 |
+
list-style-type:none !important;
|
485 |
+
position: absolute;
|
486 |
+
top: 46px;
|
487 |
+
left: -15px;
|
488 |
+
display:none;
|
489 |
+
z-index: 4545;
|
490 |
+
|
491 |
+
}
|
492 |
+
|
493 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
494 |
+
{
|
495 |
+
background:<?php echo $bg_top ?>;
|
496 |
+
}
|
497 |
+
|
498 |
+
#drop_down_views >li
|
499 |
+
{
|
500 |
+
border-bottom:1px solid #fff !important;
|
501 |
+
}
|
502 |
+
|
503 |
+
|
504 |
+
#views_tabs_select
|
505 |
+
{
|
506 |
+
display:none;
|
507 |
+
}
|
508 |
+
|
509 |
+
</style>
|
510 |
+
<div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
|
511 |
+
<div style="width:100%;">
|
512 |
+
<table cellpadding="0" cellspacing="0" style="width:100%;">
|
513 |
+
<tr>
|
514 |
+
<td>
|
515 |
+
<div id="views_tabs" style="width: 100%;<?php echo $display; ?>">
|
516 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
517 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
518 |
+
'action' => 'spiderbigcalendar_day',
|
519 |
+
'theme_id' => $theme_id,
|
520 |
+
'calendar' => $calendar_id,
|
521 |
+
'select' => $view_select,
|
522 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
523 |
+
'many_sp_calendar' => $many_sp_calendar,
|
524 |
+
'cur_page_url' => $path_sp_cal,
|
525 |
+
'cat_id' => '',
|
526 |
+
'cat_ids' => $cat_ids,
|
527 |
+
'widget' => $widget,
|
528 |
+
'rand' => $many_sp_calendar,
|
529 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
530 |
+
</div>
|
531 |
+
<div class="views" style="<?php if (!in_array('week', $views) AND $defaultview != 'week') echo 'display:none;'; if ($view == 'bigcalendarweek') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
532 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
533 |
+
'action' => 'spiderbigcalendar_week',
|
534 |
+
'theme_id' => $theme_id,
|
535 |
+
'calendar' => $calendar_id,
|
536 |
+
'select' => $view_select,
|
537 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
538 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
539 |
+
'many_sp_calendar' => $many_sp_calendar,
|
540 |
+
'cur_page_url' => $path_sp_cal,
|
541 |
+
'cat_id' => '',
|
542 |
+
'cat_ids' => $cat_ids,
|
543 |
+
'widget' => $widget,
|
544 |
+
'rand' => $many_sp_calendar,
|
545 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
546 |
+
</div>
|
547 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist') echo 'background-color:' . $bg_top . ';top:0;' ?>"
|
548 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
549 |
+
'action' => 'spiderbigcalendar_list',
|
550 |
+
'theme_id' => $theme_id,
|
551 |
+
'calendar' => $calendar_id,
|
552 |
+
'select' => $view_select,
|
553 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
554 |
+
'many_sp_calendar' => $many_sp_calendar,
|
555 |
+
'cur_page_url' => $path_sp_cal,
|
556 |
+
'cat_id' => '',
|
557 |
+
'cat_ids' => $cat_ids,
|
558 |
+
'widget' => $widget,
|
559 |
+
'rand' => $many_sp_calendar,
|
560 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
561 |
+
</div>
|
562 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth') echo 'background-color:' . $bg_top . ';top:0;'; ?>"
|
563 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
564 |
+
'action' => 'spiderbigcalendar_month',
|
565 |
+
'theme_id' => $theme_id,
|
566 |
+
'calendar' => $calendar_id,
|
567 |
+
'select' => $view_select,
|
568 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
569 |
+
'many_sp_calendar' => $many_sp_calendar,
|
570 |
+
'cur_page_url' => $path_sp_cal,
|
571 |
+
'cat_id' => '',
|
572 |
+
'cat_ids' => $cat_ids,
|
573 |
+
'widget' => $widget,
|
574 |
+
'rand' => $many_sp_calendar,
|
575 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
576 |
+
</div>
|
577 |
+
</div>
|
578 |
+
<div id="views_tabs_select" style="display:none" >
|
579 |
+
<div id="views_select" style="background-color:<?php echo $bg_top?>;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">
|
580 |
+
<?php if($view=='bigcalendarday') echo 'Day'; ?>
|
581 |
+
<?php if($view=='bigcalendarmonth') echo 'Month'; ?>
|
582 |
+
<?php if($view=='bigcalendarweek') echo 'Week'; ?>
|
583 |
+
<?php if($view=='bigcalendarlist') echo 'List'; ?>
|
584 |
+
<span>►</span>
|
585 |
+
</div>
|
586 |
+
<ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
|
587 |
+
<li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
|
588 |
+
<div class="views_select"
|
589 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
590 |
+
'action' => 'spiderbigcalendar_day',
|
591 |
+
'theme_id' => $theme_id,
|
592 |
+
'calendar' => $calendar_id,
|
593 |
+
'select' => $view_select,
|
594 |
+
'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
|
595 |
+
'many_sp_calendar' => $many_sp_calendar,
|
596 |
+
'cur_page_url' => $path_sp_cal,
|
597 |
+
'cat_id' => '',
|
598 |
+
'cat_ids' => $cat_ids,
|
599 |
+
'widget' => $widget,
|
600 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
601 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
|
602 |
+
</div>
|
603 |
+
</li>
|
604 |
+
|
605 |
+
<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"
|
606 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
607 |
+
'action' => 'spiderbigcalendar_week',
|
608 |
+
'theme_id' => $theme_id,
|
609 |
+
'calendar' => $calendar_id,
|
610 |
+
'select' => $view_select,
|
611 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
612 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
613 |
+
'many_sp_calendar' => $many_sp_calendar,
|
614 |
+
'cur_page_url' => $path_sp_cal,
|
615 |
+
'cat_id' => '',
|
616 |
+
'cat_ids' => $cat_ids,
|
617 |
+
'widget' => $widget,
|
618 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
|
619 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
|
620 |
+
</div>
|
621 |
+
</li>
|
622 |
+
|
623 |
+
<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"
|
624 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
625 |
+
'action' => 'spiderbigcalendar_list',
|
626 |
+
'theme_id' => $theme_id,
|
627 |
+
'calendar' => $calendar_id,
|
628 |
+
'select' => $view_select,
|
629 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
630 |
+
'many_sp_calendar' => $many_sp_calendar,
|
631 |
+
'cur_page_url' => $path_sp_cal,
|
632 |
+
'cat_id' => '',
|
633 |
+
'cat_ids' => $cat_ids,
|
634 |
+
'widget' => $widget,
|
635 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
636 |
+
<span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
|
637 |
+
</div>
|
638 |
+
</li>
|
639 |
+
|
640 |
+
<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"
|
641 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
642 |
+
'action' => 'spiderbigcalendar_month',
|
643 |
+
'theme_id' => $theme_id,
|
644 |
+
'calendar' => $calendar_id,
|
645 |
+
'select' => $view_select,
|
646 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
647 |
+
'many_sp_calendar' => $many_sp_calendar,
|
648 |
+
'cur_page_url' => $path_sp_cal,
|
649 |
+
'cat_id' => '',
|
650 |
+
'cat_ids' => $cat_ids,
|
651 |
+
'widget' => $widget,
|
652 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
|
653 |
+
<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>
|
654 |
+
|
655 |
+
</ul>
|
656 |
+
</div>
|
657 |
+
</td>
|
658 |
+
</tr>
|
659 |
+
<tr>
|
660 |
+
<td>
|
661 |
+
<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; ?>;">
|
662 |
+
<tr>
|
663 |
+
<td width="100%" style="padding:0; margin:0">
|
664 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;">
|
665 |
+
<tr style="height:40px; width:100%;">
|
666 |
+
<td class="top_table" align="center" colspan="7" style="z-index: 5;position: relative;background-image:url('<?php echo plugins_url('/images/Stver.png', __FILE__); ?>');padding:0; margin:0; background-color:<?php echo $bg_top; ?>;height:20px; background-repeat: no-repeat;background-size: 100% 100%;">
|
667 |
+
<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;">
|
668 |
+
<tr>
|
669 |
+
<td style="width:100%;vertical-align:center">
|
670 |
+
<table style="width:100%;">
|
671 |
+
<tr>
|
672 |
+
<td width="15%">
|
673 |
+
<div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
674 |
+
echo add_query_arg(array(
|
675 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
676 |
+
'theme_id' => $theme_id,
|
677 |
+
'calendar' => $calendar_id,
|
678 |
+
'select' => $view_select,
|
679 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
680 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
681 |
+
'many_sp_calendar' => $many_sp_calendar,
|
682 |
+
'cur_page_url' => $path_sp_cal,
|
683 |
+
'cat_id' => '',
|
684 |
+
'cat_ids' => $cat_ids,
|
685 |
+
'widget' => $widget,
|
686 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%;background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
687 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year - 1; ?></span>
|
688 |
+
</div>
|
689 |
+
</td>
|
690 |
+
<td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
|
691 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>;" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
692 |
+
echo add_query_arg(array(
|
693 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
694 |
+
'theme_id' => $theme_id,
|
695 |
+
'calendar' => $calendar_id,
|
696 |
+
'select' => $view_select,
|
697 |
+
'date' => $prev_date,
|
698 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
699 |
+
'many_sp_calendar' => $many_sp_calendar,
|
700 |
+
'cur_page_url' => $path_sp_cal,
|
701 |
+
'cat_id' => '',
|
702 |
+
'cat_ids' => $cat_ids,
|
703 |
+
'widget' => $widget,
|
704 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◀
|
705 |
+
</a>
|
706 |
+
</td>
|
707 |
+
<?php
|
708 |
+
$weekstartday = substr($week_days[0],8,2);
|
709 |
+
$weekendday = substr($week_days[6],8,2);
|
710 |
+
$startmonth = substr($week_days[0],5,2);
|
711 |
+
$endmonth = substr($week_days[6],5,2);
|
712 |
+
|
713 |
+
$startmonth_name = month_name($startmonth);
|
714 |
+
$endmonth_name = month_name($endmonth); ?>
|
715 |
+
<td style="text-align:center; margin:0;" width="40%">
|
716 |
+
<input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
|
717 |
+
<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 __($startmonth_name,'sp_calendar').' '. $weekstartday . ' - ' . __($endmonth_name,'sp_calendar') .' '. $weekendday; ?></span>
|
718 |
+
</td>
|
719 |
+
<td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
|
720 |
+
<a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
|
721 |
+
echo add_query_arg(array(
|
722 |
+
'action' => 'spiderbigcalendar_' . $defaultview,
|
723 |
+
'theme_id' => $theme_id,
|
724 |
+
'calendar' => $calendar_id,
|
725 |
+
'select' => $view_select,
|
726 |
+
'date' => $next_date,
|
727 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
728 |
+
'many_sp_calendar' => $many_sp_calendar,
|
729 |
+
'cur_page_url' => $path_sp_cal,
|
730 |
+
'cat_id' => '',
|
731 |
+
'cat_ids' => $cat_ids,
|
732 |
+
'widget' => $widget,
|
733 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">▶
|
734 |
+
</a>
|
735 |
+
</td>
|
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 |
+
'cur_page_url' => $path_sp_cal,
|
747 |
+
'cat_id' => '',
|
748 |
+
'cat_ids' => $cat_ids,
|
749 |
+
'widget' => $widget,
|
750 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" style="text-align:center; cursor:pointer; width:100%; background-color:#000000; filter:alpha(opacity=30); opacity:0.3;">
|
751 |
+
<span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
|
752 |
+
</div>
|
753 |
+
</td>
|
754 |
+
</tr>
|
755 |
+
</table>
|
756 |
+
</td>
|
757 |
+
</tr>
|
758 |
+
</table>
|
759 |
+
</td>
|
760 |
+
|
761 |
+
</tr>
|
762 |
+
</tr>
|
763 |
+
<tr>
|
764 |
+
<td>
|
765 |
+
<?php
|
766 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
767 |
+
if ($weekstart == "su") {
|
768 |
+
$month_first_weekday++;
|
769 |
+
if ($month_first_weekday == 8) {
|
770 |
+
$month_first_weekday = 1;
|
771 |
+
}
|
772 |
+
}
|
773 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
774 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
775 |
+
$last_month_days_count = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
776 |
+
$weekday_i = $month_first_weekday;
|
777 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
778 |
+
$percent = 1;
|
779 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
780 |
+
if ($sum % 7 <> 0) {
|
781 |
+
$percent = $percent + 1;
|
782 |
+
}
|
783 |
+
$sum = $sum - ($sum % 7);
|
784 |
+
$percent = $percent + ($sum / 7);
|
785 |
+
$percent = 107 / $percent;
|
786 |
+
|
787 |
+
$all_calendar_files = php_getdays_for_three_months($calendar_id, $date, $months, $theme_id, $widget);
|
788 |
+
|
789 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
790 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
791 |
+
|
792 |
+
$all_array_days = $all_calendar_files[0]['all_array_days'];
|
793 |
+
$all_array_days1 = $all_calendar_files[0]['all_array_days1'];
|
794 |
+
$all_title = $all_calendar_files[0]['all_title'];
|
795 |
+
$all_ev_ids = $all_calendar_files[0]['all_ev_ids'];
|
796 |
+
|
797 |
+
$prev_month = substr($months, 0, 2);
|
798 |
+
$this_month = substr($months, 3, 2);
|
799 |
+
$next_month = substr($months, 6, 2);
|
800 |
+
|
801 |
+
for ($i = 0; $i <= 6; $i++) {
|
802 |
+
$day=substr($week_days[$i],8,2);
|
803 |
+
$month=substr($week_days[$i],5,2);
|
804 |
+
$year=substr($week_days[$i],0,4);
|
805 |
+
|
806 |
+
switch($month)
|
807 |
+
{
|
808 |
+
case $prev_month:
|
809 |
+
$array_days=$all_array_days[0];
|
810 |
+
$array_days1=$all_array_days1[0];
|
811 |
+
$title=$all_title[0];
|
812 |
+
$ev_ids=$all_ev_ids[0];
|
813 |
+
break;
|
814 |
+
|
815 |
+
case $this_month:
|
816 |
+
$array_days=$all_array_days[1];
|
817 |
+
$array_days1=$all_array_days1[1];
|
818 |
+
$title=$all_title[1];
|
819 |
+
$ev_ids=$all_ev_ids[1];
|
820 |
+
break;
|
821 |
+
|
822 |
+
case $next_month:
|
823 |
+
$array_days=$all_array_days[2];
|
824 |
+
$array_days1=$all_array_days1[2];
|
825 |
+
$title=$all_title[2];
|
826 |
+
$ev_ids=$all_ev_ids[2];
|
827 |
+
break;
|
828 |
+
|
829 |
+
}
|
830 |
+
|
831 |
+
|
832 |
+
|
833 |
+
sort($array_days, SORT_NUMERIC);
|
834 |
+
$week_day = date('D', mktime(0, 0, 0, $month, (int) $day, $year));
|
835 |
+
$month_name = month_name($month);
|
836 |
+
echo '<table style="width:100%;border-spacing:0;">
|
837 |
+
<tr>
|
838 |
+
<td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
|
839 |
+
<span style="padding-left:10px; font-size:' . $date_font_size . 'px; color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
|
840 |
+
<span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . __($month_name,'sp_calendar') . ' ' . (int) $day . ')</span>
|
841 |
+
</td>
|
842 |
+
<tr>
|
843 |
+
<td>';
|
844 |
+
if (in_array((int) $day, $array_days)) {
|
845 |
+
foreach($title as $key => $value) {
|
846 |
+
if ($key == (int) $day) {
|
847 |
+
$ev_id = explode('<br>', $ev_ids[$key]);
|
848 |
+
array_pop($ev_id);
|
849 |
+
$ev_ids_inline = implode(',', $ev_id);
|
850 |
+
$ev_title = explode('</p>', $value);
|
851 |
+
array_pop($ev_title);
|
852 |
+
for ($j = 0; $j < count($ev_title); $j++) {
|
853 |
+
$queryy =$wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
854 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
855 |
+
" . $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]);
|
856 |
+
|
857 |
+
$cat_color = $wpdb->get_row($queryy);
|
858 |
+
|
859 |
+
if (($j + 1) % 2 == 0) {
|
860 |
+
$color = $event_num_bg_color2;
|
861 |
+
$table_color = $event_bg_color2;
|
862 |
+
}
|
863 |
+
else {
|
864 |
+
$color = $event_num_bg_color1;
|
865 |
+
$table_color = $event_bg_color1;
|
866 |
+
}
|
867 |
+
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color="";};
|
868 |
+
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . '" class="week_list">
|
869 |
+
<tr>
|
870 |
+
<td class="week_ev" style="font-size:' . $event_num_font_size . 'px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $event_num_color . '">' . (($show_numbers_for_events) ? ($j + 1) : '') . '</td>
|
871 |
+
<td>
|
872 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:15px;background:none;color:' . $event_title_color . ';"
|
873 |
+
href="' . add_query_arg(array(
|
874 |
+
'action' => 'spidercalendarbig',
|
875 |
+
'theme_id' => $theme_id,
|
876 |
+
'calendar_id' => $calendar_id,
|
877 |
+
'ev_ids' => $ev_ids_inline,
|
878 |
+
'eventID' => $ev_id[$j],
|
879 |
+
'date' => $year . '-' . $month . '-' . (int) $day,
|
880 |
+
'many_sp_calendar' => $many_sp_calendar,
|
881 |
+
'cur_page_url' => $path_sp_cal,
|
882 |
+
'widget' => $widget,
|
883 |
+
'TB_iframe' => 1,
|
884 |
+
'tbWidth' => $popup_width,
|
885 |
+
'tbHeight' => $popup_height,
|
886 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $ev_title[$j] . '</b>
|
887 |
+
</a>
|
888 |
+
</td>
|
889 |
+
</tr>
|
890 |
+
</table>';
|
891 |
+
}
|
892 |
+
}
|
893 |
+
}
|
894 |
+
}
|
895 |
+
else {
|
896 |
+
echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '" class="week_list">
|
897 |
+
<tr>
|
898 |
+
<td class="week_ev" style="font-size:22px; font-weight:bold; width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ';color:' . $event_num_color . '"></td>
|
899 |
+
<td><p style="color:' . $event_title_color . '; border:none"> ' . __('There Is No Event In This Day', 'sp_calendar') . '</p></td>
|
900 |
+
</tr>
|
901 |
+
</table>';
|
902 |
+
}
|
903 |
+
echo '</td></tr></table>';
|
904 |
+
}
|
905 |
+
?>
|
906 |
+
</td>
|
907 |
+
</tr>
|
908 |
+
</table>
|
909 |
+
</tr>
|
910 |
+
</table>
|
911 |
+
</td>
|
912 |
+
</tr>
|
913 |
+
</table>
|
914 |
+
</div>
|
915 |
+
<script>
|
916 |
+
|
917 |
+
jQuery(document).ready(function (){
|
918 |
+
|
919 |
+
jQuery('#views_select').click(function () {
|
920 |
+
jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
|
921 |
+
}, function () {
|
922 |
+
jQuery('#drop_down_views').stop(true, true).slideUp(500);
|
923 |
+
});
|
924 |
+
if(jQuery(window).width() > 640 )
|
925 |
+
{
|
926 |
+
jQuery('drop_down_views').hide();
|
927 |
+
}
|
928 |
+
});
|
929 |
+
</script>
|
930 |
+
|
931 |
+
|
932 |
+
<style>
|
933 |
+
|
934 |
+
@media only screen and (max-width : 640px) {
|
935 |
+
|
936 |
+
#views_tabs ,#drop_down_views
|
937 |
+
{
|
938 |
+
display:none;
|
939 |
+
}
|
940 |
+
|
941 |
+
#views_tabs_select
|
942 |
+
{
|
943 |
+
display:block !important;
|
944 |
+
}
|
945 |
+
|
946 |
+
|
947 |
+
|
948 |
+
}
|
949 |
+
|
950 |
+
@media only screen and (max-width : 968px) {
|
951 |
+
#cats >li
|
952 |
+
{
|
953 |
+
float:none;
|
954 |
+
}
|
955 |
+
|
956 |
+
|
957 |
+
|
958 |
+
}
|
959 |
+
.categories1 , .categories2
|
960 |
+
{
|
961 |
+
display:inline-block;
|
962 |
+
}
|
963 |
+
|
964 |
+
.categories2
|
965 |
+
{
|
966 |
+
position:relative;
|
967 |
+
left: -9px;
|
968 |
+
cursor:pointer;
|
969 |
+
}
|
970 |
+
.categories2:first-letter
|
971 |
+
{
|
972 |
+
color:#fff;
|
973 |
+
|
974 |
+
}
|
975 |
+
</style>
|
976 |
+
<?php
|
977 |
+
|
978 |
+
//reindex cat_ids_array
|
979 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
980 |
+
|
981 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
982 |
+
{
|
983 |
+
echo'
|
984 |
+
<style>
|
985 |
+
#cats #category'.$re_cat_ids_array[$i].'
|
986 |
+
{
|
987 |
+
text-decoration:underline;
|
988 |
+
cursor:pointer;
|
989 |
+
|
990 |
+
}
|
991 |
+
|
992 |
+
</style>';
|
993 |
+
|
994 |
+
}
|
995 |
+
|
996 |
+
|
997 |
+
|
998 |
+
if($cat_ids=='')
|
999 |
+
$cat_ids='';
|
1000 |
+
|
1001 |
+
if($show_cat==1)
|
1002 |
+
{
|
1003 |
+
echo '<ul id="cats" style="list-style-type:none;">';
|
1004 |
+
|
1005 |
+
foreach($categories as $category)
|
1006 |
+
{
|
1007 |
+
|
1008 |
+
?>
|
1009 |
+
|
1010 |
+
<li style="float:left;"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
1011 |
+
'action' => 'spiderbigcalendar_week',
|
1012 |
+
'theme_id' => $theme_id,
|
1013 |
+
'calendar' => $calendar_id,
|
1014 |
+
'select' => $view_select,
|
1015 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
1016 |
+
'date' => $year . '-' . $month . '-' . add_0($day),
|
1017 |
+
'many_sp_calendar' => $many_sp_calendar,
|
1018 |
+
'cur_page_url' => $path_sp_cal,
|
1019 |
+
'cat_id' => $category->id,
|
1020 |
+
'cat_ids' => $cat_ids,
|
1021 |
+
'widget' => $widget,
|
1022 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
1023 |
+
|
1024 |
+
|
1025 |
+
<?php
|
1026 |
+
|
1027 |
+
|
1028 |
+
}
|
1029 |
+
|
1030 |
+
echo '</ul>';
|
1031 |
+
}
|
1032 |
+
|
1033 |
+
die();
|
1034 |
+
}
|
1035 |
+
|
1036 |
?>
|
front_end/bigcalendarweek_widget.php
CHANGED
@@ -1,745 +1,746 @@
|
|
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 |
-
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
-
$months = (isset($_GET['months']) ? esc_html($_GET['months']) : '');
|
13 |
-
|
14 |
-
///////////////////////////////////////////////////////////////////////////////////
|
15 |
-
|
16 |
-
if(isset($_GET['cat_id']))
|
17 |
-
$cat_id = $_GET['cat_id'];
|
18 |
-
else $cat_id = "";
|
19 |
-
|
20 |
-
if(isset($_GET['cat_ids']))
|
21 |
-
$cat_ids = $_GET['cat_ids'];
|
22 |
-
else $cat_ids = "";
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
if($cat_ids=='')
|
27 |
-
$cat_ids .= $cat_id.',';
|
28 |
-
else
|
29 |
-
$cat_ids .= ','.$cat_id.',';
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
34 |
-
|
35 |
-
|
36 |
-
function getelementcountinarray($array , $element)
|
37 |
-
{
|
38 |
-
$t=0;
|
39 |
-
|
40 |
-
for($i=0; $i<count($array); $i++)
|
41 |
-
{
|
42 |
-
if($element==$array[$i])
|
43 |
-
$t++;
|
44 |
-
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
return $t;
|
49 |
-
|
50 |
-
}
|
51 |
-
|
52 |
-
function getelementindexinarray($array , $element)
|
53 |
-
{
|
54 |
-
|
55 |
-
$t='';
|
56 |
-
|
57 |
-
for($i=0; $i<count($array); $i++)
|
58 |
-
{
|
59 |
-
if($element==$array[$i])
|
60 |
-
$t.=$i.',';
|
61 |
-
|
62 |
-
}
|
63 |
-
|
64 |
-
return $t;
|
65 |
-
|
66 |
-
|
67 |
-
}
|
68 |
-
$cat_ids_array = explode(',',$cat_ids);
|
69 |
-
|
70 |
-
|
71 |
-
if($cat_id!='')
|
72 |
-
{
|
73 |
-
|
74 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
75 |
-
{
|
76 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
77 |
-
$index_array = explode(',' , $index_in_line);
|
78 |
-
array_pop ($index_array);
|
79 |
-
for($j=0; $j<count($index_array); $j++)
|
80 |
-
unset($cat_ids_array[$index_array[$j]]);
|
81 |
-
$cat_ids = implode(',',$cat_ids_array);
|
82 |
-
}
|
83 |
-
}
|
84 |
-
else
|
85 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
86 |
-
|
87 |
-
|
88 |
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
89 |
-
|
90 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
91 |
-
$weekstart = $theme->week_start_day;
|
92 |
-
$
|
93 |
-
$
|
94 |
-
$
|
95 |
-
$
|
96 |
-
$
|
97 |
-
$
|
98 |
-
$
|
99 |
-
$
|
100 |
-
$
|
101 |
-
$
|
102 |
-
$
|
103 |
-
$
|
104 |
-
$
|
105 |
-
$
|
106 |
-
$
|
107 |
-
$
|
108 |
-
$
|
109 |
-
$
|
110 |
-
$
|
111 |
-
$
|
112 |
-
$
|
113 |
-
$
|
114 |
-
$
|
115 |
-
$
|
116 |
-
$
|
117 |
-
$
|
118 |
-
$
|
119 |
-
|
120 |
-
|
121 |
-
__('
|
122 |
-
__('
|
123 |
-
__('
|
124 |
-
__('
|
125 |
-
__('
|
126 |
-
__('
|
127 |
-
__('
|
128 |
-
__('
|
129 |
-
__('
|
130 |
-
__('
|
131 |
-
__('
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
$
|
138 |
-
|
139 |
-
|
140 |
-
$
|
141 |
-
$
|
142 |
-
|
143 |
-
|
144 |
-
$
|
145 |
-
$
|
146 |
-
$
|
147 |
-
$
|
148 |
-
$cell_width =
|
149 |
-
|
150 |
-
|
151 |
-
$
|
152 |
-
$
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
$d->modify("
|
160 |
-
$
|
161 |
-
$d->
|
162 |
-
$
|
163 |
-
|
164 |
-
|
165 |
-
$
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
$
|
175 |
-
$
|
176 |
-
$
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
$
|
185 |
-
$
|
186 |
-
|
187 |
-
$
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
border:
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
#calendar_<?php echo $many_sp_calendar; ?>
|
217 |
-
#
|
218 |
-
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?>
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
font-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
#calendar_<?php echo $many_sp_calendar; ?>
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
'
|
345 |
-
'
|
346 |
-
'
|
347 |
-
'
|
348 |
-
'
|
349 |
-
'
|
350 |
-
|
351 |
-
'
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
'
|
360 |
-
'
|
361 |
-
'
|
362 |
-
'
|
363 |
-
'
|
364 |
-
'
|
365 |
-
'
|
366 |
-
|
367 |
-
'
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
'
|
376 |
-
'
|
377 |
-
'
|
378 |
-
'
|
379 |
-
'
|
380 |
-
'
|
381 |
-
|
382 |
-
'
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
'
|
391 |
-
'
|
392 |
-
'
|
393 |
-
'
|
394 |
-
'
|
395 |
-
'
|
396 |
-
|
397 |
-
'
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
'
|
425 |
-
'
|
426 |
-
'
|
427 |
-
'
|
428 |
-
'
|
429 |
-
'
|
430 |
-
'
|
431 |
-
|
432 |
-
'
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
$
|
442 |
-
$
|
443 |
-
$
|
444 |
-
|
445 |
-
|
446 |
-
$
|
447 |
-
|
448 |
-
|
449 |
-
<
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
'
|
462 |
-
'
|
463 |
-
'
|
464 |
-
'
|
465 |
-
'
|
466 |
-
'
|
467 |
-
'
|
468 |
-
|
469 |
-
'
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
$
|
493 |
-
$
|
494 |
-
$
|
495 |
-
$
|
496 |
-
$
|
497 |
-
$
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
$
|
503 |
-
$percent =
|
504 |
-
|
505 |
-
|
506 |
-
$
|
507 |
-
$
|
508 |
-
|
509 |
-
|
510 |
-
$
|
511 |
-
$
|
512 |
-
$
|
513 |
-
|
514 |
-
|
515 |
-
$
|
516 |
-
$
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
$
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
$
|
526 |
-
$
|
527 |
-
$
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
$
|
533 |
-
$
|
534 |
-
$
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
$
|
540 |
-
$
|
541 |
-
$
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
<span style="font-size:12px;color
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
$
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
" . $wpdb->prefix . "spidercalendar_event.
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
$
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
$
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
<td>
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
'
|
587 |
-
'
|
588 |
-
'
|
589 |
-
'
|
590 |
-
'
|
591 |
-
'
|
592 |
-
'
|
593 |
-
'
|
594 |
-
'
|
595 |
-
'
|
596 |
-
'
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
<td
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
'
|
624 |
-
'
|
625 |
-
'
|
626 |
-
'
|
627 |
-
'
|
628 |
-
'
|
629 |
-
'
|
630 |
-
'
|
631 |
-
|
632 |
-
'
|
633 |
-
'
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
'
|
644 |
-
'
|
645 |
-
'
|
646 |
-
'
|
647 |
-
'
|
648 |
-
'
|
649 |
-
'
|
650 |
-
'
|
651 |
-
|
652 |
-
'
|
653 |
-
'
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
'
|
722 |
-
'
|
723 |
-
'
|
724 |
-
|
725 |
-
|
726 |
-
'
|
727 |
-
'
|
728 |
-
|
729 |
-
'
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
|
|
745 |
?>
|
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 |
+
$path_sp_cal = (isset($_GET['cur_page_url']) ? esc_html($_GET['cur_page_url']) : '');
|
12 |
+
$months = (isset($_GET['months']) ? esc_html($_GET['months']) : '');
|
13 |
+
|
14 |
+
///////////////////////////////////////////////////////////////////////////////////
|
15 |
+
|
16 |
+
if(isset($_GET['cat_id']))
|
17 |
+
$cat_id = $_GET['cat_id'];
|
18 |
+
else $cat_id = "";
|
19 |
+
|
20 |
+
if(isset($_GET['cat_ids']))
|
21 |
+
$cat_ids = $_GET['cat_ids'];
|
22 |
+
else $cat_ids = "";
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
if($cat_ids=='')
|
27 |
+
$cat_ids .= $cat_id.',';
|
28 |
+
else
|
29 |
+
$cat_ids .= ','.$cat_id.',';
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
34 |
+
|
35 |
+
|
36 |
+
function getelementcountinarray($array , $element)
|
37 |
+
{
|
38 |
+
$t=0;
|
39 |
+
|
40 |
+
for($i=0; $i<count($array); $i++)
|
41 |
+
{
|
42 |
+
if($element==$array[$i])
|
43 |
+
$t++;
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
|
48 |
+
return $t;
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
function getelementindexinarray($array , $element)
|
53 |
+
{
|
54 |
+
|
55 |
+
$t='';
|
56 |
+
|
57 |
+
for($i=0; $i<count($array); $i++)
|
58 |
+
{
|
59 |
+
if($element==$array[$i])
|
60 |
+
$t.=$i.',';
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
return $t;
|
65 |
+
|
66 |
+
|
67 |
+
}
|
68 |
+
$cat_ids_array = explode(',',$cat_ids);
|
69 |
+
|
70 |
+
|
71 |
+
if($cat_id!='')
|
72 |
+
{
|
73 |
+
|
74 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
75 |
+
{
|
76 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
77 |
+
$index_array = explode(',' , $index_in_line);
|
78 |
+
array_pop ($index_array);
|
79 |
+
for($j=0; $j<count($index_array); $j++)
|
80 |
+
unset($cat_ids_array[$index_array[$j]]);
|
81 |
+
$cat_ids = implode(',',$cat_ids_array);
|
82 |
+
}
|
83 |
+
}
|
84 |
+
else
|
85 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
86 |
+
|
87 |
+
|
88 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
89 |
+
|
90 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_widget_theme WHERE id=%d', $theme_id));
|
91 |
+
$weekstart = $theme->week_start_day;
|
92 |
+
$show_cat = 1;
|
93 |
+
$bg = '#' . $theme->header_bgcolor;
|
94 |
+
$bg_color_selected = '#' . $theme->bg_color_selected;
|
95 |
+
$color_arrow = '#' . $theme->arrow_color;
|
96 |
+
$evented_color = '#' . $theme->text_color_this_month_evented;
|
97 |
+
$evented_color_bg = '#' . $theme->bg_color_this_month_evented;
|
98 |
+
$sun_days = '#' . $theme->text_color_sun_days;
|
99 |
+
$text_color_other_months = '#' . $theme->text_color_other_months;
|
100 |
+
$text_color_this_month_unevented = '#' . $theme->text_color_this_month_unevented;
|
101 |
+
$text_color_month = '#' . $theme->text_color_month;
|
102 |
+
$color_week_days = '#' . $theme->text_color_week_days;
|
103 |
+
$text_color_selected = '#' . $theme->text_color_selected;
|
104 |
+
$border_day = '#' . $theme->border_day;
|
105 |
+
$calendar_width = $theme->width;
|
106 |
+
$calendar_bg = '#' . $theme->footer_bgcolor;
|
107 |
+
$weekdays_bg_color = '#' . $theme->weekdays_bg_color;
|
108 |
+
$weekday_su_bg_color = '#' . $theme->su_bg_color;
|
109 |
+
$cell_border_color = '#' . $theme->cell_border_color;
|
110 |
+
$year_font_size = $theme->year_font_size;
|
111 |
+
$year_font_color = '#' . $theme->year_font_color;
|
112 |
+
$year_tabs_bg_color = '#' . $theme->year_tabs_bg_color;
|
113 |
+
$font_year = $theme->font_year;
|
114 |
+
$font_month = $theme->font_month;
|
115 |
+
$font_day = $theme->font_day;
|
116 |
+
$font_weekday = $theme->font_weekday;
|
117 |
+
$ev_title_color = $theme->ev_title_color;
|
118 |
+
$popup_width = $theme->popup_width;
|
119 |
+
$popup_height = $theme->popup_height;
|
120 |
+
|
121 |
+
__('January', 'sp_calendar');
|
122 |
+
__('February', 'sp_calendar');
|
123 |
+
__('March', 'sp_calendar');
|
124 |
+
__('April', 'sp_calendar');
|
125 |
+
__('May', 'sp_calendar');
|
126 |
+
__('June', 'sp_calendar');
|
127 |
+
__('July', 'sp_calendar');
|
128 |
+
__('August', 'sp_calendar');
|
129 |
+
__('September', 'sp_calendar');
|
130 |
+
__('October', 'sp_calendar');
|
131 |
+
__('November', 'sp_calendar');
|
132 |
+
__('December', 'sp_calendar');
|
133 |
+
if ($date != '') {
|
134 |
+
$date_REFERER = $date;
|
135 |
+
}
|
136 |
+
else {
|
137 |
+
$date_REFERER = date("Y-m");
|
138 |
+
$date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
|
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 |
+
$month_year = Month_name(substr($date, 5, 2));
|
147 |
+
$day = substr($date, 8, 2);
|
148 |
+
$cell_width = $calendar_width / 7;
|
149 |
+
$cell_width = (int) $cell_width - 2;
|
150 |
+
|
151 |
+
$week_days = array();
|
152 |
+
$d = new DateTime($date);
|
153 |
+
$weekday = $d->format('w');
|
154 |
+
// Monday=0, Sunday=6.
|
155 |
+
$diff = ($weekday == 0 ? 6 : $weekday - 1);
|
156 |
+
if ($weekstart == "su") {
|
157 |
+
$diff = $diff + 1;
|
158 |
+
}
|
159 |
+
$d->modify("-$diff day");
|
160 |
+
$d->modify("-1 day");
|
161 |
+
$prev_date = $d->format('Y-m-d');
|
162 |
+
$d->modify("+1 day");
|
163 |
+
$week_days[] = $d->format('Y-m-d');
|
164 |
+
for ($i = 1; $i < 7; $i++) {
|
165 |
+
$d->modify('+1 day');
|
166 |
+
$week_days[] = $d->format('Y-m-d');
|
167 |
+
}
|
168 |
+
if ($weekstart == "su") {
|
169 |
+
$d->modify('+2 day');
|
170 |
+
}
|
171 |
+
else {
|
172 |
+
$d->modify('+1 day');
|
173 |
+
}
|
174 |
+
$next_date = $d->format('Y-m-d');
|
175 |
+
$prev_month = add_0((int) substr($prev_date, 5, 2) - 1);
|
176 |
+
$this_month = add_0((int) substr($prev_date, 5, 2));
|
177 |
+
$next_month = add_0((int) substr($prev_date, 5, 2) + 1);
|
178 |
+
if ($next_month == '13') {
|
179 |
+
$next_month = '01';
|
180 |
+
}
|
181 |
+
if ($prev_month == '00') {
|
182 |
+
$prev_month = '12';
|
183 |
+
}
|
184 |
+
$view = 'bigcalendarweek_widget';
|
185 |
+
$views = explode(',', $view_select);
|
186 |
+
$defaultview = 'week';
|
187 |
+
array_pop($views);
|
188 |
+
$display = '';
|
189 |
+
if (count($views) == 0) {
|
190 |
+
$display = "display:none";
|
191 |
+
}
|
192 |
+
if(count($views) == 1 && $views[0] == $defaultview) {
|
193 |
+
$display = "display:none";
|
194 |
+
}
|
195 |
+
?>
|
196 |
+
<style type='text/css'>
|
197 |
+
#calendar_<?php echo $many_sp_calendar; ?> table {
|
198 |
+
border-collapse: initial;
|
199 |
+
border:0px;
|
200 |
+
margin: 0;
|
201 |
+
}
|
202 |
+
#calendar_<?php echo $many_sp_calendar; ?> table td {
|
203 |
+
padding: 0px;
|
204 |
+
vertical-align: none;
|
205 |
+
border-top:none;
|
206 |
+
line-height: none;
|
207 |
+
text-align: none;
|
208 |
+
}
|
209 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
|
210 |
+
border:1px solid <?php echo $cell_border_color; ?>;
|
211 |
+
font-family: <?php echo $font_day; ?>;
|
212 |
+
}
|
213 |
+
#calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
|
214 |
+
margin-bottom: 0;
|
215 |
+
}
|
216 |
+
#calendar_<?php echo $many_sp_calendar; ?> td,
|
217 |
+
#calendar_<?php echo $many_sp_calendar; ?> tr,
|
218 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> td,
|
219 |
+
#spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> tr {
|
220 |
+
border:none;
|
221 |
+
}
|
222 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
|
223 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
|
224 |
+
color: <?php echo $color_arrow; ?>;
|
225 |
+
text-decoration: none;
|
226 |
+
background: none;
|
227 |
+
font-size: 16px;
|
228 |
+
}
|
229 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
|
230 |
+
color: <?php echo $color_arrow; ?>;
|
231 |
+
text-decoration:none;
|
232 |
+
background:none;
|
233 |
+
}
|
234 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
|
235 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
|
236 |
+
text-decoration:underline;
|
237 |
+
background:none;
|
238 |
+
font-size:11px;
|
239 |
+
}
|
240 |
+
#calendar_<?php echo $many_sp_calendar; ?> a {
|
241 |
+
font-weight: normal;
|
242 |
+
}
|
243 |
+
#calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
|
244 |
+
font-size:12px;
|
245 |
+
text-decoration:none;
|
246 |
+
background:none;
|
247 |
+
}
|
248 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
|
249 |
+
border-spacing:0;
|
250 |
+
width:100%;
|
251 |
+
}
|
252 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
|
253 |
+
border-spacing: 0;
|
254 |
+
vertical-align: middle;
|
255 |
+
width: 100%;
|
256 |
+
}
|
257 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calbg {
|
258 |
+
background-color:<?php echo $bg; ?>;
|
259 |
+
text-align:center;
|
260 |
+
vertical-align: middle;
|
261 |
+
}
|
262 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
|
263 |
+
color:<?php echo $text_color_other_months; ?>;
|
264 |
+
}
|
265 |
+
#calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
|
266 |
+
color:<?php echo $text_color_this_month_unevented; ?>;
|
267 |
+
}
|
268 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calfont_year {
|
269 |
+
font-size:24px;
|
270 |
+
font-weight:bold;
|
271 |
+
color:<?php echo $text_color_year; ?>;
|
272 |
+
}
|
273 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
|
274 |
+
color:<?php echo $sun_days; ?>;
|
275 |
+
}
|
276 |
+
#calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
|
277 |
+
border: solid <?php echo $border_day; ?> 1px;
|
278 |
+
}
|
279 |
+
#TB_window {
|
280 |
+
z-index: 10000;
|
281 |
+
}
|
282 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views {
|
283 |
+
float: right;
|
284 |
+
background-color: <?php echo $calendar_bg; ?>;
|
285 |
+
height: 25px;
|
286 |
+
width: <?php echo ($calendar_width / 4) - 2; ?>px;
|
287 |
+
margin-left: 2px;
|
288 |
+
text-align: center;
|
289 |
+
cursor:pointer;
|
290 |
+
position: relative;
|
291 |
+
top: 3px;
|
292 |
+
font-family: <?php echo $font_month; ?>;
|
293 |
+
}
|
294 |
+
#calendar_<?php echo $many_sp_calendar; ?> table tr {
|
295 |
+
background: transparent !important;
|
296 |
+
}
|
297 |
+
#calendar_<?php echo $many_sp_calendar; ?> .views_select ,
|
298 |
+
#calendar_<?php echo $many_sp_calendar; ?> #views_select
|
299 |
+
{
|
300 |
+
|
301 |
+
background-color: <?php $views_tabs_bg_color?>;
|
302 |
+
width: 120px;
|
303 |
+
text-align: center;
|
304 |
+
cursor: pointer;
|
305 |
+
padding: 6px;
|
306 |
+
position: relative;
|
307 |
+
}
|
308 |
+
|
309 |
+
|
310 |
+
#drop_down_views
|
311 |
+
{
|
312 |
+
list-style-type:none !important;
|
313 |
+
position: absolute;
|
314 |
+
top: 46px;
|
315 |
+
left: -15px;
|
316 |
+
display:none;
|
317 |
+
z-index: 4545;
|
318 |
+
|
319 |
+
}
|
320 |
+
|
321 |
+
#drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
|
322 |
+
{
|
323 |
+
background:<?php echo $bg_top ?>;
|
324 |
+
}
|
325 |
+
|
326 |
+
#drop_down_views >li
|
327 |
+
{
|
328 |
+
border-bottom:1px solid #fff !important;
|
329 |
+
}
|
330 |
+
|
331 |
+
|
332 |
+
#views_tabs_select
|
333 |
+
{
|
334 |
+
display:none;
|
335 |
+
}
|
336 |
+
</style>
|
337 |
+
<div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
|
338 |
+
<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; ?>">
|
339 |
+
<tr style="background-color:#FFFFFF;">
|
340 |
+
<td style="background-color:#FFFFFF;">
|
341 |
+
<div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
|
342 |
+
<div class="views" style="<?php if (!in_array('day', $views) AND $defaultview != 'day') echo 'display:none;'; if ($view == 'bigcalendarday_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
343 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
344 |
+
'action' => 'spiderbigcalendar_day_widget',
|
345 |
+
'theme_id' => $theme_id,
|
346 |
+
'calendar' => $calendar_id,
|
347 |
+
'select' => $view_select,
|
348 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
349 |
+
'many_sp_calendar' => $many_sp_calendar,
|
350 |
+
'cur_page_url' => $path_sp_cal,
|
351 |
+
'cat_id' => '',
|
352 |
+
'cat_ids' => $cat_ids,
|
353 |
+
'widget' => $widget,
|
354 |
+
'TB_iframe' => 1,
|
355 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
356 |
+
</div>
|
357 |
+
<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 . ';height:28px;top:0;' ?>"
|
358 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
359 |
+
'action' => 'spiderbigcalendar_week_widget',
|
360 |
+
'theme_id' => $theme_id,
|
361 |
+
'calendar' => $calendar_id,
|
362 |
+
'select' => $view_select,
|
363 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
364 |
+
'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
|
365 |
+
'many_sp_calendar' => $many_sp_calendar,
|
366 |
+
'cur_page_url' => $path_sp_cal,
|
367 |
+
'cat_id' => '',
|
368 |
+
'cat_ids' => $cat_ids,
|
369 |
+
'widget' => $widget,
|
370 |
+
'TB_iframe' => 1,
|
371 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
372 |
+
</div>
|
373 |
+
<div class="views" style="<?php if (!in_array('list', $views) AND $defaultview != 'list') echo 'display:none;'; if ($view == 'bigcalendarlist_widget') echo 'background-color:' . $bg . ';height:28px;top:0;' ?>"
|
374 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
|
375 |
+
'action' => 'spiderbigcalendar_list_widget',
|
376 |
+
'theme_id' => $theme_id,
|
377 |
+
'calendar' => $calendar_id,
|
378 |
+
'select' => $view_select,
|
379 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
380 |
+
'many_sp_calendar' => $many_sp_calendar,
|
381 |
+
'cur_page_url' => $path_sp_cal,
|
382 |
+
'cat_id' => '',
|
383 |
+
'cat_ids' => $cat_ids,
|
384 |
+
'widget' => $widget,
|
385 |
+
'TB_iframe' => 1,
|
386 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
387 |
+
</div>
|
388 |
+
<div class="views" style="<?php if (!in_array('month', $views) AND $defaultview != 'month') echo 'display:none;'; if ($view == 'bigcalendarmonth_widget') echo 'background-color:' . $bg . ';height:28px;top:0;'; ?>"
|
389 |
+
onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
390 |
+
'action' => 'spiderbigcalendar_month_widget',
|
391 |
+
'theme_id' => $theme_id,
|
392 |
+
'calendar' => $calendar_id,
|
393 |
+
'select' => $view_select,
|
394 |
+
'date' => $year . '-' . add_0((Month_num($month))),
|
395 |
+
'many_sp_calendar' => $many_sp_calendar,
|
396 |
+
'cur_page_url' => $path_sp_cal,
|
397 |
+
'cat_id' => '',
|
398 |
+
'cat_ids' => $cat_ids,
|
399 |
+
'widget' => $widget,
|
400 |
+
'TB_iframe' => 1,
|
401 |
+
), admin_url('admin-ajax.php'));?>','<?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>
|
402 |
+
</div>
|
403 |
+
</div>
|
404 |
+
</td>
|
405 |
+
</tr>
|
406 |
+
<tr>
|
407 |
+
<td width="100%" style="padding:0; margin:0;">
|
408 |
+
<form action="" method="get" style="background:none; margin:0; padding:0;">
|
409 |
+
<table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>">
|
410 |
+
<tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
|
411 |
+
<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%;" >
|
412 |
+
<?php //MONTH TABLE ?>
|
413 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
|
414 |
+
<tr>
|
415 |
+
<td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
|
416 |
+
<a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
417 |
+
if (Month_num($month) == 1) {
|
418 |
+
$needed_date = ($year - 1) . '-12';
|
419 |
+
}
|
420 |
+
else {
|
421 |
+
$needed_date = $year . '-' . add_0((Month_num($month) - 1));
|
422 |
+
}
|
423 |
+
echo add_query_arg(array(
|
424 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
425 |
+
'theme_id' => $theme_id,
|
426 |
+
'calendar' => $calendar_id,
|
427 |
+
'select' => $view_select,
|
428 |
+
'date' => $prev_date,
|
429 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
430 |
+
'many_sp_calendar' => $many_sp_calendar,
|
431 |
+
'cur_page_url' => $path_sp_cal,
|
432 |
+
'cat_id' => '',
|
433 |
+
'cat_ids' => $cat_ids,
|
434 |
+
'widget' => $widget,
|
435 |
+
'TB_iframe' => 1,
|
436 |
+
), admin_url('admin-ajax.php'));
|
437 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">◄
|
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 |
+
'cur_page_url' => $path_sp_cal,
|
469 |
+
'cat_id' => '',
|
470 |
+
'cat_ids' => $cat_ids,
|
471 |
+
'widget' => $widget,
|
472 |
+
'TB_iframe' => 1,
|
473 |
+
), admin_url('admin-ajax.php'));
|
474 |
+
?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">►
|
475 |
+
</a>
|
476 |
+
</td>
|
477 |
+
</tr>
|
478 |
+
</table>
|
479 |
+
</td>
|
480 |
+
</tr>
|
481 |
+
|
482 |
+
<tr>
|
483 |
+
<td colspan="7">
|
484 |
+
<?php
|
485 |
+
$month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
|
486 |
+
if ($weekstart == "su") {
|
487 |
+
$month_first_weekday++;
|
488 |
+
if ($month_first_weekday == 8) {
|
489 |
+
$month_first_weekday = 1;
|
490 |
+
}
|
491 |
+
}
|
492 |
+
$month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
|
493 |
+
$last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
494 |
+
$last_month_days_count = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
|
495 |
+
$weekday_i = $month_first_weekday;
|
496 |
+
$last_month_days = $last_month_days - $weekday_i + 2;
|
497 |
+
$percent = 1;
|
498 |
+
$sum = $month_days - 8 + $month_first_weekday;
|
499 |
+
if ($sum % 7 <> 0) {
|
500 |
+
$percent = $percent + 1;
|
501 |
+
}
|
502 |
+
$sum = $sum - ($sum % 7);
|
503 |
+
$percent = $percent + ($sum / 7);
|
504 |
+
$percent = 107 / $percent;
|
505 |
+
|
506 |
+
$categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
|
507 |
+
$calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
|
508 |
+
$all_calendar_files = php_getdays_for_three_months($calendar_id, $date, $months, $theme_id, $widget);
|
509 |
+
|
510 |
+
$all_array_days = $all_calendar_files[0]['all_array_days'];
|
511 |
+
$all_array_days1 = $all_calendar_files[0]['all_array_days1'];
|
512 |
+
$all_title = $all_calendar_files[0]['all_title'];
|
513 |
+
$all_ev_ids = $all_calendar_files[0]['all_ev_ids'];
|
514 |
+
|
515 |
+
$prev_month = substr($months, 0, 2);
|
516 |
+
$this_month = substr($months, 3, 2);
|
517 |
+
$next_month = substr($months, 6, 2);
|
518 |
+
|
519 |
+
for ($i = 0; $i <= 6; $i++) {
|
520 |
+
$day = substr($week_days[$i], 8, 2);
|
521 |
+
$month = substr($week_days[$i], 5, 2);
|
522 |
+
$year = substr($week_days[$i], 0, 4);
|
523 |
+
switch($month) {
|
524 |
+
case $prev_month:
|
525 |
+
$array_days = $all_array_days[0];
|
526 |
+
$array_days1 = $all_array_days1[0];
|
527 |
+
$title = $all_title[0];
|
528 |
+
$ev_ids = $all_ev_ids[0];
|
529 |
+
break;
|
530 |
+
|
531 |
+
case $this_month:
|
532 |
+
$array_days = $all_array_days[1];
|
533 |
+
$array_days1 = $all_array_days1[1];
|
534 |
+
$title = $all_title[1];
|
535 |
+
$ev_ids = $all_ev_ids[1];
|
536 |
+
break;
|
537 |
+
|
538 |
+
case $next_month:
|
539 |
+
$array_days = $all_array_days[2];
|
540 |
+
$array_days1 = $all_array_days1[2];
|
541 |
+
$title = $all_title[2];
|
542 |
+
$ev_ids = $all_ev_ids[2];
|
543 |
+
break;
|
544 |
+
}
|
545 |
+
sort($array_days, SORT_NUMERIC);
|
546 |
+
$week_day = date('D', mktime(0, 0, 0, $month, (int) $day, $year));
|
547 |
+
$month_name = month_name($month);
|
548 |
+
echo '<table style="width:100%;border-spacing:0;">
|
549 |
+
<tr>
|
550 |
+
<td style="height:14px;font-size:12px; padding-left:10px; background-color:#D6D4D5; color:#6E7276">
|
551 |
+
<span style="padding-left:10px; font-size:12px; color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
|
552 |
+
<span style="font-size:12px;color:#949394;">(' . __($month_name,'sp_calendar') . ' ' . (int) $day . ')</span>
|
553 |
+
</td>
|
554 |
+
<tr>
|
555 |
+
<td>';
|
556 |
+
if (in_array((int) $day, $array_days)) {
|
557 |
+
foreach($title as $key => $value) {
|
558 |
+
if ($key == (int) $day) {
|
559 |
+
$ev_id = explode('<br>', $ev_ids[$key]);
|
560 |
+
array_pop($ev_id);
|
561 |
+
$ev_ids_inline = implode(',', $ev_id);
|
562 |
+
$ev_title = explode('</p>', $value);
|
563 |
+
array_pop($ev_title);
|
564 |
+
for ($j = 0; $j < count($ev_title); $j++) {
|
565 |
+
$queryy = $wpdb->prepare ("SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
|
566 |
+
ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=%d AND
|
567 |
+
" . $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]);
|
568 |
+
|
569 |
+
$cat_color = $wpdb->get_row($queryy);
|
570 |
+
|
571 |
+
if (($j + 1) % 2 == 0) {
|
572 |
+
$color = $bg;
|
573 |
+
$table_color = $calendar_bg;
|
574 |
+
}
|
575 |
+
else {
|
576 |
+
$color = $bg;
|
577 |
+
$table_color = $calendar_bg;
|
578 |
+
}
|
579 |
+
if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color="";};
|
580 |
+
echo '<table style="height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
|
581 |
+
<tr>
|
582 |
+
<td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $calendar_bg . '">' . ($j + 1) . '</td>
|
583 |
+
<td>
|
584 |
+
<a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:15px;background:none;color:#' . $ev_title_color . ';"
|
585 |
+
href="' . add_query_arg(array(
|
586 |
+
'action' => 'spidercalendarbig',
|
587 |
+
'theme_id' => $theme_id,
|
588 |
+
'calendar_id' => $calendar_id,
|
589 |
+
'ev_ids' => $ev_ids_inline,
|
590 |
+
'eventID' => $ev_id[$j],
|
591 |
+
'date' => $year . '-' . $month . '-' . (int) $day,
|
592 |
+
'many_sp_calendar' => $many_sp_calendar,
|
593 |
+
'cur_page_url' => $path_sp_cal,
|
594 |
+
'widget' => $widget,
|
595 |
+
'TB_iframe' => 1,
|
596 |
+
'tbWidth' => $popup_width,
|
597 |
+
'tbHeight' => $popup_height,
|
598 |
+
), admin_url('admin-ajax.php')) . '"><b>' . $ev_title[$j] . '</b>
|
599 |
+
</a>
|
600 |
+
</td>
|
601 |
+
</tr>
|
602 |
+
</table>';
|
603 |
+
}
|
604 |
+
}
|
605 |
+
}
|
606 |
+
}
|
607 |
+
else {
|
608 |
+
echo '<table style="height:14px;border-spacing:0;width: 100%;background-color:#D6D4D5;">
|
609 |
+
<tr>
|
610 |
+
<td style="font-size:22px; font-weight:bold; width:15px;text-align:center;background-color:' . $bg . ';color:#949394;"></td>
|
611 |
+
<td><p style="font-size:12px;color:' . $bg . '; border:none"> ' . __('There Is No Event In This Day', 'sp_calendar') . '</p></td>
|
612 |
+
</tr>
|
613 |
+
</table>';
|
614 |
+
}
|
615 |
+
echo '</td></tr></table>';
|
616 |
+
}
|
617 |
+
?>
|
618 |
+
</td>
|
619 |
+
</tr>
|
620 |
+
<tr style="height:<?php echo $year_font_size + 2; ?>px; font-family: <?php echo $font_year; ?>;">
|
621 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
622 |
+
echo add_query_arg(array(
|
623 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
624 |
+
'theme_id' => $theme_id,
|
625 |
+
'calendar' => $calendar_id,
|
626 |
+
'select' => $view_select,
|
627 |
+
'date' => ($year - 1) . '-' . add_0((Month_num($month_year))),
|
628 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
629 |
+
'many_sp_calendar' => $many_sp_calendar,
|
630 |
+
'cur_page_url' => $path_sp_cal,
|
631 |
+
'widget' => $widget,
|
632 |
+
'cat_id' => '',
|
633 |
+
'cat_ids' => $cat_ids,
|
634 |
+
'TB_iframe' => 1,
|
635 |
+
), admin_url('admin-ajax.php'));?>','<?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; ?>">
|
636 |
+
<?php echo ($year - 1); ?>
|
637 |
+
</td>
|
638 |
+
<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; ?>">
|
639 |
+
<?php echo $year; ?>
|
640 |
+
</td>
|
641 |
+
<td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
|
642 |
+
echo add_query_arg(array(
|
643 |
+
'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
|
644 |
+
'theme_id' => $theme_id,
|
645 |
+
'calendar' => $calendar_id,
|
646 |
+
'select' => $view_select,
|
647 |
+
'date' => ($year + 1) . '-' . add_0((Month_num($month_year))),
|
648 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
649 |
+
'many_sp_calendar' => $many_sp_calendar,
|
650 |
+
'cur_page_url' => $path_sp_cal,
|
651 |
+
'widget' => $widget,
|
652 |
+
'cat_id' => '',
|
653 |
+
'cat_ids' => $cat_ids,
|
654 |
+
'TB_iframe' => 1,
|
655 |
+
), admin_url('admin-ajax.php'));?>','<?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; ?>;color:<?php echo $year_font_color; ?>">
|
656 |
+
<?php echo ($year + 1); ?>
|
657 |
+
</td>
|
658 |
+
</tr>
|
659 |
+
</table>
|
660 |
+
<input type="text" value="1" name="day" style="display:none" />
|
661 |
+
</form>
|
662 |
+
</td>
|
663 |
+
</tr>
|
664 |
+
</table>
|
665 |
+
</div>
|
666 |
+
<style>
|
667 |
+
#calendar_<?php echo $many_sp_calendar; ?> table{
|
668 |
+
width: 100%;
|
669 |
+
}
|
670 |
+
.categories1 , .categories2
|
671 |
+
{
|
672 |
+
display:inline-block;
|
673 |
+
}
|
674 |
+
|
675 |
+
.categories2
|
676 |
+
{
|
677 |
+
position:relative;
|
678 |
+
left: -9px;
|
679 |
+
cursor:pointer;
|
680 |
+
}
|
681 |
+
.categories2:first-letter
|
682 |
+
{
|
683 |
+
color:#fff;
|
684 |
+
|
685 |
+
}
|
686 |
+
</style>
|
687 |
+
<?php
|
688 |
+
|
689 |
+
//reindex cat_ids_array
|
690 |
+
$re_cat_ids_array = array_values($cat_ids_array);
|
691 |
+
|
692 |
+
for($i=0; $i<count($re_cat_ids_array); $i++)
|
693 |
+
{
|
694 |
+
echo'
|
695 |
+
<style>
|
696 |
+
#cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
|
697 |
+
{
|
698 |
+
text-decoration:underline;
|
699 |
+
cursor:pointer;
|
700 |
+
|
701 |
+
}
|
702 |
+
|
703 |
+
</style>';
|
704 |
+
|
705 |
+
}
|
706 |
+
|
707 |
+
|
708 |
+
|
709 |
+
if($cat_ids=='')
|
710 |
+
$cat_ids='';
|
711 |
+
|
712 |
+
if($show_cat==1){
|
713 |
+
echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none;">';
|
714 |
+
|
715 |
+
foreach($categories as $category)
|
716 |
+
{
|
717 |
+
|
718 |
+
?>
|
719 |
+
|
720 |
+
<li style="height:30px"><p class="categories1" style="background-color:#<?php echo $category->color;?>"> </p><p class="categories2" id="category<?php echo $category->id ?>" style="color:#<?php echo $category->color?>" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
|
721 |
+
'action' => 'spiderbigcalendar_week_widget',
|
722 |
+
'theme_id' => $theme_id,
|
723 |
+
'calendar' => $calendar_id,
|
724 |
+
'select' => $view_select,
|
725 |
+
'months' => $prev_month . ',' . $this_month . ',' . $next_month,
|
726 |
+
'date' => $year . '-' . $month . '-' . add_0($day),
|
727 |
+
'many_sp_calendar' => $many_sp_calendar,
|
728 |
+
'cur_page_url' => $path_sp_cal,
|
729 |
+
'cat_id' => $category->id,
|
730 |
+
'cat_ids' => $cat_ids,
|
731 |
+
'widget' => $widget,
|
732 |
+
'TB_iframe' => 1,
|
733 |
+
), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
|
734 |
+
|
735 |
+
|
736 |
+
<?php
|
737 |
+
|
738 |
+
|
739 |
+
}
|
740 |
+
|
741 |
+
echo '</ul>';
|
742 |
+
}
|
743 |
+
die();
|
744 |
+
}
|
745 |
+
|
746 |
?>
|
front_end/frontend_functions.php
CHANGED
@@ -1,1133 +1,1133 @@
|
|
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 |
-
//explode the date by "-" and storing to array
|
34 |
-
$date_parts1 = explode("-", $beginDate);
|
35 |
-
//gregoriantojd() Converts a Gregorian date to Julian Day Count
|
36 |
-
$start_date = gregoriantojd($date_parts1[1], $date_parts1[2], $date_parts1[0]);
|
37 |
-
return jdtogregorian($start_date + $repeat);
|
38 |
-
}
|
39 |
-
|
40 |
-
function php_daysDifference($beginDate, $endDate) {
|
41 |
-
//explode the date by "-" and storing to array
|
42 |
-
$date_parts1 = explode("-", $beginDate);
|
43 |
-
$date_parts2 = explode("-", $endDate);
|
44 |
-
//gregoriantojd() Converts a Gregorian date to Julian Day Count
|
45 |
-
$start_date = gregoriantojd($date_parts1[1], $date_parts1[2], $date_parts1[0]);
|
46 |
-
$end_date = gregoriantojd($date_parts2[1], $date_parts2[2], $date_parts2[0]);
|
47 |
-
return $end_date - $start_date;
|
48 |
-
}
|
49 |
-
|
50 |
-
function php_getdays($show_numbers_for_events, $calendar, $date, $theme_id, $widget) {
|
51 |
-
global $wpdb;
|
52 |
-
$year = substr($date, 0, 4);
|
53 |
-
$month = substr($date, 5, 2);
|
54 |
-
if ($widget) {
|
55 |
-
$show_time = 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 |
-
}
|
61 |
-
|
62 |
-
if(isset($_GET['cat_id']))
|
63 |
-
$cat_id = $_GET['cat_id'];
|
64 |
-
else $cat_id = "";
|
65 |
-
|
66 |
-
if(isset($_GET['cat_ids']))
|
67 |
-
$cat_ids = $_GET['cat_ids'];
|
68 |
-
else $cat_ids = "";
|
69 |
-
|
70 |
-
|
71 |
-
if($cat_ids=='')
|
72 |
-
$cat_ids .= $cat_id.',';
|
73 |
-
else
|
74 |
-
$cat_ids .= ','.$cat_id.',';
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
79 |
-
|
80 |
-
$cat_ids_array = explode(',',$cat_ids);
|
81 |
-
|
82 |
-
|
83 |
-
if($cat_id!='')
|
84 |
-
{
|
85 |
-
|
86 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
87 |
-
{
|
88 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
89 |
-
$index_array = explode(',' , $index_in_line);
|
90 |
-
array_pop ($index_array);
|
91 |
-
for($j=0; $j<count($index_array); $j++)
|
92 |
-
unset($cat_ids_array[$index_array[$j]]);
|
93 |
-
$cat_ids = implode(',',$cat_ids_array);
|
94 |
-
}
|
95 |
-
}
|
96 |
-
else
|
97 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
98 |
-
|
99 |
-
$row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where published=1 and id
|
100 |
-
|
101 |
-
if($row->time_format==0)
|
102 |
-
{
|
103 |
-
$order_by = "ORDER BY " . $wpdb->prefix . "spidercalendar_event.time ASC";
|
104 |
-
}
|
105 |
-
else{
|
106 |
-
$order_by = " ORDER BY STR_TO_DATE( SUBSTRING( time, 1, 7 ) , '%h:%i%p' )";
|
107 |
-
}
|
108 |
-
|
109 |
-
if($cat_ids!=''){
|
110 |
-
$rows = $wpdb->get_results("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 (
|
111 |
-
|
112 |
-
}
|
113 |
-
else{
|
114 |
-
$rows = $wpdb->get_results($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)." ".$order_by." ");
|
115 |
-
|
116 |
-
}
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
$id_array = array();
|
121 |
-
$s = count($rows);
|
122 |
-
$id_array = array();
|
123 |
-
$array_days = array();
|
124 |
-
$array_days1 = array();
|
125 |
-
$title = array();
|
126 |
-
$ev_ids = array();
|
127 |
-
for ($i = 1; $i <= $s; $i++) {
|
128 |
-
$date_month = (int)substr($rows[$i - 1]->date, 5, 2);
|
129 |
-
$date_end_month = (int)substr($rows[$i - 1]->date_end, 5, 2);
|
130 |
-
$date_day = (int)substr($rows[$i - 1]->date, 8, 2);
|
131 |
-
$date_end_day = (int)substr($rows[$i - 1]->date_end, 8, 2);
|
132 |
-
$date_year_month = (int)(substr($rows[$i - 1]->date, 0, 4) . substr($rows[$i - 1]->date, 5, 2));
|
133 |
-
$date_end_year_month = (int)(substr($rows[$i - 1]->date_end, 0, 4) . substr($rows[$i - 1]->date_end, 5, 2));
|
134 |
-
$year_month = (int)($year . $month);
|
135 |
-
$repeat = $rows[$i - 1]->repeat;
|
136 |
-
if ($repeat == "") {
|
137 |
-
$repeat = 1;
|
138 |
-
}
|
139 |
-
$start_date = $rows[$i - 1]->date;
|
140 |
-
$weekly = $rows[$i - 1]->week;
|
141 |
-
$weekly_array = explode(',', $weekly);
|
142 |
-
$date_days = array();
|
143 |
-
$weekdays_start = array();
|
144 |
-
$weekdays = array();
|
145 |
-
|
146 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
147 |
-
//////////////////////// NO Repeat /////////////////////////////////////////////////////////////////////////////////////////////
|
148 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
149 |
-
if ($rows[$i - 1]->repeat_method == 'no_repeat') {
|
150 |
-
$date_days[] = $date_day;
|
151 |
-
}
|
152 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
153 |
-
//////////////////////// Repeat Daily /////////////////////////////////////////////////////////////////////////////////////////////
|
154 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
155 |
-
if ($rows[$i - 1]->repeat_method == 'daily') {
|
156 |
-
$t = php_daysDifference($rows[$i - 1]->date, $rows[$i - 1]->date_end);
|
157 |
-
for ($k = 1; $k <= $t / $repeat; $k++) {
|
158 |
-
$next_date = php_GetNextDate($start_date, $repeat);
|
159 |
-
$next_date_array = explode('/', $next_date);
|
160 |
-
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
161 |
-
$date_days[0] = $date_day;
|
162 |
-
if ((int)$month == $next_date_array[0] && (int)$year == $next_date_array[2])
|
163 |
-
$date_days[] = $next_date_array[1];
|
164 |
-
$start_date = date("Y-m-d", mktime(0, 0, 0, $next_date_array[0], $next_date_array[1], $next_date_array[2]));
|
165 |
-
}
|
166 |
-
}
|
167 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
168 |
-
//////////////////////// Repeat Weekly ///////////////////////////////////////////////////////////////////////////////////////////
|
169 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
170 |
-
if ($rows[$i - 1]->repeat_method == 'weekly') {
|
171 |
-
for ($j = 0; $j <= 6; $j++) {
|
172 |
-
if (in_array(date("D", mktime(0, 0, 0, $date_month, $date_day + $j, substr($rows[$i - 1]->date, 0, 4))), $weekly_array)) {
|
173 |
-
$weekdays_start[] = $date_day + $j;
|
174 |
-
}
|
175 |
-
}
|
176 |
-
for ($p = 0; $p < count($weekly_array) - 1; $p++) {
|
177 |
-
$start_date = substr($rows[$i - 1]->date, 0, 8) . $weekdays_start[$p];
|
178 |
-
$t = php_daysDifference($rows[$i - 1]->date, $rows[$i - 1]->date_end);
|
179 |
-
$r = 0;
|
180 |
-
for ($k = 1; $k < $t / $repeat; $k++) {
|
181 |
-
$start_date_array[] = $start_date;
|
182 |
-
$next_date = php_GetNextDate($start_date, $repeat * 7);
|
183 |
-
$next_date_array = explode('/', $next_date);
|
184 |
-
|
185 |
-
|
186 |
-
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
187 |
-
$date_days[0] = $weekdays_start[$p];
|
188 |
-
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))
|
189 |
-
break;
|
190 |
-
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
191 |
-
$date_days[0] = $weekdays_start[$p];
|
192 |
-
if ((int)$month == $next_date_array[0] && (int)$year == $next_date_array[2])
|
193 |
-
if ((int)$year > (int)substr($date_year_month, 0, 4)) {
|
194 |
-
$weekdays[] = $next_date_array[1];
|
195 |
-
}
|
196 |
-
else {
|
197 |
-
$weekdays[] = $next_date_array[1];
|
198 |
-
}
|
199 |
-
$start_date = date("Y-m-d", mktime(0, 0, 0, $next_date_array[0], $next_date_array[1], $next_date_array[2]));
|
200 |
-
// if ($next_date_array[2] > (int)substr($rows[$i - 1]->date_end, 0, 4))
|
201 |
-
// break;
|
202 |
-
}
|
203 |
-
$date_days = array_merge($weekdays, $date_days);
|
204 |
-
}
|
205 |
-
$repeat = $repeat * 7;
|
206 |
-
}
|
207 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
208 |
-
//////////////////////// Repeat Monthly ///////////////////////////////////////////////////////////////////////////////////////////
|
209 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
210 |
-
if ($rows[$i - 1]->repeat_method == 'monthly') {
|
211 |
-
$xxxxx = 13;
|
212 |
-
$year_dif_count = (int)$year - (int)substr($rows[$i - 1]->date, 0, 4);
|
213 |
-
$mount_dif_count = 12 - (int)substr($rows[$i - 1]->date, 5, 2) + (($year_dif_count - 1) * 12);
|
214 |
-
if ($year_dif_count > 0)
|
215 |
-
for ($my_serch_month = 1; $my_serch_month <= 12; $my_serch_month++) {
|
216 |
-
if ((($mount_dif_count + $my_serch_month) % $rows[$i - 1]->repeat) == 0) {
|
217 |
-
$xxxxx = $my_serch_month;
|
218 |
-
break;
|
219 |
-
}
|
220 |
-
}
|
221 |
-
if ($xxxxx != 13) {
|
222 |
-
if ($xxxxx < 10) {
|
223 |
-
$xxxxx = '0' . $xxxxx;
|
224 |
-
}
|
225 |
-
}
|
226 |
-
$month_days = date('t', mktime(0, 0, 0, $month, $date_day, $year));
|
227 |
-
if ($date_month < (int)$month or (int)substr($date_year_month, 0, 4) < $year)
|
228 |
-
$date_day = 1;
|
229 |
-
if ($year > (int)substr($date_year_month, 0, 4))
|
230 |
-
$date_year_month = $year . $xxxxx;
|
231 |
-
$p = (int)substr($date_year_month, 4, 2);
|
232 |
-
if ((int)substr($date_year_month, 0, 4) != (int)substr($date_end_year_month, 0, 4))
|
233 |
-
$end = (int)substr($date_end_year_month, 4, 2) + 12;
|
234 |
-
else
|
235 |
-
$end = (int)substr($date_end_year_month, 4, 2);
|
236 |
-
for ($k = 1; $k <= $end; $k++) {
|
237 |
-
if ((int)$month == $p and $rows[$i - 1]->month_type == 1) {
|
238 |
-
$date_days[0] = $rows[$i - 1]->month;
|
239 |
-
}
|
240 |
-
if ($p == (int)$month and $rows[$i - 1]->month_type == 2) {
|
241 |
-
if ($rows[$i - 1]->monthly_list != 'last') {
|
242 |
-
for ($j = $rows[$i - 1]->monthly_list; $j < $rows[$i - 1]->monthly_list + 7; $j++) {
|
243 |
-
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
244 |
-
if ($j >= $date_day) {
|
245 |
-
$date_days[0] = $j;
|
246 |
-
}
|
247 |
-
}
|
248 |
-
}
|
249 |
-
}
|
250 |
-
else {
|
251 |
-
for ($j = 1; $j <= $month_days; $j++) {
|
252 |
-
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
253 |
-
if ($j >= $date_day) {
|
254 |
-
$date_days[0] = $j;
|
255 |
-
}
|
256 |
-
}
|
257 |
-
}
|
258 |
-
}
|
259 |
-
}
|
260 |
-
if ($year > (int)substr($date_year_month, 0, 4)) {
|
261 |
-
$p = 1;
|
262 |
-
}
|
263 |
-
$p = $p + $repeat;
|
264 |
-
}
|
265 |
-
$repeat = 32;
|
266 |
-
}
|
267 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
268 |
-
//////////////////////// Repeat Yearly ///////////////////////////////////////////////////////////////////////////////////////////
|
269 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
270 |
-
if ($rows[$i - 1]->repeat_method == 'yearly') {
|
271 |
-
$month_days = date('t', mktime(0, 0, 0, $month, $date_day, $year));
|
272 |
-
$end = substr($date_end_year_month, 0, 4) - substr($date_year_month, 0, 4) + 1;
|
273 |
-
if (substr($date_year_month, 0, 4) < $year) {
|
274 |
-
$date_day = 1;
|
275 |
-
}
|
276 |
-
for ($k = 0; $k <= $end; $k += $repeat) {
|
277 |
-
if ((int)$month == $rows[$i - 1]->year_month and $rows[$i - 1]->month_type == 1 and $year == substr($date_year_month, 0, 4) + $k) {
|
278 |
-
$date_days[0] = $rows[$i - 1]->month;
|
279 |
-
}
|
280 |
-
}
|
281 |
-
for ($k = 0; $k <= $end; $k += $repeat) {
|
282 |
-
if ((int)$month == $rows[$i - 1]->year_month and $rows[$i - 1]->month_type == 2 and $year == substr($date_year_month, 0, 4) + $k) {
|
283 |
-
if ($rows[$i - 1]->monthly_list != 'last') {
|
284 |
-
for ($j = $rows[$i - 1]->monthly_list; $j < $rows[$i - 1]->monthly_list + 7; $j++) {
|
285 |
-
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
286 |
-
$date_days[0] = $j;
|
287 |
-
}
|
288 |
-
}
|
289 |
-
}
|
290 |
-
else {
|
291 |
-
for ($j = 1; $j <= $month_days; $j++) {
|
292 |
-
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
293 |
-
$date_days[0] = $j;
|
294 |
-
}
|
295 |
-
}
|
296 |
-
}
|
297 |
-
}
|
298 |
-
}
|
299 |
-
$repeat = 32;
|
300 |
-
}
|
301 |
-
$used = array();
|
302 |
-
foreach ($date_days as $date_day) {
|
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) ? '' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '') : '');
|
317 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
318 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
319 |
-
}
|
320 |
-
else {
|
321 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
322 |
-
}
|
323 |
-
$title[$date_day] = $title[$date_day] . $list;
|
324 |
-
$ev_ids[$date_day] = $ev_ids[$date_day] . $rows[$i - 1]->id . '<br>';
|
325 |
-
}
|
326 |
-
else {
|
327 |
-
$array_days[] = $date_day;
|
328 |
-
$key = array_search($date_day, $array_days);
|
329 |
-
if ($rows[$i - 1]->text_for_date != "")
|
330 |
-
$array_days1[$key] = $date_day;
|
331 |
-
$title_num[$date_day] = 1;
|
332 |
-
$c = 1;
|
333 |
-
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
334 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
335 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
336 |
-
}
|
337 |
-
else {
|
338 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
339 |
-
}
|
340 |
-
$title[$date_day] = $list;
|
341 |
-
$ev_ids[$date_day] = $rows[$i - 1]->id . '<br>';
|
342 |
-
}
|
343 |
-
}
|
344 |
-
if ($date_end_month > 0 and $date_year_month == $date_end_year_month and $date_end_year_month == $year_month)
|
345 |
-
for ($j = $date_day; $j <= $date_end_day; $j = $j + $repeat) {
|
346 |
-
if (in_array($j, $used)) {
|
347 |
-
continue;
|
348 |
-
}
|
349 |
-
else {
|
350 |
-
array_push($used, $j);
|
351 |
-
}
|
352 |
-
if (in_array($j, $array_days)) {
|
353 |
-
$key = array_search($j, $array_days);
|
354 |
-
$title_num[$j]++;
|
355 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
356 |
-
$array_days1[$key] = $j;
|
357 |
-
}
|
358 |
-
$c = $title_num[$j];
|
359 |
-
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
360 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
361 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
362 |
-
}
|
363 |
-
else {
|
364 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
365 |
-
}
|
366 |
-
$title[$j] = $title[$j] . $list;
|
367 |
-
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
368 |
-
}
|
369 |
-
else {
|
370 |
-
$array_days[] = $j;
|
371 |
-
$key = array_search($j, $array_days);
|
372 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
373 |
-
$array_days1[$key] = $j;
|
374 |
-
}
|
375 |
-
$title_num[$j] = 1;
|
376 |
-
$c = 1;
|
377 |
-
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
378 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
379 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
380 |
-
}
|
381 |
-
else {
|
382 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
383 |
-
}
|
384 |
-
$title[$j] = $list;
|
385 |
-
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
386 |
-
}
|
387 |
-
}
|
388 |
-
if ($date_end_month > 0 and $date_year_month < $date_end_year_month and $date_year_month == $year_month)
|
389 |
-
for ($j = $date_day; $j <= 31; $j = $j + $repeat) {
|
390 |
-
if (in_array($j, $used)) {
|
391 |
-
continue;
|
392 |
-
}
|
393 |
-
else {
|
394 |
-
array_push($used, $j);
|
395 |
-
}
|
396 |
-
if (in_array($j, $array_days)) {
|
397 |
-
$key = array_search($j, $array_days);
|
398 |
-
$title_num[$j]++;
|
399 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
400 |
-
$array_days1[$key] = $j;
|
401 |
-
}
|
402 |
-
$c = $title_num[$j];
|
403 |
-
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
404 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
405 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
406 |
-
}
|
407 |
-
else {
|
408 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
409 |
-
}
|
410 |
-
$title[$j] = $title[$j] . $list;
|
411 |
-
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
412 |
-
}
|
413 |
-
else {
|
414 |
-
$array_days[] = $j;
|
415 |
-
$key = array_search($j, $array_days);
|
416 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
417 |
-
$array_days1[$key] = $j;
|
418 |
-
}
|
419 |
-
$title_num[$j] = 1;
|
420 |
-
$c = 1;
|
421 |
-
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
422 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
423 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
424 |
-
}
|
425 |
-
else {
|
426 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
427 |
-
}
|
428 |
-
$title[$j] = $list;
|
429 |
-
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
430 |
-
}
|
431 |
-
}
|
432 |
-
if ($date_end_month > 0 and $date_year_month < $date_end_year_month and $date_end_year_month == $year_month)
|
433 |
-
for ($j = $date_day; $j <= $date_end_day; $j = $j + $repeat) {
|
434 |
-
if (in_array($j, $used)) {
|
435 |
-
continue;
|
436 |
-
}
|
437 |
-
else {
|
438 |
-
array_push($used, $j);
|
439 |
-
}
|
440 |
-
if (in_array($j, $array_days)) {
|
441 |
-
$key = array_search($j, $array_days);
|
442 |
-
$title_num[$j]++;
|
443 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
444 |
-
$array_days1[$key] = $j;
|
445 |
-
}
|
446 |
-
$c = $title_num[$j];
|
447 |
-
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
448 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
449 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
450 |
-
}
|
451 |
-
else {
|
452 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
453 |
-
}
|
454 |
-
$title[$j] = $title[$j] . $list;
|
455 |
-
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
456 |
-
}
|
457 |
-
else {
|
458 |
-
$array_days[] = $j;
|
459 |
-
$key = array_search($j, $array_days);
|
460 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
461 |
-
$array_days1[$key] = $j;
|
462 |
-
}
|
463 |
-
$title_num[$j] = 1;
|
464 |
-
$c = 1;
|
465 |
-
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
466 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
467 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
468 |
-
}
|
469 |
-
else {
|
470 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
471 |
-
}
|
472 |
-
$title[$j] = $list;
|
473 |
-
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
474 |
-
}
|
475 |
-
}
|
476 |
-
if ($date_end_month > 0 and $date_year_month < $date_end_year_month and $date_end_year_month > $year_month and $date_year_month < $year_month)
|
477 |
-
for ($j = $date_day; $j <= 31; $j = $j + $repeat) {
|
478 |
-
if (in_array($j, $used)) {
|
479 |
-
continue;
|
480 |
-
}
|
481 |
-
else {
|
482 |
-
array_push($used, $j);
|
483 |
-
}
|
484 |
-
if (in_array($j, $array_days)) {
|
485 |
-
$key = array_search($j, $array_days);
|
486 |
-
$title_num[$j]++;
|
487 |
-
if ($rows[$i - 1]->text_for_date != "")
|
488 |
-
$array_days1[$key] = $j;
|
489 |
-
$c = $title_num[$j];
|
490 |
-
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
491 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
492 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
493 |
-
}
|
494 |
-
else {
|
495 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
496 |
-
}
|
497 |
-
$title[$j] = $title[$j] . $list;
|
498 |
-
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
499 |
-
}
|
500 |
-
else {
|
501 |
-
$array_days[] = $j;
|
502 |
-
$key = array_search($j, $array_days);
|
503 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
504 |
-
$array_days1[$key] = $j;
|
505 |
-
}
|
506 |
-
$title_num[$j] = 1;
|
507 |
-
$c = 1;
|
508 |
-
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
509 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
510 |
-
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
511 |
-
}
|
512 |
-
else {
|
513 |
-
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
514 |
-
}
|
515 |
-
$title[$j] = $list;
|
516 |
-
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
517 |
-
}
|
518 |
-
}
|
519 |
-
}
|
520 |
-
}
|
521 |
-
for ($i = 1; $i <= count($array_days) - 1; $i++) {
|
522 |
-
if (isset($array_days[$i])) {
|
523 |
-
if ($array_days[$i] > '00' && $array_days[$i] < '09' and substr($array_days[$i], 0, 1) == '0') {
|
524 |
-
$array_days[$i] = substr($array_days[$i], 1, 1);
|
525 |
-
}
|
526 |
-
}
|
527 |
-
}
|
528 |
-
$all_calendar_files['array_days'] = $array_days;
|
529 |
-
$all_calendar_files['title'] = $title;
|
530 |
-
$all_calendar_files['array_days1'] = $array_days1;
|
531 |
-
$all_calendar_files['calendar'] = $calendar;
|
532 |
-
$all_calendar_files['ev_ids'] = $ev_ids;
|
533 |
-
return array($all_calendar_files);
|
534 |
-
}
|
535 |
-
|
536 |
-
function php_getdays_for_three_months($calendar, $date, $months, $theme_id, $widget) {
|
537 |
-
global $wpdb;
|
538 |
-
$year = substr($date, 0, 4);
|
539 |
-
$month = substr($date, 5, 2);
|
540 |
-
$months_array = explode(',', $months);
|
541 |
-
if ($widget) {
|
542 |
-
$show_time = 0;
|
543 |
-
}
|
544 |
-
else {
|
545 |
-
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
546 |
-
$show_time = $theme->show_time;
|
547 |
-
}
|
548 |
-
|
549 |
-
if(isset($_GET['cat_id']))
|
550 |
-
$cat_id = $_GET['cat_id'];
|
551 |
-
else $cat_id = "";
|
552 |
-
|
553 |
-
if(isset($_GET['cat_ids']))
|
554 |
-
$cat_ids = $_GET['cat_ids'];
|
555 |
-
else $cat_ids = "";
|
556 |
-
|
557 |
-
|
558 |
-
if($cat_ids=='')
|
559 |
-
$cat_ids .= $cat_id.',';
|
560 |
-
else
|
561 |
-
$cat_ids .= ','.$cat_id.',';
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
566 |
-
|
567 |
-
$cat_ids_array = explode(',',$cat_ids);
|
568 |
-
|
569 |
-
|
570 |
-
if($cat_id!='')
|
571 |
-
{
|
572 |
-
|
573 |
-
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
574 |
-
{
|
575 |
-
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
576 |
-
$index_array = explode(',' , $index_in_line);
|
577 |
-
array_pop ($index_array);
|
578 |
-
for($j=0; $j<count($index_array); $j++)
|
579 |
-
unset($cat_ids_array[$index_array[$j]]);
|
580 |
-
$cat_ids = implode(',',$cat_ids_array);
|
581 |
-
}
|
582 |
-
}
|
583 |
-
else
|
584 |
-
$cat_ids = substr($cat_ids, 0,-1);
|
585 |
-
|
586 |
-
$row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where published=1 and id
|
587 |
-
|
588 |
-
if($row->time_format==0)
|
589 |
-
{
|
590 |
-
$order_by = "ORDER BY " . $wpdb->prefix . "spidercalendar_event.time ASC";
|
591 |
-
}
|
592 |
-
else{
|
593 |
-
$order_by = " ORDER BY STR_TO_DATE( SUBSTRING( time, 1, 7 ) , '%h:%i%p' )";
|
594 |
-
}
|
595 |
-
|
596 |
-
if($cat_ids!=''){
|
597 |
-
$rows = $wpdb->get_results("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
|
598 |
-
|
599 |
-
}
|
600 |
-
else{
|
601 |
-
$rows = $wpdb->get_results($wpdb->prepare("SELECT * from " . $wpdb->prefix . "spidercalendar_event where published=1 and ((date_end>=%s) or (date_end=%s)) and calendar=%d", "" . substr($date, 0, 7) . "-01", "0000-00-00", $calendar)." ".$order_by." ");
|
602 |
-
}
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
$all_id_array = array();
|
609 |
-
$all_array_days = array();
|
610 |
-
$all_array_days1 = array();
|
611 |
-
$all_title = array();
|
612 |
-
$all_ev_ids = array();
|
613 |
-
$s = count($rows);
|
614 |
-
foreach ($months_array as $month) {
|
615 |
-
$id_array = array();
|
616 |
-
$array_days = array();
|
617 |
-
$array_days1 = array();
|
618 |
-
$title = array();
|
619 |
-
$ev_ids = array();
|
620 |
-
for ($i = 1; $i <= $s; $i++) {
|
621 |
-
if ($rows[$i - 1]->repeat_method != 'no_repeat' and $rows[$i - 1]->date_end == '0000-00-00')
|
622 |
-
$d_end = ((int)substr($rows[$i - 1]->date, 0, 4) + 40) . substr($rows[$i - 1]->date, 4, 6);
|
623 |
-
else
|
624 |
-
$d_end = $rows[$i - 1]->date_end;
|
625 |
-
$date_month = (int)substr($rows[$i - 1]->date, 5, 2);
|
626 |
-
$date_end_month = (int)substr($d_end, 5, 2);
|
627 |
-
$date_day = (int)substr($rows[$i - 1]->date, 8, 2);
|
628 |
-
$date_end_day = (int)substr($d_end, 8, 2);
|
629 |
-
$date_year_month = (int)(substr($rows[$i - 1]->date, 0, 4) . substr($rows[$i - 1]->date, 5, 2));
|
630 |
-
$date_end_year_month = (int)(substr($d_end, 0, 4) . substr($d_end, 5, 2));
|
631 |
-
$year_month = (int)($year . $month);
|
632 |
-
$repeat = $rows[$i - 1]->repeat;
|
633 |
-
if ($repeat == "") {
|
634 |
-
$repeat = 1;
|
635 |
-
}
|
636 |
-
$start_date = $rows[$i - 1]->date;
|
637 |
-
$weekly = $rows[$i - 1]->week;
|
638 |
-
$weekly_array = explode(',', $weekly);
|
639 |
-
$date_days = array();
|
640 |
-
$weekdays_start = array();
|
641 |
-
$weekdays = array();
|
642 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
643 |
-
//////////////////////// NO Repeat /////////////////////////////////////////////////////////////////////////////////////////////
|
644 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
645 |
-
if ($rows[$i - 1]->repeat_method == 'no_repeat') {
|
646 |
-
$date_days[] = $date_day;
|
647 |
-
}
|
648 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
649 |
-
//////////////////////// Repeat Daily /////////////////////////////////////////////////////////////////////////////////////////////
|
650 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
651 |
-
if ($rows[$i - 1]->repeat_method == 'daily') {
|
652 |
-
$t = php_daysDifference($rows[$i - 1]->date, $d_end);
|
653 |
-
for ($k = 1; $k <= $t / $repeat; $k++) {
|
654 |
-
$next_date = php_GetNextDate($start_date, $repeat);
|
655 |
-
$next_date_array = explode('/', $next_date);
|
656 |
-
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year) {
|
657 |
-
$date_days[0] = $date_day;
|
658 |
-
}
|
659 |
-
if ((int)$month == $next_date_array[0] && (int)$year == $next_date_array[2]) {
|
660 |
-
$date_days[] = $next_date_array[1];
|
661 |
-
}
|
662 |
-
$start_date = date("Y-m-d", mktime(0, 0, 0, $next_date_array[0], $next_date_array[1], $next_date_array[2]));
|
663 |
-
}
|
664 |
-
}
|
665 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
666 |
-
//////////////////////// Repeat Weekly ///////////////////////////////////////////////////////////////////////////////////////////
|
667 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
668 |
-
if ($rows[$i - 1]->repeat_method == 'weekly') {
|
669 |
-
for ($j = 0; $j <= 6; $j++) {
|
670 |
-
if (in_array(date("D", mktime(0, 0, 0, $date_month, $date_day + $j, substr($rows[$i - 1]->date, 0, 4))), $weekly_array)) {
|
671 |
-
$weekdays_start[] = $date_day + $j;
|
672 |
-
}
|
673 |
-
}
|
674 |
-
for ($p = 0; $p < count($weekly_array) - 1; $p++) {
|
675 |
-
$start_date = substr($rows[$i - 1]->date, 0, 8) . $weekdays_start[$p];
|
676 |
-
$t = php_daysDifference($rows[$i - 1]->date, $d_end);
|
677 |
-
$q = php_daysDifference($rows[$i - 1]->date, $start_date);
|
678 |
-
$r = 0;
|
679 |
-
if (($t / ($repeat * 7) - 1) > 1) {
|
680 |
-
for ($k = 1; $k < $t / ($repeat * 7) - 1; $k++) {
|
681 |
-
$start_date_array[] = $start_date;
|
682 |
-
$next_date = php_GetNextDate($start_date, $repeat * 7);
|
683 |
-
$next_date_array = explode('/', $next_date);
|
684 |
-
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
685 |
-
$date_days[0] = $weekdays_start[$p];
|
686 |
-
if ((int)$month == $next_date_array[0] && (int)$year == $next_date_array[2]) {
|
687 |
-
if ((int)$year > (int)substr($date_year_month, 0, 4)) {
|
688 |
-
$weekdays[] = $next_date_array[1];
|
689 |
-
}
|
690 |
-
else {
|
691 |
-
$weekdays[] = $next_date_array[1];
|
692 |
-
}
|
693 |
-
}
|
694 |
-
$start_date = date("Y-m-d", mktime(0, 0, 0, $next_date_array[0], $next_date_array[1], $next_date_array[2]));
|
695 |
-
if ($next_date_array[2] > (int)substr($d_end, 0, 4)) {
|
696 |
-
break;
|
697 |
-
}
|
698 |
-
}
|
699 |
-
$date_days = array_merge($weekdays, $date_days);
|
700 |
-
}
|
701 |
-
else {
|
702 |
-
if ($t >= $q) {
|
703 |
-
$date_days[] = $weekdays_start[$p];
|
704 |
-
}
|
705 |
-
}
|
706 |
-
}
|
707 |
-
$repeat = $repeat * 7;
|
708 |
-
}
|
709 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
710 |
-
//////////////////////// Repeat Monthly ///////////////////////////////////////////////////////////////////////////////////////////
|
711 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
712 |
-
if ($rows[$i - 1]->repeat_method == 'monthly') {
|
713 |
-
$month_days = date('t', mktime(0, 0, 0, $month, $date_day, $year));
|
714 |
-
if ($date_month < (int)$month or (int)substr($date_year_month, 0, 4) < $year) {
|
715 |
-
$date_day = 1;
|
716 |
-
}
|
717 |
-
if ($year > (int)substr($date_year_month, 0, 4)) {
|
718 |
-
$date_year_month = $year . '00';
|
719 |
-
}
|
720 |
-
$p = (int)substr($date_year_month, 4, 2);
|
721 |
-
if ((int)substr($date_year_month, 0, 4) != (int)substr($date_end_year_month, 0, 4)) {
|
722 |
-
$end = (int)substr($date_end_year_month, 4, 2) + 12;
|
723 |
-
}
|
724 |
-
else {
|
725 |
-
$end = (int)substr($date_end_year_month, 4, 2);
|
726 |
-
}
|
727 |
-
for ($k = 1; $k <= $end; $k++) {
|
728 |
-
if ((int)$month == $p and $rows[$i - 1]->month_type == 1) {
|
729 |
-
$date_days[0] = $rows[$i - 1]->month;
|
730 |
-
}
|
731 |
-
if ($p == (int)$month and $rows[$i - 1]->month_type == 2) {
|
732 |
-
if ($rows[$i - 1]->monthly_list != 'last') {
|
733 |
-
for ($j = $rows[$i - 1]->monthly_list; $j < $rows[$i - 1]->monthly_list + 7; $j++) {
|
734 |
-
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
735 |
-
if ($j >= $date_day) {
|
736 |
-
$date_days[0] = $j;
|
737 |
-
}
|
738 |
-
}
|
739 |
-
}
|
740 |
-
}
|
741 |
-
else {
|
742 |
-
for ($j = 1; $j < $month_days; $j++) {
|
743 |
-
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
744 |
-
if ($j >= $date_day) {
|
745 |
-
$date_days[0] = $j;
|
746 |
-
}
|
747 |
-
}
|
748 |
-
}
|
749 |
-
}
|
750 |
-
}
|
751 |
-
if ($year > (int)substr($date_year_month, 0, 4)) {
|
752 |
-
$p = 1;
|
753 |
-
}
|
754 |
-
$p = $p + $repeat;
|
755 |
-
}
|
756 |
-
$repeat = 32;
|
757 |
-
}
|
758 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
759 |
-
//////////////////////// Repeat Yearly ///////////////////////////////////////////////////////////////////////////////////////////
|
760 |
-
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
761 |
-
if ($rows[$i - 1]->repeat_method == 'yearly') {
|
762 |
-
$month_days = date('t', mktime(0, 0, 0, $month, $date_day, $year));
|
763 |
-
$end = substr($date_end_year_month, 0, 4) - substr($date_year_month, 0, 4) + 1;
|
764 |
-
if (substr($date_year_month, 0, 4) < $year) {
|
765 |
-
$date_day = 1;
|
766 |
-
}
|
767 |
-
for ($k = 0; $k <= $end; $k += $repeat) {
|
768 |
-
if ((int)$month == $rows[$i - 1]->year_month and $rows[$i - 1]->month_type == 1 and $year == substr($date_year_month, 0, 4) + $k) {
|
769 |
-
$date_days[0] = $rows[$i - 1]->month;
|
770 |
-
}
|
771 |
-
}
|
772 |
-
for ($k = 0; $k <= $end; $k += $repeat) {
|
773 |
-
if ((int)$month == $rows[$i - 1]->year_month and $rows[$i - 1]->month_type == 2 and $year == substr($date_year_month, 0, 4) + $k) {
|
774 |
-
if ($rows[$i - 1]->monthly_list != 'last') {
|
775 |
-
for ($j = $rows[$i - 1]->monthly_list; $j < $rows[$i - 1]->monthly_list + 7; $j++) {
|
776 |
-
if (date("D", mktime(0, 0, 0, $month, $j, $
|
777 |
-
$date_days[0] = $j;
|
778 |
-
}
|
779 |
-
}
|
780 |
-
}
|
781 |
-
else {
|
782 |
-
for ($j = 1; $j <= $month_days; $j++) {
|
783 |
-
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
784 |
-
$date_days[0] = $j;
|
785 |
-
}
|
786 |
-
}
|
787 |
-
}
|
788 |
-
}
|
789 |
-
}
|
790 |
-
$repeat = 32;
|
791 |
-
}
|
792 |
-
$used = array();
|
793 |
-
foreach ($date_days as $date_day) {
|
794 |
-
if ($date_month == $month) {
|
795 |
-
if (in_array($date_day, $used)) {
|
796 |
-
continue;
|
797 |
-
}
|
798 |
-
else {
|
799 |
-
array_push($used, $date_day);
|
800 |
-
}
|
801 |
-
if (in_array($date_day, $array_days)) {
|
802 |
-
$key = array_search($date_day, $array_days);
|
803 |
-
$title_num[$date_day]++;
|
804 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
805 |
-
$array_days1[$key] = $date_day;
|
806 |
-
}
|
807 |
-
$c = $title_num[$date_day];
|
808 |
-
$list = '<p> ';
|
809 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
810 |
-
$list .= $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
811 |
-
}
|
812 |
-
else {
|
813 |
-
$list .= $rows[$i - 1]->title . '</p>';
|
814 |
-
}
|
815 |
-
$title[$date_day] = $title[$date_day] . $list;
|
816 |
-
$ev_ids[$date_day] = $ev_ids[$date_day] . $rows[$i - 1]->id . '<br>';
|
817 |
-
}
|
818 |
-
else {
|
819 |
-
$array_days[] = $date_day;
|
820 |
-
$key = array_search($date_day, $array_days);
|
821 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
822 |
-
$array_days1[$key] = $date_day;
|
823 |
-
}
|
824 |
-
$title_num[$date_day] = 1;
|
825 |
-
$c = 1;
|
826 |
-
$list = '<p> ';
|
827 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
828 |
-
$list .= $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
829 |
-
}
|
830 |
-
else {
|
831 |
-
$list .= $rows[$i - 1]->title . '</p>';
|
832 |
-
}
|
833 |
-
$title[$date_day] = $list;
|
834 |
-
$ev_ids[$date_day] = $rows[$i - 1]->id . '<br>';
|
835 |
-
}
|
836 |
-
}
|
837 |
-
if ($date_end_month > 0 and $date_year_month == $date_end_year_month and $date_end_year_month == $year_month)
|
838 |
-
for ($j = $date_day; $j <= $date_end_day; $j = $j + $repeat) {
|
839 |
-
if (in_array($j, $used)) {
|
840 |
-
continue;
|
841 |
-
}
|
842 |
-
else {
|
843 |
-
array_push($used, $j);
|
844 |
-
}
|
845 |
-
if (in_array($j, $array_days)) {
|
846 |
-
$key = array_search($j, $array_days);
|
847 |
-
$title_num[$j]++;
|
848 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
849 |
-
$array_days1[$key] = $j;
|
850 |
-
}
|
851 |
-
$c = $title_num[$j];
|
852 |
-
$list = '<p> ';
|
853 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
854 |
-
$list .= $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
855 |
-
}
|
856 |
-
else {
|
857 |
-
$list .= $rows[$i - 1]->title . '</p>';
|
858 |
-
}
|
859 |
-
$title[$j] = $title[$j] . $list;
|
860 |
-
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
861 |
-
}
|
862 |
-
else {
|
863 |
-
$array_days[] = $j;
|
864 |
-
$key = array_search($j, $array_days);
|
865 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
866 |
-
$array_days1[$key] = $j;
|
867 |
-
}
|
868 |
-
$title_num[$j] = 1;
|
869 |
-
$c = 1;
|
870 |
-
$list = '<p> ';
|
871 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
872 |
-
$list .= $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
873 |
-
}
|
874 |
-
else {
|
875 |
-
$list .= $rows[$i - 1]->title . '</p>';
|
876 |
-
}
|
877 |
-
$title[$j] = $list;
|
878 |
-
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
879 |
-
}
|
880 |
-
}
|
881 |
-
if ($date_end_month > 0 and $date_year_month < $date_end_year_month and $date_year_month == $year_month)
|
882 |
-
for ($j = $date_day; $j <= 31; $j = $j + $repeat) {
|
883 |
-
if (in_array($j, $used)) {
|
884 |
-
continue;
|
885 |
-
}
|
886 |
-
else {
|
887 |
-
array_push($used, $j);
|
888 |
-
}
|
889 |
-
if (in_array($j, $array_days)) {
|
890 |
-
$key = array_search($j, $array_days);
|
891 |
-
$title_num[$j]++;
|
892 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
893 |
-
$array_days1[$key] = $j;
|
894 |
-
}
|
895 |
-
$c = $title_num[$j];
|
896 |
-
$list = '<p> ';
|
897 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
898 |
-
$list .= $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
899 |
-
}
|
900 |
-
else {
|
901 |
-
$list .= $rows[$i - 1]->title . '</p>';
|
902 |
-
}
|
903 |
-
$title[$j] = $title[$j] . $list;
|
904 |
-
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
905 |
-
}
|
906 |
-
else {
|
907 |
-
$array_days[] = $j;
|
908 |
-
$key = array_search($j, $array_days);
|
909 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
910 |
-
$array_days1[$key] = $j;
|
911 |
-
}
|
912 |
-
$title_num[$j] = 1;
|
913 |
-
$c = 1;
|
914 |
-
$list = '<p> ';
|
915 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
916 |
-
$list .= $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
917 |
-
}
|
918 |
-
else {
|
919 |
-
$list .= $rows[$i - 1]->title . '</p>';
|
920 |
-
}
|
921 |
-
$title[$j] = $list;
|
922 |
-
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
923 |
-
}
|
924 |
-
}
|
925 |
-
if ($date_end_month > 0 and $date_year_month < $date_end_year_month and $date_end_year_month == $year_month)
|
926 |
-
for ($j = $date_day; $j <= $date_end_day; $j = $j + $repeat) {
|
927 |
-
if (in_array($j, $used)) {
|
928 |
-
continue;
|
929 |
-
}
|
930 |
-
else {
|
931 |
-
array_push($used, $j);
|
932 |
-
}
|
933 |
-
if (in_array($j, $array_days)) {
|
934 |
-
$key = array_search($j, $array_days);
|
935 |
-
$title_num[$j]++;
|
936 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
937 |
-
$array_days1[$key] = $j;
|
938 |
-
}
|
939 |
-
$c = $title_num[$j];
|
940 |
-
$list = '<p> ';
|
941 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
942 |
-
$list .= $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
943 |
-
}
|
944 |
-
else {
|
945 |
-
$list .= $rows[$i - 1]->title . '</p>';
|
946 |
-
}
|
947 |
-
$title[$j] = $title[$j] . $list;
|
948 |
-
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
949 |
-
}
|
950 |
-
else {
|
951 |
-
$array_days[] = $j;
|
952 |
-
$key = array_search($j, $array_days);
|
953 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
954 |
-
$array_days1[$key] = $j;
|
955 |
-
}
|
956 |
-
$title_num[$j] = 1;
|
957 |
-
$c = 1;
|
958 |
-
$list = '<p> ';
|
959 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
960 |
-
$list .= $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
961 |
-
}
|
962 |
-
else {
|
963 |
-
$list .= $rows[$i - 1]->title . '</p>';
|
964 |
-
}
|
965 |
-
$title[$j] = $list;
|
966 |
-
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
967 |
-
}
|
968 |
-
}
|
969 |
-
if ($date_end_month > 0 and $date_year_month < $date_end_year_month and $date_end_year_month > $year_month and $date_year_month < $year_month)
|
970 |
-
for ($j = $date_day; $j <= 31; $j = $j + $repeat) {
|
971 |
-
if (in_array($j, $used)) {
|
972 |
-
continue;
|
973 |
-
}
|
974 |
-
else {
|
975 |
-
array_push($used, $j);
|
976 |
-
}
|
977 |
-
if (in_array($j, $array_days)) {
|
978 |
-
$key = array_search($j, $array_days);
|
979 |
-
$title_num[$j]++;
|
980 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
981 |
-
$array_days1[$key] = $j;
|
982 |
-
}
|
983 |
-
$c = $title_num[$j];
|
984 |
-
$list = '<p> ';
|
985 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
986 |
-
$list .= $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
987 |
-
}
|
988 |
-
else {
|
989 |
-
$list .= $rows[$i - 1]->title . '</p>';
|
990 |
-
}
|
991 |
-
$title[$j] = $title[$j] . $list;
|
992 |
-
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
993 |
-
}
|
994 |
-
else {
|
995 |
-
$array_days[] = $j;
|
996 |
-
$key = array_search($j, $array_days);
|
997 |
-
if ($rows[$i - 1]->text_for_date != "") {
|
998 |
-
$array_days1[$key] = $j;
|
999 |
-
}
|
1000 |
-
$title_num[$j] = 1;
|
1001 |
-
$c = 1;
|
1002 |
-
$list = '<p> ';
|
1003 |
-
if ($rows[$i - 1]->time and $show_time != 0) {
|
1004 |
-
$list .= $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
1005 |
-
}
|
1006 |
-
else {
|
1007 |
-
$list .= $rows[$i - 1]->title . '</p>';
|
1008 |
-
}
|
1009 |
-
$title[$j] = $list;
|
1010 |
-
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
1011 |
-
}
|
1012 |
-
}
|
1013 |
-
}
|
1014 |
-
}
|
1015 |
-
$all_id_array[] = $id_array;
|
1016 |
-
$all_array_days[] = $array_days;
|
1017 |
-
$all_array_days1[] = $array_days1;
|
1018 |
-
$all_title[] = $title;
|
1019 |
-
$all_ev_ids[] = $ev_ids;
|
1020 |
-
}
|
1021 |
-
$all_calendar_files['all_array_days'] = $all_array_days;
|
1022 |
-
$all_calendar_files['all_array_days1'] = $all_array_days1;
|
1023 |
-
$all_calendar_files['all_title'] = $all_title;
|
1024 |
-
$all_calendar_files['all_ev_ids'] = $all_ev_ids;
|
1025 |
-
$all_calendar_files['all_calendar'] = $all_id_array;
|
1026 |
-
return array($all_calendar_files);
|
1027 |
-
}
|
1028 |
-
|
1029 |
-
|
1030 |
-
function Month_name($month_num) {
|
1031 |
-
$timestamp = mktime(0, 0, 0, $month_num, 1, 2005);
|
1032 |
-
return date("F", $timestamp);
|
1033 |
-
}
|
1034 |
-
|
1035 |
-
function add_0($month_num) {
|
1036 |
-
if ($month_num < 10)
|
1037 |
-
return '0' . $month_num;
|
1038 |
-
return $month_num;
|
1039 |
-
}
|
1040 |
-
|
1041 |
-
function Month_num($month_name) {
|
1042 |
-
for ($month_num = 1; $month_num <= 12; $month_num++) {
|
1043 |
-
if (date("F", mktime(0, 0, 0, $month_num, 1, 0)) == $month_name) {
|
1044 |
-
return $month_num;
|
1045 |
-
}
|
1046 |
-
}
|
1047 |
-
}
|
1048 |
-
|
1049 |
-
function week_number($x) {
|
1050 |
-
if ($x == 1) {
|
1051 |
-
return __('First', 'sp_calendar');
|
1052 |
-
}
|
1053 |
-
elseif ($x == 8) {
|
1054 |
-
return __('Second', 'sp_calendar');
|
1055 |
-
}
|
1056 |
-
elseif ($x == 15) {
|
1057 |
-
return __('Third', 'sp_calendar');
|
1058 |
-
}
|
1059 |
-
elseif ($x == 22) {
|
1060 |
-
return __('Fourth', 'sp_calendar');
|
1061 |
-
}
|
1062 |
-
elseif ($x == 'last') {
|
1063 |
-
return __('Last', 'sp_calendar');
|
1064 |
-
}
|
1065 |
-
}
|
1066 |
-
|
1067 |
-
function week_convert($x) {
|
1068 |
-
if ($x == 'Mon') {
|
1069 |
-
return __('Monday', 'sp_calendar');
|
1070 |
-
}
|
1071 |
-
elseif ($x == 'Tue') {
|
1072 |
-
return __('Tuesday', 'sp_calendar');
|
1073 |
-
}
|
1074 |
-
elseif ($x == 'Wed') {
|
1075 |
-
return __('Wednesday', 'sp_calendar');
|
1076 |
-
}
|
1077 |
-
elseif ($x == 'Thu') {
|
1078 |
-
return __('Thursday', 'sp_calendar');
|
1079 |
-
}
|
1080 |
-
elseif ($x == 'Fri') {
|
1081 |
-
return __('Friday', 'sp_calendar');
|
1082 |
-
}
|
1083 |
-
elseif ($x == 'Sat') {
|
1084 |
-
return __('Saturday', 'sp_calendar');
|
1085 |
-
}
|
1086 |
-
elseif ($x == 'Sun') {
|
1087 |
-
return __('Sunday', 'sp_calendar');
|
1088 |
-
}
|
1089 |
-
}
|
1090 |
-
|
1091 |
-
function do_nothing() {
|
1092 |
-
return FALSE;
|
1093 |
-
}
|
1094 |
-
|
1095 |
-
function php_showevent($calendar, $date, $eventID) {
|
1096 |
-
global $wpdb;
|
1097 |
-
$year = substr($date, 0, 4);
|
1098 |
-
$month = substr($date, 5, 2);
|
1099 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE id=%d', $eventID));
|
1100 |
-
$all_files_spider_cal['row'] = $row;
|
1101 |
-
return array($all_files_spider_cal);
|
1102 |
-
}
|
1103 |
-
|
1104 |
-
function php_showevent_seemore($calendar, $date) {
|
1105 |
-
global $wpdb;
|
1106 |
-
$year = substr($date, 0, 4);
|
1107 |
-
$month = substr($date, 5, 2);
|
1108 |
-
$row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where published=1 and id=".$calendar);
|
1109 |
-
|
1110 |
-
if($row->time_format==0)
|
1111 |
-
{
|
1112 |
-
$order_by = "ORDER BY " . $wpdb->prefix . "spidercalendar_event.time ASC";
|
1113 |
-
}
|
1114 |
-
else{
|
1115 |
-
$order_by = " ORDER BY STR_TO_DATE( SUBSTRING( time, 1, 7 ) , '%h:%i%p' )";
|
1116 |
-
}
|
1117 |
-
|
1118 |
-
|
1119 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=".$calendar." ".$order_by;
|
1120 |
-
$rows = $wpdb->get_results($query);
|
1121 |
-
$all_spider_files['rows'] = $rows;
|
1122 |
-
return array($all_spider_files);
|
1123 |
-
}
|
1124 |
-
|
1125 |
-
function php_Month_num_seemore($month_name) {
|
1126 |
-
for ($month_num = 1; $month_num <= 12; $month_num++) {
|
1127 |
-
if (date("F", mktime(0, 0, 0, $month_num, 1, 0)) == $month_name) {
|
1128 |
-
return $month_num;
|
1129 |
-
}
|
1130 |
-
}
|
1131 |
-
}
|
1132 |
-
|
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 |
+
//explode the date by "-" and storing to array
|
34 |
+
$date_parts1 = explode("-", $beginDate);
|
35 |
+
//gregoriantojd() Converts a Gregorian date to Julian Day Count
|
36 |
+
$start_date = gregoriantojd($date_parts1[1], $date_parts1[2], $date_parts1[0]);
|
37 |
+
return jdtogregorian($start_date + $repeat);
|
38 |
+
}
|
39 |
+
|
40 |
+
function php_daysDifference($beginDate, $endDate) {
|
41 |
+
//explode the date by "-" and storing to array
|
42 |
+
$date_parts1 = explode("-", $beginDate);
|
43 |
+
$date_parts2 = explode("-", $endDate);
|
44 |
+
//gregoriantojd() Converts a Gregorian date to Julian Day Count
|
45 |
+
$start_date = gregoriantojd($date_parts1[1], $date_parts1[2], $date_parts1[0]);
|
46 |
+
$end_date = gregoriantojd($date_parts2[1], $date_parts2[2], $date_parts2[0]);
|
47 |
+
return $end_date - $start_date;
|
48 |
+
}
|
49 |
+
|
50 |
+
function php_getdays($show_numbers_for_events, $calendar, $date, $theme_id, $widget) {
|
51 |
+
global $wpdb;
|
52 |
+
$year = substr($date, 0, 4);
|
53 |
+
$month = substr($date, 5, 2);
|
54 |
+
if ($widget) {
|
55 |
+
$show_time = 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 |
+
}
|
61 |
+
|
62 |
+
if(isset($_GET['cat_id']))
|
63 |
+
$cat_id = $_GET['cat_id'];
|
64 |
+
else $cat_id = "";
|
65 |
+
|
66 |
+
if(isset($_GET['cat_ids']))
|
67 |
+
$cat_ids = $_GET['cat_ids'];
|
68 |
+
else $cat_ids = "";
|
69 |
+
|
70 |
+
|
71 |
+
if($cat_ids=='')
|
72 |
+
$cat_ids .= $cat_id.',';
|
73 |
+
else
|
74 |
+
$cat_ids .= ','.$cat_id.',';
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
79 |
+
|
80 |
+
$cat_ids_array = explode(',',$cat_ids);
|
81 |
+
|
82 |
+
|
83 |
+
if($cat_id!='')
|
84 |
+
{
|
85 |
+
|
86 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
87 |
+
{
|
88 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
89 |
+
$index_array = explode(',' , $index_in_line);
|
90 |
+
array_pop ($index_array);
|
91 |
+
for($j=0; $j<count($index_array); $j++)
|
92 |
+
unset($cat_ids_array[$index_array[$j]]);
|
93 |
+
$cat_ids = implode(',',$cat_ids_array);
|
94 |
+
}
|
95 |
+
}
|
96 |
+
else
|
97 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
98 |
+
|
99 |
+
$row = $wpdb->get_row($wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where published=1 and id=%d",$calendar));
|
100 |
+
|
101 |
+
if($row->time_format==0)
|
102 |
+
{
|
103 |
+
$order_by = "ORDER BY " . $wpdb->prefix . "spidercalendar_event.time ASC";
|
104 |
+
}
|
105 |
+
else{
|
106 |
+
$order_by = " ORDER BY STR_TO_DATE( SUBSTRING( time, 1, 7 ) , '%h:%i%p' )";
|
107 |
+
}
|
108 |
+
|
109 |
+
if($cat_ids!=''){
|
110 |
+
$rows = $wpdb->get_results($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 (%s) 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 ".$order_by." ",$cat_ids,substr( $date,0,7).'-01',substr( $date,0,7)."%",substr( $date,0,7).'-01',substr( $date,0,7)."%",$calendar));
|
111 |
+
|
112 |
+
}
|
113 |
+
else{
|
114 |
+
$rows = $wpdb->get_results($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)." ".$order_by." ");
|
115 |
+
|
116 |
+
}
|
117 |
+
|
118 |
+
|
119 |
+
|
120 |
+
$id_array = array();
|
121 |
+
$s = count($rows);
|
122 |
+
$id_array = array();
|
123 |
+
$array_days = array();
|
124 |
+
$array_days1 = array();
|
125 |
+
$title = array();
|
126 |
+
$ev_ids = array();
|
127 |
+
for ($i = 1; $i <= $s; $i++) {
|
128 |
+
$date_month = (int)substr($rows[$i - 1]->date, 5, 2);
|
129 |
+
$date_end_month = (int)substr($rows[$i - 1]->date_end, 5, 2);
|
130 |
+
$date_day = (int)substr($rows[$i - 1]->date, 8, 2);
|
131 |
+
$date_end_day = (int)substr($rows[$i - 1]->date_end, 8, 2);
|
132 |
+
$date_year_month = (int)(substr($rows[$i - 1]->date, 0, 4) . substr($rows[$i - 1]->date, 5, 2));
|
133 |
+
$date_end_year_month = (int)(substr($rows[$i - 1]->date_end, 0, 4) . substr($rows[$i - 1]->date_end, 5, 2));
|
134 |
+
$year_month = (int)($year . $month);
|
135 |
+
$repeat = $rows[$i - 1]->repeat;
|
136 |
+
if ($repeat == "") {
|
137 |
+
$repeat = 1;
|
138 |
+
}
|
139 |
+
$start_date = $rows[$i - 1]->date;
|
140 |
+
$weekly = $rows[$i - 1]->week;
|
141 |
+
$weekly_array = explode(',', $weekly);
|
142 |
+
$date_days = array();
|
143 |
+
$weekdays_start = array();
|
144 |
+
$weekdays = array();
|
145 |
+
|
146 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
147 |
+
//////////////////////// NO Repeat /////////////////////////////////////////////////////////////////////////////////////////////
|
148 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
149 |
+
if ($rows[$i - 1]->repeat_method == 'no_repeat') {
|
150 |
+
$date_days[] = $date_day;
|
151 |
+
}
|
152 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
153 |
+
//////////////////////// Repeat Daily /////////////////////////////////////////////////////////////////////////////////////////////
|
154 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
155 |
+
if ($rows[$i - 1]->repeat_method == 'daily') {
|
156 |
+
$t = php_daysDifference($rows[$i - 1]->date, $rows[$i - 1]->date_end);
|
157 |
+
for ($k = 1; $k <= $t / $repeat; $k++) {
|
158 |
+
$next_date = php_GetNextDate($start_date, $repeat);
|
159 |
+
$next_date_array = explode('/', $next_date);
|
160 |
+
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
161 |
+
$date_days[0] = $date_day;
|
162 |
+
if ((int)$month == $next_date_array[0] && (int)$year == $next_date_array[2])
|
163 |
+
$date_days[] = $next_date_array[1];
|
164 |
+
$start_date = date("Y-m-d", mktime(0, 0, 0, $next_date_array[0], $next_date_array[1], $next_date_array[2]));
|
165 |
+
}
|
166 |
+
}
|
167 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
168 |
+
//////////////////////// Repeat Weekly ///////////////////////////////////////////////////////////////////////////////////////////
|
169 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
170 |
+
if ($rows[$i - 1]->repeat_method == 'weekly') {
|
171 |
+
for ($j = 0; $j <= 6; $j++) {
|
172 |
+
if (in_array(date("D", mktime(0, 0, 0, $date_month, $date_day + $j, substr($rows[$i - 1]->date, 0, 4))), $weekly_array)) {
|
173 |
+
$weekdays_start[] = $date_day + $j;
|
174 |
+
}
|
175 |
+
}
|
176 |
+
for ($p = 0; $p < count($weekly_array) - 1; $p++) {
|
177 |
+
$start_date = substr($rows[$i - 1]->date, 0, 8) . $weekdays_start[$p];
|
178 |
+
$t = php_daysDifference($rows[$i - 1]->date, $rows[$i - 1]->date_end);
|
179 |
+
$r = 0;
|
180 |
+
for ($k = 1; $k < $t / $repeat; $k++) {
|
181 |
+
$start_date_array[] = $start_date;
|
182 |
+
$next_date = php_GetNextDate($start_date, $repeat * 7);
|
183 |
+
$next_date_array = explode('/', $next_date);
|
184 |
+
|
185 |
+
|
186 |
+
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
187 |
+
$date_days[0] = $weekdays_start[$p];
|
188 |
+
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))
|
189 |
+
break;
|
190 |
+
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
191 |
+
$date_days[0] = $weekdays_start[$p];
|
192 |
+
if ((int)$month == $next_date_array[0] && (int)$year == $next_date_array[2])
|
193 |
+
if ((int)$year > (int)substr($date_year_month, 0, 4)) {
|
194 |
+
$weekdays[] = $next_date_array[1];
|
195 |
+
}
|
196 |
+
else {
|
197 |
+
$weekdays[] = $next_date_array[1];
|
198 |
+
}
|
199 |
+
$start_date = date("Y-m-d", mktime(0, 0, 0, $next_date_array[0], $next_date_array[1], $next_date_array[2]));
|
200 |
+
// if ($next_date_array[2] > (int)substr($rows[$i - 1]->date_end, 0, 4))
|
201 |
+
// break;
|
202 |
+
}
|
203 |
+
$date_days = array_merge($weekdays, $date_days);
|
204 |
+
}
|
205 |
+
$repeat = $repeat * 7;
|
206 |
+
}
|
207 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
208 |
+
//////////////////////// Repeat Monthly ///////////////////////////////////////////////////////////////////////////////////////////
|
209 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
210 |
+
if ($rows[$i - 1]->repeat_method == 'monthly') {
|
211 |
+
$xxxxx = 13;
|
212 |
+
$year_dif_count = (int)$year - (int)substr($rows[$i - 1]->date, 0, 4);
|
213 |
+
$mount_dif_count = 12 - (int)substr($rows[$i - 1]->date, 5, 2) + (($year_dif_count - 1) * 12);
|
214 |
+
if ($year_dif_count > 0)
|
215 |
+
for ($my_serch_month = 1; $my_serch_month <= 12; $my_serch_month++) {
|
216 |
+
if ((($mount_dif_count + $my_serch_month) % $rows[$i - 1]->repeat) == 0) {
|
217 |
+
$xxxxx = $my_serch_month;
|
218 |
+
break;
|
219 |
+
}
|
220 |
+
}
|
221 |
+
if ($xxxxx != 13) {
|
222 |
+
if ($xxxxx < 10) {
|
223 |
+
$xxxxx = '0' . $xxxxx;
|
224 |
+
}
|
225 |
+
}
|
226 |
+
$month_days = date('t', mktime(0, 0, 0, $month, $date_day, $year));
|
227 |
+
if ($date_month < (int)$month or (int)substr($date_year_month, 0, 4) < $year)
|
228 |
+
$date_day = 1;
|
229 |
+
if ($year > (int)substr($date_year_month, 0, 4))
|
230 |
+
$date_year_month = $year . $xxxxx;
|
231 |
+
$p = (int)substr($date_year_month, 4, 2);
|
232 |
+
if ((int)substr($date_year_month, 0, 4) != (int)substr($date_end_year_month, 0, 4))
|
233 |
+
$end = (int)substr($date_end_year_month, 4, 2) + 12;
|
234 |
+
else
|
235 |
+
$end = (int)substr($date_end_year_month, 4, 2);
|
236 |
+
for ($k = 1; $k <= $end; $k++) {
|
237 |
+
if ((int)$month == $p and $rows[$i - 1]->month_type == 1) {
|
238 |
+
$date_days[0] = $rows[$i - 1]->month;
|
239 |
+
}
|
240 |
+
if ($p == (int)$month and $rows[$i - 1]->month_type == 2) {
|
241 |
+
if ($rows[$i - 1]->monthly_list != 'last') {
|
242 |
+
for ($j = $rows[$i - 1]->monthly_list; $j < $rows[$i - 1]->monthly_list + 7; $j++) {
|
243 |
+
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
244 |
+
if ($j >= $date_day) {
|
245 |
+
$date_days[0] = $j;
|
246 |
+
}
|
247 |
+
}
|
248 |
+
}
|
249 |
+
}
|
250 |
+
else {
|
251 |
+
for ($j = 1; $j <= $month_days; $j++) {
|
252 |
+
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
253 |
+
if ($j >= $date_day) {
|
254 |
+
$date_days[0] = $j;
|
255 |
+
}
|
256 |
+
}
|
257 |
+
}
|
258 |
+
}
|
259 |
+
}
|
260 |
+
if ($year > (int)substr($date_year_month, 0, 4)) {
|
261 |
+
$p = 1;
|
262 |
+
}
|
263 |
+
$p = $p + $repeat;
|
264 |
+
}
|
265 |
+
$repeat = 32;
|
266 |
+
}
|
267 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
268 |
+
//////////////////////// Repeat Yearly ///////////////////////////////////////////////////////////////////////////////////////////
|
269 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
270 |
+
if ($rows[$i - 1]->repeat_method == 'yearly') {
|
271 |
+
$month_days = date('t', mktime(0, 0, 0, $month, $date_day, $year));
|
272 |
+
$end = substr($date_end_year_month, 0, 4) - substr($date_year_month, 0, 4) + 1;
|
273 |
+
if (substr($date_year_month, 0, 4) < $year) {
|
274 |
+
$date_day = 1;
|
275 |
+
}
|
276 |
+
for ($k = 0; $k <= $end; $k += $repeat) {
|
277 |
+
if ((int)$month == $rows[$i - 1]->year_month and $rows[$i - 1]->month_type == 1 and $year == substr($date_year_month, 0, 4) + $k) {
|
278 |
+
$date_days[0] = $rows[$i - 1]->month;
|
279 |
+
}
|
280 |
+
}
|
281 |
+
for ($k = 0; $k <= $end; $k += $repeat) {
|
282 |
+
if ((int)$month == $rows[$i - 1]->year_month and $rows[$i - 1]->month_type == 2 and $year == substr($date_year_month, 0, 4) + $k) {
|
283 |
+
if ($rows[$i - 1]->monthly_list != 'last') {
|
284 |
+
for ($j = $rows[$i - 1]->monthly_list; $j < $rows[$i - 1]->monthly_list + 7; $j++) {
|
285 |
+
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
286 |
+
$date_days[0] = $j;
|
287 |
+
}
|
288 |
+
}
|
289 |
+
}
|
290 |
+
else {
|
291 |
+
for ($j = 1; $j <= $month_days; $j++) {
|
292 |
+
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
293 |
+
$date_days[0] = $j;
|
294 |
+
}
|
295 |
+
}
|
296 |
+
}
|
297 |
+
}
|
298 |
+
}
|
299 |
+
$repeat = 32;
|
300 |
+
}
|
301 |
+
$used = array();
|
302 |
+
foreach ($date_days as $date_day) {
|
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) ? '' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '') : '');
|
317 |
+
if ($rows[$i - 1]->time and $show_time != 0) {
|
318 |
+
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
319 |
+
}
|
320 |
+
else {
|
321 |
+
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
322 |
+
}
|
323 |
+
$title[$date_day] = $title[$date_day] . $list;
|
324 |
+
$ev_ids[$date_day] = $ev_ids[$date_day] . $rows[$i - 1]->id . '<br>';
|
325 |
+
}
|
326 |
+
else {
|
327 |
+
$array_days[] = $date_day;
|
328 |
+
$key = array_search($date_day, $array_days);
|
329 |
+
if ($rows[$i - 1]->text_for_date != "")
|
330 |
+
$array_days1[$key] = $date_day;
|
331 |
+
$title_num[$date_day] = 1;
|
332 |
+
$c = 1;
|
333 |
+
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
334 |
+
if ($rows[$i - 1]->time and $show_time != 0) {
|
335 |
+
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
336 |
+
}
|
337 |
+
else {
|
338 |
+
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
339 |
+
}
|
340 |
+
$title[$date_day] = $list;
|
341 |
+
$ev_ids[$date_day] = $rows[$i - 1]->id . '<br>';
|
342 |
+
}
|
343 |
+
}
|
344 |
+
if ($date_end_month > 0 and $date_year_month == $date_end_year_month and $date_end_year_month == $year_month)
|
345 |
+
for ($j = $date_day; $j <= $date_end_day; $j = $j + $repeat) {
|
346 |
+
if (in_array($j, $used)) {
|
347 |
+
continue;
|
348 |
+
}
|
349 |
+
else {
|
350 |
+
array_push($used, $j);
|
351 |
+
}
|
352 |
+
if (in_array($j, $array_days)) {
|
353 |
+
$key = array_search($j, $array_days);
|
354 |
+
$title_num[$j]++;
|
355 |
+
if ($rows[$i - 1]->text_for_date != "") {
|
356 |
+
$array_days1[$key] = $j;
|
357 |
+
}
|
358 |
+
$c = $title_num[$j];
|
359 |
+
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
360 |
+
if ($rows[$i - 1]->time and $show_time != 0) {
|
361 |
+
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
362 |
+
}
|
363 |
+
else {
|
364 |
+
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
365 |
+
}
|
366 |
+
$title[$j] = $title[$j] . $list;
|
367 |
+
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
368 |
+
}
|
369 |
+
else {
|
370 |
+
$array_days[] = $j;
|
371 |
+
$key = array_search($j, $array_days);
|
372 |
+
if ($rows[$i - 1]->text_for_date != "") {
|
373 |
+
$array_days1[$key] = $j;
|
374 |
+
}
|
375 |
+
$title_num[$j] = 1;
|
376 |
+
$c = 1;
|
377 |
+
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
378 |
+
if ($rows[$i - 1]->time and $show_time != 0) {
|
379 |
+
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
380 |
+
}
|
381 |
+
else {
|
382 |
+
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
383 |
+
}
|
384 |
+
$title[$j] = $list;
|
385 |
+
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
386 |
+
}
|
387 |
+
}
|
388 |
+
if ($date_end_month > 0 and $date_year_month < $date_end_year_month and $date_year_month == $year_month)
|
389 |
+
for ($j = $date_day; $j <= 31; $j = $j + $repeat) {
|
390 |
+
if (in_array($j, $used)) {
|
391 |
+
continue;
|
392 |
+
}
|
393 |
+
else {
|
394 |
+
array_push($used, $j);
|
395 |
+
}
|
396 |
+
if (in_array($j, $array_days)) {
|
397 |
+
$key = array_search($j, $array_days);
|
398 |
+
$title_num[$j]++;
|
399 |
+
if ($rows[$i - 1]->text_for_date != "") {
|
400 |
+
$array_days1[$key] = $j;
|
401 |
+
}
|
402 |
+
$c = $title_num[$j];
|
403 |
+
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
404 |
+
if ($rows[$i - 1]->time and $show_time != 0) {
|
405 |
+
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
406 |
+
}
|
407 |
+
else {
|
408 |
+
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
409 |
+
}
|
410 |
+
$title[$j] = $title[$j] . $list;
|
411 |
+
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
412 |
+
}
|
413 |
+
else {
|
414 |
+
$array_days[] = $j;
|
415 |
+
$key = array_search($j, $array_days);
|
416 |
+
if ($rows[$i - 1]->text_for_date != "") {
|
417 |
+
$array_days1[$key] = $j;
|
418 |
+
}
|
419 |
+
$title_num[$j] = 1;
|
420 |
+
$c = 1;
|
421 |
+
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
422 |
+
if ($rows[$i - 1]->time and $show_time != 0) {
|
423 |
+
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
424 |
+
}
|
425 |
+
else {
|
426 |
+
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
427 |
+
}
|
428 |
+
$title[$j] = $list;
|
429 |
+
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
430 |
+
}
|
431 |
+
}
|
432 |
+
if ($date_end_month > 0 and $date_year_month < $date_end_year_month and $date_end_year_month == $year_month)
|
433 |
+
for ($j = $date_day; $j <= $date_end_day; $j = $j + $repeat) {
|
434 |
+
if (in_array($j, $used)) {
|
435 |
+
continue;
|
436 |
+
}
|
437 |
+
else {
|
438 |
+
array_push($used, $j);
|
439 |
+
}
|
440 |
+
if (in_array($j, $array_days)) {
|
441 |
+
$key = array_search($j, $array_days);
|
442 |
+
$title_num[$j]++;
|
443 |
+
if ($rows[$i - 1]->text_for_date != "") {
|
444 |
+
$array_days1[$key] = $j;
|
445 |
+
}
|
446 |
+
$c = $title_num[$j];
|
447 |
+
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
448 |
+
if ($rows[$i - 1]->time and $show_time != 0) {
|
449 |
+
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
450 |
+
}
|
451 |
+
else {
|
452 |
+
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
453 |
+
}
|
454 |
+
$title[$j] = $title[$j] . $list;
|
455 |
+
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
456 |
+
}
|
457 |
+
else {
|
458 |
+
$array_days[] = $j;
|
459 |
+
$key = array_search($j, $array_days);
|
460 |
+
if ($rows[$i - 1]->text_for_date != "") {
|
461 |
+
$array_days1[$key] = $j;
|
462 |
+
}
|
463 |
+
$title_num[$j] = 1;
|
464 |
+
$c = 1;
|
465 |
+
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
466 |
+
if ($rows[$i - 1]->time and $show_time != 0) {
|
467 |
+
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
468 |
+
}
|
469 |
+
else {
|
470 |
+
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
471 |
+
}
|
472 |
+
$title[$j] = $list;
|
473 |
+
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
474 |
+
}
|
475 |
+
}
|
476 |
+
if ($date_end_month > 0 and $date_year_month < $date_end_year_month and $date_end_year_month > $year_month and $date_year_month < $year_month)
|
477 |
+
for ($j = $date_day; $j <= 31; $j = $j + $repeat) {
|
478 |
+
if (in_array($j, $used)) {
|
479 |
+
continue;
|
480 |
+
}
|
481 |
+
else {
|
482 |
+
array_push($used, $j);
|
483 |
+
}
|
484 |
+
if (in_array($j, $array_days)) {
|
485 |
+
$key = array_search($j, $array_days);
|
486 |
+
$title_num[$j]++;
|
487 |
+
if ($rows[$i - 1]->text_for_date != "")
|
488 |
+
$array_days1[$key] = $j;
|
489 |
+
$c = $title_num[$j];
|
490 |
+
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
491 |
+
if ($rows[$i - 1]->time and $show_time != 0) {
|
492 |
+
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
493 |
+
}
|
494 |
+
else {
|
495 |
+
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
496 |
+
}
|
497 |
+
$title[$j] = $title[$j] . $list;
|
498 |
+
$ev_ids[$j] = $ev_ids[$j] . $rows[$i - 1]->id . '<br>';
|
499 |
+
}
|
500 |
+
else {
|
501 |
+
$array_days[] = $j;
|
502 |
+
$key = array_search($j, $array_days);
|
503 |
+
if ($rows[$i - 1]->text_for_date != "") {
|
504 |
+
$array_days1[$key] = $j;
|
505 |
+
}
|
506 |
+
$title_num[$j] = 1;
|
507 |
+
$c = 1;
|
508 |
+
$list = '<p>' . (($show_numbers_for_events) ? '<b>' . $c . '.</b> ' : '');
|
509 |
+
if ($rows[$i - 1]->time and $show_time != 0) {
|
510 |
+
$list .= ' ' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
|
511 |
+
}
|
512 |
+
else {
|
513 |
+
$list .= ' ' . $rows[$i - 1]->title . '</p>';
|
514 |
+
}
|
515 |
+
$title[$j] = $list;
|
516 |
+
$ev_ids[$j] = $rows[$i - 1]->id . '<br>';
|
517 |
+
}
|
518 |
+
}
|
519 |
+
}
|
520 |
+
}
|
521 |
+
for ($i = 1; $i <= count($array_days) - 1; $i++) {
|
522 |
+
if (isset($array_days[$i])) {
|
523 |
+
if ($array_days[$i] > '00' && $array_days[$i] < '09' and substr($array_days[$i], 0, 1) == '0') {
|
524 |
+
$array_days[$i] = substr($array_days[$i], 1, 1);
|
525 |
+
}
|
526 |
+
}
|
527 |
+
}
|
528 |
+
$all_calendar_files['array_days'] = $array_days;
|
529 |
+
$all_calendar_files['title'] = $title;
|
530 |
+
$all_calendar_files['array_days1'] = $array_days1;
|
531 |
+
$all_calendar_files['calendar'] = $calendar;
|
532 |
+
$all_calendar_files['ev_ids'] = $ev_ids;
|
533 |
+
return array($all_calendar_files);
|
534 |
+
}
|
535 |
+
|
536 |
+
function php_getdays_for_three_months($calendar, $date, $months, $theme_id, $widget) {
|
537 |
+
global $wpdb;
|
538 |
+
$year = substr($date, 0, 4);
|
539 |
+
$month = substr($date, 5, 2);
|
540 |
+
$months_array = explode(',', $months);
|
541 |
+
if ($widget) {
|
542 |
+
$show_time = 0;
|
543 |
+
}
|
544 |
+
else {
|
545 |
+
$theme = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=%d', $theme_id));
|
546 |
+
$show_time = $theme->show_time;
|
547 |
+
}
|
548 |
+
|
549 |
+
if(isset($_GET['cat_id']))
|
550 |
+
$cat_id = $_GET['cat_id'];
|
551 |
+
else $cat_id = "";
|
552 |
+
|
553 |
+
if(isset($_GET['cat_ids']))
|
554 |
+
$cat_ids = $_GET['cat_ids'];
|
555 |
+
else $cat_ids = "";
|
556 |
+
|
557 |
+
|
558 |
+
if($cat_ids=='')
|
559 |
+
$cat_ids .= $cat_id.',';
|
560 |
+
else
|
561 |
+
$cat_ids .= ','.$cat_id.',';
|
562 |
+
|
563 |
+
|
564 |
+
|
565 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
566 |
+
|
567 |
+
$cat_ids_array = explode(',',$cat_ids);
|
568 |
+
|
569 |
+
|
570 |
+
if($cat_id!='')
|
571 |
+
{
|
572 |
+
|
573 |
+
if(getelementcountinarray($cat_ids_array,$cat_id )%2==0)
|
574 |
+
{
|
575 |
+
$index_in_line = getelementindexinarray($cat_ids_array, $cat_id);
|
576 |
+
$index_array = explode(',' , $index_in_line);
|
577 |
+
array_pop ($index_array);
|
578 |
+
for($j=0; $j<count($index_array); $j++)
|
579 |
+
unset($cat_ids_array[$index_array[$j]]);
|
580 |
+
$cat_ids = implode(',',$cat_ids_array);
|
581 |
+
}
|
582 |
+
}
|
583 |
+
else
|
584 |
+
$cat_ids = substr($cat_ids, 0,-1);
|
585 |
+
|
586 |
+
$row = $wpdb->get_row($wpdb->prepare ("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where published=1 and id=%d",$calendar));
|
587 |
+
|
588 |
+
if($row->time_format==0)
|
589 |
+
{
|
590 |
+
$order_by = "ORDER BY " . $wpdb->prefix . "spidercalendar_event.time ASC";
|
591 |
+
}
|
592 |
+
else{
|
593 |
+
$order_by = " ORDER BY STR_TO_DATE( SUBSTRING( time, 1, 7 ) , '%h:%i%p' )";
|
594 |
+
}
|
595 |
+
|
596 |
+
if($cat_ids!=''){
|
597 |
+
$rows = $wpdb->get_results($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 (%s) 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 ".$order_by." ",$cat_ids,substr( $date,0,7).'-01',substr( $date,0,7)."%", substr( $date,0,7).'-01',substr( $date,0,7)."%",$calendar));
|
598 |
+
|
599 |
+
}
|
600 |
+
else{
|
601 |
+
$rows = $wpdb->get_results($wpdb->prepare("SELECT * from " . $wpdb->prefix . "spidercalendar_event where published=1 and ((date_end>=%s) or (date_end=%s)) and calendar=%d", "" . substr($date, 0, 7) . "-01", "0000-00-00", $calendar)." ".$order_by." ");
|
602 |
+
}
|
603 |
+
|
604 |
+
|
605 |
+
|
606 |
+
|
607 |
+
|
608 |
+
$all_id_array = array();
|
609 |
+
$all_array_days = array();
|
610 |
+
$all_array_days1 = array();
|
611 |
+
$all_title = array();
|
612 |
+
$all_ev_ids = array();
|
613 |
+
$s = count($rows);
|
614 |
+
foreach ($months_array as $month) {
|
615 |
+
$id_array = array();
|
616 |
+
$array_days = array();
|
617 |
+
$array_days1 = array();
|
618 |
+
$title = array();
|
619 |
+
$ev_ids = array();
|
620 |
+
for ($i = 1; $i <= $s; $i++) {
|
621 |
+
if ($rows[$i - 1]->repeat_method != 'no_repeat' and $rows[$i - 1]->date_end == '0000-00-00')
|
622 |
+
$d_end = ((int)substr($rows[$i - 1]->date, 0, 4) + 40) . substr($rows[$i - 1]->date, 4, 6);
|
623 |
+
else
|
624 |
+
$d_end = $rows[$i - 1]->date_end;
|
625 |
+
$date_month = (int)substr($rows[$i - 1]->date, 5, 2);
|
626 |
+
$date_end_month = (int)substr($d_end, 5, 2);
|
627 |
+
$date_day = (int)substr($rows[$i - 1]->date, 8, 2);
|
628 |
+
$date_end_day = (int)substr($d_end, 8, 2);
|
629 |
+
$date_year_month = (int)(substr($rows[$i - 1]->date, 0, 4) . substr($rows[$i - 1]->date, 5, 2));
|
630 |
+
$date_end_year_month = (int)(substr($d_end, 0, 4) . substr($d_end, 5, 2));
|
631 |
+
$year_month = (int)($year . $month);
|
632 |
+
$repeat = $rows[$i - 1]->repeat;
|
633 |
+
if ($repeat == "") {
|
634 |
+
$repeat = 1;
|
635 |
+
}
|
636 |
+
$start_date = $rows[$i - 1]->date;
|
637 |
+
$weekly = $rows[$i - 1]->week;
|
638 |
+
$weekly_array = explode(',', $weekly);
|
639 |
+
$date_days = array();
|
640 |
+
$weekdays_start = array();
|
641 |
+
$weekdays = array();
|
642 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
643 |
+
//////////////////////// NO Repeat /////////////////////////////////////////////////////////////////////////////////////////////
|
644 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
645 |
+
if ($rows[$i - 1]->repeat_method == 'no_repeat') {
|
646 |
+
$date_days[] = $date_day;
|
647 |
+
}
|
648 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
649 |
+
//////////////////////// Repeat Daily /////////////////////////////////////////////////////////////////////////////////////////////
|
650 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
651 |
+
if ($rows[$i - 1]->repeat_method == 'daily') {
|
652 |
+
$t = php_daysDifference($rows[$i - 1]->date, $d_end);
|
653 |
+
for ($k = 1; $k <= $t / $repeat; $k++) {
|
654 |
+
$next_date = php_GetNextDate($start_date, $repeat);
|
655 |
+
$next_date_array = explode('/', $next_date);
|
656 |
+
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year) {
|
657 |
+
$date_days[0] = $date_day;
|
658 |
+
}
|
659 |
+
if ((int)$month == $next_date_array[0] && (int)$year == $next_date_array[2]) {
|
660 |
+
$date_days[] = $next_date_array[1];
|
661 |
+
}
|
662 |
+
$start_date = date("Y-m-d", mktime(0, 0, 0, $next_date_array[0], $next_date_array[1], $next_date_array[2]));
|
663 |
+
}
|
664 |
+
}
|
665 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
666 |
+
//////////////////////// Repeat Weekly ///////////////////////////////////////////////////////////////////////////////////////////
|
667 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
668 |
+
if ($rows[$i - 1]->repeat_method == 'weekly') {
|
669 |
+
for ($j = 0; $j <= 6; $j++) {
|
670 |
+
if (in_array(date("D", mktime(0, 0, 0, $date_month, $date_day + $j, substr($rows[$i - 1]->date, 0, 4))), $weekly_array)) {
|
671 |
+
$weekdays_start[] = $date_day + $j;
|
672 |
+
}
|
673 |
+
}
|
674 |
+
for ($p = 0; $p < count($weekly_array) - 1; $p++) {
|
675 |
+
$start_date = substr($rows[$i - 1]->date, 0, 8) . $weekdays_start[$p];
|
676 |
+
$t = php_daysDifference($rows[$i - 1]->date, $d_end);
|
677 |
+
$q = php_daysDifference($rows[$i - 1]->date, $start_date);
|
678 |
+
$r = 0;
|
679 |
+
if (($t / ($repeat * 7) - 1) > 1) {
|
680 |
+
for ($k = 1; $k < $t / ($repeat * 7) - 1; $k++) {
|
681 |
+
$start_date_array[] = $start_date;
|
682 |
+
$next_date = php_GetNextDate($start_date, $repeat * 7);
|
683 |
+
$next_date_array = explode('/', $next_date);
|
684 |
+
if ((int)$month == $date_month && (int)substr($date_year_month, 0, 4) == (int)$year)
|
685 |
+
$date_days[0] = $weekdays_start[$p];
|
686 |
+
if ((int)$month == $next_date_array[0] && (int)$year == $next_date_array[2]) {
|
687 |
+
if ((int)$year > (int)substr($date_year_month, 0, 4)) {
|
688 |
+
$weekdays[] = $next_date_array[1];
|
689 |
+
}
|
690 |
+
else {
|
691 |
+
$weekdays[] = $next_date_array[1];
|
692 |
+
}
|
693 |
+
}
|
694 |
+
$start_date = date("Y-m-d", mktime(0, 0, 0, $next_date_array[0], $next_date_array[1], $next_date_array[2]));
|
695 |
+
if ($next_date_array[2] > (int)substr($d_end, 0, 4)) {
|
696 |
+
break;
|
697 |
+
}
|
698 |
+
}
|
699 |
+
$date_days = array_merge($weekdays, $date_days);
|
700 |
+
}
|
701 |
+
else {
|
702 |
+
if ($t >= $q) {
|
703 |
+
$date_days[] = $weekdays_start[$p];
|
704 |
+
}
|
705 |
+
}
|
706 |
+
}
|
707 |
+
$repeat = $repeat * 7;
|
708 |
+
}
|
709 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
710 |
+
//////////////////////// Repeat Monthly ///////////////////////////////////////////////////////////////////////////////////////////
|
711 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
712 |
+
if ($rows[$i - 1]->repeat_method == 'monthly') {
|
713 |
+
$month_days = date('t', mktime(0, 0, 0, $month, $date_day, $year));
|
714 |
+
if ($date_month < (int)$month or (int)substr($date_year_month, 0, 4) < $year) {
|
715 |
+
$date_day = 1;
|
716 |
+
}
|
717 |
+
if ($year > (int)substr($date_year_month, 0, 4)) {
|
718 |
+
$date_year_month = $year . '00';
|
719 |
+
}
|
720 |
+
$p = (int)substr($date_year_month, 4, 2);
|
721 |
+
if ((int)substr($date_year_month, 0, 4) != (int)substr($date_end_year_month, 0, 4)) {
|
722 |
+
$end = (int)substr($date_end_year_month, 4, 2) + 12;
|
723 |
+
}
|
724 |
+
else {
|
725 |
+
$end = (int)substr($date_end_year_month, 4, 2);
|
726 |
+
}
|
727 |
+
for ($k = 1; $k <= $end; $k++) {
|
728 |
+
if ((int)$month == $p and $rows[$i - 1]->month_type == 1) {
|
729 |
+
$date_days[0] = $rows[$i - 1]->month;
|
730 |
+
}
|
731 |
+
if ($p == (int)$month and $rows[$i - 1]->month_type == 2) {
|
732 |
+
if ($rows[$i - 1]->monthly_list != 'last') {
|
733 |
+
for ($j = $rows[$i - 1]->monthly_list; $j < $rows[$i - 1]->monthly_list + 7; $j++) {
|
734 |
+
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
735 |
+
if ($j >= $date_day) {
|
736 |
+
$date_days[0] = $j;
|
737 |
+
}
|
738 |
+
}
|
739 |
+
}
|
740 |
+
}
|
741 |
+
else {
|
742 |
+
for ($j = 1; $j < $month_days; $j++) {
|
743 |
+
if (date("D", mktime(0, 0, 0, $month, $j, $year)) == $rows[$i - 1]->month_week) {
|
744 |
+
if ($j >= $date_day) {
|
745 |
+
$date_days[0] = $j;
|
746 |
+
}
|
747 |
+
}
|
748 |
+
}
|
749 |
+
}
|
750 |
+
}
|
751 |
+
if ($year > (int)substr($date_year_month, 0, 4)) {
|
752 |
+
$p = 1;
|
753 |
+
}
|
754 |
+
$p = $p + $repeat;
|
755 |
+
}
|
756 |
+
$repeat = 32;
|
757 |
+
}
|
758 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
759 |
+
//////////////////////// Repeat Yearly ///////////////////////////////////////////////////////////////////////////////////////////
|
760 |
+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
761 |
+
if ($rows[$i - 1]->repeat_method == 'yearly') {
|
762 |
+
$month_days = date('t', mktime(0, 0, 0, $month, $date_day, $year));
|
763 |
+
$end = substr($date_end_year_month, 0, 4) - substr($date_year_month, 0, 4) + 1;
|
764 |
+
if (substr($date_year_month, 0, 4) < $year) {
|
765 |
+
$date_day = 1;
|
766 |
+
}
|
767 |
+
for ($k = 0; $k <= $end; $k += $repeat) {
|
768 |
+
if ((int)$month == $rows[$i - 1]->year_month and $rows[$i - 1]->month_type == 1 and $year == substr($date_year_month, 0, 4) + $k) {
|
769 |
+
$date_days[0] = $rows[$i - 1]->month;
|
770 |
+
}
|
771 |
+
}
|
772 |
+
for ($k = 0; $k <= $end; $k += $repeat) {
|
773 |
+
if ((int)$month == $rows[$i - 1]->year_month and $rows[$i - 1]->month_type == 2 and $year == substr($date_year_month, 0, 4) + $k) {
|
774 |
+
if ($rows[$i - 1]->monthly_list != 'last') {
|
775 |
+
for ($j = $rows[$i - 1]->monthly_list; $j < $rows[$i - 1]->monthly_list + 7; $j++) {
|
776 |
+
if (date("D", mktime(0, 0, 0, $month, $j, $ye
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|