if(!emptyempty($_GET)){
$year = isset($_GET['year'])?$_GET['year']:date('y');
$month = isset($_GET['month'])?$_GET['month']:date('m');
$day = isset($_GET['day'])?$_GET['day']:date('d');
}
if(emptyempty($year)){
$year = date('Y');
}
if(emptyempty($month)){
$month = date('m');
}
if(emptyempty($month)){
$days = date('d');
}
$start_weekday = date('w',mktime(0,0,0,$month,1,$year));
//echo $start_weekday;
$days = date('t',mktime(0,0,0,$month,1,$year));
//echo $days;
$week = array('日','一','二','三','四','五','六');
$i = 0;
$k = 1;
$j = 0;
echo '
';
echo ''.$year.'年'.$month.'月'.' |
';
echo '';
for($i = 0;$i
echo ''.$week[$i].' | ';
}
echo '
';
echo '';
for($j = 0;$j
echo ''.$j.' | ';
}
while($k
if($k == $day){
echo ''.$k.' | ';
}else{
echo ''.$k.' | ';
}
if(($j+1) % 7 == 0){
echo '
';
}
$j++;
$k++;
}
while($j % 7 != 0){
echo ''.$j.' | ';
$j++;
}
echo '
';
echo '';
echo "".' | ';
echo "".' | ';
echo '';
echo '';
echo ' | ';
echo "".'>>'.' | ';
echo "".'>'.' | ';
echo '
';
echo '
';
function lastYear($year,$month){
$year = $year-1;
return "year=$year&month=$month";
}
function lastMonth($year,$month){
if($month == 1){
$year = $year -1;
$month = 12;
}else{
$month--;
}
return "year=$year&month=$month";
}
function nextYear($year,$month){
$year = $year+1;
return "year=$year&month=$month";
}
function nextMonth($year,$month){
if($month == 12){
$year = $year +1;
$month = 1;
}else {
$month++;
}
return "year=$year&month=$month";
}
?>