<html>
<head>
<?
require 'include/announcements.php'; // ITECHBIDS Configuration File
require 'include/itechbids.php'; // Server compatibility Patch
$productid=$_GET[productid];

$j=$_GET[i];
$i=$j;
$sql="select * from auction_details where productid=".$productid;
$res=mysql_query($sql);
$r1=mysql_fetch_array($res);
$total_records=mysql_num_rows($res);
$k=0;
for($t=0;$t<=5;$t++)
{
 if(!empty($r1[picture."$t"])) 
 {
 $k=$k+1;
 }
}
?>
<title><?= $r1[producttitle];?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<br>
<br>
<table align="center">

<tr>
<? 

 /*if(!empty($r1[picture."$i"])) 
 { */
 if($i<=$k && $i!=1)
 {
?>
<td align="right"><a href="view_full_size.php?productid=<?= $r1[productid];?>&i=<?= $i-1; ?>"><font size=2 color=red>Prev</font></a>&nbsp;&nbsp;
<? 
}
if($i<=$k-1)
 {
 if($i==1)
 {
?>
<td align="right"><a href="view_full_size.php?productid=<?= $r1[productid];?>&i=<?= $i+1; ?>"><font size=2 color=red>Next</font></a></td>
<? 
}
else
{ ?>
<a href="view_full_size.php?productid=<?= $r1[productid];?>&i=<?= $i+1; ?>"><font size=2 color=red>Next</font></a></td>
<? 
}
}
?>
</tr>
<tr><td valign="middle">
<table border=1 cellpadding="10" cellspacing="2" >
<tr align="center"><td>

 <?
				   if(!empty($r1[picture."$j"]))
	               {
				   $img=$r1[picture."$j"];
				   list($width, $height, $type, $attr) = getimagesize("uploads/$img");
				   $h=$height;
				   $w=$width;
				   if($h>800)	
				   {
				   $nh=800;
				   $nw=($w/$h)*$nh;
				   $h=$nh;
				   $w=$nw;
				   }
				  if($w>800)
				  {
				  $nw=800;
				  $nh=($h/$w)*$nw;
				  $h=$nh;
				  $w=$nw;
				  }
				  }
	              ?>
				 
 <img src="uploads/<? echo $r1[picture."$j"]?>" border="1" align="middle" width=<?= $w; ?> height=<?=$h?> > 
</td></tr>
 </table>
 </td></tr>
 <tr><td align="center"><a href="#" onClick="window.close();"><font size=2>Close</font></a></td></tr></table>
</body>
</html>
