diff --git a/admin/default.admin.php b/admin/default.admin.php index f3bbb03b..628e7353 100644 --- a/admin/default.admin.php +++ b/admin/default.admin.php @@ -55,7 +55,8 @@ function toggleChecked(status) {
There is a known issue with printing from the Firefox browser. To print all pages properly, RIGHT CLICK on the print link and choose "Open Link in New Tab." Then, use Firefox's native printing function (Edit > Print) to print your documents. Be aware that you should use the browser's File > Page Setup... function to specify portrait or landscape, margins, etc.
0) && ($_SESSION['prefsStyleSet'] == "BJCP2008") && ($_SESSION['userLevel'] == 0)) { +if (($totalRows_log > 0) && ($_SESSION['prefsStyleSet'] == "BJCP2008") && ($_SESSION['userLevel'] == 0)) { + include(DB.'admin_judging_tables.db.php'); $query_flights = sprintf("SELECT id FROM %s", $judging_flights_db_table); diff --git a/includes/db/output_entries_export_winner.db.php b/includes/db/output_entries_export_winner.db.php index b354566c..14a0f2cd 100644 --- a/includes/db/output_entries_export_winner.db.php +++ b/includes/db/output_entries_export_winner.db.php @@ -1,110 +1,110 @@ -"; - if ($totalRows_scores > 0) { - do { - mysql_select_db($database, $brewing); - $query_entries = sprintf("SELECT id,brewBrewerID,brewCoBrewer,brewName,brewStyle,brewCategorySort,brewCategory,brewSubCategory,brewBrewerFirstName,brewBrewerLastName,brewJudgingNumber FROM $brewing_db_table WHERE id='%s'", $row_scores['eid']); - $entries = mysql_query($query_entries, $brewing) or die(mysql_error()); - $row_entries = mysql_fetch_assoc($entries); - - $query_brewer = sprintf("SELECT id,brewerFirstName,brewerLastName,brewerClubs,brewerEmail,brewerAddress,brewerCity,brewerState,brewerZip,brewerCountry,brewerPhone1 FROM $brewer_db_table WHERE uid='%s'", $row_entries['brewBrewerID']); - $brewer = mysql_query($query_brewer, $brewing) or die(mysql_error()); - $row_brewer = mysql_fetch_assoc($brewer); - - $a[] = array($row_sql['tableNumber'],$row_sql['tableName'],$row_entries['brewCategory'],$row_entries['brewSubCategory'],$row_entries['brewStyle'],$row_scores['scorePlace'],strtr($row_brewer['brewerLastName'],$html_remove),strtr($row_brewer['brewerFirstName'],$html_remove),$row_brewer['brewerEmail'],$row_brewer['brewerAddress'],$row_brewer['brewerCity'],$row_brewer['brewerState'],$row_brewer['brewerZip'],$row_brewer['brewerCountry'],$row_brewer['brewerPhone1'],strtr($row_entries['brewName'],$html_remove),$row_brewer['brewerClubs'],$row_entries['brewCoBrewer']); - - } while ($row_scores = mysql_fetch_assoc($scores)); - } -} - -// BY CATEGORY -if ($_SESSION['prefsWinnerMethod'] == 1) { - - $query_styles = sprintf("SELECT brewStyleGroup FROM %s WHERE brewStyleActive='Y' AND brewStyleVersion='%s' ORDER BY brewStyleGroup ASC", $styles_db_table, $_SESSION['prefsStyleSet']); - $styles = mysql_query($query_styles, $brewing) or die(mysql_error()); - $row_styles = mysql_fetch_assoc($styles); - $totalRows_styles = mysql_num_rows($styles); - do { $z[] = $row_styles['brewStyleGroup']; } while ($row_styles = mysql_fetch_assoc($styles)); - - foreach (array_unique($z) as $style) { - $query_entry_count = sprintf("SELECT COUNT(*) as 'count' FROM %s WHERE brewCategorySort='%s' AND brewReceived='1'", $brewing_db_table, $style); - $entry_count = mysql_query($query_entry_count, $brewing) or die(mysql_error()); - $row_entry_count = mysql_fetch_assoc($entry_count); - - $query_score_count = sprintf("SELECT COUNT(*) as 'count' 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); - if (($action == "print") && ($view == "winners")) $query_score_count .= " AND a.scorePlace IS NOT NULL"; - if (($action == "default") && ($view == "default")) $query_score_count .= " AND a.scorePlace IS NOT NULL"; - $score_count = mysql_query($query_score_count, $brewing) or die(mysql_error()); - $row_score_count = mysql_fetch_assoc($score_count); - - if ($row_score_count['count'] > "0") { - - $query_scores = sprintf("SELECT a.scoreTable, a.scorePlace, a.scoreEntry, b.brewName, b.brewCategory, b.brewCategorySort, b.brewSubCategory, b.brewStyle, b.brewCoBrewer, c.brewerLastName, c.brewerFirstName, c.brewerEmail, c.brewerClubs, c.brewerAddress, c.brewerState, c.brewerCity, c.brewerZip, c.brewerPhone1, c.brewerCountry 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); - $query_scores .= " AND a.scorePlace IS NOT NULL"; - $query_scores .= " ORDER BY b.brewCategory,a.scorePlace ASC"; - //echo $query_scores."
"; - $scores = mysql_query($query_scores, $brewing) or die(mysql_error()); - $row_scores = mysql_fetch_assoc($scores); - $totalRows_scores = mysql_num_rows($scores); - - do { - $query_table_name = sprintf("SELECT tableName,tableNumber from %s WHERE id = '%s'",$judging_tables_db_table,$row_scores['scoreTable']); - $table_name = mysql_query($query_table_name, $brewing) or die(mysql_error()); - $row_table_name = mysql_fetch_assoc($table_name); - - $a[] = array($row_table_name['tableNumber'],strtr($row_table_name['tableName'],$html_remove),$row_scores['brewCategory'],$row_scores['brewSubCategory'],$row_scores['brewStyle'],$row_scores['scorePlace'],strtr($row_scores['brewerLastName'],$html_remove),strtr($row_scores['brewerFirstName'],$html_remove),$row_scores['brewerEmail'],$row_scores['brewerAddress'],$row_scores['brewerCity'],$row_scores['brewerState'],$row_scores['brewerZip'],$row_scores['brewerCountry'],$row_scores['brewerPhone1'],strtr($row_scores['brewName'],$html_remove),$row_scores['brewerClubs'],$row_scores['brewCoBrewer']); - } while ($row_scores = mysql_fetch_assoc($scores)); - } - } -} // end if ($_SESSION['prefsWinnerMethod'] == 1) - -// BY SUB-CATEGORY -if ($_SESSION['prefsWinnerMethod'] == 2) { - - $query_styles = sprintf("SELECT brewStyleGroup,brewStyleNum,brewStyleFROM %s WHERE brewStyleActive='Y' AND brewStyleVersion='%s' ORDER BY brewStyleGroup,brewStyleNum ASC", $styles_db_table, $_SESSION['prefsStyleSet']); - $styles = mysql_query($query_styles, $brewing) or die(mysql_error()); - $row_styles = mysql_fetch_assoc($styles); - $totalRows_styles = mysql_num_rows($styles); - do { $b[] = $row_styles['brewStyleGroup']."-".$row_styles['brewStyleNum']; } while ($row_styles = mysql_fetch_assoc($styles)); - - foreach (array_unique($b) as $style) { - $style = explode("-",$style); - - $query_score_count = sprintf("SELECT COUNT(*) as 'count' FROM %s a, %s b, %s c WHERE b.brewCategorySort='%s' AND b.brewSubCategory='%s' AND a.eid = b.id AND a.scorePlace IS NOT NULL AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style[0], $style[1]); - $score_count = mysql_query($query_score_count, $brewing) or die(mysql_error()); - $row_score_count = mysql_fetch_assoc($score_count); - - //echo $row_score_count['count']; - //echo $query_score_count; - if ($row_score_count['count'] > 0) { - - $query_scores = sprintf("SELECT a.scoreTable, a.scorePlace, a.scoreEntry, b.brewName, b.brewCategory, b.brewCategorySort, b.brewSubCategory, b.brewStyle, b.brewCoBrewer, c.brewerLastName, c.brewerFirstName, c.brewerClubs, c.brewerAddress, c.brewerState, c.brewerCity, c.brewerZip, c.brewerPhone1, c.brewerCountry 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]); - $query_scores .= " AND a.scorePlace IS NOT NULL"; - $query_scores .= " ORDER BY b.brewCategory,b.brewSubCategory,a.scorePlace"; - //echo $query_scores; - $scores = mysql_query($query_scores, $brewing) or die(mysql_error()); - $row_scores = mysql_fetch_assoc($scores); - $totalRows_scores = mysql_num_rows($scores); - - do { - $style = $row_scores['brewCategory'].$row_scores['brewSubCategory']; - if ($row_scores['brewCategorySort'] > 28) $style_long = style_convert($row_scores['brewCategorySort'],1); - else $style_long = $row_scores['brewStyle']; - - $query_table_name = sprintf("SELECT tableName,tableNumber from %s WHERE id = '%s'",$judging_tables_db_table,$row_scores['scoreTable']); - $table_name = mysql_query($query_table_name, $brewing) or die(mysql_error()); - $row_table_name = mysql_fetch_assoc($table_name); - - $a[] = array($row_table_name['tableNumber'],strtr($row_table_name['tableName'],$html_remove),$row_scores['brewCategory'],$row_scores['brewSubCategory'],$style_long,$row_scores['scorePlace'],strtr($row_scores['brewerLastName'],$html_remove),strtr($row_scores['brewerFirstName'],$html_remove),$row_scores['brewerEmail'],$row_scores['brewerAddress'],$row_scores['brewerCity'],$row_brewer['brewerState'],$row_scores['brewerZip'],$row_scores['brewerCountry'],$row_scores['brewerPhone1'],strtr($row_scores['brewName'],$html_remove),$row_scores['brewerClubs'],$row_scores['brewCoBrewer']); - } while ($row_scores = mysql_fetch_assoc($scores)); - } - } -} // end if ($_SESSION['prefsWinnerMethod'] == 2) +"; + if ($totalRows_scores > 0) { + do { + mysql_select_db($database, $brewing); + $query_entries = sprintf("SELECT id,brewBrewerID,brewCoBrewer,brewName,brewStyle,brewCategorySort,brewCategory,brewSubCategory,brewBrewerFirstName,brewBrewerLastName,brewJudgingNumber FROM $brewing_db_table WHERE id='%s'", $row_scores['eid']); + $entries = mysql_query($query_entries, $brewing) or die(mysql_error()); + $row_entries = mysql_fetch_assoc($entries); + + $query_brewer = sprintf("SELECT id,brewerFirstName,brewerLastName,brewerClubs,brewerEmail,brewerAddress,brewerCity,brewerState,brewerZip,brewerCountry,brewerPhone1 FROM $brewer_db_table WHERE uid='%s'", $row_entries['brewBrewerID']); + $brewer = mysql_query($query_brewer, $brewing) or die(mysql_error()); + $row_brewer = mysql_fetch_assoc($brewer); + + $a[] = array($row_sql['tableNumber'],$row_sql['tableName'],$row_entries['brewCategory'],$row_entries['brewSubCategory'],$row_entries['brewStyle'],$row_scores['scorePlace'],strtr($row_brewer['brewerLastName'],$html_remove),strtr($row_brewer['brewerFirstName'],$html_remove),$row_brewer['brewerEmail'],$row_brewer['brewerAddress'],$row_brewer['brewerCity'],$row_brewer['brewerState'],$row_brewer['brewerZip'],$row_brewer['brewerCountry'],$row_brewer['brewerPhone1'],strtr($row_entries['brewName'],$html_remove),$row_brewer['brewerClubs'],$row_entries['brewCoBrewer']); + + } while ($row_scores = mysql_fetch_assoc($scores)); + } +} + +// BY CATEGORY +if ($_SESSION['prefsWinnerMethod'] == 1) { + + $query_styles = sprintf("SELECT brewStyleGroup FROM %s WHERE brewStyleActive='Y' AND (brewStyleVersion='%s' OR brewStyleOwn='custom') ORDER BY brewStyleGroup ASC", $styles_db_table, $_SESSION['prefsStyleSet']); + $styles = mysql_query($query_styles, $brewing) or die(mysql_error()); + $row_styles = mysql_fetch_assoc($styles); + $totalRows_styles = mysql_num_rows($styles); + do { $z[] = $row_styles['brewStyleGroup']; } while ($row_styles = mysql_fetch_assoc($styles)); + + foreach (array_unique($z) as $style) { + $query_entry_count = sprintf("SELECT COUNT(*) as 'count' FROM %s WHERE brewCategorySort='%s' AND brewReceived='1'", $brewing_db_table, $style); + $entry_count = mysql_query($query_entry_count, $brewing) or die(mysql_error()); + $row_entry_count = mysql_fetch_assoc($entry_count); + + $query_score_count = sprintf("SELECT COUNT(*) as 'count' 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); + if (($action == "print") && ($view == "winners")) $query_score_count .= " AND a.scorePlace IS NOT NULL"; + if (($action == "default") && ($view == "default")) $query_score_count .= " AND a.scorePlace IS NOT NULL"; + $score_count = mysql_query($query_score_count, $brewing) or die(mysql_error()); + $row_score_count = mysql_fetch_assoc($score_count); + + if ($row_score_count['count'] > "0") { + + $query_scores = sprintf("SELECT a.scoreTable, a.scorePlace, a.scoreEntry, b.brewName, b.brewCategory, b.brewCategorySort, b.brewSubCategory, b.brewStyle, b.brewCoBrewer, c.brewerLastName, c.brewerFirstName, c.brewerEmail, c.brewerClubs, c.brewerAddress, c.brewerState, c.brewerCity, c.brewerZip, c.brewerPhone1, c.brewerCountry 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); + $query_scores .= " AND a.scorePlace IS NOT NULL"; + $query_scores .= " ORDER BY b.brewCategory,a.scorePlace ASC"; + //echo $query_scores."
"; + $scores = mysql_query($query_scores, $brewing) or die(mysql_error()); + $row_scores = mysql_fetch_assoc($scores); + $totalRows_scores = mysql_num_rows($scores); + + do { + $query_table_name = sprintf("SELECT tableName,tableNumber from %s WHERE id = '%s'",$judging_tables_db_table,$row_scores['scoreTable']); + $table_name = mysql_query($query_table_name, $brewing) or die(mysql_error()); + $row_table_name = mysql_fetch_assoc($table_name); + + $a[] = array($row_table_name['tableNumber'],strtr($row_table_name['tableName'],$html_remove),$row_scores['brewCategory'],$row_scores['brewSubCategory'],$row_scores['brewStyle'],$row_scores['scorePlace'],strtr($row_scores['brewerLastName'],$html_remove),strtr($row_scores['brewerFirstName'],$html_remove),$row_scores['brewerEmail'],$row_scores['brewerAddress'],$row_scores['brewerCity'],$row_scores['brewerState'],$row_scores['brewerZip'],$row_scores['brewerCountry'],$row_scores['brewerPhone1'],strtr($row_scores['brewName'],$html_remove),$row_scores['brewerClubs'],$row_scores['brewCoBrewer']); + } while ($row_scores = mysql_fetch_assoc($scores)); + } + } +} // end if ($_SESSION['prefsWinnerMethod'] == 1) + +// BY SUB-CATEGORY +if ($_SESSION['prefsWinnerMethod'] == 2) { + + $query_styles = sprintf("SELECT brewStyleGroup,brewStyleNum,brewStyleFROM %s WHERE brewStyleActive='Y' AND (brewStyleVersion='%s' OR brewStyleOwn='custom') ORDER BY brewStyleGroup,brewStyleNum ASC", $styles_db_table, $_SESSION['prefsStyleSet']); + $styles = mysql_query($query_styles, $brewing) or die(mysql_error()); + $row_styles = mysql_fetch_assoc($styles); + $totalRows_styles = mysql_num_rows($styles); + do { $b[] = $row_styles['brewStyleGroup']."-".$row_styles['brewStyleNum']; } while ($row_styles = mysql_fetch_assoc($styles)); + + foreach (array_unique($b) as $style) { + $style = explode("-",$style); + + $query_score_count = sprintf("SELECT COUNT(*) as 'count' FROM %s a, %s b, %s c WHERE b.brewCategorySort='%s' AND b.brewSubCategory='%s' AND a.eid = b.id AND a.scorePlace IS NOT NULL AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style[0], $style[1]); + $score_count = mysql_query($query_score_count, $brewing) or die(mysql_error()); + $row_score_count = mysql_fetch_assoc($score_count); + + //echo $row_score_count['count']; + //echo $query_score_count; + if ($row_score_count['count'] > 0) { + + $query_scores = sprintf("SELECT a.scoreTable, a.scorePlace, a.scoreEntry, b.brewName, b.brewCategory, b.brewCategorySort, b.brewSubCategory, b.brewStyle, b.brewCoBrewer, c.brewerLastName, c.brewerFirstName, c.brewerClubs, c.brewerAddress, c.brewerState, c.brewerCity, c.brewerZip, c.brewerPhone1, c.brewerCountry 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]); + $query_scores .= " AND a.scorePlace IS NOT NULL"; + $query_scores .= " ORDER BY b.brewCategory,b.brewSubCategory,a.scorePlace"; + //echo $query_scores; + $scores = mysql_query($query_scores, $brewing) or die(mysql_error()); + $row_scores = mysql_fetch_assoc($scores); + $totalRows_scores = mysql_num_rows($scores); + + do { + $style = $row_scores['brewCategory'].$row_scores['brewSubCategory']; + if ($row_scores['brewCategorySort'] > 28) $style_long = style_convert($row_scores['brewCategorySort'],1); + else $style_long = $row_scores['brewStyle']; + + $query_table_name = sprintf("SELECT tableName,tableNumber from %s WHERE id = '%s'",$judging_tables_db_table,$row_scores['scoreTable']); + $table_name = mysql_query($query_table_name, $brewing) or die(mysql_error()); + $row_table_name = mysql_fetch_assoc($table_name); + + $a[] = array($row_table_name['tableNumber'],strtr($row_table_name['tableName'],$html_remove),$row_scores['brewCategory'],$row_scores['brewSubCategory'],$style_long,$row_scores['scorePlace'],strtr($row_scores['brewerLastName'],$html_remove),strtr($row_scores['brewerFirstName'],$html_remove),$row_scores['brewerEmail'],$row_scores['brewerAddress'],$row_scores['brewerCity'],$row_brewer['brewerState'],$row_scores['brewerZip'],$row_scores['brewerCountry'],$row_scores['brewerPhone1'],strtr($row_scores['brewName'],$html_remove),$row_scores['brewerClubs'],$row_scores['brewCoBrewer']); + } while ($row_scores = mysql_fetch_assoc($scores)); + } + } +} // end if ($_SESSION['prefsWinnerMethod'] == 2) ?> \ No newline at end of file diff --git a/includes/db/output_labels_awards.db.php b/includes/db/output_labels_awards.db.php index 8ea01e5a..10ab0cd5 100644 --- a/includes/db/output_labels_awards.db.php +++ b/includes/db/output_labels_awards.db.php @@ -1,140 +1,140 @@ -Add_Label($text); - } - -} while ($row_bos = mysql_fetch_assoc($bos)); - -if ($_SESSION['prefsWinnerMethod'] == "1") { // Output by Category - $query_styles = sprintf("SELECT brewStyleGroup FROM %s WHERE brewStyleActive='Y' AND brewStyleVersion='%s' ORDER BY brewStyleGroup ASC", $styles_db_table, $_SESSION['prefsStyleSet']); - $styles = mysql_query($query_styles, $brewing) or die(mysql_error()); - $row_styles = mysql_fetch_assoc($styles); - $totalRows_styles = mysql_num_rows($styles); - do { $style[] = $row_styles['brewStyleGroup']; } while ($row_styles = mysql_fetch_assoc($styles)); - - - foreach (array_unique($style) as $style) { - $query_entry_count = sprintf("SELECT COUNT(*) as 'count' FROM %s WHERE brewCategorySort='%s' AND brewReceived='1'", $brewing_db_table, $style); - $entry_count = mysql_query($query_entry_count, $brewing) or die(mysql_error()); - $row_entry_count = mysql_fetch_assoc($entry_count); - - $query_score_count = sprintf("SELECT COUNT(*) as 'count' FROM %s a, %s b, %s c WHERE b.brewCategorySort='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID AND (a.scorePlace IS NOT NULL OR a.scorePlace='')", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style); - $score_count = mysql_query($query_score_count, $brewing) or die(mysql_error()); - $row_score_count = mysql_fetch_assoc($score_count); - - - if (($row_entry_count['count'] > 0) && ($row_score_count['count'] > 0)) { - - $query_scores = sprintf("SELECT a.scorePlace, a.scoreEntry, b.brewName, b.brewCategory, b.brewCategorySort, b.brewSubCategory, b.brewStyle, b.brewCoBrewer, c.brewerLastName, c.brewerFirstName, c.brewerClubs FROM %s a, %s b, %s c WHERE b.brewCategorySort='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID AND (a.scorePlace IS NOT NULL OR a.scorePlace='') ORDER BY a.scorePlace", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style); - $scores = mysql_query($query_scores, $brewing) or die(mysql_error()); - $row_scores = mysql_fetch_assoc($scores); - $totalRows_scores = mysql_num_rows($scores); - - do { - $style = $row_scores['brewCategory'].$row_scores['brewSubCategory']; - - $text = sprintf("\n%s%s\n%s\n%s", - display_place($row_scores['scorePlace'],1)." - ", - style_convert($row_scores['brewCategorySort'],1), - strtr($row_scores['brewerFirstName'],$html_remove)." ".strtr($row_scores['brewerLastName'],$html_remove), - strtr($row_scores['brewName'],$html_remove) - ); - $text = iconv('UTF-8', 'windows-1252', $text); - $pdf->Add_Label($text); - } while ($row_scores = mysql_fetch_assoc($scores)); - } - } -} - -elseif ($_SESSION['prefsWinnerMethod'] == "2") { // Output by sub-category - - $query_styles = sprintf("SELECT brewStyleGroup,brewStyleNum,brewStyle FROM %s WHERE brewStyleActive='Y' AND brewStyleVersion='%s' ORDER BY brewStyleGroup,brewStyleNum ASC", $styles_db_table, $_SESSION['prefsStyleSet']); - $styles = mysql_query($query_styles, $brewing) or die(mysql_error()); - $row_styles = mysql_fetch_assoc($styles); - $totalRows_styles = mysql_num_rows($styles); - do { $style[] = $row_styles['brewStyleGroup']."-".$row_styles['brewStyleNum']."-".$row_styles['brewStyle']; } while ($row_styles = mysql_fetch_assoc($styles)); - - foreach (array_unique($style) as $style) { - $style = explode("-",$style); - $query_entry_count = sprintf("SELECT COUNT(*) as 'count' FROM %s WHERE brewCategorySort='%s' AND brewSubCategory='%s' AND brewReceived='1'", $brewing_db_table, $style[0], $style[1]); - $entry_count = mysql_query($query_entry_count, $brewing) or die(mysql_error()); - $row_entry_count = mysql_fetch_assoc($entry_count); - - $query_score_count = sprintf("SELECT COUNT(*) as 'count' FROM %s a, %s b, %s c WHERE b.brewCategorySort='%s' AND b.brewSubCategory='%s' AND a.eid = b.id AND a.scorePlace IS NOT NULL AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style[0], $style[1]); - $score_count = mysql_query($query_score_count, $brewing) or die(mysql_error()); - $row_score_count = mysql_fetch_assoc($score_count); - - - if (($row_entry_count['count'] > 0) && ($row_score_count['count'] > 0)) { - - $query_scores = sprintf("SELECT a.scorePlace, b.brewName, b.brewCategory, b.brewSubCategory, b.brewStyle, c.brewerLastName, c.brewerFirstName, c.brewerClubs 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 AND (a.scorePlace IS NOT NULL OR a.scorePlace='') ORDER BY a.scorePlace", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style[0],$style[1]); - $scores = mysql_query($query_scores, $brewing) or die(mysql_error()); - $row_scores = mysql_fetch_assoc($scores); - $totalRows_scores = mysql_num_rows($scores); - - do { - $text = sprintf("\n%s%s\n%s\n%s", - display_place($row_scores['scorePlace'],1)." - ", - $row_scores['brewCategory'].$row_scores['brewSubCategory'].": ".$row_scores['brewStyle'], - strtr($row_scores['brewerFirstName'],$html_remove)." ".strtr($row_scores['brewerLastName'],$html_remove), - strtr($row_scores['brewName'],$html_remove) - ); - $text = iconv('UTF-8', 'windows-1252', $text); - $pdf->Add_Label($text); - } while ($row_scores = mysql_fetch_assoc($scores)); - } - } -} // end elseif ($_SESSION['prefsWinnerMethod'] == "2") - -else { // Output by Table. - do { - - $query_scores = sprintf("SELECT * FROM %s WHERE scoreTable='%s'", $judging_scores_db_table, $row_tables['id']); - $query_scores .= " AND (scorePlace='1' OR scorePlace='2' OR scorePlace='3' OR scorePlace='4' OR scorePlace='5') ORDER BY scorePlace ASC"; - $scores = mysql_query($query_scores, $brewing) or die(mysql_error()); - $row_scores = mysql_fetch_assoc($scores); - $totalRows_scores = mysql_num_rows($scores); - - do { - $query_entries = sprintf("SELECT id,brewBrewerFirstName,brewBrewerLastName,brewName,brewStyle,brewCategory,brewSubCategory FROM $brewing_db_table WHERE id='%s'", $row_scores['eid']); - $entries = mysql_query($query_entries, $brewing) or die(mysql_error()); - $row_entries = mysql_fetch_assoc($entries); - - $text = sprintf("\n%s%s\n%s\n%s", - display_place($row_scores['scorePlace'],1)." - ", - $row_tables['tableName'], - strtr($row_entries['brewBrewerFirstName'],$html_remove)." ".strtr($row_entries['brewBrewerLastName'],$html_remove), - strtr($row_entries['brewName'],$html_remove) - ); - $text = iconv('UTF-8', 'windows-1252', $text); - $pdf->Add_Label($text); - - } while ($row_scores = mysql_fetch_assoc($scores)); - - } while ($row_tables = mysql_fetch_assoc($tables)); - -} - +Add_Label($text); + } + +} while ($row_bos = mysql_fetch_assoc($bos)); + +if ($_SESSION['prefsWinnerMethod'] == "1") { // Output by Category + $query_styles = sprintf("SELECT brewStyleGroup FROM %s WHERE brewStyleActive='Y' AND (brewStyleVersion='%s' OR brewStyleOwn='custom') ORDER BY brewStyleGroup ASC", $styles_db_table, $_SESSION['prefsStyleSet']); + $styles = mysql_query($query_styles, $brewing) or die(mysql_error()); + $row_styles = mysql_fetch_assoc($styles); + $totalRows_styles = mysql_num_rows($styles); + do { $style[] = $row_styles['brewStyleGroup']; } while ($row_styles = mysql_fetch_assoc($styles)); + + + foreach (array_unique($style) as $style) { + $query_entry_count = sprintf("SELECT COUNT(*) as 'count' FROM %s WHERE brewCategorySort='%s' AND brewReceived='1'", $brewing_db_table, $style); + $entry_count = mysql_query($query_entry_count, $brewing) or die(mysql_error()); + $row_entry_count = mysql_fetch_assoc($entry_count); + + $query_score_count = sprintf("SELECT COUNT(*) as 'count' FROM %s a, %s b, %s c WHERE b.brewCategorySort='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID AND (a.scorePlace IS NOT NULL OR a.scorePlace='')", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style); + $score_count = mysql_query($query_score_count, $brewing) or die(mysql_error()); + $row_score_count = mysql_fetch_assoc($score_count); + + + if (($row_entry_count['count'] > 0) && ($row_score_count['count'] > 0)) { + + $query_scores = sprintf("SELECT a.scorePlace, a.scoreEntry, b.brewName, b.brewCategory, b.brewCategorySort, b.brewSubCategory, b.brewStyle, b.brewCoBrewer, c.brewerLastName, c.brewerFirstName, c.brewerClubs FROM %s a, %s b, %s c WHERE b.brewCategorySort='%s' AND a.eid = b.id AND c.uid = b.brewBrewerID AND (a.scorePlace IS NOT NULL OR a.scorePlace='') ORDER BY a.scorePlace", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style); + $scores = mysql_query($query_scores, $brewing) or die(mysql_error()); + $row_scores = mysql_fetch_assoc($scores); + $totalRows_scores = mysql_num_rows($scores); + + do { + $style = $row_scores['brewCategory'].$row_scores['brewSubCategory']; + + $text = sprintf("\n%s%s\n%s\n%s", + display_place($row_scores['scorePlace'],1)." - ", + style_convert($row_scores['brewCategorySort'],1), + strtr($row_scores['brewerFirstName'],$html_remove)." ".strtr($row_scores['brewerLastName'],$html_remove), + strtr($row_scores['brewName'],$html_remove) + ); + $text = iconv('UTF-8', 'windows-1252', $text); + $pdf->Add_Label($text); + } while ($row_scores = mysql_fetch_assoc($scores)); + } + } +} + +elseif ($_SESSION['prefsWinnerMethod'] == "2") { // Output by sub-category + + $query_styles = sprintf("SELECT brewStyleGroup,brewStyleNum,brewStyle FROM %s WHERE brewStyleActive='Y' AND (brewStyleVersion='%s' OR brewStyleOwn='custom') ORDER BY brewStyleGroup,brewStyleNum ASC", $styles_db_table, $_SESSION['prefsStyleSet']); + $styles = mysql_query($query_styles, $brewing) or die(mysql_error()); + $row_styles = mysql_fetch_assoc($styles); + $totalRows_styles = mysql_num_rows($styles); + do { $style[] = $row_styles['brewStyleGroup']."-".$row_styles['brewStyleNum']."-".$row_styles['brewStyle']; } while ($row_styles = mysql_fetch_assoc($styles)); + + foreach (array_unique($style) as $style) { + $style = explode("-",$style); + $query_entry_count = sprintf("SELECT COUNT(*) as 'count' FROM %s WHERE brewCategorySort='%s' AND brewSubCategory='%s' AND brewReceived='1'", $brewing_db_table, $style[0], $style[1]); + $entry_count = mysql_query($query_entry_count, $brewing) or die(mysql_error()); + $row_entry_count = mysql_fetch_assoc($entry_count); + + $query_score_count = sprintf("SELECT COUNT(*) as 'count' FROM %s a, %s b, %s c WHERE b.brewCategorySort='%s' AND b.brewSubCategory='%s' AND a.eid = b.id AND a.scorePlace IS NOT NULL AND c.uid = b.brewBrewerID", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style[0], $style[1]); + $score_count = mysql_query($query_score_count, $brewing) or die(mysql_error()); + $row_score_count = mysql_fetch_assoc($score_count); + + + if (($row_entry_count['count'] > 0) && ($row_score_count['count'] > 0)) { + + $query_scores = sprintf("SELECT a.scorePlace, b.brewName, b.brewCategory, b.brewSubCategory, b.brewStyle, c.brewerLastName, c.brewerFirstName, c.brewerClubs 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 AND (a.scorePlace IS NOT NULL OR a.scorePlace='') ORDER BY a.scorePlace", $judging_scores_db_table, $brewing_db_table, $brewer_db_table, $style[0],$style[1]); + $scores = mysql_query($query_scores, $brewing) or die(mysql_error()); + $row_scores = mysql_fetch_assoc($scores); + $totalRows_scores = mysql_num_rows($scores); + + do { + $text = sprintf("\n%s%s\n%s\n%s", + display_place($row_scores['scorePlace'],1)." - ", + $row_scores['brewCategory'].$row_scores['brewSubCategory'].": ".$row_scores['brewStyle'], + strtr($row_scores['brewerFirstName'],$html_remove)." ".strtr($row_scores['brewerLastName'],$html_remove), + strtr($row_scores['brewName'],$html_remove) + ); + $text = iconv('UTF-8', 'windows-1252', $text); + $pdf->Add_Label($text); + } while ($row_scores = mysql_fetch_assoc($scores)); + } + } +} // end elseif ($_SESSION['prefsWinnerMethod'] == "2") + +else { // Output by Table. + do { + + $query_scores = sprintf("SELECT * FROM %s WHERE scoreTable='%s'", $judging_scores_db_table, $row_tables['id']); + $query_scores .= " AND (scorePlace='1' OR scorePlace='2' OR scorePlace='3' OR scorePlace='4' OR scorePlace='5') ORDER BY scorePlace ASC"; + $scores = mysql_query($query_scores, $brewing) or die(mysql_error()); + $row_scores = mysql_fetch_assoc($scores); + $totalRows_scores = mysql_num_rows($scores); + + do { + $query_entries = sprintf("SELECT id,brewBrewerFirstName,brewBrewerLastName,brewName,brewStyle,brewCategory,brewSubCategory FROM $brewing_db_table WHERE id='%s'", $row_scores['eid']); + $entries = mysql_query($query_entries, $brewing) or die(mysql_error()); + $row_entries = mysql_fetch_assoc($entries); + + $text = sprintf("\n%s%s\n%s\n%s", + display_place($row_scores['scorePlace'],1)." - ", + $row_tables['tableName'], + strtr($row_entries['brewBrewerFirstName'],$html_remove)." ".strtr($row_entries['brewBrewerLastName'],$html_remove), + strtr($row_entries['brewName'],$html_remove) + ); + $text = iconv('UTF-8', 'windows-1252', $text); + $pdf->Add_Label($text); + + } while ($row_scores = mysql_fetch_assoc($scores)); + + } while ($row_tables = mysql_fetch_assoc($tables)); + +} + ?> \ No newline at end of file diff --git a/includes/db/styles.db.php b/includes/db/styles.db.php index aa261e1e..6e29b71e 100644 --- a/includes/db/styles.db.php +++ b/includes/db/styles.db.php @@ -8,7 +8,7 @@ } else $styleSet = $_SESSION['prefsStyleSet']; -$query_styles = sprintf("SELECT * FROM %s WHERE brewStyleVersion='%s'",$styles_db_table,$styleSet); +$query_styles = sprintf("SELECT * FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom')",$styles_db_table,$styleSet); if ($view != "default") { $explodies = explode("-",$view); $query_styles .= sprintf(" AND brewStyleGroup='%s' AND brewStyleNum='%s'",$explodies[0],$explodies[1]); @@ -31,7 +31,7 @@ $totalRows_styles = mysql_num_rows($styles); if ($section != "list") { - $query_styles2 = sprintf("SELECT * FROM %s WHERE brewStyleVersion='%s'",$styles_db_table,$_SESSION['prefsStyleSet']); + $query_styles2 = sprintf("SELECT * FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom')",$styles_db_table,$_SESSION['prefsStyleSet']); if (($section == "judge") && ($go == "judge")) $query_styles2 .= " AND brewStyleActive='Y' ORDER BY brewStyleGroup,brewStyleNum"; elseif ($section == "brew") $query_styles2 .= " AND brewStyleActive='Y' AND brewStyleGroup > '28' AND brewStyleReqSpec = '1'"; else $query_styles2 .= " AND brewStyleActive='Y' ORDER BY brewStyleGroup,brewStyleNum"; diff --git a/includes/process/process_brewing.inc.php b/includes/process/process_brewing.inc.php index d5e7b337..6892a057 100644 --- a/includes/process/process_brewing.inc.php +++ b/includes/process/process_brewing.inc.php @@ -155,7 +155,7 @@ // Get style name from broken parts mysql_select_db($database, $brewing); - $query_style_name = sprintf("SELECT * FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table, $_SESSION['prefsStyleSet'],$styleFix,$style[1]); + $query_style_name = sprintf("SELECT * FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table, $_SESSION['prefsStyleSet'],$styleFix,$style[1]); $style_name = mysql_query($query_style_name, $brewing) or die(mysql_error()); $row_style_name = mysql_fetch_assoc($style_name); @@ -508,7 +508,7 @@ else $styleFix = $style[0]; // Get style name from broken parts - $query_style_name = sprintf("SELECT * FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$styleFix,$style[1]); + $query_style_name = sprintf("SELECT * FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$styleFix,$style[1]); $style_name = mysql_query($query_style_name, $brewing) or die(mysql_error()); $row_style_name = mysql_fetch_assoc($style_name); $check = $row_style_name['brewStyleOwn']; diff --git a/includes/process/process_judging_flight_check.inc.php b/includes/process/process_judging_flight_check.inc.php index a26123a9..5e09ec05 100644 --- a/includes/process/process_judging_flight_check.inc.php +++ b/includes/process/process_judging_flight_check.inc.php @@ -39,7 +39,7 @@ if (in_array($row_check_received['id'],$empty_array)) { // First, get the id of the entry's style category/subcategory - $query_style = sprintf("SELECT id FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$row_check_received['brewCategorySort'],$row_check_received['brewSubCategory']); + $query_style = sprintf("SELECT id FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$row_check_received['brewCategorySort'],$row_check_received['brewSubCategory']); $style = mysql_query($query_style, $brewing) or die(mysql_error()); $row_style = mysql_fetch_assoc($style); //echo $query_style."
"; @@ -74,7 +74,7 @@ if (!in_array($row_check_received['id'],$flight_array)) { // First, get the id of the entry's style category/subcategory - $query_style = sprintf("SELECT id FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$row_check_received['brewCategorySort'],$row_check_received['brewSubCategory']); + $query_style = sprintf("SELECT id FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$row_check_received['brewCategorySort'],$row_check_received['brewSubCategory']); $style = mysql_query($query_style, $brewing) or die(mysql_error()); $row_style = mysql_fetch_assoc($style); //echo $query_style."
"; diff --git a/includes/process/process_judging_tables.inc.php b/includes/process/process_judging_tables.inc.php index 1c8f8364..46aa06e3 100644 --- a/includes/process/process_judging_tables.inc.php +++ b/includes/process/process_judging_tables.inc.php @@ -180,7 +180,7 @@ $row_table_style = mysql_fetch_assoc($table_style); //echo $query_table_style."
"; - $query_style = sprintf("SELECT id FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$row_entry['brewCategorySort'],$row_entry['brewSubCategory']); + $query_style = sprintf("SELECT id FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'",$styles_db_table,$_SESSION['prefsStyleSet'],$row_entry['brewCategorySort'],$row_entry['brewSubCategory']); $style = mysql_query($query_style, $brewing) or die(mysql_error()); $row_style = mysql_fetch_assoc($style); //echo $query_style."
"; @@ -293,7 +293,7 @@ //echo $query_entry."
"; - $query_style = sprintf("SELECT id FROM $styles_db_table WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $styles_db_table,$_SESSION['prefsStyleSet'],$row_entry['brewCategorySort'],$row_entry['brewSubCategory']); + $query_style = sprintf("SELECT id FROM $styles_db_table WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $styles_db_table,$_SESSION['prefsStyleSet'],$row_entry['brewCategorySort'],$row_entry['brewSubCategory']); $style = mysql_query($query_style, $brewing) or die(mysql_error()); $row_style = mysql_fetch_assoc($style); diff --git a/includes/process/process_styles.inc.php b/includes/process/process_styles.inc.php index 38041224..d148b43f 100644 --- a/includes/process/process_styles.inc.php +++ b/includes/process/process_styles.inc.php @@ -68,7 +68,7 @@ if ($_SESSION['prefsStyleSet'] == "BJCP2008") $category_end = 28; if ($_SESSION['prefsStyleSet'] == "BJCP2015") $category_end = 34; mysql_select_db($database, $brewing); - $query_style_name = sprintf("SELECT brewStyleGroup FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup >= %s ORDER BY id DESC LIMIT 1", $styles_db_table, $_SESSION['prefsStyleSet'], $category_end); + $query_style_name = sprintf("SELECT brewStyleGroup FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup >= %s ORDER BY id DESC LIMIT 1", $styles_db_table, $_SESSION['prefsStyleSet'], $category_end); $style_name = mysql_query($query_style_name, $brewing) or die(mysql_error()); $row_style_name = mysql_fetch_assoc($style_name); diff --git a/index.php b/index.php index 5b57ce76..b3b32277 100644 --- a/index.php +++ b/index.php @@ -135,24 +135,23 @@ ".$timezone_offset; echo "
".$_SESSION['prefsTimeZone']; echo "
".date('T'); + echo "User Agent: ".$_SERVER['HTTP_USER_AGENT']."
"; + if ($fx) echo "FIREFOX Detected
"; - echo $section."
"; - echo "User: ".$query_user."
"; - echo "Brewer: ".$query_brewer."
"; - echo "Name: ".$query_name."
"; - echo "Prefs: ".$query_prefs."
"; - echo "Comp Info: ".$row_contest_info."
"; - echo "Tables: ".$query_tables."
"; - echo $entry_window_open."
"; - echo $registration_open."
"; - echo judging_date_return()."
"; - echo $remaining_entries."
"; - echo $today."
"; - echo $_SESSION['dataCheck'.$prefix_session]."
"; + echo "Time Zone Name: ".$tz."
"; + echo "Time Zone: ".date('T')."
"; + echo "Time Zone Offset: ".$timezone_offset."
"; + echo "Time Zone Preferences: ".$_SESSION['prefsTimeZone']."
"; + echo "

"; + echo "Section: ".$section."
"; + echo "Entry Window Status: ".$entry_window_open."
"; + echo "Registration Status: ".$registration_open."
"; + echo "Judging Status: ".judging_date_return()."
"; + echo "Remaining Entries: ".$remaining_entries."
"; + echo "

"; + echo "

Session Variables: "; + print_r($_SESSION); + echo "

"; } if ($section != "admin") { ?> diff --git a/lib/admin.lib.php b/lib/admin.lib.php index 7d63470e..9d120a91 100644 --- a/lib/admin.lib.php +++ b/lib/admin.lib.php @@ -692,7 +692,7 @@ function table_score_data($eid,$score_table,$suffix) { $row_entries = mysql_fetch_assoc($entries); $style = $row_entries['brewCategorySort'].$row_entries['brewSubCategory']; - $query_styles = sprintf("SELECT brewStyle FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$_SESSION['prefsStyleSet'],$row_entries['brewCategorySort'],$row_entries['brewSubCategory']); + $query_styles = sprintf("SELECT brewStyle FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$_SESSION['prefsStyleSet'],$row_entries['brewCategorySort'],$row_entries['brewSubCategory']); $styles = mysql_query($query_styles, $brewing) or die(mysql_error()); $row_styles = mysql_fetch_assoc($styles); @@ -732,7 +732,7 @@ function received_entries() { mysql_select_db($database, $brewing); $style_array = array(); - $query_styles = sprintf("SELECT brewStyle FROM %s WHERE brewStyleVersion='%s'", $prefix."styles",$_SESSION['prefsStyleSet']); + $query_styles = sprintf("SELECT brewStyle FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom')", $prefix."styles",$_SESSION['prefsStyleSet']); $styles = mysql_query($query_styles, $brewing) or die(mysql_error()); $row_styles = mysql_fetch_array($styles); diff --git a/lib/common.lib.php b/lib/common.lib.php index 4ed06b8d..12c6fa67 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1367,7 +1367,7 @@ function style_convert($number,$type,$base_url="") { $styles_db_table = $prefix."styles"; mysql_select_db($database, $brewing); - $query_style = sprintf("SELECT brewStyleNum,brewStyleGroup,brewStyle,brewStyleVersion,brewStyleReqSpec FROM %s WHERE brewStyleGroup='%s' AND brewStyleVersion='%s'",$styles_db_table,$number,$_SESSION['prefsStyleSet']); + $query_style = sprintf("SELECT brewStyleNum,brewStyleGroup,brewStyle,brewStyleVersion,brewStyleReqSpec FROM %s WHERE brewStyleGroup='%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')",$styles_db_table,$number,$_SESSION['prefsStyleSet']); $style = mysql_query($query_style, $brewing) or die(mysql_error()); $row_style = mysql_fetch_assoc($style); @@ -1672,7 +1672,7 @@ function style_convert($number,$type,$base_url="") { // case "9": $number = explode("^",$number); - $query_style = sprintf("SELECT brewStyleNum,brewStyleGroup,brewStyle,brewStyleVersion,brewStyleReqSpec,brewStyleStrength,brewStyleCarb,brewStyleSweet FROM %s WHERE brewStyleGroup='%s' AND brewStyleNum='%s' AND brewStyleVersion='%s'",$styles_db_table,$number[0],$number[1],$_SESSION['prefsStyleSet']); + $query_style = sprintf("SELECT brewStyleNum,brewStyleGroup,brewStyle,brewStyleVersion,brewStyleReqSpec,brewStyleStrength,brewStyleCarb,brewStyleSweet FROM %s WHERE brewStyleGroup='%s' AND brewStyleNum='%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')",$styles_db_table,$number[0],$number[1],$_SESSION['prefsStyleSet']); $style = mysql_query($query_style, $brewing) or die(mysql_error()); $row_style = mysql_fetch_assoc($style); $style_convert = $row_style['brewStyleGroup']."^".$row_style['brewStyleNum']."^".$row_style['brewStyle']."^".$row_style['brewStyleVersion']."^".$row_style['brewStyleReqSpec']."^".$row_style['brewStyleStrength']."^".$row_style['brewStyleCarb']."^".$row_style['brewStyleSweet']; @@ -1855,7 +1855,7 @@ function get_table_info($input,$method,$id,$dbTable,$param) { $input = explode("^",$input); /* - $query_style = sprintf("SELECT brewStyleNum,brewStyleGroup FROM $styles_db_table WHERE brewStyleNum='%s' AND brewStyleGroup='%s' AND brewStyleVersion='%s'",$input[0],$input[1],$_SESSION['prefsStyleSet']); + $query_style = sprintf("SELECT brewStyleNum,brewStyleGroup FROM $styles_db_table WHERE brewStyleNum='%s' AND brewStyleGroup='%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom'))",$input[0],$input[1],$_SESSION['prefsStyleSet']); $style = mysql_query($query_style, $brewing) or die(mysql_error()); $row_style = mysql_fetch_assoc($style); echo $query_style."
"; @@ -2332,7 +2332,7 @@ function winner_check($id,$judging_scores_db_table,$judging_tables_db_table,$bre $entry = mysql_query($query_entry, $brewing) or die(mysql_error()); $row_entry = mysql_fetch_assoc($entry); - $query_style = sprintf("SELECT brewStyle FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles", $_SESSION['prefsStyleSet'], $row_entry['brewCategorySort'],$row_entry['brewSubCategory']); + $query_style = sprintf("SELECT brewStyle FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles", $_SESSION['prefsStyleSet'], $row_entry['brewCategorySort'],$row_entry['brewSubCategory']); $style = mysql_query($query_style, $brewing) or die(mysql_error()); $row_style = mysql_fetch_assoc($style); @@ -3003,7 +3003,7 @@ function limit_subcategory($style,$pref_num,$pref_exception_sub_num,$pref_except if ($style_break[0] <= 9) $style_num = "0".$style_break[0]; else $style_num = $style_break[0]; - $query_style = sprintf("SELECT id FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'",$prefix."styles",$_SESSION['prefsStyleSet'],$style_num,$style_break[1]); + $query_style = sprintf("SELECT id FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'",$prefix."styles",$_SESSION['prefsStyleSet'],$style_num,$style_break[1]); $style = mysql_query($query_style, $brewing) or die(mysql_error()); $row_style = mysql_fetch_assoc($style); @@ -3037,7 +3037,7 @@ function highlight_required($msg,$method,$version) { if ($method == "0") { // mead cider sweetness - $query_check = sprintf("SELECT brewStyleSweet FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]); + $query_check = sprintf("SELECT brewStyleSweet FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]); $check = mysql_query($query_check, $brewing) or die(mysql_error()); $row_check = mysql_fetch_assoc($check); $totalRows_check = mysql_num_rows($check); @@ -3050,7 +3050,7 @@ function highlight_required($msg,$method,$version) { if ($method == "1") { // special ingredients REQUIRED beer/mead/cider - $query_check = sprintf("SELECT brewStyleReqSpec FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]); + $query_check = sprintf("SELECT brewStyleReqSpec FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]); $check = mysql_query($query_check, $brewing) or die(mysql_error()); $row_check = mysql_fetch_assoc($check); @@ -3061,7 +3061,7 @@ function highlight_required($msg,$method,$version) { if ($method == "2") { // mead cider carb - $query_check = sprintf("SELECT brewStyleCarb FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]); + $query_check = sprintf("SELECT brewStyleCarb FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]); $check = mysql_query($query_check, $brewing) or die(mysql_error()); $row_check = mysql_fetch_assoc($check); @@ -3072,7 +3072,7 @@ function highlight_required($msg,$method,$version) { if ($method == "3") { // mead strength - $query_check = sprintf("SELECT brewStyleStrength FROM %s WHERE brewStyleVersion='%s' AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]); + $query_check = sprintf("SELECT brewStyleStrength FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleGroup='%s' AND brewStyleNum='%s'", $prefix."styles",$version,$explodies[1],$explodies[2]); $check = mysql_query($query_check, $brewing) or die(mysql_error()); $row_check = mysql_fetch_assoc($check); @@ -3149,7 +3149,7 @@ function styles_active($method) { if ($method == 0) { // Active Styles - $query_styles = sprintf("SELECT brewStyleGroup FROM %s WHERE brewStyleVersion='%s' AND brewStyleActive='Y' ORDER BY brewStyleGroup ASC",$prefix."styles",$_SESSION['prefsStyleSet']); + $query_styles = sprintf("SELECT brewStyleGroup FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleActive='Y' ORDER BY brewStyleGroup ASC",$prefix."styles",$_SESSION['prefsStyleSet']); $styles = mysql_query($query_styles, $brewing) or die(mysql_error()); $row_styles = mysql_fetch_assoc($styles); $totalRows_styles = mysql_num_rows($styles); @@ -3171,7 +3171,7 @@ function styles_active($method) { if ($method == 2) { - $query_styles = sprintf("SELECT brewStyleGroup,brewStyleNum,brewStyle FROM %s WHERE brewStyleVersion='%s' AND brewStyleActive='Y' ORDER BY brewStyleGroup,brewStyleNum ASC",$prefix."styles",$_SESSION['prefsStyleSet']); + $query_styles = sprintf("SELECT brewStyleGroup,brewStyleNum,brewStyle FROM %s WHERE (brewStyleVersion='%s' OR brewStyleOwn='custom') AND brewStyleActive='Y' ORDER BY brewStyleGroup,brewStyleNum ASC",$prefix."styles",$_SESSION['prefsStyleSet']); $styles = mysql_query($query_styles, $brewing) or die(mysql_error()); $row_styles = mysql_fetch_assoc($styles); $totalRows_styles = mysql_num_rows($styles); diff --git a/lib/process.lib.php b/lib/process.lib.php index fd6a7c00..2a4e2ef3 100644 --- a/lib/process.lib.php +++ b/lib/process.lib.php @@ -204,7 +204,7 @@ function check_carb_sweetness($style,$styleSet) { if (preg_match("/^[[:digit:]]+$/",$style[0])) $style_0 = sprintf('%02d',$style[0]); else $style_0 = $style[0]; - $query_brews = sprintf("SELECT brewStyleCarb,brewStyleSweet FROM %s WHERE brewStyleGroup = '%s' AND brewStyleNum = '%s' AND brewStyleVersion='%s'", $prefix."styles", $style_0, $style[1], $styleSet); + $query_brews = sprintf("SELECT brewStyleCarb,brewStyleSweet FROM %s WHERE brewStyleGroup = '%s' AND brewStyleNum = '%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')", $prefix."styles", $style_0, $style[1], $styleSet); $brews = mysql_query($query_brews, $brewing) or die(mysql_error()); $row_brews = mysql_fetch_assoc($brews); @@ -222,7 +222,7 @@ function check_mead_strength($style,$styleSet) { if (preg_match("/^[[:digit:]]+$/",$style[0])) $style_0 = sprintf('%02d',$style[0]); else $style_0 = $style[0]; - $query_brews = sprintf("SELECT brewStyleStrength FROM %s WHERE brewStyleGroup = '%s' AND brewStyleNum = '%s' AND brewStyleVersion='%s'", $prefix."styles", $style_0, $style[1], $styleSet); + $query_brews = sprintf("SELECT brewStyleStrength FROM %s WHERE brewStyleGroup = '%s' AND brewStyleNum = '%s' AND (brewStyleVersion='%s' OR brewStyleOwn='custom')", $prefix."styles", $style_0, $style[1], $styleSet); $brews = mysql_query($query_brews, $brewing) or die(mysql_error()); $row_brews = mysql_fetch_assoc($brews); diff --git a/paths.php b/paths.php index e54ef5dd..80438d34 100644 --- a/paths.php +++ b/paths.php @@ -1,33 +1,34 @@ - \ No newline at end of file diff --git a/sections/beerxml.sec.php b/sections/beerxml.sec.php index 62418ece..f443c6ef 100644 --- a/sections/beerxml.sec.php +++ b/sections/beerxml.sec.php @@ -1,134 +1,207 @@ -"; -echo $entry_window_open."
"; -echo $remaining_entries."
"; -echo $_SESSION['userLevel']; - -$php_version = "4.0.1"; - */ - - -// Disaable entry add/edit if registration closed and entry window closed -if (($registration_open != 1) && ($entry_window_open != 1) && ($_SESSION['userLevel'] > 1)) { - echo "
Importing Entries Not Available
"; - if ($registration_open == "0") echo "

Entry registration has not opened yet.

"; - if ($registration_open == "2") echo "

Entry registration has closed.

"; -} - -// Open but entry limit reached -// No importing -elseif (($registration_open == 1) && ($_SESSION['userLevel'] > 1) && ($comp_entry_limit)) { - echo "
Importing Entries Not Available
"; - echo "

The competition entry limit has been reached.

"; -} - -// Open but personal entry limit reached -// No importing -elseif (($registration_open == 1) && ($entry_window_open == 1) && ($_SESSION['userLevel'] > 1) && ($remaining_entries == 0)) { - echo "
Adding Entries Not Available
"; - echo "

Your personal entry limit has been reached.

"; -} - -// Registration open, but entry window not -// No importing -elseif (($registration_open == 1) && ($entry_window_open != 1) && ($_SESSION['userLevel'] > 1)) { - echo "
Importing Entries Not Available
"; - echo "

You will be able to add or import entries on or after $entry_open.

"; -} - -// Special for NHC -// No importing -elseif ((NHC) && ($_SESSION['userLevel'] > 1) && ($registration_open != 1) && ($prefix != "final_")) { - echo "
Importing Entries Not Available
"; - echo "

NHC registration has closed.

"; -} - -// Special for NHC -// Close adding or editing during the entry window as well -elseif ((NHC) && ($_SESSION['userLevel'] > 1) && ($registration_open != 1) && ($entry_window_open != 1) && ($prefix == "final_")) { - echo "
Importing Entries Not Available
"; - echo "

NHC registration has closed.

"; -} - -else { - - if ($php_version >= 5) { - - $message = ""; - $return = ""; - include (INCLUDES.'beerXML/input_beer_xml.inc.php'); - $MAX_SIZE = 2000000; - $FILE_MIMES = array('text/xml'); - $FILE_EXTS = array('.xml'); - $DELETABLE = false; - $url_this = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; - - if(!$_REQUEST['inserted'] == "true") $_SESSION['recipes'] = ""; - - if ($_FILES['userfile']) { - $file_type = $_FILES['userfile']['type']; - $file_name = $_FILES['userfile']['name']; - $file_ext = strtolower(substr($file_name,strrpos($file_name,"."))); - - // File size check - if ($_FILES['userfile']['size'] > $MAX_SIZE) - $message .= "The file size is over 2MB. Please adjust the size and try again."; - - //File type and extension check - elseif (!in_array($file_type, $FILE_MIMES) && !in_array($file_ext, $FILE_EXTS)) - $message .= "Sorry, that file type is not allowed to be uploaded. Only .xml file extensions are allowed."; - - // Check if file uploaded, if so, parse. - elseif(is_uploaded_file($_FILES['userfile']['tmp_name'])) { - - $input = new InputBeerXML($_FILES['userfile']['tmp_name']); - - if($_POST["insert_type"] == "recipes"){ - $insertedRecipes = $input->insertRecipes(); - if (count($insertedRecipes) > 1) $message .= ucwords(readable_number(count($insertedRecipes))) . " entries added."; - else $message .= ucwords(readable_number(count($insertedRecipes))) . " entry added."; - } - - $_SESSION['recipes'] = $recipes; - } - print ""; - } - elseif (!$_FILES['userfile']) $message .= ""; - else $message .= "Invalid file specified."; - if (($action != "print") && ($msg != "default")) echo $msg_output; - if (!empty($message)) echo "
".$message."
"; - if (entries_unconfirmed($_SESSION['user_id']) > 0) { - echo "
You have unconfirmed entries. Please go to your entry list to confirm all your entry data. Unconfirmed entry data will be deleted every 24 hours.
"; - } -?> - -

BeerXML Import Help

-

Browse for your BeerXML compliant file on your hard drive that you exported from BeerSmith, BrewBlogger, etc. and click Upload.

-
- - - - - - - - -
BeerXML File:
 
- - - - -
- = "5") - - else echo "
Your server's version of PHP does not support the BeerXML import feature.
-

PHP version 5.x or higher is required — this server is running PHP version ".$php_version.".

"; - -} // end else ?> +"; +echo $entry_window_open."
"; +echo $remaining_entries."
"; +echo $_SESSION['userLevel']; + +$php_version = "4.0.1"; + */ + + +/* ---------------- USER 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 + $primary_links = top of page links + $secondary_links = sublinks + + $header1_X = an

header on the page + $header2_X = an

subheader on the page + + $page_infoX = the bulk of the information on the page. + + $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 = "

PrintPrint This Page

"; + +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 ($php_version >= 5) $php_OK = TRUE; else $php_OK = FALSE; +$upload_form_display = FALSE; + +$message1 = ""; +$message2 = ""; +$message3 = ""; +$message4 = ""; +$message5 = ""; +$message6 = ""; +$message7 = ""; +$message8 = ""; +$message9 = ""; + +// Build Links +$help_link = "

My Info and Entries Help

"; + +// Build Messages + +// Disaable entry add/edit if registration closed and entry window closed +if (($registration_open != 1) && ($entry_window_open != 1) && ($_SESSION['userLevel'] > 1)) { + $message1 .= "
Importing Entries Not Available
"; + if ($registration_open == "0") $message1 .= "

Entry registration has not opened yet.

"; + if ($registration_open == "2") $message1 .= "

Entry registration has closed.

"; +} + +// Open but entry limit reached +// No importing +elseif (($registration_open == 1) && ($_SESSION['userLevel'] > 1) && ($comp_entry_limit)) { + $message2 .= "
Importing Entries Not Available
"; + $message2 .= "

The competition entry limit has been reached.

"; +} + +// Open but personal entry limit reached +// No importing +elseif (($registration_open == 1) && ($entry_window_open == 1) && ($_SESSION['userLevel'] > 1) && ($remaining_entries == 0)) { + $message3 .= "
Adding Entries Not Available
"; + $message3 .= "

Your personal entry limit has been reached.

"; +} + +// Registration open, but entry window not +// No importing +elseif (($registration_open == 1) && ($entry_window_open != 1) && ($_SESSION['userLevel'] > 1)) { + $message4 .= "
Importing Entries Not Available
"; + $message4 .= "

You will be able to add or import entries on or after $entry_open.

"; +} + +// Special for NHC +// No importing +elseif ((NHC) && ($_SESSION['userLevel'] > 1) && ($registration_open != 1) && ($prefix != "final_")) { + $message5 .= "
Importing Entries Not Available
"; + $message5 .= "

NHC registration has closed.

"; +} + +// Special for NHC +// Close adding or editing during the entry window as well +elseif ((NHC) && ($_SESSION['userLevel'] > 1) && ($registration_open != 1) && ($entry_window_open != 1) && ($prefix == "final_")) { + $message6 .= "
Importing Entries Not Available
"; + $message6 .= "

NHC registration has closed.

"; +} + +else { + + if ($php_OK) { + $upload_form_display = TRUE; + $message = ""; + $return = ""; + include (INCLUDES.'beerXML/input_beer_xml.inc.php'); + $MAX_SIZE = 2000000; + $FILE_MIMES = array('text/xml'); + $FILE_EXTS = array('.xml'); + $DELETABLE = false; + $url_this = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; + + if(!$_REQUEST['inserted'] == "true") $_SESSION['recipes'] = ""; + + if ($_FILES['userfile']) { + $file_type = $_FILES['userfile']['type']; + $file_name = $_FILES['userfile']['name']; + $file_ext = strtolower(substr($file_name,strrpos($file_name,"."))); + + // File size check + if ($_FILES['userfile']['size'] > $MAX_SIZE) + $message .= "The file size is over 2MB. Please adjust the size and try again."; + + //File type and extension check + elseif (!in_array($file_type, $FILE_MIMES) && !in_array($file_ext, $FILE_EXTS)) + $message .= "Sorry, that file type is not allowed to be uploaded. Only .xml file extensions are allowed."; + + // Check if file uploaded, if so, parse. + elseif(is_uploaded_file($_FILES['userfile']['tmp_name'])) { + + $input = new InputBeerXML($_FILES['userfile']['tmp_name']); + + if($_POST["insert_type"] == "recipes"){ + $insertedRecipes = $input->insertRecipes(); + if (count($insertedRecipes) > 1) $message .= ucwords(readable_number(count($insertedRecipes))) . " entries added."; + else $message .= ucwords(readable_number(count($insertedRecipes))) . " entry added."; + } + + $_SESSION['recipes'] = $recipes; + } + print ""; + } + elseif (!$_FILES['userfile']) $message .= ""; + else $message .= "Invalid file specified."; + if (($action != "print") && ($msg != "default")) echo $msg_output; + if (!empty($message)) $message7 .= "
".$message."
"; + if (entries_unconfirmed($_SESSION['user_id']) > 0) { + $message8 .= "
You have unconfirmed entries. Please go to your entry list to confirm all your entry data. Unconfirmed entry data will be deleted every 24 hours.
"; + } + } +} +if (!$php_OK) $message9 .= "
Your server's version of PHP does not support the BeerXML import feature.

PHP version 5.x or higher is required — this server is running PHP version ".$php_version.".

"; + + +// -------------------------------------------------------------- +// Display +// -------------------------------------------------------------- + +echo $message1; +echo $message2; +echo $message3; +echo $message4; +echo $message5; +echo $message6; +echo $message7; +echo $message8; +echo $message9; +echo $help_link; + +if ($upload_form_display) { ?> +

Browse for your BeerXML compliant file on your hard drive click Upload.

+
+ + + + + + + + +
BeerXML File:
 
+ + + + +
+ + + + + + diff --git a/sections/bos.sec.php b/sections/bos.sec.php index 7b467d85..e128881b 100644 --- a/sections/bos.sec.php +++ b/sections/bos.sec.php @@ -1,132 +1,276 @@ - 0) { - - $random = random_generator(6,2); - - if ($action == "print") echo '"; -if ($go != "admin") echo $info_msg; - -if ($section == "step2") { -?> -
- - - - - - - -

My Info and Entries Help

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1) { ?> - - - - - - - - - - - - 1) { ?> - - - - - - " /> - " /> - - - - - - - -
First Name:" size="32" maxlength="20" 1)) echo "readonly style='color:#666; background-color: #eee; border: 1px solid #666;'"; ?>>RequiredPlease enter only one person's name.
- You will be able to identify a co-brewer when adding your entries.
Last Name:" size="32" maxlength="20" 1)) echo "readonly"; ?>Required
Street Address:" size="32">Required 
City:" size="32">Required 
State or Province:" size="32">Required 
Zip or Postal Code:" size="32">Required 
Country: - - Required 
Phone 1:" size="32">Required 
Phone 2:" size="32">  
Drop-Off Location: - - Please indicate where you will be dropping off your entries.
Club Name: - -
Club Name:" size="32" maxlength="200">  
AHA Member Number: - = "999999994")) { // For use with NHC ?> - Pending - - " size="11" maxlength="9" /> - -
Stewarding:Are you willing be a steward in this competition? /> Yes
/> No
 
Stewarding
Location Availabilty:
- - - - - - -
- -
- -
Judging:Are you willing and qualified to judge in this competition? /> Yes
/> No
 
Judging
Location Availability:
- - - - - - -
- -
- -
Please complete the following information and click "Submit Brewer Information."
-

- - " /> - " /> - - - - - - - - "> -
-You can only edit your own profile."; +The information here beyond your first name, last name, and club is strictly for record-keeping and contact purposes. A condition of entry into the competition is providing this information. Your name and club may be displayed should one of your entries place, but no other information will be made public."; +if ($go != "admin") echo $info_msg; +if ($section == "step2") { +?> +
+ + + + + + + +

My Info and Entries Help

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1) { ?> + + + + + + + + + + + + 1) { ?> + + + + + + " /> + " /> + + + + + + + +
First Name:" size="32" maxlength="20" 1)) echo "readonly style='color:#666; background-color: #eee; border: 1px solid #666;'"; ?>>RequiredPlease enter only one person's name.
+ You will be able to identify a co-brewer when adding your entries.
Last Name:" size="32" maxlength="20" 1)) echo "readonly"; ?>Required
Street Address:" size="32">Required 
City:" size="32">Required 
State or Province:" size="32">Required 
Zip or Postal Code:" size="32">Required 
Country: + + Required 
Phone 1:" size="32">Required 
Phone 2:" size="32">  
Drop-Off Location: + + Please indicate where you will be dropping off your entries.
Club Name: + +
Club Name:" size="32" maxlength="200">  
AHA Member Number: + = "999999994")) { // For use with NHC ?> + Pending + + " size="11" maxlength="9" /> + +
Stewarding:Are you willing be a steward in this competition? /> Yes
/> No
 
Stewarding
Location Availabilty:
+ + + + + + +
+ +
+ +
Judging:Are you willing and qualified to judge in this competition? /> Yes
/> No
 
Judging
Location Availability:
+ + + + + + +
+ +
+ +
Please complete the following information and click "Submit Brewer Information."
+

+ + " /> + " /> + + + + + + + + "> +
+You can only edit your own profile."; ?> \ No newline at end of file diff --git a/sections/brewer_entries.sec.php b/sections/brewer_entries.sec.php index df728155..c796b43f 100644 --- a/sections/brewer_entries.sec.php +++ b/sections/brewer_entries.sec.php @@ -7,6 +7,74 @@ * */ +/* ---------------- USER 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 + $primary_links = top of page links + $secondary_links = sublinks + + $header1_X = an

header on the page + $header2_X = an

subheader on the page + + $page_infoX = the bulk of the information on the page. + + $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 = "

PrintPrint This Page

"; + +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 --------------------- */ + + +$primary_page_info = ""; +$primary_links = ""; +$secondary_links = ""; +$header1_1 = ""; +$page_info1 = ""; +$header1_2 = ""; +$page_info2 = ""; +$table_head1 = ""; +$table_body1 = ""; + +// Page specific variables +$entry_message = ""; +$remaining_message = ""; +$discount_fee_message = ""; +$entry_fee_message = ""; +$nhc_message_1 = ""; +$nhc_message_2 = ""; +$add_entry_link = ""; +$beer_xml_link = ""; +$print_list_link = ""; +$pay_fees_message = ""; +$firefox_warning = ""; + + + +// Build Headers +$header1_1 .= "

Entries

"; + +$firefox_warning .= "
There is a known issue with printing from the Firefox browser. To print all pages properly from Firefox, RIGHT CLICK on any print link and choose \"Open Link in New Tab.\" Then, use Firefox's native printing function (Edit > Print) to print your documents. Be aware that you should use the browser's File > Page Setup... function to specify portrait or landscape, margins, etc.
"; + // Show Scores? if ((judging_date_return() == 0) && ($entry_window_open == 2) && ($registration_open == 2) && ($judge_window_open == 2) && ($_SESSION['prefsDisplayWinners'] == "Y") && (judging_winner_display($delay))) $show_scores = TRUE; else $show_scores = FALSE; @@ -32,17 +100,6 @@ } // Build Messages and Links -$entry_message = ""; -$remaining_message = ""; -$discount_fee_message = ""; -$entry_fee_message = ""; -$nhc_message_1 = ""; -$nhc_message_2 = ""; -$add_entry_link = ""; -$beer_xml_link = ""; -$print_list_link = ""; -$pay_fees_message = ""; - if (($registration_open >= 1) && ($entry_window_open >=1)) { $entry_message .= "
"; $entry_message .= ""; @@ -81,23 +138,21 @@ $remaining_message .= "
"; } - //if (($entry_window_open == 1) && (!$comp_entry_limit)) { - // Build Add Entry Link - $add_entry_link .= ""; - $add_entry_link .= "Add Entry"; - $add_entry_link .= ""; - $beer_xml_link .= "Import Entries Using BeerXML"; - $beer_xml_link .= ""; - //} - + // Build Add Entry Link + $add_entry_link .= ""; + $add_entry_link .= "Add Entry"; + $add_entry_link .= ""; + $beer_xml_link .= "Import Entries Using BeerXML"; + $beer_xml_link .= ""; + // Build Print List of Entries Link $print_list_link .= ""; $print_list_link .= "Print Entry List"; @@ -224,53 +279,39 @@ } // end if (($registration_open == 1) && (($entry_open == 1) || ($entry_open == 2))) - -// ------------------------ Display ------------------------------- - -echo "

Entries

"; - -if ($fx) echo "
There is a known issue with printing from the Firefox browser. To print all pages properly from Firefox, RIGHT CLICK on any print link and choose \"Open Link in New Tab.\" Then, use Firefox's native printing function (Edit > Print) to print your documents. Be aware that you should use the browser's File > Page Setup... function to specify portrait or landscape, margins, etc.
"; - -// Display Warnings and Entry Message -if (($totalRows_log > 0) && ($action != "print")) { - echo $warnings; - echo $entry_message; -} - -if (($action != "print") && ($entry_window_open > 0)) { - - // Display Add Entry, Beer XML and Print List of Entries Links - if ((judging_date_return() > 0) && (!$comp_entry_limit)) echo $remaining_message; - echo "
"; +// Compile Primary Links +// Add Entry, Beer XML and Print List of Entries Links + if ((judging_date_return() > 0) && (!$comp_entry_limit)) $primary_links .= $remaining_message; + $primary_links .= "
"; if (($remaining_entries > 0) && ($entry_window_open == 1) && (judging_date_return() > 0) && (!$comp_entry_limit)) { - echo $add_entry_link; - if ((!NHC) && ($_SESSION['prefsHideRecipe'] == "N")) echo $beer_xml_link; + $primary_links .= $add_entry_link; + if ((!NHC) && ($_SESSION['prefsHideRecipe'] == "N")) $primary_links .= $beer_xml_link; } - echo $print_list_link; - echo "
"; + $primary_links .= $print_list_link; + $primary_links .= "
"; +// Compile Messages +// Entry Fee and Discount Info +if (($registration_open >= 1) && ($entry_window_open >= 1)) { + if ((!NHC) || ((NHC) && ($prefix != "final_"))) { + $page_info1 .= "
"; + $page_info1 .= $entry_fee_message; + if (($_SESSION['brewerDiscount'] == "Y") && ($_SESSION['contestEntryFeePasswordNum'] != "")) $page_info1 .= $discount_fee_message; + $page_info1 .= "
"; + $page_info1 .= "
"; + $page_info1 .= $pay_fees_message; + $page_info1 .= "
"; + } // end if ((!NHC) || ((NHC) && ($prefix != "final_"))) +} // end if if (judging_date_return() > 0) - // Display Entry Fee and Discount Messages - if (($registration_open >= 1) && ($entry_window_open >= 1)) { - if ((!NHC) || ((NHC) && ($prefix != "final_"))) { - echo "
"; - echo $entry_fee_message; - if (($_SESSION['brewerDiscount'] == "Y") && ($_SESSION['contestEntryFeePasswordNum'] != "")) echo $discount_fee_message; - echo "
"; - echo "
"; - echo $pay_fees_message; - echo "
"; - } // end if ((!NHC) || ((NHC) && ($prefix != "final_"))) - } // end if if (judging_date_return() > 0) - - if (NHC) { - if (($entry_window_open > 0) && ($prefix != "final_")) echo $nhc_message_1; - if ($show_scores) echo $nhc_message_2; - } // end if (NHC) +if (NHC) { + if (($entry_window_open > 0) && ($prefix != "final_")) $page_info2 .= $nhc_message_1; + if ($show_scores) $page_info2 .= $nhc_message_2; +} // end if (NHC) -} // end if ($action != "print") -if (($totalRows_log > 0) && ($entry_window_open >= 1)) { +// Build user's entry information + $entry_output = ""; do { @@ -425,6 +466,27 @@ } while ($row_log = mysql_fetch_assoc($log)); +// -------------------------------------------------------------- +// Display +// -------------------------------------------------------------- + +echo $header1_1; +if ($fx) echo $firefox_warning; + +// Display Warnings and Entry Message +if (($totalRows_log > 0) && ($action != "print")) { + echo $warnings; + echo $entry_message; +} + +// Display links and other information +if (($action != "print") && ($entry_window_open > 0)) { + echo $primary_links; + echo $page_info1; + echo $page_info2; +} + +if (($totalRows_log > 0) && ($entry_window_open >= 1)) { ?> header on the page + $header2_X = an

subheader on the page + + $page_infoX = the bulk of the information on the page. + + $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 = "

PrintPrint This Page

"; + +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 --------------------- */ + + include (DB.'judging_locations.db.php'); +$primary_page_info = ""; +$header1_1 = ""; +$page_info1 = ""; +$table_head1 = ""; +$table_body1 = ""; +$table_head2 = ""; +$table_body2 = ""; +$table_head3 = ""; +$table_body3 = ""; + +// Page specific variables +$user_edit_links = ""; +$edit_user_info_link = ""; +$edit_email_link = ""; +$edit_password_link = ""; +$name = ""; +$email = ""; +$phone = ""; +$discount = ""; +$aha_number = ""; + // Build useful variables if (($_SESSION['brewerDiscount'] == "Y") && ($_SESSION['contestEntryFeePasswordNum'] != "")) $entry_discount = TRUE; else $entry_discount = FALSE; -$brewer_assignment = brewer_assignment($_SESSION['user_id'],"1"); +$brewer_assignment .= brewer_assignment($_SESSION['user_id'],"1"); $assignment_array = str_replace(", ",",",$brewer_assignment); $assignment_array = explode(",", $assignment_array); if ((!in_array("Judge",$assignment_array)) && ($_SESSION['brewerJudge'] == "Y") && ($totalRows_judging3 > 1)) $judge_available_not_assigned = TRUE; else $judge_available_not_assigned = FALSE; @@ -19,27 +145,25 @@ elseif ((in_array("Steward",$assignment_array)) && ($_SESSION['brewerSteward'] == "Y") && ($totalRows_judging3 > 1)) $assignment = "steward"; else $assignment = ""; +// Build header +$header1_1 .= "

Info

"; -//echo $brewer_assignment; - -// Build Thank You Message -$thank_you = "

Thank you for entering the ".$_SESSION['contestName'].", ".$_SESSION['brewerFirstName']."."; -if (($totalRows_log > 0) && ($action != "print")) $thank_you .= " View your entries.

"; - -$user_edit_links = ""; +// Build primary page info (thank you message) +$primary_page_info .= sprintf("

Thank you for entering the %s, %s.",$_SESSION['contestName'],$_SESSION['brewerFirstName']); +if (($totalRows_log > 0) && ($action != "print")) $primary_page_info .= " View your entries.

"; if ($action != "print") { // Build Edit My Info link - $edit_user_info_link = "Change My Email Address"; + $edit_email_link .= "Change My Email Address"; // Build Change My Email Address link - $edit_password_link = "Change My Password"; + $edit_password_link .= "Change My Password"; $user_edit_links .= "
"; @@ -62,16 +186,17 @@ $user_edit_links .= "
"; } // end if ($action != "print") + + // Build User Info -$name = $_SESSION['brewerFirstName']." ".$_SESSION['brewerLastName']; -$email = $_SESSION['brewerEmail']; +$name .= $_SESSION['brewerFirstName']." ".$_SESSION['brewerLastName']; +$email .= $_SESSION['brewerEmail']; if (!empty($_SESSION['brewerAddress'])) $address = $_SESSION['brewerAddress']; else $address = "None entered"; if (!empty($_SESSION['brewerCity'])) $city = $_SESSION['brewerCity']; else $city = "None entered"; if (!empty($_SESSION['brewerState'])) $state = $_SESSION['brewerState']; else $state = "None entered"; if (!empty($_SESSION['brewerZip'])) $zip = $_SESSION['brewerZip']; else $zip = "None entered"; if (!empty($_SESSION['brewerCountry'])) $country = $_SESSION['brewerCountry']; else $country = "None entered"; if ($_SESSION['brewerCountry'] == "United States") $us_phone = TRUE; else $us_phone = FALSE; -$phone = ""; if (!empty($_SESSION['brewerPhone1'])) { if ($us_phone) $phone .= format_phone_us($_SESSION['brewerPhone1'])." (1)"; else $phone .= $_SESSION['brewerPhone1']." (1)"; @@ -81,11 +206,11 @@ else $phone .= "
".$_SESSION['brewerPhone2']." (2)"; } if (!empty($_SESSION['brewerClubs'])) $club = $_SESSION['brewerClubs']; else $club = "None entered"; -$discount = "Yes (".$currency_symbol.$_SESSION['contestEntryFeePasswordNum']." per entry)"; +$discount .= "Yes (".$currency_symbol.$_SESSION['contestEntryFeePasswordNum']." per entry)"; if (!empty($_SESSION['brewerAHA'])) { - if ($_SESSION['brewerAHA'] < "999999994") $aha_number = sprintf("%09s",$_SESSION['brewerAHA']); - elseif ($_SESSION['brewerAHA'] >= "999999994") $aha_number = "Pending"; -} else $aha_number = "None entered"; + if ($_SESSION['brewerAHA'] < "999999994") $aha_number .= sprintf("%09s",$_SESSION['brewerAHA']); + elseif ($_SESSION['brewerAHA'] >= "999999994") $aha_number .= "Pending"; +} else $aha_number .= "None entered"; // Build Judge Info Display @@ -151,287 +276,259 @@ if ($action == "print") $table_assign_steward = table_assignments($_SESSION['user_id'],"S",$_SESSION['prefsTimeZone'],$_SESSION['prefsDateFormat'],$_SESSION['prefsTimeFormat'],1); else $table_assign_steward = table_assignments($_SESSION['user_id'],"S",$_SESSION['prefsTimeZone'],$_SESSION['prefsDateFormat'],$_SESSION['prefsTimeFormat'],0); +// Build User Info table body -// ------------------------ Display ------------------------------- -// Display NHC Final Round Instructions (NHC ONLY) -if ((NHC) && ($prefix == "final_") && ($action != "print") && ($totalRows_log > 0)) include (MODS.'nhc_final_round_instructions.php'); -// Display Thank You -echo $thank_you; -echo "

Info

"; -// Display User Edit Links -echo $user_edit_links; -/* -echo $brewer_assignment."
"; -echo $judge_available_not_assigned."
"; -echo $steward_available_not_assigned."
"; -echo $_SESSION['brewerJudge']."
"; -echo $_SESSION['brewerSteward']."
"; -*/ -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; + +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; + +if ($entry_discount) { + + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + } -?> - - - - - - + +if (!empty($assignment)) { + + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + +} + + +if ((in_array("Judge",$assignment_array)) && ($action != "print")) { + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; +} // end if (in_array("Judge",$assignment_array)) && ($action != "print")) + + +if ($_SESSION['brewerJudge'] == "Y") { + + + + $bjcp_rank = explode(",",$row_brewer['brewerJudgeRank']); + $display_rank = bjcp_rank($bjcp_rank[0],2); + if (!empty($bjcp_rank[1])) $display_rank .= designations($row_brewer['brewerJudgeRank'],$bjcp_rank[0]); + + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + + if (!empty($judge_info)) { + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; - - - - - - - - - -"; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + } // end if ((!$judge_available_not_assigned) && (!empty($table_assign_judge))) + + } // end if (!empty($judge_info)) + +} // end if ($_SESSION['brewerJudge'] == "Y") + + + +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; +$table_body1 .= ""; + +if ($_SESSION['brewerSteward'] == "Y") { + if (!empty($steward_info)) { + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + + if ((!$steward_available_not_assigned) && (!empty($table_assign_steward))) { + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + } // end if ((!$judge_available_not_assigned) && (!empty($table_assign_judge))) + } } + + +// -------------------------------------------------------------- +// Display +// -------------------------------------------------------------- + +// Display primary page info and subhead +echo $primary_page_info; +echo $header1_1; + +// Display User Edit Links +echo $user_edit_links; + ?> -
Name:
Email:
Address:
City:
State or Province:
Zip or Postal Code:
Country:
Phone Number(s):
AHA Number:  *An American Homebrewers Association (AHA) membership is required if one of your entries is selected for a Great American Beer Festival Pro-Am.
Drop Off Location:
Club:
Entry Fee Discount:
Assigned As:
 Print your judging scoresheet labelsPrint Judging Scoresheet Labels(Avery 5160 PDF Download)
