<? $title="$lang_221";
	require 'templates/'.$tfold.'/header.php';?>
	<table width="980" cellpadding="0" cellspacing="0" align="center">
	<tr>
<tr class="tdhead_main"><td width="1%" height="24" valign="top"><img src=templates/<?=$tfold?>/img_files/t_header_l.gif></td>
<td width="98%" height="24" valign="middle">&nbsp;<B><? echo "$lang_283" ?></b></td>
<td width="1%" height="24" valign="top"><img src=templates/<?=$tfold?>/img_files/t_header_r.gif></td></tr>
	</table>
<table width="980" align="center" cellpadding="0" cellspacing="0" border=0 class="ft_right"  style="padding-left : 10px; padding-right : 10px; padding-bottom : 10px; padding-top : 10px;" >
<tr>
<td valign="top" >
<table cellpadding="0" cellspacing="0">
<tr align="center" height=35>
<td width=2>
<? require'include/usermenu.php'; ?>
</td></tr></table></td><td valign="top" align="right">
<table cellpadding="0" cellspacing="0" width=730>
<tr>
<td>&nbsp;</td></tr><tr>
<td>
<table cellspacing="0" cellpadding="0" class="ft2" width=100%><?
	$count=0;
	if($watch_total_records1 > 0)
	{
	 ?>

<div style="display: none; position: absolute; top: 70px;" id="preview_div"></div>
<table border="0" align="center" cellpadding="0" cellspacing="0" width=710>
<TR height="12" align="center" style="background-image: url(templates/<? echo "$tfold" ?>/img_files/head_tab2.gif);">
<th height="17" width=15%><?=$lang_703?></th><th width=40%></th><th width=10%><?=$lang_704?></th><th width=10%><?=$lang_705?></th><th width=20%><?=$lang_706?></th></Tr>

    <?
	while($watch_roww=mysql_fetch_array($watch_res1))
	{
$feature_sql="select * from auction_details where productid=".$watch_roww[productid];
$feature_res=mysql_query($feature_sql);
$feature_row=mysql_fetch_array($feature_res);

$datecheck=date("Y-m-d H:i:s");


$expiry_date = $feature_row['expire_date'];
$selling_method = $feature_row['selling_method'];

if($expiry_date < "$datecheck"){
$listtype=3;
}



	$string_1=$feature_row[detailed_descrip];
	?>
	<?
$imgsize = $feature_row['picture1'];
list($widths, $heights, $types, $attrs) = getimagesize("uploads/$imgsize");
if($feature_row['picture2']==""){
$feature_row['picture2']=$feature_row['picture1'];
}
$img=$feature_row['picture2'];
				   list($width, $height, $type, $attr) = getimagesize("uploads/$img");
				   $h=$height;
				   $w=$width;
				   if($h>80)	
				   {
				   $nh=80;
				   $nw=($w/$h)*$nh;
				   $h=$nh;
				   $w=$nw;
				   }
				  if($w>100)
				  {
				  $nw=100;
				  $nh=($h/$w)*$nw;
				  $h=$nh;
				  $w=$nw;
				  }
		
	?>
<? if(($i%2)==0){ ?>
<tr style="background-image: url(templates/<? echo "$tfold" ?>/img_files/mid_tab2.gif);">
<? } ?>
<? if(($i%2)!=0){ ?>
<tr>
<? } ?>
<td align="center" height="100">
		
		<table border="0" cellpadding="0" cellspacing="0" width=65 height=65 bordercolor="#000000">
		<tr valign="top">
		<td align="center" bgcolor="#ffffff" style="padding-left:5px;">




	<a onmouseover="showtrail('uploads/<? echo $feature_row['picture1']; ?>','',<?=$widths?>,<?=$heights?>)" onmouseout="hidetrail()" href="itechd.php?productid=<? echo $feature_row['productid']; ?>">
	 <img src="uploads/<? echo $feature_row['picture2']; ?>" width=<?=$w?> height=<?=$h?> border=0>
	</a>
	</td>
		</tr>
		</table>
		</td>
<?
$description=$feature_row['detailed_descrip'];
$description=substr($description, 0, 50);
$description="$description....";
?>
		<td align="left" style="padding-left:5px;padding-top:5px;padding-bottom:5px;">
<font color="#4a4a4a">
<B><?=$lang_751?>: <? echo Trim($sale_price); ?><?=$feature_row['or_price']?></b></font><BR><BR>
<a href="itechd.php?productid=<? echo $feature_row['productid']; ?>">
	<? echo $feature_row['producttitle'];?></a><BR><BR><? echo "$description" ?>
</td>
<? 
$expiry_date = $feature_row['expire_date'];
        $date1 = strtotime(now);
		$date22=strtotime($expiry_date);

      $date1 = date("Y,m,j,G,i,s",$date1);
      $date2 = date("Y,m,j,G,i,s",$date22); 
      $exdate = date("YmjGis",$date22);

$futuredate = date("M j, Y G:i:s",$date22); 
$min_bid_amount=$feature_row['min_bid_amount'];
$bidincrement=$feature_row['bidincrement'];

if($selling_method!="11")
{
$bid_sql2="select * from site_bids where productid=".$feature_row['productid']." order by bidding_amount desc";
$bid_res2=mysql_query($bid_sql2);
$bid_row2=mysql_fetch_array($bid_res2);
$user_bid_amt=$bid_row2[bidding_amount];
$user_bid_id=$bid_row2['user_id'];
$user_bid_sold="$user_bid_amt";
$user_bid_amt = $user_bid_amt+$bidincrement;
if($user_bid_amt==$bidincrement)
{$user_bid_amt = $min_bid_amount + $bidincrement;
}
}

if($selling_method=="11")
{
$bid_sql2="select * from site_bids where productid=".$feature_row['productid']." order by bidding_amount asc";
$bid_res2=mysql_query($bid_sql2);
$bid_row2=mysql_fetch_array($bid_res2);
$user_bid_amt=$bid_row2[bidding_amount];
$user_bid_id=$bid_row2['user_id'];
$user_bid_sold="$user_bid_amt";
}

$query="select * from auction_details where productid=".$feature_row['productid'];
$table=mysql_query($query);
$row=mysql_fetch_array($table);
$sale_price=$row['currency'];

$highest_bidder_sql="select * from member_details where user_id=".$user_bid_id;
   $highest_bidder_res=mysql_query($highest_bidder_sql);
   $highest_bidder_res=mysql_fetch_array($highest_bidder_res);
  $user_bid_name=$highest_bidder_res[user_name];
$timetoadd = $feature_row['timetoadd']; 
if($user_bid_name=="")
{
$user_bid_name = "None";
}
$bidnow=$_SESSION[userid];

?>
<td align="center">
<?
$expire_date = $feature_row['expire_date']; 
$date2=strtotime($expire_date);
$date2 = date("d-m-Y H:i:s",$date2); 
$dateTo = $date2;
$date1 = mktime(date("H"),date("i"),date("s"),date("n"),date("j"),date("Y"));
$dateToElements = split(' ', $dateTo);
$dateToDateElements = split('-', $dateToElements[0]);
$dateToTimeElements = split(':', $dateToElements[1]); 
$date2 = mktime($dateToTimeElements[0], $dateToTimeElements[1], $dateToTimeElements[2], $dateToDateElements[1], $dateToDateElements[0], $dateToDateElements[2]); 
$difference = $date2 - $date1;
?>
<div id="futu<?=$feature_row['productid'];?>" style="display:none;"><?=$difference?></div>
<div id="totb<?=$feature_row['productid'];?>" style="display:none;"><?=$feature_row['totbid'];?></div>	   
<div id="timadd<?=$feature_row['productid'];?>" style="display:none;"><?=$feature_row['timetoadd'];?></div>	    
<div id="pause<?=$feature_row['productid'];?>" style="display:none;">no</div>
<div style="border:0px; padding:0px; font-weight:bold; color:teal; font-size:12px;">
<span style="border:0px; padding:0px; font-weight:bold; color:teal; font-size:12px;" id="Amt<?=$feature_row['productid']?>">
<?if($listtype!=3){?>
<?=$sale_price?><? echo Trim($user_bid_amt); ?>
<? } ?>
<?if($listtype==3){?>
<?=$sale_price?><? echo Trim($user_bid_sold); ?>
<? } ?>
</span>
</div>
</td>
<td align="center">
<div style="font-weight:bold;" id="Usr<?=$feature_row['productid']?>"><?=$user_bid_name?>
</div><BR>
</td>
<td align="center">
<?
if($listtype!=3){
?>
<div id="Bid<?=$feature_row['productid']?>" style="font-size:18px; font-weight:bold;">
<B>--|--|--</b>
</div>
<?}?>
<?
if($listtype==3){
?>
<?
$pay_sql2="select * from usertransaction where user_id=$user_id and itemid=".$feature_row['productid'];
$pay_res2=mysql_query($pay_sql2);
$pay_total_records2=mysql_num_rows($pay_res2);
?>
<? if($pay_total_records2==0){ ?>
<form name="form<?=$i?>" action="reviewitechds.php" method="POST">
<input type="hidden" name="productid" value="<?=$feature_row['productid']?>">
<input type="image" src=templates/<?=$tfold?>/img_files/pay_now.png border="0">
</form>
<? } ?>
<? if($pay_total_records2>0){ ?>
<img src=templates/<?=$tfold?>/img_files/pay_now_dis.png border="0">
<? } ?>
<?}?>
<BR>

<?
if($listtype!=3){
?>

<?if(empty($_SESSION[userid])) { ?>
<a name= "link1" href="signin.php" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('IMG<?=$i?>','','templates/<?=$tfold?>/img_files/login.png',1);" style="text-decoration:none;">
<img NAME = "IMG<?=$i?>" src=templates/<?=$tfold?>/img_files/bidnow.png border="0"></a>
<? } ?>
<?if(!empty($_SESSION[userid])) { ?>
<a name= "link1" href="javascript:bidnow(<?=$feature_row['productid']?>,<?=$bidnow?>)" style="text-decoration:none;">
<img NAME = "IMG<?=$i?>" src=templates/<?=$tfold?>/img_files/bidnow.png border="0"></a>
<? } ?>
<?}?>
<?
if($listtype==3){
?>
<B><?=$lang_719?><BR><? echo $row['expire_date']; ?></b>
<?}?>
</td>


		</tr>
<?
$i++;
$allpro2 = $feature_row['productid'];


$allpro1 = "$allpro2";

if($allpro!=""){
$allpro = "$allpro1|$allpro";
}
if($allpro==""){
$allpro = "$allpro1";
}
}
?>
<TR><TD>
</TD></TR>
</table>
	<?
	}
$user_id=$_SESSION[user_id];
	?>
<SCRIPT LANGUAGE='javascript'>countdown('<?=$allpro?>')</SCRIPT>
<SCRIPT LANGUAGE='javascript'>setTimeout("GetUpdate('<?=$allpro?>','<?=$user_id?>')",2000);</SCRIPT>
</TD></TR>
</table></TD></TR>
</table><?
	if($watch_total_records1 == 0)
	{
	 ?>
</TD></TR>
</table>
<? } ?>
	<table width="980" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="98%" height="5" valign="middle"><img src=templates/<?=$tfold?>/img_files/t_bot.gif border="0"></b></td>
</tr>
	</table>
<? require 'templates/'.$tfold.'/footer.php'?>
</table>
  </body>
</html>	