include("./MoonPhase.php");
// create an instance of the class, and use the current time
$moon = new MoonPhase();
//$age = round( $moon->age(), 1 );
$age = round( $moon->age(), 0 );
$stage = $moon->phase() < 0.5 ? '' : '';
$distance = round( $moon->distance(), 2 );
$nextnewtime = gmdate( 'G:i:s', $moon->next_new_moon() );
$nextnewdate = gmdate( 'd.m.Y', $moon->next_new_moon() );
$nextfulltime = gmdate( 'G:i:s', $moon->next_full_moon() );
$nextfulldate = gmdate( 'd.m.Y', $moon->next_full_moon() );
$phasename = $moon->phase_name();
sg('MoonT.age',$age);
sg('MoonT.stage',$stage);
sg('MoonT.distance',$distance);
sg('MoonT.nextnewtime',$nextnewtime);
sg('MoonT.nextnewdate',$nextnewdate);
sg('MoonT.nextfulltime',$nextfulltime);
sg('MoonT.nextfulldate',$nextfulldate);
sg('MoonT.phasename',$phasename);
//echo "$age days old,  $stage. ";
//echo " $distance km ";
//echo "new moon $next.";
