Calendar effects include: calendarclassphptestphptable {border: 1pxsolid050;} fontb {color: white; background: blue;} th {width: 30px;} td, th {height: 30px; text-align: cente
Calendar effects include:
Calendar. class. php
Year = isset ($ _ GET ["year"])? $ _ GET ["year"]: date ("Y"); $ this-> month = isset ($ _ GET ["month"])? $ _ GET ["month"]: date ("m"); $ this-> start_weekday = date ("w", mktime (0, 0, 0, $ this-> month, 1, $ this-> year); $ this-> days = date ("t", mktime (0, 0, 0, $ this-> month, 1, $ this-> year);} function out () {echo'
'; $ This-> chageDate ("test. php"); $ this-> weeksList (); $ this-> daysList (); echo'
';} Private function weeksList () {$ week = array ('day', 'yi', '2', '3', '4', '5 ', '6'); echo''; For ($ I = 0; $ I
'. $ Week [$ I].''; Echo'';} Private function daysList () {echo''; // Output space (to be blank before the first day of October 10, January) for ($ j = 0; $ j <$ this-> start_weekday; $ j ++) echo' '; For ($ k = 1; $ k <= $ this-> days; $ k ++) {$ j ++; if ($ k = date ('D') echo''. $ K .''; Elseecho''. $ K .''; If ($ j % 7 = 0) echo'';} // The following spaces while ($ j % 7! = 0) {echo' '; $ J ++;} echo'';} Private function prevYear ($ year, $ month) {$ year = $ year-1; if ($ year <1970) $ year = 1970; return "year = {$ year} & month = {$ month}";} private function prevMonth ($ year, $ month) {if ($ month = 1) {$ year = $ year-1; if ($ year <1970) $ year = 1970; $ month = 12;} else {$ month --;} return "year = {$ year} & month = {$ month}";} private function nextYear ($ year, $ month) {$ year = $ year + 1; if ($ year> 2038) $ year = 2038; return "year = {$ year} & month = {$ month}";} private function nextMonth ($ year, $ month) {if ($ month = 12) {$ year ++; if ($ year> 2100) $ year = 2100; $ month = 1 ;} else {$ month ++;} return "year = {$ year} & month = {$ month}";} private function chageDate ($ url = "") {echo''; Echo'PrevYear ($ this-> year, $ this-> month). '">'. '<'.''; Echo'PrevMonth ($ this-> year, $ this-> month). '">'. '<'.''; Echo''; Echo ''; echo''; Echo'NextYear ($ this-> year, $ this-> month). '">'. '> '.''; Echo'NextMonth ($ this-> year, $ this-> month). '">'. '> '.''; Echo'';}}?>
Test. php
out();?>