BJCP Judge ID: "0") echo $_SESSION['brewerJudgeID']; else echo "N/A"; ?>
Beer Judge Ranks and Designations:",", ",$display_rank); else echo "N/A"; ?>
Mead Judge Endorsement:
Categories Preferred: - -
Categories Not Preferred: - -
Available to Judge? - -
Judging Availability: - - - - - - - - - - - - - - -
Yes/NoLocationDate/Time
- contact the competition organizer or judge coordinator."; - ?> -
Table Assignment(s): - - - - - - - - - - - - -
LocationDate/TimeTable
-
Name:".$name."
Email:".$email."
Address:".$address."
City:".$city."
State or Province:".$state."
Zip or Postal Code:".$zip."
Country:".$country."
Phone Number(s):".$phone."
AHA Number:".$aha_number."  *An American Homebrewers Association (AHA) membership is required if one of your entries is selected for a Great American Beer Festival Pro-Am.
Drop Off Location:".dropoff_location($_SESSION['brewerDropOff'])."
Club:".$club."
Available to Judge?"; +if ((!empty($_SESSION['brewerJudge'])) && ($action != "print")) $table_body1 .= yes_no($_SESSION['brewerJudge'],$base_url); +elseif ((!empty($_SESSION['brewerJudge'])) && ($action == "print")) $table_body1 .= yes_no($_SESSION['brewerJudge'],$base_url,3); +else $table_body1 .= "None entered"; +$table_body1 .= "
Entry Fee Discount:".$discount."
Available to Steward?
Assigned As:".$brewer_assignment."
 Print your judging scoresheet labelsPrint Judging Scoresheet Labels(Avery 5160 PDF Download)
