? ????? ???? ?? ??? ?? ??? ???????.
①??? ?? ???? ??? <a href='sy1.php?y={$nexty}'>>>< /a>??? sy1.php ??? ??? ?? ??? Calendar.php? ??? ? ????.
②?? ? ?? ?? 2018? 5????. 2018? 6?? ???? ?? ? ??? ???? ?? ???? 2018? 5?? ?? ??? ?????. ?? ??????.
//?? ?? ②
??? ??? ??? ????.
<!DOCTYPE html>
<html>
<style>
???{??:#99ffcc;}
?{ ?? ?? :?? ????;??:#0099ff;}
#tr1{??:#00ccff;}
.td1{??:#009999;}
a{??:#ff9900;}
</ ???>
<head>
<meta charset="UTF-8">
<script src="jquery-2.2.3.js" type="text/javascript"></ script>
</head>
<body>
<?php
require "./Convert.class.php";
$convert=isset($_GET["convert"])? $_GET[" Convert"]:date("Y-m-d");
//php Calendar
//1.date() ??? ?? ??, ?, ?? ?????
$year=isset($_GET[" y"])?$ _GET["y"]:date("Y");
$mon=isset($_GET["m"])?$_GET["m"]:date("m") ;
$day= isset($_GET["d"])?$_GET["d"]:date("d");
$convert=$year.'-'.$mon.'-' .$day;// ?? ?? ??
if($convert!=''){
$c=new Convert($convert);
$time=$c->getLyTime();//Get the lunar time
// echo $convert.'Corresponding lunar time:'.$time;
}
//2. ?? ?? ??? ??? ??? mktime() ?? ??. ?? 1? ??
$daynum=date(" t",mktime(0,0,0,$mon,1,$year));//??? ?? 31
$w=date("w",mktime(0,0,0,$mon, 1,$year));//?? 1? ?? 4
//3. ??? ?? ??
echo"<div>";
echo"<table border='0' >";
echo"<h3><div>{$year}?{ $mon}?{$day}</div></h3>";
echo "<tr id='tr1'onmouseOver='overTr(this)'onmouseOut='outTr(this)'>";
echo "<th style=' color:#ff0000;'onmouseOver='overTr(this)'onmouseOut='outTr(this)'>?</th>";
echo "<th>一</th>";
echo "<?>?</?>";
echo "<?>?</?>";
echo "<?>?</?>";
echo " <?> ;五</th>";
echo "<th style='color:#ff0000;'>Six</th>";
echo "</tr>";
//4 . ?? ?? ??
$dayindex=1;
while($dayindex<=$daynum){
echo"<tr onmouseOver='overTr(this)'onmouseOut='outTr(this)' >" ;
for($i=1;$i<=7;$i++){//7? ??? ???? ??
if($dayindex<=$daynum&&($w<$i||$dayindex ! =1)){
//'2014-10-1'(??? ???? ??)$year-$month-$d
if($dayindex==$day){
echo "< ;th style='??:#ff0000;'><a href='?y={$year}&m={$mon}&d={$dayindex}'>{$dayindex}</a> /th>";
}else{
????????????????? echo "<th onmouseOver='overTh(this)' onmouseOut='outTh(this)'><a href='?y={$year} &m= {$mon}&d={$dayindex}'>{$dayindex}</a></th>";
????????????????????????????????????????????????> ~ ~ $prem<=1){
$prem=12;
$prey--;
}else{
$prem--;
}
if($nextm> ;=12){
$ nextm=1;
$nexty++;
}else{
$nextm++;
}
$prey=$year-1;//????
$nexty= $year+1;//??
//Hyperlink
echo "<tr onmouseOver='overTr(this)'onmouseOut='outTr(this)'><td colspan='7'align ='center'>";
echo "<a href='calendar.php?y={$prey}&m={$mon}&d={$day}'><<</ a> ";
echo "<font face='official script'color='#663399'>{$year}年</font> ";
echo "<a href='calendar.php?y={$nexty}&m={$ ?}&d={$day}'>>></a>
echo" ";
echo"<a href='calendar.php?y={$year}&m={$prem}&d={$day}'><</a> ";
echo "<fontface='隸書'color='#663399'>{$mon}?</font> ";
echo "<a href='calendar.php?y={$year }&m={$nextm}&d={$day}'>></a>";
echo "</td></tr>";
echo "<tr onmouseOver= 'overTr(this)'onmouseOut='outTr(this)'><td colspan='7'>";
echo "<div>$convert 對應的農(nóng)歷時間:$time</div>" ;
echo "</td></tr>";
echo "</table>";
echo "</div>";
?>
<script>
var oriCol=null;
function ?overTr(obj){
oriCol=obj.bgColor;
obj.bgColor='#0f0';
}
function outTr(obj){
obj.bgColor =oriCol;
}
function overTh(obj) {
? ? oriCol=obj.bgColor;
? ? obj.bgColor='red';
}
function outTh(obj){
? ? obj.bgColor=oriCol ;
}
</script>
</body>
</html>