<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>ReadOwnedProperty PHP Page</title>
		<style type="text/css">
			h1 {text-align: center; color: blue}
			h2 {font-family: Ariel, sans-serif; text-align: left; color: blue}
			p.footer {text-align: center}
			table.output {font-family: Ariel, sans-serif}
		</style>
	</head>
	<body>
	<?php
		// Get connection
		$Conn = odbc_connect('GG', 'GG-User','GG-User+password');
	
		// Test connection
		if (!Conn)
	    	{
	        	exit ("ODBC Connection Failed: " . $Conn);
	    	}
		// Create SQL statement
    	$SQL = "SELECT * FROM OWNED_PROPERTY";
 
    	// Execute SQL statement
    	$RecordSet = odbc_exec($Conn,$SQL);
    
    	// Test existence of recordset
    	if (!$RecordSet)
	    	{
	        	exit ("SQL Statement Error: " . $SQL);
	    	}
	?>
	    <!--  Page Headers -->
	    <h1>
	   		The Garden Glory OWNED_PROPERTY Table
		</h1>
	    <hr />
	    <h2>
	        OWNED_PROPERTY
		</h2>
	<?php	  
		// Table headers
	    echo "<table class='output' border='1'>
	    		<tr>
	    			<th>PropertyID</th>
	    			<th>PropertyName</th>
                                <th>PropertyType</th>
	    			<th>Street</th>
	    			<th>City</th>
	    			<th>State</th>
	    			<th>ZIP</th>
	    			<th>OwnerID</th>
	    		</tr>";
	    
	    // Table data
	    while($RecordSetRow = odbc_fetch_array($RecordSet))
	    	{
	    	echo "<tr>";
	    	echo "<td>" . $RecordSetRow['PropertyID'] . "</td>";
	    	echo "<td>" . $RecordSetRow['PropertyName'] . "</td>";
                echo "<td>" . $RecordSetRow['PropertyType'] . "</td>";
	    	echo "<td>" . $RecordSetRow['Street'] . "</td>";
	    	echo "<td>" . $RecordSetRow['City'] . "</td>";
	    	echo "<td>" . $RecordSetRow['State'] . "</td>";
	    	echo "<td>" . $RecordSetRow['ZIP'] . "</td>";
	    	echo "<td>" . $RecordSetRow['OwnerID'] . "</td>";
	    	echo "</tr>";
	    	}
	    echo "</table>";
	    
	    // Close connection
	    odbc_close($Conn);
	?>
		<br />
		<hr />
		<p class="footer">
			<a href="../GG/index.html">Return to Garden Glory Home Page</a>
		</p>
		<hr />
    </body>
</html>