<?
session_start();
include('_db.connection.php');
include('check.access.php');
include('_public.setup.php');
?>

	<table cellpadding="0" cellspacing="0" width="780" border="0">
		<?php include("i.header.php"); ?>
		<tr>
			<td>
				<table cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td valign="top">
							<!--
							**************************
							**** BEGIN BODY TABLE ****
							**************************
							-->
							<table cellpadding="0" cellspacing="0">
								<tr>
									<td><a href="image.list.php?fid=<? echo $fid; ?>"><img src="./images/ButtonBack.gif" border="0" alt="Back To Image List"></a><img src="./images/HeaderImageManager3.gif"></td>
								</tr>
								<tr>
									<td align="center">
										<!--
										**************************
										*** BEGIN BODY CONTENT ***
										**************************
										-->
										<script language="javascript">
										function copyit(theField) {
											var tempval=eval("document."+theField)
											tempval.focus()
											tempval.select()
											therange=tempval.createTextRange()
											therange.execCommand("Copy")
										}
										</script>
										<table width="90%" border="0">
											<tr>
												<td>
												<?
												$image_result = mysql_query("SELECT * FROM images WHERE image_id = '$img' and mid = '$mid'", $db);
												$image = mysql_fetch_object($image_result);
												
												$src = "usr/" . $mid . "/" . $image->filename;
												$image_bytes= filesize($src);
												$image_k = round($image_bytes/1024);
												?>
													<table width="100%" border="0">
														<tr>
															<td valign="top">
																<table>
																	<tr>
																		<td style="border: 1px solid #083C58;" bgcolor="#F8F8F8" align="center"><a href="<? echo "is.php?i=" . $image->image_id . "&img=" . $image->filename; ?>" target="_blank"><img src="<? echo "usr/" . $mid . "/i_" . $image->filename; ?>" border="0"></a><br><a href="<? echo "is.php?i=" . $image->image_id . "&img=" . $image->filename; ?>" target="_blank">View Full Size Image</a></td>
																	</tr>
																	<tr>
																		<td style="border: 1px solid #083C58; padding: 6px" bgcolor="#F8F8F8">
																			<table width="100%">
																				<tr>
																					<td><font face="Verdana" style="font-size: 11;" color="#083C58">Views:</td>
																					<td><font face="Verdana" style="font-size: 11;" color="#000000"><b><? echo $image->viewed; ?></td>
																				</tr>
																				<tr><td colspan="2" height="4"></td></tr>
																				<tr>
																					<td><font face="Verdana" style="font-size: 11;" color="#083C58">Height:</td>
																					<td><font face="Verdana" style="font-size: 11;" color="#000000"><b><? echo $image->height; ?>px</td>
																				</tr>
																				<tr><td colspan="2" height="4"></td></tr>
																				<tr>
																					<td><font face="Verdana" style="font-size: 11;" color="#083C58">Width:</td>
																					<td><font face="Verdana" style="font-size: 11;" color="#000000"><b><? echo $image->width; ?>px</td>
																				</tr>
																				<tr><td colspan="2" height="4"></td></tr>
																				<tr>
																					<td><font face="Verdana" style="font-size: 11;" color="#083C58">File Size:<br><font face="Verdana" style="font-size: 10;" color="#083C58">(on the server)</td>
																					<td><font face="Verdana" style="font-size: 11;" color="#000000"><b><? echo $image_k; ?>kb</td>
																				</tr>
																			</table>
																		</td>
																	</tr>
																	<tr>
																		<td style="border: 1px solid #083C58; padding: 6px" bgcolor="#F8F8F8">
																			<table width="100%">
																			<form action="actions.php?pmode=update_img_quality" method="post">
																			<input type="hidden" name="fid" value="<? echo $fid; ?>">
																			<input type="hidden" name="img" value="<? echo $img; ?>">
																				<tr>
																					<td colspan="2"><font face="Verdana" style="font-size: 11;" color="#083C58"><b>Quality:</b></td>
																				</tr>
																				<tr><td colspan="2" height="4"></td></tr>
																				<tr>
																					<td><font face="Verdana" style="font-size: 11;" color="#083C58"><input type="radio" value="80" name="quality" <? if($image->imgquality == 80){ echo "checked"; } ?>></td>
																					<td width="100%"><font face="Verdana" style="font-size: 11;" color="#083C58"><b>High</td>
																				</tr>
																				<tr>
																					<td><font face="Verdana" style="font-size: 11;" color="#083C58"><input type="radio" value="65" name="quality" <? if($image->imgquality == 65){ echo "checked"; } ?>></td>
																					<td width="100%"><font face="Verdana" style="font-size: 11;" color="#083C58"><b>Medium</td>
																				</tr>
																				<tr>
																					<td><font face="Verdana" style="font-size: 11;" color="#083C58"><input type="radio" value="40" name="quality" <? if($image->imgquality == 40){ echo "checked"; } ?>></td>
																					<td width="100%"><font face="Verdana" style="font-size: 11;" color="#083C58"><b>Low</td>
																				</tr>
																				<tr>
																					<td colspan="2" align="right"><input type="submit" value="Update"></td>
																				</tr>
																				</form>
																			</table>
																		</td>
																	</tr>
																</table>
															</td>
															<td valign="top" width="100%">
																<table>
																	<tr>
																		<td><font face="Verdana" style="font-size: 11;" color="#083C58"><b>Caption:</b> <font color="#000000"><? if($image->caption != ""){ echo $image->caption; } else { echo "None"; } ?></td>
																	</tr>
																	<tr>
																		<td height="5"></td>
																	</tr>
																	<form name="code">
																	<tr>
																		<td><font face="Verdana" style="font-size: 11;" color="#083C58"><b>Link to this image</td>
																	</tr>
																	<tr>
																		<td><input type="textbox" name="link" value="<? echo $setup->url . "/is.php?i=" . $image->image_id . "&img=" . $image->filename; ?>" style="width: 325; font-size: 10;"></td>
																	</tr>
																	<tr>
																		<td align="right"><a href="javascript:copyit('code.link')"><img src="images/ButtonCopy.gif" border="0"></a></td>
																	</tr>
																	<tr>
																		<td><font face="Verdana" style="font-size: 11;" color="#083C58"><b>HTML for this image</td>
																	</tr>
																	<tr>
																		<td><textarea name="html" style="width: 325; height: 50;"><img src="<? echo $setup->url . "/is.php?i=" . $image->image_id . "&img=" . $image->filename; ?>" border="0"></textarea></td>
																	</tr>
																	<tr>
																		<td align="right"><a href="javascript:copyit('code.html')"><img src="images/ButtonCopy.gif" border="0"></td>
																	</tr>
																	</form>
																</table>
															</td>
														</tr>
													</table>
												</td>
											</tr>
											<tr>
												<td>&nbsp;</td>
											</tr>
										</table>
										<!--
										**************************
										**** END BODY CONTENT ****
										**************************
										-->
									</td>
								</tr>
							</table>
							<!--
							**************************
							***** END BODY TABLE *****
							**************************
							-->
						</td>
						<td valign="top"bgcolor="#295670"><img src="./images/IndexDropShadow.gif"></td>
						<td valign="top" bgcolor="#083C58">
							<?php include("i.member.rn.php"); ?>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td background="./images/Footer.gif"><img src="./images/Footer.gif" border="0"></td>
		</tr>
		<tr>
			<td>
				<?php include("i.footer.php"); ?>
			</td>
		</tr>
	</table>

<?
mysql_close($db);
print($close);
?>