<?
$arr_sort=array("id", "id DESC", "tel", "tel DESC", "f_cena_", "f_cena_ DESC", "contakt", "contakt DESC");
shuffle($arr_sort);

$zapros_razdel = " razdel_".($posled_field_razdel-1)." = '".$tree_cat[$posled_field_razdel]."' ";
$zapros_razdel_2 = $zapros_razdel;
//if($real_param) $zapros_razdel = " ".$real_param." = '".$real_param_value."' ";

//$zapros_region = " AND region_".($real_region_tree-1)." = '".$id_region."' ";


$r1=mysql_query("SELECT id, zag, zag_url, f_cena_, small, opis FROM board WHERE ".$zapros_razdel.$zapros_region." AND id_akk ='".$rr['id_akk']."' AND id !='".$rr['id']."' ORDER BY ".$arr_sort[0]." LIMIT 5");

$nr1=mysql_num_rows($r1);
if($nr1)
	{
	echo '<p><b>Другие объявления магазина: </b></p>';
	echo '<table  width=100%><tr>';
	while($rr1=mysql_fetch_array($r1))
		{
		$titt=explode("<hr>", $rr1['opis']);
		if($titt[1])
		$tit='title="'.obrez(str_replace("\n"," ", $titt[1]), 200).'"'; else $tit='';

		echo '<td width=20% align=center valign=top>';
		if($rr1['small'])
		echo '<a href="'.$bp.'items/'.$rr1['zag_url'].'_'.$rr1['id'].'" ><img class="imground" src="'.$bp.$rr1['small'].'" border=0></a><br>';
		else
		echo '<table ><tr><td align=center valign=middle height="'.$rru['r_foto_mini'].'" width="'.$rru['r_foto_mini'].'" class="tbl"><img src="'.$bp.'icon/ok3.png" border=0></td></tr></table>';
		echo '<a '.$tit.' href="'.$bp.'items/'.$rr1['zag_url'].'_'.$rr1['id'].'" >'.$rr1['zag'].'</a><br>';
		if($rr1['f_cena_'])
		echo _font($rr1['f_cena_'],1).' руб.';
		}
	echo '</table><p>';
	}
mysql_free_result($r1);


?>
