<?php ob_start();
 session_start();
include($_SERVER['DOCUMENT_ROOT'].'/includes/connection.php');
$year=$_REQUEST['year'];
$month=$_REQUEST['month'];
$monthname=strtoupper(date("F",strtotime($year."-".$month."-01")));

?>
 <h2 title="Moon Phases" style="text-align:center; color:#CC9900;"><?php echo $monthname."&nbsp;".$year?></h2>

   <div class="rTable"> 
		    <div class="rTableRow">
				<div class="rTableCell"  style="text-align:center; font-size:large;">Moon phase</div>
	        <div class="rTableCell"  style="text-align:center; font-size:large;">Date</div>
	        <div class="rTableCell"  style="text-align:center; font-size:large;">Time</div>
				</div>
<?php

$catquery=mysql_query("select * from moonphases where year(moondate)=".$year." and month(moondate)=".$month."  order by moondate asc");
 
 	while($noticia = mysql_fetch_array($catquery))
 	{ 
	
	 $moonyear=date('Y',strtotime($noticia['moondate']));
	 $moonmonth=date('F',strtotime($noticia['moondate']));
	 $moonday=date('j',strtotime($noticia['moondate']));
	?> 		 
				
				 <div class="rTableRow">
	        <div class="rTableCell"  style="text-align:center; font-size:large;"><b><?php echo $noticia['moonphase']?></b></div>
	        <div class="rTableCell"  style="text-align:center; font-size:large;"><b><?php echo $moonmonth."&nbsp;".$moonday.",&nbsp;".$moonyear?></b></div>
	        <div class="rTableCell"  style="text-align:center; font-size:large;"><b><?php echo $noticia['phasetime'];?></b></div>
          </div>
	       
		 <?php
		 }
		 mysql_close($link);
?>
		   
		   </div>