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

一個(gè)PHP日歷程序

<?php 
//<-------處理通過GET方法提交的變量;開始--------> 
if($HTTP_GET_VARS[year]=="") 

    $HTTP_GET_VARS[year]=date("Y"); 

if($HTTP_GET_VARS[month]=="") 

    $HTTP_GET_VARS[month]=date("n"); 

$month=$HTTP_GET_VARS[month]; 
$year=$HTTP_GET_VARS[year]; 
//<-------處理通過GET方法提交的變量;結(jié)束--------> 
if($year<1971) 

    echo "出錯(cuò)!"; 
    echo "<BR>"; 
    echo "<a href=$HTTP_SERVER_VARS[php_SELF]>Back</a>"; 
    exit(); 

?> 
<table width="200" border="1" cellspacing="0" cellpadding="0" bordercolor="#E7E7E7" style="font-size:12px;" align="center"> 
<tr align="center"><td colspan="2"> 
<?php  
//<-------當(dāng)月份超出1至12時(shí)的處理;開始-------> 
if($month<1) 

    $month=12; 
    $year-=1; 

if($month>12) 

    $month=1; 
    $year+=1; 

//<-------當(dāng)月份超出1至12時(shí)的處理;結(jié)束-------> 
//*************************************** 
//<---------上一年,下一年,上月,下月的連接處理及輸出;開始---------> 
echo "<a href=$HTTP_SERVER_VARS[php_SELF]?year=".($year-1)."&month=".$month."><<</a>年<a href=$HTTP_SERVER_VARS[php_SELF]?year=".($year+1)."&month=".$month.">>></a>"; 
?> 
</td><td colspan="3"><?php echo $year."年".$month."月";?> 
</td><td colspan="2"> 
<?php  
echo "<a href=$HTTP_SERVER_VARS[php_SELF]?month=".($month-1)."&year=".$year."><<</a>月<a href=$HTTP_SERVER_VARS[php_SELF]?month=".($month+1)."&year=".$year.">>></a>"; 
//<--------上一年,下一年,上月,下月的連接處理及輸出;結(jié)束---------> 
   ?></td></tr> 
 <tr align=center><td><font color="red">日</font></td><td>一</td><td>二</td><td>三</td><td>四</td><td>五</td><td>六</td></tr><tr> 
<?php 
$d=date("d"); 
$FirstDay=date("w",mktime(0,0,0,$month,1,$year));//取得任何一個(gè)月的一號(hào)是星期幾,用于計(jì)算一號(hào)是由表格的第幾格開始 
$bgtoday=date("d"); 
function font_color($month,$today,$year)//用于計(jì)算星期天的字體顏色 

    $sunday=date("w",mktime(0,0,0,$month,$today,$year)); 
    if($sunday=="0") 
    { 
        $FontColor="red"; 
    } 
    else 
    { 
        $FontColor="black"; 
    } 
    return $FontColor; 

function bgcolor($month,$bgtoday,$today_i,$year)//用于計(jì)算當(dāng)日的背景顏色 

    $show_today=date("d",mktime(0,0,0,$month,$today_i,$year)); 
    $sys_today=date("d",mktime(0,0,0,$month,$bgtoday,$year)); 
    if($show_today==$sys_today) 
    { 
        $bgcolor="bgcolor=#6699FF"; 
    } 
    else 
    { 
        $bgcolor=""; 
    } 
    return $bgcolor; 

function font_style($month,$today,$year)//用于計(jì)算星期天的字體風(fēng)格 

    $sunday=date("w",mktime(0,0,0,$month,$today,$year)); 
    if($sunday=="0") 
    { 
        $FontStyle="<strong>"; 
    } 
    else 
    { 
        $FontStyle=""; 
    } 
    return $FontStyle; 

for($i=0;$i<=$FirstDay;$i++)//此for用于輸出某個(gè)月的一號(hào)位置 

    for($i;$i<$FirstDay;$i++) 
    { 
        echo "<td align=center> </td>/n"; 
    } 
    if($i==$FirstDay) 
    { 
        echo "<td align=center ".bgcolor($month,$bgtoday,1,$year)."><font color=".font_color($month,1,$year).">".font_style($month,1,$year)."1</font></td>/n"; 
        if($FirstDay==6)//判斷1號(hào)是否星期六 
        { 
            echo "</tr>"; 
        } 
    } 

$countMonth=date("t",mktime(0,0,0,$month,1,$year));//某月的總天數(shù) 
for($i=2;$i<=$countMonth;$i++)//輸出由1號(hào)定位,隨后2號(hào)直至月尾的所有號(hào)數(shù) 

    echo "<td align=center ".bgcolor($month,$bgtoday,$i,$year)."><font color=".font_color($month,$i,$year).">".font_style($month,$i,$year)."$i</font></td>/n"; 
    if(date("w",mktime(0,0,0,$month,$i,$year))==6)//判斷該日是否星期六 
    { 
    echo "</tr>/n"; 
    } 

?> 
</table>

php技術(shù)一個(gè)PHP日歷程序,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 久久伊人久久 | 久久国产露脸老熟女熟69 | md2.pud 麻豆传媒官网 | 北条麻妃快播 | 99久久无码一区人妻A片蜜 | 琪琪婷婷五月色综合久久 | 被同桌摸出水来了好爽的视频 | 动漫美女禁区图 | 午夜DV内射一区区 | 成人在线观看视频免费 | 日韩欧美群交P内射捆绑 | 性欧美xxxxporn| 8090碰成年女人免费碰碰尤物 | 两个女人互添下身高潮自视频 | 精品久久久久久无码人妻国产馆 | 国内精品免费视频精选在线观看 | 成年人视频免费在线观看 | 亚洲AV色香蕉一区二区9255 | 午夜一区二区三区 | 精品国产精品人妻久久无码五月天 | 色婷婷国产精品视频一区二区 | 佐山爱痴汉theav | 麻豆国产96在线日韩麻豆 | 亚洲欧洲自拍偷拍 | 国内精品久久久久久西瓜色吧 | 97人人添人人澡人人澡人人澡 | 久久人人爽人人片AV人成 | 麻花豆传媒剧国产免费mv观看 | 西施打开双腿下面好紧 | 无码AV熟妇素人内射V在线 | 国产精品自在在线午夜精品 | 果冻传媒在线播放 | 亚洲三区视频 | 岳扒开让我添 | 高清无码中文字幕在线观看视频 | 成 人 片 免费播放 成 人 免费 黄 色 网站无毒下载 | 嫩草亚洲国产精品 | 蜜臀AV久久国产午夜福利软件 | 午夜勾魂曲 | 柠檬福利精品视频导航 | 暖暖免费观看日本在线视频 |