<?
		include("config/connect.php");
		$aucidsnew = '';
		foreach($_POST as $name => $value)
		{
			if($aucidsnew=='')
			{
				$aucidsnew .= "'".$value."'";
			}
			else
			{
				$aucidsnew .= ",'".$value."'";

			}	
		}
		
		//echo "[".$temp."]";
		//$aucids = explode(',',$_GET["aids"]);
		//$prices = explode(',',$_GET["pris"]);
		
		/*$totcount = count($aucids);
		$temp = "";
		for($i=0;$i<$totcount;$i++)
		{
			if($i==$totcount-1)
			{
				$aucidsnew .= "'".$aucids[$i]."'";
			}
			else
			{
				$aucidsnew .= "'".$aucids[$i]."',"; 						
			}
		}*/
		$qrysel = "select * from auc_due_table where auction_id in (".$aucidsnew.") order by auc_due_time";
		$ressel = mysql_query($qrysel);
		$total = mysql_num_rows($ressel);
		$counter = 0;
		$p = 0;
		for($i=1;$i<=$total;$i++)
		{
			$obj = mysql_fetch_object($ressel);
			$newprice = $obj->auc_due_price;
			$oldprice = $prices[$p];

					$qr = "select * from bid_account ba left join registration r on ba.user_id=r.id where auction_id='".$obj->auction_id."' and bid_flag='d' order by ba.id desc limit 0,1";
					$res2 = mysql_query($qr);
					$total2 = mysql_num_rows($res2);
					$obj2 = mysql_fetch_object($res2);
					$username = $obj2->username;
					if($i==1)
					{
						$temp = '{"auction":{"id":"'.$obj->auction_id.'","price":"'.$newprice.'","username":"'.$username.'"}}';
					}
/*					elseif($i==$total)
					{
						$temp .= ',{"auction":{"id":"'.$obj->auction_id.'","price":"'.$newprice.'","username":"'.$username.'"}}';			
					}
*/					else
					{
						$temp .= ',{"auction":{"id":"'.$obj->auction_id.'","price":"'.$newprice.'","username":"'.$username.'"}}';
					}
			$p++;
			
		}
		//echo '[{"auction":{"id":"'.$firstauct.'"}},{"auction":{"id":"5"}},{"auction":{"id":"8"}}]';

		echo "[".$temp."]";		
?>
