<?php

	include "library.php";

	$cxn = start_code();
	

			/* get variables */

	$id = val( $_SESSION, "id" );

	$noted_member_id = val( $_GET, "notedid" );


		/* check id's */


	crash_if_missing( $id, "id missing in notes", $cxn );

	crash_if_missing( $noted_member_id, "noted_member_id missing in notes", $cxn );

	page_header( "Notes", $cxn );

	form_start( "notes_go.php", "notedid", $noted_member_id );

	show_photo( $noted_member_id, 100, -1, true, false, $cxn );

	echo "<br><br>";
	
	if (query_has_rows( "SELECT id FROM notes WHERE member_id = ".$id." AND noted_member_id = ".$noted_member_id, $cxn ))
	{
		$data = get_first_row( "SELECT text FROM notes WHERE member_id = ".$id." AND noted_member_id = ".$noted_member_id, $cxn );

		form_textarea( "", "notes", 10, 100, $data['text'] );
	}
	else
		form_textarea( "", "notes", 10, 100, "" );

	echo "<tr><td></td><td align='center'><br><br><input type='image' src='buttons/".button_filename( "save" )."' border='0'></td></tr>";

	form_end();

?>


