if ($count_cider) {
     $style_type = "Cider";
     $style_beer_count[] .= 0;
     $style_beer_count_logged[] .= 0;
     $style_mead_count[] .= 0;
     $style_mead_count_logged[] .= 0;
     $style_cider_count[] .= $row_style_count['count'];
     $style_cider_count_logged[] .= $row_style_count_logged['count'];
 }
 if ($other_count) {
     if ($row_style_type['brewStyleType'] <= 3) {
         $source = "bcoe";
     } else {
         $source = "custom";
     }
     $style_type = style_type($row_style_type['brewStyleType'], "2", $source);
     if ($style_type == "Beer") {
         $style_beer_count[] .= $row_style_count['count'];
         $style_beer_count_logged[] .= $row_style_count_logged['count'];
     } elseif ($style_type == "Mead") {
         $style_mead_count[] .= $row_style_count['count'];
         $style_mead_count_logged[] .= $row_style_count_logged['count'];
     } elseif ($style_type == "Cider") {
         $style_cider_count[] .= $row_style_count['count'];
         $style_cider_count_logged[] .= $row_style_count_logged['count'];
     } else {
         $style_other_count[] .= $row_style_count['count'];
         $style_other_count_logged[] .= $row_style_count_logged['count'];
     }
     //$style_type_array[] = $style_type;
 }
        echo "Update Accepted Style Categories";
    }
    ?>
" /></p>
<input type="hidden" name="relocate" value="<?php 
    echo relocate($_SERVER['HTTP_REFERER'], "default", $msg, $id);
    ?>
">
</form>
<?php 
}
?>

