<?php
function getCalendar($year,$month){
global $current_user;
$first_day = get_option(‘start_of_week’);
$first_of_month = gmmktime(0,0,0,$month,1,$year);
$per_line = 7;
$total_days = date(‘t’,strtotime(“$year-$month”));
//echo “$year-$month-2″;
//$first_day = date(‘N’,strtotime(“$year-$month-1″))
$line = 1;
for($i=1;$i<=$total_days;$i++){
$day = date(‘w’,strtotime(“$year-$month-$i”));
$array_data[$line][$day] = $i;
if($day==6){
$line++;
}
}
return $array_data;
}
$iid = $_REQUEST['iid'];
$did = “d_vfcalendar”;
$year= ($_REQUEST['year']==”")?date(“Y”,strtotime(“now”)):$_REQUEST['year'];
$month = ($_REQUEST['month']==”")?date(“n”,strtotime(“now”)):$_REQUEST['month'];
$calendar = getCalendar($year,$month);
$prev_month = date(“n”,strtotime(“$year-$month -1 month”));
$next_month = date(“n”,strtotime(“$year-$month +1 month”));
$prev_year = date(“Y”,strtotime(“$year-$month -1 month”));
$next_year = date(“Y”,strtotime(“$year-$month +1 month”));
$prev_month_name = date(“M”,strtotime(“$year-$month -1 month”));
$next_month_name = date(“M”,strtotime(“$year-$month +1 month”));
?>
