<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
        <head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>ReadCustomer 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('HSD', 'HSD-User','HSD-User+password');
	
		// Test connection
		if (!$Conn)
	    	{
	        	exit ("ODBC Connection Failed: " . $Conn);
	    	}
		// Create SQL statement
    	$SQL = "SELECT * FROM CUSTOMER";
 
    	// Execute SQL statement
    	$RecordSet = odbc_exec($Conn,$SQL);
    
    	// Test existence of recordset
    	if (!$RecordSet)
	    	{
	        	exit ("SQL Statement Error: " . $SQL);
	    	}
	?>
	    <!--  Page Headers -->
	    <h1>
	   		The Heather Sweeney Designs CUSTOMER Table
		</h1>
	    <hr />
	    <h2>
	        CUSTOMER
		</h2>
	<?php	  
		// Table headers
	    echo "<table class='output' border='1'>
	    		<tr>
	    			<th>EmailAddress</th>
	    			<th>LastName</th>
	    			<th>FirstName</th>
	    			<th>Phone</th>
	    			<th>StreetAddress</th>
	    			<th>City</th>
	    			<th>State</th>
	    			<th>ZIP</th>
	    		</tr>";
	    
	    // Table data
	    while($RecordSetRow = odbc_fetch_array($RecordSet))
	    	{
	    	echo "<tr>";
	    	echo "<td>" . $RecordSetRow['EmailAddress'] . "</td>";
	    	echo "<td>" . $RecordSetRow['LastName'] . "</td>";
	    	echo "<td>" . $RecordSetRow['FirstName'] . "</td>";
	    	echo "<td>" . $RecordSetRow['Phone'] . "</td>";
	    	echo "<td>" . $RecordSetRow['StreetAddress'] . "</td>";
	    	echo "<td>" . $RecordSetRow['City'] . "</td>";
	    	echo "<td>" . $RecordSetRow['State'] . "</td>";
	    	echo "<td>" . $RecordSetRow['ZIP'] . "</td>";
	    	echo "</tr>";
	    	}
	    echo "</table>";
	    
	    // Close connection
	    odbc_close($Conn);
	?>
		<br />
		<hr />
		<p class="footer">
			<a href="../HSD/index.html">Return to Heather Sweeney Designs Home Page</a>
		</p>
		<hr />
    </body>
</html>