BJCP Judge ID:"; + if ($_SESSION['brewerJudgeID'] > "0") $table_body1 .= $_SESSION['brewerJudgeID']; else $table_body1 .= "N/A"; + $table_body1 .= "
Beer Judge Ranks and Designations:"; + if ($_SESSION['brewerJudgeRank'] != "") $table_body1 .= str_replace("
",", ",$display_rank); else $table_body1 .= "N/A"; + $table_body1 .= "
Mead Judge Endorsement:"; + if ($action == "print") $table_body1 .= yes_no($_SESSION['brewerJudgeMead'],$base_url,3); else $table_body1 .= yes_no($_SESSION['brewerJudgeMead'],$base_url); + $table_body1 .= "
Categories Preferred:"; + if ($_SESSION['brewerJudgeLikes'] != "") $table_body1 .= style_convert($_SESSION['brewerJudgeLikes'],4,$base_url); + $table_body1 .= "
Categories Not Preferred:"; + if ($_SESSION['brewerJudgeDislikes'] != "") $table_body1 .= style_convert($_SESSION['brewerJudgeDislikes'],4,$base_url); else $table_body1 .= "N/A"; + $table_body1 .= "
Judge Availability:"; + if (($assignment == "judge") || (empty($assignment))) { + + if (empty($table_assign_judge)) { + + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= $judge_info; + $table_body1 .= ""; + $table_body1 .= "
Yes/NoLocationDate/Time
"; + + } + + else $table_body1 .= "No data retrieved."; + } + if ((!empty($table_assign_judge)) && (!empty($assignment))) $table_body1 .= sprintf("** You have already been assigned as a %s to a table. If you wish to change your availabilty and/or withdraw your role, contact the competition organizer or judge coordinator.",$assignment,build_public_url("contact","default","default",$sef,$base_url)); + $table_body1 .= "
Stewarding Availability: - - - - - - - - - - - - - - -
Yes/NoLocationDate/Time
- contact the competition organizer or judge coordinator."; - ?> -
Table Assignment(s): - - - - - - - - - - - - -
LocationDate/TimeTable
-
Table Assignment(s):"; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= $table_assign_judge; + $table_body1 .= ""; + $table_body1 .= "
LocationDate/TimeTable
"; + $table_body1 .= "
Available to Steward?"; +if ((!empty($_SESSION['brewerSteward'])) && ($action != "print")) $table_body1 .= yes_no($_SESSION['brewerSteward'],$base_url); +elseif ((!empty($_SESSION['brewerSteward'])) && ($action == "print")) $table_body1 .= yes_no($_SESSION['brewerSteward'],$base_url,3); +else $table_body1 .= "None entered"; +$table_body1 .= "
Steward Availability:"; + if (($assignment == "steward") || (empty($assignment))) { + + if (empty($table_assign_steward)) { + + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= $steward_info; + $table_body1 .= ""; + $table_body1 .= "
Yes/NoLocationDate/Time
"; + + } + + else $table_body1 .= "No data retrieved."; + } + if ((!empty($table_assign_steward)) && (!empty($assignment))) $table_body1 .= sprintf("** You have already been assigned as a %s to a table. If you wish to change your availabilty and/or withdraw your role, contact the competition organizer or judge coordinator.",$assignment,build_public_url("contact","default","default",$sef,$base_url)); + $table_body1 .= "
Table Assignment(s):"; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= ""; + $table_body1 .= $table_assign_steward; + $table_body1 .= ""; + $table_body1 .= "
LocationDate/TimeTable
"; + $table_body1 .= "
\ No newline at end of file + + + +
+ + + + + diff --git a/sections/judge_closed.sec.php b/sections/judge_closed.sec.php index 1bfa100f..3bdce4b1 100644 --- a/sections/judge_closed.sec.php +++ b/sections/judge_closed.sec.php @@ -1,10 +1,54 @@ - -

