<?php

	include "library.php";

	$cxn = start_code();


			/* get variables */

	$email_id = val( $_GET, "emailid" );


		/* start the page  */

	page_header( "View Email", $cxn, true );


		/* check id */

	crash_if_missing( $email_id, "id blank in view email", $cxn );


		/* view the email */
		
	$query = "SELECT * FROM message WHERE id = ".$email_id;

	$result = run_query( $query, $cxn, true );

	$data = get_row( $result );

	echo "<br><br>";

	echo "<table width='60%'>";

	echo "<tr><td width='10%'>".sp(1)."</td><td width='50%'>".sp(1)."</td></tr>";

	show_field( "Subject&nbsp;&nbsp;", $data['subject'], true );

	echo "<tr><td>".sp(1)."</td></tr>";
	
	show_field( "Message&nbsp;&nbsp;", $data['message'], true );

	echo "</table>";

?>

