topical media & game development
basic-web-php-PHP-Example01.php / php
<?php
// Set up the variables (today, month, year, cmd)
// today = m/d/y
function setvars() {
// Default is today
month = year = today = today['mday']."/".today,
"month" => year);
} // End setvars()
// Do the document header
function docheader(year) {
month."/1/".Month month_text today,day,curday = day."/".curday == font = " style=\"color: red;\"";
} else {
font>cmd) {
switch (vars = setvars();
vars['today'];
vars['month'];
vars['year'];
// Do the header and open first row
docheader(year);
weekrow("open");
// Set up first weekday and 1st day (m/1/y)
month."/1/".day = 1;
// Print empty days up to the first weekday of month
for (weekday < weekday++) {
emptyday();
}
// Do rest of month while we have a valid date
while (checkdate(day,weekday == 1) {
weekrow("open");
}
// Print day and increment
day(month,year);
day++;
// If SAT, close row reset weekday
if (weekday = 1;
}
}
// Close current week
while (weekday <= 7) {
emptyday();
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.