Thanks To All Who Participated in the

-

There were entries judged and registered participants, judges, and stewards.

\ No newline at end of file + header on the page + $header2_X = an

subheader on the page + + $page_infoX = the bulk of the information on the page. + $help_page_link = link to the appropriate page on help.brewcompetition.com + $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 + $messageX = various messages to display + + $print_page_link = "

PrintPrint This Page

"; + $competition_logo = "Competition Logo"; + +Declare all variables empty at the top of the script. Add on later... + $warning1 = ""; + $primary_page_info = ""; + $header1_1 = ""; + $page_info1 = ""; + $header1_2 = ""; + $page_info2 = ""; + + etc., etc., etc. + + * ---------------- END Rebuild Info --------------------- */ + +$header1_1 = ""; +$page_info1 = ""; + +$header1_1 .= sprintf("

Thanks To All Who Participated in the %s

",$_SESSION['contestName']); +$page_info1 = sprintf("

There were %s entries judged and %s registered participants, judges, and stewards.

",get_entry_count('received'),get_participant_count('default')); + +echo $header1_1; +echo $page_info1; +?> diff --git a/sections/list.sec.php b/sections/list.sec.php index 791eb7aa..22882e02 100644 --- a/sections/list.sec.php +++ b/sections/list.sec.php @@ -1,39 +1,77 @@ -= 25) && ($score <= 29.9)) $return = "Bronze Certificate"; - elseif (($score >= 30) && ($score <= 37.9)) $return = "Silver Certificate"; - elseif (($score >= 38) && ($score <= 50)) $return = "Gold Certificate"; - return $return; - } -} -$judging_date = judging_date_return(); -$delay = $_SESSION['prefsWinnerDelay'] * 3600; -$total_not_paid = total_not_paid_brewer($_SESSION['user_id']); - -// Display messages if conditions are right -if (($action != "print") && ($msg != "default")) echo $msg_output; - -// Add the top of the page MODS scripts - -// Add the help link for the page -if ($action != "print") echo "

