<?php  
if (isset($_POST['confirm'])) 
{
  include("route.php");
  return;
}
else if (isset($_POST['calculate'])) 
{
  include("route.php");
  return;
}
else if (isset($_POST['confirmsave'])) 
{
  include("confirm.php");
  return;
}

?>

<form id="route" name="route" method="post">
  <p>
  <label>
  <input name="Routing" type="radio" value="return" <?php echo ( ($_POST['Routing']!="oneway")? 'checked="checked"' : "" ) ?> />
    Return</label>
  <br />
  <label>
  <input  name="Routing" type="radio" value="oneway"  <?php echo ( ($_POST['Routing']=="oneway")? 'checked="checked"' : "" ) ?> />
    One-way</label>
  <br />
 <br />
  <label> Number of Passengers: <br />
  <input name="passengers" type="text" value=<?php  echo isset($_POST['passengers'])? '"' . $_POST['passengers'] . '"' : '"1"' ?> size="5" />
  </label>
  <br />
  </p>
  <label> Origin city or IATA airport code <br />
  <input name="destination0" type="text" value= <?php echo '"' . $_POST['destination0'] . '"' ?> size="20" />
  </label>
  <br />
  <?php 
  include("form.php"); 
  
  ?>
  <p>
   
	<input name="AddMultiple" type="submit" value="add more destinations" /> 
	<input name="Remove" type="submit" value="remove destination" />
	  	<br/><br />
	 Enter all airports on your route <strong>in order</strong>.  Clicking the "add more destinations" button will add airports <strong>after</strong> your previous entry. Selecting the return option (default) will double the distance and emissions.<br/>
Remove empty/unused destination boxes before clicking "calculate emissions" or hitting enter/return on your keyboard.
	<br/><br />
	
	 <input name="confirm" type="submit" value="calculate emissions"/>
  </p>
</form> 