<?php include('car.inc.php'); ?>
<!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" src="jquery-1.2.3.pack.js"></script>
	<script type="text/javascript" src="jquery.rounded.js"></script>
		
	<link rel="stylesheet" type="text/css" href="screen.css" />
</head>

<body>
	<div id="faux">
		<div id="copy">
			<img src="logo.jpg" />
			<h1>Purchase Carbon Offsets</h1>
		</div>
			
		<div id="container">
			<div style="background-image:url('top-corners.jpg'); height:20px; background-repeat:no-repeat;">&nbsp;</div>
			<?php if($error) { ?>
			<p><?php echo $error; ?></p>
			<?php } else { ?>
			<div id="resultsCar">
				<h3>Your vehicle report</h3>
				<p>Your car consumes <strong><?php echo number_format($consumption, 2, '.', ''); ?>	liters</strong> of gas per 100km, which equals <strong><?php echo number_format($totalcons, 2, '.', ''); ?> liters</strong> of gas per year.</p>
				
				<h3>Annual Emissions</h3>
				<p><?php echo number_format($totalemit, 2, '.', ''); ?> KG</strong> of CO2 per year.</p>
				
				<h3>Annual Offset Cost</h3>
				<p>$<?php echo number_format($annualoffset, 2, '.', ''); ?></p>
				
				<h3>Total Offset Costs for <?php echo number_format($yearnum, 0, '.', ''); ?></strong> year(s)</h3>
				<p>$<?php echo number_format($totaloffset, 2, '.', ''); ?></p>
				
				<form name="my_lv" method="post" action="https://www.paypal.com/cgi-bin/webscr" target="_blank" id="left-form">
					<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 class="submit" name="OffsetBttn" type="image" src="offsetnow.png">
				</form>
				<a href="index.php" title="Recalculate"><img src="recalculate.png" /></a>
			</div>
			<?php } ?>
			<div style="background-image:url('bottom-corners.jpg'); background-repeat:no-repeat;">&nbsp;</div>
		</div>
	</div>
</body>
</html>