<?
$feature_sql="select * from auction_details where status='Active' and picture1!='' and (bid_starting_date <= '$datecheck') and (expire_date > '$datecheck') order by expire_date limit 11,8 ";
	$feature_res=mysql_query($feature_sql);
	$tot_count2=mysql_num_rows($feature_res);
	$count=0;
	if($tot_count2 > 0)
	{
	 ?>
	
	<table width="980" cellpadding="0" cellspacing="0" >
	<tr>
<tr><td width="1%" height="24" valign="top"><img src=templates/<?=$tfold?>/img_files/t_header_l_gr.gif></td>
<td class="tdhead_main_gr" width="30%" height="24" valign="middle">

<table width="250" cellpadding="0" cellspacing="0" >
<tr><td width="1%" height="24" valign="top"><img src=templates/<?=$tfold?>/img_files/heading-left-gr.gif></td>
<td class="head_main_gr" width="98%" height="24" valign="middle">&nbsp;<B>LIVE AUCTIONS</b></td>
<td width="1%" height="24" valign="top"><img src=templates/<?=$tfold?>/img_files/heading-right-gr.gif></td></tr>
	</table>
</td>
<td class="tdhead_main_gr" width="68%" height="24" valign="middle">&nbsp;</td>
<td width="1%" height="24" valign="top"><img src=templates/<?=$tfold?>/img_files/t_header_r_gr.gif></td></tr>
	</table>

<table border="0" align="center" cellpadding="0" cellspacing="0" width=980 class="ft_right_gr">
<TR height="12" align="center" style="background-image: url(templates/<? echo "$tfold" ?>/img_files/head_tab2.gif);">
<TD height="17" width=10%><?=$lang_703?></TD><TD width=50%>&nbsp;</TD><TD width=10%><?=$lang_704?></TD><TD width=10%><?=$lang_705?></TD><TD width=20%><?=$lang_706?></TD></Tr>

    <?
		while($feature_row=mysql_fetch_array($feature_res))
	{
$i=$feature_row['productid'];
$sale_price=$feature_row['currency'];
	?>
	<?
$imgsize = $feature_row['picture1'];
list($widths, $heights, $types, $attrs) = getimagesize("uploads/$imgsize");
$img=$feature_row['picture2'];
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;
				  }
		
	?>
<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" style="padding-left:5px; border-bottom:0px;">
	<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>
<?
$expiry_date = $feature_row['expire_date'];
 $min_bid_amount=$feature_row['min_bid_amount'];
$bidincrement=$feature_row['bidincrement'];

$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_amt = $user_bid_amt + $bidincrement;

if($user_bid_amt==$bidincrement)
{
$user_bid_amt = $min_bid_amount;
}

$highest_bidder_sql="select user_name un 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[un];
if($user_bid_name=="")
{
$user_bid_name = "None";
}

?>
<?
$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<?=$i;?>" style="display:none;">no</div>
	</td>
		</tr>
		</table>
		</td>
<?
$description=$feature_row['detailed_descrip'];
$description=substr($description, 0, 100);
$description="$description....";
$description=strip_tags($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>
<td align="center">
<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<?=$i?>">
<? echo Trim($sale_price); ?><? echo Trim($user_bid_amt); ?></span>
</div>
</td>
<td align="center">
    <div style="font-weight:bold;" width="100%" id="Usr<?=$i?>"><?=$user_bid_name?>
</div>
</td>
<td align="center">
<div id="Bid<?=$i?>" style="font-size:18px; font-weight:bold;">
<b>--|--|--|--</b></div><BR>
<?if(empty($_SESSION[userid])) { ?>
<a name= "link1" href="signin.php" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage('IMG<?=$i?>','','templates/<?=$tfold?>/img_files/login_big.png',1);" style="text-decoration:none;">
<img NAME = "IMG<?=$i?>" src=templates/<?=$tfold?>/img_files/bidnow_big.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_big.png border="0"></a>
<? } ?>
</td>


		</tr>
<?
 if(($l==1)||($l==5))
{
echo "<tr>";
$l=1;
}
$allpro2 = $feature_row['productid'];
$allpro1 = "$allpro2";
if($allpro!=""){
$allpro = "$allpro1|$allpro";
}
if($allpro==""){
$allpro = "$allpro1";
}
?>
	<?
	}
	?>
</table>
	<table width="980" height="55" cellpadding="0" cellspacing="0" style="background-image: url(templates/<? echo "$tfold" ?>/img_files/bot_bot.gif);">
	<tr>
<tr>
<td width="98%" height="55" valign="middle">&nbsp;&nbsp;<a href="all_live.php?cats_id=0&list_type=0"><B>All Live Auctions</b></a></td>
</tr>
	</table>

	<?
	}
	?>
<?
	if($tot_count > 0)
	{ ?>
<SCRIPT LANGUAGE='javascript'>countdown('<?=$allpro?>')</SCRIPT>
<SCRIPT LANGUAGE='javascript'>setTimeout("GetUpdate('<?=$allpro?>')",2000);</SCRIPT>
<? } ?>