<?
$mardatecheck=date("Y-m-d H:i:s");
$marfeature_sql="select * from auction_details where status='Active' and selling_method!='ads' and selling_method!='want_it_now' and picture1!='' and (expire_date > '$mardatecheck') order by expire_date limit 0,4 ";
$marfeature_res=mysql_query($marfeature_sql);

while($marfeature_row=mysql_fetch_array($marfeature_res))
{

$marproductid=$marfeature_row['productid'];
$marproducttitle=$marfeature_row['producttitle'];
$marcurrency=$marfeature_row['currency'];
$marmin_bid_amount=$marfeature_row['min_bid_amount'];
$marbidincrement=$marfeature_row['bidincrement'];

$marbid_sql2="select bidding_amount as bamt from site_bids where productid=".$marproductid." order by bidding_amount desc";
$marbid_res2=mysql_query($marbid_sql2);

$marnum_row2=mysql_num_rows($marbid_res2);
if($marnum_row2!=""){
$marbid_row2=mysql_fetch_array($marbid_res2);
$maruser_bid_amt=$marbid_row2[bamt];
$maruser_bid_amt = $maruser_bid_amt + $marbidincrement;
if($maruser_bid_amt==$marbidincrement)
{
$maruser_bid_amt = $marmin_bid_amount;
}
$maror_price=$marfeature_row['or_price'];
$marsavings = ($maror_price - $maruser_bid_amt)/100;
$marsavings = round($marsavings, 2);
}
$marmtext = "<a href=itechd.php?productid=".$marproductid." style=\"text-decoration:none;\"><font color=#00FF00><B>+++</font><font color=#FFFFFF> ".$marproducttitle." - End Price: ". $marcurrency."".$maruser_bid_amt." - <font color=#FF0000>Saving: ".$marsavings."%</font><font color=#00FF00> +++</b></font></a>";
$marmtext1 = $marmtext." ".$marmtext1;
}
?>
