Diff for phpPlatonLib/Date_Week_Magic/docs/example.php between version 1.1 and 1.2
| version 1.1, 2002/03/30 23:49:02 |
version 1.2, 2002/05/29 19:40:06 |
|
|
| |
<?php // $Id$ |
| |
|
| |
if (! isset($day)) |
| |
$day = 1; |
| |
if (! isset($month)) |
| |
$month = 6; |
| |
if (! isset($year)) |
| |
$year = 1981; |
| |
if (! isset($week)) |
| |
$week = 50; |
| |
?> |
| |
<html> |
| |
<head> |
| |
<title>Date_Week_Magic testing page</title> |
| |
</head> |
| |
<body> |
| |
<h1>Date_Week_Magic testing page</h1> |
| |
<form> |
| |
<table border=0 cellspacing=0 cellpadding=0> |
| |
<tr> |
| |
<td>Day</td> |
| |
<td>Month</td> |
| |
<td>Year</td> |
| |
<td>Week</td> |
| |
</tr> |
| |
<tr> |
| |
<td><input type=text value="<?php echo $day; ?>" name=day maxlength=4></td> |
| |
<td><input type=text value="<?php echo $month; ?>" name=month maxlength=4></td> |
| |
<td><input type=text value="<?php echo $year; ?>" name=year maxlength=4></td> |
| |
<td><input type=text value="<?php echo $week; ?>" name=week maxlength=4></td> |
| |
</tr> |
| |
<tr> |
| |
<td colspan=4><input type=submit></td> |
| |
</tr> |
| |
</table> |
| |
</form> |
| |
<p> |
| <?php |
<?php |
| // $Id$ |
|
| |
|
| require_once 'Date/Week_Magic.php'; |
require_once 'Date/Week_Magic.php'; |
| |
|
| // First example |
$ar = Date_Week_Magic::week($year, $month, $day); |
| $day = 1; |
|
| $month = 6; |
echo "Date $day/$month/$year "; |
| $year = 1981; |
echo ($ar == false |
| $ar = Date_Week_Magic::week($year, $month, $day); |
? "is invalid" |
| |
: " was day $ar[weekday] in week $ar[week]."); |
| echo "Date $day/$month/$year was day $ar[weekday] in week $ar[week]."; |
|
| echo "<p>"; |
?> |
| |
<p> |
| // Second example |
<?php |
| $week = 50; |
|
| $year = 1998; |
$ar = Date_Week_Magic::monday($year, $week); |
| $ar = Date_Week_Magic::monday($year, $week); |
|
| |
|
| echo "Monday of week $week in year $year was $ar[day]/$ar[month]."; |
echo "Monday of week $week in year $year was $ar[day]/$ar[month]."; |
| |
|
| ?> |
?> |
| |
|
| |
</body> |
| |
|
Platon Group <platon@platon.org> http://platon.org/
|
|