PrintHeader("MiniCal"); if (isset($_GET['f']) ) { $f = $_GET['f']; } if (isset($_GET['d']) ) { $d = $_GET['d']; } if (isset($_GET['m']) ) { $m = $_GET['m']; } if (isset($_GET['y']) ) { $y = $_GET['y']; } if (isset($_GET['n']) ) { $n = $_GET['n']; } if ( $d == -1 ) { $d = Date("d"); } if ( $m == -1 ) { $m = Date("n"); } if ( $y == -1 ) { $y = Date("Y"); } echo "\n"; echo ""; echo "\n"; $yoff = Date("Y") + 10; echo "\n"; echo "\n"; echo "\n"; echo "
"; echo "\n"; echo "\n"; echo "\n"; $nm = $m + 1; $ny = $y; if ( $nm == 13 ) { $nm = 1; $ny = $y + 1; } $lm = $m - 1; $ly = $y; if ( $lm == 0 ) { $lm = 12; $ly = $y -1; } $m_name = $current_module_strings['cal_month_long'][$m]; if($currentModule == 'Home') { $path_name = "index.php?module=Home&action=index"; } else { $path_name = "index.php?module=Calendar&action=calendar_day"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
". $m_name ." ". $y ."
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; $WeekDayName=array('LBL_SM_SUN','LBL_SM_MON','LBL_SM_TUE','LBL_SM_WED','LBL_SM_THU','LBL_SM_FRI','LBL_SM_SAT'); for ( $i = $current_user->weekstart;$i<=6;$i++ ) { echo "\n"; } for ( $i = 0;$i<$current_user->weekstart;$i++ ) { echo "\n"; } echo "\n"; $ts = mktime(12,0,0,$m,1,$y); $today=Date("Ymd",time()); /* Back to last weekstart before ts */ while ( Date("w",$ts) != $current_user->weekstart ) { $ts -= 86400; } $go = 1; $a = 0; $w = 0; while ( $go == 1 ) { $wd = Date("w",$ts); $xd = Date("j",$ts); $xxd = Date("d",$ts); $xm = Date("n",$ts); $xy = Date("Y",$ts); if ( $wd == $l->user->weekstart ) { # new week echo "\n"; $w0 = (( 1 + Date("w",mktime(12,0,0,1,1, Date("Y",$ts) ) )) % 7) > 3; $wn = sprintf("%02d", Round( (Date("z",$ts)+7 ) / 7) ); echo " \n"; } $col = ""; if ( $today == Date("Ymd",$ts) ) { $col = "today"; } else if ($wd == 0 ) { $col = "holiday"; } else if ($wd == 6 ) { $col = "freeday"; } else if ($xm != $m ) { $col = "otherday"; } else { $col = "appday"; } //For displaying the class - included by Jaguar if($xm !=$m) { echo "\n"; if ( $wd == ($l->user->weekstart+6)%7 ) { # end week echo "\n"; if ( ($xm > $m) || ($xy > $y) ) { break; } } $a++; $w++; $ts += 86400; } if ( $n == 1 ) { echo ""; } echo "
". $current_module_strings['LBL_WEEK'] ."". $current_module_strings[$WeekDayName[$i]] ."". $current_module_strings[$WeekDayName[$i]] ."
". $wn ." \n"; } else { $tdavl="". $xxd .""; // added by raj /* Select appointments for this day */ $from = new DateTime(); $to = new DateTime(); $from->setDateTimeTS($ts - 12 * 3600); $to->setDateTimeTS($ts - 12 * 3600); #$to->addDays(7); $pref->callist = array(); $app = new appointment(); $app->readCal($pref,$from,$to); // appointment::readCal($pref,$from,$to); $dd = new DateTime(); # $d = strftime($lang['DateFormatStr'],$ts); $dd->setDateTimeTS($ts); $d = $dd->getDate(); $tref = Date("Ymd",$ts); $eventclass=$col; if(count($pref->callist)!=0) { //Classes are provided when events are created - Jaguar if($col == "today") $eventclass="todayevent"; else $eventclass="eventbold"; } $tdavl.=$eventclass."\">\n"; echo $tdavl; //displaying the td - Jaguar //Display Date with link, move here from above to get tref date format if ($col=="today") { echo "". $xxd .""; } else { echo "". $xxd ."" ; } // $next = NextDay($ts); # Check for workday if ( ! $dd->isWorkDay($pref) ) { $ts = $next; $day++; continue; } $dinfo = GetDaysInfo($ts); $hastable = 0; $a = 0; // } else { echo " "; } #echo " ". $xxd .""; echo "
NONE
\n"; echo "
\n"; # selection of none allowed echo "
\n"; echo "\n"; echo "\n"; ?>