<? $arrO = array();
$svoisProreti = mysql_query("SELECT * FROM `m_products` WHERE products_cat='$idpas'");
while($productAA = mysql_fetch_assoc($svoisProreti)){
$oas = unserialize($productAA['vsesvois']);
$ocatsvois = explode(",",$productAA['catsvois']);
// print_R($oas);
//echo "<hr>";
$pabl[] = $oas;
$catpabl[] = $ocatsvois;
}
// print_r($catpabl); echo "<hr>";
//print_r($pabl);
$pabl= array_map("unserialize", array_unique( array_map("serialize", $pabl) ));
echo "<hr>";
foreach ($pabl as $key1 => &$level1) {
foreach ($level1 as $key2 => &$val1) {
foreach ($pabl as $key21 => &$level2) {
foreach ($level2 as $key22 => &$val2) {
if ($val1 == $val2 && ($key1 != $key21 || ($key1 == $key21 && $key2 != $key22))) {
unset($pabl[$key21][$key22]);
}
if (!count($pabl[$key21])) {
unset($pabl[$key21]);
}
}
}
}
}
$arrOut = array();
$pop = array();
foreach($catpabl as $subArr){
$arrOut = array_merge($arrOut,array_values($subArr));
}
$rd = array_unique($arrOut);
?>
<div class="BlockFiltr">
<? foreach ($rd as $pf){
$sqlv = mysql_query("SELECT * FROM `mn_prop` WHERE id='$pf'");
while($sl = mysql_fetch_assoc($sqlv)){
?>
<div class="NameFiltr"> <? echo $sl['name']; ?></div>
<? foreach($pabl as $seubArr){ ?>
<div class="FormFiltr" >
<? if($sl['func']==1){
$textv = "select_".$sl['id'];
$resHar = mysql_fetch_assoc(mysql_query("SELECT * FROM `mn_prop_svois` WHERE id='".$seubArr[$textv]."'"));
echo $resHar['name'];
} ?>
<? if($sl['func']==2){
$idS = "select_".$sl['id'];
$fdsa[] = $seubArr[$idS];
foreach ($seubArr[$idS] as $val) {
$resHard = mysql_fetch_assoc(mysql_query("SELECT * FROM `mn_prop_svois` WHERE id='".$val."'"));
//echo $resHard['name']."<br>";
$rpop = explode(" ", $resHard['name']);
$pui[] = $rpop; }
$arrka = array();
foreach($pui as $subArr){
$arrka = array_merge($arrka,$subArr);
}
print_R($arrka[(count($arrka)-1)]);
//print_r($opana) ."<br>";
} ?>
<? if($sl['func']==3){} ?>
<? if($sl['func']==4){} ?>
</div>
<? } } } ?>