<?php 
if ($action == "add" || $action == "edit") {
    $style_type_2 = style_type($row_styles['brewStyleType'], "1", "bcoe");
    ?>

<script type='text/javascript'>//<![CDATA[ 
$(document).ready(function(){
	$("#mead-cider").hide("fast");
	$("#mead").hide("fast");
	
	<?php 
    if ($action == "edit" && $view == "2") {
        ?>
	
	$("#mead-cider").show("slow");
	$("#mead").hide("slow");
	
	<?php 
<?php

$query_scores = sprintf("SELECT scoreEntry,scorePlace,scoreType FROM {$judging_scores_db_table} WHERE eid='%s'", $row_sql['id']);
$scores = mysql_query($query_scores, $brewing) or die(mysql_error());
$row_scores = mysql_fetch_assoc($scores);
$query_flight = sprintf("SELECT * FROM {$judging_flights_db_table} WHERE flightEntryID='%s'", $row_sql['id']);
$flight = mysql_query($query_flight, $brewing) or die(mysql_error());
$row_flight = mysql_fetch_assoc($flight);
$query_bos = sprintf("SELECT scorePlace FROM {$judging_scores_bos_db_table} WHERE eid='%s'", $row_sql['id']);
$bos = mysql_query($query_bos, $brewing) or die(mysql_error());
$row_bos = mysql_fetch_assoc($bos);
$totalRows_bos = mysql_num_rows($bos);
if ($totalRows_bos > 0) {
    $bos_place = $row_bos['scorePlace'];
} else {
    $bos_place = "";
}
$style_type = style_type($row_scores['scoreType'], 2, "bcoe");
$location = explode("^", get_table_info(1, "location", $row_flight['flightTable'], "default", "default"));
$table_info = explode("^", get_table_info(1, "basic", $row_flight['flightTable'], "default", "default"));
$table_name = sprintf("%02s", $table_info[0]) . ": " . $table_info[1];
function orphan_styles()
{
    require CONFIG . 'config.php';
    if ($_SESSION['prefsStyleSet'] == "BJCP2008") {
        $end = 28;
    }
    if ($_SESSION['prefsStyleSet'] == "BJCP2015") {
        $end = 34;
    }
    $query_styles = sprintf("SELECT id,brewStyle,brewStyleType FROM %s WHERE brewStyleGroup >= %s", $prefix . "styles", $end);
    $styles = mysql_query($query_styles, $brewing) or die(mysql_error());
    $row_styles = mysql_fetch_assoc($styles);
    $totalRows_styles = mysql_num_rows($styles);
    $query_style_types = sprintf("SELECT id FROM %s WHERE styleTypeOwn = 'custom'", $prefix . "style_types");
    $style_types = mysql_query($query_style_types, $brewing) or die(mysql_error());
    $row_style_types = mysql_fetch_assoc($style_types);
    $totalRows_style_types = mysql_num_rows($style_types);
    do {
        $a[] = style_type($row_style_types['id'], "2", "bcoe");
    } while ($row_style_types = mysql_fetch_assoc($style_types));
    $return = "";
    if ($totalRows_styles > 0) {
        do {
            if (!in_array($row_styles['brewStyleType'], $a)) {
                if ($row_styles['brewStyleType'] > 3) {
                    $return .= "<p><a href='index.php?section=admin&amp;go=styles&amp;action=edit&amp;id=" . $row_styles['id'] . "'><span class='icon'><img src='" . $base_url . "images/pencil.png' alt='Edit " . $row_styles['brewStyle'] . "' title='Edit " . $row_styles['brewStyle'] . "'></span></a>" . $row_styles['brewStyle'] . "</p>";
                }
            }
        } while ($row_styles = mysql_fetch_assoc($styles));
    }
    if ($return == "") {
        $return .= "<p>All custom styles have a valid style type associated with them.</p>";
    }
    return $return;
}
<?php

$query_tables = "SELECT * FROM {$judging_tables_db_table} ORDER BY tableNumber";
$tables = mysql_query($query_tables, $brewing) or die(mysql_error());
$row_tables = mysql_fetch_assoc($tables);
$totalRows_tables = mysql_num_rows($tables);
$query_bos = "SELECT * FROM {$judging_scores_bos_db_table} ORDER BY scoreType,scorePlace ASC";
$bos = mysql_query($query_bos, $brewing) or die(mysql_error());
$row_bos = mysql_fetch_assoc($bos);
$totalRows_bos = mysql_num_rows($bos);
do {
    $query_entries = sprintf("SELECT id,brewBrewerFirstName,brewBrewerLastName,brewName,brewStyle,brewCategory,brewSubCategory FROM {$brewing_db_table} WHERE id='%s'", $row_bos['eid']);
    $entries = mysql_query($query_entries, $brewing) or die(mysql_error());
    $row_entries = mysql_fetch_assoc($entries);
    if ($row_bos['scorePlace'] != "") {
        $text = sprintf("\n%s\n%s\n%s\n%s", display_place($row_bos['scorePlace'], 1) . " - BEST IN SHOW", style_type($row_bos['scoreType'], "3", "default"), strtr($row_entries['brewBrewerFirstName'], $html_remove) . " " . strtr($row_entries['brewBrewerLastName'], $html_remove), strtr($row_entries['brewName'], $html_remove) . " - " . $row_entries['brewStyle']);
        $text = iconv('UTF-8', 'windows-1252', $text);
        $pdf->Add_Label($text);
    }
} while ($row_bos = mysql_fetch_assoc($bos));
if ($_SESSION['prefsWinnerMethod'] == "1") {
    // Output by Category
    $query_styles = sprintf("SELECT brewStyleGroup FROM %s WHERE brewStyleActive='Y' AND (brewStyleVersion='%s' OR brewStyleOwn='custom') ORDER BY brewStyleGroup ASC", $styles_db_table, $_SESSION['prefsStyleSet']);
    $styles = mysql_query($query_styles, $brewing) or die(mysql_error());
    $row_styles = mysql_fetch_assoc($styles);
    $totalRows_styles = mysql_num_rows($styles);
    do {
        $style[] = $row_styles['brewStyleGroup'];
    } while ($row_styles = mysql_fetch_assoc($styles));
    foreach (array_unique($style) as $style) {
        $query_entry_count = sprintf("SELECT COUNT(*) as 'count' FROM %s WHERE brewCategorySort='%s' AND brewReceived='1'", $brewing_db_table, $style);
" value="<?php 
                    echo $bid;
                    ?>
" />
        <input type="hidden" name="scoreTable<?php 
                    echo $score_id;
                    ?>
" value="<?php 
                    echo $id;
                    ?>
" />
        <input type="hidden" name="scoreType<?php 
                    echo $score_id;
                    ?>
" value="<?php 
                    echo style_type($score_style_data[3], "1", "bcoe");
                    ?>
" />
        <td><?php 
                    echo $entry_number;
                    ?>
</td>
        <td class="data"><?php 
                    echo $judging_number;
                    ?>
</td>
        <td class="data"><?php 
                    echo $style_display;
                    ?>
</td>
        <td class="data"><input type="checkbox" name="scoreMiniBOS<?php