My Info and Entries Help

"; - -// Call the brewer's info information -include (SECTIONS.'brewer_info.sec.php'); - -// Call the brewer's entry information -include (SECTIONS.'brewer_entries.sec.php'); + header on the page + $header2_X = an

subheader on the page + + $page_infoX = the bulk of the information on the page. + + $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 = "

PrintPrint This Page

"; + +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 --------------------- */ + +$help_link = "

My Info and Entries Help

"; + +function pay_to_print($prefs_pay,$entry_paid) { + if (($prefs_pay == "Y") && ($entry_paid == "1")) return TRUE; + elseif (($prefs_pay == "Y") && ($entry_paid == "0")) return FALSE; + elseif ($prefs_pay == "N") return TRUE; +} + +if (NHC) { + function certificate_type($score) { + if (($score >= 25) && ($score <= 29.9)) $return = "Bronze Certificate"; + elseif (($score >= 30) && ($score <= 37.9)) $return = "Silver Certificate"; + elseif (($score >= 38) && ($score <= 50)) $return = "Gold Certificate"; + return $return; + } +} +$judging_date = judging_date_return(); +$delay = $_SESSION['prefsWinnerDelay'] * 3600; +$total_not_paid = total_not_paid_brewer($_SESSION['user_id']); + +// Display messages if conditions are right +if (($action != "print") && ($msg != "default")) echo $msg_output; + +// Add the help link for the page +if ($action != "print") echo $help_link; + +// Call the brewer's info information +include (SECTIONS.'brewer_info.sec.php'); + +// Call the brewer's entry information +include (SECTIONS.'brewer_entries.sec.php'); ?> \ No newline at end of file diff --git a/sections/login.sec.php b/sections/login.sec.php index 2af02a80..09a057b3 100644 --- a/sections/login.sec.php +++ b/sections/login.sec.php @@ -1,85 +1,139 @@ - -
- - - - - - - - - -
Email Address:>
Password:
-

