Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of NaiFPHP  >  Get Futurist Date  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example for Get a Futurist Date Class
Class: Get Futurist Date
Calculate a date adding a number of days to today
Author: By
Last change:
Date: 2006-08-22 02:26
Size: 1,958 bytes
 

Contents

Class file image Download
<?php

/*
//------------------------------------------------------------------------------------------------------------
|| @ Script Desc  : Get a futurist date from today date to your adding date
|| @ Version      : 1.0 beta
|| @ Created      : NAIF PHP
|| @ Web Site     : www.naifphp.net
|| @ Date Created : 22 - 8 - 2006
//--------------------------------------------------------------------------------------------------------------
*/


include_once ("GetFuturistDate.class.php");

if(! isset ( 
$_GET['action'] ) )
{

echo 
"<title> Example : Get Futurist Date Class </title>".
         
"<h2> Please insert the day , month and year to get a futurist date   </h2>".
         
"Note : Leave any column blank if you don't want to add it .".

         
"<form method=\"get\">".
         
"Day(s) : <BR><input type=\"text\" name=\"d\" ><BR>".
         
"Month(s) : <BR><input type=\"text\" name=\"m\"><BR>".
         
"Year(s) : <BR><input type=\"text\" name=\"y\"><BR>".
         
"<input type=\"hidden\" name=\"action\"><BR>".
         
"<input type=\"submit\" value=\"Get Futurist Date\"></form>";


}
else
{

$d $_GET['d'];
$m $_GET['m'];
$y $_GET['y'];

$obj = new GetFuturistDate();

// extracting all information :)
$my_date         $obj->FuturistDate($d$m$y);

$today           $my_date["TODAY"];
$futu_date       $my_date["FUTURISTDATE"];
$date_unix       $my_date["UNIX"];
$balance_day     $my_date["BDAY"];
$balance_month   $my_date["BMONTH"];
$balance_year    $my_date["BYEAR"];


echo  
"ToDay Date is : " $today ." <br> \n".
         
"My Futurist Date After "$d ."day , "$m ." month ,"$y ."year is : ".$futu_date.
         
"\n<br> My Futurist Date UNIX formatting : "$date_unix ." <br>\n".
         
" day's difference : "$balance_day ." , month : "$balance_month ." , year : " $balance_year.

         
"\n <br><br><a href=\"?\"> Try Again </a>";

}

?>