Skip to content

Commit

Permalink
Fix 2.6.2 Bugs
Browse files Browse the repository at this point in the history
Archive winner display. Best Brewer display.
  • Loading branch information
geoffhumphrey committed Nov 13, 2023
1 parent e99703c commit 3895505
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 59 deletions.
5 changes: 4 additions & 1 deletion awards.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@
else $style_display = $style.": ".$row_scores['brewStyle'];

// Name Display
if ($_SESSION['prefsProEdition'] == 1) $brewer_name = $row_scores['brewerBreweryName'];
if ($_SESSION['prefsProEdition'] == 1) {
if (empty($row_scores['brewerBreweryName'])) $brewer_name = $row_scores['brewerFirstName']." ".$row_scores['brewerLastName'];
else $brewer_name = $row_scores['brewerBreweryName'];
}
else $brewer_name = $row_scores['brewerFirstName']." ".$row_scores['brewerLastName'];

$brewer_club = "";
Expand Down
10 changes: 5 additions & 5 deletions includes/db/scores.db.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
}

// Display by Table
if ($winner_method == 0) $query_scores = sprintf("SELECT a.scorePlace, a.scoreEntry, b.id, b.brewName, b.brewCategory, b.brewCategorySort, b.brewSubCategory, b.brewStyle, b.brewCoBrewer, b.brewInfo, c.brewerLastName, c.brewerFirstName, c.brewerBreweryName, c.brewerClubs, c.brewerMHP FROM %s a, %s b, %s c WHERE a.scoreTable='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $row_tables['id']);
if ($winner_method == 0) $query_scores = sprintf("SELECT * FROM %s a, %s b, %s c WHERE a.scoreTable='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $row_tables['id']);

// Display by Category
if ($winner_method == 1) {

if ($style_set == "BA") $query_scores = sprintf("SELECT a.scorePlace, a.scoreEntry, b.brewName, b.brewCategory, b.brewCategorySort, b.brewSubCategory, b.brewStyle, b.brewCoBrewer, b.brewInfo, c.brewerLastName, c.brewerFirstName, c.brewerBreweryName, c.brewerClubs, c.brewerMHP FROM %s a, %s b, %s c WHERE b.brewCategory='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style);
if ($style_set == "BA") $query_scores = sprintf("SELECT * FROM %s a, %s b, %s c WHERE b.brewCategory='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style);

else $query_scores = sprintf("SELECT a.scorePlace, a.scoreEntry, b.id, b.brewName, b.brewCategory, b.brewCategorySort, b.brewSubCategory, b.brewStyle, b.brewCoBrewer, b.brewInfo, c.brewerLastName, c.brewerFirstName, c.brewerBreweryName, c.brewerClubs, c.brewerMHP FROM %s a, %s b, %s c WHERE b.brewCategorySort='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style_pad);
else $query_scores = sprintf("SELECT * FROM %s a, %s b, %s c WHERE b.brewCategorySort='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style_pad);

}

// Display by Subcategory
if ($winner_method == 2) {

if ($style_set == "BA") $query_scores = sprintf("SELECT a.scorePlace, a.scoreEntry, b.brewName, b.brewCategory, b.brewCategorySort, b.brewSubCategory, b.brewStyle, b.brewCoBrewer, b.brewInfo, c.brewerLastName, c.brewerFirstName, c.brewerBreweryName, c.brewerClubs, c.brewerMHP FROM %s a, %s b, %s c WHERE b.brewSubCategory='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style[1]);
if ($style_set == "BA") $query_scores = sprintf("SELECT * FROM %s a, %s b, %s c WHERE b.brewSubCategory='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style[1]);

else $query_scores = sprintf("SELECT a.scorePlace, a.scoreEntry, b.id, b.brewName, b.brewCategory, b.brewCategorySort, b.brewSubCategory, b.brewStyle, b.brewCoBrewer, b.brewInfo, c.brewerLastName, c.brewerFirstName, c.brewerBreweryName, c.brewerClubs, c.brewerMHP FROM %s a, %s b, %s c WHERE b.brewCategorySort='%s' AND b.brewSubCategory='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style[0], $style[1]);
else $query_scores = sprintf("SELECT * FROM %s a, %s b, %s c WHERE b.brewCategorySort='%s' AND b.brewSubCategory='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style[0], $style[1]);

}

Expand Down
4 changes: 0 additions & 4 deletions sections/bestbrewer.sec.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,12 +591,8 @@
echo "</p>";
}
*/

echo $club_points_show;


?>
<div class="bcoem-winner-table">
<?php echo $header1_1; ?>
Expand Down
2 changes: 1 addition & 1 deletion sections/brewer.sec.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@

}

if (($_SESSION['prefsProEdition'] == 1) && (!$show_judge_steward_fields)) $pro_entrant = TRUE;
if (($_SESSION['prefsProEdition'] == 1) && ((!$show_judge_steward_fields) || ($go == "admin"))) $pro_entrant = TRUE;

// Build drop-off select element
$dropoff_select = "";
Expand Down
2 changes: 0 additions & 2 deletions sections/brewer_entries.sec.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
/**
* Module: brewer_entries.sec.php
* Description: This module displays the user's entries and related data
* Info: As of version 1.3.0, most of the presentation layer has been separated from the programming layer
*
*
*/

Expand Down
7 changes: 5 additions & 2 deletions sections/winners.sec.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,13 @@
}

$winners_table_body_1 .= "<td>";
if ($_SESSION['prefsProEdition'] == 1) $winners_table_body_1 .= $row_scores['brewerBreweryName'];
if ($_SESSION['prefsProEdition'] == 1) {
if (empty($row_scores['brewerBreweryName'])) $winners_table_body_1 .= $row_scores['brewerFirstName']." ".$row_scores['brewerLastName'];
else $winners_table_body_1 .= $row_scores['brewerBreweryName'];
}
else {
$winners_table_body_1 .= $row_scores['brewerFirstName']." ".$row_scores['brewerLastName'];
if (!empty($row_scores['brewerMHP'])) $winners_table_body_1 .= " <span data-toggle=\"tooltip\" data-placement=\"top\" title=\"Master Homebrewer Program Participant\" style=\"color: #F2D06C; background-color: #000;\" class=\"badge\">MHP</span>";
if ((isset($row_scores['brewerMHP'])) && (!empty($row_scores['brewerMHP']))) $winners_table_body_1 .= " <span data-toggle=\"tooltip\" data-placement=\"top\" title=\"Master Homebrewer Program Participant\" style=\"color: #F2D06C; background-color: #000;\" class=\"badge\">MHP</span>";
}
if (($_SESSION['prefsProEdition'] == 0) && (!empty($row_scores['brewCoBrewer'])) && ($row_scores['brewCoBrewer'] != " ")) $winners_table_body_1 .= "<br>".$label_cobrewer.": ".$row_scores['brewCoBrewer'];
$winners_table_body_1 .= "</td>";
Expand Down
7 changes: 5 additions & 2 deletions sections/winners_category.sec.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@
}

$table_body1 .= "<td width=\"25%\">";
if ($_SESSION['prefsProEdition'] == 1) $table_body1 .= $row_scores['brewerBreweryName'];
if ($_SESSION['prefsProEdition'] == 1) {
if (empty($row_scores['brewerBreweryName'])) $table_body1 .= $row_scores['brewerFirstName']." ".$row_scores['brewerLastName'];
else $table_body1 .= $row_scores['brewerBreweryName'];
}
else {
$table_body1 .= $row_scores['brewerFirstName']." ".$row_scores['brewerLastName'];
if (!empty($row_scores['brewerMHP'])) $table_body1 .= " <span data-toggle=\"tooltip\" data-placement=\"top\" title=\"Master Homebrewer Program Participant\" style=\"color: #F2D06C; background-color: #000;\" class=\"badge\">MHP</span>";
if ((isset($row_scores['brewerMHP'])) && (!empty($row_scores['brewerMHP']))) $table_body1 .= " <span data-toggle=\"tooltip\" data-placement=\"top\" title=\"Master Homebrewer Program Participant\" style=\"color: #F2D06C; background-color: #000;\" class=\"badge\">MHP</span>";
}
if (($_SESSION['prefsProEdition'] == 0) && (!empty($row_scores['brewCoBrewer'])) && ($row_scores['brewCoBrewer'] != " ")) $table_body1 .= "<br>".$label_cobrewer.": ".$row_scores['brewCoBrewer'];
$table_body1 .= "</td>";
Expand Down
52 changes: 10 additions & 42 deletions sections/winners_subcategory.sec.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,6 @@
*
*/


/* ---------------- PUBLIC Pages Rebuild Info ---------------------
Beginning with the 1.3.0 release, an effort was begun to separate the programming
layer from the presentation layer for all scripts with this header.
All Public pages have certain variables in common that build the page:
$primary_page_info = any information related to the page
$header1_X = an <h2> header on the page
$header2_X = an <h3> subheader on the page
$page_infoX = the bulk of the information on the page.
$print_page_link = the "Print This Page" link
$competition_logo = display of the competition's logo
$labelX = the various labels in a table or on a form
$table_headX = all table headers (column names)
$table_bodyX = table body info
$messageX = various messages to display
$print_page_link = "<p><span class='icon'><img src='".$base_url."images/printer.png' border='0' alt='Print' title='Print' /></span><a id='modal_window_link' href='".$base_url."output/print.php?section=".$section."&amp;action=print' title='Print'>Print This Page</a></p>";
$competition_logo = "<img src='".$base_url."user_images/".$_SESSION['contestLogo']."' width='".$_SESSION['prefsCompLogoSize']."' style='float:right; padding: 5px 0 5px 5px' alt='Competition Logo' title='Competition Logo' />";
Declare all variables empty at the top of the script. Add on later...
$primary_page_info = "";
$header1_1 = "";
$page_info1 = "";
$header1_2 = "";
$page_info2 = "";
$table_head1 = "";
$table_body1 = "";
etc., etc., etc.
* ---------------- END Rebuild Info --------------------- */

if ($row_scored_entries['count'] > 0) {

$category_end = $_SESSION['style_set_category_end'];
Expand Down Expand Up @@ -134,14 +95,21 @@
$table_body1 .= display_place($row_scores['scorePlace'],2);
$table_body1 .= "</td>";
}

$table_body1 .= "<td width=\"25%\">";
if ($_SESSION['prefsProEdition'] == 1) $table_body1 .= $row_scores['brewerBreweryName'];

if ($_SESSION['prefsProEdition'] == 1) {
if (empty($row_scores['brewerBreweryName'])) $table_body1 .= $row_scores['brewerFirstName']." ".$row_scores['brewerLastName'];
else $table_body1 .= $row_scores['brewerBreweryName'];
}

else {
$table_body1 .= $row_scores['brewerFirstName']." ".$row_scores['brewerLastName'];
if (!empty($row_scores['brewerMHP'])) $table_body1 .= " <span data-toggle=\"tooltip\" data-placement=\"top\" title=\"Master Homebrewer Program Participant\" style=\"color: #F2D06C; background-color: #000;\" class=\"badge\">MHP</span>";
if ((isset($row_scores['brewerMHP'])) && (!empty($row_scores['brewerMHP']))) $table_body1 .= " <span data-toggle=\"tooltip\" data-placement=\"top\" title=\"Master Homebrewer Program Participant\" style=\"color: #F2D06C; background-color: #000;\" class=\"badge\">MHP</span>";
}

if (($_SESSION['prefsProEdition'] == 0) && (!empty($row_scores['brewCoBrewer'])) && ($row_scores['brewCoBrewer'] != " ")) $table_body1 .= "<br>".$label_cobrewer.": ".$row_scores['brewCoBrewer'];

$table_body1 .= "</td>";

$table_body1 .= "<td>";
Expand Down

0 comments on commit 3895505

Please sign in to comment.