"; echo ""; echo "  "; if (($year > $calstartyear) || (($month > 1)&&($year == $calstartyear))) { echo "".$calfontback.$maand[$pm]."   ".$py.$closefont.""; $pdate = date("Y-m-d",mktime(0,0,0,$month-1,1,$year)) ; echo "   " ; echo "".translate("Popup Month")."" ; } else echo " " ; echo ""; echo ""; echo $calfontasked.$askedmonth.$closefont." " ; echo "   " ; echo $calfontasked.$askedyear.$closefont."\n"; echo "" ; $calendyear = $y + $caladvanceyear ; if ($ny <= $calendyear) { $ndate = date("Y-m-d",mktime(0,0,0,$month+1,1,$year)) ; echo "   " ; echo "".translate("Popup Month")."   " ; echo "".$calfontnext.$maand[$nm]."   ".$ny.$closefont."" ; echo "  "; } else echo " " ; echo "\n\n"; echo ""; echo ""; // make the header days of week for ($i=intval($weekstartday)+1;$i<=(intval($weekstartday) + 7);$i++){ echo "\n"; // sunday else echo "bgcolor=$weekdaytopclr>".$dayfont.$week[dayinweek($i)].$closefont."\n"; // rest of week } echo "\n\n\n"; // begin the days // print initial blank squares for ($i=1;$i<=blankdays(intval($weekstartday),$firstday);$i++){ echo ""; } $a=0; for ($i=1;$i<=$nr;$i++){ echo "
".$dayfont.$week[dayinweek($i)].$closefont."
 " ; echo "
" ; echo "" ; if ($viewdayok=='1') echo "" ; echo $datenumfont.$i.$closefont ; if ($viewdayok=='1') echo "" ; echo "   " ; if (date("w",mktime(0,0,0,$month,$i,$year))==$weekstartday) { if ($viewweekok=='1') echo "".translate("View week")." ".weekNumber($i,$month,$year)." " ; } if ((($publicview==1)&&($uname!=""))||($publicview==0)) { if ($addeventok == 1){ echo "".translate("Add Event")."" ; } } echo "
" ; // now get eventual events on $i $query = "select id,user,title,starttime,endtime from ".$EVENTS_TB." left join ".$CAT_TB." on ".$EVENTS_TB.".cat=".$CAT_TB.".cat_id where day='$i' and month='$month' and year='$year' and approved='1' " ; if ($catview!=0) $query = $query." and ".$EVENTS_TB.".cat=$catview " ; if (($userview=='1')&&($userlogin==1)) { // user view user specific events only if ($ugroup!=0) { $query = $query." and ".$EVENTS_TB.".user='".$uname."' "; } } $query = $query." order by day,month,year,starttime,title ASC"; $result = mysql_query($query); $devtcnt = mysql_num_rows($result) ; if (($limitmthevt!=0)&&($devtcnt!=0)&&($devtcnt>=$limitmthevt)) { echo $caleventfont."       " ; if ($viewdayok=='1') echo "" ; echo $devtcnt." ".translate("events") ; if ($viewdayok=='1') echo "" ; echo "     ".$closefont ; } else if ($devtcnt!=0) { echo "\n" ; while ($row = mysql_fetch_object($result)){ echo "" ; echo "" ; if ($showeventborder=='1') echo "
\n" ; if (($showeventborder=='1')||($showeventtimeborder=='1')) echo "" ; if (($showeventtimeborder=='1')&&($showeventborder=='0')) echo "
" ; echo $caleventfont ; if ($row->starttime=='') echo " - " ; else { if ($time12hour=='1') echo show12hour($row->starttime) ; else echo $row->starttime ; if ($row->endtime!='') { echo "
" ; if ($time12hour=='1') echo show12hour($row->endtime) ; else echo $row->endtime ; } } echo $closefont."
".$caleventfont ; if (($showuserentry==1)&&($uname!="")) echo "<".$row->user."> " ; if ($popupevent == 1) echo $caleventfont."id."&uname=$uname','Calendar','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=".$popupeventwidth.",height=".$popupeventheight."')\">"; else echo "id.">"; echo stripslashes($row->title)."".$closefont ; echo "
" ; } echo "
\n" ; } echo ""; $a++; if (blankdays(intval($weekstartday),date("w",mktime(0,0,0,$month,$i,$year))) == 6) { echo "\n\n"; $a = 0; } } // ending stuff (making 'white' td's to fill table if ($a != 0){ $last = 7-$a; for ($i=1;$i<=$last;$i++) echo " "; } echo ""; echo ""; echo ""; echo "" ; echo "" ; // display search echo ""; echo "
" ; echo "
".$datenumfont.translate("Today").$closefont."
\n
"; echo "
\n"; echo $menufont."".translate("Go to").": ".$closefont ; // get months echo "  \n"; // get year from "calstartyear" and give "caladvanceyear" years more to select echo "
\n"; echo "
" ; echo "
" ; if (($allowsearch)&&($searchmonthok == '1')) { search(); } else echo " " ; echo "
"; } else { echo "

".$titlefont.translate("disabled").$closefont.".

" ; } } switch ($op){ // view cal per month case "cal":{ if (!$month) $month = $m ; if (!$year) $year = $y ; cal($month,$year,$monthborder,$calcells,$calcellp,$tablewidth,$trtopcolor,$calfontback,$calfontasked,$calfontnext,$sundaytopclr,$weekdaytopclr,$sundayemptyclr,$weekdayemptyclr,$todayclr,$sundayclr,$weekdayclr); break; } // default: default:{ if ($caldefault == '0') echo ""; if ($caldefault == '1') echo ""; if ($caldefault == '2'){ if (!$month) $month = $m; if (!$year) $year = $y; cal($month,$year,$monthborder,$calcells,$calcellp,$tablewidth,$trtopcolor,$calfontback,$calfontasked,$calfontnext,$sundaytopclr,$weekdaytopclr,$sundayemptyclr,$weekdayemptyclr,$todayclr,$sundayclr,$weekdayclr); } break; } } include ('cal_functions.inc.php'); include ('cal_footer.inc.php'); ?>