0) ? $Size : 25; $First=(!array_key_exists('f', $_GET) || empty($_GET['f'])) ? 1 : only_digits($_GET['f'], 4); $First=(is_numeric($First) && $First>0) ? $First : 1; $ReqType=(!array_key_exists('r', $_GET) || empty($_GET['r'])) ? 'l' : chk_str($_GET['r'], 1); $ReqType=in_array($ReqType, array('c', 'e', 'l', 'n')) ? $ReqType : 'l'; $Map_BT=array('I' => 'Individual', 'G' => 'Group', 'S' => 'Steward', 'J' => 'Judge'); $BrewClub=''; $Email=''; $FullName=''; switch ($ReqType) { case 'c': if (array_key_exists('BC_LIST', $_POST) && !empty($_POST['BC_LIST'])) { $BrewClub=chk_str($_POST['BC_LIST'], 50); } break; case 'e': if (array_key_exists('MATCH', $_POST) && !empty($_POST['MATCH'])) { $Email=chk_str($_POST['MATCH'], 30); } break; case 'n': if (array_key_exists('MATCH', $_POST) && !empty($_POST['MATCH'])) { $FullName=chk_str($_POST['MATCH'], 30); } break; } list($GoodAcct, $AcctName)=chk_acct($Key,'A'); $TypeName='Brewer'; if (!$GoodAcct) { $Page='0;url=failed.php'; $First=1; $Size=25; $BrewCnt=0; } else { $Page='900;url='.($ReqType == 'c' ? 'brewclub_list' : 'amenu').'.php?k='.$Key; $query='select count(*) from '; switch ($ReqType) { case 'c': $query.='brewer where brewclub="'.$BrewClub.'"'; break; case 'e': $query.='names where email like "%'.$Email.'%"'; break; case 'n': $query.='names where fullname like "%'.$FullName.'%"'; break; case 'l': if ($Type != 'b') { $query.='brewer where assist="'.($Type == 'j' ? 'J' : 'S').'"'; $TypeName=$Type == 'j' ? 'Judge' : 'Steward'; } else { $query.='brewer'; } } $cnt_res=mysqli_query($db, $query); $cnt_row=mysqli_fetch_row($cnt_res); $BrewCnt=$cnt_row[0]; if ($ReqType != 'l') { $Size=$BrewCnt; $First=1; } elseif ($First > $BrewCnt) { $First=max(1,intval($BrewCnt / $Size) * $Size + 1); } } $AskSession=(get_ctrl('SESS-ASK') == 'Y'); $ShowPaid=(cntPayment() > 0); ?>
'."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; } ?>

