<!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>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
	include_once('PeakService.php');
	include_once('MountainPeak.php');
	
	$service = new PeaksService();
	
	if($_POST)
	{
		
		$peak = new MountainPeak();
		$peak->id = $_POST["id"];
		$peak->name = $_POST["name"];
		$peak->elevation = $_POST["elevation"];
		$peak->latitude = $_POST["latitude"];
		$peak->longitude = $_POST["longitude"];
		$peak->prominence = $_POST["prominence"];
		$peak->range_name = $_POST["range_name"];
		$peak->state = $_POST["state"];
		$peak->first_ascent = $_POST["first_ascent"];
		
		$result = $service->updateForest($peak);
		
		print_r($result);
<body>
<div id="accordion">
<h3><a href="#">Data Table</a></h3>
<div>
<table id="peaks">
<thead>
<th>ID</th><th>Name</th><th>Elevation</th><th>Longitude</th><th>Latitude</th><th>Prominence</th><th>Range Name</th><th>State</th><th>First Ascent</th>
</thead>
<tbody>
<?php


include_once('PeakService.php');

$peak_service = new PeaksService();

$peak_array = $peak_service->getAllPeaks();
$ranges = $peak_service->getDistinctRanges();
$states = $peak_service->getDistinctStates();

foreach ($peak_array as $row)
{
	echo "<tr><td>".$row->id."</td><td>".$row->name."</td><td>".$row->elevation."</td><td>".$row->latitude."</td><td>".$row->longitude."</td><td>".$row->prominence."</td><td>".$row->range_name."</td><td>".$row->state."</td><td>".$row->first_ascent."</td></tr>";	
}

?>
</tbody>
</table>
</div>