-
-

ExclamationHave you ">registered your account yet?

-

ExclamationDid you forget your password? If so, ">click here to reset it.

-You are already logged in."; - } -if ($action == "forgot") { - //if (($action != "print") && ($msg != "default")) echo $msg_output; - if ($go == "password") { ?> -

To reset your password, enter the email address you used when you registered.

-
" method="POST" name="form1" id="form1"> - - - - - - - - -
Email Address:>
 
-
-There is no email address in the system that matches the one you entered.

Try again?"; - } - else { ?> -

- - - - - - - - - - - - - -
ID Verification Question:
Answer:
 
- -

Can't remember the answer to your ID verification question? Get it via email.

-
- 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 = "

PrintPrint This Page

"; + $competition_logo = "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 --------------------- */ + +$primary_links = ""; +$message0 = ""; +$message1 = ""; +$message2 = ""; + +// Build Messages +if (($action != "print") && ($msg != "default")) $message0 .= $msg_output; +if (isset($_SESSION['loginUsername'])) $message1 .= "
You are already logged in.
"; + +if ((($action == "default") || ($action == "login") || ($action == "logout")) && (!isset($_SESSION['loginUsername']))) $login_form_display = TRUE; else $login_form_display = FALSE; +if (($action == "forgot") && ($go == "password") && (!isset($_SESSION['loginUsername']))) $forget_form_display = TRUE; else $foget_form_display = FALSE; +if (($action == "forgot") && ($go == "verify") && (!isset($_SESSION['loginUsername']))) { + $verify_form_display = TRUE; + if (empty($username)) $username_check = $_POST['loginUsername']; + else $username_check = $username; + $user_check = user_check($username_check); + $user_check = explode("^",$user_check); + + if (($user_check[0] == 0) && ($msg == "default")) { + $message2 .= sprintf("
There is no email address in the system that matches the one you entered.