0) { $list_query.=' limit '.(($First > 1) ? ($First - 1).', ' : '').$Size; } echo ''."\n"; $tab_class=' class="fixed'; if ($ReqType == 'l') { if ($Comp_Stage != 'POST') { $tab_class.='33'; } else { $tab_class.='50'; } } else { if ($Comp_Stage != 'POST') { $tab_class.='50'; } else { $tab_class=''; } } $tab_class.=(!empty($tab_class) ? '"' : ''); if ($BrewCnt == 0) { echo '

'."\n"; echo 'No '.$TypeName.'s Found
'."\n"; echo '

'."\n"; } else { echo '

'."\n"; echo $BrewCnt.' '.$TypeName.(($BrewCnt == 1) ? '' : 's')."\n"; echo '

'."\n"; echo ''."\n"; echo ''."\n"; if ($Comp_Stage != 'POST') { echo ''."\n"; } if ($ReqType == 'l') { echo ''."\n"; } echo ''."\n"; echo ''."\n"; echo '
'."\n"; if (in_array($Type, array('j', 's'))) { echo 'Add New '.$TypeName.''."\n"; } else { echo 'Add New Brewer'."\n"; } echo ''."\n"; table_nav ('brewer_list.php?k='.$Key.'&o='.$Order.'&t='.$Type.'&r='.$ReqType, $BrewCnt, $First, $Size, 10, TRUE); echo ''."\n"; echo '
'."\n"; echo 'Brewer Search: '."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; $HRef='brewer_list.php?k='.$Key.'&f='.$First.'&s='.$Size.'&t='.$Type.'&r='.$ReqType.'&o='; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; if ($ReqType != 'c') { echo ''."\n"; } if ($AskNB) { echo ''."\n"; } echo ''."\n"; echo ''."\n"; if ($AskPrefs) { echo ''."\n"; echo ''."\n"; } echo ''."\n"; } $PrefType=array(); $PrefCat=array(); $PrefSub=array(); $PrefPos=0; $brew_res=mysqli_query($db, $list_query); while ($brew_row=mysqli_fetch_assoc($brew_res)) { if ($AskSession) { $query='select count(*) from session_prefs where brewer="'.$brew_row['brewer'].'"'; $cnt_res=mysqli_query($db, $query); $cnt_row=mysqli_fetch_row($cnt_res); $SessCnt=$cnt_row[0]; } else { $SessCnt=0; } echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; if ($ReqType != 'c') { echo ''."\n"; } if ($AskNB) { echo ''."\n"; } echo ''."\n"; echo ''."\n"; if ($AskPrefs) { foreach (array(TRUE, FALSE) as $Likes) { echo ''."\n"; } } echo ''."\n"; } if ($BrewCnt != 0) { echo '
'."\n"; echo 'Brewer
Number
'."\n"; echo ''."\n"; echo '
'."\n"; echo 'Type'."\n"; echo ''."\n"; echo ''."\n"; echo 'Brewer
Name
'."\n"; echo ''."\n"; echo '
'."\n"; echo 'Email
Address
'."\n"; echo ''."\n"; echo '
'."\n"; echo 'BrewClub'."\n"; echo ''."\n"; echo ''."\n"; echo 'New
Brewer
'."\n"; echo ''."\n"; echo '
'."\n"; echo 'Assist
Offer
'."\n"; echo ''."\n"; echo '
'."\n"; echo 'Entry
Count
'."\n"; echo ''."\n"; echo '
'."\n"; echo 'Likes'."\n"; echo ''."\n"; echo 'Dislikes'."\n"; echo '
'."\n"; echo ''.$brew_row['brewer'].''."\n"; echo ''."\n"; if (array_key_exists($brew_row['brewer_type'], $Map_BT)) { echo $Map_BT[$brew_row['brewer_type']]."\n"; } else { echo 'Unknown'."\n"; } echo ''."\n"; echo safe($brew_row['fullname'])."\n"; echo ''."\n"; echo ''.safe($brew_row['email']).''."\n"; echo ''."\n"; echo ''.safe($brew_row['brewclub']).''."\n"; echo ''."\n"; if ($brew_row['brewer_type'] == 'I') { echo ($brew_row['new_brewer'] == 'Y' ? 'Yes' : 'No'); } else { echo 'N/A'; } echo "\n"; echo ''."\n"; $LowerAssist=strtolower($brew_row['assist']); echo ($LowerAssist != $Type ? '' : '').disp_assist($brew_row['assist']).($LowerAssist != $Type ? '' : ''); } } else { echo '>'."\n"; if ($brew_row['brewer_type'] == 'G') { echo '—'; } else { echo disp_assist($brew_row['assist'], TRUE); } } echo "\n"; echo ''."\n"; echo '—'."\n "; } else { $query='select count(*) from entry where brewer='.$brew_row['brewer'].' and removed="Y"'; $cnt_res=mysqli_query($db, $query); $cnt_row=mysqli_fetch_row($cnt_res); echo ' title="Active - Deleted'.($ShowPaid ? ' - Paid' : '').'">'."\n"; echo ''; echo $brew_row['ecnt'].' / '.$cnt_row[0]; echo ''; if ($ShowPaid) { echo ' / '.cntPaid($brew_row['brewer']).''; } echo "\n"; } echo ''."\n"; if ($brew_row['assist'] == 'N') { $cnt_pref=0; } else { $query='select * from style_prefs where brewer="'.$brew_row['brewer'].'" and rank'.($Likes ? '>' : '<').'0 order by rank'.($Likes ? '' : ' desc'); $pref_res=mysqli_query($db, $query); $cnt_pref=mysqli_num_rows($pref_res); } if ($cnt_pref == 0) { echo ' '."\n"; } else { echo ''."\n"; $cnt=0; while ($pref_row=mysqli_fetch_assoc($pref_res)) { ++$cnt; if ($pref_row['cat'] > 0) { ++$PrefPos; $PrefType[$PrefPos]=$pref_row['type_seq']; $PrefCat[$PrefPos]=$pref_row['cat']; $PrefSub[$PrefPos]=$pref_row['sub_cat']; } if ($cnt > 1) { echo ''."\n"; } echo ''."\n"; } while ($cnt < 3) { echo ''."\n"; echo ''."\n"; ++$cnt; } echo '
/'."\n"; echo disp_type(get_type($pref_row['type_seq'])); } else { echo '" onmouseover="showPrefStyle('.$PrefPos.')" onmouseout="hidePrefStyle()">'."\n"; if (cntEntryCat($pref_row['type_seq'], $pref_row['cat']) > 0) { echo ''.disp_cat($pref_row['type_seq'], $pref_row['cat']).''; } else { echo disp_cat($pref_row['type_seq'], $pref_row['cat']); } if (!empty($pref_row['sub_cat'])) { if (cntEntryCat($pref_row['type_seq'], $pref_row['cat'], $pref_row['sub_cat']) > 0) { echo ''.$pref_row['sub_cat'].''; } else { echo $pref_row['sub_cat']; } } echo "\n"; } echo '/ 
'."\n"; } echo '
'."\n"; } if ($BrewCnt > 10) { echo ''."\n"; echo ''."\n"; if ($Comp_Stage != 'POST') { echo ''."\n"; } if ($ReqType == 'l') { echo ''."\n"; } echo ''."\n"; echo ''."\n"; echo '
'."\n"; if (in_array($Type, array('j', 's'))) { echo 'Add New '.$TypeName.''."\n"; } else { echo 'Add New Brewer'."\n"; } echo ''."\n"; table_nav ('brewer_list.php?k='.$Key.'&o='.$Order.'&t='.$Type.'&r='.$ReqType, $BrewCnt, $First, $Size, 10, TRUE); echo ''."\n"; echo '
'."\n"; echo 'Brewer Search: '."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; } ?>
'."\n"; if ($ReqType == 'c') { echo ''."\n"; } echo ''."\n"; echo '
'."\n"; echo ''."\n"; echo '
'."\n"; if ($AskPrefs && $PrefPos > 0) { echo ''."\n"; } ?>