<?php session_start();  ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>CoolDrivePass : Emissions Calculator</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/JavaScript">
</script>
</head>

<?php

	  $estEmit = $_POST['estimates_sel'];
	  $estKm = $_POST['kmselect'];
	  $yearsNum = $_POST['xyears'];
	  $totalEmit = $estEmit * $estKm;
	  $annualOffsetCost = $totalEmit * 0.02;
	  $totalOffset = $annualOffsetCost * $yearsNum;
	  $averageAnnual = 0.2843 * 20000;
	  
	?>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('/images/buttons/buttons_color_02.gif','/images/buttons/buttons_color_03.gif','/images/buttons/buttons_color_04.gif','/images/buttons/buttons_color_05.gif')">
<p align="center">
</p>
<div align="center">
  
  <table id="Table_02" width="674" border="0" cellpadding="0" cellspacing="0">
    <tr>
    </tr>
    <tr>

      <td align="right" valign="top"><div align="right" class="fixtable" >
        <table width="99%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="64%" align="left" valign="bottom">
			  
				<p><strong>Vehicle Report:</strong></p>
				
 							  
			  </td>
	        </tr>
            <tr valign="bottom">
              <td colspan="3" align="left"><br>
              
		<p>	
		Your annual emissions are: <strong>
		<?php echo number_format($totalEmit, 2, '.', ''); ?>
		 KG</strong> of CO2 per year.
<br>
Your annual offset cost is : <strong>$
<?php echo number_format($annualOffsetCost, 2, '.', ''); ?>
</strong>
<br>
Your total offset costs for <strong>
<?php echo number_format($yearsNum, 0, '.', ''); ?>
</strong> year(s) is: <strong>$
<?php echo number_format($totalOffset, 2, '.', ''); ?>
</strong>
<br>

<form name="my_lv" method="post" action="https://www.paypal.com/cgi-bin/webscr">
	<input type="hidden"  name="cmd" value="_xclick"/>
	<input type="hidden"  name="business" value="offsetters@gmail.com"/>
	<input type="hidden"  name="item_name" value="Cooldrivepass CO2 Offset"/>
	<input type="hidden"  name="currency_code" value="CAD"/>
	<input type="hidden"  name="amount" value="<?php echo number_format($totalOffset, 2, '.', ''); ?>"/>
	<input type="submit" value="Offset Your Emissions Now" >
</form>
	 


  </p>
</td>
            </tr>
          </table>
      </div></td>

    </tr>
    
  </table>
  
</div>
</body>
</html>