<?php
//
if(@$city != "")
{
	$resultrotation = mysql_query("SELECT * FROM screen WHERE city = '$city' AND hidden_status = 1 ORDER by id DESC", $db);
	if($myrowtrotation = mysql_fetch_array($resultrotation))
	{
		$bannertotal = mysql_num_rows($resultrotation);
		// random
		$imagefrom = 1;
		$imageto = $bannertotal;
		$rand = rand($imagefrom, $imageto);
		//
		$bctotal = 1;
		do
		{
			if($rand == $bctotal)
			{
				
				$btitle = $myrowtrotation['title'.$lang];
				$btext = $myrowtrotation['text'.$lang];
				$bimg = $photo_path.$myrowtrotation['img1'];
			}
			$bctotal = $bctotal + 1;
		}
		while($myrowtrotation = mysql_fetch_array($resultrotation));
	}
}
//
if(file_exists(@$bimg))
{
	list($iwidth, $iheight, $type, $iattr) = getimagesize($bimg);
	//
	echo(' style="background-image: url(\''.$bimg.'\'); background-repeat: no-repeat;" ');
}
else
{
	//
	echo(' style="background-image: url(\'img/rotate/1.jpg\'); background-repeat: no-repeat;" ');
}
?>