国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > PHP > 正文

PHP日歷代碼通用函數

2024-05-04 23:05:51
字體:
來源:轉載
供稿:網友
<?php
//calendar.php
//check if the month and year values exist
if ((!$_get['month']) && (!$_get['year'])) {
   $month = date ("n");
   $year = date ("y");
} else {
   $month = $_get['month'];
   $year = $_get['year'];
}
//calculate the viewed month
$timestamp = mktime (0, 0, 0, $month, 1, $year);
$monthname = date("f", $timestamp);
//now let's create the table with the proper month
?>
<table border="1" cellpadding="3" cellspacing="0" bordercolor="#000000">
   <tr>
   <td colspan="7" class="calendartodayoff" onmouseover="this.classname='calendartodayover'" onmouseout="this.classname='calendartodayoff'">
    <span ><?php echo $monthname . " " . $year; ?></span>
   </td>
   </tr>
   <tr>
   <td class="calendartodayoff" onmouseover="this.classname='calendartodayover'" onmouseout="this.classname='calendartodayoff'">
    <span >su</span>
   </td>
   <td class="calendartodayoff" onmouseover="this.classname='calendartodayover'" onmouseout="this.classname='calendartodayoff'">
    <span >m</span>
   </td>
   <td class="calendartodayoff" onmouseover="this.classname='calendartodayover'" onmouseout="this.classname='calendartodayoff'">
    <span >tu</span>
   </td>
   <td class="calendartodayoff" onmouseover="this.classname='calendartodayover'" onmouseout="this.classname='calendartodayoff'">
    <span >w</span>
   </td>
   <td class="calendartodayoff" onmouseover="this.classname='calendartodayover'" onmouseout="this.classname='calendartodayoff'">
    <span >th</span>
   </td>
   <td class="calendartodayoff" onmouseover="this.classname='calendartodayover'" onmouseout="this.classname='calendartodayoff'">
    <span >f</span>
   </td>
   <td class="calendartodayoff" onmouseover="this.classname='calendartodayover'" onmouseout="this.classname='calendartodayoff'">
    <span >sa</span>
   </td>
   </tr>
   <?php   
    $monthstart = date("w", $timestamp);
    $lastday = date("d", mktime (0, 0, 0, $month + 1, 0, $year));
    $startdate = -$monthstart;
   
    //figure out how many rows we need.
    $numrows = ceil (((date("t",mktime (0, 0, 0, $month + 1, 0, $year)) + $monthstart) / 7));
   
    //let's make an appropriate number of rows...
    for ($k = 1; $k <= $numrows; $k++){
     ?><tr><?php
     //use 7 columns (for 7 days)...
     for ($i = 0; $i < 7; $i++){
      $startdate++;
      if (($startdate <= 0) || ($startdate > $lastday)){
       //if we have a blank day in the calendar.
       ?><td >&nbsp;</td><?php
      } else {
               
       if ($startdate == date("j") && $month == date("n") && $year == date("y")){
        ?><td class="calendartodayoff" onmouseover="this.classname='calendartodayover'; checkfortasks ('<?php echo $year . "-" . $month . "-" . $startdate; ?>',event);" onmouseout="this.classname='calendartodayoff'; hidetask();"><?php echo date ("j"); ?></td><?php
       } else {
        ?><td class="calendaroff" onmouseover="this.classname='calendarover'; checkfortasks ('<?php echo $year . "-" . $month . "-" . $startdate; ?>',event);" onmouseout="this.classname='calendaroff'; hidetask();"><?php echo $startdate; ?></td><?php
       }
      }
     }
     ?></tr><?php
    }
   ?>   
</table>
中國最大的web開發資源網站及技術社區,
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 金川县| 台东市| 垦利县| 凌云县| 革吉县| 西乌| 沾益县| 宜昌市| 阳谷县| 乐清市| 金坛市| 留坝县| 铜陵市| 德化县| 禹州市| 太仆寺旗| 台前县| 游戏| 蓬溪县| 崇左市| 镇赉县| 关岭| 金秀| 武陟县| 临安市| 惠来县| 昆明市| 龙泉市| 新乡县| 阜康市| 望都县| 庐江县| 榆社县| 福清市| 中西区| 油尖旺区| 大方县| 乌鲁木齐县| 云浮市| 安岳县| 德格县|