Source for file 6.php
Documentation is available at 6.php
* Description: A "personal planner" with some WML for fun
* Note this is done the stupid way - a giant if/else for WML or HTML
* could be greatly simplified with some HTML/WML rendering classes...
return ((float) $usec + (float) $sec);
if ( !@include 'Calendar/Calendar.php' ) {
define ('CALENDAR_ROOT','../../');
require_once CALENDAR_ROOT. 'Month/Weekdays.php';
require_once CALENDAR_ROOT. 'Day.php';
if (!isset ($_GET['y'])) $_GET['y'] = date('Y');
if (!isset ($_GET['m'])) $_GET['m'] = date('n');
if (!isset ($_GET['d'])) $_GET['d'] = date('j');
$Day = & new Calendar_Day($_GET['y'],$_GET['m'],$_GET['d']);
$selection = array ($Day);
#-----------------------------------------------------------------------------#
if ( isset ($_GET['mime']) && $_GET['mime']== 'wml' ) {
header ('Content-Type: text/vnd.wap.wml');
echo ( '<?xml version="1.0"?>' );
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<big><strong>Personal Planner Rendered with WML</strong></big>
if ( isset ($_GET['viewday']) ) {
<p><strong>Viewing <?php echo ( date('l, jS of F, Y',$Day->getTimeStamp ()) ); ?></strong></p>
echo ( "?y=". $Day->thisYear (). "&m=".
$Day->thisMonth (). "&d=". $Day->thisDay (). "&mime=wml" );
while ( $Hour = & $Day->fetch () ) {
echo ( "<td>". date('g a',$Hour->getTimeStamp ()). "</td><td>Free time!</td>\n" );
<p><strong> <?php echo ( date('F Y',$Month->getTimeStamp ()) ); ?></strong></p>
<td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td><td>S</td>
$Month->build ($selection);
while ( $Day = $Month->fetch () ) {
} else if ( $Day->isSelected () ) {
echo ( "<td><anchor><strong><u>". $Day->thisDay (). "</u></strong>\n<go href=\"". $_SERVER['PHP_SELF']. "?viewday=true&y=".
$Day->thisYear (). "&m=". $Day->thisMonth (). "&d=". $Day->thisDay ().
"&mime=wml\" />\n</anchor></td>\n" );
echo ( "<td><anchor>". $Day->thisDay (). "\n<go href=\"?viewday=true&y=".
$Day->thisYear (). "&m=". $Day->thisMonth (). "&d=". $Day->thisDay ().
"&mime=wml\" /></anchor></td>\n" );
echo ( "?y=". $Month->thisYear (). "&m=".
$Month->prevMonth (). "&d=". $Month->thisDay (). "&mime=wml" );
<td></td><td></td><td></td><td></td><td></td>
echo ( "?y=". $Month->thisYear (). "&m=".
$Month->nextMonth (). "&d=". $Month->thisDay (). "&mime=wml" );
<p><a href=" <?php echo ( $_SERVER['PHP_SELF'] ); ?>">Back to HTML</a></p>
<?php echo ( '<p>Took: '. (getmicrotime()- $start). ' seconds</p>' ); ?>
#-----------------------------------------------------------------------------#
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<title> HTML (+WML) Personal Planner </title>
<h1>Personal Planner Rendered with HTML</h1>
<p>To view in WML, click <a href=" <?php echo ( $_SERVER['PHP_SELF'] ); ?>?mime=wml">here</a> or place a ?mime=wml at the end of any URL.
Note that <a href="http://www.opera.com/download">Opera</a> supports WML natively and Mozilla / Firefox has the WMLBrowser
plugin: <a href="http://wmlbrowser.mozdev.org">wmlbrowser.mozdev.org</a></p>
if ( isset ($_GET['viewday']) ) {
<p><strong>Viewing <?php echo ( date('l, jS of F, Y',$Day->getTimeStamp ()) ); ?></strong></p>
echo ( "?y=". $Day->thisYear (). "&m=".
$Day->thisMonth (). "&d=". $Day->thisDay ());
?>">Back to Month View</a>
while ( $Hour = & $Day->fetch () ) {
echo ( "<td>". date('g a',$Hour->getTimeStamp ()). "</td><td>Free time!</td>\n" );
<p><strong> <?php echo ( date('F Y',$Month->getTimeStamp ()) ); ?></strong></p>
<td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td><td>S</td>
$Month->build ($selection);
while ( $Day = $Month->fetch () ) {
} else if ( $Day->isSelected () ) {
echo ( "<td><a href=\"". $_SERVER['PHP_SELF']. "?viewday=true&y=".
$Day->thisYear (). "&m=". $Day->thisMonth (). "&d=". $Day->thisDay ().
"&wml\"><strong><u>". $Day->thisDay (). "</u></strong></a></td>\n" );
echo ( "<td><a href=\"". $_SERVER['PHP_SELF']. "?viewday=true&y=".
$Day->thisYear (). "&m=". $Day->thisMonth (). "&d=". $Day->thisDay ().
"\">". $Day->thisDay (). "</a></td>\n" );
echo ( "?y=". $Month->thisYear (). "&m=".
$Month->prevMonth (). "&d=". $Month->thisDay () );
<td></td><td></td><td></td><td></td><td></td>
echo ( "?y=". $Month->thisYear (). "&m=".
$Month->nextMonth (). "&d=". $Month->thisDay () );
<?php echo ( '<p><b>Took: '. (getmicrotime()- $start). ' seconds</b></p>' ); ?>
Documentation generated on Mon, 11 Mar 2019 15:37:47 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|