<?php

	include "library.php";

	$cxn = start_code();

	
			/* get variables */

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

	$unblock = val( $_GET, "unblock" );
	$unblock_id = val( $_GET, "unblockid" );


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

	crash_if_missing( $unblock, "unblock missing in unblock", $cxn );

	crash_if_missing( $unblock_id, "unblock id missing in unblock", $cxn );


			/* start page */

	page_header( "", $cxn );

	if ($unblock == "no")
		echo black( "Unblock cancelled<br><br>" );
	else
	{
		$query = "DELETE FROM blocked_list WHERE blocker_id = ".$id." AND blockee_id = ".$unblock_id;

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

		echo black( "Member unblocked successfully<br><br>" );
	}

	echo show_link( "Return", "mailboxes.php", "box", "blocked" );
?>

