PHP Perfect Date Calendar Generation class we wrote a date calendar generated in PHP to generate a class program OH.
PHP Tutorial Perfect Date Calendar Generation class
We wrote a date calendar generated using PHP to generate the class program OH.
Example
Include_once '/class/calendar.class.php ';
$simple _example = new Calendar ();
Print ($simple _example->output_calendar ());
*/
Class calendar{
var $date;
var $year;
var $month;
var $day;
var $week _start_on = false;
var $week _start = 7;//Sunday
var $link _days = true;
var $link _to;
var $formatted _link_to;
var $mark _today = true;
var $today _date_class = ' Today ';
var $mark _selected = true;
var $selected _date_class = ' selected ';
var $mark _passed = true;
var $passed _date_class = ' passed ';
var $highlighted _dates;
var $default _highlighted_class = ' highlighted ';
/* Constructor */
function calendar ($date = null, $year = NULL, $month = null) {
$self = Htmlspecialchars ($_server[' php_self ');
$this->link_to = $self;
if (Is_null ($year) | | is_null ($month)) {
if (!is_null ($date)) {
--------Strtotime the submitted date to ensure correct format
$this->date = Date ("y-m-d", Strtotime ($date));
} else {
--------------------------no date submitted, use today ' s date
$this->date = Date ("y-m-d");
}
$this->set_date_parts_from_date ($this->date);
} else {
$this->year = $year;
$this->month = Str_pad ($month, 2, ' 0 ', str_pad_left);
}
}
function Set_date_parts_from_date ($date) {
$this->year = Date ("Y", Strtotime ($date));
$this->month = Date ("M", Strtotime ($date));
$this->day = Date ("D", Strtotime ($date));
}
1 2 3 4
http://www.bkjia.com/PHPjc/444876.html www.bkjia.com true http://www.bkjia.com/PHPjc/444876.html techarticle PHP Perfect Date calendar Generation class we wrote a date calendar generated in PHP to generate a class program OH. PHP Tutorial Perfect Date Calendar Generation class We wrote a date that was generated in PHP ...