From 38955052cf1960fab735566f8dc814088bfb666b Mon Sep 17 00:00:00 2001
From: Geoff Humphrey
Date: Mon, 13 Nov 2023 14:54:12 -0700
Subject: [PATCH] Fix 2.6.2 Bugs
Archive winner display. Best Brewer display.
---
awards.php | 5 ++-
includes/db/scores.db.php | 10 +++---
sections/bestbrewer.sec.php | 4 ---
sections/brewer.sec.php | 2 +-
sections/brewer_entries.sec.php | 2 --
sections/winners.sec.php | 7 ++--
sections/winners_category.sec.php | 7 ++--
sections/winners_subcategory.sec.php | 52 ++++++----------------------
8 files changed, 30 insertions(+), 59 deletions(-)
diff --git a/awards.php b/awards.php
index 93fa18ef..60ba8d9a 100644
--- a/awards.php
+++ b/awards.php
@@ -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 = "";
diff --git a/includes/db/scores.db.php b/includes/db/scores.db.php
index 96c059ad..f2b5784a 100644
--- a/includes/db/scores.db.php
+++ b/includes/db/scores.db.php
@@ -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]);
}
diff --git a/sections/bestbrewer.sec.php b/sections/bestbrewer.sec.php
index a88382c1..60b7ad25 100644
--- a/sections/bestbrewer.sec.php
+++ b/sections/bestbrewer.sec.php
@@ -591,12 +591,8 @@
echo "
";
}
-
*/
-echo $club_points_show;
-
-
?>
diff --git a/sections/brewer.sec.php b/sections/brewer.sec.php
index e85c2f01..4f83a1c7 100644
--- a/sections/brewer.sec.php
+++ b/sections/brewer.sec.php
@@ -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 = "";
diff --git a/sections/brewer_entries.sec.php b/sections/brewer_entries.sec.php
index e30927ca..bdcb1f1c 100644
--- a/sections/brewer_entries.sec.php
+++ b/sections/brewer_entries.sec.php
@@ -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
- *
*
*/
diff --git a/sections/winners.sec.php b/sections/winners.sec.php
index 8c3f7c6e..e37bc6cc 100644
--- a/sections/winners.sec.php
+++ b/sections/winners.sec.php
@@ -120,10 +120,13 @@
}
$winners_table_body_1 .= "
";
- 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 .= " MHP";
+ if ((isset($row_scores['brewerMHP'])) && (!empty($row_scores['brewerMHP']))) $winners_table_body_1 .= " MHP";
}
if (($_SESSION['prefsProEdition'] == 0) && (!empty($row_scores['brewCoBrewer'])) && ($row_scores['brewCoBrewer'] != " ")) $winners_table_body_1 .= " ".$label_cobrewer.": ".$row_scores['brewCoBrewer'];
$winners_table_body_1 .= " | ";
diff --git a/sections/winners_category.sec.php b/sections/winners_category.sec.php
index d8a1cc7a..5801fc77 100644
--- a/sections/winners_category.sec.php
+++ b/sections/winners_category.sec.php
@@ -84,10 +84,13 @@
}
$table_body1 .= "
";
- 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 .= " MHP";
+ if ((isset($row_scores['brewerMHP'])) && (!empty($row_scores['brewerMHP']))) $table_body1 .= " MHP";
}
if (($_SESSION['prefsProEdition'] == 0) && (!empty($row_scores['brewCoBrewer'])) && ($row_scores['brewCoBrewer'] != " ")) $table_body1 .= " ".$label_cobrewer.": ".$row_scores['brewCoBrewer'];
$table_body1 .= " | ";
diff --git a/sections/winners_subcategory.sec.php b/sections/winners_subcategory.sec.php
index 02f06f93..6a851fe0 100644
--- a/sections/winners_subcategory.sec.php
+++ b/sections/winners_subcategory.sec.php
@@ -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
header on the page
- $header2_X = an 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 = "
Print This Page
";
- $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'];
@@ -134,14 +95,21 @@
$table_body1 .= display_place($row_scores['scorePlace'],2);
$table_body1 .= "";
}
-
+
$table_body1 .= "
";
- 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 .= " MHP";
+ if ((isset($row_scores['brewerMHP'])) && (!empty($row_scores['brewerMHP']))) $table_body1 .= " MHP";
}
+
if (($_SESSION['prefsProEdition'] == 0) && (!empty($row_scores['brewCoBrewer'])) && ($row_scores['brewCoBrewer'] != " ")) $table_body1 .= " ".$label_cobrewer.": ".$row_scores['brewCoBrewer'];
+
$table_body1 .= " | ";
$table_body1 .= "
";
|