I have some notes and tutorials on setting GeoServer up and building web mapping apps at http://ian01.geog.psu.edu. 

Looking for advanced GeoServer tutorials
i want to create a traffic lights system that will tell me how many days are left to go until a document reaches its expiration date.
I want it to be marked by colors in my html.


green: if the document has 31 days or more to go until it expires.
amber: 30 days or less until it expires.
red: for 7 days or less.


I also want to display a text, telling me how many days until expiration.
The expiration date comes from my database in the field called insurance_date

Heres my code i am new to php so struggling to put my code together, if someone could show me how to restructure my code in order to achieve what im trying to do id be greatful, thanks.

my code:

 &lt;?php 

   include 'config.php';
   $data = mysql_query("SELECT * FROM supplier_stats") 
   or die(mysql_error()); 

   while($info = mysql_fetch_array( $data )) 
   { 
     echo "&lt;p&gt;Insurance Expires ! - &lt;font color=\"red\"&gt;".$info['insurance_date'] . "&lt;/font&gt;&lt;/p&gt;"; 

   } 

   $date_diff = 60*60*24*7; // 7 days
   // time()+$date_diff will be a timestamp 7 days in the future
   if ($info['insurance_date'] &lt; time()+$date_diff) {
    echo "less than 7 days left!";
   }

