日期:2011-05-04  浏览次数:20554 次


<?php
class Calendar{

/*
  *            日历
  *
  *      @作者:sports98
  *      Email:flyruns@hotmail.com
  *      @版本:V1.0
  */

    var $YEAR,$MONTH,$DAY;
    var $WEEK=array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
    var $_MONTH=array(
            "01"=>"一月",
            "02"=>"二月",
            "03"=>"三月",
            "04"=>"四月",
            "05"=>"五月",
            "06"=>"六月",
            "07"=>"七月",
            "08"=>"八月",
            "09"=>"九月",
            "10"=>"十月",
            "11"=>"十一月",
            "12"=>"十二月"
        );

    //设置年份
    function setYear($year){
        $this->YEAR=$year;
    }
    //获得年份
    function getYear(){
        return $this->YEAR;
    }
    //设置月份
    function setMonth($month){
        $this->MONTH=$month;
    }
    //获得月份
    function getMonth(){
        return $this->MONTH;
    }
    //设置日期
    function setDay($day){
        $this->DAY=$day;
    }
    //获得日期
    function getDay(){
        return $this->DAY;
    }
    //打印日历
    function OUT(){
        $this->_env();
        $week=$this->getWeek($this->YEAR,$this->MONTH,$this->DAY);//获得日期为星期几 (例如今天为2003-07-18,星期五)
        $fweek=$this->getWeek($this->YEAR,$this->MONTH,1);//获得此月第一天为星期几
        echo "<div style=\"margin:0;border:1 solid black;width:300;font:9pt\">
  &n