- Print
- - PDF
+ - PDF
- XML
diff --git a/admin/entries.admin.php b/admin/entries.admin.php
index 2a7c9c96..9285f233 100644
--- a/admin/entries.admin.php
+++ b/admin/entries.admin.php
@@ -268,7 +268,7 @@
$entry_actions .= " ";
$entry_actions .= " ";
$entry_actions .= " ";
- $entry_actions .= " ";
+ $entry_actions .= " ";
}
$scoresheet_link_1 = "";
@@ -286,7 +286,7 @@
$scoresheet_random_file_relative_1 = "user_temp/".$random_file_name_1;
$scoresheet_random_file_1 = USER_TEMP.$random_file_name_1;
$scoresheet_random_file_html_1 = $base_url.$scoresheet_random_file_relative_1;
- $scoresheet_link_1 .= "",$brewer_entries_text_006);
+ $scoresheet_link_1 .= " ";
+ }
+
+ if ((!empty($scoresheet_file_name_2)) && ($scoresheet_judging)) {
+
+ // The pseudo-random number and the corresponding name of the temporary file are defined each time
+ // this brewer_entries.sec.php script is accessed (or refreshed), but the temporary file is created
+ // only when the entrant clicks on the gavel icon to access the scoresheet.
+
+ $random_num_str_2 = random_generator(8,2);
+ $random_file_name_2 = $random_num_str_2.".pdf";
+ $scoresheet_random_file_relative_2 = "user_temp/".$random_file_name_2;
+ $scoresheet_random_file_2 = USER_TEMP.$random_file_name_2;
+ $scoresheet_random_file_html_2 = $base_url.$scoresheet_random_file_relative_2;
+
+ $scoresheet_link_2 .= "",$brewer_entries_text_006);
+ $scoresheet_link_2 .= " ";
+ }
+
+ // Clean up temporary scoresheets created for other brewers, when they are at least 1 minute old (just to avoid problems when two entrants try accessing their scoresheets at practically the same time, and clean up previously created scoresheets for the same brewer, regardless of how old they are.
+ $tempfiles = array_diff(scandir(USER_TEMP), array('..', '.'));
+
+ if (is_array($tempfiles)) {
+ foreach ($tempfiles as $file) {
+ if ((filectime(USER_TEMP.$file) < time() - 1*60) || ((strpos($file, $scoresheet_file_name_judging) !== FALSE))) {
+ unlink(USER_TEMP.$file);
+ }
+
+ if ((filectime(USER_TEMP.$file) < time() - 1*60) || ((strpos($file, $scoresheet_file_name_entry) !== FALSE))) {
+ unlink(USER_TEMP.$file);
+ }
+ }
+ }
+
+ if ((($dbTable == "default") && ($_SESSION['prefsDisplaySpecial'] == "E")) || ($dbTable != "default")) $entry_actions = $scoresheet_link_1;
+ if ((($dbTable == "default") && ($_SESSION['prefsDisplaySpecial'] == "J")) || ($dbTable != "default")) $entry_actions = $scoresheet_link_2;
+ }
+
?>
|
@@ -221,9 +335,7 @@
|
|
-
-
- |
+ |
";
if (strpos($brewer_assignment,'Judge') !== false) {
- $output_datatables_view_link = " ";
+ $output_datatables_view_link = " ";
}
else $output_datatables_view_link = "";
$output_datatables_other_link2 = build_action_link("fa-user",$base_url,"user","default","username","admin",$row_brewer['uid'],"default","default",0,"Change ".$brewer_tooltip_display_name."’s email address");
- $output_datatables_email_link .= "";
+ $output_datatables_email_link .= "";
if ($us_phone) {
- $output_datatables_phone_link = "";
+ $output_datatables_phone_link = "";
}
else {
- $output_datatables_phone_link = "";
+ $output_datatables_phone_link = "";
}
$output_datatables_user_question_link = "";
diff --git a/admin/upload.admin.php b/admin/upload.admin.php
index e348e7b5..1d4febd2 100644
--- a/admin/upload.admin.php
+++ b/admin/upload.admin.php
@@ -71,7 +71,7 @@
while ($file = readdir($handle)) {
if(!is_dir($file) && !is_link($file)) {
$filelist .= "\n";
- $filelist .= "".$file." | \n";
+ $filelist .= "".$file." | \n";
$filelist .= "".date("l, F j, Y H:i", filemtime($upload_dir.$file))." | \n";
$filelist .= " | \n";
$filelist .= "
\n";
diff --git a/admin/upload_scoresheets.admin.php b/admin/upload_scoresheets.admin.php
index de2821e4..b7d9923c 100644
--- a/admin/upload_scoresheets.admin.php
+++ b/admin/upload_scoresheets.admin.php
@@ -131,7 +131,7 @@
$scoresheet_random_file = USER_TEMP.$random_file_name;
$scoresheet_random_file_html = $base_url.$scoresheet_random_file_relative;
$scoresheet_link = "";
- $scoresheet_link .= "".$scoresheet_file_name."";
diff --git a/includes/current_version.inc.php b/includes/current_version.inc.php
index 59b33a63..3db0e62d 100644
--- a/includes/current_version.inc.php
+++ b/includes/current_version.inc.php
@@ -1,16 +1,16 @@
0) $query_check .= " AND brewUpdated < DATE_SUB( NOW(), INTERVAL 1 DAY)";
- $check = mysqli_query($connection,$query_check) or die (mysqli_error($connection));
- $row_check = mysqli_fetch_assoc($check);
-
- do { $a[] = $row_check['id']; } while ($row_check = mysqli_fetch_assoc($check));
-
- foreach ($a as $id) {
- $deleteSQL = sprintf("DELETE FROM %s WHERE id='%s'", $prefix."brewing", $id);
- mysqli_real_escape_string($connection,$deleteSQL);
- $result = mysqli_query($connection,$deleteSQL) or die (mysqli_error($connection));
- }
- }
-
- if ($type == "special") {
- $query_check = sprintf("SELECT a.id, a.brewUpdated, a.brewInfo, a.brewCategorySort, a.brewSubCategory FROM %s as a, %s as b WHERE a.brewCategorySort=b.brewStyleGroup AND a.brewSubCategory=b.brewStyleNum AND b.brewStyleReqSpec=1 AND (a.brewInfo IS NULL OR a.brewInfo='') AND b.brewStyleVersion = '%s'", $prefix."brewing",$prefix."styles",$_SESSION['prefsStyleSet']);
- if ($interval > 0) $query_check .=" AND a.brewUpdated < DATE_SUB( NOW(), INTERVAL 1 DAY)";
-
- $check = mysqli_query($connection,$query_check) or die (mysqli_error($connection));
- $row_check = mysqli_fetch_assoc($check);
-
- do {
-
- $deleteSQL = sprintf("DELETE FROM %s WHERE id='%s'", $prefix."brewing", $row_check['id']);
- mysqli_real_escape_string($connection,$deleteSQL);
- $result = mysqli_query($connection,$deleteSQL) or die (mysqli_error($connection));
-
- } while ($row_check = mysqli_fetch_assoc($check));
- }
-}
-*/
-
-function generate_judging_numbers($brewing_db_table,$method) {
-
- require(CONFIG.'config.php');
- mysqli_select_db($connection,$database);
-
- // Clear out all current judging numbers
- $updateSQL = sprintf("UPDATE %s SET brewJudgingNumber=NULL", $brewing_db_table);
- mysqli_real_escape_string($connection,$updateSQL);
- $result = mysqli_query($connection,$updateSQL) or die (mysqli_error($connection));
-
- $query_judging_numbers = sprintf("SELECT id,brewCategory,brewName FROM %s", $brewing_db_table);
- $judging_numbers = mysqli_query($connection,$query_judging_numbers) or die (mysqli_error($connection));
- $row_judging_numbers = mysqli_fetch_assoc($judging_numbers);
-
- if ($method == "default") {
-
- $files = array_slice(scandir(USER_DOCS), 2);
-
- do {
-
- $judging_number_looper = TRUE;
-
- while($judging_number_looper) {
-
- $generated_judging_number = generate_judging_num(1,"default");
- $scoresheet_file_name_judging = $generated_judging_number.".pdf";
-
- if (!in_array($scoresheet_file_name_judging,$files)) {
- $brewJudgingNumber = $generated_judging_number;
- $updateSQL = sprintf("UPDATE %s SET brewJudgingNumber=%s WHERE id=%s",
- $brewing_db_table,
- GetSQLValueString($brewJudgingNumber, "text"),
- GetSQLValueString($row_judging_numbers['id'], "text"));
-
- mysqli_real_escape_string($connection,$updateSQL);
- $result = mysqli_query($connection,$updateSQL) or die (mysqli_error($connection));
-
- $judging_number_looper = FALSE;
- }
- else {
- $judging_number_looper = TRUE;
- }
- }
- } while ($row_judging_numbers = mysqli_fetch_assoc($judging_numbers));
- }
-
- if ($method == "identical") {
- do {
- $j_num = sprintf("%06s",$row_judging_numbers['id']);
- $updateSQL = sprintf("UPDATE %s SET brewJudgingNumber=%s WHERE id=%s",
- $brewing_db_table,
- GetSQLValueString($j_num, "text"),
- GetSQLValueString($row_judging_numbers['id'], "text"));
- mysqli_real_escape_string($connection,$updateSQL);
- $result = mysqli_query($connection,$updateSQL) or die (mysqli_error($connection));
- } while ($row_judging_numbers = mysqli_fetch_assoc($judging_numbers));
- }
-
- if ($method == "legacy") {
- do {
- $updateSQL = sprintf("UPDATE %s SET brewJudgingNumber=%s WHERE id=%s",
- $brewing_db_table,
- GetSQLValueString(generate_judging_num(2,$row_judging_numbers['brewCategory']), "text"),
- GetSQLValueString($row_judging_numbers['id'], "text"));
- mysqli_real_escape_string($connection,$updateSQL);
- $result = mysqli_query($connection,$updateSQL) or die (mysqli_error($connection));
- } while ($row_judging_numbers = mysqli_fetch_assoc($judging_numbers));
- }
-}
-
-function check_sweetness($style,$styleSet) {
-
- include (CONFIG.'config.php');
- mysqli_select_db($connection,$database);
-
- $style_explodies = explode("-",$style);
-
- if (preg_match("/^[[:digit:]]+$/",$style_explodies[0])) $style_0 = sprintf('%02d',$style_explodies[0]);
- else $style_0 = $style_explodies[0];
-
- $query_brews = sprintf("SELECT brewStyleSweet FROM %s WHERE brewStyleGroup='%s' AND brewStyleNum='%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')", $prefix."styles", $style_0, $style_explodies[1], $_SESSION['prefsStyleSet']);
- $brews = mysqli_query($connection,$query_brews) or die (mysqli_error($connection));
- $row_brews = mysqli_fetch_assoc($brews);
-
- if ($row_brews['brewStyleSweet'] == 1) return TRUE;
- else return FALSE;
-
-}
-
-
-function check_carb($style,$styleSet) {
-
- include (CONFIG.'config.php');
- mysqli_select_db($connection,$database);
-
- $style_explodies = explode("-",$style);
-
- if (preg_match("/^[[:digit:]]+$/",$style[0])) $style_0 = sprintf('%02d',$style_explodies[0]);
- else $style_0 = $style_explodies[0];
-
- $query_brews = sprintf("SELECT brewStyleCarb FROM %s WHERE brewStyleGroup='%s' AND brewStyleNum='%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')", $prefix."styles", $style_0, $style_explodies[1], $_SESSION['prefsStyleSet']);
- $brews = mysqli_query($connection,$query_brews) or die (mysqli_error($connection));
- $row_brews = mysqli_fetch_assoc($brews);
-
- if ($row_brews['brewStyleCarb'] == 1) return TRUE;
- else return FALSE;
-
-}
-
-function check_mead_strength($style,$styleSet) {
-
- include (CONFIG.'config.php');
- mysqli_select_db($connection,$database);
-
- $style_explodies = explode("-",$style);
-
- if (preg_match("/^[[:digit:]]+$/",$style_explodies[0])) $style_0 = sprintf('%02d',$style_explodies[0]);
- else $style_0 = $style_explodies[0];
-
- $query_brews = sprintf("SELECT brewStyleStrength FROM %s WHERE brewStyleGroup = '%s' AND brewStyleNum = '%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')", $prefix."styles", $style_0, $style_explodies[1], $styleSet);
- $brews = mysqli_query($connection,$query_brews) or die (mysqli_error($connection));
- $row_brews = mysqli_fetch_assoc($brews);
-
- if ($row_brews['brewStyleStrength'] == 1) return TRUE;
- else return FALSE;
-
-}
-
-
-// Map BJCP2008 Styles to BJCP2015 Styles
-function bjcp_convert() {
-
- include (CONFIG.'config.php');
- mysqli_select_db($connection,$database);
-
- $query_brews = sprintf("SELECT id,brewName,brewCategory,brewCategorySort,brewSubCategory,brewStyle FROM %s ORDER BY brewCategorySort,brewSubCategory", $prefix."brewing");
- $brews = mysqli_query($connection,$query_brews) or die (mysqli_error($connection));
- $row_brews = mysqli_fetch_assoc($brews);
-
- // Loop through entries and convert to 2015 styles
- do {
-
- $style = $row_brews['brewCategorySort'].$row_brews['brewSubCategory'];
-
- switch($style) {
-
- // 1
- case "01A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","1","01","A","American Light Lager",$row_brews['id']);
- break;
-
- case "01B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","1","01","B","American Lager",$row_brews['id']);
- break;
-
- case "01C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","2","02","A","International Pale Lager",$row_brews['id']);
- break;
-
- case "01D":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","4","04","A","Munich Helles",$row_brews['id']);
- break;
-
- case "01E":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","5","05","C","Helles Exportbier",$row_brews['id']);
- break;
-
- // 2
- case "02A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","5","05","D","German Pils",$row_brews['id']);
- break;
-
- case "02B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","3","03","B","Czech Premium Pale Lager",$row_brews['id']);
- break;
-
- case "02C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s', brewInfo='%s' WHERE id='%s'",$prefix."brewing","27","27","A","Historical Beer","Pre-Phohibition Lager",$row_brews['id']);
- break;
-
- // 3
- case "03A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","7","07","A","Vienna Lager",$row_brews['id']);
- break;
-
- case "03B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","6","06","A","Marzen",$row_brews['id']);
- break;
-
- // 4
- case "04A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","2","02","C","International Dark Lager",$row_brews['id']);
- break;
-
- case "04B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","8","08","A","Munich Dunkel",$row_brews['id']);
- break;
-
- case "04C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","8","08","B","Schwarzbier",$row_brews['id']);
- break;
-
- // 5
- case "05A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","4","04","C","Helles Bock",$row_brews['id']);
- break;
-
- case "05B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","6","06","C","Dunkels Bock",$row_brews['id']);
- break;
-
- case "05C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","9","09","A","Doppelbock",$row_brews['id']);
- break;
-
- case "05D":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","9","09","B","Doppelbock",$row_brews['id']);
- break;
-
- // 6
- case "06A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","1","01","C","Cream Ale",$row_brews['id']);
- break;
-
- case "06B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","18","18","A","Blonde Ale",$row_brews['id']);
- break;
-
- case "06C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","5","05","B","Kolsch",$row_brews['id']);
- break;
-
- case "06D":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","1","01","D","American Wheat Beer",$row_brews['id']);
- break;
-
- // 7
- case "07A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","2","02","B","International Amber Lager",$row_brews['id']);
- break;
-
- case "07B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","19","19","B","California Common",$row_brews['id']);
- break;
-
- case "07C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","7","07","B","Altbier",$row_brews['id']);
- break;
-
- // 8
- case "08A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","11","11","A","Ordinary Bitter",$row_brews['id']);
- break;
-
- case "08B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","11","11","B","Best Bitter",$row_brews['id']);
- break;
-
- case "08C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","11","11","C","Strong Bitter",$row_brews['id']);
- break;
-
- // 9
- case "09A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","14","14","A","Scottish Light",$row_brews['id']);
- break;
-
- case "09B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","14","14","B","Scottish Heavy",$row_brews['id']);
- break;
-
- case "09C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","14","14","C","Scottish Export",$row_brews['id']);
- break;
-
- case "09D":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","15","15","A","Irish Red Ale",$row_brews['id']);
- break;
-
- case "09E":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","17","17","C","Wee Heavy",$row_brews['id']);
- break;
-
- // 10
- case "10A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","18","18","B","American Pale Ale",$row_brews['id']);
- break;
-
- case "10B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","19","19","A","American Amber Ale",$row_brews['id']);
- break;
-
- case "10C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","19","19","B","American Brown Ale",$row_brews['id']);
- break;
-
- // 11
- case "11A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","13","13","A","Dark Mild",$row_brews['id']);
- break;
-
- case "11B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s', brewInfo='%s' WHERE id='%s'",$prefix."brewing","27","27","B","Historical Beer","London Brown Ale",$row_brews['id']);
- break;
-
- case "11C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","13","13","B","British Brown Ale",$row_brews['id']);
- break;
-
- // 12
- case "12A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","13","13","C","English Porter",$row_brews['id']);
- break;
-
- case "12B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","20","20","B","American Porter",$row_brews['id']);
- break;
-
- case "12C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","9","09","C","Baltic Porter",$row_brews['id']);
- break;
-
- // 13
- case "13A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","15","15","B","Irish Stout",$row_brews['id']);
- break;
-
- case "13B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","16","16","A","Sweet Stout",$row_brews['id']);
- break;
-
- case "13C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","16","16","B","Oatmeal Stout",$row_brews['id']);
- break;
-
- case "13D":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","16","16","D","Foreign Export Stout",$row_brews['id']);
- break;
-
- case "13E":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","20","20","B","American Stout",$row_brews['id']);
- break;
-
- case "13F":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","20","20","C","Imperial Stout",$row_brews['id']);
- break;
-
- // 14
- case "14A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","12","12","C","English IPA",$row_brews['id']);
- break;
-
- case "14B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","21","21","A","American IPA",$row_brews['id']);
- break;
-
- case "14C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","22","22","A","American IPA",$row_brews['id']);
- break;
-
- // 15
- case "15A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","10","10","A","Weissbier",$row_brews['id']);
- break;
-
- case "15B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","10","10","B","Dunkles Weissbier",$row_brews['id']);
- break;
-
- case "15C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","10","10","C","Weizenbock",$row_brews['id']);
- break;
-
- case "15D":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s', brewInfo='%s' WHERE id='%s'",$prefix."brewing","27","27","A","Historical Beer","Roggenbier",$row_brews['id']);
- break;
-
- // 16
- case "16A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","24","24","A","Witbier",$row_brews['id']);
- break;
-
- case "16B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","24","24","B","Belgian Pale Ale",$row_brews['id']);
- break;
-
- case "16C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","25","25","B","Saison",$row_brews['id']);
- break;
-
- case "16D":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","24","24","C","Biere de Garde",$row_brews['id']);
- break;
-
- case "16E":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","34","34","A","Clone Beer",$row_brews['id']);
- break;
-
- // 17
- case "17A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","23","23","A","Berliner Weisse",$row_brews['id']);
- break;
-
- case "17B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","23","23","B","Flanders Red Ale",$row_brews['id']);
- break;
-
- case "17C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","23","23","C","Oud Bruin",$row_brews['id']);
- break;
-
- case "17D":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","23","23","D","Lambic",$row_brews['id']);
- break;
-
- case "17E":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","23","23","E","Gueuze",$row_brews['id']);
- break;
-
- case "17F":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","23","23","F","Fruit Lambic",$row_brews['id']);
- break;
-
- // 18
- case "18A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","25","25","A","Belgian Blonde Ale",$row_brews['id']);
- break;
-
- case "18B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","26","26","B","Belgian Dubbel",$row_brews['id']);
- break;
-
- case "18C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","26","26","C","Belgian Tripel",$row_brews['id']);
- break;
-
- case "18D":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","25","25","C","Belgian Golden Strong Ale",$row_brews['id']);
- break;
-
- case "18E":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","26","26","D","Belgian Dark Strong Ale",$row_brews['id']);
- break;
-
- // 19
- case "19A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","17","17","B","Old Ale",$row_brews['id']);
- break;
-
- case "19B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","17","17","D","English Barleywine",$row_brews['id']);
- break;
-
- case "19C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","22","22","C","American Barleywine",$row_brews['id']);
- break;
-
- // 20
- case "20A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","29","29","A","Fruit Beer",$row_brews['id']);
- break;
-
- // 21
- case "21A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","30","30","A","Spice, Herb, or Vegetable Beer",$row_brews['id']);
- break;
-
- case "21B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","30","30","C","Winter Seasonal Beer",$row_brews['id']);
- break;
-
- // 22
- case "22A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","6","06","B","Rauchbier",$row_brews['id']);
- break;
-
- case "22B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","32","32","A","Classic Style Smoked Beer",$row_brews['id']);
- break;
-
- case "22C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","33","33","A","Wood-Aged Beer",$row_brews['id']);
- break;
-
- // 23
- case "23A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","34","34","C","Specialty Beer",$row_brews['id']);
- break;
-
- // 24
- case "24A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M1","M1","A","Dry Mead",$row_brews['id']);
- break;
-
- case "24B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M1","M1","B","Semi-Sweet Mead",$row_brews['id']);
- break;
-
- case "24C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M1","M1","C","Sweet Mead",$row_brews['id']);
- break;
-
- // 25
- case "25A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M2","M2","A","Cyser",$row_brews['id']);
- break;
-
- case "25B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M2","M2","B","Pyment",$row_brews['id']);
- break;
-
- case "25C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M2","M2","E","Melomel",$row_brews['id']);
- break;
-
- // 26
- case "26A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M3","M3","A","Spice, Herb or Vegetable Mead",$row_brews['id']);
- break;
-
- case "26B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M4","M4","A","Braggot",$row_brews['id']);
- break;
-
- case "26C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M4","M4","C","Experimental Mead",$row_brews['id']);
- break;
-
- // 27
- case "27A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C1","C1","A","New World Cider",$row_brews['id']);
- break;
-
- case "27B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C1","C1","B","English Cider",$row_brews['id']);
- break;
-
- case "27C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C1","C1","C","French Cider",$row_brews['id']);
- break;
-
- case "27D":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C1","C1","C","New World Perry",$row_brews['id']);
- break;
-
- case "27E":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C1","C1","D","Traditional Perry",$row_brews['id']);
- break;
-
- // 28
- case "28A":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C2","C2","A","New England Cider",$row_brews['id']);
- break;
-
- case "28B":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C2","C2","B","Cider with Other Fruit",$row_brews['id']);
- break;
-
- case "28C":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C2","C2","C","Applewine",$row_brews['id']);
- break;
-
- case "28D":
- $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C2","C2","F","Specialty Cider/Perry",$row_brews['id']);
- break;
-
- }
-
- mysqli_select_db($connection,$database);
- $result = mysqli_query($connection,$updateSQL) or die (mysqli_error($connection));
-
- /* --- DEBUG ---
- echo "".$updateSQL."
";
- echo $row_brews['brewName']." (".$row_brews['brewCategorySort'].$row_brews['brewSubCategory'].": ".$row_brews['brewStyle'].")
";
- */
-
- } while ($row_brews = mysqli_fetch_assoc($brews));
-
-}
-
-function standardize_name($string) {
-
- // Modified version of Armand Niculescu's function
- // See http://www.media-division.com/correct-name-capitalization-in-php/
- // Only applies to latin characters
-
- // Major latin-character languages that will apply the standardization
- $name_check_langs = array("en", "fr", "es", "pt", "it", "de");
-
- if (in_array($_SESSION['prefsLanguageFolder'], $name_check_langs)) {
-
- $word_splitters = array(" ", "-", "O'", "L'", "D'", "St.", "Mc", "Mac", ".", "\"");
- $lowercase_exceptions = array("the", "van", "den", "ter", "von", "und", "des", "der", "de", "da", "of", "and", "l'", "d'", "de", "la", "vit", "dos", "das", "do");
- $uppercase_exceptions = array("II", "III", "IV", "VI", "VII", "VIII", "IX", "IPA", "DIPA", "NE", "SHV");
-
- $string = strtolower($string);
-
- foreach ($word_splitters as $delimiter) {
-
- $words = explode($delimiter, $string);
- $newwords = array();
-
- foreach ($words as $word) {
- if (in_array(strtoupper($word), $uppercase_exceptions)) $word = strtoupper($word);
- elseif (!in_array($word, $lowercase_exceptions)) $word = ucfirst($word);
- $newwords[] = $word;
- }
-
- if (in_array(strtolower($delimiter), $lowercase_exceptions)) $delimiter = strtolower($delimiter);
- $string = join($delimiter, $newwords);
-
- }
-
- }
-
- return $string;
-}
-
-function rmove($src, $dest){
-
- // If source is not a directory stop processing
- if(!is_dir($src)) return false;
-
- // If the destination directory does not exist create it
- if(!is_dir($dest)) {
- if(!mkdir($dest)) {
- // If the destination directory could not be created stop processing
- return false;
- }
- }
-
- // Open the source directory to read in files
- $i = new DirectoryIterator($src);
- foreach($i as $f) {
- if($f->isFile()) {
- rename($f->getRealPath(), "$dest/" . $f->getFilename());
- }
- }
-}
-
-function rdelete($src,$file_mimes){
-
- if (empty($file_mimes)) $file_mimes = array('image/jpeg','image/jpg','image/gif','image/png','application/pdf','image/bmp','image/tiff','image/svg+xml');
- else $file_mimes = array('application/pdf');
-
- // If source is not a directory stop processing
- if(!is_dir($src)) return false;
-
- $files = new FilesystemIterator($src);
-
- foreach($files as $file) {
- $mime = mime_content_type($file->getPathname());
- if (in_array($mime, $file_mimes)) unlink($file);
- }
-}
+ 0) $query_check .= " AND brewUpdated < DATE_SUB( NOW(), INTERVAL 1 DAY)";
+ $check = mysqli_query($connection,$query_check) or die (mysqli_error($connection));
+ $row_check = mysqli_fetch_assoc($check);
+
+ do { $a[] = $row_check['id']; } while ($row_check = mysqli_fetch_assoc($check));
+
+ foreach ($a as $id) {
+ $deleteSQL = sprintf("DELETE FROM %s WHERE id='%s'", $prefix."brewing", $id);
+ mysqli_real_escape_string($connection,$deleteSQL);
+ $result = mysqli_query($connection,$deleteSQL) or die (mysqli_error($connection));
+ }
+ }
+
+ if ($type == "special") {
+ $query_check = sprintf("SELECT a.id, a.brewUpdated, a.brewInfo, a.brewCategorySort, a.brewSubCategory FROM %s as a, %s as b WHERE a.brewCategorySort=b.brewStyleGroup AND a.brewSubCategory=b.brewStyleNum AND b.brewStyleReqSpec=1 AND (a.brewInfo IS NULL OR a.brewInfo='') AND b.brewStyleVersion = '%s'", $prefix."brewing",$prefix."styles",$_SESSION['prefsStyleSet']);
+ if ($interval > 0) $query_check .=" AND a.brewUpdated < DATE_SUB( NOW(), INTERVAL 1 DAY)";
+
+ $check = mysqli_query($connection,$query_check) or die (mysqli_error($connection));
+ $row_check = mysqli_fetch_assoc($check);
+
+ do {
+
+ $deleteSQL = sprintf("DELETE FROM %s WHERE id='%s'", $prefix."brewing", $row_check['id']);
+ mysqli_real_escape_string($connection,$deleteSQL);
+ $result = mysqli_query($connection,$deleteSQL) or die (mysqli_error($connection));
+
+ } while ($row_check = mysqli_fetch_assoc($check));
+ }
+}
+*/
+
+function generate_judging_numbers($brewing_db_table,$method) {
+
+ require(CONFIG.'config.php');
+ mysqli_select_db($connection,$database);
+
+ // Clear out all current judging numbers
+ $updateSQL = sprintf("UPDATE %s SET brewJudgingNumber=NULL", $brewing_db_table);
+ mysqli_real_escape_string($connection,$updateSQL);
+ $result = mysqli_query($connection,$updateSQL) or die (mysqli_error($connection));
+
+ $query_judging_numbers = sprintf("SELECT id,brewCategory,brewName FROM %s", $brewing_db_table);
+ $judging_numbers = mysqli_query($connection,$query_judging_numbers) or die (mysqli_error($connection));
+ $row_judging_numbers = mysqli_fetch_assoc($judging_numbers);
+
+ if ($method == "default") {
+
+ $files = array_slice(scandir(USER_DOCS), 2);
+
+ do {
+
+ $judging_number_looper = TRUE;
+
+ while($judging_number_looper) {
+
+ $generated_judging_number = generate_judging_num(1,"default");
+ $scoresheet_file_name_judging = $generated_judging_number.".pdf";
+
+ if (!in_array($scoresheet_file_name_judging,$files)) {
+ $brewJudgingNumber = $generated_judging_number;
+ $updateSQL = sprintf("UPDATE %s SET brewJudgingNumber=%s WHERE id=%s",
+ $brewing_db_table,
+ GetSQLValueString($brewJudgingNumber, "text"),
+ GetSQLValueString($row_judging_numbers['id'], "text"));
+
+ mysqli_real_escape_string($connection,$updateSQL);
+ $result = mysqli_query($connection,$updateSQL) or die (mysqli_error($connection));
+
+ $judging_number_looper = FALSE;
+ }
+ else {
+ $judging_number_looper = TRUE;
+ }
+ }
+ } while ($row_judging_numbers = mysqli_fetch_assoc($judging_numbers));
+ }
+
+ if ($method == "identical") {
+ do {
+ $j_num = sprintf("%06s",$row_judging_numbers['id']);
+ $updateSQL = sprintf("UPDATE %s SET brewJudgingNumber=%s WHERE id=%s",
+ $brewing_db_table,
+ GetSQLValueString($j_num, "text"),
+ GetSQLValueString($row_judging_numbers['id'], "text"));
+ mysqli_real_escape_string($connection,$updateSQL);
+ $result = mysqli_query($connection,$updateSQL) or die (mysqli_error($connection));
+ } while ($row_judging_numbers = mysqli_fetch_assoc($judging_numbers));
+ }
+
+ if ($method == "legacy") {
+ do {
+ $updateSQL = sprintf("UPDATE %s SET brewJudgingNumber=%s WHERE id=%s",
+ $brewing_db_table,
+ GetSQLValueString(generate_judging_num(2,$row_judging_numbers['brewCategory']), "text"),
+ GetSQLValueString($row_judging_numbers['id'], "text"));
+ mysqli_real_escape_string($connection,$updateSQL);
+ $result = mysqli_query($connection,$updateSQL) or die (mysqli_error($connection));
+ } while ($row_judging_numbers = mysqli_fetch_assoc($judging_numbers));
+ }
+}
+
+function check_sweetness($style,$styleSet) {
+
+ include (CONFIG.'config.php');
+ mysqli_select_db($connection,$database);
+
+ $style_explodies = explode("-",$style);
+
+ if (preg_match("/^[[:digit:]]+$/",$style_explodies[0])) $style_0 = sprintf('%02d',$style_explodies[0]);
+ else $style_0 = $style_explodies[0];
+
+ $query_brews = sprintf("SELECT brewStyleSweet FROM %s WHERE brewStyleGroup='%s' AND brewStyleNum='%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')", $prefix."styles", $style_0, $style_explodies[1], $_SESSION['prefsStyleSet']);
+ $brews = mysqli_query($connection,$query_brews) or die (mysqli_error($connection));
+ $row_brews = mysqli_fetch_assoc($brews);
+
+ if ($row_brews['brewStyleSweet'] == 1) return TRUE;
+ else return FALSE;
+
+}
+
+
+function check_carb($style,$styleSet) {
+
+ include (CONFIG.'config.php');
+ mysqli_select_db($connection,$database);
+
+ $style_explodies = explode("-",$style);
+
+ if (preg_match("/^[[:digit:]]+$/",$style[0])) $style_0 = sprintf('%02d',$style_explodies[0]);
+ else $style_0 = $style_explodies[0];
+
+ $query_brews = sprintf("SELECT brewStyleCarb FROM %s WHERE brewStyleGroup='%s' AND brewStyleNum='%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')", $prefix."styles", $style_0, $style_explodies[1], $_SESSION['prefsStyleSet']);
+ $brews = mysqli_query($connection,$query_brews) or die (mysqli_error($connection));
+ $row_brews = mysqli_fetch_assoc($brews);
+
+ if ($row_brews['brewStyleCarb'] == 1) return TRUE;
+ else return FALSE;
+
+}
+
+function check_mead_strength($style,$styleSet) {
+
+ include (CONFIG.'config.php');
+ mysqli_select_db($connection,$database);
+
+ $style_explodies = explode("-",$style);
+
+ if (preg_match("/^[[:digit:]]+$/",$style_explodies[0])) $style_0 = sprintf('%02d',$style_explodies[0]);
+ else $style_0 = $style_explodies[0];
+
+ $query_brews = sprintf("SELECT brewStyleStrength FROM %s WHERE brewStyleGroup = '%s' AND brewStyleNum = '%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')", $prefix."styles", $style_0, $style_explodies[1], $styleSet);
+ $brews = mysqli_query($connection,$query_brews) or die (mysqli_error($connection));
+ $row_brews = mysqli_fetch_assoc($brews);
+
+ if ($row_brews['brewStyleStrength'] == 1) return TRUE;
+ else return FALSE;
+
+}
+
+
+// Map BJCP2008 Styles to BJCP2015 Styles
+function bjcp_convert() {
+
+ include (CONFIG.'config.php');
+ mysqli_select_db($connection,$database);
+
+ $query_brews = sprintf("SELECT id,brewName,brewCategory,brewCategorySort,brewSubCategory,brewStyle FROM %s ORDER BY brewCategorySort,brewSubCategory", $prefix."brewing");
+ $brews = mysqli_query($connection,$query_brews) or die (mysqli_error($connection));
+ $row_brews = mysqli_fetch_assoc($brews);
+
+ // Loop through entries and convert to 2015 styles
+ do {
+
+ $style = $row_brews['brewCategorySort'].$row_brews['brewSubCategory'];
+
+ switch($style) {
+
+ // 1
+ case "01A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","1","01","A","American Light Lager",$row_brews['id']);
+ break;
+
+ case "01B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","1","01","B","American Lager",$row_brews['id']);
+ break;
+
+ case "01C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","2","02","A","International Pale Lager",$row_brews['id']);
+ break;
+
+ case "01D":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","4","04","A","Munich Helles",$row_brews['id']);
+ break;
+
+ case "01E":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","5","05","C","Helles Exportbier",$row_brews['id']);
+ break;
+
+ // 2
+ case "02A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","5","05","D","German Pils",$row_brews['id']);
+ break;
+
+ case "02B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","3","03","B","Czech Premium Pale Lager",$row_brews['id']);
+ break;
+
+ case "02C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s', brewInfo='%s' WHERE id='%s'",$prefix."brewing","27","27","A","Historical Beer","Pre-Phohibition Lager",$row_brews['id']);
+ break;
+
+ // 3
+ case "03A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","7","07","A","Vienna Lager",$row_brews['id']);
+ break;
+
+ case "03B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","6","06","A","Marzen",$row_brews['id']);
+ break;
+
+ // 4
+ case "04A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","2","02","C","International Dark Lager",$row_brews['id']);
+ break;
+
+ case "04B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","8","08","A","Munich Dunkel",$row_brews['id']);
+ break;
+
+ case "04C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","8","08","B","Schwarzbier",$row_brews['id']);
+ break;
+
+ // 5
+ case "05A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","4","04","C","Helles Bock",$row_brews['id']);
+ break;
+
+ case "05B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","6","06","C","Dunkels Bock",$row_brews['id']);
+ break;
+
+ case "05C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","9","09","A","Doppelbock",$row_brews['id']);
+ break;
+
+ case "05D":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","9","09","B","Doppelbock",$row_brews['id']);
+ break;
+
+ // 6
+ case "06A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","1","01","C","Cream Ale",$row_brews['id']);
+ break;
+
+ case "06B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","18","18","A","Blonde Ale",$row_brews['id']);
+ break;
+
+ case "06C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","5","05","B","Kolsch",$row_brews['id']);
+ break;
+
+ case "06D":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","1","01","D","American Wheat Beer",$row_brews['id']);
+ break;
+
+ // 7
+ case "07A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","2","02","B","International Amber Lager",$row_brews['id']);
+ break;
+
+ case "07B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","19","19","B","California Common",$row_brews['id']);
+ break;
+
+ case "07C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","7","07","B","Altbier",$row_brews['id']);
+ break;
+
+ // 8
+ case "08A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","11","11","A","Ordinary Bitter",$row_brews['id']);
+ break;
+
+ case "08B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","11","11","B","Best Bitter",$row_brews['id']);
+ break;
+
+ case "08C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","11","11","C","Strong Bitter",$row_brews['id']);
+ break;
+
+ // 9
+ case "09A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","14","14","A","Scottish Light",$row_brews['id']);
+ break;
+
+ case "09B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","14","14","B","Scottish Heavy",$row_brews['id']);
+ break;
+
+ case "09C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","14","14","C","Scottish Export",$row_brews['id']);
+ break;
+
+ case "09D":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","15","15","A","Irish Red Ale",$row_brews['id']);
+ break;
+
+ case "09E":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","17","17","C","Wee Heavy",$row_brews['id']);
+ break;
+
+ // 10
+ case "10A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","18","18","B","American Pale Ale",$row_brews['id']);
+ break;
+
+ case "10B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","19","19","A","American Amber Ale",$row_brews['id']);
+ break;
+
+ case "10C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","19","19","B","American Brown Ale",$row_brews['id']);
+ break;
+
+ // 11
+ case "11A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","13","13","A","Dark Mild",$row_brews['id']);
+ break;
+
+ case "11B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s', brewInfo='%s' WHERE id='%s'",$prefix."brewing","27","27","B","Historical Beer","London Brown Ale",$row_brews['id']);
+ break;
+
+ case "11C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","13","13","B","British Brown Ale",$row_brews['id']);
+ break;
+
+ // 12
+ case "12A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","13","13","C","English Porter",$row_brews['id']);
+ break;
+
+ case "12B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","20","20","B","American Porter",$row_brews['id']);
+ break;
+
+ case "12C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","9","09","C","Baltic Porter",$row_brews['id']);
+ break;
+
+ // 13
+ case "13A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","15","15","B","Irish Stout",$row_brews['id']);
+ break;
+
+ case "13B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","16","16","A","Sweet Stout",$row_brews['id']);
+ break;
+
+ case "13C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","16","16","B","Oatmeal Stout",$row_brews['id']);
+ break;
+
+ case "13D":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","16","16","D","Foreign Export Stout",$row_brews['id']);
+ break;
+
+ case "13E":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","20","20","B","American Stout",$row_brews['id']);
+ break;
+
+ case "13F":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","20","20","C","Imperial Stout",$row_brews['id']);
+ break;
+
+ // 14
+ case "14A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","12","12","C","English IPA",$row_brews['id']);
+ break;
+
+ case "14B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","21","21","A","American IPA",$row_brews['id']);
+ break;
+
+ case "14C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","22","22","A","American IPA",$row_brews['id']);
+ break;
+
+ // 15
+ case "15A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","10","10","A","Weissbier",$row_brews['id']);
+ break;
+
+ case "15B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","10","10","B","Dunkles Weissbier",$row_brews['id']);
+ break;
+
+ case "15C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","10","10","C","Weizenbock",$row_brews['id']);
+ break;
+
+ case "15D":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s', brewInfo='%s' WHERE id='%s'",$prefix."brewing","27","27","A","Historical Beer","Roggenbier",$row_brews['id']);
+ break;
+
+ // 16
+ case "16A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","24","24","A","Witbier",$row_brews['id']);
+ break;
+
+ case "16B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","24","24","B","Belgian Pale Ale",$row_brews['id']);
+ break;
+
+ case "16C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","25","25","B","Saison",$row_brews['id']);
+ break;
+
+ case "16D":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","24","24","C","Biere de Garde",$row_brews['id']);
+ break;
+
+ case "16E":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","34","34","A","Clone Beer",$row_brews['id']);
+ break;
+
+ // 17
+ case "17A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","23","23","A","Berliner Weisse",$row_brews['id']);
+ break;
+
+ case "17B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","23","23","B","Flanders Red Ale",$row_brews['id']);
+ break;
+
+ case "17C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","23","23","C","Oud Bruin",$row_brews['id']);
+ break;
+
+ case "17D":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","23","23","D","Lambic",$row_brews['id']);
+ break;
+
+ case "17E":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","23","23","E","Gueuze",$row_brews['id']);
+ break;
+
+ case "17F":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","23","23","F","Fruit Lambic",$row_brews['id']);
+ break;
+
+ // 18
+ case "18A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","25","25","A","Belgian Blonde Ale",$row_brews['id']);
+ break;
+
+ case "18B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","26","26","B","Belgian Dubbel",$row_brews['id']);
+ break;
+
+ case "18C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","26","26","C","Belgian Tripel",$row_brews['id']);
+ break;
+
+ case "18D":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","25","25","C","Belgian Golden Strong Ale",$row_brews['id']);
+ break;
+
+ case "18E":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","26","26","D","Belgian Dark Strong Ale",$row_brews['id']);
+ break;
+
+ // 19
+ case "19A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","17","17","B","Old Ale",$row_brews['id']);
+ break;
+
+ case "19B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","17","17","D","English Barleywine",$row_brews['id']);
+ break;
+
+ case "19C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","22","22","C","American Barleywine",$row_brews['id']);
+ break;
+
+ // 20
+ case "20A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","29","29","A","Fruit Beer",$row_brews['id']);
+ break;
+
+ // 21
+ case "21A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","30","30","A","Spice, Herb, or Vegetable Beer",$row_brews['id']);
+ break;
+
+ case "21B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","30","30","C","Winter Seasonal Beer",$row_brews['id']);
+ break;
+
+ // 22
+ case "22A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","6","06","B","Rauchbier",$row_brews['id']);
+ break;
+
+ case "22B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","32","32","A","Classic Style Smoked Beer",$row_brews['id']);
+ break;
+
+ case "22C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","33","33","A","Wood-Aged Beer",$row_brews['id']);
+ break;
+
+ // 23
+ case "23A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","34","34","C","Specialty Beer",$row_brews['id']);
+ break;
+
+ // 24
+ case "24A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M1","M1","A","Dry Mead",$row_brews['id']);
+ break;
+
+ case "24B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M1","M1","B","Semi-Sweet Mead",$row_brews['id']);
+ break;
+
+ case "24C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M1","M1","C","Sweet Mead",$row_brews['id']);
+ break;
+
+ // 25
+ case "25A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M2","M2","A","Cyser",$row_brews['id']);
+ break;
+
+ case "25B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M2","M2","B","Pyment",$row_brews['id']);
+ break;
+
+ case "25C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M2","M2","E","Melomel",$row_brews['id']);
+ break;
+
+ // 26
+ case "26A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M3","M3","A","Spice, Herb or Vegetable Mead",$row_brews['id']);
+ break;
+
+ case "26B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M4","M4","A","Braggot",$row_brews['id']);
+ break;
+
+ case "26C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","M4","M4","C","Experimental Mead",$row_brews['id']);
+ break;
+
+ // 27
+ case "27A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C1","C1","A","New World Cider",$row_brews['id']);
+ break;
+
+ case "27B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C1","C1","B","English Cider",$row_brews['id']);
+ break;
+
+ case "27C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C1","C1","C","French Cider",$row_brews['id']);
+ break;
+
+ case "27D":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C1","C1","C","New World Perry",$row_brews['id']);
+ break;
+
+ case "27E":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C1","C1","D","Traditional Perry",$row_brews['id']);
+ break;
+
+ // 28
+ case "28A":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C2","C2","A","New England Cider",$row_brews['id']);
+ break;
+
+ case "28B":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C2","C2","B","Cider with Other Fruit",$row_brews['id']);
+ break;
+
+ case "28C":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C2","C2","C","Applewine",$row_brews['id']);
+ break;
+
+ case "28D":
+ $updateSQL = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='%s', brewStyle='%s' WHERE id='%s'",$prefix."brewing","C2","C2","F","Specialty Cider/Perry",$row_brews['id']);
+ break;
+
+ }
+
+ mysqli_select_db($connection,$database);
+ $result = mysqli_query($connection,$updateSQL) or die (mysqli_error($connection));
+
+ /* --- DEBUG ---
+ echo "".$updateSQL."
";
+ echo $row_brews['brewName']." (".$row_brews['brewCategorySort'].$row_brews['brewSubCategory'].": ".$row_brews['brewStyle'].")
";
+ */
+
+ } while ($row_brews = mysqli_fetch_assoc($brews));
+
+}
+
+function standardize_name($string) {
+
+ // Modified version of Armand Niculescu's function
+ // See http://www.media-division.com/correct-name-capitalization-in-php/
+ // Only applies to latin characters
+
+ // Major latin-character languages that will apply the standardization
+ $name_check_langs = array("en", "fr", "es", "pt", "it", "de");
+
+ if (in_array($_SESSION['prefsLanguageFolder'], $name_check_langs)) {
+
+ $word_splitters = array(" ", "-", "O'", "L'", "D'", "St.", "Mc", "Mac", ".", "\"");
+ $lowercase_exceptions = array("the", "van", "den", "ter", "von", "und", "des", "der", "de", "da", "of", "and", "l'", "d'", "de", "la", "vit", "dos", "das", "do");
+ $uppercase_exceptions = array("II", "III", "IV", "VI", "VII", "VIII", "IX", "IPA", "DIPA", "NE", "SHV");
+
+ $string = strtolower($string);
+
+ foreach ($word_splitters as $delimiter) {
+
+ $words = explode($delimiter, $string);
+ $newwords = array();
+
+ foreach ($words as $word) {
+ if (in_array(strtoupper($word), $uppercase_exceptions)) $word = strtoupper($word);
+ elseif (!in_array($word, $lowercase_exceptions)) $word = ucfirst($word);
+ $newwords[] = $word;
+ }
+
+ if (in_array(strtolower($delimiter), $lowercase_exceptions)) $delimiter = strtolower($delimiter);
+ $string = join($delimiter, $newwords);
+
+ }
+
+ }
+
+ return $string;
+}
+
+function rmove($src, $dest){
+
+ // If source is not a directory stop processing
+ if(!is_dir($src)) return false;
+
+ // If the destination directory does not exist create it
+ if(!is_dir($dest)) {
+ if(!mkdir($dest)) {
+ // If the destination directory could not be created stop processing
+ return false;
+ }
+ }
+
+ // Open the source directory to read in files
+ $i = new DirectoryIterator($src);
+ foreach($i as $f) {
+ if($f->isFile()) {
+ rename($f->getRealPath(), "$dest/" . $f->getFilename());
+ }
+ }
+}
+
+function rdelete($src,$file_mimes){
+
+ if (empty($file_mimes)) $file_mimes = array('image/jpeg','image/jpg','image/gif','image/png','application/pdf','image/bmp','image/tiff','image/svg+xml');
+ else $file_mimes = array('application/pdf');
+
+ // If source is not a directory stop processing
+ if(!is_dir($src)) return false;
+
+ $files = new FilesystemIterator($src);
+
+ foreach($files as $file) {
+ $mime = mime_content_type($file->getPathname());
+ if (in_array($mime, $file_mimes)) unlink($file);
+ }
+}
?>
\ No newline at end of file
diff --git a/output/results.output.php b/output/results.output.php
index cb1a0338..58bbf0d1 100644
--- a/output/results.output.php
+++ b/output/results.output.php
@@ -1,44 +1,44 @@
-".$_SESSION['contestName']."";
- echo sprintf("%s %s %s %s %s
",$judge_closed_001,get_entry_count('received'),$judge_closed_002,get_participant_count('default'),$judge_closed_003);
- echo "".$label_bos."
";
- include (SECTIONS.'bos.sec.php');
-
- if (($_SESSION['prefsShowBestBrewer'] != 0) || ($_SESSION['prefsShowBestClub'] != 0)) include (SECTIONS.'bestbrewer.sec.php');
-
- echo "".$label_winners."
";
- if ($row_prefs['prefsWinnerMethod'] == "1") include (SECTIONS.'winners_category.sec.php');
- elseif ($row_prefs['prefsWinnerMethod'] == "2") include (SECTIONS.'winners_subcategory.sec.php');
- else include (SECTIONS.'winners.sec.php');
-
- }
-
-}
-
-else echo "Please log in as an Admin to view this report.
";
-
-?>
+".$_SESSION['contestName']."";
+ echo sprintf("%s %s %s %s %s
",$judge_closed_001,get_entry_count('received'),$judge_closed_002,get_participant_count('default'),$judge_closed_003);
+ echo "".$label_bos."
";
+ include (SECTIONS.'bos.sec.php');
+
+ if (($_SESSION['prefsShowBestBrewer'] != 0) || ($_SESSION['prefsShowBestClub'] != 0)) include (SECTIONS.'bestbrewer.sec.php');
+
+ echo "".$label_winners."
";
+ if ($row_prefs['prefsWinnerMethod'] == "1") include (SECTIONS.'winners_category.sec.php');
+ elseif ($row_prefs['prefsWinnerMethod'] == "2") include (SECTIONS.'winners_subcategory.sec.php');
+ else include (SECTIONS.'winners.sec.php');
+
+ }
+
+}
+
+else echo "Please log in as an Admin to view this report.
";
+
+?>
diff --git a/sections/bestbrewer.sec.php b/sections/bestbrewer.sec.php
index 12e95365..e8e243f9 100644
--- a/sections/bestbrewer.sec.php
+++ b/sections/bestbrewer.sec.php
@@ -264,14 +264,14 @@ function normalizeClubs($string) {
// Build club points table body
$table_body2 .= "";
- $table_body2 .= "".$bb_display_position_clubs." | ";
+ $table_body2 .= "".$bb_display_position_clubs." | ";
$table_body2 .= "".$bestbrewer_clubs[$key]['Clubs']." | ";
- $table_body2 .= "".$bestbrewer_clubs[$key]['Places'][0]." | ";
- $table_body2 .= "".$bestbrewer_clubs[$key]['Places'][1]." | ";
- $table_body2 .= "".$bestbrewer_clubs[$key]['Places'][2]." | ";
- if ($show_4th_clubs) $table_body2 .= "".$bestbrewer_clubs[$key]['Places'][3]." | ";
- if ($show_HM_clubs) $table_body2 .= "".$bestbrewer_clubs[$key]['Places'][4]." | ";
- $table_body2 .= "";
+ $table_body2 .= " | ".$bestbrewer_clubs[$key]['Places'][0]." | ";
+ $table_body2 .= "".$bestbrewer_clubs[$key]['Places'][1]." | ";
+ $table_body2 .= "".$bestbrewer_clubs[$key]['Places'][2]." | ";
+ if ($show_4th_clubs) $table_body2 .= "".$bestbrewer_clubs[$key]['Places'][3]." | ";
+ if ($show_HM_clubs) $table_body2 .= "".$bestbrewer_clubs[$key]['Places'][4]." | ";
+ $table_body2 .= "";
if ($section == "results") $table_body2 .= $points_clubs;
else $table_body2 .= number_format($points_clubs,2);
if ($section != "results") $table_body2 .= " ";
@@ -301,28 +301,28 @@ function normalizeClubs($string) {
if ($row_limits['prefsShowBestBrewer'] != 0) {
// Build best brewer table headers
$table_head1 .= " |
";
- $table_head1 .= sprintf("%s | ",$label_place);
- $table_head1 .= sprintf("%s | ",$label_brewer);
- $table_head1 .= "".addOrdinalNumberSuffix(1)." | ";
- $table_head1 .= "".addOrdinalNumberSuffix(2)." | ";
- $table_head1 .= "".addOrdinalNumberSuffix(3)." | ";
- if ($show_4th) $table_head1 .= "".addOrdinalNumberSuffix(4)." | ";
- if ($show_HM) $table_head1 .= sprintf("%s | ",$best_brewer_text_001);
- $table_head1 .= sprintf("%s | ",$label_score);
- if ($_SESSION['prefsProEdition'] == 0) $table_head1 .= sprintf("%s | ",$label_club);
+ $table_head1 .= sprintf("%s | ",$label_place);
+ $table_head1 .= sprintf("%s | ",$label_brewer);
+ $table_head1 .= "".addOrdinalNumberSuffix(1)." | ";
+ $table_head1 .= "".addOrdinalNumberSuffix(2)." | ";
+ $table_head1 .= "".addOrdinalNumberSuffix(3)." | ";
+ if ($show_4th) $table_head1 .= "".addOrdinalNumberSuffix(4)." | ";
+ if ($show_HM) $table_head1 .= sprintf("%s | ",$best_brewer_text_001);
+ $table_head1 .= sprintf("%s | ",$label_score);
+ if ($_SESSION['prefsProEdition'] == 0) $table_head1 .= sprintf("%s | ",$label_club);
}
if (($_SESSION['prefsProEdition'] == 0) && ($row_limits['prefsShowBestClub'] != 0)) {
// Clubs table headers
$table_head2 .= "
";
- $table_head2 .= sprintf("%s | ",$label_place);
- $table_head2 .= sprintf("%s | ",$label_club);
- $table_head2 .= "".addOrdinalNumberSuffix(1)." | ";
- $table_head2 .= "".addOrdinalNumberSuffix(2)." | ";
- $table_head2 .= "".addOrdinalNumberSuffix(3)." | ";
- if ($show_4th_clubs) $table_head2 .= "".addOrdinalNumberSuffix(4)." | ";
- if ($show_HM_clubs) $table_head2 .= sprintf("%s | ",$best_brewer_text_001);
- $table_head2 .= sprintf("%s | ",$label_score);
+ $table_head2 .= sprintf("%s | ",$label_place);
+ $table_head2 .= sprintf("%s | ",$label_club);
+ $table_head2 .= "".addOrdinalNumberSuffix(1)." | ";
+ $table_head2 .= "".addOrdinalNumberSuffix(2)." | ";
+ $table_head2 .= "".addOrdinalNumberSuffix(3)." | ";
+ if ($show_4th_clubs) $table_head2 .= "".addOrdinalNumberSuffix(4)." | ";
+ if ($show_HM_clubs) $table_head2 .= sprintf("%s | ",$best_brewer_text_001);
+ $table_head2 .= sprintf("%s | ",$label_score);
$table_head2 .= "
";
}
@@ -342,21 +342,21 @@ function normalizeClubs($string) {
else $bb_display_position = "";
if ($bb_position <= $bb_max_position) {
$table_body1 .= "";
- $table_body1 .= "".$bb_display_position." | ";
- $table_body1 .= "".$bestbrewer[$key]['Name'];
+ $table_body1 .= " | ".$bb_display_position." | ";
+ $table_body1 .= "".$bestbrewer[$key]['Name'];
if (array_sum($bestbrewer[$key]['TypeBOS']) > 0) $table_body1 .= sprintf(" ** %s %s **",$label_bos,$label_participant);
$table_body1 .= " | ";
- $table_body1 .= "".$bestbrewer[$key]['Places'][0]." | ";
- $table_body1 .= "".$bestbrewer[$key]['Places'][1]." | ";
- $table_body1 .= "".$bestbrewer[$key]['Places'][2]." | ";
- if ($show_4th) $table_body1 .= "".$bestbrewer[$key]['Places'][3]." | ";
- if ($show_HM) $table_body1 .= "".$bestbrewer[$key]['Places'][4]." | ";
- $table_body1 .= "";
+ $table_body1 .= " | ".$bestbrewer[$key]['Places'][0]." | ";
+ $table_body1 .= "".$bestbrewer[$key]['Places'][1]." | ";
+ $table_body1 .= "".$bestbrewer[$key]['Places'][2]." | ";
+ if ($show_4th) $table_body1 .= "".$bestbrewer[$key]['Places'][3]." | ";
+ if ($show_HM) $table_body1 .= "".$bestbrewer[$key]['Places'][4]." | ";
+ $table_body1 .= "";
if ($section == "results") $table_body1 .= $points;
else $table_body1 .= number_format($points,2);
if ($section != "results") $table_body1 .= " ";
$table_body1 .= " | ";
- if ($_SESSION['prefsProEdition'] == 0) $table_body1 .= "".$bestbrewer[$key]['Clubs']." | ";
+ if ($_SESSION['prefsProEdition'] == 0) $table_body1 .= "".$bestbrewer[$key]['Clubs']." | ";
$table_body1 .= "
";
}
else break;
diff --git a/sections/bos.sec.php b/sections/bos.sec.php
index 536a50c9..5f72ffaa 100644
--- a/sections/bos.sec.php
+++ b/sections/bos.sec.php
@@ -70,40 +70,38 @@
// Build table headers
$table_head1 .= "";
- $table_head1 .= sprintf("%s | ",$label_place);
- $table_head1 .= sprintf("%s | ",$label_brewer);
- $table_head1 .= sprintf("%s | ",$label_entry_name);
- $table_head1 .= sprintf("%s | ",$label_style);
- if ($_SESSION['prefsProEdition'] == 0) $table_head1 .= sprintf("%s | ",$label_club);
+ $table_head1 .= sprintf("%s | ",$label_place);
+ $table_head1 .= sprintf("%s | ",$label_brewer);
+ $table_head1 .= sprintf("%s | ",$label_entry_name);
+ $table_head1 .= sprintf("%s | ",$label_style);
+ if ($_SESSION['prefsProEdition'] == 0) $table_head1 .= sprintf("%s | ",$label_club);
$table_head1 .= "
";
do {
$table_body1 .= "";
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= display_place($row_bos['scorePlace'],2);
$table_body1 .= " | ";
- $table_body1 .= "";
+ $table_body1 .= " | ";
if ($_SESSION['prefsProEdition'] == 1) $table_body1 .= $row_bos['brewerBreweryName'];
else $table_body1 .= $row_bos['brewerFirstName']." ".$row_bos['brewerLastName'];
if (($_SESSION['prefsProEdition'] == 0) && ($row_bos['brewCoBrewer'] != "")) $table_body1 .= sprintf(" %s: %s",$label_cobrewer,$row_bos['brewCoBrewer']);
$table_body1 .= " | ";
- if ($action == "print") $table_body1 .= "";
- else $table_body1 .= " | ";
+ $table_body1 .= " | ";
$table_body1 .= $row_bos['brewName'];
$table_body1 .= " | ";
- if ($action == "print") $table_body1 .= "";
- else $table_body1 .= " | ";
+ $table_body1 .= " | ";
if ($_SESSION['prefsStyleSet'] == "BA") $table_body1 .= $row_bos['brewStyle'];
else $table_body1 .= $row_bos['brewCategory'].$row_bos['brewSubCategory'].": ".$row_bos['brewStyle'];
$table_body1 .= " | ";
if ($_SESSION['prefsProEdition'] == 0) {
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= $row_bos['brewerClubs'];
$table_body1 .= " | ";
}
@@ -176,9 +174,9 @@
$table_head2 .= "
";
if ($row_sbi['sbi_display_places'] == "1") $table_head2 .= sprintf("%s | ",$label_place);
- $table_head2 .= sprintf("%s | ",$label_brewer);
- $table_head2 .= sprintf("%s | ",$label_entry_name);
- $table_head2 .= sprintf("%s | ",$label_style);
+ $table_head2 .= sprintf("%s | ",$label_brewer);
+ $table_head2 .= sprintf("%s | ",$label_entry_name);
+ $table_head2 .= sprintf("%s | ",$label_style);
if ($_SESSION['prefsProEdition'] == 0) $table_head2 .= sprintf("%s | ",$label_club);
$table_head2 .= "
";
@@ -191,18 +189,18 @@
$table_body2 .= "";
if ($row_sbi['sbi_display_places'] == "1") {
- $table_body2 .= "";
+ $table_body2 .= " | ";
$table_body2 .= display_place($row_sbd['sbd_place'],2);
$table_body2 .= " | ";
}
- $table_body2 .= "";
+ $table_body2 .= " | ";
if ($_SESSION['prefsProEdition'] == 0) $table_body2 .= $brewer_info['0']." ".$brewer_info['1'];
else $table_body2 .= $brewer_info[15];
if (($_SESSION['prefsProEdition'] == 0) && (!empty($entry_info['4']))) $table_body2 .= " ".$label_cobrewer.": ".$entry_info['4'];
$table_body2 .= " | ";
- $table_body2 .= "";
+ $table_body2 .= " | ";
$table_body2 .= $entry_info['0'];
$table_body2 .= " | ";
@@ -211,7 +209,7 @@
$table_body2 .= "";
if ($_SESSION['prefsProEdition'] == 0) {
- $table_body2 .= "";
+ $table_body2 .= " | ";
$table_body2 .= $brewer_info['8'];
$table_body2 .= " | ";
}
diff --git a/sections/brewer_entries.sec.php b/sections/brewer_entries.sec.php
index aea844ba..c69fea5c 100644
--- a/sections/brewer_entries.sec.php
+++ b/sections/brewer_entries.sec.php
@@ -175,7 +175,7 @@
if (($scoresheet) && (!empty($scoresheet_file_name))) {
$scoresheet_link = "";
- $scoresheet_link .= "%s",$label_place);
- $table_head1 .= sprintf("%s | ",$label_brewer);
- $table_head1 .= sprintf("%s %s | ",$label_entry,$label_name);
- $table_head1 .= sprintf("%s | ",$label_style);
- if ($_SESSION['prefsProEdition'] == 0) $table_head1 .= sprintf("%s | ",$label_club);
- if ($filter == "scores") $table_head1 .= sprintf("Score | ",$label_score);
+ $table_head1 .= sprintf("%s | ",$label_place);
+ $table_head1 .= sprintf("%s | ",$label_brewer);
+ $table_head1 .= sprintf("%s %s | ",$label_entry,$label_name);
+ $table_head1 .= sprintf("%s | ",$label_style);
+ if ($_SESSION['prefsProEdition'] == 0) $table_head1 .= sprintf("%s | ",$label_club);
+ if ($filter == "scores") $table_head1 .= sprintf("Score | ",$label_score);
$table_head1 .= "
";
// Build table body
@@ -98,13 +98,13 @@
$table_body1 .= "";
if ($action == "print") {
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= display_place($row_scores['scorePlace'],1);
$table_body1 .= " | ";
}
else {
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= display_place($row_scores['scorePlace'],2);
$table_body1 .= " | ";
}
@@ -115,11 +115,11 @@
if (($_SESSION['prefsProEdition'] == 0) && ($row_scores['brewCoBrewer'] != "")) $table_body1 .= "
".$label_cobrewer.": ".$row_scores['brewCoBrewer'];
$table_body1 .= "";
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= $row_scores['brewName'];
$table_body1 .= " | ";
- $table_body1 .= "";
+ $table_body1 .= " | ";
if ($_SESSION['prefsStyleSet'] == "BA") $table_body1 .= $row_scores['brewStyle'];
else $table_body1 .= $style.": ".$row_scores['brewStyle'];
if ((!empty($row_scores['brewInfo'])) && ($section != "results")) {
@@ -128,13 +128,13 @@
$table_body1 .= " | ";
if ($_SESSION['prefsProEdition'] == 0) {
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= $row_scores['brewerClubs'];
$table_body1 .= " | ";
}
if ($filter == "scores") {
- $table_body1 .= "";
+ $table_body1 .= " | ";
if (!empty($row_scores['scoreEntry'])) $table_body1 .= $row_scores['scoreEntry'];
else $table_body1 .= " ";
$table_body1 .= " | ";
diff --git a/sections/winners_category.sec.php b/sections/winners_category.sec.php
index 202686a8..c8b78912 100644
--- a/sections/winners_category.sec.php
+++ b/sections/winners_category.sec.php
@@ -90,11 +90,11 @@
}
// Build table headers
$table_head1 .= "
";
- $table_head1 .= sprintf("%s | ",$label_place);
- $table_head1 .= sprintf("%s | ",$label_brewer);
- $table_head1 .= sprintf("%s %s | ",$label_entry,$label_name);
- $table_head1 .= sprintf("%s | ",$label_style);
- if ($_SESSION['prefsProEdition'] == 0) $table_head1 .= sprintf("%s | ",$label_club);
+ $table_head1 .= sprintf("%s | ",$label_place);
+ $table_head1 .= sprintf("%s | ",$label_brewer);
+ $table_head1 .= sprintf("%s %s | ",$label_entry,$label_name);
+ $table_head1 .= sprintf("%s | ",$label_style);
+ if ($_SESSION['prefsProEdition'] == 0) $table_head1 .= sprintf("%s | ",$label_club);
if ($filter == "scores") $table_head1 .= sprintf("Score | ",$label_score);
$table_head1 .= "
";
@@ -108,18 +108,18 @@
$table_body1 .= "";
if ($action == "print") {
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= display_place($row_scores['scorePlace'],1);
$table_body1 .= " | ";
}
else {
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= display_place($row_scores['scorePlace'],2);
$table_body1 .= " | ";
}
- $table_body1 .= "";
+ $table_body1 .= " | ";
if ($_SESSION['prefsProEdition'] == 1) $table_body1 .= $row_scores['brewerBreweryName'];
else $table_body1 .= $row_scores['brewerFirstName']." ".$row_scores['brewerLastName'];
if (($_SESSION['prefsProEdition'] == 0) && ($row_scores['brewCoBrewer'] != "")) $table_body1 .= " ".$label_cobrewer.": ".$row_scores['brewCoBrewer'];
@@ -129,7 +129,7 @@
$table_body1 .= $row_scores['brewName'];
$table_body1 .= " | ";
- $table_body1 .= "";
+ $table_body1 .= " | ";
if ($_SESSION['prefsStyleSet'] == "BA") $table_body1 .= $row_scores['brewStyle'];
else $table_body1 .= $style.": ".$row_scores['brewStyle'];
if ((!empty($row_scores['brewInfo'])) && ($section != "results")) {
@@ -138,13 +138,13 @@
$table_body1 .= " | ";
if ($_SESSION['prefsProEdition'] == 0) {
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= $row_scores['brewerClubs'];
$table_body1 .= " | ";
}
if ($filter == "scores") {
- $table_body1 .= "";
+ $table_body1 .= " | ";
if (!empty($row_scores['scoreEntry'])) $table_body1 .= $row_scores['scoreEntry'];
else $table_body1 .= " ";
$table_body1 .= " | ";
diff --git a/sections/winners_subcategory.sec.php b/sections/winners_subcategory.sec.php
index b944b212..83ea648d 100644
--- a/sections/winners_subcategory.sec.php
+++ b/sections/winners_subcategory.sec.php
@@ -78,12 +78,12 @@
// Build table headers
$table_head1 .= "
";
- $table_head1 .= sprintf("%s | ",$label_place);
- $table_head1 .= sprintf("%s | ",$label_brewer);
- $table_head1 .= sprintf("%s %s | ",$label_entry,$label_name);
- $table_head1 .= sprintf("%s | ",$label_style);
- if ($_SESSION['prefsProEdition'] == 0) $table_head1 .= sprintf("%s | ",$label_club);
- if ($filter == "scores") $table_head1 .= sprintf("Score | ",$label_score);
+ $table_head1 .= sprintf("%s | ",$label_place);
+ $table_head1 .= sprintf("%s | ",$label_brewer);
+ $table_head1 .= sprintf("%s %s | ",$label_entry,$label_name);
+ $table_head1 .= sprintf("%s | ",$label_style);
+ if ($_SESSION['prefsProEdition'] == 0) $table_head1 .= sprintf("%s | ",$label_club);
+ if ($filter == "scores") $table_head1 .= sprintf("Score | ",$label_score);
$table_head1 .= "
";
// Build table body
@@ -117,18 +117,18 @@
$table_body1 .= "";
if ($action == "print") {
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= display_place($row_scores['scorePlace'],1);
$table_body1 .= " | ";
}
else {
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= display_place($row_scores['scorePlace'],2);
$table_body1 .= " | ";
}
- $table_body1 .= "";
+ $table_body1 .= " | ";
if ($_SESSION['prefsProEdition'] == 1) $table_body1 .= $row_scores['brewerBreweryName'];
else $table_body1 .= $row_scores['brewerFirstName']." ".$row_scores['brewerLastName'];
if (($_SESSION['prefsProEdition'] == 0) && ($row_scores['brewCoBrewer'] != "")) $table_body1 .= " ".$label_cobrewer.": ".$row_scores['brewCoBrewer'];
@@ -138,7 +138,7 @@
$table_body1 .= $row_scores['brewName'];
$table_body1 .= " | ";
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= $style.": ".$style_long;
if ((!empty($row_scores['brewInfo'])) && ($section != "results")) {
$table_body1 .= " | ";
@@ -146,13 +146,13 @@
$table_body1 .= "";
if ($_SESSION['prefsProEdition'] == 0) {
- $table_body1 .= "";
+ $table_body1 .= " | ";
$table_body1 .= $row_scores['brewerClubs'];
$table_body1 .= " | ";
}
if ($filter == "scores") {
- $table_body1 .= "";
+ $table_body1 .= " | ";
if (!empty($row_scores['scoreEntry'])) $table_body1 .= $row_scores['scoreEntry'];
else $table_body1 .= " ";
$table_body1 .= " | ";
diff --git a/sql/bcoem_baseline_2.1.X.sql b/sql/bcoem_baseline_2.1.X.sql
index dda55291..b1c36860 100644
--- a/sql/bcoem_baseline_2.1.X.sql
+++ b/sql/bcoem_baseline_2.1.X.sql
@@ -1421,7 +1421,7 @@ CREATE TABLE IF NOT EXISTS `baseline_system` (
--
INSERT INTO `baseline_system` (`id`, `version`, `version_date`, `data_check`, `setup`, `setup_last_step`) VALUES
-(1, '2.1.15.0', '2019-01-09', '2019-01-09 00:00:01', 1, 8);
+(1, '2.1.16.0', '2019-02-01', '2019-02-01 00:00:01', 1, 8);
-- --------------------------------------------------------
diff --git a/update.php b/update.php
index a9084c1f..1283fd08 100644
--- a/update.php
+++ b/update.php
@@ -1,6 +1,6 @@