Calendar by WD – Responsive Event Calendar - Version 1.4.10

Version Description

bug fixed

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 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 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 "%' . $search_tag . '%"';
49
- }
50
- else {
51
- $where = '';
52
- }
53
- // get the total number of records
54
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_theme" . $where;
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 " . $limit . ",20";
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
- $top_height = ((isset($_POST["top_height"])) ? esc_html($_POST["top_height"]) : '');
72
- $bg_top = ((isset($_POST["bg_top"])) ? esc_html($_POST["bg_top"]) : '');
73
- $year_font_size = ((isset($_POST["year_font_size"])) ? esc_html($_POST["year_font_size"]) : '');
74
- $text_color_year = ((isset($_POST["text_color_year"])) ? esc_html($_POST["text_color_year"]) : '');
75
- $arrow_color_year = ((isset($_POST["arrow_color_year"])) ? esc_html($_POST["arrow_color_year"]) : '');
76
- $month_type = ((isset($_POST["month_type"])) ? esc_html($_POST["month_type"]) : '');
77
- $month_font_size = ((isset($_POST["month_font_size"])) ? esc_html($_POST["month_font_size"]) : '');
78
- $text_color_month = ((isset($_POST["text_color_month"])) ? esc_html($_POST["text_color_month"]) : '');
79
- $arrow_color_month = ((isset($_POST["arrow_color_month"])) ? esc_html($_POST["arrow_color_month"]) : '');
80
- $next_month_text_color = ((isset($_POST["next_month_text_color"])) ? esc_html($_POST["next_month_text_color"]) : '');
81
- $next_month_font_size = ((isset($_POST["next_month_font_size"])) ? esc_html($_POST["next_month_font_size"]) : '');
82
- $next_month_arrow_color = ((isset($_POST["next_month_arrow_color"])) ? esc_html($_POST["next_month_arrow_color"]) : '');
83
- $prev_month_text_color = ((isset($_POST["prev_month_text_color"])) ? esc_html($_POST["prev_month_text_color"]) : '');
84
- $prev_month_font_size = ((isset($_POST["prev_month_font_size"])) ? esc_html($_POST["prev_month_font_size"]) : '');
85
- $prev_month_arrow_color = ((isset($_POST["prev_month_arrow_color"])) ? esc_html($_POST["prev_month_arrow_color"]) : '');
86
- $arrow_size = ((isset($_POST["arrow_size"])) ? esc_html($_POST["arrow_size"]) : '');
87
- $text_color_week_days = ((isset($_POST["text_color_week_days"])) ? esc_html($_POST["text_color_week_days"]) : '');
88
- $week_days_cell_height = ((isset($_POST["week_days_cell_height"])) ? esc_html($_POST["week_days_cell_height"]) : '');
89
- $weekdays_bg_color = ((isset($_POST["weekdays_bg_color"])) ? esc_html($_POST["weekdays_bg_color"]) : '');
90
- $weekday_sunday_bg_color = ((isset($_POST["weekday_sunday_bg_color"])) ? esc_html($_POST["weekday_sunday_bg_color"]) : '');
91
- $weekdays_font_size = ((isset($_POST["weekdays_font_size"])) ? esc_html($_POST["weekdays_font_size"]) : '');
92
- $bg_bottom = ((isset($_POST["bg_bottom"])) ? esc_html($_POST["bg_bottom"]) : '');
93
- $cell_height = ((isset($_POST["cell_height"])) ? esc_html($_POST["cell_height"]) : '');
94
- $text_color_other_months = ((isset($_POST["text_color_other_months"])) ? esc_html($_POST["text_color_other_months"]) : '');
95
- $bg_color_other_months = ((isset($_POST["bg_color_other_months"])) ? esc_html($_POST["bg_color_other_months"]) : '');
96
- $text_color_this_month_unevented = ((isset($_POST["text_color_this_month_unevented"])) ? esc_html($_POST["text_color_this_month_unevented"]) : '');
97
- $text_color_this_month_evented = ((isset($_POST["text_color_this_month_evented"])) ? esc_html($_POST["text_color_this_month_evented"]) : '');
98
- $bg_color_this_month_evented = ((isset($_POST["bg_color_this_month_evented"])) ? esc_html($_POST["bg_color_this_month_evented"]) : '');
99
- $event_title_color = ((isset($_POST["event_title_color"])) ? esc_html($_POST["event_title_color"]) : '');
100
- $current_day_border_color = ((isset($_POST["current_day_border_color"])) ? esc_html($_POST["current_day_border_color"]) : '');
101
- $cell_border_color = ((isset($_POST["cell_border_color"])) ? esc_html($_POST["cell_border_color"]) : '');
102
- $text_color_sun_days = ((isset($_POST["text_color_sun_days"])) ? esc_html($_POST["text_color_sun_days"]) : '');
103
- $sundays_bg_color = ((isset($_POST["sundays_bg_color"])) ? esc_html($_POST["sundays_bg_color"]) : '');
104
- $sundays_font_size = ((isset($_POST["sundays_font_size"])) ? esc_html($_POST["sundays_font_size"]) : '');
105
- $other_days_font_size = ((isset($_POST["other_days_font_size"])) ? esc_html($_POST["other_days_font_size"]) : '');
106
- $show_time = ((isset($_POST["show_time"])) ? esc_html($_POST["show_time"]) : '');
107
- $show_event = ((isset($_POST["show_event"])) ? esc_html($_POST["show_event"]) : '');
108
- $date_format = ((isset($_POST["date_format"])) ? esc_html($_POST["date_format"]) : '');
109
- $title_color = ((isset($_POST["title_color"])) ? esc_html($_POST["title_color"]) : '');
110
- $title_font_size = ((isset($_POST["title_font_size"])) ? esc_html($_POST["title_font_size"]) : '');
111
- $title_font = ((isset($_POST["title_font"])) ? esc_html($_POST["title_font"]) : '');
112
- $title_style = ((isset($_POST["title_style"])) ? esc_html($_POST["title_style"]) : '');
113
- $date_color = ((isset($_POST["date_color"])) ? esc_html($_POST["date_color"]) : '');
114
- $date_size = ((isset($_POST["date_size"])) ? esc_html($_POST["date_size"]) : '');
115
- $date_font = ((isset($_POST["date_font"])) ? esc_html($_POST["date_font"]) : '');
116
- $date_style = ((isset($_POST["date_style"])) ? esc_html($_POST["date_style"]) : '');
117
- $next_prev_event_bgcolor = ((isset($_POST["next_prev_event_bgcolor"])) ? esc_html($_POST["next_prev_event_bgcolor"]) : '');
118
- $next_prev_event_arrowcolor = ((isset($_POST["next_prev_event_arrowcolor"])) ? esc_html($_POST["next_prev_event_arrowcolor"]) : '');
119
- $show_event_bgcolor = ((isset($_POST["show_event_bgcolor"])) ? esc_html($_POST["show_event_bgcolor"]) : '');
120
- $popup_width = ((isset($_POST["popup_width"])) ? esc_html($_POST["popup_width"]) : '');
121
- $popup_height = ((isset($_POST["popup_height"])) ? esc_html($_POST["popup_height"]) : '');
122
- $number_of_shown_evetns = ((isset($_POST["number_of_shown_evetns"])) ? esc_html($_POST["number_of_shown_evetns"]) : '');
123
- $show_repeat = ((isset($_POST["show_repeat"])) ? esc_html($_POST["show_repeat"]) : '');
124
- $day_start = ((isset($_POST["show_event"])) ? esc_html($_POST["show_event"]) : '');
125
- $views_tabs_font_size = ((isset($_POST["views_tabs_font_size"])) ? esc_html($_POST["views_tabs_font_size"]) : '');
126
- $views_tabs_text_color = ((isset($_POST["views_tabs_text_color"])) ? esc_html($_POST["views_tabs_text_color"]) : '');
127
- $views_tabs_bg_color = ((isset($_POST["views_tabs_bg_color"])) ? esc_html($_POST["views_tabs_bg_color"]) : '');
128
- $day_month_font_color = ((isset($_POST["day_month_font_color"])) ? esc_html($_POST["day_month_font_color"]) : '');
129
- $week_font_color = ((isset($_POST["week_font_color"])) ? esc_html($_POST["week_font_color"]) : '');
130
- $day_month_font_size = ((isset($_POST["day_month_font_size"])) ? esc_html($_POST["day_month_font_size"]) : '');
131
- $week_font_size = ((isset($_POST["week_font_size"])) ? esc_html($_POST["week_font_size"]) : '');
132
- $ev_title_bg_color = ((isset($_POST["ev_title_bg_color"])) ? esc_html($_POST["ev_title_bg_color"]) : '');
133
- $date_height = ((isset($_POST["date_height"])) ? esc_html($_POST["date_height"]) : '');
134
- $event_table_height = ((isset($_POST["event_table_height"])) ? esc_html($_POST["event_table_height"]) : '');
135
- $event_num_font_size = ((isset($_POST["event_num_font_size"])) ? esc_html($_POST["event_num_font_size"]) : '');
136
- $date_font_size = ((isset($_POST["date_font_size"])) ? esc_html($_POST["date_font_size"]) : '');
137
- $event_num_color = ((isset($_POST["event_num_color"])) ? esc_html($_POST["event_num_color"]) : '');
138
- $event_num_bg_color2 = ((isset($_POST["event_num_bg_color2"])) ? esc_html($_POST["event_num_bg_color2"]) : '');
139
- $event_num_bg_color1 = ((isset($_POST["event_num_bg_color1"])) ? esc_html($_POST["event_num_bg_color1"]) : '');
140
- $event_bg_color2 = ((isset($_POST["event_bg_color2"])) ? esc_html($_POST["event_bg_color2"]) : '');
141
- $event_bg_color1 = ((isset($_POST["event_bg_color1"])) ? esc_html($_POST["event_bg_color1"]) : '');
142
- $date_bg_color = ((isset($_POST["date_bg_color"])) ? esc_html($_POST["date_bg_color"]) : '');
143
- if ($id === -1) {
144
- $save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_theme', array(
145
- 'id' => NULL,
146
- 'title' => $title,
147
- 'width' => $width,
148
- 'week_start_day' => $week_start_day,
149
- 'border_color' => $border_color,
150
- 'border_radius' => $border_radius,
151
- 'border_width' => $border_width,
152
- 'top_height' => $top_height,
153
- 'bg_top' => $bg_top,
154
- 'year_font_size' => $year_font_size,
155
- 'text_color_year' => $text_color_year,
156
- 'arrow_color_year' => $arrow_color_year,
157
- 'month_type' => $month_type,
158
- 'month_font_size' => $month_font_size,
159
- 'text_color_month' => $text_color_month,
160
- 'arrow_color_month' => $arrow_color_month,
161
- 'next_month_text_color' => $next_month_text_color,
162
- 'next_month_font_size' => $next_month_font_size,
163
- 'next_month_arrow_color' => $next_month_arrow_color,
164
- 'prev_month_text_color' => $prev_month_text_color,
165
- 'prev_month_font_size' => $prev_month_font_size,
166
- 'prev_month_arrow_color' => $prev_month_arrow_color,
167
- 'arrow_size' => $arrow_size,
168
- 'text_color_week_days' => $text_color_week_days,
169
- 'week_days_cell_height' => $week_days_cell_height,
170
- 'weekdays_bg_color' => $weekdays_bg_color,
171
- 'weekday_sunday_bg_color' => $weekday_sunday_bg_color,
172
- 'weekdays_font_size' => $weekdays_font_size,
173
- 'bg_bottom' => $bg_bottom,
174
- 'cell_height' => $cell_height,
175
- 'text_color_other_months' => $text_color_other_months,
176
- 'bg_color_other_months' => $bg_color_other_months,
177
- 'text_color_this_month_unevented' => $text_color_this_month_unevented,
178
- 'text_color_this_month_evented' => $text_color_this_month_evented,
179
- 'bg_color_this_month_evented' => $bg_color_this_month_evented,
180
- 'event_title_color' => $event_title_color,
181
- 'current_day_border_color' => $current_day_border_color,
182
- 'cell_border_color' => $cell_border_color,
183
- 'text_color_sun_days' => $text_color_sun_days,
184
- 'sundays_bg_color' => $sundays_bg_color,
185
- 'sundays_font_size' => $sundays_font_size,
186
- 'other_days_font_size' => $other_days_font_size,
187
- 'show_time' => $show_time,
188
- 'date_format' => $date_format,
189
- 'title_color' => $title_color,
190
- 'title_font_size' => $title_font_size,
191
- 'title_font' => $title_font,
192
- 'title_style' => $title_style,
193
- 'date_color' => $date_color,
194
- 'date_size' => $date_size,
195
- 'date_font' => $date_font,
196
- 'date_style' => $date_style,
197
- 'next_prev_event_bgcolor' => $next_prev_event_bgcolor,
198
- 'next_prev_event_arrowcolor' => $next_prev_event_arrowcolor,
199
- 'show_event_bgcolor' => $show_event_bgcolor,
200
- 'popup_width' => $popup_width,
201
- 'popup_height' => $popup_height,
202
- 'number_of_shown_evetns' => $number_of_shown_evetns,
203
- 'show_repeat' => $show_repeat,
204
- 'day_start' => $show_event,
205
- 'views_tabs_font_size' => $views_tabs_font_size,
206
- 'views_tabs_text_color' => $views_tabs_text_color,
207
- 'views_tabs_bg_color' => $views_tabs_bg_color,
208
- 'day_month_font_color' => $day_month_font_color,
209
- 'week_font_color' => $week_font_color,
210
- 'day_month_font_size' => $day_month_font_size,
211
- 'week_font_size' => $week_font_size,
212
- 'ev_title_bg_color' => $ev_title_bg_color,
213
- 'date_height' => $date_height,
214
- 'event_table_height' => $event_table_height,
215
- 'event_num_font_size' => $event_num_font_size,
216
- 'date_font_size' => $date_font_size,
217
- 'event_num_color' => $event_num_color,
218
- 'event_num_bg_color2' => $event_num_bg_color2,
219
- 'event_num_bg_color1' => $event_num_bg_color1,
220
- 'event_bg_color2' => $event_bg_color2,
221
- 'event_bg_color1' => $event_bg_color1,
222
- 'date_bg_color' => $date_bg_color,
223
- 'day_start' => $show_event,
224
- ), array(
225
- '%d',
226
- '%s',
227
- '%s',
228
- '%s',
229
- '%s',
230
- '%s',
231
- '%s',
232
- '%s',
233
- '%s',
234
- '%s',
235
- '%s',
236
- '%s',
237
- '%s',
238
- '%s',
239
- '%s',
240
- '%s',
241
- '%s',
242
- '%s',
243
- '%s',
244
- '%s',
245
- '%s',
246
- '%s',
247
- '%s',
248
- '%s',
249
- '%s',
250
- '%s',
251
- '%s',
252
- '%s',
253
- '%s',
254
- '%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
- '%d',
283
- '%d',
284
- '%s',
285
- '%s',
286
- '%s',
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
- '%d'
304
- ));
305
- }
306
- else {
307
- $save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_theme', array(
308
- 'title' => $title,
309
- 'width' => $width,
310
- 'week_start_day' => $week_start_day,
311
- 'border_color' => $border_color,
312
- 'border_radius' => $border_radius,
313
- 'border_width' => $border_width,
314
- 'top_height' => $top_height,
315
- 'bg_top' => $bg_top,
316
- 'year_font_size' => $year_font_size,
317
- 'text_color_year' => $text_color_year,
318
- 'arrow_color_year' => $arrow_color_year,
319
- 'month_type' => $month_type,
320
- 'month_font_size' => $month_font_size,
321
- 'text_color_month' => $text_color_month,
322
- 'arrow_color_month' => $arrow_color_month,
323
- 'next_month_text_color' => $next_month_text_color,
324
- 'next_month_font_size' => $next_month_font_size,
325
- 'next_month_arrow_color' => $next_month_arrow_color,
326
- 'prev_month_text_color' => $prev_month_text_color,
327
- 'prev_month_font_size' => $prev_month_font_size,
328
- 'prev_month_arrow_color' => $prev_month_arrow_color,
329
- 'arrow_size' => $arrow_size,
330
- 'text_color_week_days' => $text_color_week_days,
331
- 'week_days_cell_height' => $week_days_cell_height,
332
- 'weekdays_bg_color' => $weekdays_bg_color,
333
- 'weekday_sunday_bg_color' => $weekday_sunday_bg_color,
334
- 'weekdays_font_size' => $weekdays_font_size,
335
- 'bg_bottom' => $bg_bottom,
336
- 'cell_height' => $cell_height,
337
- 'text_color_other_months' => $text_color_other_months,
338
- 'bg_color_other_months' => $bg_color_other_months,
339
- 'text_color_this_month_unevented' => $text_color_this_month_unevented,
340
- 'text_color_this_month_evented' => $text_color_this_month_evented,
341
- 'bg_color_this_month_evented' => $bg_color_this_month_evented,
342
- 'event_title_color' => $event_title_color,
343
- 'current_day_border_color' => $current_day_border_color,
344
- 'cell_border_color' => $cell_border_color,
345
- 'text_color_sun_days' => $text_color_sun_days,
346
- 'sundays_bg_color' => $sundays_bg_color,
347
- 'sundays_font_size' => $sundays_font_size,
348
- 'other_days_font_size' => $other_days_font_size,
349
- 'show_time' => $show_time,
350
- 'date_format' => $date_format,
351
- 'title_color' => $title_color,
352
- 'title_font_size' => $title_font_size,
353
- 'title_font' => $title_font,
354
- 'title_style' => $title_style,
355
- 'date_color' => $date_color,
356
- 'date_size' => $date_size,
357
- 'date_font' => $date_font,
358
- 'date_style' => $date_style,
359
- 'next_prev_event_bgcolor' => $next_prev_event_bgcolor,
360
- 'next_prev_event_arrowcolor' => $next_prev_event_arrowcolor,
361
- 'show_event_bgcolor' => $show_event_bgcolor,
362
- 'popup_width' => $popup_width,
363
- 'popup_height' => $popup_height,
364
- 'number_of_shown_evetns' => $number_of_shown_evetns,
365
- 'show_repeat' => $show_repeat,
366
- 'day_start' => $show_event,
367
- 'views_tabs_font_size' => $views_tabs_font_size,
368
- 'views_tabs_text_color' => $views_tabs_text_color,
369
- 'views_tabs_bg_color' => $views_tabs_bg_color,
370
- 'day_month_font_color' => $day_month_font_color,
371
- 'week_font_color' => $week_font_color,
372
- 'day_month_font_size' => $day_month_font_size,
373
- 'week_font_size' => $week_font_size,
374
- 'ev_title_bg_color' => $ev_title_bg_color,
375
- 'date_height' => $date_height,
376
- 'event_table_height' => $event_table_height,
377
- 'event_num_font_size' => $event_num_font_size,
378
- 'date_font_size' => $date_font_size,
379
- 'event_num_color' => $event_num_color,
380
- 'event_num_bg_color2' => $event_num_bg_color2,
381
- 'event_num_bg_color1' => $event_num_bg_color1,
382
- 'event_bg_color2' => $event_bg_color2,
383
- 'event_bg_color1' => $event_bg_color1,
384
- 'date_bg_color' => $date_bg_color,
385
- 'day_start' => $show_event,
386
- ), array('id' => $id), array(
387
- '%s',
388
- '%s',
389
- '%s',
390
- '%s',
391
- '%s',
392
- '%s',
393
- '%s',
394
- '%s',
395
- '%s',
396
- '%s',
397
- '%s',
398
- '%s',
399
- '%s',
400
- '%s',
401
- '%s',
402
- '%s',
403
- '%s',
404
- '%s',
405
- '%s',
406
- '%s',
407
- '%s',
408
- '%s',
409
- '%s',
410
- '%s',
411
- '%s',
412
- '%s',
413
- '%s',
414
- '%s',
415
- '%s',
416
- '%s',
417
- '%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
- '%d',
444
- '%d',
445
- '%s',
446
- '%s',
447
- '%s',
448
- '%s',
449
- '%s',
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
- '%d',
465
- ), array('%d'));
466
- }
467
- if ($save_or_no === FALSE) {
468
- ?>
469
- <div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
470
- <?php
471
- return FALSE;
472
- }
473
- else {
474
- ?>
475
- <div class="updated"><p><strong>Theme Saved.</strong></p></div>
476
- <?php
477
- return TRUE;
478
- }
479
- }
480
-
481
- function edit_theme_calendar($id) {
482
- global $wpdb;
483
- if ($id == 0) {
484
- $row = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=1');
485
- }
486
- else {
487
- $row = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_theme WHERE id=' . $id);
488
- }
489
- html_edit_theme_calendar($row, $id);
490
- }
491
-
492
- function remove_theme_calendar($id) {
493
- if ($id > 0 && $id < 18) {
494
- ?>
495
- <div id="message" class="error"><p>You can't delete deafult theme.</p></div>
496
- <?php
497
- return FALSE;
498
- }
499
- global $wpdb;
500
- $sql_remove_tag = "DELETE FROM " . $wpdb->prefix . "spidercalendar_theme WHERE id='" . $id . "'";
501
- if (!$wpdb->query($sql_remove_tag)) {
502
- ?>
503
- <div id="message" class="error"><p>Spider Calendar Theme Not Deleted</p></div>
504
- <?php
505
- }
506
- else {
507
- ?>
508
- <div class="updated"><p><strong>Item Deleted.</strong></p></div>
509
- <?php
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.9
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" 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&nbsp;&nbsp;&nbsp;&nbsp;
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&nbsp;&nbsp;&nbsp;&nbsp;
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&nbsp;&nbsp;&nbsp;&nbsp;
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&nbsp;&nbsp;&nbsp;&nbsp;
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("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE id=".$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&amp;dir=ltr&amp;load=admin-bar,wp-admin&amp;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&amp;dir=ltr&amp;load=global,wp-admin&amp;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;">&nbsp;</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&nbsp;&nbsp;&nbsp;&nbsp;
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("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id='" . $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">&nbsp;-&nbsp;</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">&nbsp;-&nbsp;</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("SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar where id=".$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">&nbsp;-&nbsp;</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">&nbsp;-&nbsp;</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 } ?>
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&nbsp;&nbsp;&nbsp;&nbsp;
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&nbsp;&nbsp;&nbsp;&nbsp;
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&nbsp;&nbsp;&nbsp;&nbsp;
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&nbsp;&nbsp;&nbsp;&nbsp;
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&amp;dir=ltr&amp;load=admin-bar,wp-admin&amp;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&amp;dir=ltr&amp;load=global,wp-admin&amp;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;">&nbsp;</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&nbsp;&nbsp;&nbsp;&nbsp;
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">&nbsp;-&nbsp;</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">&nbsp;-&nbsp;</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">&nbsp;-&nbsp;</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">&nbsp;-&nbsp;</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 if (function_exists('current_user_can')) {
2
- if (!current_user_can('manage_options')) {
3
- die('Access Denied');
4
- }
5
- }
6
-
7
- function add_spider_calendar() {
8
- html_add_spider_calendar();
9
- }
10
-
11
- function spider_upcoming(){
12
- if(isset($_GET['upcalendar_id']))
13
- $calendar_id=(int)$_GET['upcalendar_id'];
14
- else $calendar_id="0";
15
-
16
- global $wpdb;
17
- $order = " ORDER BY title ASC";
18
- $sort["default_style"] = "manage-column column-autor sortable desc";
19
- $sort["sortid_by"] = "title";
20
- $sort["custom_style"] = "manage-column column-title sorted asc";
21
- $sort["1_or_2"] = "2";
22
- if (isset($_POST['page_number'])) {
23
- if (esc_html($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
24
- if (isset($_POST['order_by'])) {
25
- $sort["sortid_by"] = esc_html($_POST['order_by']);
26
- }
27
- $sort["custom_style"] = "manage-column column-title sorted asc";
28
- $sort["1_or_2"] = "2";
29
- $order = "ORDER BY " . $sort["sortid_by"] . " ASC";
30
- }
31
- else {
32
- $sort["custom_style"] = "manage-column column-title sorted desc";
33
- $sort["1_or_2"] = "1";
34
- $order = "ORDER BY " . $sort["sortid_by"] . " DESC";
35
- }
36
- if ($_POST['page_number']) {
37
- $limit = (esc_html($_POST['page_number'])- 1) * 20;
38
- }
39
- else {
40
- $limit = 0;
41
- }
42
- }
43
- else {
44
- $limit = 0;
45
- }
46
- if (isset($_POST['search_events_by_title'])) {
47
- $search_tag = esc_html($_POST['search_events_by_title']);
48
- }
49
- else {
50
- $search_tag = "";
51
- }
52
-
53
- if ($search_tag) {
54
- $where = ' AND ' . $wpdb->prefix . 'spidercalendar_event.title LIKE "%' . $search_tag . '%"';
55
- }
56
- else {
57
- $where = '';
58
- }
59
- if (isset($_POST['startdate']) && esc_html($_POST['startdate'])) {
60
- $where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date > \'' . esc_html($_POST['startdate']) . '\' ';
61
- }
62
- if (isset($_POST['enddate']) && esc_html($_POST['enddate'])) {
63
- $where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date < \'' . esc_html($_POST['enddate']) . '\' ';
64
- }
65
- // Get the total number of records.
66
-
67
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=" . $calendar_id . " " . $where . " ";
68
-
69
- $total = $wpdb->get_var($query);
70
- $pageNav['total'] = $total;
71
- $pageNav['limit'] = $limit / 20 + 1;
72
-
73
- $query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=" . $calendar_id . " " . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
74
-
75
- $rows=$wpdb->get_results($query);
76
-
77
-
78
- html_upcoming_widget($rows, $pageNav, $sort);
79
-
80
- }
81
-
82
-
83
- function show_spider_calendar() {
84
- global $wpdb;
85
- $order = " ORDER BY title ASC";
86
- $sort["default_style"] = "manage-column column-autor sortable desc";
87
- $sort["sortid_by"] = "title";
88
- $sort["custom_style"] = "manage-column column-title sorted asc";
89
- $sort["1_or_2"] = "2";
90
- if (isset($_POST['page_number'])) {
91
- if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
92
- $sort["sortid_by"] = esc_html($_POST['order_by']);
93
- }
94
- if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
95
- $sort["custom_style"] = "manage-column column-title sorted asc";
96
- $sort["1_or_2"] = "2";
97
- $order = "ORDER BY " . $sort["sortid_by"] . " ASC";
98
- }
99
- else {
100
- $sort["custom_style"] = "manage-column column-title sorted desc";
101
- $sort["1_or_2"] = "1";
102
- $order = "ORDER BY " . $sort["sortid_by"] . " DESC";
103
- }
104
- if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
105
- $limit = (esc_html($_POST['page_number']) - 1) * 20;
106
- }
107
- else {
108
- $limit = 0;
109
- }
110
- }
111
- else {
112
- $limit = 0;
113
- }
114
- if (isset($_POST['search_events_by_title'])) {
115
- $search_tag = esc_html($_POST['search_events_by_title']);
116
- }
117
- else {
118
- $search_tag = "";
119
- }
120
- if ($search_tag) {
121
- $where = ' WHERE title LIKE "%' . $search_tag . '%"';
122
- }
123
- else {
124
- $where = ' ';
125
- }
126
- // Get the total number of records.
127
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_calendar" . $where;
128
- $total = $wpdb->get_var($query);
129
- $pageNav['total'] = $total;
130
- $pageNav['limit'] = $limit / 20 + 1;
131
- $query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_calendar" . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
132
- $rows = $wpdb->get_results($query);
133
- // display function
134
- html_show_spider_calendar($rows, $pageNav, $sort);
135
- }
136
-
137
- function show_event_cat(){
138
- global $wpdb;
139
- $order = " ORDER BY title ASC";
140
- $sort["default_style"] = "manage-column column-autor sortable desc";
141
- $sort["sortid_by"] = "title";
142
- $sort["custom_style"] = "manage-column column-title sorted asc";
143
- $sort["1_or_2"] = "2";
144
- if (isset($_POST['page_number'])) {
145
- if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
146
- $sort["sortid_by"] = esc_html($_POST['order_by']);
147
- }
148
- if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
149
- $sort["custom_style"] = "manage-column column-title sorted asc";
150
- $sort["1_or_2"] = "2";
151
- $order = "ORDER BY " . $sort["sortid_by"] . " ASC";
152
- }
153
- else {
154
- $sort["custom_style"] = "manage-column column-title sorted desc";
155
- $sort["1_or_2"] = "1";
156
- $order = "ORDER BY " . $sort["sortid_by"] . " DESC";
157
- }
158
- if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
159
- $limit = (esc_html($_POST['page_number']) - 1) * 20;
160
- }
161
- else {
162
- $limit = 0;
163
- }
164
- }
165
- else {
166
- $limit = 0;
167
- }
168
- if (isset($_POST['search_cat_by_title'])) {
169
- $search_tag = esc_html($_POST['search_cat_by_title']);
170
- }
171
- else {
172
- $search_tag = "";
173
- }
174
- if ($search_tag) {
175
- $where = ' WHERE title LIKE "%' . $search_tag . '%"';
176
- }
177
- else {
178
- $where = ' ';
179
- }
180
- // Get the total number of records.
181
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event_category" . $where;
182
- $total = $wpdb->get_var($query);
183
- $pageNav['total'] = $total;
184
- $pageNav['limit'] = $limit / 20 + 1;
185
- $query = "SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category" . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
186
-
187
- $rows = $wpdb->get_results($query);
188
- // display function
189
- show_event_category($rows, $pageNav, $sort);
190
-
191
- }
192
-
193
- // Edit calendar.
194
- function edit_spider_calendar($id) {
195
- global $wpdb;
196
- $row = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE id=\'' . $id . '\'');
197
- html_edit_spider_calendar($row);
198
- }
199
-
200
- // Delete calendar.
201
- function remove_spider_calendar($id) {
202
- global $wpdb;
203
- $sql_remov_vid = "DELETE FROM " . $wpdb->prefix . "spidercalendar_calendar WHERE id='" . $id . "'";
204
- $sql_remov_eve = "DELETE FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar='" . $id . "'";
205
- if (!$wpdb->query($sql_remov_vid)) {
206
- ?>
207
- <div id="message" class="error"><p>Calendar Not Deleted.</p></div>
208
- <?php
209
- }
210
- else {
211
- ?>
212
- <div class="updated"><p><strong>Calendar Deleted.</strong></p></div>
213
- <?php
214
- $count_eve = $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE calendar=' . $id);
215
- if ($count_eve) {
216
- if (!$wpdb->query($sql_remov_eve)) {
217
- ?>
218
- <div id="message" class="error"><p>Events Not Deleted.</p></div>
219
- <?php
220
- }
221
- }
222
- }
223
- }
224
-
225
- //Save Category Event
226
-
227
- function save_spider_category_event() {
228
- /*
229
- if (!$id) {
230
- echo '<h1 style="color:#00C">Error. ID does not exist.</h1>';
231
- exit;
232
- }
233
- */
234
- if($_POST['title']!=""){
235
- $title = (isset($_POST["title"]) ? esc_html(stripslashes($_POST["title"])) : '');
236
- $published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
237
- $color = (isset($_POST["color"]) ? esc_html(stripslashes($_POST["color"])) : '');
238
- $description = (isset($_POST["description"]) ? esc_html(stripslashes($_POST["description"])) : '');
239
- global $wpdb;
240
-
241
- $save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_event_category', array(
242
- 'id' => NULL,
243
- 'title' => $title,
244
- 'published' => $published,
245
- 'color' => $color,
246
- 'description' => $description,
247
- ), array(
248
- '%d',
249
- '%s',
250
- '%d',
251
- '%s',
252
- '%s'
253
- ));
254
- }
255
- }
256
-
257
-
258
- // Publish/Unpublish category.
259
- function spider_category_published($id) {
260
- global $wpdb;
261
- $publish = $wpdb->get_var($wpdb->prepare('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_event_category WHERE `id`="%d"', $id));
262
- if ($publish) {
263
- $publish = 0;
264
- $publish_unpublish = 'Category unpublished.';
265
- }
266
- else {
267
- $publish = 1;
268
- $publish_unpublish = 'Category published.';
269
- }
270
- $save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event_category', array(
271
- 'published' => $publish,
272
- ), array('id' => $id), array(
273
- '%d',
274
- ));
275
- if ($save_or_no !== FALSE) {
276
- ?>
277
- <div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
278
- <?php
279
- $location_cal = admin_url('admin.php?page=spider_calendar_event_category');
280
- header('Location: '.$location_cal.'');
281
- }
282
- }
283
-
284
-
285
- //Apply category event
286
-
287
- function apply_spider_category_event($id) {
288
-
289
- $title = (isset($_POST["title"]) ? esc_html(stripslashes($_POST["title"])) : '');
290
- $published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
291
- $color = (isset($_POST["color"]) ? esc_html(stripslashes($_POST["color"])) : '');
292
- $description = (isset($_POST["description"]) ? esc_html(stripslashes($_POST["description"])) : '');
293
- global $wpdb;
294
-
295
-
296
- $save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event_category', array(
297
- 'title' => $title,
298
- 'published' => $published,
299
- 'color' => $color,
300
- 'description' => $description,
301
- ), array('id' => $_POST['id']), array(
302
- '%s',
303
- '%d',
304
- '%s',
305
- '%s'
306
- ));
307
-
308
- }
309
-
310
- // Save calendar.
311
- function apply_spider_calendar($id) {
312
- if (!$id) {
313
- echo '<h1 style="color:#00C">Error. ID does not exist.</h1>';
314
- exit;
315
- }
316
- if(isset($_POST['title'])){
317
- $title = (isset($_POST["title"]) ? esc_html(stripslashes($_POST["title"])) : '');
318
- $user_type = (isset($_POST["user_type"]) ? esc_html($_POST["user_type"]) : '');
319
- $time_format = (isset($_POST["time_format"]) ? (int) $_POST["time_format"] : 0);
320
- $def_year = (isset($_POST["def_year"]) ? esc_html($_POST["def_year"]) : '');
321
- $def_month = (isset($_POST["def_month"]) ? esc_html($_POST["def_month"]) : '');
322
- $allow_publish = (isset($_POST["allow_publish"]) ? esc_html($_POST["allow_publish"]) : '');
323
- $published = (isset($_POST["published"]) ? (int) $_POST["published"] : 1);
324
- global $wpdb;
325
- if ($id === -1) {
326
- $save_or_no = $wpdb->insert($wpdb->prefix . 'spidercalendar_calendar', array(
327
- 'id' => NULL,
328
- 'title' => $title,
329
- 'gid' => $user_type,
330
- 'def_year' => $def_year,
331
- 'def_month' => $def_month,
332
- 'time_format' => $time_format,
333
- 'allow_publish' => $allow_publish,
334
- 'published' => $published,
335
- ), array(
336
- '%d',
337
- '%s',
338
- '%s',
339
- '%s',
340
- '%s',
341
- '%s',
342
- '%s',
343
- '%d'
344
- ));
345
- }
346
- else {
347
- $save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_calendar', array(
348
- 'title' => $title,
349
- 'gid' => $user_type,
350
- 'time_format' => $time_format,
351
- 'def_year' => $def_year,
352
- 'def_month' => $def_month,
353
- 'allow_publish' => $allow_publish,
354
- 'published' => $published,
355
- ), array('id' => $id), array(
356
- '%s',
357
- '%s',
358
- '%d',
359
- '%s',
360
- '%s',
361
- '%s',
362
- '%d'
363
- ));
364
- }
365
- if ($save_or_no === FALSE) {
366
- ?>
367
- <div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
368
- <?php
369
- return FALSE;
370
- }
371
- else {
372
- ?>
373
- <div class="updated"><p><strong>Calendar Saved.</strong></p></div>
374
- <?php
375
- return TRUE;
376
- }
377
- }
378
- }
379
-
380
- // Publish/Unpublish calendar.
381
- function spider_calendar_published($id) {
382
- global $wpdb;
383
- $publish = $wpdb->get_var($wpdb->prepare('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $id));
384
- if ($publish) {
385
- $publish = 0;
386
- $publish_unpublish = 'Calendar unpublished.';
387
- }
388
- else {
389
- $publish = 1;
390
- $publish_unpublish = 'Calendar published.';
391
- }
392
- $save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_calendar', array(
393
- 'published' => $publish,
394
- ), array('id' => $id), array(
395
- '%d',
396
- ));
397
- if ($save_or_no !== FALSE) {
398
- ?>
399
- <div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
400
- <?php
401
- $location_cal = admin_url('admin.php?page=SpiderCalendar');
402
- header('Location: '.$location_cal.'');
403
- }
404
- }
405
-
406
- // Event in table
407
- function show_spider_event($calendar_id) {
408
- global $wpdb;
409
- $order = " ORDER BY title ASC";
410
- $sort["default_style"] = "manage-column column-autor sortable desc";
411
- $sort["sortid_by"] = "title";
412
- $sort["custom_style"] = "manage-column column-title sorted asc";
413
- $sort["1_or_2"] = "2";
414
- if (isset($_POST['page_number'])) {
415
- if (isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') {
416
- $sort["sortid_by"] = esc_html($_POST['order_by']);
417
- }
418
- if (isset($_POST['asc_or_desc']) && (esc_html($_POST['asc_or_desc']) == 1)) {
419
- $sort["custom_style"] = "manage-column column-title sorted asc";
420
- $sort["1_or_2"] = "2";
421
- $order = "ORDER BY " . $sort["sortid_by"] . " ASC";
422
- }
423
- else {
424
- $sort["custom_style"] = "manage-column column-title sorted desc";
425
- $sort["1_or_2"] = "1";
426
- $order = "ORDER BY " . $sort["sortid_by"] . " DESC";
427
- }
428
- if (isset($_POST['page_number']) && (esc_html($_POST['page_number']))) {
429
- $limit = (esc_html($_POST['page_number']) - 1) * 20;
430
- }
431
- else {
432
- $limit = 0;
433
- }
434
- }
435
- else {
436
- $limit = 0;
437
- }
438
- if (isset($_POST['search_events_by_title'])) {
439
- $search_tag = esc_html($_POST['search_events_by_title']);
440
- }
441
- else {
442
- $search_tag = "";
443
- }
444
- if ($search_tag) {
445
- $where = ' AND ' . $wpdb->prefix . 'spidercalendar_event.title LIKE "%' . $search_tag . '%"';
446
- }
447
- else {
448
- $where = '';
449
- }
450
- if (isset($_POST['startdate']) && esc_html($_POST['startdate'])) {
451
- $where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date > \'' . esc_html($_POST['startdate']) . '\' ';
452
- }
453
- if (isset($_POST['enddate']) && $_POST['enddate']) {
454
- $where .= ' AND ' . $wpdb->prefix . 'spidercalendar_event.date < \'' . esc_html($_POST['enddate']) . '\' ';
455
- }
456
- // Get the total number of records.
457
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "spidercalendar_event WHERE calendar=" . $calendar_id . " " . $where . " ";
458
- $total = $wpdb->get_var($query);
459
- $pageNav['total'] = $total;
460
- $pageNav['limit'] = $limit / 20 + 1;
461
-
462
- $query = "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
463
- WHERE calendar=" . $calendar_id . " " . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
464
-
465
- $rows = $wpdb->get_results($query);
466
- $cal_name = $wpdb->get_var($wpdb->prepare('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE `id`="%d"', $calendar_id));
467
- html_show_spider_event($rows, $pageNav, $sort, $calendar_id, $cal_name);
468
- }
469
-
470
- // Add an event.
471
- function add_spider_event($calendar_id) {
472
- global $wpdb;
473
- $cal_name = $wpdb->get_var('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE id=' . $calendar_id);
474
- html_add_spider_event($calendar_id, $cal_name);
475
- }
476
-
477
- // Edit event.
478
- function edit_spider_event($calendar_id, $id) {
479
- global $wpdb;
480
- $row = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE id=\'' . $id . '\'');
481
- $calendar = $row->calendar;
482
- $query = 'SELECT title FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE id=' . $calendar;
483
- $calendar_name = $wpdb->get_var($query);
484
- $cal_name = $wpdb->get_var('SELECT title' . ' FROM ' . $wpdb->prefix . 'spidercalendar_calendar WHERE id=' . $calendar_id);
485
- html_edit_spider_event($row, $calendar_id, $id, $cal_name);
486
- }
487
-
488
- // Save event.
489
- function apply_spider_event($calendar_id, $id) {
490
- global $wpdb;
491
- if(isset($_POST['title'])){
492
- $title = ((isset($_POST['title'])) ? esc_html(stripslashes($_POST['title'])) : '');
493
- $category = ((isset($_POST['category'])) ? esc_html(stripslashes($_POST['category'])) : '');
494
- $text_for_date = ((isset($_POST['text_for_date'])) ? stripslashes($_POST['text_for_date']) : '');
495
- $published = ((isset($_POST['published'])) ? (int) $_POST['published'] : 1);
496
- $repeat = ((isset($_POST['repeat'])) ? esc_html($_POST['repeat']) : '');
497
- $week = ((isset($_POST['week'])) ? esc_html($_POST['week']) : '');
498
- $month = ((isset($_POST['month'])) ? esc_html($_POST['month']) : '');
499
- $monthly_list = ((isset($_POST['monthly_list'])) ? esc_html($_POST['monthly_list']) : '');
500
- $month_type = ((isset($_POST['month_type'])) ? esc_html($_POST['month_type']) : '');
501
- $month_week = ((isset($_POST['month_week'])) ? esc_html($_POST['month_week']) : '');
502
- $year_month = ((isset($_POST['year_month'])) ? esc_html($_POST['year_month']) : '');
503
- $repeat_method = ((isset($_POST['repeat_method'])) ? esc_html($_POST['repeat_method']) : 'no_repeat');
504
- $date = ((isset($_POST['date'])) ? esc_html($_POST['date']) : '');
505
- $date_end = ((isset($_POST['date_end'])) ? esc_html($_POST['date_end']) : '');
506
- if ($date_end == '' && $repeat_method != 'no_repeat') {
507
- $date_end = '2070-12-12';
508
- }
509
- $select_from = ((isset($_POST['select_from'])) ? esc_html($_POST['select_from']) : '');
510
- $select_to = ((isset($_POST['select_to'])) ? esc_html($_POST['select_to']) : '');
511
- $selhour_from = ((isset($_POST['selhour_from'])) ? esc_html($_POST['selhour_from']) : '');
512
- $selhour_to = ((isset($_POST['selhour_to'])) ? esc_html($_POST['selhour_to']) : '');
513
- $selminute_from = ((isset($_POST['selminute_from'])) ? esc_html($_POST['selminute_from']) : '');
514
- $selminute_to = ((isset($_POST['selminute_to'])) ? esc_html($_POST['selminute_to']) : '');
515
- if ($selhour_from) {
516
- if ($selhour_to) {
517
- $time = $selhour_from . ':' . $selminute_from . '' . $select_from . '-' . $selhour_to . ':' . $selminute_to . '' . $select_to;
518
- }
519
- else {
520
- $time = $selhour_from . ':' . $selminute_from . ' ' . $select_from;
521
- }
522
- }
523
- else {
524
- $time = '';
525
- }
526
- if ($id === -1) {
527
- $save = $wpdb->insert($wpdb->prefix . 'spidercalendar_event', array(
528
- 'id' => NULL,
529
- 'category' => $category,
530
- 'title' => $title,
531
- 'time' => $time,
532
- 'calendar' => $calendar_id,
533
- 'date' => $date,
534
- 'text_for_date' => $text_for_date,
535
- 'published' => $published,
536
- 'repeat' => $repeat,
537
- 'week' => $week,
538
- 'date_end' => $date_end,
539
- 'month' => $month,
540
- 'monthly_list' => $monthly_list,
541
- 'month_week' => $month_week,
542
- 'month_type' => $month_type,
543
- 'year_month' => $year_month,
544
- 'repeat_method' => $repeat_method,
545
- 'userID' => ''
546
- ), array(
547
- '%d',
548
- '%s',
549
- '%s',
550
- '%s',
551
- '%d',
552
- '%s',
553
- '%s',
554
- '%d',
555
- '%s',
556
- '%s',
557
- '%s',
558
- '%s',
559
- '%s',
560
- '%s',
561
- '%s',
562
- '%s',
563
- '%s',
564
- '%s'
565
- ));
566
- }
567
- else {
568
- $save = $wpdb->update($wpdb->prefix . 'spidercalendar_event', array(
569
- 'title' => $title,
570
- 'category' => $category,
571
- 'time' => $time,
572
- 'calendar' => $calendar_id,
573
- 'date' => $date,
574
- 'text_for_date' => $text_for_date,
575
- 'published' => $published,
576
- 'repeat' => $repeat,
577
- 'week' => $week,
578
- 'date_end' => $date_end,
579
- 'month' => $month,
580
- 'monthly_list' => $monthly_list,
581
- 'month_type' => $month_type,
582
- 'month_week' => $month_week,
583
- 'year_month' => $year_month,
584
- 'repeat_method' => $repeat_method
585
- ), array('id' => $id), array(
586
- '%s',
587
- '%s',
588
- '%s',
589
- '%d',
590
- '%s',
591
- '%s',
592
- '%d',
593
- '%s',
594
- '%s',
595
- '%s',
596
- '%s',
597
- '%s',
598
- '%s',
599
- '%s',
600
- '%s',
601
- '%s'
602
- ));
603
- }
604
- if ($save !== FALSE) {
605
- ?>
606
- <div class="updated"><p><strong>Item Saved.</strong></p></div>
607
- <?php
608
- return TRUE;
609
- }
610
- else {
611
- ?>
612
- <div class="updated"><p><strong>Error. Please install plugin again.</strong></p></div>
613
- <?php
614
- return FALSE;
615
- }
616
- }
617
- }
618
-
619
- // Publish/Unpublish event.
620
- function published_spider_event($calendar_id, $id) {
621
- global $wpdb;
622
- $publish = $wpdb->get_var('SELECT published FROM ' . $wpdb->prefix . 'spidercalendar_event WHERE `id`=' . $id);
623
- if ($publish) {
624
- $publish = 0;
625
- $publish_unpublish = 'Event unpublished.';
626
- }
627
- else {
628
- $publish = 1;
629
- $publish_unpublish = 'Event published.';
630
- }
631
- $save_or_no = $wpdb->update($wpdb->prefix . 'spidercalendar_event', array(
632
- 'published' => $publish,
633
- ), array('id' => $id), array(
634
- '%d',
635
- ));
636
- if ($save_or_no !== FALSE) {
637
- ?>
638
- <div class="updated"><p><strong><?php echo $publish_unpublish; ?></strong></p></div>
639
- <?php
640
- $location_cal = admin_url('admin.php?page=SpiderCalendar&task=show_manage_event&calendar_id='.$calendar_id.'');
641
- header('Location: '.$location_cal.'');
642
- }
643
- }
644
-
645
- // Delete event.
646
- function remove_spider_event($calendar_id, $id) {
647
- global $wpdb;
648
- $sql_remove_vid = "DELETE FROM " . $wpdb->prefix . "spidercalendar_event WHERE id='" . $id . "'";
649
- if (!$wpdb->query($sql_remove_vid)) {
650
- ?>
651
- <div id="message" class="error"><p>Event Not Deleted.</p></div>
652
- <?php
653
- }
654
- else {
655
- ?>
656
- <div class="updated"><p><strong>Event Deleted.</strong></p></div>
657
- <?php
658
- }
659
- }
660
- function remove_category_event($id) {
661
- global $wpdb;
662
- $sql_remove_vid = "DELETE FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE id='" . $id . "'";
663
- if (!$wpdb->query($sql_remove_vid)) {
664
- ?>
665
- <div id="message" class="error"><p>Event Category Not Deleted.</p></div>
666
- <?php
667
- }
668
- else {
669
- ?>
670
- <div class="updated"><p><strong>Event Category Deleted.</strong></p></div>
671
- <?php
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
- $bg_top = '#' . $theme->bg_top;
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
- if ($date != '') {
173
- $date_REFERER = $date;
174
- }
175
- else {
176
- $date_REFERER = date("Y-m");
177
- $date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
178
- }
179
- $year_REFERER = substr($date_REFERER, 0, 4);
180
- $month_REFERER = Month_name(substr($date_REFERER, 5, 2));
181
- $day_REFERER = substr($date_REFERER, 8, 2);
182
-
183
- $year = substr($date, 0, 4);
184
- $month = Month_name(substr($date, 5, 2));
185
- $day = substr($date, 8, 2);
186
-
187
- $cell_width = $cal_width / 7;
188
- $month_day_count = date('t', mktime(0, 0, 0, Month_num($month), 1, $year));
189
- $prev_month_day_count = date('t', mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
190
-
191
- if ($day > $month_day_count) {
192
- $month = Month_name(Month_num($month) + 1);
193
- $day = '01';
194
- }
195
- if ((int) $day < 1) {
196
- $month = Month_name(Month_num($month) - 1);
197
- $day = $prev_month_day_count;
198
- }
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 = 'bigcalendarday';
205
- $views = explode(',', $view_select);
206
- $defaultview = 'day';
207
- array_pop($views);
208
- $display = '';
209
- if (count($views) == 0) {
210
- $display = "display:none";
211
- }
212
- if(count($views) == 1 && $views[0] == $defaultview) {
213
- $display = "display:none";
214
- }
215
- ?>
216
- <style type='text/css'>
217
-
218
- .day_ev{
219
- border-top-left-radius: <?php echo $border_radius2 ?>px !important;
220
- border-top-right-radius: <?php echo $border_radius2 ?>px !important;
221
- border-radius: <?php echo $border_radius2 ?>px !important;
222
- border-bottom-left-radius: <?php echo $border_radius2 ?>px !important;
223
- }
224
-
225
- #bigcalendar<?php echo $many_sp_calendar ?> td, #bigcalendar<?php echo $many_sp_calendar ?> tr, #spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
226
- border: none !important;
227
- }
228
- #bigcalendar<?php echo $many_sp_calendar ?> . general_table {
229
- border-radius: <?php echo $border_radius ?>px !important;
230
- }
231
- #bigcalendar<?php echo $many_sp_calendar ?> . top_table {
232
- border-top-left-radius: <?php echo $border_radius2 ?>px !important;
233
- border-top-right-radius: <?php echo $border_radius2 ?>px !important;
234
- }
235
- .general_table table table:last-child .day_ev:last-child td,
236
- .general_table table table:last-child .week_list:last-child td{
237
- border-bottom-left-radius:<?php echo $border_radius2?>px;
238
-
239
- }
240
-
241
- .general_table table tr:last-child >td:last-child{
242
- border-bottom-right-radius: <?php echo $border_radius2; ?>px;
243
- border-top-right-radius: <?php echo $border_radius2 ?>px;
244
- }
245
-
246
- #bigcalendar<?php echo $many_sp_calendar ?> . cala_arrow a : link, #bigcalendar .cala_arrow a:visited {
247
- text-decoration: none !important;
248
- background: none !important;
249
- font-size: <?php echo $arrow_size ?>px !important;
250
- }
251
- #bigcalendar<?php echo $many_sp_calendar ?> . cala_arrow {
252
- vertical-align: middle !important;
253
- }
254
- #bigcalendar<?php echo $many_sp_calendar ?> . cala_arrow a : hover {
255
- font-size: <?php echo $arrow_size_hover ?>px !important;
256
- text-decoration: none !important;
257
- background: none !important;
258
- }
259
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : link, #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : visited {
260
- text-decoration: none !important;
261
- background: none !important;
262
- font-size: 12px !important;
263
- color: red;
264
- }
265
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : hover {
266
- text-decoration: none !important;
267
- background: none !important;
268
- }
269
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day {
270
- border: 1px solid <?php echo $cell_border_color; ?> !important;
271
- <?php echo 'vertical-align:top !important;'; ?>
272
- }
273
- #bigcalendar<?php echo $many_sp_calendar; ?> . weekdays {
274
- vertical-align: middle !important;
275
- border: 1px solid <?php echo $cell_border_color; ?> !important;
276
- }
277
- #bigcalendar<?php echo $many_sp_calendar; ?> . week_days {
278
- font-size: <?php echo $weekdays_font_size; ?>px !important;
279
- }
280
- #bigcalendar<?php echo $many_sp_calendar; ?> . calyear_table {
281
- border-spacing: 0 !important;
282
- width: 100% !important;
283
- }
284
- . calyear_table table #bigcalendar<?php echo $many_sp_calendar; ?> . calmonth_table {
285
- border-spacing: 0 !important;
286
- width: 100% !important;
287
- }
288
- #bigcalendar<?php echo $many_sp_calendar; ?> . calbg, #bigcalendar .calbg td {
289
- text-align: center !important;
290
- width: 14% !important;
291
- }
292
- #bigcalendar<?php echo $many_sp_calendar; ?> . caltext_color_other_months {
293
- color: <?php echo $text_color_other_months; ?> !important;
294
- border: 1px solid <?php echo $cell_border_color; ?> !important;
295
- <?php echo 'vertical-align:top !important;'; ?>
296
- }
297
- #bigcalendar<?php echo $many_sp_calendar; ?> . caltext_color_this_month_unevented {
298
- color: <?php echo $text_color_this_month_unevented; ?> !important;
299
- }
300
- #bigcalendar<?php echo $many_sp_calendar; ?> . calfont_year {
301
- font-size: 24px !important;
302
- font-weight: bold !important;
303
- color: <?php echo $text_color_year; ?> !important;
304
- }
305
- .general_table table, .general_table td, .general_table tr {
306
- border: inherit !important;
307
- vertical-align: initial !important;
308
- border-collapse: inherit !important;
309
- margin: inherit !important;
310
- padding: inherit !important;
311
- }
312
- .general_table {
313
- border-collapse: inherit !important;
314
- margin: inherit !important;
315
- }
316
- .general_table p {
317
- margin: inherit !important;
318
- padding: inherit !important;
319
- }
320
- #bigcalendar<?php echo $many_sp_calendar; ?> . calsun_days {
321
- color: <?php echo $sun_days ?> !important;
322
- border: 1px solid <?php echo $cell_border_color; ?> !important;
323
- <?php echo 'vertical-align:top !important; text-align:left !important;'; ?>
324
- background-color: <?php echo $sundays_bg_color; ?> !important;
325
- }
326
- #TB_window {
327
- z-index: 10000;
328
- }
329
-
330
- #bigcalendar<?php echo $many_sp_calendar; ?> td {
331
- vertical-align: middle !important;
332
- }
333
- #bigcalendar<?php echo $many_sp_calendar; ?> table {
334
- border-collapse: initial;
335
- border:0px;
336
- max-width: none;
337
- }
338
- #bigcalendar<?php echo $many_sp_calendar; ?> table tr:hover td {
339
- background: none;
340
- }
341
- #bigcalendar<?php echo $many_sp_calendar; ?> table td {
342
- padding: 0px;
343
- vertical-align: none;
344
- border-top:none;
345
- line-height: none;
346
- text-align: none;
347
- }
348
- #bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
349
- margin-bottom:0;
350
- }
351
- #bigcalendar<?php echo $many_sp_calendar; ?> td,
352
- #bigcalendar<?php echo $many_sp_calendar; ?> tr,
353
- #spiderCalendarTitlesList td,
354
- #spiderCalendarTitlesList tr {
355
- border:none;
356
- }
357
- #bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
358
- border-radius: <?php echo $border_radius; ?>px;
359
- }
360
- #bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
361
- border-top-left-radius: <?php echo $border_radius2; ?>px;
362
- border-top-right-radius: <?php echo $border_radius2; ?>px;
363
- }
364
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
365
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
366
- text-decoration:none;
367
- background:none;
368
- font-size: <?php echo $arrow_size; ?>px;
369
- }
370
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
371
- text-decoration:none;
372
- background:none;
373
- }
374
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
375
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
376
- text-decoration:none;
377
- background:none;
378
- font-size:12px;
379
- color:red;
380
- }
381
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
382
- text-decoration:none;
383
- background:none;
384
- }
385
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
386
- border:1px solid <?php echo $cell_border_color; ?>;
387
- vertical-align:top;
388
- }
389
- #bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
390
- border:1px solid <?php echo $cell_border_color; ?>;
391
- }
392
- #bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
393
- font-size:<?php echo $weekdays_font_size; ?>px;
394
- }
395
- #bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
396
- border-spacing:0;
397
- width:100%;
398
- }
399
- #bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
400
- border-spacing:0;
401
- width:100%;
402
- }
403
- #bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
404
- #bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
405
- text-align:center;
406
- width:14%;
407
- }
408
- #bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
409
- color:<?php echo $text_color_other_months; ?>;
410
- border:1px solid <?php echo $cell_border_color; ?>;
411
- vertical-align:top;
412
- }
413
- #bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
414
- color:<?php echo $text_color_this_month_unevented; ?>;
415
- }
416
- #bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
417
- font-size:24px;
418
- font-weight:bold;
419
- color:<?php echo $text_color_year; ?>;
420
- }
421
- #bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
422
- color:<?php echo $sun_days; ?>;
423
- border:1px solid <?php echo $cell_border_color; ?>;
424
- vertical-align:top;
425
- text-align:left;
426
- background-color:<?php echo $sundays_bg_color; ?>;
427
- }
428
- #bigcalendar<?php echo $many_sp_calendar; ?> .views {
429
- float: right;
430
- background-color: <?php echo $views_tabs_bg_color; ?>;
431
- min-height: 25px;
432
- min-width: 70px;
433
- margin-right: 2px;
434
- text-align: center;
435
- cursor:pointer;
436
- position: relative;
437
- top: 5px;
438
- }
439
-
440
-
441
- #bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
442
- #bigcalendar<?php echo $many_sp_calendar; ?> #views_select
443
- {
444
-
445
- background-color: <?php echo $views_tabs_bg_color?>;
446
- width: 120px;
447
- text-align: center;
448
- cursor: pointer;
449
- padding: 6px;
450
- position: relative;
451
- }
452
-
453
- #bigcalendar<?php echo $many_sp_calendar; ?> .views span{
454
- padding: 7px;
455
- }
456
-
457
- #drop_down_views
458
- {
459
- list-style-type:none !important;
460
- position: absolute;
461
- top: 46px;
462
- left: -15px;
463
- display:none;
464
- z-index: 4545;
465
-
466
- }
467
-
468
- #drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
469
- {
470
- background:<?php echo $bg_top ?>;
471
- }
472
-
473
- #drop_down_views >li
474
- {
475
- border-bottom:1px solid #fff !important;
476
- }
477
-
478
-
479
- #views_tabs_select
480
- {
481
- display:none;
482
- }
483
-
484
- </style>
485
- <div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
486
- <div style="width:100%;">
487
- <table cellpadding="0" cellspacing="0" style="width:100%;">
488
- <tr>
489
- <td>
490
-
491
- <div id="views_tabs" style="width: 100%;<?php echo $display ?>">
492
- <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;'; ?>"
493
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
494
- 'action' => 'spiderbigcalendar_day',
495
- 'theme_id' => $theme_id,
496
- 'calendar' => $calendar_id,
497
- 'select' => $view_select,
498
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
499
- 'many_sp_calendar' => $many_sp_calendar,
500
- 'cur_page_url' => $path_sp_cal,
501
- 'cat_id' => '',
502
- 'cat_ids' => $cat_ids,
503
- 'widget' => $widget,
504
- 'rand' => $many_sp_calendar,
505
- ), 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>
506
- </div>
507
- <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;'; ?>"
508
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
509
- 'action' => 'spiderbigcalendar_week',
510
- 'theme_id' => $theme_id,
511
- 'calendar' => $calendar_id,
512
- 'select' => $view_select,
513
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
514
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
515
- 'many_sp_calendar' => $many_sp_calendar,
516
- 'cur_page_url' => $path_sp_cal,
517
- 'cat_id' => '',
518
- 'cat_ids' => $cat_ids,
519
- 'widget' => $widget,
520
- 'rand' => $many_sp_calendar,
521
- ), 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>
522
- </div>
523
- <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;'; ?>"
524
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
525
- 'action' => 'spiderbigcalendar_list',
526
- 'theme_id' => $theme_id,
527
- 'calendar' => $calendar_id,
528
- 'select' => $view_select,
529
- 'date' => $year . '-' . add_0((Month_num($month))),
530
- 'many_sp_calendar' => $many_sp_calendar,
531
- 'cur_page_url' => $path_sp_cal,
532
- 'cat_id' => '',
533
- 'cat_ids' => $cat_ids,
534
- 'widget' => $widget,
535
- 'rand' => $many_sp_calendar,
536
- ), 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>
537
- </div>
538
- <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;'; ?>"
539
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
540
- 'action' => 'spiderbigcalendar_month',
541
- 'theme_id' => $theme_id,
542
- 'calendar' => $calendar_id,
543
- 'select' => $view_select,
544
- 'date' => $year . '-' . add_0((Month_num($month))),
545
- 'many_sp_calendar' => $many_sp_calendar,
546
- 'cur_page_url' => $path_sp_cal,
547
- 'cat_id' => '',
548
- 'cat_ids' => $cat_ids,
549
- 'widget' => $widget,
550
- 'rand' => $many_sp_calendar,
551
- ), 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>
552
- </div>
553
- </div>
554
- <div id="views_tabs_select" style="display:none" >
555
- <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">
556
- <?php if($view=='bigcalendarday') echo 'Day'; ?>
557
- <?php if($view=='bigcalendarmonth') echo 'Month'; ?>
558
- <?php if($view=='bigcalendarweek') echo 'Week'; ?>
559
- <?php if($view=='bigcalendarlist') echo 'List'; ?>
560
- <span>&#9658;</span>
561
- </div>
562
- <ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
563
- <li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
564
- <div class="views_select"
565
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
566
- 'action' => 'spiderbigcalendar_day',
567
- 'theme_id' => $theme_id,
568
- 'calendar' => $calendar_id,
569
- 'select' => $view_select,
570
- 'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
571
- 'many_sp_calendar' => $many_sp_calendar,
572
- 'cur_page_url' => $path_sp_cal,
573
- 'cat_id' => '',
574
- 'cat_ids' => $cat_ids,
575
- 'widget' => $widget,
576
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
577
- <span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
578
- </div>
579
- </li>
580
-
581
- <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"
582
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
583
- 'action' => 'spiderbigcalendar_week',
584
- 'theme_id' => $theme_id,
585
- 'calendar' => $calendar_id,
586
- 'select' => $view_select,
587
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
588
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
589
- 'many_sp_calendar' => $many_sp_calendar,
590
- 'cur_page_url' => $path_sp_cal,
591
- 'cat_id' => '',
592
- 'cat_ids' => $cat_ids,
593
- 'widget' => $widget,
594
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
595
- <span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
596
- </div>
597
- </li>
598
-
599
- <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"
600
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
601
- 'action' => 'spiderbigcalendar_list',
602
- 'theme_id' => $theme_id,
603
- 'calendar' => $calendar_id,
604
- 'select' => $view_select,
605
- 'date' => $year . '-' . add_0((Month_num($month))),
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'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
612
- <span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
613
- </div>
614
- </li>
615
-
616
- <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"
617
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
618
- 'action' => 'spiderbigcalendar_month',
619
- 'theme_id' => $theme_id,
620
- 'calendar' => $calendar_id,
621
- 'select' => $view_select,
622
- 'date' => $year . '-' . add_0((Month_num($month))),
623
- 'many_sp_calendar' => $many_sp_calendar,
624
- 'cur_page_url' => $path_sp_cal,
625
- 'cat_id' => '',
626
- 'cat_ids' => $cat_ids,
627
- 'widget' => $widget,
628
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
629
- <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>
630
-
631
- </ul>
632
- </div>
633
-
634
- </td>
635
- </tr>
636
- <tr>
637
- <td>
638
- <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; ?>;">
639
- <tr>
640
- <td width="100%" style="padding:0; margin:0;">
641
- <table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;" >
642
- <tr style="height:40px; width:100%;">
643
- <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%;">
644
- <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;">
645
- <tr>
646
- <td width="15%">
647
- <div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
648
- echo add_query_arg(array(
649
- 'action' => 'spiderbigcalendar_' . $defaultview,
650
- 'theme_id' => $theme_id,
651
- 'calendar' => $calendar_id,
652
- 'select' => $view_select,
653
- 'date' => ($year - 1) . '-' . add_0((Month_num($month))) . '-' . $day,
654
- 'many_sp_calendar' => $many_sp_calendar,
655
- 'cur_page_url' => $path_sp_cal,
656
- 'cat_id' => '',
657
- 'cat_ids' => $cat_ids,
658
- 'widget' => $widget,
659
- ), 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;">
660
- <span style="font-size:18px; color:#FFF"><?php echo $year - 1; ?></span>
661
- </div>
662
- </td>
663
- <td style="width:100%;vertical-align:center">
664
- <table style="width:100%;">
665
- <tr>
666
- <td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
667
- <a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
668
-
669
- if ($day == '01' && Month_num(Month_name(Month_num($month) - 1)) != '12') {
670
- $needed_date = $year . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
671
- }
672
-
673
- else
674
- {
675
- if (Month_num(Month_name(Month_num($month) - 1)) == '12' && $day == '01') {
676
-
677
- $needed_date = ($year - 1) . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
678
- }
679
- else {
680
- $needed_date = $year . '-' . add_0((Month_num($month))) . '-' . add_0($day - 1);
681
- }
682
- }
683
- echo add_query_arg(array(
684
- 'action' => 'spiderbigcalendar_' . $defaultview,
685
- 'theme_id' => $theme_id,
686
- 'calendar' => $calendar_id,
687
- 'select' => $view_select,
688
- 'date' => $needed_date,
689
- 'many_sp_calendar' => $many_sp_calendar,
690
- 'cur_page_url' => $path_sp_cal,
691
- 'cat_id' => '',
692
- 'cat_ids' => $cat_ids,
693
- 'widget' => $widget,
694
- ), admin_url('admin-ajax.php'));
695
- ?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">&#9664;
696
- </a>
697
- </td>
698
- <td style="text-align:center; margin:0;" width="40%">
699
- <input type="hidden" name="month" readonly="" value="<?php echo $month?>"/>
700
- <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>
701
- </td>
702
- <?php
703
- if ($day == $month_day_count && Month_num(Month_name(Month_num($month) + 1)) != '1') {
704
- $needed_date = $year . '-' . add_0((Month_num($month) + 1)) . '-01';
705
-
706
- }
707
- else
708
- {
709
-
710
- if (Month_num(Month_name(Month_num($month) + 1)) == '1' && $day == $month_day_count) {
711
- $needed_date = ($year + 1) . '-' . add_0(Month_num($month + 1)) . '-01';
712
-
713
- }
714
- else {
715
- $needed_date = $year . '-' . add_0(Month_num($month)) . '-' . add_0($day + 1);
716
- }
717
- }
718
-
719
- ?>
720
-
721
- <td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
722
- <a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
723
-
724
- echo add_query_arg(array(
725
- 'action' => 'spiderbigcalendar_' . $defaultview,
726
- 'theme_id' => $theme_id,
727
- 'calendar' => $calendar_id,
728
- 'select' => $view_select,
729
- 'date' => $needed_date,
730
- 'many_sp_calendar' => $many_sp_calendar,
731
- 'cur_page_url' => $path_sp_cal,
732
- 'cat_id' => '',
733
- 'cat_ids' => $cat_ids,
734
- 'widget' => $widget,
735
- ), admin_url('admin-ajax.php'));
736
- ?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">&#9654;
737
- </a>
738
- </td>
739
- <td width="15%">
740
- <div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
741
- echo add_query_arg(array(
742
- 'action' => 'spiderbigcalendar_' . $defaultview,
743
- 'theme_id' => $theme_id,
744
- 'calendar' => $calendar_id,
745
- 'select' => $view_select,
746
- 'date' => ($year + 1) . '-' . add_0((Month_num($month))) . '-' . $day,
747
- 'many_sp_calendar' => $many_sp_calendar,
748
- 'cur_page_url' => $path_sp_cal,
749
- 'cat_id' => '',
750
- 'cat_ids' => $cat_ids,
751
- 'widget' => $widget,
752
- ), 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;">
753
- <span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
754
- </div>
755
- </td>
756
- </tr>
757
- </table>
758
- </td>
759
- </tr>
760
- </table>
761
- </td>
762
-
763
- </tr>
764
- </tr>
765
- <tr>
766
- <td>
767
- <?php
768
- $month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
769
- if ($weekstart == "su") {
770
- $month_first_weekday++;
771
- if ($month_first_weekday == 8) {
772
- $month_first_weekday = 1;
773
- }
774
- }
775
- $month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
776
- $last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
777
- $weekday_i = $month_first_weekday;
778
- $last_month_days = $last_month_days - $weekday_i + 2;
779
- $percent = 1;
780
- $sum = $month_days - 8 + $month_first_weekday;
781
- if ($sum % 7 <> 0) {
782
- $percent = $percent + 1;
783
- }
784
- $sum = $sum - ($sum % 7);
785
- $percent = $percent + ($sum / 7);
786
- $percent = 107 / $percent;
787
- $all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
788
- $categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
789
- $calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
790
- $array_days = $all_calendar_files[0]['array_days'];
791
- $array_days1 = $all_calendar_files[0]['array_days1'];
792
- $title = $all_calendar_files[0]['title'];
793
- $ev_ids = $all_calendar_files[0]['ev_ids'];
794
- sort($array_days, SORT_NUMERIC);
795
- if (!$array_days || !in_array((int) $day, $array_days)) {
796
- $week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
797
- echo '<table style="border-spacing:0;width:100%;border-bottom:1px solid ' . $cell_border_color . '">
798
- <tr>
799
- <td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
800
- <span style="padding-left:10px; font-size:' . $week_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
801
- <span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
802
- </td>
803
- </tr>
804
- <tr>
805
- <td>
806
- <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">
807
- <tr>
808
- <td style="font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $event_num_bg_color1 . ';color:' . $event_num_color . '"></td>
809
- <td><p style="color:' . $event_title_color . ';border:none;">&nbsp;' . __('There Is No Event In This Day', 'sp_calendar') . '</p></td>
810
- </tr>
811
- </table>
812
- </td>
813
- </tr>
814
- </table>';
815
- }
816
- if (in_array((int) $day, $array_days)) {
817
- $week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
818
- echo '<table style="border-spacing:0;width:100%;border-bottom:1px solid ' . $cell_border_color . '">
819
- <tr>
820
- <td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
821
- <span style="padding-left:10px; font-size:' . $date_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
822
- <span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
823
- </td>
824
- <tr>
825
- <td>';
826
- foreach ($title as $key => $value) {
827
- if ($key == (int) $day) {
828
- $ev_id = explode('<br>', $ev_ids[$key]);
829
- array_pop($ev_id);
830
- $ev_ids_inline = implode(',', $ev_id);
831
- $ev_title = explode('</p>', $value);
832
- array_pop($ev_title);
833
- for ($j = 0; $j < count($ev_title); $j++) {
834
-
835
-
836
- $query = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
837
- ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND
838
- " . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$ev_id[$j];
839
-
840
- $cat_color = $wpdb->get_row($query);
841
-
842
- if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color="";};
843
-
844
- if (($j + 1) % 2 == 0) {
845
- $color = $event_num_bg_color2;
846
- $table_color = $event_bg_color2;
847
- }
848
- else {
849
- $color = $event_num_bg_color1;
850
- $table_color = $event_bg_color1;
851
- }
852
-
853
- 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">
854
- <tr>
855
- <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>
856
- <td>
857
- <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:15px;background:none;text-decoration: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)) . '-' . (int) $day,
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>' . $ev_title[$j] . '</b>
872
- </a>
873
- </td>
874
- </tr>
875
- </table>';
876
- }
877
- }
878
- }
879
- echo '</td></tr></table>';
880
- }
881
- ?>
882
- </td>
883
- </tr>
884
- </table>
885
- </tr>
886
- </table>
887
- </td>
888
- </tr>
889
- </table>
890
-
891
- <script>
892
-
893
- jQuery(document).ready(function (){
894
-
895
- jQuery('#views_select').click(function () {
896
- jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
897
- }, function () {
898
- jQuery('#drop_down_views').stop(true, true).slideUp(500);
899
- });
900
- if(jQuery(window).width() > 640 )
901
- {
902
- jQuery('drop_down_views').hide();
903
- }
904
- });
905
- </script>
906
-
907
-
908
- <style>
909
-
910
- @media only screen and (max-width : 640px) {
911
-
912
- #views_tabs ,#drop_down_views
913
- {
914
- display:none;
915
- }
916
-
917
- #views_tabs_select
918
- {
919
- display:block !important;
920
- }
921
-
922
-
923
-
924
- }
925
-
926
- @media only screen and (max-width : 968px) {
927
- #cats >li
928
- {
929
- float:none;
930
- }
931
-
932
-
933
-
934
- }
935
- .categories1 , .categories2
936
- {
937
- display:inline-block;
938
- }
939
-
940
- .categories2
941
- {
942
- position:relative;
943
- left: -9px;
944
- cursor:pointer;
945
- }
946
- .categories2:first-letter
947
- {
948
- color:#fff;
949
-
950
- }
951
- </style>
952
- <?php
953
-
954
- //reindex cat_ids_array
955
- $re_cat_ids_array = array_values($cat_ids_array);
956
-
957
- for($i=0; $i<count($re_cat_ids_array); $i++)
958
- {
959
- echo'
960
- <style>
961
- #cats #category'.$re_cat_ids_array[$i].'
962
- {
963
- text-decoration:underline;
964
- cursor:pointer;
965
-
966
- }
967
-
968
- </style>';
969
-
970
- }
971
-
972
-
973
-
974
- if($cat_ids=='')
975
- $cat_ids='';
976
-
977
-
978
- echo '<ul id="cats" style="list-style-type:none;">';
979
-
980
-
981
- foreach($categories as $category)
982
- {
983
-
984
- ?>
985
-
986
- <li style="float:left;"><p class="categories1" style="background-color:#<?php echo $category->color;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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(
987
- 'action' => 'spiderbigcalendar_day',
988
- 'theme_id' => $theme_id,
989
- 'calendar' => $calendar_id,
990
- 'select' => $view_select,
991
- 'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
992
- 'many_sp_calendar' => $many_sp_calendar,
993
- 'cur_page_url' => $path_sp_cal,
994
- 'cat_id' => $category->id,
995
- 'cat_ids' => $cat_ids,
996
- 'widget' => $widget,
997
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
998
-
999
-
1000
- <?php
1001
-
1002
-
1003
- }
1004
-
1005
- echo '</ul><br><br>';
1006
-
1007
- die();
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>&#9658;</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; ?>')">&#9664;
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; ?>')">&#9654;
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;">&nbsp;' . __('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;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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
- $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 ($cell_height == '') {
132
- // $cell_height = 70;
133
- // }
134
- // if ($cal_width == '') {
135
- // $cal_width = 700;
136
- // }
137
- if ($date != '') {
138
- $date_REFERER = $date;
139
- }
140
- else {
141
- $date_REFERER = date("Y-m");
142
- $date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
143
- }
144
-
145
- $year_REFERER = substr($date_REFERER, 0, 4);
146
- $month_REFERER = Month_name(substr($date_REFERER, 5, 2));
147
- $day_REFERER = substr($date_REFERER, 8, 2);
148
-
149
- $year = substr($date, 0, 4);
150
- $month = Month_name(substr($date, 5, 2));
151
- $day = substr($date, 8, 2);
152
-
153
- $this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
154
- $prev_month = add_0((int) $this_month - 1);
155
- $next_month = add_0((int) $this_month + 1);
156
-
157
- $cell_width = $calendar_width / 7;
158
- $cell_width = (int) $cell_width - 2;
159
-
160
- $month_day_count = date('t', mktime(0, 0, 0, Month_num($month), 1, $year));
161
- $prev_month_day_count = date('t', mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
162
-
163
- if ($day > $month_day_count) {
164
- $month = Month_name(Month_num($month) + 1);
165
- $day = '01';
166
- }
167
- if ((int) $day < 1) {
168
- $month = Month_name(Month_num($month) - 1);
169
- $day = $prev_month_day_count;
170
- }
171
-
172
- $this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
173
- $prev_month = add_0((int) $this_month - 1);
174
- $next_month = add_0((int) $this_month + 1);
175
-
176
- $view = 'bigcalendarday_widget';
177
- $views = explode(',', $view_select);
178
- $defaultview = 'day';
179
- array_pop($views);
180
- $display = '';
181
- if (count($views) == 0) {
182
- $display = "display:none";
183
- }
184
- if(count($views) == 1 && $views[0] == $defaultview) {
185
- $display = "display:none";
186
- }
187
- ?>
188
- <style type='text/css'>
189
- #calendar_<?php echo $many_sp_calendar; ?> table {
190
- border-collapse: initial;
191
- border:0px;
192
- }
193
- #calendar_<?php echo $many_sp_calendar; ?> table td {
194
- padding: 0px;
195
- vertical-align: none;
196
- border-top:none;
197
- line-height: none;
198
- text-align: none;
199
- }
200
- #calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
201
- border:1px solid <?php echo $cell_border_color; ?>;
202
- font-family: <?php echo $font_day; ?>;
203
- }
204
- #calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
205
- margin-bottom: 0;
206
- }
207
- #calendar_<?php echo $many_sp_calendar; ?> td,
208
- #calendar_<?php echo $many_sp_calendar; ?> tr,
209
- #spiderCalendarTitlesList_<?php echo $many_sp_calendar ?> td,
210
- #spiderCalendarTitlesList_<?php echo $many_sp_calendar ?> tr {
211
- border:none;
212
- }
213
- #calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
214
- #calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
215
- color: <?php echo $color_arrow; ?>;
216
- text-decoration: none;
217
- background: none;
218
- font-size: 16px;
219
- }
220
- #calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
221
- color: <?php echo $color_arrow; ?>;
222
- text-decoration:none;
223
- background:none;
224
- }
225
- #calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
226
- #calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
227
- text-decoration:underline;
228
- background:none;
229
- font-size:11px;
230
- }
231
- #calendar_<?php echo $many_sp_calendar; ?> a {
232
- font-weight: normal;
233
- }
234
- #calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
235
- font-size:12px;
236
- text-decoration:none;
237
- background:none;
238
- }
239
- #calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
240
- border-spacing:0;
241
- width:100%;
242
- }
243
- #calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
244
- border-spacing: 0;
245
- vertical-align: middle;
246
- width: 100%;
247
- }
248
- #calendar_<?php echo $many_sp_calendar; ?> .calbg {
249
- background-color:<?php echo $bg; ?>;
250
- text-align:center;
251
- vertical-align: middle;
252
- }
253
- #calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
254
- color:<?php echo $text_color_other_months; ?>;
255
- }
256
- #calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
257
- color:<?php echo $text_color_this_month_unevented; ?>;
258
- }
259
- #calendar_<?php echo $many_sp_calendar; ?> .calfont_year {
260
- font-size:24px;
261
- font-weight:bold;
262
- color:<?php echo $year_font_color; ?>;
263
- }
264
- #calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
265
- color:<?php echo $sun_days; ?>;
266
- }
267
- #calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
268
- border: solid <?php echo $border_day; ?> 1px;
269
- }
270
- #TB_window {
271
- z-index: 10000;
272
- }
273
- #calendar_<?php echo $many_sp_calendar; ?> .views {
274
- float: right;
275
- background-color: <?php echo $calendar_bg; ?>;
276
- height: 25px;
277
- width: <?php echo ($calendar_width / 4) - 2; ?>px;
278
- margin-left: 2px;
279
- text-align: center;
280
- cursor:pointer;
281
- position: relative;
282
- top: 3px;
283
- font-family: <?php echo $font_month; ?>;
284
- }
285
- #calendar_<?php echo $many_sp_calendar; ?> table tr {
286
- background: transparent !important;
287
- }
288
-
289
-
290
- #calendar_<?php echo $many_sp_calendar; ?> .views_select ,
291
- #calendar_<?php echo $many_sp_calendar; ?> #views_select
292
- {
293
-
294
- background-color: ".$views_tabs_bg_color.";
295
- width: 120px;
296
- text-align: center;
297
- cursor: pointer;
298
- padding: 6px;
299
- position: relative;
300
- }
301
-
302
-
303
- #drop_down_views
304
- {
305
- list-style-type:none !important;
306
- position: absolute;
307
- top: 46px;
308
- left: -15px;
309
- display:none;
310
- z-index: 4545;
311
-
312
- }
313
-
314
- #drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
315
- {
316
- background:<?php echo $bg_top ?>;
317
- }
318
-
319
- #drop_down_views >li
320
- {
321
- border-bottom:1px solid #fff !important;
322
- }
323
-
324
-
325
- #views_tabs_select
326
- {
327
- display:none;
328
- }
329
- </style>
330
- <div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
331
- <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; ?>">
332
- <tr style="background-color:#FFFFFF;">
333
- <td style="background-color:#FFFFFF;">
334
- <div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
335
- <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;'; ?>"
336
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
337
- 'action' => 'spiderbigcalendar_day_widget',
338
- 'theme_id' => $theme_id,
339
- 'calendar' => $calendar_id,
340
- 'select' => $view_select,
341
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
342
- 'many_sp_calendar' => $many_sp_calendar,
343
- 'cur_page_url' => $path_sp_cal,
344
- 'cat_id' => '',
345
- 'cat_ids' => $cat_ids,
346
- 'widget' => $widget,
347
- 'TB_iframe' => 1,
348
- ), 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>
349
- </div>
350
- <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;'; ?>"
351
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
352
- 'action' => 'spiderbigcalendar_week_widget',
353
- 'theme_id' => $theme_id,
354
- 'calendar' => $calendar_id,
355
- 'select' => $view_select,
356
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
357
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
358
- 'many_sp_calendar' => $many_sp_calendar,
359
- 'cur_page_url' => $path_sp_cal,
360
- 'cat_id' => '',
361
- 'cat_ids' => $cat_ids,
362
- 'widget' => $widget,
363
- 'TB_iframe' => 1,
364
- ), 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>
365
- </div>
366
- <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;' ?>"
367
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
368
- 'action' => 'spiderbigcalendar_list_widget',
369
- 'theme_id' => $theme_id,
370
- 'calendar' => $calendar_id,
371
- 'select' => $view_select,
372
- 'date' => $year . '-' . add_0((Month_num($month))),
373
- 'many_sp_calendar' => $many_sp_calendar,
374
- 'cur_page_url' => $path_sp_cal,
375
- 'cat_id' => '',
376
- 'cat_ids' => $cat_ids,
377
- 'widget' => $widget,
378
- 'TB_iframe' => 1,
379
- ), 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>
380
- </div>
381
- <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;'; ?>"
382
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
383
- 'action' => 'spiderbigcalendar_month_widget',
384
- 'theme_id' => $theme_id,
385
- 'calendar' => $calendar_id,
386
- 'select' => $view_select,
387
- 'date' => $year . '-' . add_0((Month_num($month))),
388
- 'many_sp_calendar' => $many_sp_calendar,
389
- 'cur_page_url' => $path_sp_cal,
390
- 'cat_id' => '',
391
- 'cat_ids' => $cat_ids,
392
- 'widget' => $widget,
393
- 'TB_iframe' => 1,
394
- ), 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>
395
- </div>
396
- </div>
397
- </td>
398
- </tr>
399
- <tr>
400
- <td width="100%" style="padding:0; margin:0;">
401
- <form action="" method="get" style="background:none; margin:0; padding:0;">
402
- <table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>">
403
- <tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
404
- <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%;" >
405
- <?php //MONTH TABLE ?>
406
- <table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
407
- <tr>
408
- <td style="text-align:left; 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 ($day == '01' && Month_num(Month_name(Month_num($month) - 1)) != '12') {
411
- $needed_date = $year . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
412
- }
413
- elseif (Month_num(Month_name(Month_num($month) - 1)) == '12' && $day == '01') {
414
- $needed_date = ($year - 1) . '-' . add_0((Month_num($month) - 1)) . '-' . $prev_month_day_count;
415
- }
416
- else {
417
- $needed_date = $year . '-' . add_0((Month_num($month))) . '-' . add_0($day - 1);
418
- }
419
- echo add_query_arg(array(
420
- 'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
421
- 'theme_id' => $theme_id,
422
- 'calendar' => $calendar_id,
423
- 'select' => $view_select,
424
- 'date' => $needed_date,
425
- 'many_sp_calendar' => $many_sp_calendar,
426
- 'cur_page_url' => $path_sp_cal,
427
- 'cat_id' => '',
428
- 'cat_ids' => $cat_ids,
429
- 'widget' => $widget,
430
- 'TB_iframe' => 1,
431
- ), admin_url('admin-ajax.php'));
432
- ?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">&#9668;
433
- </a>
434
- </td>
435
- <td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
436
- <input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
437
- <span style="font-size:<?php echo $year_font_size; ?>px;?>; color:<?php echo $text_color_month; ?>;"><?php echo $day . ' ' . __($month, 'sp_calendar') . ' ' . $year ?></span>
438
- </td>
439
- <td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
440
- <a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
441
- if ($day == $month_day_count && Month_num(Month_name(Month_num($month) + 1)) != '1') {
442
- $needed_date = $year . '-' . add_0((Month_num($month) + 1)) . '-01';
443
- }
444
- elseif (Month_num(Month_name(Month_num($month) + 1)) == '1' && $day == $month_day_count) {
445
- $needed_date = ($year + 1) . '-' . add_0(Month_num($month + 1)) . '-01';
446
- }
447
- else {
448
- $needed_date = $year . '-' . add_0(Month_num($month)) . '-' . add_0($day + 1);
449
- }
450
- echo add_query_arg(array(
451
- 'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
452
- 'theme_id' => $theme_id,
453
- 'calendar' => $calendar_id,
454
- 'select' => $view_select,
455
- 'date' => $needed_date,
456
- 'many_sp_calendar' => $many_sp_calendar,
457
- 'cur_page_url' => $path_sp_cal,
458
- 'cat_id' => '',
459
- 'cat_ids' => $cat_ids,
460
- 'widget' => $widget,
461
- 'TB_iframe' => 1,
462
- ), admin_url('admin-ajax.php'));
463
- ?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">&#9658;
464
- </a>
465
- </td>
466
- </tr>
467
- </table>
468
- </td>
469
- </tr>
470
-
471
- <tr>
472
- <td colspan="7">
473
- <?php
474
- $month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
475
- if ($weekstart == "su") {
476
- $month_first_weekday++;
477
- if ($month_first_weekday == 8) {
478
- $month_first_weekday = 1;
479
- }
480
- }
481
- $month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
482
- $last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
483
- $weekday_i = $month_first_weekday;
484
- $last_month_days = $last_month_days - $weekday_i + 2;
485
- $percent = 1;
486
- $sum = $month_days - 8 + $month_first_weekday;
487
- if ($sum % 7 <> 0) {
488
- $percent = $percent + 1;
489
- }
490
- $sum = $sum - ($sum % 7);
491
- $percent = $percent + ($sum / 7);
492
- $percent = 107 / $percent;
493
- $all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
494
- $categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
495
- $calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
496
- $array_days = $all_calendar_files[0]['array_days'];
497
- $array_days1 = $all_calendar_files[0]['array_days1'];
498
- $title = $all_calendar_files[0]['title'];
499
- $ev_ids = $all_calendar_files[0]['ev_ids'];
500
- sort($array_days, SORT_NUMERIC);
501
- if (!$array_days || !in_array((int) $day, $array_days)) {
502
- $week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
503
- echo '<table style="border-spacing:0;width:100%;">
504
- <tr>
505
- <td style="height:14px;font-size:12px; padding-left:10px;background-color:#D6D4D5; color:#6E7276">
506
- <span style="padding-left:10px; font-size:12px;color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
507
- <span style="font-size:12px;color:#949394;">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
508
- </td>
509
- </tr>
510
- <tr>
511
- <td>
512
- <table style="height:14px;border-spacing:0;width: 100%;background-color:#D6D4D5;">
513
- <tr>
514
- <td style="font-size:22px;font-weight:bold;width:15px;text-align:center;background-color:' . $bg . ';color:#949394;"></td>
515
- <td><p style="font-size:12px;color:' . $bg . ';border:none;">&nbsp;' . __('There Is No Event In This Day', 'sp_calendar') . '</p></td>
516
- </tr>
517
- </table>
518
- </td>
519
- </tr>
520
- </table>';
521
- }
522
- if (in_array((int) $day, $array_days)) {
523
- $week_day = date('D', mktime(0, 0, 0, Month_num($month), (int) $day , $year));
524
- echo '<table style="border-spacing:0;width:100%;">
525
- <tr>
526
- <td style="height:14px;font-size:12px; padding-left:10px;background-color:#D6D4D5; color:#6E7276">
527
- <span style="padding-left:10px; font-size:12px;color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
528
- <span style="font-size:12px;color:#949394;">(' . __($month,'sp_calendar') . ' ' . (int) $day . ', ' . $year . ')</span>
529
- </td>
530
- <tr>
531
- <td>';
532
- foreach ($title as $key => $value) {
533
- if ($key == (int) $day) {
534
- $ev_id = explode('<br>', $ev_ids[$key]);
535
- array_pop($ev_id);
536
- $ev_ids_inline = implode(',', $ev_id);
537
- $ev_title = explode('</p>', $value);
538
- array_pop($ev_title);
539
- for ($j = 0; $j < count($ev_title); $j++) {
540
- $query = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
541
- ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND
542
- " . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$ev_id[$j];
543
-
544
- $cat_color = $wpdb->get_row($query);
545
-
546
- if (($j + 1) % 2 == 0) {
547
- $color = $bg;
548
- $table_color = $calendar_bg;
549
- }
550
- else {
551
- $color = $bg;
552
- $table_color = $calendar_bg;
553
- }
554
- if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color="";};
555
- echo '<table style="border-spacing:0;height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
556
- <tr>
557
- <td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $calendar_bg . '">' . ($j + 1) . '</td>
558
- <td>
559
- <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="font-size:15px;background:none;text-decoration:none;color:#' . $ev_title_color . '; "
560
- href="' . add_query_arg(array(
561
- 'action' => 'spidercalendarbig',
562
- 'theme_id' => $theme_id,
563
- 'calendar_id' => $calendar_id,
564
- 'ev_ids' => $ev_ids_inline,
565
- 'eventID' => $ev_id[$j],
566
- 'date' => $year . '-' . add_0(Month_num($month)) . '-' . (int) $day,
567
- 'many_sp_calendar' => $many_sp_calendar,
568
- 'cur_page_url' => $path_sp_cal,
569
- 'widget' => $widget,
570
- 'TB_iframe' => 1,
571
- 'tbWidth' => $popup_width,
572
- 'tbHeight' => $popup_height,
573
- ), admin_url('admin-ajax.php')) . '"><b>' . $ev_title[$j] . '</b>
574
- </a>
575
- </td>
576
- </tr>
577
- </table>';
578
- }
579
- }
580
- }
581
- echo '</td></tr></table>';
582
- }
583
- ?>
584
- </td>
585
- </tr>
586
- <tr style="height:<?php echo $year_font_size + 2; ?>px; font-family: <?php echo $font_year; ?>;">
587
- <td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
588
- echo add_query_arg(array(
589
- 'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
590
- 'theme_id' => $theme_id,
591
- 'calendar' => $calendar_id,
592
- 'select' => $view_select,
593
- 'date' => ($year - 1) . '-' . add_0((Month_num($month))). '-' . $day,
594
- 'many_sp_calendar' => $many_sp_calendar,
595
- 'cur_page_url' => $path_sp_cal,
596
- 'widget' => $widget,
597
- 'cat_id' => '',
598
- 'cat_ids' => $cat_ids,
599
- 'TB_iframe' => 1,
600
- ), 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; ?>">
601
- <?php echo ($year - 1); ?>
602
- </td>
603
- <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; ?>">
604
- <?php echo $year; ?>
605
- </td>
606
- <td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
607
- echo add_query_arg(array(
608
- 'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
609
- 'theme_id' => $theme_id,
610
- 'calendar' => $calendar_id,
611
- 'select' => $view_select,
612
- 'date' => ($year + 1) . '-' . add_0((Month_num($month))). '-' . $day,
613
- 'many_sp_calendar' => $many_sp_calendar,
614
- 'cur_page_url' => $path_sp_cal,
615
- 'widget' => $widget,
616
- 'cat_id' => '',
617
- 'cat_ids' => $cat_ids,
618
- 'TB_iframe' => 1,
619
- ), 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; ?>">
620
- <?php echo ($year + 1); ?>
621
- </td>
622
- </tr>
623
- </table>
624
- <input type="text" value="1" name="day" style="display:none" />
625
- </form>
626
- </td>
627
- </tr>
628
- </table>
629
- </div>
630
- <style>
631
- #calendar_<?php echo $many_sp_calendar; ?> table{
632
- width: 100%;
633
- }
634
- .categories1 , .categories2
635
- {
636
- display:inline-block;
637
- }
638
-
639
- .categories2
640
- {
641
- position:relative;
642
- left: -9px;
643
- cursor:pointer;
644
- }
645
- .categories2:first-letter
646
- {
647
- color:#fff;
648
-
649
- }
650
- </style>
651
- <?php
652
-
653
- //reindex cat_ids_array
654
- $re_cat_ids_array = array_values($cat_ids_array);
655
-
656
- for($i=0; $i<count($re_cat_ids_array); $i++)
657
- {
658
- echo'
659
- <style>
660
- #cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
661
- {
662
- text-decoration:underline;
663
- cursor:pointer;
664
-
665
- }
666
-
667
- </style>';
668
-
669
- }
670
-
671
-
672
-
673
- if($cat_ids=='')
674
- $cat_ids='';
675
-
676
-
677
- echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none;">';
678
-
679
- foreach($categories as $category)
680
- {
681
-
682
- ?>
683
-
684
- <li style="height:30px"><p class="categories1" style="background-color:#<?php echo $category->color;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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(
685
- 'action' => 'spiderbigcalendar_day_widget',
686
- 'theme_id' => $theme_id,
687
- 'calendar' => $calendar_id,
688
- 'select' => $view_select,
689
- 'date' => $year . '-' . add_0(Month_num($month)) . '-' . add_0($day),
690
- 'many_sp_calendar' => $many_sp_calendar,
691
- 'cur_page_url' => $path_sp_cal,
692
- 'cat_id' => $category->id,
693
- 'cat_ids' => $cat_ids,
694
- 'widget' => $widget,
695
- 'TB_iframe' => 1,
696
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
697
-
698
-
699
- <?php
700
-
701
-
702
- }
703
-
704
- echo '</ul><br><br>';
705
-
706
- die();
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; ?>')">&#9668;
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; ?>')">&#9658;
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;">&nbsp;' . __('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;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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
- $bg_top = '#' . $theme->bg_top;
90
- $bg_bottom = '#' . $theme->bg_bottom;
91
- $border_color = '#' . $theme->border_color;
92
- $text_color_year = '#' . $theme->text_color_year;
93
- $text_color_month = '#' . $theme->text_color_month;
94
- $color_week_days = '#' . $theme->text_color_week_days;
95
- $text_color_other_months = '#' . $theme->text_color_other_months;
96
- $text_color_this_month_unevented = '#' . $theme->text_color_this_month_unevented;
97
- $evented_color = '#' . $theme->text_color_this_month_evented;
98
- $evented_color_bg = '#' . $theme->bg_color_this_month_evented;
99
- $color_arrow_year = '#' . $theme->arrow_color_year;
100
- $color_arrow_month = '#' . $theme->arrow_color_month;
101
- $sun_days = '#' . $theme->text_color_sun_days;
102
- $event_title_color = '#' . $theme->event_title_color;
103
- $current_day_border_color = '#' . $theme->current_day_border_color;
104
- $cell_border_color = '#' . $theme->cell_border_color;
105
- $cell_height = $theme->cell_height;
106
- $popup_width = $theme->popup_width;
107
- $popup_height = $theme->popup_height;
108
- $number_of_shown_evetns = $theme->number_of_shown_evetns;
109
- $sundays_font_size = $theme->sundays_font_size;
110
- $other_days_font_size = $theme->other_days_font_size;
111
- $weekdays_font_size = $theme->weekdays_font_size;
112
- $border_width = $theme->border_width;
113
- $top_height = $theme->top_height;
114
- $bg_color_other_months = '#' . $theme->bg_color_other_months;
115
- $sundays_bg_color = '#' . $theme->sundays_bg_color;
116
- $weekdays_bg_color = '#' . $theme->weekdays_bg_color;
117
- $weekstart = $theme->week_start_day;
118
- $weekday_sunday_bg_color = '#' . $theme->weekday_sunday_bg_color;
119
- $border_radius = $theme->border_radius;
120
- $border_radius2 = $border_radius-$border_width;
121
- $week_days_cell_height = $theme->week_days_cell_height;
122
- $year_font_size = $theme->year_font_size;
123
- $month_font_size = $theme->month_font_size;
124
- $arrow_size = $theme->arrow_size;
125
- $arrow_size_hover = $arrow_size + 5;
126
- $next_month_text_color = '#' . $theme->next_month_text_color;
127
- $prev_month_text_color = '#' . $theme->prev_month_text_color;
128
- $next_month_arrow_color = '#' . $theme->next_month_arrow_color;
129
- $prev_month_arrow_color = '#' . $theme->prev_month_arrow_color;
130
- $next_month_font_size = $theme->next_month_font_size;
131
- $prev_month_font_size = $theme->prev_month_font_size;
132
- $month_type = $theme->month_type;
133
- $date_bg_color = '#' . $theme->date_bg_color;
134
- $event_bg_color1 = '#' . $theme->event_bg_color1;
135
- $event_bg_color2 = '#' . $theme->event_bg_color2;
136
- $event_num_bg_color1 = '#' . $theme->event_num_bg_color1;
137
- $event_num_bg_color2 = '#' . $theme->event_num_bg_color2;
138
- $event_num_color = '#' . $theme->event_num_color;
139
- $date_font_size = $theme->date_font_size;
140
- $event_num_font_size = $theme->event_num_font_size;
141
- $event_table_height = $theme->event_table_height;
142
- $date_height = $theme->date_height;
143
- $day_month_font_size = $theme->day_month_font_size;
144
- $week_font_size = $theme->week_font_size;
145
- $day_month_font_color = '#' . $theme->day_month_font_color;
146
- $week_font_color = '#' . $theme->week_font_color;
147
- $views_tabs_bg_color = '#' . $theme->views_tabs_bg_color;
148
- $views_tabs_text_color = '#' . $theme->views_tabs_text_color;
149
- $views_tabs_font_size = $theme->views_tabs_font_size;
150
-
151
- $date_bg_color = '#' . $theme->date_bg_color;
152
- $event_bg_color1 = '#' . $theme->event_bg_color1;
153
- $event_bg_color2 = '#' . $theme->event_bg_color2;
154
- $event_num_bg_color1 = '#' . $theme->event_num_bg_color1;
155
- $event_num_bg_color2 = '#' . $theme->event_num_bg_color2;
156
- $event_num_color = '#' . $theme->event_num_color;
157
- $date_font_size = $theme->date_font_size;
158
- $event_num_font_size = $theme->event_num_font_size;
159
- $show_numbers_for_events = $theme->day_start;
160
-
161
- __('January', 'sp_calendar');
162
- __('February', 'sp_calendar');
163
- __('March', 'sp_calendar');
164
- __('April', 'sp_calendar');
165
- __('May', 'sp_calendar');
166
- __('June', 'sp_calendar');
167
- __('July', 'sp_calendar');
168
- __('August', 'sp_calendar');
169
- __('September', 'sp_calendar');
170
- __('October', 'sp_calendar');
171
- __('November', 'sp_calendar');
172
- __('December', 'sp_calendar');
173
- if ($cell_height == '') {
174
- $cell_height = 70;
175
- }
176
- if ($cal_width == '') {
177
- $cal_width = 700;
178
- }
179
-
180
- if ($date != '') {
181
- $date_REFERER = $date;
182
- }
183
- else {
184
- $date_REFERER = date("Y-m");
185
- $date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
186
- }
187
- $year_REFERER = substr($date_REFERER, 0, 4);
188
- $month_REFERER = Month_name(substr($date_REFERER, 5, 2));
189
- $day_REFERER = substr($date_REFERER, 8, 2);
190
-
191
- $year = substr($date, 0, 4);
192
- $month = Month_name(substr($date, 5, 2));
193
- $day = substr($date, 8, 2);
194
-
195
- $cell_width = $cal_width / 7;
196
-
197
- $this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
198
- $prev_month = add_0((int) $this_month - 1);
199
- $next_month = add_0((int) $this_month + 1);
200
-
201
- $view = 'bigcalendarlist';
202
- $views = explode(',', $view_select);
203
- $defaultview = 'list';
204
- array_pop($views);
205
- $display = '';
206
- if (count($views) == 0) {
207
- $display = "display:none";
208
- }
209
- if(count($views) == 1 && $views[0] == $defaultview) {
210
- $display = "display:none";
211
- }
212
- ?>
213
- <style type='text/css'>
214
- .general_table table table:last-child .last_table:last-child td{
215
- border-bottom-left-radius:<?php echo $border_radius2?>px;
216
-
217
- }
218
-
219
- #bigcalendar<?php echo $many_sp_calendar; ?> td,
220
- #bigcalendar<?php echo $many_sp_calendar; ?> tr,
221
- #spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
222
- border: none !important;
223
- }
224
- #bigcalendar<?php echo $many_sp_calendar; ?> . general_table {
225
- border-radius: <?php echo $border_radius; ?>px !important;
226
- }
227
- #bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
228
- border-top-left-radius: <?php echo $border_radius2; ?>px !important;
229
- border-top-right-radius: <?php echo $border_radius2; ?>px !important;
230
- }
231
-
232
-
233
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow a : link,
234
- #bigcalendar .cala_arrow a:visited {
235
- text-decoration: none !important;
236
- background: none !important;
237
- font-size: <?php echo $arrow_size; ?>px !important;
238
- }
239
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow {
240
- vertical-align: middle !important;
241
- }
242
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow a : hover {
243
- font-size: <?php echo $arrow_size_hover; ?>px !important;
244
- text-decoration: none !important;
245
- background: none !important;
246
- }
247
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : link,
248
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : visited {
249
- text-decoration: none !important;
250
- background: none !important;
251
- font-size: 12px !important;
252
- color: red;
253
- }
254
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : hover {
255
- text-decoration: none !important;
256
- background: none !important;
257
- }
258
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day {
259
- border: 1px solid <?php echo $cell_border_color; ?> !important;
260
- <?php echo 'vertical-align:top !important;'; ?>
261
- }
262
- #bigcalendar<?php echo $many_sp_calendar; ?> . weekdays {
263
- vertical-align: middle !important;
264
- border: 1px solid <?php echo $cell_border_color; ?> !important;
265
- }
266
- #bigcalendar<?php echo $many_sp_calendar; ?> . week_days {
267
- font-size: <?php echo $weekdays_font_size; ?>px !important;
268
- }
269
- #bigcalendar<?php echo $many_sp_calendar; ?> . calyear_table {
270
- border-spacing: 0 !important;
271
- width: 100% !important;
272
- }
273
- . calyear_table table #bigcalendar<?php echo $many_sp_calendar; ?> . calmonth_table {
274
- border-spacing: 0 !important;
275
- width: 100% !important;
276
- }
277
- #bigcalendar<?php echo $many_sp_calendar; ?> . calbg,
278
- #bigcalendar .calbg td {
279
- text-align: center !important;
280
- width: 14% !important;
281
- }
282
- #bigcalendar<?php echo $many_sp_calendar; ?> . caltext_color_other_months {
283
- color: <?php echo $text_color_other_months; ?> !important;
284
- border: 1px solid <?php echo $cell_border_color; ?> !important;
285
- <?php echo 'vertical-align:top !important;'; ?>
286
- }
287
- #bigcalendar<?php echo $many_sp_calendar; ?> . caltext_color_this_month_unevented {
288
- color: <?php echo $text_color_this_month_unevented; ?> !important;
289
- }
290
- #bigcalendar<?php echo $many_sp_calendar; ?> . calfont_year {
291
- font-size: 24px !important;
292
- font-weight: bold !important;
293
- color: <?php echo $text_color_year; ?> !important;
294
- }
295
- .general_table table, .general_table td, .general_table tr {
296
- border: inherit !important;
297
- vertical-align: initial !important;
298
- border-collapse: inherit !important;
299
- margin: inherit !important;
300
- padding: inherit !important;
301
- }
302
- .general_table {
303
- border-collapse: inherit !important;
304
- margin: inherit !important;
305
- }
306
- .general_table p {
307
- margin: inherit !important;
308
- padding: inherit !important;
309
- }
310
- #bigcalendar<?php echo $many_sp_calendar; ?> . calsun_days {
311
- color: <?php echo $sun_days; ?> !important;
312
- border: 1px solid <?php echo $cell_border_color; ?> !important;
313
- <?php echo 'vertical-align:top !important; text-align:left !important;'; ?>
314
- background-color: <?php echo $sundays_bg_color; ?> !important;
315
- }
316
- #TB_window {
317
- z-index: 10000;
318
- }
319
-
320
- #bigcalendar<?php echo $many_sp_calendar; ?> td {
321
- vertical-align: middle !important;
322
- }
323
- #bigcalendar<?php echo $many_sp_calendar; ?> table {
324
- border-collapse: initial;
325
- border:0px;
326
- max-width: none;
327
- }
328
- #bigcalendar<?php echo $many_sp_calendar; ?> table tr:hover td {
329
- background: none;
330
- }
331
- #bigcalendar<?php echo $many_sp_calendar; ?> table td {
332
- padding: 0px;
333
- vertical-align: none;
334
- border-top:none;
335
- line-height: none;
336
- text-align: none;
337
- }
338
- #bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
339
- margin-bottom:0;
340
- }
341
- #bigcalendar<?php echo $many_sp_calendar; ?> td,
342
- #bigcalendar<?php echo $many_sp_calendar; ?> tr,
343
- #spiderCalendarTitlesList td,
344
- #spiderCalendarTitlesList tr {
345
- border:none;
346
- }
347
- #bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
348
- border-radius: <?php echo $border_radius; ?>px;
349
- }
350
- #bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
351
- border-top-left-radius: <?php echo $border_radius2; ?>px;
352
- border-top-right-radius: <?php echo $border_radius2; ?>px;
353
- }
354
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
355
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
356
- text-decoration:none;
357
- background:none;
358
- font-size: <?php echo $arrow_size; ?>px;
359
- }
360
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
361
- text-decoration:none;
362
- background:none;
363
- }
364
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
365
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
366
- text-decoration:none;
367
- background:none;
368
- font-size:12px;
369
- color:red;
370
- }
371
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
372
- text-decoration:none;
373
- background:none;
374
- }
375
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
376
- border:1px solid <?php echo $cell_border_color; ?>;
377
- vertical-align:top;
378
- }
379
- #bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
380
- border:1px solid <?php echo $cell_border_color; ?>;
381
- }
382
- #bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
383
- font-size:<?php echo $weekdays_font_size; ?>px;
384
- }
385
- #bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
386
- border-spacing:0;
387
- width:100%;
388
- }
389
- #bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
390
- border-spacing:0;
391
- width:100%;
392
- }
393
- #bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
394
- #bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
395
- text-align:center;
396
- width:14%;
397
- }
398
- #bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
399
- color:<?php echo $text_color_other_months; ?>;
400
- border:1px solid <?php echo $cell_border_color; ?>;
401
- vertical-align:top;
402
- }
403
- #bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
404
- color:<?php echo $text_color_this_month_unevented; ?>;
405
- }
406
- #bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
407
- font-size:24px;
408
- font-weight:bold;
409
- color:<?php echo $text_color_year; ?>;
410
- }
411
- #bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
412
- color:<?php echo $sun_days; ?>;
413
- border:1px solid <?php echo $cell_border_color; ?>;
414
- vertical-align:top;
415
- text-align:left;
416
- background-color:<?php echo $sundays_bg_color; ?>;
417
- }
418
- #bigcalendar<?php echo $many_sp_calendar; ?> .views {
419
- float: right;
420
- background-color: <?php echo $views_tabs_bg_color; ?>;
421
- min-height: 25px;
422
- min-width: 70px;
423
- margin-right: 2px;
424
- text-align: center;
425
- cursor:pointer;
426
- position: relative;
427
- top: 5px;
428
- }
429
- #bigcalendar<?php echo $many_sp_calendar; ?> .views span{
430
- padding: 7px;
431
- }
432
-
433
- #bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
434
- #bigcalendar<?php echo $many_sp_calendar; ?> #views_select
435
- {
436
-
437
- background-color: <?php echo $views_tabs_bg_color?>;
438
- width: 120px;
439
- text-align: center;
440
- cursor: pointer;
441
- padding: 6px;
442
- position: relative;
443
- }
444
-
445
-
446
- #drop_down_views
447
- {
448
- list-style-type:none !important;
449
- position: absolute;
450
- top: 46px;
451
- left: -15px;
452
- display:none;
453
- z-index: 4545;
454
-
455
- }
456
-
457
- #drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
458
- {
459
- background:<?php echo $bg_top ?>;
460
- }
461
-
462
- #drop_down_views >li
463
- {
464
- border-bottom:1px solid #fff !important;
465
- }
466
-
467
-
468
- #views_tabs_select
469
- {
470
- display:none;
471
- }
472
-
473
- </style>
474
- <div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
475
- <div style="width:100%;">
476
- <table cellpadding="0" cellspacing="0" style="width:100%;">
477
- <tr>
478
- <td>
479
-
480
- <div id="views_tabs" style="width: 100.4%;<?php echo $display; ?>">
481
- <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;'; ?>"
482
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
483
- 'action' => 'spiderbigcalendar_day',
484
- 'theme_id' => $theme_id,
485
- 'calendar' => $calendar_id,
486
- 'select' => $view_select,
487
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
488
- 'many_sp_calendar' => $many_sp_calendar,
489
- 'cur_page_url' => $path_sp_cal,
490
- 'cat_id' => '',
491
- 'cat_ids' => $cat_ids,
492
- 'widget' => $widget,
493
- 'rand' => $many_sp_calendar,
494
- ), 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>
495
- </div>
496
- <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;'; ?>"
497
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
498
- 'action' => 'spiderbigcalendar_week',
499
- 'theme_id' => $theme_id,
500
- 'calendar' => $calendar_id,
501
- 'select' => $view_select,
502
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
503
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
504
- 'many_sp_calendar' => $many_sp_calendar,
505
- 'cur_page_url' => $path_sp_cal,
506
- 'cat_id' => '',
507
- 'cat_ids' => $cat_ids,
508
- 'widget' => $widget,
509
- 'rand' => $many_sp_calendar,
510
- ), 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>
511
- </div>
512
- <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;'; ?>"
513
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
514
- 'action' => 'spiderbigcalendar_list',
515
- 'theme_id' => $theme_id,
516
- 'calendar' => $calendar_id,
517
- 'select' => $view_select,
518
- 'date' => $year . '-' . add_0((Month_num($month))),
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
- 'rand' => $many_sp_calendar,
525
- ), 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>
526
- </div>
527
- <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;'; ?>"
528
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
529
- 'action' => 'spiderbigcalendar_month',
530
- 'theme_id' => $theme_id,
531
- 'calendar' => $calendar_id,
532
- 'select' => $view_select,
533
- 'date' => $year . '-' . add_0((Month_num($month))),
534
- 'many_sp_calendar' => $many_sp_calendar,
535
- 'cur_page_url' => $path_sp_cal,
536
- 'cat_id' => '',
537
- 'cat_ids' => $cat_ids,
538
- 'widget' => $widget,
539
- 'rand' => $many_sp_calendar,
540
- ), 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>
541
- </div>
542
- </div>
543
-
544
- <div id="views_tabs_select" style="display:none" >
545
- <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">
546
- <?php if($view=='bigcalendarday') echo 'Day'; ?>
547
- <?php if($view=='bigcalendarmonth') echo 'Month'; ?>
548
- <?php if($view=='bigcalendarweek') echo 'Week'; ?>
549
- <?php if($view=='bigcalendarlist') echo 'List'; ?>
550
- <span>&#9658;</span>
551
- </div>
552
- <ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
553
- <li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
554
- <div class="views_select"
555
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
556
- 'action' => 'spiderbigcalendar_month',
557
- 'theme_id' => $theme_id,
558
- 'calendar' => $calendar_id,
559
- 'select' => $view_select,
560
- 'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
561
- 'many_sp_calendar' => $many_sp_calendar,
562
- 'cur_page_url' => $path_sp_cal,
563
- 'cat_id' => '',
564
- 'cat_ids' => $cat_ids,
565
- 'widget' => $widget,
566
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
567
- <span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
568
- </div>
569
- </li>
570
-
571
- <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"
572
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
573
- 'action' => 'spiderbigcalendar_week',
574
- 'theme_id' => $theme_id,
575
- 'calendar' => $calendar_id,
576
- 'select' => $view_select,
577
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
578
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
579
- 'many_sp_calendar' => $many_sp_calendar,
580
- 'cur_page_url' => $path_sp_cal,
581
- 'cat_id' => '',
582
- 'cat_ids' => $cat_ids,
583
- 'widget' => $widget,
584
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
585
- <span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
586
- </div>
587
- </li>
588
-
589
- <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"
590
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
591
- 'action' => 'spiderbigcalendar_list',
592
- 'theme_id' => $theme_id,
593
- 'calendar' => $calendar_id,
594
- 'select' => $view_select,
595
- 'date' => $year . '-' . add_0((Month_num($month))),
596
- 'many_sp_calendar' => $many_sp_calendar,
597
- 'cur_page_url' => $path_sp_cal,
598
- 'cat_id' => '',
599
- 'cat_ids' => $cat_ids,
600
- 'widget' => $widget,
601
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
602
- <span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
603
- </div>
604
- </li>
605
-
606
- <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"
607
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
608
- 'action' => 'spiderbigcalendar_month',
609
- 'theme_id' => $theme_id,
610
- 'calendar' => $calendar_id,
611
- 'select' => $view_select,
612
- 'date' => $year . '-' . add_0((Month_num($month))),
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">Month</span></div></li>
620
-
621
- </ul>
622
- </div>
623
- </td>
624
- </tr>
625
- <tr>
626
- <td>
627
- <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; ?>;">
628
- <tr>
629
- <td width="100%" style=" padding:0; margin:0">
630
- <table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100.3%">
631
- <tr style="height:40px; width:100%;">
632
- <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%; " >
633
- <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;">
634
- <tr>
635
- <td style="width:100%;vertical-align:center">
636
- <table style="width:100%;">
637
- <tr>
638
- <td width="15%">
639
- <div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
640
- echo add_query_arg(array(
641
- 'action' => 'spiderbigcalendar_' . $defaultview,
642
- 'theme_id' => $theme_id,
643
- 'calendar' => $calendar_id,
644
- 'select' => $view_select,
645
- 'date' => ($year - 1) . '-' . add_0((Month_num($month))),
646
- 'many_sp_calendar' => $many_sp_calendar,
647
- 'cur_page_url' => $path_sp_cal,
648
- 'cat_id' => '',
649
- 'cat_ids' => $cat_ids,
650
- 'widget' => $widget,
651
- ), 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;">
652
- <span style="font-size:18px; color:#FFF"><?php echo $year-1; ?></span>
653
- </div>
654
- </td>
655
- <td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
656
- <a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
657
- if (Month_num($month) == 1) {
658
- $needed_date = ($year - 1) . '-12';
659
- }
660
- else {
661
- $needed_date = $year . '-' . add_0((Month_num($month) - 1));
662
- }
663
- echo add_query_arg(array(
664
- 'action' => 'spiderbigcalendar_' . $defaultview,
665
- 'theme_id' => $theme_id,
666
- 'calendar' => $calendar_id,
667
- 'select' => $view_select,
668
- 'date' => $needed_date,
669
- 'many_sp_calendar' => $many_sp_calendar,
670
- 'cur_page_url' => $path_sp_cal,
671
- 'cat_id' => '',
672
- 'cat_ids' => $cat_ids,
673
- 'widget' => $widget,
674
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">&#9664;
675
- </a>
676
- </td>
677
- <td style="text-align:center; margin:0;" width="40%">
678
- <input type="hidden" name="month" readonly="" value="<?php echo $month?>"/>
679
- <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>
680
- </td>
681
- <td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
682
- <a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
683
- if (Month_num($month) == 12) {
684
- $needed_date = ($year + 1) . '-01';
685
- }
686
- else {
687
- $needed_date = $year . '-' . add_0((Month_num($month) + 1));
688
- }
689
- echo add_query_arg(array(
690
- 'action' => 'spiderbigcalendar_' . $defaultview,
691
- 'theme_id' => $theme_id,
692
- 'calendar' => $calendar_id,
693
- 'select' => $view_select,
694
- 'date' => $needed_date,
695
- 'many_sp_calendar' => $many_sp_calendar,
696
- 'cur_page_url' => $path_sp_cal,
697
- 'cat_id' => '',
698
- 'cat_ids' => $cat_ids,
699
- 'widget' => $widget,
700
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">&#9654;
701
- </a>
702
- </td>
703
- <td width="15%">
704
- <div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
705
- echo add_query_arg(array(
706
- 'action' => 'spiderbigcalendar_' . $defaultview,
707
- 'theme_id' => $theme_id,
708
- 'calendar' => $calendar_id,
709
- 'select' => $view_select,
710
- 'date' => ($year + 1) . '-' . add_0((Month_num($month))),
711
- 'many_sp_calendar' => $many_sp_calendar,
712
- 'cur_page_url' => $path_sp_cal,
713
- 'cat_id' => '',
714
- 'cat_ids' => $cat_ids,
715
- 'widget' => $widget,
716
- ), 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;">
717
- <span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
718
- </div>
719
- </td>
720
- </tr>
721
- </table>
722
- </td>
723
- </tr>
724
- </table>
725
- </td>
726
-
727
- </tr>
728
- </tr>
729
- <tr>
730
- <td>
731
- <?php
732
- $month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
733
- if ($weekstart == "su") {
734
- $month_first_weekday++;
735
- if ($month_first_weekday == 8) {
736
- $month_first_weekday = 1;
737
- }
738
- }
739
- $month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
740
- $last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
741
- $weekday_i = $month_first_weekday;
742
- $last_month_days = $last_month_days - $weekday_i + 2;
743
- $percent = 1;
744
- $sum = $month_days - 8 + $month_first_weekday;
745
- if ($sum % 7 <> 0) {
746
- $percent = $percent + 1;
747
- }
748
- $sum = $sum - ($sum % 7);
749
- $percent = $percent + ($sum / 7);
750
- $percent = 107 / $percent;
751
- $all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
752
-
753
- $categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
754
- $calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
755
- $array_days = $all_calendar_files[0]['array_days'];
756
- $array_days1 = $all_calendar_files[0]['array_days1'];
757
- $title = $all_calendar_files[0]['title'];
758
- $ev_ids = $all_calendar_files[0]['ev_ids'];
759
-
760
-
761
- sort($array_days, SORT_NUMERIC);
762
- if (!$array_days) {
763
- echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '">
764
- <tr>
765
- <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>
766
- <td><p style="color:' . $event_title_color . '; border:none">&nbsp;' . __('There Is No Event In This Month', 'sp_calendar') . '</p></td>
767
- </tr>
768
- </table>';
769
- }
770
- for ($i = 0; $i < count($array_days); $i++) {
771
- $week_day = date('D', mktime(0, 0, 0, Month_num($month), $array_days[$i], $year));
772
- echo '<table style="width:100%;border-spacing:0;">
773
- <tr>
774
- <td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
775
- <span style="padding-left:10px; font-size:' . $date_font_size . 'px;color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
776
- <span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . add_0($array_days[$i]) . ' ' . __($month,'sp_calendar') . ')</span>
777
- </td>
778
- </tr>
779
- <tr>
780
- <td>';
781
- foreach ($title as $key => $value) {
782
- if ($key == $array_days[$i]) {
783
- $ev_id = explode('<br>', $ev_ids[$key]);
784
- array_pop($ev_id);
785
- $ev_ids_inline = implode(',', $ev_id);
786
- $ev_title = explode('</p>', $value);
787
- array_pop($ev_title);
788
- for ($j = 0; $j < count($ev_title); $j++) {
789
- $queryy = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
790
- ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND
791
- " . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$ev_id[$j];
792
-
793
- $cat_color = $wpdb->get_row($queryy);
794
-
795
- if (($j + 1) % 2 == 0) {
796
- $color = $event_num_bg_color2;
797
- $table_color = $event_bg_color2;
798
- }
799
- else {
800
- $color = $event_num_bg_color1;
801
- $table_color = $event_bg_color1;
802
- }
803
- if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color="";};
804
- echo '<table class="last_table" style="overflow:hidden;height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . ';">
805
- <tr>
806
- <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>
807
- <td>
808
- <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:13px;background:none;color:' . $event_title_color . ';"
809
- href="' . add_query_arg(array(
810
- 'action' => 'spidercalendarbig',
811
- 'theme_id' => $theme_id,
812
- 'calendar_id' => $calendar_id,
813
- 'ev_ids' => $ev_ids_inline,
814
- 'eventID' => $ev_id[$j],
815
- 'date' => $year . '-' . add_0(Month_num($month)) . '-' . $array_days[$i],
816
- 'many_sp_calendar' => $many_sp_calendar,
817
- 'cur_page_url' => $path_sp_cal,
818
- 'widget' => $widget,
819
- 'TB_iframe' => 1,
820
- 'tbWidth' => $popup_width,
821
- 'tbHeight' => $popup_height,
822
- ), admin_url('admin-ajax.php')) . '"><b>'.$ev_title[$j].'</b>
823
- </a>
824
- </td>
825
- </tr>
826
- </table>';
827
- }
828
- }
829
- }
830
- echo '</td></tr></table>';
831
- }
832
- ?>
833
- </td>
834
- </tr>
835
- </table>
836
- </tr>
837
- </table>
838
- </td>
839
- </tr>
840
- </table>
841
-
842
- <script>
843
-
844
- jQuery(document).ready(function (){
845
-
846
- jQuery('#views_select').click(function () {
847
- jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
848
- }, function () {
849
- jQuery('#drop_down_views').stop(true, true).slideUp(500);
850
- });
851
- if(jQuery(window).width() > 640 )
852
- {
853
- jQuery('drop_down_views').hide();
854
- }
855
- });
856
- </script>
857
-
858
-
859
- <style>
860
-
861
- @media only screen and (max-width : 640px) {
862
-
863
- #views_tabs ,#drop_down_views
864
- {
865
- display:none;
866
- }
867
-
868
- #views_tabs_select
869
- {
870
- display:block !important;
871
- }
872
-
873
-
874
-
875
- }
876
-
877
- @media only screen and (max-width : 968px) {
878
- #cats >li
879
- {
880
- float:none;
881
- }
882
-
883
-
884
-
885
- }
886
- .categories1 , .categories2
887
- {
888
- display:inline-block;
889
- }
890
-
891
- .categories2
892
- {
893
- position:relative;
894
- left: -9px;
895
- cursor:pointer;
896
- }
897
- .categories2:first-letter
898
- {
899
- color:#fff;
900
-
901
- }
902
- </style>
903
- <?php
904
-
905
- //reindex cat_ids_array
906
- $re_cat_ids_array = array_values($cat_ids_array);
907
-
908
- for($i=0; $i<count($re_cat_ids_array); $i++)
909
- {
910
- echo'
911
- <style>
912
- #cats #category'.$re_cat_ids_array[$i].'
913
- {
914
- text-decoration:underline;
915
- cursor:pointer;
916
-
917
- }
918
-
919
- </style>';
920
-
921
- }
922
-
923
-
924
-
925
- if($cat_ids=='')
926
- $cat_ids='';
927
-
928
-
929
- echo '<ul id="cats" style="list-style-type:none;">';
930
-
931
- foreach($categories as $category)
932
- {
933
-
934
- ?>
935
-
936
- <li style="float:left;"><p class="categories1" style="background-color:#<?php echo $category->color;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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(
937
- 'action' => 'spiderbigcalendar_list',
938
- 'theme_id' => $theme_id,
939
- 'calendar' => $calendar_id,
940
- 'select' => $view_select,
941
- 'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
942
- 'many_sp_calendar' => $many_sp_calendar,
943
- 'cur_page_url' => $path_sp_cal,
944
- 'cat_id' => $category->id,
945
- 'cat_ids' => $cat_ids,
946
- 'widget' => $widget,
947
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
948
-
949
-
950
- <?php
951
-
952
-
953
- }
954
-
955
- echo '</ul><br><br>';
956
-
957
- die();
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>&#9658;</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; ?>')">&#9664;
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; ?>')">&#9654;
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">&nbsp;' . __('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;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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
- $bg_color_selected = '#' . $theme->bg_color_selected;
92
- $color_arrow = '#' . $theme->arrow_color;
93
- $evented_color = '#' . $theme->text_color_this_month_evented;
94
- $evented_color_bg = '#' . $theme->bg_color_this_month_evented;
95
- $sun_days = '#' . $theme->text_color_sun_days;
96
- $text_color_other_months = '#' . $theme->text_color_other_months;
97
- $text_color_this_month_unevented = '#' . $theme->text_color_this_month_unevented;
98
- $text_color_month = '#' . $theme->text_color_month;
99
- $color_week_days = '#' . $theme->text_color_week_days;
100
- $text_color_selected = '#' . $theme->text_color_selected;
101
- $border_day = '#' . $theme->border_day;
102
- $calendar_width = $theme->width;
103
- $calendar_bg = '#' . $theme->footer_bgcolor;
104
- $weekdays_bg_color = '#' . $theme->weekdays_bg_color;
105
- $weekday_su_bg_color = '#' . $theme->su_bg_color;
106
- $cell_border_color = '#' . $theme->cell_border_color;
107
- $year_font_size = $theme->year_font_size;
108
- $year_font_color = '#' . $theme->year_font_color;
109
- $year_tabs_bg_color = '#' . $theme->year_tabs_bg_color;
110
- $font_year = $theme->font_year;
111
- $font_month = $theme->font_month;
112
- $font_day = $theme->font_day;
113
- $font_weekday = $theme->font_weekday;
114
- $ev_title_color = $theme->ev_title_color;
115
- $popup_width = $theme->popup_width;
116
- $popup_height = $theme->popup_height;
117
-
118
- __('January', 'sp_calendar');
119
- __('February', 'sp_calendar');
120
- __('March', 'sp_calendar');
121
- __('April', 'sp_calendar');
122
- __('May', 'sp_calendar');
123
- __('June', 'sp_calendar');
124
- __('July', 'sp_calendar');
125
- __('August', 'sp_calendar');
126
- __('September', 'sp_calendar');
127
- __('October', 'sp_calendar');
128
- __('November', 'sp_calendar');
129
- __('December', 'sp_calendar');
130
- if ($date != '') {
131
- $date_REFERER = $date;
132
- }
133
- else {
134
- $date_REFERER = date("Y-m");
135
- $date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
136
- }
137
- $year_REFERER = substr($date_REFERER, 0, 4);
138
- $month_REFERER = Month_name(substr($date_REFERER, 5, 2));
139
- $day_REFERER = substr($date_REFERER, 8, 2);
140
-
141
- $year = substr($date, 0, 4);
142
- $month = Month_name(substr($date, 5, 2));
143
- $day = substr($date, 8, 2);
144
-
145
- $this_month = substr($year . '-' . add_0((Month_num($month))), 5, 2);
146
- $prev_month = add_0((int) $this_month - 1);
147
- $next_month = add_0((int) $this_month + 1);
148
-
149
- $cell_width = $calendar_width / 7;
150
- $cell_width = (int) $cell_width - 2;
151
-
152
- $view = 'bigcalendarlist_widget';
153
- $views = explode(',', $view_select);
154
- $defaultview = 'list';
155
- array_pop($views);
156
- $display = '';
157
- if (count($views) == 0) {
158
- $display = "display:none";
159
- }
160
- if(count($views) == 1 && $views[0] == $defaultview) {
161
- $display = "display:none";
162
- }
163
- ?>
164
- <style type='text/css'>
165
- #calendar_<?php echo $many_sp_calendar; ?> table {
166
- border-collapse: initial;
167
- border:0px;
168
- margin: 0;
169
- }
170
- #calendar_<?php echo $many_sp_calendar; ?> table td {
171
- padding: 0px;
172
- vertical-align: none;
173
- border-top:none;
174
- line-height: none;
175
- text-align: none;
176
- }
177
- #calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
178
- border:1px solid <?php echo $cell_border_color; ?>;
179
- font-family: <?php echo $font_day; ?>;
180
- }
181
- #calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
182
- margin-bottom: 0;
183
- }
184
- #calendar_<?php echo $many_sp_calendar; ?> td,
185
- #calendar_<?php echo $many_sp_calendar; ?> tr,
186
- #spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> td,
187
- #spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> tr {
188
- border:none;
189
- }
190
- #calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
191
- #calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
192
- color: <?php echo $color_arrow; ?>;
193
- text-decoration: none;
194
- background: none;
195
- font-size: 16px;
196
- }
197
- #calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
198
- color: <?php echo $color_arrow; ?>;
199
- text-decoration:none;
200
- background:none;
201
- }
202
- #calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
203
- #calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
204
- text-decoration:underline;
205
- background:none;
206
- font-size:11px;
207
- }
208
- #calendar_<?php echo $many_sp_calendar; ?> a {
209
- font-weight: normal;
210
- }
211
- #calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
212
- font-size:12px;
213
- text-decoration:none;
214
- background:none;
215
- }
216
- #calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
217
- border-spacing:0;
218
- width:100%;
219
- }
220
- #calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
221
- border-spacing: 0;
222
- vertical-align: middle;
223
- width: 100%;
224
- }
225
- #calendar_<?php echo $many_sp_calendar; ?> .calbg {
226
- background-color:<?php echo $bg; ?>;
227
- text-align:center;
228
- vertical-align: middle;
229
- }
230
- #calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
231
- color:<?php echo $text_color_other_months; ?>;
232
- }
233
- #calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
234
- color:<?php echo $text_color_this_month_unevented; ?>;
235
- }
236
- #calendar_<?php echo $many_sp_calendar; ?> .calfont_year {
237
- font-size:24px;
238
- font-weight:bold;
239
- color:<?php echo $year_font_color; ?>;
240
- }
241
- #calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
242
- color:<?php echo $sun_days; ?>;
243
- }
244
- #calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
245
- border: solid <?php echo $border_day; ?> 1px;
246
- }
247
- #TB_window {
248
- z-index: 10000;
249
- }
250
- #calendar_<?php echo $many_sp_calendar; ?> .views {
251
- float: right;
252
- background-color: <?php echo $calendar_bg; ?>;
253
- height: 25px;
254
- width: <?php echo ($calendar_width / 4) - 2; ?>px;
255
- margin-left: 2px;
256
- text-align: center;
257
- cursor:pointer;
258
- position: relative;
259
- top: 3px;
260
- font-family: <?php echo $font_month; ?>;
261
- }
262
- #calendar_<?php echo $many_sp_calendar; ?> table tr {
263
- background: transparent !important;
264
- }
265
-
266
- #calendar_<?php echo $many_sp_calendar; ?> .views_select ,
267
- #calendar_<?php echo $many_sp_calendar; ?> #views_select
268
- {
269
-
270
- background-color: <?php $views_tabs_bg_color?>;
271
- width: 120px;
272
- text-align: center;
273
- cursor: pointer;
274
- padding: 6px;
275
- position: relative;
276
- }
277
-
278
-
279
- #drop_down_views
280
- {
281
- list-style-type:none !important;
282
- position: absolute;
283
- top: 46px;
284
- left: -15px;
285
- display:none;
286
- z-index: 4545;
287
-
288
- }
289
-
290
- #drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
291
- {
292
- background:<?php echo $bg_top ?>;
293
- }
294
-
295
- #drop_down_views >li
296
- {
297
- border-bottom:1px solid #fff !important;
298
- }
299
-
300
-
301
- #views_tabs_select
302
- {
303
- display:none;
304
- }
305
- </style>
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; 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="width: 101%;margin-left: -2px;<?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
- 'TB_iframe' => 1,
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
- 'TB_iframe' => 1,
340
- ), 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>
341
- </div>
342
- <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;' ?>"
343
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
344
- 'action' => 'spiderbigcalendar_list_widget',
345
- 'theme_id' => $theme_id,
346
- 'calendar' => $calendar_id,
347
- 'select' => $view_select,
348
- 'date' => $year . '-' . add_0((Month_num($month))),
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 __('List', 'sp_calendar'); ?></span>
356
- </div>
357
- <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;'; ?>"
358
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
359
- 'action' => 'spiderbigcalendar_month_widget',
360
- 'theme_id' => $theme_id,
361
- 'calendar' => $calendar_id,
362
- 'select' => $view_select,
363
- 'date' => $year . '-' . add_0((Month_num($month))),
364
- 'many_sp_calendar' => $many_sp_calendar,
365
- 'cur_page_url' => $path_sp_cal,
366
- 'cat_id' => '',
367
- 'cat_ids' => $cat_ids,
368
- 'widget' => $widget,
369
- 'TB_iframe' => 1,
370
- ), 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>
371
- </div>
372
- </div>
373
- </td>
374
- </tr>
375
- <tr>
376
- <td width="100%" style="padding:0; margin:0;">
377
- <form action="" method="get" style="background:none; margin:0; padding:0;">
378
- <table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>">
379
- <tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
380
- <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%;" >
381
- <?php //MONTH TABLE ?>
382
- <table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
383
- <tr>
384
- <td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
385
- <a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
386
- if (Month_num($month) == 1) {
387
- $needed_date = ($year - 1) . '-12';
388
- }
389
- else {
390
- $needed_date = $year . '-' . add_0((Month_num($month) - 1));
391
- }
392
- echo add_query_arg(array(
393
- 'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
394
- 'theme_id' => $theme_id,
395
- 'calendar' => $calendar_id,
396
- 'select' => $view_select,
397
- 'date' => $needed_date,
398
- 'many_sp_calendar' => $many_sp_calendar,
399
- 'cur_page_url' => $path_sp_cal,
400
- 'cat_id' => '',
401
- 'cat_ids' => $cat_ids,
402
- 'widget' => $widget,
403
- 'TB_iframe' => 1,
404
- ), admin_url('admin-ajax.php'));
405
- ?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">&#9668;
406
- </a>
407
- </td>
408
- <td width="60%" style="text-align:center; margin:0; padding:0; font-family:<?php echo $font_month; ?>">
409
- <input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
410
- <span style="font-size:<?php echo $year_font_size; ?>px;?>; color:<?php echo $text_color_month; ?>;"><?php echo __($month, 'sp_calendar'); ?></span>
411
- </td>
412
- <td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
413
- <a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
414
- if (Month_num($month) == 12) {
415
- $needed_date = ($year + 1) . '-01';
416
- }
417
- else {
418
- $needed_date = $year . '-' . add_0((Month_num($month) + 1));
419
- }
420
- echo add_query_arg(array(
421
- 'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
422
- 'theme_id' => $theme_id,
423
- 'calendar' => $calendar_id,
424
- 'select' => $view_select,
425
- 'date' => $needed_date,
426
- 'many_sp_calendar' => $many_sp_calendar,
427
- '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; ?>')">&#9658;
434
- </a>
435
- </td>
436
- </tr>
437
- </table>
438
- </td>
439
- </tr>
440
-
441
- <tr>
442
- <td colspan="7">
443
- <?php
444
- $month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
445
- if ($weekstart == "su") {
446
- $month_first_weekday++;
447
- if ($month_first_weekday == 8) {
448
- $month_first_weekday = 1;
449
- }
450
- }
451
- $month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
452
- $last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
453
- $weekday_i = $month_first_weekday;
454
- $last_month_days = $last_month_days - $weekday_i + 2;
455
- $percent = 1;
456
- $sum = $month_days - 8 + $month_first_weekday;
457
- if ($sum % 7 <> 0) {
458
- $percent = $percent + 1;
459
- }
460
- $sum = $sum - ($sum % 7);
461
- $percent = $percent + ($sum / 7);
462
- $percent = 107 / $percent;
463
- $all_calendar_files = php_getdays(0, $calendar_id, $date, $theme_id, $widget);
464
- $categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
465
- $calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
466
- $array_days = $all_calendar_files[0]['array_days'];
467
- $array_days1 = $all_calendar_files[0]['array_days1'];
468
- $title = $all_calendar_files[0]['title'];
469
- $ev_ids = $all_calendar_files[0]['ev_ids'];
470
- sort($array_days, SORT_NUMERIC);
471
- if (!$array_days) {
472
- echo '<table style="height:14px;border-spacing:0;border-spacing:0;width: 100%;background-color:#D6D4D5;">
473
- <tr>
474
- <td style="padding-left:10px; font-size:12px;font-weight:bold;width:10px;text-align:center;background-color:' . $bg . ';color:#949394;"></td>
475
- <td><p style="font-size:12px;color:' . $bg . '; border:none">&nbsp;' . __('There Is No Event In This Month', 'sp_calendar') . '</p></td>
476
- </tr>
477
- </table>';
478
- }
479
- for ($i = 0; $i < count($array_days); $i++) {
480
- $week_day = date('D', mktime(0, 0, 0, Month_num($month), $array_days[$i], $year));
481
- echo '<table style="width:100%; border-spacing:0;">
482
- <tr>
483
- <td style="height:14px;font-size:12px; padding-left:10px;background-color:#D6D4D5; color:#6E7276">
484
- <span style="padding-left:10px; font-size:12px;color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
485
- <span style="font-size:12px;color:#949394;">(' . add_0($array_days[$i]) . ' ' . __($month,'sp_calendar') . ')</span>
486
- </td>
487
- </tr>
488
- <tr>
489
- <td>';
490
- foreach ($title as $key => $value) {
491
- if ($key == $array_days[$i]) {
492
- $ev_id = explode('<br>', $ev_ids[$key]);
493
- array_pop($ev_id);
494
- $ev_ids_inline = implode(',', $ev_id);
495
- $ev_title = explode('</p>', $value);
496
- array_pop($ev_title);
497
- for ($j = 0; $j < count($ev_title); $j++) {
498
- $queryy = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
499
- ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND
500
- " . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$ev_id[$j];
501
-
502
- $cat_color = $wpdb->get_row($queryy);
503
-
504
- if (($j + 1) % 2 == 0) {
505
- $color = $bg;
506
- $table_color = $calendar_bg;
507
- }
508
- else {
509
- $color = $bg;
510
- $table_color = $calendar_bg;
511
- }
512
- if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color="";};
513
- echo '<table class="last_table" style="overflow:hidden;height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
514
- <tr>
515
- <td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $calendar_bg . '">' . ($j +1 ) . '</td>
516
- <td>
517
- <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:13px;background:none;color:#' . $ev_title_color . ';"
518
- href="' . add_query_arg(array(
519
- 'action' => 'spidercalendarbig',
520
- 'theme_id' => $theme_id,
521
- 'calendar_id' => $calendar_id,
522
- 'ev_ids' => $ev_ids_inline,
523
- 'eventID' => $ev_id[$j],
524
- 'date' => $year . '-' . add_0(Month_num($month)) . '-' . $array_days[$i],
525
- 'many_sp_calendar' => $many_sp_calendar,
526
- 'cur_page_url' => $path_sp_cal,
527
- 'widget' => $widget,
528
- 'TB_iframe' => 1,
529
- 'tbWidth' => $popup_width,
530
- 'tbHeight' => $popup_height,
531
- ), admin_url('admin-ajax.php')) . '"><b>'.$ev_title[$j].'</b>
532
- </a>
533
- </td>
534
- </tr>
535
- </table>';
536
- }
537
- }
538
- }
539
- echo '</td></tr></table>';
540
- }
541
- ?>
542
- </td>
543
- </tr>
544
- <tr style="height:<?php echo $year_font_size + 2; ?>px; font-family: <?php echo $font_year; ?>;">
545
- <td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
546
- echo add_query_arg(array(
547
- 'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
548
- 'theme_id' => $theme_id,
549
- 'calendar' => $calendar_id,
550
- 'select' => $view_select,
551
- 'date' => ($year - 1) . '-' . add_0((Month_num($month))),
552
- 'many_sp_calendar' => $many_sp_calendar,
553
- 'cur_page_url' => $path_sp_cal,
554
- 'widget' => $widget,
555
- 'cat_id' => '',
556
- 'cat_ids' => $cat_ids,
557
- 'TB_iframe' => 1,
558
- ), 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; ?>">
559
- <?php echo ($year - 1); ?>
560
- </td>
561
- <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; ?>">
562
- <?php echo $year; ?>
563
- </td>
564
- <td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
565
- echo add_query_arg(array(
566
- 'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
567
- 'theme_id' => $theme_id,
568
- 'calendar' => $calendar_id,
569
- 'select' => $view_select,
570
- 'date' => ($year + 1) . '-' . add_0((Month_num($month))),
571
- 'many_sp_calendar' => $many_sp_calendar,
572
- 'cur_page_url' => $path_sp_cal,
573
- 'widget' => $widget,
574
- 'cat_id' => '',
575
- 'cat_ids' => $cat_ids,
576
- 'TB_iframe' => 1,
577
- ), 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; ?>">
578
- <?php echo ($year + 1); ?>
579
- </td>
580
- </tr>
581
- </table>
582
- <input type="text" value="1" name="day" style="display:none" />
583
- </form>
584
- </td>
585
- </tr>
586
- </table>
587
- </div>
588
- <style>
589
- #calendar_<?php echo $many_sp_calendar; ?> table{
590
- width: 100%;
591
- }
592
- .categories1 , .categories2
593
- {
594
- display:inline-block;
595
- }
596
-
597
- .categories2
598
- {
599
- position:relative;
600
- left: -9px;
601
- cursor:pointer;
602
- }
603
- .categories2:first-letter
604
- {
605
- color:#fff;
606
-
607
- }
608
- </style>
609
- <?php
610
-
611
- //reindex cat_ids_array
612
- $re_cat_ids_array = array_values($cat_ids_array);
613
-
614
- for($i=0; $i<count($re_cat_ids_array); $i++)
615
- {
616
- echo'
617
- <style>
618
- #cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
619
- {
620
- text-decoration:underline;
621
- cursor:pointer;
622
-
623
- }
624
-
625
- </style>';
626
-
627
- }
628
-
629
-
630
-
631
- if($cat_ids=='')
632
- $cat_ids='';
633
-
634
-
635
- echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none;">';
636
-
637
- foreach($categories as $category)
638
- {
639
-
640
- ?>
641
-
642
- <li style="height:30px"><p class="categories1" style="background-color:#<?php echo $category->color;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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(
643
- 'action' => 'spiderbigcalendar_list_widget',
644
- 'theme_id' => $theme_id,
645
- 'calendar' => $calendar_id,
646
- 'select' => $view_select,
647
- 'date' => $year.'-'.add_0((Month_num($month))) . '-' . add_0($day),
648
- 'many_sp_calendar' => $many_sp_calendar,
649
- 'cur_page_url' => $path_sp_cal,
650
- 'cat_id' => $category->id,
651
- 'cat_ids' => $cat_ids,
652
- 'widget' => $widget,
653
- 'TB_iframe' => 1,
654
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
655
-
656
-
657
- <?php
658
-
659
-
660
- }
661
-
662
- echo '</ul><br><br>';
663
-
664
- die();
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; ?>')">&#9668;
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; ?>')">&#9658;
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">&nbsp;' . __('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;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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>&#9658;</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; ?>')">&#9664;
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; ?>')">&#9654;
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=".$calendar." AND " . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$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;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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>&#9658;</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; ?>')">&#9664;
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; ?>')">&#9654;
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;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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; ?>')">&#9668;
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; ?>')">&#9658;
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=".$calendar_id." AND se.id IN (".$ev_ids_inline.") ";
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=".$calendar_id." AND se.id IN (".$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;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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; ?>')">&#9668;
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; ?>')">&#9658;
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;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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
- $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
- $show_numbers_for_events = $theme->day_start;
152
-
153
- __('January', 'sp_calendar');
154
- __('February', 'sp_calendar');
155
- __('March', 'sp_calendar');
156
- __('April', 'sp_calendar');
157
- __('May', 'sp_calendar');
158
- __('June', 'sp_calendar');
159
- __('July', 'sp_calendar');
160
- __('August', 'sp_calendar');
161
- __('September', 'sp_calendar');
162
- __('October', 'sp_calendar');
163
- __('November', 'sp_calendar');
164
- __('December', 'sp_calendar');
165
- if ($cell_height == '') {
166
- $cell_height = 70;
167
- }
168
- if ($cal_width == '') {
169
- $cal_width = 700;
170
- }
171
-
172
- if ($date != '') {
173
- $date_REFERER = $date;
174
- }
175
- else {
176
- $date_REFERER = date("Y-m");
177
- $date = date("Y") . '-' . php_Month_num(date("F")) . '-' . date("d");
178
- }
179
- $year_REFERER = substr($date_REFERER, 0, 4);
180
- $month_REFERER = Month_name(substr($date_REFERER, 5, 2));
181
- $day_REFERER = substr($date_REFERER, 8, 2);
182
-
183
- $year = substr($date, 0, 4);
184
- $month = Month_name(substr($date, 5, 2));
185
- $day = substr($date, 8, 2);
186
-
187
- $cell_width = $cal_width / 7;
188
-
189
- $week_days = array();
190
- $d = new DateTime($date);
191
- $weekday = $d->format('w');
192
- // Monday=0, Sunday=6.
193
- $diff = ($weekday == 0 ? 6 : $weekday - 1);
194
- if ($weekstart == "su") {
195
- $diff = $diff + 1;
196
- }
197
- $d->modify("-$diff day");
198
- $d->modify("-1 day");
199
- $prev_date = $d->format('Y-m-d');
200
- $d->modify("+1 day");
201
- $week_days[] = $d->format('Y-m-d');
202
- for ($i = 1; $i < 7; $i++) {
203
- $d->modify('+1 day');
204
- $week_days[] = $d->format('Y-m-d');
205
- }
206
- if ($weekstart == "su") {
207
- $d->modify('+2 day');
208
- }
209
- else {
210
- $d->modify('+1 day');
211
- }
212
- $next_date = $d->format('Y-m-d');
213
- $prev_month = add_0((int) substr($prev_date, 5, 2) - 1);
214
- $this_month = add_0((int) substr($prev_date, 5, 2));
215
- $next_month = add_0((int) substr($prev_date, 5, 2) + 1);
216
- if ($next_month == '13') {
217
- $next_month = '01';
218
- }
219
- if ($prev_month == '00') {
220
- $prev_month = '12';
221
- }
222
-
223
- $view = 'bigcalendarweek';
224
- $views = explode(',', $view_select);
225
- $defaultview = 'week';
226
- array_pop($views);
227
- $display = '';
228
- if (count($views) == 0) {
229
- $display = "display:none";
230
- }
231
- if(count($views) == 1 && $views[0] == $defaultview) {
232
- $display = "display:none";
233
- }
234
- ?>
235
- <style type='text/css'>
236
- .week_list:last-child{
237
- border-top-left-radius: <?php echo $border_radius2; ?>px !important;
238
- border-top-right-radius: <?php echo $border_radius2; ?>px !important;
239
- border-radius:<?php echo $border_radius2; ?>px !important;
240
- border-bottom-left-radius: <?php echo $border_radius2; ?>px !important;
241
- }
242
-
243
- .general_table table table:last-child .week_list .week_ev{
244
- border-bottom-left-radius:<?php echo $border_radius2?>px;
245
-
246
- }
247
-
248
- #bigcalendar<?php echo $many_sp_calendar; ?> td,
249
- #bigcalendar<?php echo $many_sp_calendar; ?> tr,
250
- #spiderCalendarTitlesList td, #spiderCalendarTitlesList tr {
251
- border: none !important;
252
- }
253
- #bigcalendar<?php echo $many_sp_calendar; ?> . general_table {
254
- border-radius: <?php echo $border_radius; ?>px !important;
255
- }
256
- #bigcalendar<?php echo $many_sp_calendar; ?> . top_table {
257
- border-top-left-radius: <?php echo $border_radius2; ?>px !important;
258
- border-top-right-radius: <?php echo $border_radius2; ?>px !important;
259
- }
260
-
261
- .general_table table tr:last-child >td:last-child{
262
- border-bottom-right-radius: <?php echo $border_radius2; ?>px;
263
- border-top-right-radius: <?php echo $border_radius2 ?>px;
264
- }
265
-
266
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow a : link,
267
- #bigcalendar .cala_arrow a:visited {
268
- text-decoration: none !important;
269
- background: none !important;
270
- font-size: <?php echo $arrow_size; ?>px !important;
271
- }
272
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow {
273
- vertical-align: middle !important;
274
- }
275
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_arrow a : hover {
276
- font-size: <?php echo $arrow_size_hover; ?>px !important;
277
- text-decoration: none !important;
278
- background: none !important;
279
- }
280
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : link,
281
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : visited {
282
- text-decoration: none !important;
283
- background: none !important;
284
- font-size: 12px !important;
285
- color: red;
286
- }
287
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day a : hover {
288
- text-decoration: none !important;
289
- background: none !important;
290
- }
291
- #bigcalendar<?php echo $many_sp_calendar; ?> . cala_day {
292
- border: 1px solid <?php echo $cell_border_color; ?> !important;
293
- <?php echo 'vertical-align:top !important;'; ?>
294
- }
295
- #bigcalendar<?php echo $many_sp_calendar; ?> . weekdays {
296
- vertical-align: middle !important;
297
- border: 1px solid <?php echo $cell_border_color; ?> !important;
298
- }
299
- #bigcalendar<?php echo $many_sp_calendar; ?> . week_days {
300
- font-size: <?php echo $weekdays_font_size; ?>px !important;
301
- }
302
- #bigcalendar<?php echo $many_sp_calendar; ?> . calyear_table {
303
- border-spacing: 0 !important;
304
- width: 100% !important;
305
- }
306
- . calyear_table table #bigcalendar<?php echo $many_sp_calendar; ?> . calmonth_table {
307
- border-spacing: 0 !important;
308
- width: 100% !important;
309
- }
310
- #bigcalendar<?php echo $many_sp_calendar; ?> . calbg, #bigcalendar .calbg td {
311
- text-align: center !important;
312
- width: 14% !important;
313
- }
314
- #bigcalendar<?php echo $many_sp_calendar; ?> . caltext_color_other_months {
315
- color: <?php echo $text_color_other_months; ?> !important;
316
- border: 1px solid <?php echo $cell_border_color; ?> !important;
317
- <?php echo 'vertical-align:top !important;'; ?>
318
- }
319
- #bigcalendar<?php echo $many_sp_calendar; ?> . caltext_color_this_month_unevented {
320
- color: <?php echo $text_color_this_month_unevented; ?> !important;
321
- }
322
- #bigcalendar<?php echo $many_sp_calendar; ?> . calfont_year {
323
- font-size: 24px !important;
324
- font-weight: bold !important;
325
- color: <?php echo $text_color_year; ?> !important;
326
- }
327
- .general_table table, .general_table td, .general_table tr {
328
- border: inherit !important;
329
- vertical-align: initial !important;
330
- border-collapse: inherit !important;
331
- margin: inherit !important;
332
- padding: inherit !important;
333
- }
334
- .general_table {
335
- border-collapse: inherit !important;
336
- margin: inherit !important;
337
- }
338
- .general_table p {
339
- margin: inherit !important;
340
- padding: inherit !important;
341
- }
342
- #bigcalendar<?php echo $many_sp_calendar; ?> . calsun_days {
343
- color: <?php echo $sun_days; ?> !important;
344
- border: 1px solid <?php echo $cell_border_color; ?> !important;
345
- <?php echo 'vertical-align:top !important; text-align:left !important;'; ?>
346
- background-color: <?php echo $sundays_bg_color; ?> !important;
347
- }
348
- #bigcalendar<?php echo $many_sp_calendar; ?> . calbottom_border {
349
-
350
- }
351
- #TB_window {
352
- z-index: 10000;
353
- }
354
-
355
- #bigcalendar<?php echo $many_sp_calendar; ?> td {
356
- vertical-align: middle !important;
357
- }
358
- #bigcalendar<?php echo $many_sp_calendar; ?> table {
359
- border-collapse: initial;
360
- border:0px;
361
- max-width: none;
362
- }
363
- #bigcalendar<?php echo $many_sp_calendar; ?> table tr:hover td {
364
- background: none;
365
- }
366
- #bigcalendar<?php echo $many_sp_calendar; ?> table td {
367
- padding: 0px;
368
- vertical-align: none;
369
- border-top:none;
370
- line-height: none;
371
- text-align: none;
372
- }
373
- #bigcalendar<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
374
- margin-bottom:0;
375
- }
376
- #bigcalendar<?php echo $many_sp_calendar; ?> td,
377
- #bigcalendar<?php echo $many_sp_calendar; ?> tr,
378
- #spiderCalendarTitlesList td,
379
- #spiderCalendarTitlesList tr {
380
- border:none;
381
- }
382
- #bigcalendar<?php echo $many_sp_calendar; ?> .general_table {
383
- border-radius: <?php echo $border_radius; ?>px;
384
- }
385
- #bigcalendar<?php echo $many_sp_calendar; ?> .top_table {
386
- border-top-left-radius: <?php echo $border_radius2; ?>px;
387
- border-top-right-radius: <?php echo $border_radius2; ?>px;
388
- }
389
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
390
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
391
- text-decoration:none;
392
- background:none;
393
- font-size: <?php echo $arrow_size; ?>px;
394
- }
395
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
396
- text-decoration:none;
397
- background:none;
398
- }
399
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:link,
400
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:visited {
401
- text-decoration:none;
402
- background:none;
403
- font-size:12px;
404
- color:red;
405
- }
406
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day a:hover {
407
- text-decoration:none;
408
- background:none;
409
- }
410
- #bigcalendar<?php echo $many_sp_calendar; ?> .cala_day {
411
- border:1px solid <?php echo $cell_border_color; ?>;
412
- vertical-align:top;
413
- }
414
- #bigcalendar<?php echo $many_sp_calendar; ?> .weekdays {
415
- border:1px solid <?php echo $cell_border_color; ?>;
416
- }
417
- #bigcalendar<?php echo $many_sp_calendar; ?> .week_days {
418
- font-size:<?php echo $weekdays_font_size; ?>px;
419
- }
420
- #bigcalendar<?php echo $many_sp_calendar; ?> .calyear_table {
421
- border-spacing:0;
422
- width:100%;
423
- }
424
- #bigcalendar<?php echo $many_sp_calendar; ?> .calmonth_table {
425
- border-spacing:0;
426
- width:100%;
427
- }
428
- #bigcalendar<?php echo $many_sp_calendar; ?> .calbg,
429
- #bigcalendar<?php echo $many_sp_calendar; ?> .calbg td {
430
- text-align:center;
431
- width:14%;
432
- }
433
- #bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
434
- color:<?php echo $text_color_other_months; ?>;
435
- border:1px solid <?php echo $cell_border_color; ?>;
436
- vertical-align:top;
437
- }
438
- #bigcalendar<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
439
- color:<?php echo $text_color_this_month_unevented; ?>;
440
- }
441
- #bigcalendar<?php echo $many_sp_calendar; ?> .calfont_year {
442
- font-size:24px;
443
- font-weight:bold;
444
- color:<?php echo $text_color_year; ?>;
445
- }
446
- #bigcalendar<?php echo $many_sp_calendar; ?> .calsun_days {
447
- color:<?php echo $sun_days; ?>;
448
- border:1px solid <?php echo $cell_border_color; ?>;
449
- vertical-align:top;
450
- text-align:left;
451
- background-color:<?php echo $sundays_bg_color; ?>;
452
- }
453
- #bigcalendar<?php echo $many_sp_calendar; ?> .views {
454
- float: right;
455
- background-color: <?php echo $views_tabs_bg_color; ?>;
456
- min-height: 25px;
457
- min-width: 70px;
458
- margin-right: 2px;
459
- text-align: center;
460
- cursor:pointer;
461
- position: relative;
462
- top: 5px;
463
- }
464
- #bigcalendar<?php echo $many_sp_calendar; ?> .views span{
465
- padding: 7px;
466
- }
467
-
468
- #bigcalendar<?php echo $many_sp_calendar; ?> .views_select ,
469
- #bigcalendar<?php echo $many_sp_calendar; ?> #views_select
470
- {
471
-
472
- background-color: <?php echo $views_tabs_bg_color?> ;
473
- width: 120px;
474
- text-align: center;
475
- cursor: pointer;
476
- padding: 6px;
477
- position: relative;
478
- }
479
-
480
-
481
- #drop_down_views
482
- {
483
- list-style-type:none !important;
484
- position: absolute;
485
- top: 46px;
486
- left: -15px;
487
- display:none;
488
- z-index: 4545;
489
-
490
- }
491
-
492
- #drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
493
- {
494
- background:<?php echo $bg_top ?>;
495
- }
496
-
497
- #drop_down_views >li
498
- {
499
- border-bottom:1px solid #fff !important;
500
- }
501
-
502
-
503
- #views_tabs_select
504
- {
505
- display:none;
506
- }
507
-
508
- </style>
509
- <div id="afterbig<?php echo $many_sp_calendar; ?>" style="<?php echo $display ?>">
510
- <div style="width:100%;">
511
- <table cellpadding="0" cellspacing="0" style="width:100%;">
512
- <tr>
513
- <td>
514
- <div id="views_tabs" style="width: 100%;<?php echo $display; ?>">
515
- <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;'; ?>"
516
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
517
- 'action' => 'spiderbigcalendar_day',
518
- 'theme_id' => $theme_id,
519
- 'calendar' => $calendar_id,
520
- 'select' => $view_select,
521
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
522
- 'many_sp_calendar' => $many_sp_calendar,
523
- 'cur_page_url' => $path_sp_cal,
524
- 'cat_id' => '',
525
- 'cat_ids' => $cat_ids,
526
- 'widget' => $widget,
527
- 'rand' => $many_sp_calendar,
528
- ), 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>
529
- </div>
530
- <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;'; ?>"
531
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
532
- 'action' => 'spiderbigcalendar_week',
533
- 'theme_id' => $theme_id,
534
- 'calendar' => $calendar_id,
535
- 'select' => $view_select,
536
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
537
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
538
- 'many_sp_calendar' => $many_sp_calendar,
539
- 'cur_page_url' => $path_sp_cal,
540
- 'cat_id' => '',
541
- 'cat_ids' => $cat_ids,
542
- 'widget' => $widget,
543
- 'rand' => $many_sp_calendar,
544
- ), 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>
545
- </div>
546
- <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;' ?>"
547
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
548
- 'action' => 'spiderbigcalendar_list',
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
- 'rand' => $many_sp_calendar,
559
- ), 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>
560
- </div>
561
- <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;'; ?>"
562
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
563
- 'action' => 'spiderbigcalendar_month',
564
- 'theme_id' => $theme_id,
565
- 'calendar' => $calendar_id,
566
- 'select' => $view_select,
567
- 'date' => $year . '-' . add_0((Month_num($month))),
568
- 'many_sp_calendar' => $many_sp_calendar,
569
- 'cur_page_url' => $path_sp_cal,
570
- 'cat_id' => '',
571
- 'cat_ids' => $cat_ids,
572
- 'widget' => $widget,
573
- 'rand' => $many_sp_calendar,
574
- ), 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>
575
- </div>
576
- </div>
577
- <div id="views_tabs_select" style="display:none" >
578
- <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">
579
- <?php if($view=='bigcalendarday') echo 'Day'; ?>
580
- <?php if($view=='bigcalendarmonth') echo 'Month'; ?>
581
- <?php if($view=='bigcalendarweek') echo 'Week'; ?>
582
- <?php if($view=='bigcalendarlist') echo 'List'; ?>
583
- <span>&#9658;</span>
584
- </div>
585
- <ul id="drop_down_views" style="float: left;top: inherit;left: -20px;margin-top: 0px;">
586
- <li <?php if($view=='bigcalendarday'):?> class="active" <?php endif; ?> style="<?php if(!in_array('day',$views) AND $defaultview!='day' ) echo 'display:none;' ; ?>">
587
- <div class="views_select"
588
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
589
- 'action' => 'spiderbigcalendar_day',
590
- 'theme_id' => $theme_id,
591
- 'calendar' => $calendar_id,
592
- 'select' => $view_select,
593
- 'date' => $year.'-'.add_0((Month_num($month))).'-'.date('d'),
594
- 'many_sp_calendar' => $many_sp_calendar,
595
- 'cur_page_url' => $path_sp_cal,
596
- 'cat_id' => '',
597
- 'cat_ids' => $cat_ids,
598
- 'widget' => $widget,
599
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
600
- <span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Day</span>
601
- </div>
602
- </li>
603
-
604
- <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"
605
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
606
- 'action' => 'spiderbigcalendar_week',
607
- 'theme_id' => $theme_id,
608
- 'calendar' => $calendar_id,
609
- 'select' => $view_select,
610
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
611
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
612
- 'many_sp_calendar' => $many_sp_calendar,
613
- 'cur_page_url' => $path_sp_cal,
614
- 'cat_id' => '',
615
- 'cat_ids' => $cat_ids,
616
- 'widget' => $widget,
617
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">
618
- <span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">Week</span>
619
- </div>
620
- </li>
621
-
622
- <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"
623
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
624
- 'action' => 'spiderbigcalendar_list',
625
- 'theme_id' => $theme_id,
626
- 'calendar' => $calendar_id,
627
- 'select' => $view_select,
628
- 'date' => $year . '-' . add_0((Month_num($month))),
629
- 'many_sp_calendar' => $many_sp_calendar,
630
- 'cur_page_url' => $path_sp_cal,
631
- 'cat_id' => '',
632
- 'cat_ids' => $cat_ids,
633
- 'widget' => $widget,
634
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
635
- <span style="position:relative;top:25%;color:<?php echo $views_tabs_text_color ?>;font-size:<?php echo $views_tabs_font_size ?>px">List</span>
636
- </div>
637
- </li>
638
-
639
- <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"
640
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
641
- 'action' => 'spiderbigcalendar_month',
642
- 'theme_id' => $theme_id,
643
- 'calendar' => $calendar_id,
644
- 'select' => $view_select,
645
- 'date' => $year . '-' . add_0((Month_num($month))),
646
- 'many_sp_calendar' => $many_sp_calendar,
647
- 'cur_page_url' => $path_sp_cal,
648
- 'cat_id' => '',
649
- 'cat_ids' => $cat_ids,
650
- 'widget' => $widget,
651
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')" >
652
- <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>
653
-
654
- </ul>
655
- </div>
656
- </td>
657
- </tr>
658
- <tr>
659
- <td>
660
- <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; ?>;">
661
- <tr>
662
- <td width="100%" style="padding:0; margin:0">
663
- <table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0; width:100%;">
664
- <tr style="height:40px; width:100%;">
665
- <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%;">
666
- <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;">
667
- <tr>
668
- <td style="width:100%;vertical-align:center">
669
- <table style="width:100%;">
670
- <tr>
671
- <td width="15%">
672
- <div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
673
- echo add_query_arg(array(
674
- 'action' => 'spiderbigcalendar_' . $defaultview,
675
- 'theme_id' => $theme_id,
676
- 'calendar' => $calendar_id,
677
- 'select' => $view_select,
678
- 'date' => ($year - 1) . '-' . add_0((Month_num($month))) . '-' . date('d'),
679
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
680
- 'many_sp_calendar' => $many_sp_calendar,
681
- 'cur_page_url' => $path_sp_cal,
682
- 'cat_id' => '',
683
- 'cat_ids' => $cat_ids,
684
- 'widget' => $widget,
685
- ), 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;">
686
- <span style="font-size:18px; color:#FFF"><?php echo $year - 1; ?></span>
687
- </div>
688
- </td>
689
- <td class="cala_arrow" width="15%" style="text-align:right;margin:0px;padding:0px">
690
- <a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>;" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
691
- echo add_query_arg(array(
692
- 'action' => 'spiderbigcalendar_' . $defaultview,
693
- 'theme_id' => $theme_id,
694
- 'calendar' => $calendar_id,
695
- 'select' => $view_select,
696
- 'date' => $prev_date,
697
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
698
- 'many_sp_calendar' => $many_sp_calendar,
699
- 'cur_page_url' => $path_sp_cal,
700
- 'cat_id' => '',
701
- 'cat_ids' => $cat_ids,
702
- 'widget' => $widget,
703
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">&#9664;
704
- </a>
705
- </td>
706
- <?php
707
- $weekstartday = substr($week_days[0],8,2);
708
- $weekendday = substr($week_days[6],8,2);
709
- $startmonth = substr($week_days[0],5,2);
710
- $endmonth = substr($week_days[6],5,2);
711
-
712
- $startmonth_name = month_name($startmonth);
713
- $endmonth_name = month_name($endmonth); ?>
714
- <td style="text-align:center; margin:0;" width="40%">
715
- <input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
716
- <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>
717
- </td>
718
- <td style="margin:0; padding:0;text-align:left" width="15%" class="cala_arrow">
719
- <a style="text-shadow: 1px 1px 2px black;color:<?php echo $color_arrow_month; ?>" href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
720
- echo add_query_arg(array(
721
- 'action' => 'spiderbigcalendar_' . $defaultview,
722
- 'theme_id' => $theme_id,
723
- 'calendar' => $calendar_id,
724
- 'select' => $view_select,
725
- 'date' => $next_date,
726
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
727
- 'many_sp_calendar' => $many_sp_calendar,
728
- 'cur_page_url' => $path_sp_cal,
729
- 'cat_id' => '',
730
- 'cat_ids' => $cat_ids,
731
- 'widget' => $widget,
732
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">&#9654;
733
- </a>
734
- </td>
735
- <td width="15%">
736
- <div onclick="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>','<?php
737
- echo add_query_arg(array(
738
- 'action' => 'spiderbigcalendar_' . $defaultview,
739
- 'theme_id' => $theme_id,
740
- 'calendar' => $calendar_id,
741
- 'select' => $view_select,
742
- 'date' => ($year + 1) . '-' . add_0((Month_num($month))) . '-' . date('d'),
743
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
744
- 'many_sp_calendar' => $many_sp_calendar,
745
- 'cur_page_url' => $path_sp_cal,
746
- 'cat_id' => '',
747
- 'cat_ids' => $cat_ids,
748
- 'widget' => $widget,
749
- ), 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;">
750
- <span style="font-size:18px; color:#FFF"><?php echo $year + 1; ?></span>
751
- </div>
752
- </td>
753
- </tr>
754
- </table>
755
- </td>
756
- </tr>
757
- </table>
758
- </td>
759
-
760
- </tr>
761
- </tr>
762
- <tr>
763
- <td>
764
- <?php
765
- $month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
766
- if ($weekstart == "su") {
767
- $month_first_weekday++;
768
- if ($month_first_weekday == 8) {
769
- $month_first_weekday = 1;
770
- }
771
- }
772
- $month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
773
- $last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
774
- $last_month_days_count = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
775
- $weekday_i = $month_first_weekday;
776
- $last_month_days = $last_month_days - $weekday_i + 2;
777
- $percent = 1;
778
- $sum = $month_days - 8 + $month_first_weekday;
779
- if ($sum % 7 <> 0) {
780
- $percent = $percent + 1;
781
- }
782
- $sum = $sum - ($sum % 7);
783
- $percent = $percent + ($sum / 7);
784
- $percent = 107 / $percent;
785
-
786
- $all_calendar_files = php_getdays_for_three_months($calendar_id, $date, $months, $theme_id, $widget);
787
-
788
- $categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
789
- $calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
790
-
791
- $all_array_days = $all_calendar_files[0]['all_array_days'];
792
- $all_array_days1 = $all_calendar_files[0]['all_array_days1'];
793
- $all_title = $all_calendar_files[0]['all_title'];
794
- $all_ev_ids = $all_calendar_files[0]['all_ev_ids'];
795
-
796
- $prev_month = substr($months, 0, 2);
797
- $this_month = substr($months, 3, 2);
798
- $next_month = substr($months, 6, 2);
799
-
800
- for ($i = 0; $i <= 6; $i++) {
801
- $day=substr($week_days[$i],8,2);
802
- $month=substr($week_days[$i],5,2);
803
- $year=substr($week_days[$i],0,4);
804
-
805
- switch($month)
806
- {
807
- case $prev_month:
808
- $array_days=$all_array_days[0];
809
- $array_days1=$all_array_days1[0];
810
- $title=$all_title[0];
811
- $ev_ids=$all_ev_ids[0];
812
- break;
813
-
814
- case $this_month:
815
- $array_days=$all_array_days[1];
816
- $array_days1=$all_array_days1[1];
817
- $title=$all_title[1];
818
- $ev_ids=$all_ev_ids[1];
819
- break;
820
-
821
- case $next_month:
822
- $array_days=$all_array_days[2];
823
- $array_days1=$all_array_days1[2];
824
- $title=$all_title[2];
825
- $ev_ids=$all_ev_ids[2];
826
- break;
827
-
828
- }
829
-
830
-
831
-
832
- sort($array_days, SORT_NUMERIC);
833
- $week_day = date('D', mktime(0, 0, 0, $month, (int) $day, $year));
834
- $month_name = month_name($month);
835
- echo '<table style="width:100%;border-spacing:0;">
836
- <tr>
837
- <td style="height:' . $date_height . 'px;font-size:' . $date_font_size . 'px; padding-left:10px;background-color:' . $date_bg_color . '; color:#6E7276">
838
- <span style="padding-left:10px; font-size:' . $date_font_size . 'px; color:' . $week_font_color . '">' . week_convert($week_day) . '</span>
839
- <span style="font-size:' . $day_month_font_size . 'px;color:' . $day_month_font_color . '">(' . __($month_name,'sp_calendar') . ' ' . (int) $day . ')</span>
840
- </td>
841
- <tr>
842
- <td>';
843
- if (in_array((int) $day, $array_days)) {
844
- foreach($title as $key => $value) {
845
- if ($key == (int) $day) {
846
- $ev_id = explode('<br>', $ev_ids[$key]);
847
- array_pop($ev_id);
848
- $ev_ids_inline = implode(',', $ev_id);
849
- $ev_title = explode('</p>', $value);
850
- array_pop($ev_title);
851
- for ($j = 0; $j < count($ev_title); $j++) {
852
- $queryy = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
853
- ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND
854
- " . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$ev_id[$j];
855
-
856
- $cat_color = $wpdb->get_row($queryy);
857
-
858
- if (($j + 1) % 2 == 0) {
859
- $color = $event_num_bg_color2;
860
- $table_color = $event_bg_color2;
861
- }
862
- else {
863
- $color = $event_num_bg_color1;
864
- $table_color = $event_bg_color1;
865
- }
866
- if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color="";};
867
- echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $table_color . '" class="week_list">
868
- <tr>
869
- <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>
870
- <td>
871
- <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:15px;background:none;color:' . $event_title_color . ';"
872
- href="' . add_query_arg(array(
873
- 'action' => 'spidercalendarbig',
874
- 'theme_id' => $theme_id,
875
- 'calendar_id' => $calendar_id,
876
- 'ev_ids' => $ev_ids_inline,
877
- 'eventID' => $ev_id[$j],
878
- 'date' => $year . '-' . $month . '-' . (int) $day,
879
- 'many_sp_calendar' => $many_sp_calendar,
880
- 'cur_page_url' => $path_sp_cal,
881
- 'widget' => $widget,
882
- 'TB_iframe' => 1,
883
- 'tbWidth' => $popup_width,
884
- 'tbHeight' => $popup_height,
885
- ), admin_url('admin-ajax.php')) . '"><b>' . $ev_title[$j] . '</b>
886
- </a>
887
- </td>
888
- </tr>
889
- </table>';
890
- }
891
- }
892
- }
893
- }
894
- else {
895
- echo '<table style="height:' . $event_table_height . 'px;border-spacing:0;width: 100%;background-color:' . $event_bg_color1 . '" class="week_list">
896
- <tr>
897
- <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>
898
- <td><p style="color:' . $event_title_color . '; border:none">&nbsp;' . __('There Is No Event In This Day', 'sp_calendar') . '</p></td>
899
- </tr>
900
- </table>';
901
- }
902
- echo '</td></tr></table>';
903
- }
904
- ?>
905
- </td>
906
- </tr>
907
- </table>
908
- </tr>
909
- </table>
910
- </td>
911
- </tr>
912
- </table>
913
- </div>
914
- <script>
915
-
916
- jQuery(document).ready(function (){
917
-
918
- jQuery('#views_select').click(function () {
919
- jQuery('#drop_down_views').stop(true, true).delay(200).slideDown(500);
920
- }, function () {
921
- jQuery('#drop_down_views').stop(true, true).slideUp(500);
922
- });
923
- if(jQuery(window).width() > 640 )
924
- {
925
- jQuery('drop_down_views').hide();
926
- }
927
- });
928
- </script>
929
-
930
-
931
- <style>
932
-
933
- @media only screen and (max-width : 640px) {
934
-
935
- #views_tabs ,#drop_down_views
936
- {
937
- display:none;
938
- }
939
-
940
- #views_tabs_select
941
- {
942
- display:block !important;
943
- }
944
-
945
-
946
-
947
- }
948
-
949
- @media only screen and (max-width : 968px) {
950
- #cats >li
951
- {
952
- float:none;
953
- }
954
-
955
-
956
-
957
- }
958
- .categories1 , .categories2
959
- {
960
- display:inline-block;
961
- }
962
-
963
- .categories2
964
- {
965
- position:relative;
966
- left: -9px;
967
- cursor:pointer;
968
- }
969
- .categories2:first-letter
970
- {
971
- color:#fff;
972
-
973
- }
974
- </style>
975
- <?php
976
-
977
- //reindex cat_ids_array
978
- $re_cat_ids_array = array_values($cat_ids_array);
979
-
980
- for($i=0; $i<count($re_cat_ids_array); $i++)
981
- {
982
- echo'
983
- <style>
984
- #cats #category'.$re_cat_ids_array[$i].'
985
- {
986
- text-decoration:underline;
987
- cursor:pointer;
988
-
989
- }
990
-
991
- </style>';
992
-
993
- }
994
-
995
-
996
-
997
- if($cat_ids=='')
998
- $cat_ids='';
999
-
1000
-
1001
- echo '<ul id="cats" style="list-style-type:none;">';
1002
-
1003
- foreach($categories as $category)
1004
- {
1005
-
1006
- ?>
1007
-
1008
- <li style="float:left;"><p class="categories1" style="background-color:#<?php echo $category->color;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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(
1009
- 'action' => 'spiderbigcalendar_week',
1010
- 'theme_id' => $theme_id,
1011
- 'calendar' => $calendar_id,
1012
- 'select' => $view_select,
1013
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
1014
- 'date' => $year . '-' . $month . '-' . add_0($day),
1015
- 'many_sp_calendar' => $many_sp_calendar,
1016
- 'cur_page_url' => $path_sp_cal,
1017
- 'cat_id' => $category->id,
1018
- 'cat_ids' => $cat_ids,
1019
- 'widget' => $widget,
1020
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
1021
-
1022
-
1023
- <?php
1024
-
1025
-
1026
- }
1027
-
1028
- echo '</ul><br><br>';
1029
-
1030
- die();
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>&#9658;</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; ?>')">&#9664;
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; ?>')">&#9654;
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">&nbsp;' . __('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;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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
- $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
- $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 ($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
- $year_REFERER = substr($date_REFERER, 0, 4);
140
- $month_REFERER = Month_name(substr($date_REFERER, 5, 2));
141
- $day_REFERER = substr($date_REFERER, 8, 2);
142
-
143
- $year = substr($date, 0, 4);
144
- $month = Month_name(substr($date, 5, 2));
145
- $month_year = Month_name(substr($date, 5, 2));
146
- $day = substr($date, 8, 2);
147
- $cell_width = $calendar_width / 7;
148
- $cell_width = (int) $cell_width - 2;
149
-
150
- $week_days = array();
151
- $d = new DateTime($date);
152
- $weekday = $d->format('w');
153
- // Monday=0, Sunday=6.
154
- $diff = ($weekday == 0 ? 6 : $weekday - 1);
155
- if ($weekstart == "su") {
156
- $diff = $diff + 1;
157
- }
158
- $d->modify("-$diff day");
159
- $d->modify("-1 day");
160
- $prev_date = $d->format('Y-m-d');
161
- $d->modify("+1 day");
162
- $week_days[] = $d->format('Y-m-d');
163
- for ($i = 1; $i < 7; $i++) {
164
- $d->modify('+1 day');
165
- $week_days[] = $d->format('Y-m-d');
166
- }
167
- if ($weekstart == "su") {
168
- $d->modify('+2 day');
169
- }
170
- else {
171
- $d->modify('+1 day');
172
- }
173
- $next_date = $d->format('Y-m-d');
174
- $prev_month = add_0((int) substr($prev_date, 5, 2) - 1);
175
- $this_month = add_0((int) substr($prev_date, 5, 2));
176
- $next_month = add_0((int) substr($prev_date, 5, 2) + 1);
177
- if ($next_month == '13') {
178
- $next_month = '01';
179
- }
180
- if ($prev_month == '00') {
181
- $prev_month = '12';
182
- }
183
- $view = 'bigcalendarweek_widget';
184
- $views = explode(',', $view_select);
185
- $defaultview = 'week';
186
- array_pop($views);
187
- $display = '';
188
- if (count($views) == 0) {
189
- $display = "display:none";
190
- }
191
- if(count($views) == 1 && $views[0] == $defaultview) {
192
- $display = "display:none";
193
- }
194
- ?>
195
- <style type='text/css'>
196
- #calendar_<?php echo $many_sp_calendar; ?> table {
197
- border-collapse: initial;
198
- border:0px;
199
- margin: 0;
200
- }
201
- #calendar_<?php echo $many_sp_calendar; ?> table td {
202
- padding: 0px;
203
- vertical-align: none;
204
- border-top:none;
205
- line-height: none;
206
- text-align: none;
207
- }
208
- #calendar_<?php echo $many_sp_calendar; ?> .cell_body td {
209
- border:1px solid <?php echo $cell_border_color; ?>;
210
- font-family: <?php echo $font_day; ?>;
211
- }
212
- #calendar_<?php echo $many_sp_calendar; ?> p, ol, ul, dl, address {
213
- margin-bottom: 0;
214
- }
215
- #calendar_<?php echo $many_sp_calendar; ?> td,
216
- #calendar_<?php echo $many_sp_calendar; ?> tr,
217
- #spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> td,
218
- #spiderCalendarTitlesList_<?php echo $many_sp_calendar; ?> tr {
219
- border:none;
220
- }
221
- #calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:link,
222
- #calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:visited {
223
- color: <?php echo $color_arrow; ?>;
224
- text-decoration: none;
225
- background: none;
226
- font-size: 16px;
227
- }
228
- #calendar_<?php echo $many_sp_calendar; ?> .cala_arrow a:hover {
229
- color: <?php echo $color_arrow; ?>;
230
- text-decoration:none;
231
- background:none;
232
- }
233
- #calendar_<?php echo $many_sp_calendar; ?> .cala_day a:link,
234
- #calendar_<?php echo $many_sp_calendar; ?> .cala_day a:visited {
235
- text-decoration:underline;
236
- background:none;
237
- font-size:11px;
238
- }
239
- #calendar_<?php echo $many_sp_calendar; ?> a {
240
- font-weight: normal;
241
- }
242
- #calendar_<?php echo $many_sp_calendar; ?> .cala_day a:hover {
243
- font-size:12px;
244
- text-decoration:none;
245
- background:none;
246
- }
247
- #calendar_<?php echo $many_sp_calendar; ?> .calyear_table {
248
- border-spacing:0;
249
- width:100%;
250
- }
251
- #calendar_<?php echo $many_sp_calendar; ?> .calmonth_table {
252
- border-spacing: 0;
253
- vertical-align: middle;
254
- width: 100%;
255
- }
256
- #calendar_<?php echo $many_sp_calendar; ?> .calbg {
257
- background-color:<?php echo $bg; ?>;
258
- text-align:center;
259
- vertical-align: middle;
260
- }
261
- #calendar_<?php echo $many_sp_calendar; ?> .caltext_color_other_months {
262
- color:<?php echo $text_color_other_months; ?>;
263
- }
264
- #calendar_<?php echo $many_sp_calendar; ?> .caltext_color_this_month_unevented {
265
- color:<?php echo $text_color_this_month_unevented; ?>;
266
- }
267
- #calendar_<?php echo $many_sp_calendar; ?> .calfont_year {
268
- font-size:24px;
269
- font-weight:bold;
270
- color:<?php echo $text_color_year; ?>;
271
- }
272
- #calendar_<?php echo $many_sp_calendar; ?> .calsun_days {
273
- color:<?php echo $sun_days; ?>;
274
- }
275
- #calendar_<?php echo $many_sp_calendar; ?> .calborder_day {
276
- border: solid <?php echo $border_day; ?> 1px;
277
- }
278
- #TB_window {
279
- z-index: 10000;
280
- }
281
- #calendar_<?php echo $many_sp_calendar; ?> .views {
282
- float: right;
283
- background-color: <?php echo $calendar_bg; ?>;
284
- height: 25px;
285
- width: <?php echo ($calendar_width / 4) - 2; ?>px;
286
- margin-left: 2px;
287
- text-align: center;
288
- cursor:pointer;
289
- position: relative;
290
- top: 3px;
291
- font-family: <?php echo $font_month; ?>;
292
- }
293
- #calendar_<?php echo $many_sp_calendar; ?> table tr {
294
- background: transparent !important;
295
- }
296
- #calendar_<?php echo $many_sp_calendar; ?> .views_select ,
297
- #calendar_<?php echo $many_sp_calendar; ?> #views_select
298
- {
299
-
300
- background-color: <?php $views_tabs_bg_color?>;
301
- width: 120px;
302
- text-align: center;
303
- cursor: pointer;
304
- padding: 6px;
305
- position: relative;
306
- }
307
-
308
-
309
- #drop_down_views
310
- {
311
- list-style-type:none !important;
312
- position: absolute;
313
- top: 46px;
314
- left: -15px;
315
- display:none;
316
- z-index: 4545;
317
-
318
- }
319
-
320
- #drop_down_views >li:hover .views_select, #drop_down_views >li.active .views_select
321
- {
322
- background:<?php echo $bg_top ?>;
323
- }
324
-
325
- #drop_down_views >li
326
- {
327
- border-bottom:1px solid #fff !important;
328
- }
329
-
330
-
331
- #views_tabs_select
332
- {
333
- display:none;
334
- }
335
- </style>
336
- <div id="calendar_<?php echo $many_sp_calendar; ?>" style="width:<?php echo $calendar_width; ?>px;">
337
- <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; ?>">
338
- <tr style="background-color:#FFFFFF;">
339
- <td style="background-color:#FFFFFF;">
340
- <div id="views_tabs" style="width: 101%;margin-left: -2px;<?php echo $display; ?>">
341
- <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;'; ?>"
342
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
343
- 'action' => 'spiderbigcalendar_day_widget',
344
- 'theme_id' => $theme_id,
345
- 'calendar' => $calendar_id,
346
- 'select' => $view_select,
347
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
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
- 'TB_iframe' => 1,
354
- ), 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>
355
- </div>
356
- <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;' ?>"
357
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
358
- 'action' => 'spiderbigcalendar_week_widget',
359
- 'theme_id' => $theme_id,
360
- 'calendar' => $calendar_id,
361
- 'select' => $view_select,
362
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
363
- 'date' => $year . '-' . add_0((Month_num($month))) . '-' . date('d'),
364
- 'many_sp_calendar' => $many_sp_calendar,
365
- 'cur_page_url' => $path_sp_cal,
366
- 'cat_id' => '',
367
- 'cat_ids' => $cat_ids,
368
- 'widget' => $widget,
369
- 'TB_iframe' => 1,
370
- ), 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>
371
- </div>
372
- <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;' ?>"
373
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>', '<?php echo add_query_arg(array(
374
- 'action' => 'spiderbigcalendar_list_widget',
375
- 'theme_id' => $theme_id,
376
- 'calendar' => $calendar_id,
377
- 'select' => $view_select,
378
- 'date' => $year . '-' . add_0((Month_num($month))),
379
- 'many_sp_calendar' => $many_sp_calendar,
380
- 'cur_page_url' => $path_sp_cal,
381
- 'cat_id' => '',
382
- 'cat_ids' => $cat_ids,
383
- 'widget' => $widget,
384
- 'TB_iframe' => 1,
385
- ), 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>
386
- </div>
387
- <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;'; ?>"
388
- onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar; ?>', '<?php echo add_query_arg(array(
389
- 'action' => 'spiderbigcalendar_month_widget',
390
- 'theme_id' => $theme_id,
391
- 'calendar' => $calendar_id,
392
- 'select' => $view_select,
393
- 'date' => $year . '-' . add_0((Month_num($month))),
394
- 'many_sp_calendar' => $many_sp_calendar,
395
- 'cur_page_url' => $path_sp_cal,
396
- 'cat_id' => '',
397
- 'cat_ids' => $cat_ids,
398
- 'widget' => $widget,
399
- 'TB_iframe' => 1,
400
- ), 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>
401
- </div>
402
- </div>
403
- </td>
404
- </tr>
405
- <tr>
406
- <td width="100%" style="padding:0; margin:0;">
407
- <form action="" method="get" style="background:none; margin:0; padding:0;">
408
- <table cellpadding="0" cellspacing="0" border="0" style="border-spacing:0; font-size:12px; margin:0; padding:0;" width="<?php echo $calendar_width; ?>">
409
- <tr height="28px" style="width:<?php echo $calendar_width; ?>px;">
410
- <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%;" >
411
- <?php //MONTH TABLE ?>
412
- <table cellpadding="0" cellspacing="0" border="0" align="center" class="calmonth_table" style="width:100%; margin:0; padding:0">
413
- <tr>
414
- <td style="text-align:left; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
415
- <a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
416
- if (Month_num($month) == 1) {
417
- $needed_date = ($year - 1) . '-12';
418
- }
419
- else {
420
- $needed_date = $year . '-' . add_0((Month_num($month) - 1));
421
- }
422
- echo add_query_arg(array(
423
- 'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
424
- 'theme_id' => $theme_id,
425
- 'calendar' => $calendar_id,
426
- 'select' => $view_select,
427
- 'date' => $prev_date,
428
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
429
- 'many_sp_calendar' => $many_sp_calendar,
430
- 'cur_page_url' => $path_sp_cal,
431
- 'cat_id' => '',
432
- 'cat_ids' => $cat_ids,
433
- 'widget' => $widget,
434
- 'TB_iframe' => 1,
435
- ), admin_url('admin-ajax.php'));
436
- ?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">&#9668;
437
- </a>
438
- </td>
439
- <?php
440
- $weekstartday = substr($week_days[0],8,2);
441
- $weekendday = substr($week_days[6],8,2);
442
- $startmonth = substr($week_days[0],5,2);
443
- $endmonth = substr($week_days[6],5,2);
444
-
445
- $startmonth_name = month_name($startmonth);
446
- $endmonth_name = month_name($endmonth); ?>
447
- <td style="text-align:center; margin:0;" width="40%">
448
- <input type="hidden" name="month" readonly="" value="<?php echo $month; ?>"/>
449
- <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>
450
- </td>
451
- <td style="text-align:right; margin:0; padding:0; line-height:16px" class="cala_arrow" width="20%">
452
- <a href="javascript:showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
453
- if (Month_num($month) == 12) {
454
- $needed_date = ($year + 1) . '-01';
455
- }
456
- else {
457
- $needed_date = $year . '-' . add_0((Month_num($month) + 1));
458
- }
459
- echo add_query_arg(array(
460
- 'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
461
- 'theme_id' => $theme_id,
462
- 'calendar' => $calendar_id,
463
- 'select' => $view_select,
464
- 'date' => $next_date,
465
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
466
- 'many_sp_calendar' => $many_sp_calendar,
467
- 'cur_page_url' => $path_sp_cal,
468
- 'cat_id' => '',
469
- 'cat_ids' => $cat_ids,
470
- 'widget' => $widget,
471
- 'TB_iframe' => 1,
472
- ), admin_url('admin-ajax.php'));
473
- ?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')">&#9658;
474
- </a>
475
- </td>
476
- </tr>
477
- </table>
478
- </td>
479
- </tr>
480
-
481
- <tr>
482
- <td colspan="7">
483
- <?php
484
- $month_first_weekday = date("N", mktime(0, 0, 0, Month_num($month), 1, $year));
485
- if ($weekstart == "su") {
486
- $month_first_weekday++;
487
- if ($month_first_weekday == 8) {
488
- $month_first_weekday = 1;
489
- }
490
- }
491
- $month_days = date("t", mktime(0, 0, 0, Month_num($month), 1, $year));
492
- $last_month_days = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
493
- $last_month_days_count = date("t", mktime(0, 0, 0, Month_num($month) - 1, 1, $year));
494
- $weekday_i = $month_first_weekday;
495
- $last_month_days = $last_month_days - $weekday_i + 2;
496
- $percent = 1;
497
- $sum = $month_days - 8 + $month_first_weekday;
498
- if ($sum % 7 <> 0) {
499
- $percent = $percent + 1;
500
- }
501
- $sum = $sum - ($sum % 7);
502
- $percent = $percent + ($sum / 7);
503
- $percent = 107 / $percent;
504
-
505
- $categories=$wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "spidercalendar_event_category WHERE published=1");
506
- $calendar = (isset($_GET['calendar']) ? $_GET['calendar'] : '');
507
- $all_calendar_files = php_getdays_for_three_months($calendar_id, $date, $months, $theme_id, $widget);
508
-
509
- $all_array_days = $all_calendar_files[0]['all_array_days'];
510
- $all_array_days1 = $all_calendar_files[0]['all_array_days1'];
511
- $all_title = $all_calendar_files[0]['all_title'];
512
- $all_ev_ids = $all_calendar_files[0]['all_ev_ids'];
513
-
514
- $prev_month = substr($months, 0, 2);
515
- $this_month = substr($months, 3, 2);
516
- $next_month = substr($months, 6, 2);
517
-
518
- for ($i = 0; $i <= 6; $i++) {
519
- $day = substr($week_days[$i], 8, 2);
520
- $month = substr($week_days[$i], 5, 2);
521
- $year = substr($week_days[$i], 0, 4);
522
- switch($month) {
523
- case $prev_month:
524
- $array_days = $all_array_days[0];
525
- $array_days1 = $all_array_days1[0];
526
- $title = $all_title[0];
527
- $ev_ids = $all_ev_ids[0];
528
- break;
529
-
530
- case $this_month:
531
- $array_days = $all_array_days[1];
532
- $array_days1 = $all_array_days1[1];
533
- $title = $all_title[1];
534
- $ev_ids = $all_ev_ids[1];
535
- break;
536
-
537
- case $next_month:
538
- $array_days = $all_array_days[2];
539
- $array_days1 = $all_array_days1[2];
540
- $title = $all_title[2];
541
- $ev_ids = $all_ev_ids[2];
542
- break;
543
- }
544
- sort($array_days, SORT_NUMERIC);
545
- $week_day = date('D', mktime(0, 0, 0, $month, (int) $day, $year));
546
- $month_name = month_name($month);
547
- echo '<table style="width:100%;border-spacing:0;">
548
- <tr>
549
- <td style="height:14px;font-size:12px; padding-left:10px; background-color:#D6D4D5; color:#6E7276">
550
- <span style="padding-left:10px; font-size:12px; color:' . $color_week_days . '">' . week_convert($week_day) . '</span>
551
- <span style="font-size:12px;color:#949394;">(' . __($month_name,'sp_calendar') . ' ' . (int) $day . ')</span>
552
- </td>
553
- <tr>
554
- <td>';
555
- if (in_array((int) $day, $array_days)) {
556
- foreach($title as $key => $value) {
557
- if ($key == (int) $day) {
558
- $ev_id = explode('<br>', $ev_ids[$key]);
559
- array_pop($ev_id);
560
- $ev_ids_inline = implode(',', $ev_id);
561
- $ev_title = explode('</p>', $value);
562
- array_pop($ev_title);
563
- for ($j = 0; $j < count($ev_title); $j++) {
564
- $queryy = "SELECT " . $wpdb->prefix . "spidercalendar_event_category.color AS color FROM " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category
565
- ON " . $wpdb->prefix . "spidercalendar_event.category=" . $wpdb->prefix . "spidercalendar_event_category.id WHERE " . $wpdb->prefix . "spidercalendar_event.calendar=".$calendar." AND
566
- " . $wpdb->prefix . "spidercalendar_event.published='1' AND " . $wpdb->prefix . "spidercalendar_event_category.published='1' AND " . $wpdb->prefix . "spidercalendar_event.id=".$ev_id[$j];
567
-
568
- $cat_color = $wpdb->get_row($queryy);
569
-
570
- if (($j + 1) % 2 == 0) {
571
- $color = $bg;
572
- $table_color = $calendar_bg;
573
- }
574
- else {
575
- $color = $bg;
576
- $table_color = $calendar_bg;
577
- }
578
- if(!isset($cat_color->color)) { $cat_color = new stdClass; $cat_color->color="";};
579
- echo '<table style="height:14px;border-spacing:0;width: 100%;background-color:' . $table_color . '">
580
- <tr>
581
- <td style="font-size:14px;font-weight:bold;width:15px;text-align:center;background-color:#' . $cat_color->color . ';color:' . $calendar_bg . '">' . ($j + 1) . '</td>
582
- <td>
583
- <a class="thickbox-previewbigcalendar' . $many_sp_calendar . '" style="text-decoration:none;font-size:15px;background:none;color:#' . $ev_title_color . ';"
584
- href="' . add_query_arg(array(
585
- 'action' => 'spidercalendarbig',
586
- 'theme_id' => $theme_id,
587
- 'calendar_id' => $calendar_id,
588
- 'ev_ids' => $ev_ids_inline,
589
- 'eventID' => $ev_id[$j],
590
- 'date' => $year . '-' . $month . '-' . (int) $day,
591
- 'many_sp_calendar' => $many_sp_calendar,
592
- 'cur_page_url' => $path_sp_cal,
593
- 'widget' => $widget,
594
- 'TB_iframe' => 1,
595
- 'tbWidth' => $popup_width,
596
- 'tbHeight' => $popup_height,
597
- ), admin_url('admin-ajax.php')) . '"><b>' . $ev_title[$j] . '</b>
598
- </a>
599
- </td>
600
- </tr>
601
- </table>';
602
- }
603
- }
604
- }
605
- }
606
- else {
607
- echo '<table style="height:14px;border-spacing:0;width: 100%;background-color:#D6D4D5;">
608
- <tr>
609
- <td style="font-size:22px; font-weight:bold; width:15px;text-align:center;background-color:' . $bg . ';color:#949394;"></td>
610
- <td><p style="font-size:12px;color:' . $bg . '; border:none">&nbsp;' . __('There Is No Event In This Day', 'sp_calendar') . '</p></td>
611
- </tr>
612
- </table>';
613
- }
614
- echo '</td></tr></table>';
615
- }
616
- ?>
617
- </td>
618
- </tr>
619
- <tr style="height:<?php echo $year_font_size + 2; ?>px; font-family: <?php echo $font_year; ?>;">
620
- <td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
621
- echo add_query_arg(array(
622
- 'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
623
- 'theme_id' => $theme_id,
624
- 'calendar' => $calendar_id,
625
- 'select' => $view_select,
626
- 'date' => ($year - 1) . '-' . add_0((Month_num($month_year))),
627
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
628
- 'many_sp_calendar' => $many_sp_calendar,
629
- 'cur_page_url' => $path_sp_cal,
630
- 'widget' => $widget,
631
- 'cat_id' => '',
632
- 'cat_ids' => $cat_ids,
633
- 'TB_iframe' => 1,
634
- ), 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; ?>">
635
- <?php echo ($year - 1); ?>
636
- </td>
637
- <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; ?>">
638
- <?php echo $year; ?>
639
- </td>
640
- <td colspan="2" onclick="showbigcalendar('bigcalendar<?php echo $many_sp_calendar ?>','<?php
641
- echo add_query_arg(array(
642
- 'action' => 'spiderbigcalendar_' . $defaultview . '_widget',
643
- 'theme_id' => $theme_id,
644
- 'calendar' => $calendar_id,
645
- 'select' => $view_select,
646
- 'date' => ($year + 1) . '-' . add_0((Month_num($month_year))),
647
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
648
- 'many_sp_calendar' => $many_sp_calendar,
649
- 'cur_page_url' => $path_sp_cal,
650
- 'widget' => $widget,
651
- 'cat_id' => '',
652
- 'cat_ids' => $cat_ids,
653
- 'TB_iframe' => 1,
654
- ), 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; ?>">
655
- <?php echo ($year + 1); ?>
656
- </td>
657
- </tr>
658
- </table>
659
- <input type="text" value="1" name="day" style="display:none" />
660
- </form>
661
- </td>
662
- </tr>
663
- </table>
664
- </div>
665
- <style>
666
- #calendar_<?php echo $many_sp_calendar; ?> table{
667
- width: 100%;
668
- }
669
- .categories1 , .categories2
670
- {
671
- display:inline-block;
672
- }
673
-
674
- .categories2
675
- {
676
- position:relative;
677
- left: -9px;
678
- cursor:pointer;
679
- }
680
- .categories2:first-letter
681
- {
682
- color:#fff;
683
-
684
- }
685
- </style>
686
- <?php
687
-
688
- //reindex cat_ids_array
689
- $re_cat_ids_array = array_values($cat_ids_array);
690
-
691
- for($i=0; $i<count($re_cat_ids_array); $i++)
692
- {
693
- echo'
694
- <style>
695
- #cats_widget_'.$many_sp_calendar.' #category'.$re_cat_ids_array[$i].'
696
- {
697
- text-decoration:underline;
698
- cursor:pointer;
699
-
700
- }
701
-
702
- </style>';
703
-
704
- }
705
-
706
-
707
-
708
- if($cat_ids=='')
709
- $cat_ids='';
710
-
711
-
712
- echo '<ul id="cats_widget_'.$many_sp_calendar.'" style="list-style-type:none;">';
713
-
714
- foreach($categories as $category)
715
- {
716
-
717
- ?>
718
-
719
- <li style="height:30px"><p class="categories1" style="background-color:#<?php echo $category->color;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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(
720
- 'action' => 'spiderbigcalendar_week_widget',
721
- 'theme_id' => $theme_id,
722
- 'calendar' => $calendar_id,
723
- 'select' => $view_select,
724
- 'months' => $prev_month . ',' . $this_month . ',' . $next_month,
725
- 'date' => $year . '-' . $month . '-' . add_0($day),
726
- 'many_sp_calendar' => $many_sp_calendar,
727
- 'cur_page_url' => $path_sp_cal,
728
- 'cat_id' => $category->id,
729
- 'cat_ids' => $cat_ids,
730
- 'widget' => $widget,
731
- 'TB_iframe' => 1,
732
- ), admin_url('admin-ajax.php'));?>','<?php echo $many_sp_calendar; ?>','<?php echo $widget; ?>')"> <?php echo $category->title ?></p></li>
733
-
734
-
735
- <?php
736
-
737
-
738
- }
739
-
740
- echo '</ul><br><br>';
741
-
742
- die();
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; ?>')">&#9668;
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; ?>')">&#9658;
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">&nbsp;' . __('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;?>">&nbsp;&nbsp;&nbsp;&nbsp;</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=".$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("SELECT " . $wpdb->prefix . "spidercalendar_event.*," . $wpdb->prefix . "spidercalendar_event_category.color from " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category = " . $wpdb->prefix . "spidercalendar_event_category.id where " . $wpdb->prefix . "spidercalendar_event_category.published=1 and " . $wpdb->prefix . "spidercalendar_event.category IN (".$cat_ids.") and " . $wpdb->prefix . "spidercalendar_event.published=1 and ( ( (date<='".substr( $date,0,7)."-01' or date like '".substr( $date,0,7)."%') and (date_end>='".substr( $date,0,7)."-01' ) or date_end='0000-00-00' ) or ( date_end is Null and date like '".substr( $date,0,7)."%' ) ) and calendar='".$calendar."' ".$order_by." ");
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>&nbsp;&nbsp;' : '') : '');
317
- if ($rows[$i - 1]->time and $show_time != 0) {
318
- $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
319
- }
320
- else {
321
- $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
334
- if ($rows[$i - 1]->time and $show_time != 0) {
335
- $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
336
- }
337
- else {
338
- $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
360
- if ($rows[$i - 1]->time and $show_time != 0) {
361
- $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
362
- }
363
- else {
364
- $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
378
- if ($rows[$i - 1]->time and $show_time != 0) {
379
- $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
380
- }
381
- else {
382
- $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
404
- if ($rows[$i - 1]->time and $show_time != 0) {
405
- $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
406
- }
407
- else {
408
- $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
422
- if ($rows[$i - 1]->time and $show_time != 0) {
423
- $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
424
- }
425
- else {
426
- $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
448
- if ($rows[$i - 1]->time and $show_time != 0) {
449
- $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
450
- }
451
- else {
452
- $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
466
- if ($rows[$i - 1]->time and $show_time != 0) {
467
- $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
468
- }
469
- else {
470
- $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
491
- if ($rows[$i - 1]->time and $show_time != 0) {
492
- $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
493
- }
494
- else {
495
- $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
509
- if ($rows[$i - 1]->time and $show_time != 0) {
510
- $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
511
- }
512
- else {
513
- $list .= '&nbsp;' . $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=".$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("SELECT " . $wpdb->prefix . "spidercalendar_event.*," . $wpdb->prefix . "spidercalendar_event_category.color from " . $wpdb->prefix . "spidercalendar_event JOIN " . $wpdb->prefix . "spidercalendar_event_category ON " . $wpdb->prefix . "spidercalendar_event.category = " . $wpdb->prefix . "spidercalendar_event_category.id where " . $wpdb->prefix . "spidercalendar_event_category.published=1 and " . $wpdb->prefix . "spidercalendar_event.category IN (".$cat_ids.") and " . $wpdb->prefix . "spidercalendar_event.published=1 and ( ( (date<='".substr( $date,0,7)."-01' or date like '".substr( $date,0,7)."%') and (date_end>='".substr( $date,0,7)."-01' ) or date_end='0000-00-00' ) or ( date_end is Null and date like '".substr( $date,0,7)."%' ) ) and calendar='".$calendar."' ".$order_by." ");
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, $year)) == $rows[$i - 1]->month_week) {
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>&nbsp; ';
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>&nbsp; ';
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>&nbsp; ';
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>&nbsp; ';
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>&nbsp; ';
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>&nbsp; ';
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>&nbsp; ';
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>&nbsp; ';
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>&nbsp; ';
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>&nbsp; ';
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>&nbsp;&nbsp;' : '') : '');
317
+ if ($rows[$i - 1]->time and $show_time != 0) {
318
+ $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
319
+ }
320
+ else {
321
+ $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
334
+ if ($rows[$i - 1]->time and $show_time != 0) {
335
+ $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
336
+ }
337
+ else {
338
+ $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
360
+ if ($rows[$i - 1]->time and $show_time != 0) {
361
+ $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
362
+ }
363
+ else {
364
+ $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
378
+ if ($rows[$i - 1]->time and $show_time != 0) {
379
+ $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
380
+ }
381
+ else {
382
+ $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
404
+ if ($rows[$i - 1]->time and $show_time != 0) {
405
+ $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
406
+ }
407
+ else {
408
+ $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
422
+ if ($rows[$i - 1]->time and $show_time != 0) {
423
+ $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
424
+ }
425
+ else {
426
+ $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
448
+ if ($rows[$i - 1]->time and $show_time != 0) {
449
+ $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
450
+ }
451
+ else {
452
+ $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
466
+ if ($rows[$i - 1]->time and $show_time != 0) {
467
+ $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
468
+ }
469
+ else {
470
+ $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
491
+ if ($rows[$i - 1]->time and $show_time != 0) {
492
+ $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
493
+ }
494
+ else {
495
+ $list .= '&nbsp;' . $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>&nbsp;&nbsp;' : '');
509
+ if ($rows[$i - 1]->time and $show_time != 0) {
510
+ $list .= '&nbsp;' . $rows[$i - 1]->title . '<br>(' . $rows[$i - 1]->time . ')</p>';
511
+ }
512
+ else {
513
+ $list .= '&nbsp;' . $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 = sub