if(isset($prm) and $prm > 0){
$m=$prm+$chm;}else{
$m= date("m");}
$d= date("d"); // Finds today's date
$y= date("Y"); // Finds today's year
$no_of_days = date('t',mktime(0,0,0,$m,1,$y)); // This is to calculate number of days in a month
$mn=date('M',mktime(0,0,0,$m,1,$y)); // Month is calculated to display at the top of the calendar
$yn=date('Y',mktime(0,0,0,$m,1,$y)); // Year is calculated to display at the top of the calendar
$j= date('w',mktime(0,0,0,$m,1,$y)); // This will calculate the week day of the first day of the month
for($k=1; $k<=$j; $k++){ // Adjustment of date starting
$adj .="
| ";
}
/// Starting of top line showing name of the days of the week
echo "
";
echo " < | $mn $yn | > | ";
echo "Sun | Mon | Tue | Wed | Thu | Fri | Sat | ";
////// End of the top line showing name of the days of the week//////////
//////// Starting of the days//////////
for($i=1;$i<=$no_of_days;$i++){
echo $adj."$i "; // This will display the date inside the calendar cell
echo " | ";
$adj='';
$j ++;
if($j==7){echo " ";
$j=0;}
}
echo " Calendar | ";
echo "
|
";
echo "Reset PHP Calendar";
?>