Try again?",build_public_url("login","password","forgot",$sef,$base_url)); + } + +} +else $verify_form_display = FALSE; + +// Build Links + +if ($section != "update") { + if (($msg != "default") && ($registration_open < "2") && (!$verify_form_display)) $primary_links .= sprintf("

ExclamationHave you registered your account yet?

",$base_url,build_public_url("register","default","default",$sef,$base_url)); + if ($login_form_display) $primary_links .= sprintf("

ExclamationDid you forget your password? If so, click here to reset it.

",$base_url,build_public_url("login","password","forgot",$sef,$base_url)); +} + + +echo $message0; +echo $message1; +echo $message2; +echo $primary_links; +?> + + +
+ + + + + + + + + +
Email Address:>
Password:
+

+
+ + + +

To reset your password, enter the email address you used when you registered.

+
" method="POST" name="form1" id="form1"> + + + + + + + + +
Email Address:>
 
+
+ + +
+ + + + + + + + + + + + + +
ID Verification Question:
Answer:
 
+ +
+

Can't remember the answer to your ID verification question? Get it via email.

+ \ No newline at end of file diff --git a/sections/reg_closed.sec.php b/sections/reg_closed.sec.php index 31681af5..98f6a472 100644 --- a/sections/reg_closed.sec.php +++ b/sections/reg_closed.sec.php @@ -1,32 +1,89 @@ - -

Thanks and Good Luck To All Who Entered the !

- -

There are registered participants, judges, and stewards.

- -

There are registered entries and registered participants, judges, and stewards.

-

There are received and processed entries (this number will update as entries are picked up from drop-off locations and organized for judging).

- -

Judging Date 1) echo "s"; ?>

-The competition judging date is yet to be determined. Please check back later."; else { ?> - -

- ".$row_judging['judgingLocName'].""; ?> - ".$row_judging['judgingLocation']; ?> - - Map <?php echo $row_judging['judgingLocName']; ?> - Driving Directions to <?php echo $row_judging['judgingLocName']; ?> - - ".getTimeZoneDateTime($_SESSION['prefsTimeZone'], $row_judging['judgingDate'], $_SESSION['prefsDateFormat'], $_SESSION['prefsTimeFormat'], "long", "date-time")."
"; ?> -

- - + header on the page + $header2_X = an

subheader on the page + + $page_infoX = the bulk of the information on the page. + $help_page_link = link to the appropriate page on help.brewcompetition.com + $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 + $messageX = various messages to display + + $print_page_link = "

PrintPrint This Page

"; + $competition_logo = "Competition Logo"; + +Declare all variables empty at the top of the script. Add on later... + $warning1 = ""; + $primary_page_info = ""; + $header1_1 = ""; + $page_info1 = ""; + $header1_2 = ""; + $page_info2 = ""; + + etc., etc., etc. + + * ---------------- END Rebuild Info --------------------- */ + + +include(DB.'judging_locations.db.php'); +include(DB.'entries.db.php'); + +$primary_page_info = ""; +$header1_1 = ""; +$page_info1 = ""; +$header1_2 = ""; +$page_info2 = ""; + +// Header +$header1_1 .= sprintf("

Thanks and Good Luck To All Who Entered the %s!

",$_SESSION['contestName']); +if (NHC) $page_info1 .= sprintf("

There are %s registered participants, judges, and stewards.

",get_participant_count('default')); +else { + $page_info1 .= sprintf("

There are %s registered entries and %s registered participants, judges, and stewards.

",get_entry_count('none'),get_participant_count('default')); + $page_info1 .= sprintf("

There are %s received and processed entries (this number will update as entries are picked up from drop-off locations and organized for judging).

",get_entry_count('received')); +} + + + +$header1_2 .= "

Judging Date"; +if ($totalRows_judging > 1) $header1_2 .= "s"; +$header1_2 .= "

"; +if ($totalRows_judging == 0) $page_info2 .= "

Competition judging dates are yet to be determined. Please check back later.

"; +else { + do { + $page_info2 .= "

