天天躁日日躁狠狠躁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自動生成月歷代碼,轉載需保留來源!

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

主站蜘蛛池模板: 国产午夜在线精品三级a午夜电影 | 亚欧成人毛片一区二区三区四区 | 久久综久久美利坚合众国 | 国产精品人妻无码免费A片导航 | 91免费精品国自产拍在线可以看 | md2.pud 麻豆传媒官网 | 野花社区视频WWW高清 | 色综合五月激情综合色一区 | 台湾18成人影院 | 亚洲午夜精品一区二区公牛电影院 | 最近中文字幕在线中文高清版 | 97人人超碰国产精品最新蜜芽 | 国产精品免费久久久久影院 | 混乱家庭电影完整版在线看 | 欧美雌雄双性人交xxxx | 国际老妇高清在线观看 | 在线成 人av影院 | 长篇高h肉爽文丝袜 | 中文字幕一区二区视频 | JK白丝校花爽到娇喘视频 | 欧美精品一区二区蜜臀亚洲 | 日本xxx片免费高清在线 | 影音先锋xfplay影院av | 麻豆精品传媒一二三区 | 一色屋精品亚洲香蕉网站 | 大学生第一次破苞疼哭了 | 九九热精品在线观看 | 三级成人电彭 | 久久青草费线频观看国产 | 99热久久视频只有精品6国产 | 果冻传媒在线播放 | 无码免费视频AAAAAA片草莓 | 我半夜摸妺妺的奶C了她软件 | 欧美雌雄双性人交xxxx | 亚洲国产货青视觉盛宴 | 日本无修肉动漫在线观看 | 精品免费久久久久久成人影院 | 无码精品AV久久久奶水 | 中文在线观看永久免费 | 动漫H片在线播放免费高清 动漫AV纯肉无码AV电影网 | 99久久久久亚洲AV无码 |