<?php

	include "library.php";

	$cxn = start_code();

	$cxn_common = db_common_login();

	
			/* get variables */

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


		/* start the page  */

	page_header( "View Email", $cxn, $cxn_common, "", 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%'>&nbsp;</td><td width='50%'>".sp(1)."</td></tr>";

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

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

	echo "</table>";

?>