<?
	include("config/connect.php");
	include("functions.php");
	
	$qrysel2 = "select * from auction_pause_management where id='3'";
	$ressel2 = mysql_query($qrysel2);
	$total = mysql_num_rows($ressel2);
	if($total==0)
	{
		$qryins = "Insert into auction_pause_management (referral_bids) values('1')";
		mysql_query($qryins);
		$qrysel2 = "select * from auction_pause_management where id='3'";
		$ressel2 = mysql_query($qrysel2);
	}
	$objsel2 = mysql_fetch_array($ressel2);
	
	$qrysel = "select * from auction_pause_management where id='4'";
	$ressel = mysql_query($qrysel);
	$total1 = mysql_num_rows($ressel);
	if($total1==0)
	{
		$qryins1 = "Insert into auction_pause_management (referral_bids) values('1')";
		mysql_query($qryins1);
		$qrysel = "select * from auction_pause_management where id='4'";
		$ressel = mysql_query($qrysel);
	}	
	$objsel = mysql_fetch_array($ressel);
	
	sleep(5);

	$qrysel3 = "select * from auction_pause_management where id='3'";
	$ressel3 = mysql_query($qrysel3);
	$objsel3 = mysql_fetch_array($ressel3);
	
	$oldvalue1 = $objsel2["referral_bids"];
	$newvalue1 = $objsel3["referral_bids"];

	$qrysel1 = "select * from auction_pause_management where id='4'";
	$ressel1 = mysql_query($qrysel1);
	$objsel1 = mysql_fetch_array($ressel1);
	
	$oldvalue = $objsel["referral_bids"];
	$newvalue = $objsel1["referral_bids"];
	
	if($oldvalue1==$newvalue1)
	{
		$output1 = exec("php update_butler.php >/dev/null &");
	}	

	if($oldvalue==$newvalue)
	{
		$output = exec("php update_records.php >/dev/null &");
	}	
?>