"; + $page_info2 .= "".$row_judging['judgingLocName'].""; + if ($row_judging['judgingLocation'] != "") $page_info2 .= "
".$row_judging['judgingLocation']; + if (($row_judging['judgingLocation'] != "") && ($action != "print")) { + $page_info2 .= "  Map ".$row_judging["; + $page_info2 .= "Driving Directions to ".$row_judging["; + } + if ($row_judging['judgingDate'] != "") $page_info2 .= "
".getTimeZoneDateTime($_SESSION['prefsTimeZone'], $row_judging['judgingDate'], $_SESSION['prefsDateFormat'], $_SESSION['prefsTimeFormat'], "long", "date-time")."
"; + $page_info2 .= "

"; + } while ($row_judging = mysql_fetch_assoc($judging)); +} + +echo $header1_1; +echo $page_info1; +echo $header1_2; +echo $page_info2; + +?> diff --git a/sections/winners.sec.php b/sections/winners.sec.php index 8d861f6c..a56d1952 100644 --- a/sections/winners.sec.php +++ b/sections/winners.sec.php @@ -1,80 +1,182 @@ - - 0) { - if ($entry_count > 1) $entries = "entries"; else $entries = "entry"; - if (score_count($row_tables['id'],"1")) { -?> - - - - -
Table ".$row_tables['tableNumber'].": ".$row_tables['tableName']." (".$entry_count." ".$entries.")
"; ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PlaceBrewer(s)Entry NameStyleClubScore
>>Co-Brewer: ".$row_scores['brewCoBrewer']; ?>>>>>
-Table ".$row_tables['tableNumber'].": ".$row_tables['tableName']." (".$entry_count." ".$entries.")

No winners have been entered yet for this table. Please check back later.

"; - } // end if ($entry_count > 0); -} while ($row_tables = mysql_fetch_assoc($tables)); - -?> \ No newline at end of file + 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 = "

PrintPrint This Page

"; + $competition_logo = "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 --------------------- */ + + + +do { +$entry_count = get_table_info(1,"count_total",$row_tables['id'],$dbTable,"default"); + +if ($entry_count > 0) { + + if ($entry_count > 1) $entries = "entries"; else $entries = "entry"; + + if (score_count($row_tables['id'],"1")) { + + $primary_page_info = ""; + $header1_1 = ""; + $page_info1 = ""; + $header1_2 = ""; + $page_info2 = ""; + + $table_head1 = ""; + $table_body1 = ""; + + // Build page headers + $header1_1 .= "

Table ".$row_tables['tableNumber'].": ".$row_tables['tableName']." (".$entry_count." ".$entries.")

"; + $header1_2 .= "

Table ".$row_tables['tableNumber'].": ".$row_tables['tableName']." (".$entry_count." ".$entries.")

No winners have been entered yet for this table. Please check back later.

"; + + // Build table headers + $table_head1 .= ""; + $table_head1 .= "Place"; + $table_head1 .= "Brewer(s)"; + $table_head1 .= "Entry Name"; + $table_head1 .= "Style"; + $table_head1 .= "Club"; + if ($filter == "scores") $table_head1 .= "Score"; + $table_head1 .= ""; + + // Build table body + include(DB.'scores.db.php'); + + do { + $style = $row_scores['brewCategory'].$row_scores['brewSubCategory']; + + $table_body1 .= ""; + + if ($action == "print") { + $table_body1 .= ""; + $table_body1 .= display_place($row_scores['scorePlace'],1); + $table_body1 .= ""; + } + + else { + $table_body1 .= ""; + $table_body1 .= display_place($row_scores['scorePlace'],2); + $table_body1 .= ""; + } + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['brewerFirstName']." ".$row_scores['brewerLastName']; + if ($row_scores['brewCoBrewer'] != "") $table_body1 .= "
Co-Brewer: ".$row_scores['brewCoBrewer']; + $table_body1 .= ""; + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['brewName']; + $table_body1 .= ""; + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $style.": ".$row_scores['brewStyle']; + $table_body1 .= ""; + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['brewerClubs']; + $table_body1 .= ""; + + if ($filter == "scores") { + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['scoreEntry']; + $table_body1 .= ""; + } + + $table_body1 .= ""; + + } while ($row_scores = mysql_fetch_assoc($scores)); + + + +$random1 = ""; +$random1 .= random_generator(7,2); + + +// -------------------------------------------------------------- +// Display +// -------------------------------------------------------------- +?> + + + + + + + + + +
+ 0); +} while ($row_tables = mysql_fetch_assoc($tables)); + +?> + + + diff --git a/sections/winners_category.sec.php b/sections/winners_category.sec.php index 68fa5611..618baa83 100644 --- a/sections/winners_category.sec.php +++ b/sections/winners_category.sec.php @@ -1,82 +1,180 @@ - 1) $entries = "entries"; else $entries = "entry"; -if ($row_score_count['count'] > "0") { -?> -

Category

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PlaceBrewer(s)Entry NameStyleClubScore
>>Co-Brewer: ".$row_scores['brewCoBrewer']; ?>>>>>
- 0 - } // end foreach -?> \ No newline at end of file + 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 = "

PrintPrint This Page

"; + $competition_logo = "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 --------------------- */ + +$a = styles_active(0); +foreach (array_unique($a) as $style) { + + include(DB.'winners_category.db.php'); + + // Display all winners + if ($row_entry_count['count'] > 1) $entries = "entries"; else $entries = "entry"; + if ($row_score_count['count'] > "0") { + + $primary_page_info = ""; + $header1_1 = ""; + $page_info1 = ""; + $header1_2 = ""; + $page_info2 = ""; + + $table_head1 = ""; + $table_body1 = ""; + + + // Build headers + $header1_1 .= "

"; + $header1_1 .= "Category ".ltrim($style,"0").": ".style_convert($style,"1")." (".$row_entry_count['count']." ".$entries.")"; + $header1_1 .= "

"; + + + // Build table headers + $table_head1 .= ""; + $table_head1 .= "Place"; + $table_head1 .= "Brewer(s)"; + $table_head1 .= "Entry Name"; + $table_head1 .= "Style"; + $table_head1 .= "Club"; + if ($filter == "scores") $table_head1 .= "Score"; + $table_head1 .= ""; + + // Build table body + + include(DB.'scores.db.php'); + + do { + $style = $row_scores['brewCategory'].$row_scores['brewSubCategory']; + + $table_body1 .= ""; + + if ($action == "print") { + $table_body1 .= ""; + $table_body1 .= display_place($row_scores['scorePlace'],1); + $table_body1 .= ""; + } + + else { + $table_body1 .= ""; + $table_body1 .= display_place($row_scores['scorePlace'],2); + $table_body1 .= ""; + } + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['brewerFirstName']." ".$row_scores['brewerLastName']; + if ($row_scores['brewCoBrewer'] != "") $table_body1 .= "
Co-Brewer: ".$row_scores['brewCoBrewer']; + $table_body1 .= ""; + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['brewName']; + $table_body1 .= ""; + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $style.": ".$row_scores['brewStyle']; + $table_body1 .= ""; + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['brewerClubs']; + $table_body1 .= ""; + + if ($filter == "scores") { + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['scoreEntry']; + $table_body1 .= ""; + } + + $table_body1 .= ""; + + } while ($row_scores = mysql_fetch_assoc($scores)); + + +$random1 = ""; +$random1 .= random_generator(7,2); + +// -------------------------------------------------------------- +// Display +// -------------------------------------------------------------- + +echo $header1_1; +?> + + + + + + + + +
+ 0 + } // end foreach +?> + + + diff --git a/sections/winners_subcategory.sec (DEN-E88543M's conflicted copy 2015-08-26).php b/sections/winners_subcategory.sec (DEN-E88543M's conflicted copy 2015-08-26).php new file mode 100644 index 00000000..b8c97eb7 --- /dev/null +++ b/sections/winners_subcategory.sec (DEN-E88543M's conflicted copy 2015-08-26).php @@ -0,0 +1,188 @@ + 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 = "

PrintPrint This Page

"; + $competition_logo = "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 ($_SESSION['prefsStyleSet'] == "BJCP2008") $category_end = 28; +else $category_end = 34; + +$a = styles_active(2); +foreach (array_unique($a) as $style) { + + $style = explode("^",$style); + + include(DB.'winners_subcategory.db.php'); + + // Display all winners + if ($row_entry_count['count'] > 0) { + if ($row_entry_count['count'] > 1) $entries = "entries"; else $entries = "entry"; + if ($row_score_count['count'] > 0) { + + + $primary_page_info = ""; + $header1_1 = ""; + $page_info1 = ""; + $header1_2 = ""; + $page_info2 = ""; + + $table_head1 = ""; + $table_body1 = ""; + + // Build headers + $header1_1 .= "

"; + $header1_1 .= "Category ".ltrim($style[0],"0").$style[1].": ".$style[2]." (".$row_entry_count['count']." ".$entries.")"; + $header1_1 .= "

"; + + // Build table headers + $table_head1 .= ""; + $table_head1 .= "Place"; + $table_head1 .= "Brewer(s)"; + $table_head1 .= "Entry Name"; + $table_head1 .= "Style"; + $table_head1 .= "Club"; + if ($filter == "scores") $table_head1 .= "Score"; + $table_head1 .= ""; + + // Build table body + + include(DB.'scores.db.php'); + + do { + $style = $row_scores['brewCategory'].$row_scores['brewSubCategory']; + if ($row_scores['brewCategorySort'] > $category_end) $style_long = style_convert($row_scores['brewCategorySort'],1); + else $style_long = $row_scores['brewStyle']; + + $table_body1 .= ""; + + if ($action == "print") { + $table_body1 .= ""; + $table_body1 .= display_place($row_scores['scorePlace'],1); + $table_body1 .= ""; + } + + else { + $table_body1 .= ""; + $table_body1 .= display_place($row_scores['scorePlace'],2); + $table_body1 .= ""; + } + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['brewerFirstName']." ".$row_scores['brewerLastName']; + if ($row_scores['brewCoBrewer'] != "") $table_body1 .= "
Co-Brewer: ".$row_scores['brewCoBrewer']; + $table_body1 .= ""; + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['brewName']; + $table_body1 .= ""; + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $style.": ".$style_long; + $table_body1 .= ""; + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['brewerClubs']; + $table_body1 .= ""; + + if ($filter == "scores") { + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['scoreEntry']; + $table_body1 .= ""; + } + + $table_body1 .= ""; + + } while ($row_scores = mysql_fetch_assoc($scores)); + +$random1 = ""; +$random1 .= random_generator(7,2); + +// -------------------------------------------------------------- +// Display +// -------------------------------------------------------------- + +?> + + + + + + + + + +
+ + + + + diff --git a/sections/winners_subcategory.sec.php b/sections/winners_subcategory.sec.php index 90bd8c70..a493e335 100644 --- a/sections/winners_subcategory.sec.php +++ b/sections/winners_subcategory.sec.php @@ -1,81 +1,182 @@ - 0) { - if ($row_entry_count['count'] > 1) $entries = "entries"; else $entries = "entry"; - if ($row_score_count['count'] > 0) { -?> -

Category

- - - - - - - - - - - - - - - - 28) $style_long = style_convert($row_scores['brewCategorySort'],1); - else $style_long = $row_scores['brewStyle']; -?> - - - - - - - - - - - - -
PlaceBrewer(s)Entry NameStyleClubScore
>>Co-Brewer: ".$row_scores['brewCoBrewer']; ?>>>>
- \ No newline at end of file + 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 = "

PrintPrint This Page

"; + $competition_logo = "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 ($_SESSION['prefsStyleSet'] == "BJCP2008") $category_end = 28; +else $category_end = 34; + +$a = styles_active(2); +foreach (array_unique($a) as $style) { + + $style = explode("^",$style); + + include(DB.'winners_subcategory.db.php'); + + // Display all winners + if ($row_entry_count['count'] > 0) { + if ($row_entry_count['count'] > 1) $entries = "entries"; else $entries = "entry"; + if ($row_score_count['count'] > 0) { + + + $primary_page_info = ""; + $header1_1 = ""; + $page_info1 = ""; + $header1_2 = ""; + $page_info2 = ""; + + $table_head1 = ""; + $table_body1 = ""; + + // Build headers + $header1_1 .= "

"; + $header1_1 .= "Category ".ltrim($style[0],"0").$style[1].": ".$style[2]." (".$row_entry_count['count']." ".$entries.")"; + $header1_1 .= "

"; + + // Build table headers + $table_head1 .= ""; + $table_head1 .= "Place"; + $table_head1 .= "Brewer(s)"; + $table_head1 .= "Entry Name"; + $table_head1 .= "Style"; + $table_head1 .= "Club"; + if ($filter == "scores") $table_head1 .= "Score"; + $table_head1 .= ""; + + // Build table body + + include(DB.'scores.db.php'); + + do { + $style = $row_scores['brewCategory'].$row_scores['brewSubCategory']; + if ($row_scores['brewCategorySort'] > $category_end) $style_long = style_convert($row_scores['brewCategorySort'],1); + else $style_long = $row_scores['brewStyle']; + + $table_body1 .= ""; + + if ($action == "print") { + $table_body1 .= ""; + $table_body1 .= display_place($row_scores['scorePlace'],1); + $table_body1 .= ""; + } + + else { + $table_body1 .= ""; + $table_body1 .= display_place($row_scores['scorePlace'],2); + $table_body1 .= ""; + } + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['brewerFirstName']." ".$row_scores['brewerLastName']; + if ($row_scores['brewCoBrewer'] != "") $table_body1 .= "
Co-Brewer: ".$row_scores['brewCoBrewer']; + $table_body1 .= ""; + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['brewName']; + $table_body1 .= ""; + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $style.": ".$style_long; + $table_body1 .= ""; + + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['brewerClubs']; + $table_body1 .= ""; + + if ($filter == "scores") { + if ($action == "print") $table_body1 .= ""; + else $table_body1 .= ""; + $table_body1 .= $row_scores['scoreEntry']; + $table_body1 .= ""; + } + + $table_body1 .= ""; + + } while ($row_scores = mysql_fetch_assoc($scores)); +$random1 = ""; +$random1 .= random_generator(7,2); +?> + + + + + + + + + +
+ + + + + diff --git a/update/current/data_updates.php b/update/current/data_updates.php index 4a45a4bd..971b9aca 100644 --- a/update/current/data_updates.php +++ b/update/current/data_updates.php @@ -7,7 +7,7 @@ //$styles_db_table = "baseline_styles"; // Update System table -$sql = "UPDATE `".$system_db_table."` SET version = '1.3.1.0', version_date = '2015-05-31' WHERE id = 1"; +$sql = "UPDATE `".$system_db_table."` SET version = '1.3.1.0', version_date = '2015-08-21' WHERE id = 1"; mysql_select_db($database, $brewing); mysql_real_escape_string($sql); $result = mysql_query($sql, $brewing); @@ -30,6 +30,26 @@ //echo $sql."
"; $output .= "
  • Auto purge set to \"Yes.\"
  • "; +// Get any custom styles and hold in variables to insert later +$query_custom_styles = sprintf("SELECT * FROM %s WHERE brewStyleGroup > 28", $prefix."styles"); +$custom_styles = mysql_query($query_custom_styles, $brewing) or die(mysql_error()); +$row_custom_styles = mysql_fetch_assoc($custom_styles); +$totalRows_custom_styles = mysql_num_rows($custom_styles); + +//echo $totalRows_custom_styles."
    "; + +if ($totalRows_custom_styles > 0) { + + $a = ""; + + do { + + $a[] .= $row_custom_styles['id']."|".$row_custom_styles['brewStyleNum']."|".$row_custom_styles['brewStyle']."|".$row_custom_styles['brewStyleCategory']."|".$row_custom_styles['brewStyleOG']."|".$row_custom_styles['brewStyleOGMax']."|".$row_custom_styles['brewStyleFG']."|".$row_custom_styles['brewStyleFGMax']."|".$row_custom_styles['brewStyleABV']."|".$row_custom_styles['brewStyleABVMax']."|".$row_custom_styles['brewStyleIBU']."|".$row_custom_styles['brewStyleIBUMax']."|".$row_custom_styles['brewStyleSRM']."|".$row_custom_styles['brewStyleSRMMax']."|".$row_custom_styles['brewStyleType']."|".$row_custom_styles['brewStyleInfo']."|".$row_custom_styles['brewStyleLink']."|".$row_custom_styles['brewStyleGroup']."|".$row_custom_styles['brewStyleActive']."|".$row_custom_styles['brewStyleOwn']; + + } while ($row_custom_styles = mysql_fetch_assoc($custom_styles)); + +} + // Empty the current Styles table $sql = "TRUNCATE `".$styles_db_table."`"; mysql_select_db($database, $brewing); @@ -302,4 +322,80 @@ $result = mysql_query($sql, $brewing); //echo $sql; $output .= "
  • Style data updated successfully in the database.
  • "; + +// Add custom styles to Styles DB + +foreach ($a as $custom_style) { + + $custom_style_data = explode("|",$custom_style); + $new_custom = ($custom_style_data[17] + 6); + + $sql = "INSERT INTO `".$styles_db_table."` "; + $sql .= "(`id`, `brewStyleNum`, `brewStyle`, `brewStyleCategory`, `brewStyleOG`, `brewStyleOGMax`, `brewStyleFG`, `brewStyleFGMax`, `brewStyleABV`, `brewStyleABVMax`, `brewStyleIBU`, `brewStyleIBUMax`, `brewStyleSRM`, `brewStyleSRMMax`, `brewStyleType`, `brewStyleInfo`, `brewStyleLink`, `brewStyleGroup`, `brewStyleActive`, `brewStyleOwn`) "; + $sql .= "VALUES "; + $sql .= "(NULL, '".$custom_style_data[1]."', '".$custom_style_data[2]."', '".$custom_style_data[3]."', '".$custom_style_data[4]."', '".$custom_style_data[5]."', '".$custom_style_data[6]."', '".$custom_style_data[7]."', '".$custom_style_data[8]."', '".$custom_style_data[9]."', '".$custom_style_data[10]."', '".$custom_style_data[11]."', '".$custom_style_data[12]."', '".$custom_style_data[13]."', '".$custom_style_data[14]."', '".$custom_style_data[15]."', '".$custom_style_data[16]."', '".$new_custom."', '".$custom_style_data[18]."', '".$custom_style_data[19]."');"; + mysql_select_db($database, $brewing); + mysql_real_escape_string($sql); + $result = mysql_query($sql, $brewing); + + // Update any defined judging tables with new id + + $query_custom_style_id = sprintf("SELECT id FROM %s ORDER BY id DESC LIMIT 1", $prefix."styles"); + $custom_style_id = mysql_query($query_custom_style_id, $brewing) or die(mysql_error()); + $row_custom_style_id = mysql_fetch_assoc($custom_style_id); + //echo $query_custom_style_id."
    "; + //echo $row_custom_style_id['id']."
    "; + + $query_custom_style_table = sprintf("SELECT id,tableStyles FROM %s", $prefix."judging_tables"); + $custom_style_table = mysql_query($query_custom_style_table, $brewing) or die(mysql_error()); + $row_custom_style_table = mysql_fetch_assoc($custom_style_table); + //echo $query_custom_style_table."
    "; + + do { + $b = ""; + $new_table_styles = ""; + + //echo $row_custom_style_table['id']."
    "; + //echo $row_custom_style_table['tableStyles']."
    "; + + $table_styles = explode(",",$row_custom_style_table['tableStyles']); + //print_r($table_styles); + + if (in_array($custom_style_data[0],$table_styles)) { + + foreach ($table_styles as $b) { + if ($custom_style_data[0] == $b) $new_table_styles[] .= $row_custom_style_id['id']; + else $new_table_styles[] .= $b; + + } + + $insert = implode(",",$new_table_styles); + + $sql = sprintf("UPDATE %s SET tableStyles='%s' WHERE id='%s'",$prefix."judging_tables",$insert,$row_custom_style_table['id']); + mysql_select_db($database, $brewing); + mysql_real_escape_string($sql); + $result = mysql_query($sql, $brewing); + + //echo $sql."
    "; + } + + else { + + $insert = $row_custom_style_table['tableStyles']; + + } + + } while ($row_custom_style_table = mysql_fetch_assoc($custom_style_table)); + + + // Update any entries with new style number + + $sql = sprintf("UPDATE %s SET brewCategory='%s', brewCategorySort='%s', brewSubCategory='A', brewStyle='%s' WHERE brewCategorySort='%s'",$prefix."brewing", $new_custom, $new_custom, $custom_style_data[2], $custom_style_data[17]); + mysql_select_db($database, $brewing); + mysql_real_escape_string($sql); + $result = mysql_query($sql, $brewing); + +} + + ?> \ No newline at end of file