<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr><td class="nav"><a href="index.php?section=home">Home</a>&nbsp;&gt;&nbsp;<a href="index.php?section=manage_hotornot">HotOrNot Rating</a></td></tr>
	<tr><td>&nbsp;</td></tr>
	<tr>
		<td>
			<table cellpadding="2" cellspacing="3" border="0" align="center">
			<form action="index.php" method="post">
			<input type="hidden" name="section" value="manage_hotornot">
				<tr>
					<td class="form_cell">
						<table cellspacing="2" cellpadding="0" border="0">
							<tr>
								<td class="body">Search For:</td>
							</tr>							
							<tr>
								<td><?php admin_form_element(array ("type" => "input", "name" => "search_text", "size" => 20, "value" => $data["values"][search_text])); ?></td>
							</tr>
							<tr>
								<td><?php
									$search_for = array (
										"type" => "select",
										"name" => "search_for",
										"options" => array (
											"" => "Please, select...",
											"mem_id" => "Member ID",
											"pho_id" => "Photo ID",
											"caption" => "Caption"
										),
										"value" => $data["values"][search_for]
										);
									admin_form_element($search_for);?>
								</td>
							</tr>
						</table>
					</td>
					<td class="form_cell">
						<table cellspacing="2" cellpadding="0" border="0">
							<tr>
								<td class="body">Sort By:</td>
							</tr>
							<tr>
								<td><?php
									$sort_by = array (
										"type" => "select",
										"name" => "sort_by",
										"options" => array (
											"" => "Please, select...",
											"rating" => "Rating",
											"votes" => "Votes",
											"pho_id" => "Photo ID",
											"mem_id" => "Member ID"
										),
										"value" => $data["values"][sort_by]
										);
									admin_form_element($sort_by); ?>
								</td>
							</tr>
							<tr>
								<td><?php
									$sort_order = array (
										"type" => "select",
										"name" => "sort_order",
										"options" => array (
											"asc" => "ascending",
											"desc" => "descending"
										),
										"value" => $data["values"][sort_order]
									);
								admin_form_element($sort_order);
								?>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center"><?php admin_form_element( array ("type" => "button", "value" => "Show")); ?></td>
				</tr>
			</form>
			</table>
		</td>
	</tr>
	<tr><td>&nbsp;</td></tr>
	<?php if(count($data["photos"]) == 0): ?>
	<tr><td align="center" class="body">No photos found.</td></tr>
	<?php else: ?>
	<tr><td>		
		<table align="center" cellpadding="2" cellspacing="2" border="0" width="400">
		<form action="index.php" method="post">
		<input type="hidden" name="section" value="manage_hotornot">
		<input type="hidden" name="ret_link" value="<?php echo $data["link"]; ?>">
		<input type="hidden" name="action" value="">
		<tr>
			<td class="list_header" align="center">
			<input type="checkbox" onclick="HS_TickAll('pho_id[]',this.form)" name="tick_tracker">
			</td>			
			<td class="list_header" align="center" nowrap>Photo</td>
			<td class="list_header" align="center" width="100%">Caption</td>
			<td class="list_header" align="center" nowrap>Rating</td>
			<td class="list_header" align="center" nowrap>Votes</td>
			<td class="list_header" align="center" nowrap>Member ID</td>
			<td class="list_header" align="center" nowrap>Photo ID</td>
			<td class="list_header" align="center" nowrap>Action</td>
		</tr>
		<?php
		
			foreach($data["photos"] as $photo){
			?>
			<tr>
				<td class="list_cell"><?php
				admin_form_element(array ("type" => "checkbox", "name" => "pho_id[]", "ovalue" => $photo["pho_id"]));
				?></td>
				<td class="list_cell"><?php admin_output_image($photo["photo"],$photo["edit"],"photos"); ?></td>
				<td class="list_cell"><?php echo $photo["caption"]; ?></td>
				<td class="list_cell"><?php echo $photo["rating"]; ?></td>
				<td class="list_cell"><?php echo $photo["votes"]; ?></td>
				<td class="list_cell"><?php echo $photo["mem_id"]; ?></td>
				<td class="list_cell"><?php echo $photo["pho_id"]; ?></td>
				<td class="list_cell"><?php
					admin_output_image("buttons/but_edit_small.gif",$photo["edit"],0,"edit");
					admin_output_image("buttons/but_ban_small.gif",$photo["voting"],0,"remove from voting");
					admin_output_image("buttons/but_delete_small.gif",$photo["delete"],0,"delete");
				?></td>
			</tr>
			<?php
			}//foreach
					
		?>
		<tr>			
			<td colspan="8" align="center"><?php
			admin_form_element( array ("type" => "button", "value" => "Remove from Voting", "bsubmit" => "this.form.action.value='voting';") );
			echo "&nbsp;";
			admin_form_element( array ("type" => "button", "value" => "Delete", "bsubmit" => "this.form.section.value='manage_photos';this.form.action.value='delete';") );
			?></td>			
		</tr>		
		</form>
		</table>
	</td></tr>
	<tr><td>&nbsp;</td></tr>
	<?php if(is_array($data["pages"][numbers])): ?>
	<tr>
		<td class="pages_line">
			<table cellpadding="0" cellspacing="0" border="0" align="center" height="20">
				<tr>					
					<td align="center" class="pages_body">
					<?php
						if($data["pages"][prev]){
							?><a href="<?php echo $data["pages"][prev]; ?>">&lt;&lt;</a>&nbsp;<?php
						}//if
						while(list($page,$link) = each($data["pages"][numbers])){
							?><a href="<?php echo $link; ?>"><?php echo ($page == $data["pages"][current]) ? "<b>".$page."</b>" : $page ; ?></a>&nbsp;<?php
						}//while
						if($data["pages"][next]){
							?><a href="<?php echo $data["pages"][next]; ?>">&gt;&gt;</a>&nbsp;<?php
						}//if
					?>
					</td>
			</table>
		</td>
	</tr>
	<?php endif; ?>
	<?php endif; ?>
</table>