0) { $Stage=4; $Focus='SUB3'; } else { $Stage=5; $Focus='SUBMIT'; } } elseif (!empty($prefs['TC2'])) { $Stage=3; $Focus=(substr($prefs['TC2'], -1) != ':' && cntSubCat($prefs['TYPE_SEQ2'], $prefs['CAT2']) > 0 && empty($prefs['SUB2'])) ? 'SUB2' : 'TC3'; } elseif (!empty($prefs['TC1'])) { $Stage=2; $Focus=(substr($prefs['TC1'], -1) != ':' && cntSubCat($prefs['TYPE_SEQ1'], $prefs['CAT1']) > 0 && empty($prefs['SUB1'])) ? 'SUB1' : 'TC2'; } else { $Stage=1; $Focus='TC1'; } // // Look at other type of preferences // $OtherTC=array(); $OtherSub=array(); foreach (($IsLikes ? array(-1, -2, -3) : $A123) as $Rank) { $AbsRank=abs($Rank); $query='select * from style_prefs where brewer="'.$BrewerNo.'" and rank="'.$Rank.'"'; $rank_res=mysqli_query($db, $query); if (mysqli_num_rows($rank_res) > 0) { $rank_row=mysqli_fetch_assoc($rank_res); $OtherTC[$AbsRank]=$rank_row['type_seq'].':'.(!empty($rank_row['cat']) ? $rank_row['cat'] : ''); $OtherSub[$AbsRank]=$rank_row['sub_cat']; } } // // Look at Entries // $Entry_SubSet=array(); $EntryTC=array(); $EntrySubs=array(); if ($IsLikes) { $query='select type_seq, cat, sub_cat from entry where brewer="'.$BrewerNo.'" and removed!="Y"'; $entry_res=mysqli_query($db, $query); while ($entry_row = mysqli_fetch_assoc($entry_res)) { $TC=$entry_row['type_seq'].':'.$entry_row['cat']; if (!empty($entry_row['sub_cat'])) { if (!array_key_exists($TC, $Entry_SubSet)) { $Entry_SubSet[$TC]='"'.$entry_row['sub_cat'].'"'; } else { $Entry_SubSet[$TC].=', "'.$entry_row['sub_cat'].'"'; } } if (!array_key_exists($TC, $EntrySubs)) { $EntrySubs[$TC]=array(); } $EntrySubs[$TC][]=$entry_row['sub_cat']; } foreach ($EntrySubs as $ChkTC => $ChkSub) { list($ChkTypeSeq, $ChkCat)=explode(':', $ChkTC); if (count($ChkSub) >= cntSubCat($ChkTypeSeq, $ChkCat)) { $EntryTC[]=$ChkTC; } if (!in_array($ChkTypeSeq.':', $EntryTC)) { $EntryTC[]=$ChkTypeSeq.':'; } } } ?>
0 ? 'EP' : '').($IsLikes ? 'X' : 'W'), $Key, $BrewerNo); ?>

'."\n" : ''); ?> $ChkSub) { if (!empty($ChkSub)) { list($ChkTypeSeq, $ChkCat)=explode(':', $ChkTC); $query='select count(*) from style_sub where sg="'.$Comp_SG.'" and type_seq="'.$ChkTypeSeq.'" and cat="'.$ChkCat.'" and sub_cat not in ('.$ChkSub.')'; $chk_res=mysqli_query($db, $query); $chk_row=mysqli_fetch_row($chk_res); if ($chk_row[0] == 0 && !in_array($TC, $Used)) { $Used[]=$ChkTC; } } } echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; if (substr($prefs['TC'.$Level], -1) != ':' && cntSubCat($prefs['TYPE_SEQ'.$Level], $prefs['CAT'.$Level]) > 0) { $Used=array_key_exists($prefs['TC'.$Level], $EntrySubs) ? $EntrySubs[$prefs['TC'.$Level]] : array(); foreach ($A123 as $Chk) { if (!empty($OtherSub[$Chk]) && $OtherTC[$Chk] == $prefs['TC'.$Level]) { $Used[]=$OtherSub[$Chk]; } } foreach ($A123 as $ChkLevel) { if ($ChkLevel == $Level) { continue; } if (!empty($prefs['SUB'.$ChkLevel]) && $prefs['TC'.$ChkLevel] == $prefs['TC'.$Level]) { $Used[]=$prefs['SUB'.$ChkLevel]; } } echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; } else { $prefs['SUB'.$Level]=''; } Conflict($Level); if ($Level < 3) { echo ''."\n"; echo ''."\n"; echo ''."\n"; } } ?>
'."\n"; echo disp_ordinal($Level).' '.disp_ld($IsLikes).' Category'."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; echo disp_ordinal($Level).' '.disp_ld($IsLikes).' Sub-Category'; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; echo ' '."\n"; echo '

'."\n"; echo ''."\n"; echo ''."\n"; } ?>