-
Notifications
You must be signed in to change notification settings - Fork 0
/
pgm-cal-system.php
1004 lines (714 loc) · 38.3 KB
/
pgm-cal-system.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
error_reporting(E_PARSE);
if($_GET['_SESSION'] != '' || $_POST['_SESSION'] != '' || $_COOKIE['_SESSION'] != '') { exit; }
###############################################################################
## Soholaunch(R) Site Management Tool
## Version 4.5
##
## Author: Mike Johnston [mike.johnston@soholaunch.com]
## Homepage: http://www.soholaunch.com
## Bug Reports: http://bugzilla.soholaunch.com
## Release Notes: sohoadmin/build.dat.php
###############################################################################
##############################################################################
## COPYRIGHT NOTICE
## Copyright 1999-2003 Soholaunch.com, Inc. and Mike Johnston
## Copyright 2003-2007 Soholaunch.com, Inc.
## All Rights Reserved.
##
## This script may be used and modified in accordance to the license
## agreement attached (license.txt) except where expressly noted within
## commented areas of the code body. This copyright notice and the comments
## comments above and below must remain intact at all times. By using this
## code you agree to indemnify Soholaunch.com, Inc, its coporate agents
## and affiliates from any liability that might arise from its use.
##
## Selling the code for this program without prior written consent is
## expressly forbidden and in violation of Domestic and International
## copyright laws.
###############################################################################
#######################################################
## BUILD RAND KEY FIELD FUNCTION
#######################################################
error_reporting(E_PARSE);
session_start();
include_once('sohoadmin/includes/emulate_globals.php');
function GEN_KEY() {
for ($GK=1;$GK<=15;$GK++) {
$BASE_32 .= rand(0,999);
}
$BASE_32 .= date("gis"); // Append timestamp with seconds num to 100% guarantee rnd key
$NEW_KEY = md5($BASE_32);
return $NEW_KEY;
}
######################################################################
### DEFINE THE PAGE IN WHICH THIS MODULE IS RUNNING
######################################################################
$CAL_MOD_PAGE = $pr;
######################################################################
### SETUP OVERALL DISPLAY SETTINGS AND DETERMINE WHICH STEP
### TO BEGIN WITH. WE HAVE TWO CALENDAR TYPES, MONTHLY AND WEEKLY
######################################################################
// --------------------------------------------------------
// Get product display setup (colors; permissions; etc.)
// --------------------------------------------------------
$result = mysql_query("SELECT * FROM calendar_display");
$err_test = mysql_num_rows($result);
if ($err_test < 1) { echo lang("Please Setup Calendar System Display Settings."); exit; }
$DISPLAY = mysql_fetch_array($result);
if ($SEL_MONTH == "") { $SEL_MONTH = date("m"); } // Set default dates if drop down not active
if ($SEL_YEAR == "") { $SEL_YEAR = date("Y"); }
if ($CHANGE_CAT == "") { $CHANGE_CAT = "ALL"; }
// --------------------------------------------------------
// Setup Drop Down Options for Categories
// --------------------------------------------------------
if ($CHANGE_CAT == "ALL") { $osel = "SELECTED"; } else { $osel = ""; }
$copts = "<OPTION VALUE=\"ALL\" $osel>".lang("All")."</OPTION>\n";
$c = mysql_query("SELECT * FROM calendar_category ORDER BY Category_Name");
$NUM_CATEGORIES = mysql_num_rows($c);
while ($r = mysql_fetch_array($c)) {
if ($CHANGE_CAT == "$r[Category_Name]") { $osel = "SELECTED"; $CURRENT_CAT_KEY = $r[PRIKEY]; } else { $osel = ""; }
$CAT_DISPLAY_NAME[$r[PRIKEY]] = $r[Category_Name];
if ($CALFORM_CATEGORY == $r[Category_Name]) { $CALFORM_CATNUM = $r[PRIKEY]; }
$copts .= "<OPTION VALUE=\"$r[Category_Name]\" $osel>$r[Category_Name]</OPTION>\n";
}
if (isset($OWNER_NAME) && $DISPLAY[ALLOW_PERSONAL_CALENDARS] == "Y") {
if (eregi("AUTH:", $CHANGE_CAT)) { $osel = "SELECTED"; } else { $osel = ""; }
$copts .= "<OPTION VALUE=\"AUTH:$MD5CODE\" $osel>".lang("Private").": $OWNER_NAME</OPTION>\n";
}
$MONTH_OPTIONS = "";
for ($x=1;$x<=12;$x++) {
$val = date("m", mktime(0,0,0,$x,1,2002));
$display = date("M", mktime(0,0,0,$x,1,2002));
if ($val == $SEL_MONTH) { $SEL = "SELECTED"; } else { $SEL = ""; }
$MONTH_OPTIONS .= "<OPTION VALUE=\"$val\" $SEL>$display</OPTION>\n";
}
$YEAR_OPTIONS = "";
for ($x=2002;$x<=2015;$x++) {
if ($x == $SEL_YEAR) { $SEL = "SELECTED"; } else { $SEL = ""; }
$YEAR_OPTIONS .= "<OPTION VALUE=\"$x\" $SEL>$x</OPTION>\n";
}
############################################################################
### CHECK FOR USER SUBMISSION AND PROCESS FORM ACTIVITY NOW
############################################################################
if (isset($PUBLIC_SUBMIT_EVENT)) { // Submit event has been requested
// Include event submission form for display in step one.
// -------------------------------------------------------
if ($FORM_SUBMIT_STEP == "") {
if ($EDIT_EVENT_RECORD != "") {
$edresult = mysql_query("SELECT * FROM calendar_events WHERE PRIKEY = '$EDIT_EVENT_RECORD'");
$EDIT_DATA = mysql_fetch_array($edresult);
}
if ($DELETE_EVENT_RECORD != "") {
mysql_query("DELETE FROM calendar_events WHERE PRIKEY = '$DELETE_EVENT_RECORD'");
echo "<DIV ALIGN=CENTER CLASS=text>".lang("Your selected event has been deleted.")."</DIV>\n";
$tResultFlag = 1;
} else {
// Log this calendar view into stats
// -----------------------------------------------------------------
if (file_exists("pgm-site_stats.inc.php")) { // Check; this mod N/A in Lite Version
$statpage = "Calendar: Submit Event";
include ("pgm-site_stats.inc.php");
}
// -----------------------------------------------------------------
$filename = "pgm-cal-submitevent.inc.php";
ob_start();
include("$filename");
$TMP_HTML = ob_get_contents();
ob_end_clean();
echo $TMP_HTML;
} // End if Delete Check
} // End Form Submit Step 1
if ($FORM_SUBMIT_STEP == "2") {
// Check for form submission errors
// ----------------------------------------------------
$err = 0;
if (strlen($CALFORM_NAME) < 3) { $err = 1; }
if (strlen($CALFORM_EMAILADDRESS) < 5) { $err = 1; }
if (strlen($CALFORM_TITLE) < 3) { $err = 1; }
// If Errors exists; flip back to form for correction
// ----------------------------------------------------
if ($err == 1) {
$filename = "pgm-cal-submitevent.inc.php";
ob_start();
include("$filename");
$TMP_HTML = ob_get_contents();
ob_end_clean();
echo "<DIV ALIGN=CENTER CLASS=text><font color=red>".lang("You did not enter one or more required fields. Please modify your submission and try again.")."</font></DIV><BR>\n";
echo $TMP_HTML;
}
// No errors; let's decide what to do with the submission:
// If the submitted category contains "AUTH:"; then this
// is an addition to a personal calendar. Otherwise it
// is a normal submission. (The user could not have a
// choice of an AUTH: category if it were not theirs)
// -------------------------------------------------------
$tResultFlag = 0;
if ($err == 0) {
$tmp_date = $CALFORM_YEAR."-".$CALFORM_MONTH."-".$CALFORM_DAY;
if (eregi("AUTH:", $CALFORM_CATEGORY)) { // This is a personal event; just add it
// Add this personal event to the data table now
// -----------------------------------------------
$tmp = eregi_replace("AUTH:", "", $CALFORM_CATEGORY);
if ($EDIT_CAL_RECORD == "") {
$THIS_NEW_KEY = GEN_KEY();
mysql_query("INSERT INTO calendar_events VALUES('$THIS_NEW_KEY','$tmp_date',' ','$CALFORM_START_TIME',
'$CALFORM_END_TIME','$CALFORM_TITLE','$CALFORM_DETAILS','$tmp','','','','Y','','','')");
} else {
mysql_query("UPDATE calendar_events SET EVENT_DATE = '$tmp_date', EVENT_START = '$CALFORM_START_TIME',
EVENT_END = '$CALFORM_END_TIME', EVENT_TITLE = '$CALFORM_TITLE', EVENT_DETAILS = '$CALFORM_DETAILS', EVENT_CATEGORY = '$tmp'
WHERE PRIKEY = '$EDIT_CAL_RECORD'");
}
$tResultFlag = 1;
echo "<DIV ALIGN=CENTER CLASS=text><font color=maroon>[ ".lang("Event Added to your Calendar")." ]</font></DIV><BR>\n";
} else { // Build confirmation email and send
// Add this event as a "Pending" event for confirmation
// ---------------------------------------------------------
$tmp = "~~~PENDING~~~";
$pendKey = GEN_KEY();
if ($CALFORM_CATNUM == "") { $CALFORM_CATNUM = "ALL"; }
mysql_query("INSERT INTO calendar_events VALUES('$pendKey','$tmp_date',' ','$CALFORM_START_TIME',
'$CALFORM_END_TIME','$CALFORM_TITLE','$CALFORM_DETAILS','$CALFORM_CATNUM','','','$tmp','Y','','','')");
$LAST_ID = $pendKey;
// Create confirmation email for webmaster
// ----------------------------------------------------------
$CALFORM_TITLE = stripslashes($CALFORM_TITLE);
$CALFORM_DETAILS = stripslashes($CALFORM_DETAILS);
$email_confirm = lang("The following event was submitted to your calendar. To approve this event, click the approve link below.")."\n\n";
$email_confirm .= lang("If you do not wish to add this event to your calendar, simply disregard this email.")."\n\n";
$email_confirm .= lang("Event Date").": $tmp_date\n";
$email_confirm .= lang("Event Category").": $CALFORM_CATEGORY\n";
$email_confirm .= lang("Event Title").": $CALFORM_TITLE\n";
$email_confirm .= lang("Start Time").": $CALFORM_START_TIME ".$lang["End Time"].": $CALFORM_END_TIME\n\n";
$email_confirm .= lang("Event Details").": $CALFORM_DETAILS\n\n\n";
$email_confirm .= lang("To approve, click the link below:")."\n";
$email_confirm .= "http://$this_ip/pgm-cal-confirm.php?id=$LAST_ID\n\n\n";
$email_confirm .= "*** ".lang("THIS IS AN AUTO-GENERATED EMAIL FROM YOUR WEBSITE")." ***";
if ($DISPLAY[EMAIL_CONFIRMATION] != "") {
mail("$DISPLAY[EMAIL_CONFIRMATION]", "Calendar Event Submission", "$email_confirm", "FROM: $CALFORM_EMAILADDRESS");
}
$tResultFlag = 1;
echo "<DIV ALIGN=CENTER CLASS=text><font color=maroon>[ ".lang("Your submission has been sent to our calendar manager for approval.")." ".lang("Thank you").". ]</font></DIV><BR>\n";
} // End post type
} // End only if non-error
} // End Step 2
// Make sure that we flag the fact that we don't need to
// display any calendar type functions that appear below
// this function in the script
// ------------------------------------------------------------------
if ($tResultFlag != 1) {
$dType = "FORM";
if (isset($DISPLAY_SEARCH_CALENDAR)) { unset($DISPLAY_SEARCH_CALENDAR); }
if (isset($DISPLAY_MONTHLY_CALENDAR)) { unset($DISPLAY_MONTHLY_CALENDAR); }
}
} // End Submit Event
############################################################################
// Create overall form that will wrap around the display
// calendar for both displays
// -----------------------------------------------------------
$START_FORM = "<FORM METHOD=POST ACTION=\"index.php\">\n";
$START_FORM .= "<INPUT TYPE=HIDDEN NAME=\"pr\" VALUE=\"$CAL_MOD_PAGE\">\n";
$END_FORM = "</FORM>\n\n";
// --------------------------------------------------------
// $dType :: calendar display type during runtime
// M = Montly View || W = Weekly View
// --------------------------------------------------------
if (isset($DISPLAY_SEARCH_CALENDAR)) { $dType = "W"; }
if (isset($DISPLAY_MONTHLY_CALENDAR)) { $dType = "M"; }
if (isset($CHANGE_CALENDAR_CATEGORY)) { $dType = "M"; }
if (isset($CHANGE_CALENDAR_MONYEAR)) { $dType = "M"; }
if ($dType == "") { $dType = $DISPLAY[DISPLAY_STYLE]; }
#######################################################################
### LET'S DO THE MONTH (M) VIEW FIRST, SINCE WE ALREADY HAVE THAT ONE
### "CHEATED" FOR US IN THE "MONTH ONLY" OBJECT INCLUDE :)
#######################################################################
if (eregi("M", $dType) && !eregi("W", $dType) && $dType != "FORM") { // It's late and I can't remember upper or lower case
// Log this calendar view into stats
// -----------------------------------------------------------------
if (file_exists("pgm-site_stats.inc.php")) { // Check; this mod N/A in Lite Version
$statpage = "Calendar: Monthly View";
include ("pgm-site_stats.inc.php");
}
// -----------------------------------------------------------------
$REUSE_FLAG = 1; // Set this flag for the include so it doesn't use "this month" by default
// Include the single category monthly view include and pass
// the REUSE FLAG to let the script know that we are using
// this within the system.
// -----------------------------------------------------------
$filename = "pgm-cal-monthview.php";
ob_start();
include("$filename");
$TMP_HTML = ob_get_contents();
ob_end_clean();
// Create drop down boxes that hold category and month/year
// selection searchs for normal system operation.
// -----------------------------------------------------------
$DROP_DOWN = "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 ALIGN=CENTER WIDTH=100%>\n";
$DROP_DOWN .= "<TR>\n";
if ($NUM_CATEGORIES > 0) { // Don't Display Category option if NO categories exist
$DROP_DOWN .= "<TD ALIGN=CENTER VALIGN=MIDDLE CLASS=text>\n";
if($hide_drop_down != 1){
$DROP_DOWN .= "<B>Category</B>: </FONT><SELECT NAME=\"CHANGE_CAT\" CLASS=smtext STYLE='background: #EFEFEF;'>\n";
$DROP_DOWN .= $copts;
$DROP_DOWN .= "</SELECT> <input type=submit name=CHANGE_CALENDAR_CATEGORY value=\"Change\" class=FormLt1>\n";
}
$DROP_DOWN .= "</TD>\n";
}
$DROP_DOWN .= "<TD ALIGN=CENTER VALIGN=MIDDLE CLASS=text>\n";
$DROP_DOWN .= "<B>".lang("Current View")."</B>: </font><SELECT NAME=\"SEL_MONTH\" class=smtext STYLE='background: #EFEFEF;'>$MONTH_OPTIONS</SELECT> <SELECT NAME=\"SEL_YEAR\" class=smtext STYLE='background: #EFEFEF;'>$YEAR_OPTIONS</SELECT>\n";
$DROP_DOWN .= " <INPUT TYPE=SUBMIT NAME=CHANGE_CALENDAR_MONYEAR VALUE=\"".lang("View")."\" CLASS=FormLt1>\n";
$DROP_DOWN .= "</TD>\n";
$DROP_DOWN .= "</TR></TABLE>";
// Create footer table that will allow Public Event Submissions
// AND/OR display a link to the "detailed/searchable" calendar view
// -------------------------------------------------------------------
$CAL_FOOTER = "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 ALIGN=CENTER WIDTH=100%>\n";
$CAL_FOOTER .= "<TR>\n";
if ($DISPLAY[ALLOW_PUBLIC_SUBMISSIONS] == "Y" || ($DISPLAY[ALLOW_PERSONAL_CALENDARS] == "Y" && isset($OWNER_NAME))) { // Don't Display Submit Event unless turned on.
$CAL_FOOTER .= "<TD ALIGN=CENTER VALIGN=MIDDLE CLASS=text><BR>\n";
$CAL_FOOTER .= "<input type=submit name=PUBLIC_SUBMIT_EVENT value=\" ".lang("Submit an Event")." \" class=FormLt1>\n";
$CAL_FOOTER .= "</TD>\n";
}
$CAL_FOOTER .= "<TD ALIGN=CENTER VALIGN=MIDDLE CLASS=smtext><BR>\n";
$CAL_FOOTER .= "<INPUT TYPE=SUBMIT NAME=DISPLAY_SEARCH_CALENDAR VALUE=\"".lang("Detail Event Search")."\" CLASS=FormLt1>\n";
$CAL_FOOTER .= "</TD>\n";
$CAL_FOOTER .= "</TR></TABLE>";
// Replace ##DROPDOWN## insert from month view .inc with the
// created drop down selections
// -----------------------------------------------------------
$TMP_HTML = str_replace("##DROPDOWN##", "$DROP_DOWN", $TMP_HTML);
// Ok, Let's output the final result to the screen and call
// it quits for now.
// -----------------------------------------------------------
echo $START_FORM;
echo $TMP_HTML;
echo $CAL_FOOTER;
echo $END_FORM;
} // End Montly View Calendar Display
#######################################################################
### NOW LET'S CREATE THE "DETAIL EVENT SEARCH" OR "WEEKLY/DAILY" VIEW
### CALENDAR DISPLAY VERSION
#######################################################################
if (eregi("W", $dType) && !eregi("M", $dType) && $dType != "FORM") {
// Check for passed variables from header menu that may overide default
// selections
// ---------------------------------------------------------------------
if ($DETAIL_SHOW_MONTH != "") {
$tmp = split("-", $DETAIL_SHOW_MONTH);
$SEL_MONTH = $tmp[1];
$SEL_YEAR = $tmp[0];
}
// If there is an Authorized User Loged In, Let's search for any events
// they may be able to view beyond "public" events
// -------------------------------------------------------------------------
$SEC_SEARCH = "EVENT_SECURITYCODE = 'Public'";
if (isset($GROUPS)) {
$flag = 0;
$tmp = split(";", $GROUPS);
$tmpc = count($tmp);
for ($dd=0;$dd<=$tmpc;$dd++) {
if ($tmp[$dd] != "") {
$SEC_SEARCH .= " OR EVENT_SECURITYCODE = '$tmp[$dd]'";
$flag++;
}
}
if ($DISPLAY[ALLOW_PERSONAL_CALENDARS] == "Y") { $SEC_SEARCH .= " OR EVENT_SECURITYCODE = ''"; }
if ($flag != 0) { $SEC_SEARCH = "($SEC_SEARCH)"; }
}
// Setup base date calculation variables for use with header build
// -----------------------------------------------------------------------
$NUM_DAYS_IN_MONTH = date("t", mktime(0,0,0,$SEL_MONTH,1,$SEL_YEAR));
$START_DOW = date("l", mktime(0,0,0,$SEL_MONTH,1,$SEL_YEAR)); // What day of week does month start on?
$WK_NUM = date("w", mktime(0,0,0,$SEL_MONTH,1,$SEL_YEAR)); // What day of week NUMBER does this start on
if ($SEL_MONTH == date("m")) { $HIGHLIGHT = "on"; $HIGHLIGHT_DAY = date("j"); }
$day_of_week = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
$sm_day_of_week = array('SUN','MON','TUE','WED','THU','FRI','SAT');
$TEXT_MONTH = date("M", mktime(0,0,0,$SEL_MONTH,1,$SEL_YEAR));
$LONG_TEXT_MONTH = date("F", mktime(0,0,0,$SEL_MONTH,1,$SEL_YEAR));
$DI_DATE = date("F Y", mktime(0,0,0,$SEL_MONTH,1,$SEL_YEAR));
$DI_DATE = strtoupper($DI_DATE);
$t = $SEL_MONTH - 1;
$PREV_MONTH = date("M", mktime(0,0,0,$t,1,$SEL_YEAR));
$prev_pass = date("Y-m", mktime(0,0,0,$t,1,$SEL_YEAR));
$t = $SEL_MONTH + 1;
$NEXT_MONTH = date("M", mktime(0,0,0,$t,1,$SEL_YEAR));
$next_pass = date("Y-m", mktime(0,0,0,$t,1,$SEL_YEAR));
// BUILD HEADER SEARCH QUERY TABLE
// -------------------------------------------------------------------
echo $START_FORM;
echo "<TABLE BORDER=0 CELLPADDING=8 CELLSPACING=0 WIDTH=99% ALIGN=CENTER STYLE='border: 0px inset black;'>\n";
echo "<TR>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP CLASS=smtext WIDTH=50% BGCOLOR=WHITE>\n";
// Build "Cal-At-A-Glance-Nav" Structure
// ----------------------------------------------------------------
echo "<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 WIDTH=95% ALIGN=CENTER>\n";
echo "<TR><TD ALIGN=LEFT CLASS=smtext><a href=\"".pagename($CAL_MOD_PAGE, "&")."DISPLAY_SEARCH_CALENDAR=&DETAIL_SHOW_MONTH=$prev_pass\"><< $PREV_MONTH</A></TD>\n";
echo "<TD ALIGN=CENTER CLASS=text><B>$DI_DATE</B></TD>\n";
echo "<TD ALIGN=RIGHT CLASS=smtext><a href=\"".pagename($CAL_MOD_PAGE, "&")."DISPLAY_SEARCH_CALENDAR=&DETAIL_SHOW_MONTH=$next_pass\">$NEXT_MONTH >></a></TD></TR></TABLE>\n\n";
echo "<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 WIDTH=95% ALIGN=CENTER STYLE='border: 1px inset black;'>\n";
echo "<TR>\n";
echo "<TD ALIGN=CENTER VALIGN=MIDDLE BGCOLOR=\"OLDLACE\" CLASS=smtext STYLE='border: 1px inset black;'>";
echo "<font color=$DISPLAY[TEXT_COLOR]><a href=\"".pagename($CAL_MOD_PAGE, "&")."DISPLAY_MONTHLY_CALENDAR=&SEL_MONTH=$SEL_MONTH&SEL_YEAR=$SEL_YEAR&CHANGE_CAT=$CHANGE_CAT\">".lang("Month")."</b><font>";
echo "</TD>\n";
for ($x=0;$x<=6;$x++) {
echo "<TD ALIGN=CENTER VALIGN=MIDDLE BGCOLOR=$DISPLAY[BACKGROUND_COLOR] CLASS=smtext STYLE='border: 1px inset black;'>";
echo "<font color=$DISPLAY[TEXT_COLOR]><B>$sm_day_of_week[$x]</b><font>";
echo "</TD>\n";
}
echo "</TR>\n";
echo "\n\n<TR>\n";
$FLAG = 0;
$display_day = 1;
echo "<TD ALIGN=CENTER VALIGN=TOP BGCOLOR=OLDLACE CLASS=smtext STYLE='border: 1px inset black;'>\n";
$this_start = 1;
$this_end = 7 - $WK_NUM;
echo "<a href=\"".pagename($CAL_MOD_PAGE, "&")."DISPLAY_SEARCH_CALENDAR=&DETAIL_VIEW_WEEK=$this_start-$this_end&SEL_MONTH=$SEL_MONTH&SEL_YEAR=$SEL_YEAR&CHANGE_CAT=$CHANGE_CAT\">$TEXT_MONTH<BR>$this_start-$this_end</A>";
echo "</TD>\n";
for ($x=0;$x<=6;$x++) { // Start First Week Loop
if (eregi("$START_DOW", $day_of_week[$x]) || $FLAG == 1) {
if ($HIGHLIGHT == "on" && $display_day == $HIGHLIGHT_DAY) { $BGCOLOR = "skyblue"; } else { $BGCOLOR = "WHITE"; }
echo "<TD ALIGN=CENTER VALIGN=TOP BGCOLOR=$BGCOLOR CLASS=smtext STYLE='border: 1px inset black;'>\n";
$this_date = $SEL_YEAR."-".$SEL_MONTH."-".$display_day;
echo "<a href=\"".pagename($CAL_MOD_PAGE, "&")."DISPLAY_SEARCH_CALENDAR=&DETAIL_VIEW=$this_date&SEL_MONTH=$SEL_MONTH&SEL_YEAR=$SEL_YEAR&CHANGE_CAT=$CHANGE_CAT\">$TEXT_MONTH<BR>$display_day</A>";
echo "</TD>\n";
$display_day++;
$FLAG = 1;
} else {
echo "\n<TD ALIGN=LEFT VALIGN=TOP BGCOLOR=#EFEFEF CLASS=text style='border: 1px inset black;'>";
echo " ";
echo "</TD>\n";
}
} // End First Week Loop
echo "</TR>\n";
$FLAG=0;
$NUM_ROWS = $NUM_DAYS_IN_MONTH/7;
$days_in_first = $display_day - 1;
$days_in_rest = $NUM_DAYS_IN_MONTH - $days_in_first;
# Display extra row?
if($days_in_rest > 28){
if ($NUM_ROWS > 4) { $NUM_ROWS = 5; }
}
for ($x=1;$x<=$NUM_ROWS;$x++) { // Start Weekly Loop
echo "\n\n<TR>\n";
echo "<TD ALIGN=CENTER VALIGN=TOP BGCOLOR=OLDLACE CLASS=smtext STYLE='border: 1px inset black;'>\n";
$this_start = $display_day;
$this_end = $this_start + 6;
if ($this_end > $NUM_DAYS_IN_MONTH) {
$this_end = $NUM_DAYS_IN_MONTH;
}
echo "<a href=\"".pagename($CAL_MOD_PAGE, "&")."DISPLAY_SEARCH_CALENDAR=&DETAIL_VIEW_WEEK=$this_start-$this_end&SEL_MONTH=$SEL_MONTH&SEL_YEAR=$SEL_YEAR&CHANGE_CAT=$CHANGE_CAT\">$TEXT_MONTH<BR>$this_start-$this_end</A>";
echo "</TD>\n";
for ($y=1;$y<=7;$y++) { // Start Daily Loop
if ($FLAG != 1) {
if ($HIGHLIGHT == "on" && $display_day == $HIGHLIGHT_DAY) { $BGCOLOR = "skyblue"; } else { $BGCOLOR = "WHITE"; }
echo "\n<TD ALIGN=CENTER VALIGN=TOP BGCOLOR=$BGCOLOR CLASS=smtext STYLE='border: 1px inset black;'>\n";
$this_date = $SEL_YEAR."-".$SEL_MONTH."-".$display_day;
echo "<a href=\"".pagename($CAL_MOD_PAGE, "&")."DISPLAY_SEARCH_CALENDAR=&DETAIL_VIEW=$this_date&SEL_MONTH=$SEL_MONTH&SEL_YEAR=$SEL_YEAR&CHANGE_CAT=$CHANGE_CAT\">$TEXT_MONTH<BR>$display_day</A>";
echo "\n</TD>\n";
} else {
echo "\n<TD ALIGN=LEFT VALIGN=TOP BGCOLOR=#EFEFEF CLASS=text STYLE='border: 1px inset black;'>";
echo " ";
echo "</TD>\n";
}
if ($display_day == $NUM_DAYS_IN_MONTH) { $FLAG = 1; }
$display_day++;
} // End Daily ($y) Loop
echo "</TR>\n";
} // End Month ($x) Loop
echo "\n\n</TABLE>\n";
if (eregi("AUTH:", $CHANGE_CAT)) {
$tmp = "($OWNER_NAME)";
} else {
$tmp = "$CHANGE_CAT";
}
echo "<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 WIDTH=95% ALIGN=CENTER>\n";
echo "<TR><TD ALIGN=CENTER BGCOLOR=WHITE CLASS=smtext>\n";
echo "<FONT COLOR=#999999>".lang("Current Category").": $tmp</FONT>\n";
echo "</TR></TABLE>\n\n";
// Now Build the Search Side to the header Menu
// --------------------------------------------------------------------------------
echo "</TD><TD ALIGN=LEFT VALIGN=TOP CLASS=text WIDTH=50%>\n";
echo "<INPUT TYPE=HIDDEN NAME=\"SEL_MONTH\" VALUE=\"$SEL_MONTH\">\n";
echo "<INPUT TYPE=HIDDEN NAME=\"SEL_YEAR\" VALUE=\"$SEL_YEAR\">\n";
echo "<INPUT TYPE=HIDDEN NAME=\"dType\" VALUE=\"W\">\n";
echo "<BR><B>Search Keywords</B>:<BR><INPUT TYPE=TEXT NAME=DETAIL_SEARCH_KEYWORDS VALUE=\"\" class=\"textfield\" STYLE='WIDTH: 210px;'><BR><BR>";
if ($NUM_CATEGORIES > 0) {
echo "<B>".lang("In Category")."</B>:<BR><SELECT NAME=\"CHANGE_CAT\" CLASS=smtext STYLE='WIDTH: 210px;'>\n";
echo "$copts</SELECT><BR><BR>\n";
}
echo "<B>Sort by</B>:<BR><INPUT TYPE=RADIO NAME=SORT_RESULTS_BY VALUE=\"EVENT_DATE\" CHECKED> Event Date\n";
echo " <INPUT TYPE=RADIO NAME=SORT_RESULTS_BY VALUE=\"EVENT_TITLE\"> Event Title\n";
echo " <SELECT NAME=\"SORT_BY_ORDER\" CLASS=smtext><OPTION VALUE=\"ASC\">ASC</OPTION>\n";
echo "<OPTION VALUE=\"DESC\">DESC</OPTION></SELECT><BR><BR>\n";
echo "<INPUT TYPE=SUBMIT NAME=\"CALENDAR_SEARCH\" VALUE=\" ".lang("Search Now")." \" CLASS=FormLt1>\n";
if ($DISPLAY[ALLOW_PUBLIC_SUBMISSIONS] == "Y" || ($DISPLAY[ALLOW_PERSONAL_CALENDARS] == "Y" && isset($OWNER_NAME))) { // Don't Display Submit Event unless turned on.
echo " <input type=submit name=PUBLIC_SUBMIT_EVENT value=\" ".lang("Submit an Event")." \" class=FormLt1>\n";
}
echo "<BR><DIV ALIGN=CENTER CLASS=smtext style='padding: 10px;'><FONT COLOR=#999999>".lang("Submit a search to change categories.")."</FONT></DIV>\n";
echo "</TD></TR></TABLE>\n"; // End Header Table
###################################################################################
### START ACTUAL DETAIL DISPLAY BASED ON SEARCH OR "CLICK" REQUIREMENT
###################################################################################
// If an exact day way requested, pull request from this function
// -----------------------------------------------------------------
if ($DETAIL_VIEW != "") {
// Log this calendar view into stats
// -----------------------------------------------------------------
if (file_exists("pgm-site_stats.inc.php")) { // Check; this mod N/A in Lite Version
$statpage = "Calendar: Weekly View";
include ("pgm-site_stats.inc.php");
}
// -----------------------------------------------------------------
$show_cal_type = "";
$tmp = split("-", $DETAIL_VIEW);
$REQ_YEAR = $tmp[0];
$REQ_DAY = $tmp[2];
$REQ_MONTH = $tmp[1];
$tmp = date("l, F j, Y", mktime(0,0,0,$REQ_MONTH,$REQ_DAY,$REQ_YEAR));
$REQUEST_TITLE = "<B>Events for $tmp:</B>";
$tmp = "$REQ_YEAR-$REQ_MONTH-$REQ_DAY";
if ($CHANGE_CAT != "ALL" && !eregi("AUTH:", $CHANGE_CAT)) {
$CAT_QUERY = "AND EVENT_CATEGORY = '$CURRENT_CAT_KEY'";
} else {
$CAT_QUERY = "";
}
if (eregi("AUTH:", $CHANGE_CAT)) {
$tmp = eregi_replace("AUTH:", "", $CHANGE_CAT);
$CAT_QUERY = "AND EVENT_CATEGORY = '$tmp'";
}
$result = mysql_query("SELECT PRIKEY, EVENT_DATE, EVENT_TITLE, EVENT_CATEGORY, EVENT_DETAILS, EVENT_DETAILPAGE, EVENT_START, EVENT_END, EVENT_SECURITYCODE
FROM calendar_events WHERE EVENT_DATE = '$tmp' AND $SEC_SEARCH $CAT_QUERY ORDER BY EVENT_DATE, EVENT_START");
} // End Day View
// If a weekly view was requested, pull query data from this routine
// -----------------------------------------------------------------
if ($DETAIL_VIEW_WEEK != "") {
// Log this calendar view into stats
// -----------------------------------------------------------------
if (file_exists("pgm-site_stats.inc.php")) { // Check; this mod N/A in Lite Version
$statpage = "Calendar: Weekly View";
include ("pgm-site_stats.inc.php");
}
// -----------------------------------------------------------------
$tmp = split("-", $DETAIL_VIEW_WEEK);
$START_DAY = $tmp[0];
$END_DAY = $tmp[1];
$REQUEST_TITLE = "<B>".lang("Events for the Week of")." $LONG_TEXT_MONTH $START_DAY-$END_DAY, $SEL_YEAR:</B>";
$show_cal_type = "WEEKLYTEMPLATE";
} // End Week View
// If this request is in fact a true SEARCH request; use this routine
// -------------------------------------------------------------------
if (isset($CALENDAR_SEARCH)) {
// Log this calendar view into stats
// -----------------------------------------------------------------
if (file_exists("pgm-site_stats.inc.php")) { // Check; this mod N/A in Lite Version
$statpage = "Calendar: Search Events";
include ("pgm-site_stats.inc.php");
}
// -----------------------------------------------------------------
$show_cal_type = "";
if ($DETAIL_SEARCH_KEYWORDS == "") {
$DETAIL_SEARCH_KEYWORDS = "All Events";
}
$REQUEST_TITLE = "<B>".lang("Events for")." $LONG_TEXT_MONTH $SEL_YEAR ".lang("that match your search for")." \"$DETAIL_SEARCH_KEYWORDS\" ";
if ($NUM_CATEGORIES > 0) {
if (eregi("AUTH:", $CHANGE_CAT)) {
$tmp = lang("your personal calendar")." ($OWNER_NAME)";
} else {
$tmp = lang("the category").", \"$CHANGE_CAT\"";
}
$REQUEST_TITLE .= lang("located in")." $tmp:</B>";
}
if ($CHANGE_CAT != "ALL" && !eregi("AUTH:", $CHANGE_CAT)) {
$CAT_QUERY = "AND EVENT_CATEGORY = '$CURRENT_CAT_KEY'";
} else {
$CAT_QUERY = "";
}
if (eregi("AUTH:", $CHANGE_CAT)) {
$tmp = eregi_replace("AUTH:", "", $CHANGE_CAT);
$CAT_QUERY = "AND EVENT_CATEGORY = '$tmp'";
}
$date_like = "$SEL_YEAR-$SEL_MONTH-";
if ($DETAIL_SEARCH_KEYWORDS == "All Events") {
$result = mysql_query("SELECT PRIKEY, EVENT_DATE, EVENT_KEYWORDS, EVENT_TITLE, EVENT_CATEGORY, EVENT_DETAILS, EVENT_DETAILPAGE, EVENT_START, EVENT_END, EVENT_SECURITYCODE
FROM calendar_events WHERE $SEC_SEARCH $CAT_QUERY ORDER BY $SORT_RESULTS_BY, EVENT_START $SORT_BY_ORDER");
} else {
$result = mysql_query("SELECT PRIKEY, EVENT_DATE, EVENT_KEYWORDS, EVENT_TITLE, EVENT_CATEGORY, EVENT_DETAILS, EVENT_DETAILPAGE, EVENT_START, EVENT_END, EVENT_SECURITYCODE
FROM calendar_events WHERE
EVENT_DATE LIKE '$date_like%' AND
(EVENT_KEYWORDS LIKE '%$DETAIL_SEARCH_KEYWORDS%' OR
EVENT_DATE LIKE '%$DETAIL_SEARCH_KEYWORDS%' OR
EVENT_TITLE LIKE '%$DETAIL_SEARCH_KEYWORDS%' OR
EVENT_DETAILS LIKE '%$DETAIL_SEARCH_KEYWORDS%' OR
EVENT_START LIKE '%$DETAIL_SEARCH_KEYWORDS%') AND
$SEC_SEARCH $CAT_QUERY ORDER BY $SORT_RESULTS_BY, EVENT_START $SORT_BY_ORDER");
} // End All or Something search
} // End Calendar Event Search Check
// BUILD HEADER DISPLAYING REQUESTED VIEW (THE DAY/WEEK)
// -------------------------------------------------------------------
if ($REQUEST_TITLE != "") {
echo "<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=99% ALIGN=CENTER STYLE='border: 1px inset black;'>\n";
echo "<TR>\n";
echo "<TD ALIGN=LEFT VALIGN=TOP BGCOLOR=$DISPLAY[BACKGROUND_COLOR]><FONT SIZE=2 FACE=VERDANA COLOR=$DISPLAY[TEXT_COLOR]>\n";
echo "$REQUEST_TITLE\n";
echo "</TD></TR><TR><TD ALIGN=LEFT VALIGN=TOP CLASS=text BGCOLOR=\"$DISPLAY[BACKGROUND_COLOR]\">";
$check_results = mysql_num_rows($result);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~ START "EACH" RESULT DISPLAY ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ($show_cal_type != "WEEKLYTEMPLATE") {
while ($row = mysql_fetch_array($result)) {
$cat_num = $row[EVENT_CATEGORY];
if ($cat_num == "ALL") {
$category = "All";
} else {
$category = $CAT_DISPLAY_NAME[$cat_num];
}
if ($cat_num == $MD5CODE) {
$category = "<a href=\"".pagename($pr, "&")."EDIT_EVENT_RECORD=$row[PRIKEY]&PUBLIC_SUBMIT_EVENT=\">".lang("Edit Event")."</a>] [<a href=\"".pagename($pr, "&")."DELETE_EVENT_RECORD=$row[PRIKEY]&PUBLIC_SUBMIT_EVENT=\">".lang("Delete Event")."</a>";
}
echo "<TABLE BORDER=0 CELLPADDING=6 CELLSPACING=0 WIDTH=100% ALIGN=LEFT STYLE='border: 1px inset black;'>\n";
echo "<TR>\n";
echo "<TD ALIGN=LEFT VALIGN=TOP CLASS=text BGCOLOR=\"#EFEFEF\">\n";
if ($cat_num == $MD5CODE) {
echo "<img src=securelogin.gif alt=\"".lang("This is your private event.")."\" border=0 hspace=2 vspace=2 align=absmiddle>\n";
}
$t = $row[EVENT_DATE];
$tmp = split("-", $t);
$dDate = date("l, F j, Y", mktime(0,0,0,$tmp[1],$tmp[2],$tmp[0]));
$row[EVENT_TITLE] = stripslashes($row[EVENT_TITLE]);
$row[EVENT_DETAILS] = stripslashes($row[EVENT_DETAILS]);
echo "[ <FONT COLOR=DARKGREEN>".$category."</FONT> ] $dDate<BR><FONT SIZE=2 FACE=VERDANA><B>$row[EVENT_TITLE]</B></FONT>\n";
$tmp = split(":", $row[EVENT_START]);
if ($tmp[0] != "00") {
$tmp = date("g:ia", mktime($tmp[0],$tmp[1],$tmp[2],$SEL_MONTH,1,$SEL_YEAR));
$event_time = $tmp;
if ($row[EVENT_END] != "00:00:00") {
$tmp = split(":", $row[EVENT_END]);
$tmp = date("g:ia", mktime($tmp[0],$tmp[1],$tmp[2],$SEL_MONTH,1,$SEL_YEAR));
$event_time .= "-$tmp";
}
echo " ($event_time)\n";
}
echo "</TD></TR><TR><TD ALIGN=LEFT VALIGN=TOP CLASS=text BGCOLOR=\"WHITE\" STYLE='border-top: 1px inset black;'>\n";
echo "Event Details: ".$row[EVENT_DETAILS];
if ($row[EVENT_DETAILPAGE] != "") {
echo "<a href=\"#\" onclick=\"javscript: window.open('pgm-cal-details.inc.php?id=$row[PRIKEY]','EVENTDETAILS', 'scrollbars=yes,location=no,resizable=yes,width=470,height=400');\">";
if ($row[EVENT_DETAILS] != "") {
echo "[".lang("More Details")."...</a>]\n";
} else {
echo "[ ".lang("Click to View")." ]</a>.\n";
}
}
if ($row[EVENT_DETAILPAGE] == "" && $row[EVENT_DETAILS] == "") {
echo "<FONT COLOR=#999999>".lang("No details available for this event.")."</FONT>\n";
}
echo "</TD></TR></TABLE><BR CLEAR=ALL><BR>";
} // End While Loop
} else { // Show Weekly display (different than others)
// Start building single column "day of the week" chart table
// =============================================================
for ($DAY_COUNT=$START_DAY;$DAY_COUNT <= $END_DAY;$DAY_COUNT++) {
#####
#####
##### BUILD ROW ONE
#####
#####
echo "<TABLE BORDER=0 CELLPADDING=6 CELLSPACING=1 WIDTH=100% ALIGN=CENTER STYLE='border: 1px inset black;'>\n";
echo "<TR>\n";
echo "<TD ALIGN=LEFT VALIGN=TOP BGCOLOR=#EFEFEF><FONT FACE=VERDANA SIZE=2 COLOR=BLACK>\n";
$today ="'$SEL_YEAR-$SEL_MONTH-$DAY_COUNT";
$dDateOwk = date("l", mktime(0,0,0,$SEL_MONTH,$DAY_COUNT,$SEL_YEAR));
$my = date("(M j)", mktime(0,0,0,$SEL_MONTH,$DAY_COUNT,$SEL_YEAR));
echo "<B>$dDateOwk</B> $my</TD></TR><TD ALIGN=LEFT VALIGN=TOP BGCOLOR=WHITE CLASS=text>\n";
$WHERE_QUERY = "EVENT_DATE = '$SEL_YEAR-$SEL_MONTH-$DAY_COUNT'";
if ($CHANGE_CAT != "ALL" && !eregi("AUTH:", $CHANGE_CAT)) {
$CAT_QUERY = "AND EVENT_CATEGORY = '$CURRENT_CAT_KEY'";
} else {
$CAT_QUERY = "";
}
if (eregi("AUTH:", $CHANGE_CAT)) {
$tmp = eregi_replace("AUTH:", "", $CHANGE_CAT);
$CAT_QUERY = "AND EVENT_CATEGORY = '$tmp'";
}
$result = mysql_query("SELECT PRIKEY, EVENT_DATE, EVENT_TITLE, EVENT_CATEGORY, EVENT_DETAILS, EVENT_DETAILPAGE, EVENT_START, EVENT_END,
EVENT_SECURITYCODE FROM calendar_events WHERE $WHERE_QUERY AND $SEC_SEARCH $CAT_QUERY ORDER BY EVENT_DATE, EVENT_START");
$TOTAL_EVENTS_FOR_THIS_DAY = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
$cat_num = $row[EVENT_CATEGORY];
if ($cat_num == "ALL") {
$category = "All";
} else {
$category = $CAT_DISPLAY_NAME[$cat_num];
}
if ($cat_num == $MD5CODE) {
$category = "<a href=\"".pagename($pr, "&")."EDIT_EVENT_RECORD=$row[PRIKEY]&PUBLIC_SUBMIT_EVENT=\">".$lang["Edit Event"]."</a>] [<a href=\"".pagename($pr, "&")."DELETE_EVENT_RECORD=$row[PRIKEY]&PUBLIC_SUBMIT_EVENT=\">".$lang["Delete Event"]."</a>";
}
echo "<TABLE BORDER=0 CELLPADDING=6 CELLSPACING=0 WIDTH=100% ALIGN=LEFT STYLE='border: 1px inset black;'>\n";
echo "<TR>\n";
echo "<TD ALIGN=LEFT VALIGN=TOP CLASS=text BGCOLOR=\"oldlace\">\n";
if ($cat_num == $MD5CODE) {
echo "<img src=securelogin.gif alt=\"".$lang["This is your private event."]."\" border=0 hspace=2 vspace=2 align=absmiddle>\n";
}
$t = $row[EVENT_DATE];
$tmp = split("-", $t);
$dDate = date("F j, Y", mktime(0,0,0,$tmp[1],$tmp[2],$tmp[0]));
$row[EVENT_TITLE] = stripslashes($row[EVENT_TITLE]);
$row[EVENT_DETAILS] = stripslashes($row[EVENT_DETAILS]);
echo "[ <FONT COLOR=DARKGREEN>".$category."</FONT> ] <FONT SIZE=2 FACE=VERDANA><B>$row[EVENT_TITLE]</B></FONT>\n";
$tmp = split(":", $row[EVENT_START]);
$tmp = date("g:ia", mktime($tmp[0],$tmp[1],$tmp[2],$SEL_MONTH,1,$SEL_YEAR));
$event_time = $tmp;
if ($row[EVENT_END] != "00:00:00") {
$tmp = split(":", $row[EVENT_END]);
$tmp = date("g:ia", mktime($tmp[0],$tmp[1],$tmp[2],$SEL_MONTH,1,$SEL_YEAR));
$event_time .= "-$tmp";
}
echo " ($event_time)\n";
echo "</TD></TR><TR><TD ALIGN=LEFT VALIGN=TOP CLASS=text BGCOLOR=\"WHITE\" STYLE='border-top: 1px inset black;'>\n";
echo lang("Event Details").": ".$row[EVENT_DETAILS];
if ($row[EVENT_DETAILPAGE] != "") {
echo "<a href=\"#\" onclick=\"javscript: window.open('pgm-cal-details.inc.php?id=$row[PRIKEY]','EVENTDETAILS', 'scrollbars=yes,location=no,resizable=yes,width=470,height=400');\">";
if ($row[EVENT_DETAILS] != "") {
echo "[".lang("More Details")."...</a>]\n";
} else {
echo "[ ".lang("Click to View")." ]</a>.\n";
}
}
if ($row[EVENT_DETAILPAGE] == "" && $row[EVENT_DETAILS] == "") {
echo "<FONT COLOR=#999999>".lang("No details available for this event.")."</FONT>\n";
}
echo "</TD></TR></TABLE><BR CLEAR=ALL><BR>";
} // End While Loop
if ($TOTAL_EVENTS_FOR_THIS_DAY == 0) {
echo "<FONT COLOR=#999999>".lang("There are no events scheduled for this day.")."</font>\n";
}
echo "</TD></TR></TABLE><BR>\n"; // End ROW loop
} // End For Each Day of the Week For Statement
} // End Show Weekly
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~ END EACH DISPLAY ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo "</TD></TR></TABLE><BR>\n";
if ($check_results == 0) {
if (eregi("AUTH:", $CHANGE_CAT)) {
$tmp = lang("your personal calendar").".<BR>($OWNER_NAME)";
} else {
$tmp = lang("in category").": \"$CHANGE_CAT\".";
}
echo "<DIV ALIGN=CENTER CLASS=text>".lang("There where no events found for your selection or search")." $tmp</DIV><BR>\n";
}
echo $END_FORM;
} else {
echo "<BR><BR><DIV ALIGN=CENTER CLASS=text>".lang("Please search for an event or select the day or week you wish to view.")."</DIV><BR><BR>\n";
} // End If Request Title Clicked
} // End Detail - Weekly/Daily Display
// If an authorized user is logged in; indicate at the bottom of each calendar screen
// WHO is logged in; and if; personal cal feature is on, display "LOCK KEY"
// -----------------------------------------------------------------------------------
if ($OWNER_NAME != "") {
echo "<DIV ALIGN=CENTER CLASS=smtext><FONT COLOR=#999999>".lang("Authorized user logged in").": $OWNER_NAME</FONT><BR>\n";
if ($DISPLAY[ALLOW_PERSONAL_CALENDARS] == "Y") {
echo "<FONT COLOR=#999999><img src=securelogin.gif alt=\"".lang("This is your private event.")."\" border=0 hspace=2 vspace=2 align=absmiddle> ".lang("Indicates your private event").". ".lang("No one else can view this event but")." $OWNER_NAME.</FONT></div>\n";