<?php

	include "library.php";

	$cxn = start_code( true );
	
	$cxn_common = db_common_login();
	

	$_SESSION['validation_error'] = "false";
	$_SESSION['validation_errors'] = "";

	page_header( "", $cxn, $cxn_common, "", true );

	$query = "SELECT profile.id as member_id, photos.*, profile.handle FROM photos LEFT JOIN profile ON profile.id = photos.member_id ORDER BY photos.id DESC LIMIT 100";

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

	echo "<table>";

	for ($i=0; $i < query_num_rows($result); $i++)
	{
		$data = get_row( $result );

		echo "<tr><td width='10%'>";

//		echo show_handle( $data['member_id'], $data['handle'], "main", "", "stats_screen", "true" );

		$url = url_encode( "display_profile.php", "showid", $data['member_id'], "returnpoint", "main", "startpos", "0", "stats_screen", "true" );

		echo "<a class='glink' href='".$url."'>".$data['handle']."</a>";		


		echo "</td><td width='20%'>";

		show_photo( $data['member_id'], 100, $data['photo_number'], true, false, $cxn );

		echo "</td><td>&nbsp;&nbsp;".show_link( "Rotate", "rotate_photo_go.php", "thisid", $data['member_id'], "photonumber", $data['photo_number'], "rotate", "yes" )."</td></tr>";
		
//		</tr><tr><td>&nbsp;</td></tr>";
	}

	echo "</table>";

	echo black( "<br><br>Finished" );
	
?>