天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

PHP自動生成月歷代碼

<?php
/* 
Function Written by Nelson Neoh @3/2004. 
For those who wants to utilize this code, please do not remove this remark. 
If you have done any enhancement to this code, please post the copy at http://www.dev-club.com php board.  Thank you.

Function usage: calendar(Month,Year)
*/

function calendar($MM,$YYYY){
    if($MM=="") $MM = date("m");
    if($YYYY=="") $YYYY = date("Y");
    if(checkdate($MM,1,$YYYY)){
        $stringDate = strftime("%d %b %Y",mktime (0,0,0,$MM,1,$YYYY));
        $days = strftime("%d",mktime (0,0,0,$MM+1,0,$YYYY));
        $firstDay = strftime("%w",mktime (0,0,0,$MM,1,$YYYY));
        $lastDay = strftime("%w",mktime (0,0,0,$MM,$days,$YYYY));
        $printDays = $days;
        $preMonth = strftime("%m",mktime (0,0,0,$MM-1,1,$YYYY));
        $preYear = strftime("%Y",mktime (0,0,0,$MM-1,1,$YYYY));
        $nextMonth = strftime("%m",mktime (0,0,0,$MM+1,1,$YYYY));
        $nextYear = strftime("%Y",mktime (0,0,0,$MM+1,1,$YYYY));
        print("<table border=/"1/" cellpadding=/"1/" cellspacing=/"1/">");
        print("<tr><th valign=/"top/"><a href=/"".$_SERVER['php_SELF']."?NB=".$_GET["NB"]."&MM=".$preMonth."&YY=".$preYear."/">P</a></th>");
        print("<th colspan=/"5/" valign=/"top/">".strftime("%b %Y",mktime (0,0,0,$MM,1,$YYYY))."</th>");
        print("<th valign=/"top/"><a href=/"".$_SERVER['php_SELF']."?NB=".$_GET["NB"]."&MM=".$nextMonth."&YY=".$nextYear."/">N</a></th></tr>");
        print("<tr style=/"font-family: Verdana; font-size:x-small/">");
        print("<th>Sun</th><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th></tr>");

        $currentDays = 1;
        for($a=1;$a<=5;$a++){
            print("<tr align=/"left/" valign=/"top/" style=/"font-family: Verdana; font-size:x-small/">");
            $diffDays = $firstDay-$lastDay;
            if($firstDay>$lastDay && $currentDays ==1 && ($diffDays<>1)){
                for($x=$lastDay;$x>=0;$x--){
                    $printDays = $days-$x;
                    print("<td>$printDays</td>");
                }
                for($z=1;$z<$firstDay-$lastDay;$z++){
                    print("<td> </td>");
                }
                for($y=$firstDay;$y<7;$y++){
                    print("<td>$currentDays</td>");
                    $currentDays++;
                }
            } elseif($firstDay!=0 && $currentDays==1){
                for($z=1;$z<=$firstDay;$z++){
                    print("<td> </td>");
                }
                for($y=$firstDay;$y<7;$y++){
                    print("<td>$currentDays</td>");
                    $currentDays++;
                }
            } else {
                for($u=1;$u<=7 && $currentDays<=$days;$u++){
                    print("<td>$currentDays</td>");
                    $currentDays++;
                }
            }
            print("</tr>");
        }
        print("</table>");
    }
}
?>

 

php技術PHP自動生成月歷代碼,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 女人夜夜春 | 在线观看亚洲免费人成网址 | 中文字幕1 | 男女性杂交内射妇女BBWXZ | 无码人妻精品一区二区蜜桃色欲 | 国产在线aaa片一区二区99 | 兽交白浆喷水高潮 | bl 纯肉 高Hbl被强文 | yy8090韩国理伦片在线 | 午夜福利视频极品国产83 | 亚洲精品中文字幕在线 | 国产精品久久久久久久久LI无码 | 老师小扫货水能么多叫出来 | 九色终合九色综合88 | 久久99精品国产免费观看 | 国产精品综合AV一区二区国产馆 | 久久无码人妻AV精品一区 | 夜夜国产亚洲视频香蕉 | 草草久久久无码国产专区全集观看 | 97色伦图片97色伦图影院久久 | 国产精品热久久高潮AV袁孑怡 | 特黄AAAAAAA片免费视频 | 亚洲精品高清中文字幕完整版 | 擦擦擦在线视频观看 | 亚洲一区二区女搞男 | 成品片a免人看免费 | 乱子伦在线观看中文字幕 | 超碰免费碰免费视频 | 欧美日韩一二区旡码高清在线 | 久久黄色免费网站 | 11 13加污女qq看他下面 | 二色AV天堂在线 | 蜜桃成熟时2在线观看完整版hd | 我年轻漂亮的继坶2中字在线播放 | 日韩1区1区产品乱码芒果榴莲 | 老色哥网站 | 欧美日韩一区在线观看 | 精品区2区3区4区产品乱码9 | 亚洲三区视频 | 97视频久久| 国产毛片女人18水多 |