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."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 "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 "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 "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 "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 "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 "Browse for your BeerXML compliant file on your hard drive that you exported from BeerSmith, BrewBlogger, etc. and click Upload.
- 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."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 .= "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 .= "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 .= "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 .= "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 .= "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 .= "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) { ?>
+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 .= "";
$print_list_link .= "";
@@ -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 = "
Print 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']."
";
-*/
-?>
-
-
- 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 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/No |
- Location |
- Date/Time |
-
-
-
-
-
-
- contact the competition organizer or judge coordinator.";
- ?>
- |
-
-
-
- Table Assignment(s): |
-
-
-
-
-
- Location |
- Date/Time |
- Table |
-
-
-
-
-
-
- |
-
-";
+$table_body1 .= "Name: | ";
+$table_body1 .= "".$name." | ";
+$table_body1 .= "";
+$table_body1 .= "";
+$table_body1 .= "Email: | ";
+$table_body1 .= "".$email." | ";
+$table_body1 .= "
";
+$table_body1 .= "";
+$table_body1 .= "Address: | ";
+$table_body1 .= "".$address." | ";
+$table_body1 .= "
";
+$table_body1 .= "";
+$table_body1 .= "City: | ";
+$table_body1 .= "".$city." | ";
+$table_body1 .= "
";
+$table_body1 .= "";
+$table_body1 .= "State or Province: | ";
+$table_body1 .= "".$state." | ";
+$table_body1 .= "
";
+$table_body1 .= "";
+$table_body1 .= "Zip or Postal Code: | ";
+$table_body1 .= "".$zip." | ";
+$table_body1 .= "
";
+$table_body1 .= "";
+$table_body1 .= "Country: | ";
+$table_body1 .= "".$country." | ";
+$table_body1 .= "
";
+$table_body1 .= "";
+$table_body1 .= "Phone Number(s): | ";
+$table_body1 .= "".$phone." | ";
+$table_body1 .= "
";
+$table_body1 .= "";
+$table_body1 .= "AHA Number: | ";
+$table_body1 .= "".$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. | ";
+$table_body1 .= "
";
+$table_body1 .= "";
+$table_body1 .= "Drop Off Location: | ";
+$table_body1 .= "".dropoff_location($_SESSION['brewerDropOff'])." | ";
+$table_body1 .= "
";
+$table_body1 .= "";
+$table_body1 .= "Club: | ";
+$table_body1 .= "".$club." | ";
+$table_body1 .= "
";
+
+$table_body1 .= "";
+$table_body1 .= "Available to Judge? | ";
+$table_body1 .= "";
+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 .= " | ";
+$table_body1 .= "
";
+
+if ($entry_discount) {
+
+ $table_body1 .= "";
+ $table_body1 .= "Entry Fee Discount: | ";
+ $table_body1 .= "".$discount." | ";
+ $table_body1 .= "
";
+
}
-?>
-
- Available to Steward? |
- |
-
-
-
+
+if (!empty($assignment)) {
+
+ $table_body1 .= "
";
+ $table_body1 .= "Assigned As: | ";
+ $table_body1 .= "".$brewer_assignment." | ";
+ $table_body1 .= "
";
+
+}
+
+
+if ((in_array("Judge",$assignment_array)) && ($action != "print")) {
+ $table_body1 .= "";
+ $table_body1 .= " | ";
+ $table_body1 .= "Print Judging Scoresheet Labels(Avery 5160 PDF Download) | ";
+ $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 .= "BJCP Judge ID: | ";
+ $table_body1 .= "";
+ if ($_SESSION['brewerJudgeID'] > "0") $table_body1 .= $_SESSION['brewerJudgeID']; else $table_body1 .= "N/A";
+ $table_body1 .= " | ";
+ $table_body1 .= "
";
+ $table_body1 .= "Beer Judge Ranks and Designations: | ";
+ $table_body1 .= "";
+ if ($_SESSION['brewerJudgeRank'] != "") $table_body1 .= str_replace(" ",", ",$display_rank); else $table_body1 .= "N/A";
+ $table_body1 .= " | ";
+ $table_body1 .= "";
+ $table_body1 .= "Mead Judge Endorsement: | ";
+ $table_body1 .= "";
+ if ($action == "print") $table_body1 .= yes_no($_SESSION['brewerJudgeMead'],$base_url,3); else $table_body1 .= yes_no($_SESSION['brewerJudgeMead'],$base_url);
+ $table_body1 .= " | ";
+ $table_body1 .= "
";
+ $table_body1 .= "Categories Preferred: | ";
+ $table_body1 .= "";
+ if ($_SESSION['brewerJudgeLikes'] != "") $table_body1 .= style_convert($_SESSION['brewerJudgeLikes'],4,$base_url);
+ $table_body1 .= " | ";
+ $table_body1 .= "";
+ $table_body1 .= "Categories Not Preferred: | ";
+ $table_body1 .= "";
+ if ($_SESSION['brewerJudgeDislikes'] != "") $table_body1 .= style_convert($_SESSION['brewerJudgeDislikes'],4,$base_url); else $table_body1 .= "N/A";
+ $table_body1 .= " | ";
+ $table_body1 .= "
";
+
+ if (!empty($judge_info)) {
+ $table_body1 .= "";
+ $table_body1 .= "Judge Availability: | ";
+ $table_body1 .= "";
+ if (($assignment == "judge") || (empty($assignment))) {
+
+ if (empty($table_assign_judge)) {
+
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= "Yes/No | ";
+ $table_body1 .= "Location | ";
+ $table_body1 .= "Date/Time | ";
+ $table_body1 .= " ";
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= $judge_info;
+ $table_body1 .= "";
+ $table_body1 .= " ";
+
+ }
+
+ 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 .= " | ";
+ $table_body1 .= "
";
- Stewarding Availability: |
-
-
-
-
-
-
-
-
- Yes/No |
- Location |
- Date/Time |
-
-
-
-
-
-
- contact the competition organizer or judge coordinator.";
- ?>
- |
-
-
-
- Table Assignment(s): |
-
-
-
-
-
- Location |
- Date/Time |
- Table |
-
-
-
-
-
-
- |
-
-";
+ $table_body1 .= "Table Assignment(s): | ";
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= "Location | ";
+ $table_body1 .= "Date/Time | ";
+ $table_body1 .= "Table | ";
+ $table_body1 .= " ";
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= $table_assign_judge;
+ $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 .= "Available to Steward? | ";
+$table_body1 .= "";
+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 .= " | ";
+$table_body1 .= "
";
+
+if ($_SESSION['brewerSteward'] == "Y") {
+ if (!empty($steward_info)) {
+ $table_body1 .= "";
+ $table_body1 .= "Steward Availability: | ";
+ $table_body1 .= "";
+ if (($assignment == "steward") || (empty($assignment))) {
+
+ if (empty($table_assign_steward)) {
+
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= "Yes/No | ";
+ $table_body1 .= "Location | ";
+ $table_body1 .= "Date/Time | ";
+ $table_body1 .= " ";
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= $steward_info;
+ $table_body1 .= "";
+ $table_body1 .= " ";
+
+ }
+
+ 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_body1 .= "
";
+
+ if ((!$steward_available_not_assigned) && (!empty($table_assign_steward))) {
+ $table_body1 .= "";
+ $table_body1 .= "Table Assignment(s): | ";
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= "Location | ";
+ $table_body1 .= "Date/Time | ";
+ $table_body1 .= "Table | ";
+ $table_body1 .= " ";
+ $table_body1 .= "";
+ $table_body1 .= "";
+ $table_body1 .= $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;
+
?>
-
\ 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 = "
Print This Page
";
+ $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 = "
Print 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 @@
-
-
-Have you ">registered your account yet?
-Did 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.
-
-There is no email address in the system that matches the one you entered.Try again?";
- }
- else { ?>
-
- header on the page
+ $header2_X = an subheader on the page
+
+ $page_infoX = the bulk of the information on the page.
+ $print_page_link = the "Print This Page" link
+ $competition_logo = display of the competition's logo
+
+ $labelX = the various labels in a table or on a form
+ $table_headX = all table headers (column names)
+ $table_bodyX = table body info
+ $messageX = various messages to display
+
+ $print_page_link = "
Print This Page
";
+ $competition_logo = "";
+
+Declare all variables empty at the top of the script. Add on later...
+ $primary_page_info = "";
+ $header1_1 = "";
+ $page_info1 = "";
+ $header1_2 = "";
+ $page_info2 = "";
+
+ $table_head1 = "";
+ $table_body1 = "";
+
+ etc., etc., etc.
+
+ * ---------------- END Rebuild Info --------------------- */
+
+$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("
Have you registered your account yet?
",$base_url,build_public_url("register","default","default",$sef,$base_url));
+ if ($login_form_display) $primary_links .= sprintf("Did 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;
+?>
+
+
+
+
+
+
+To reset your password, enter the email address you used when you registered.
+
+
+
+
+ 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']; ?>
-
-
-
-
- ".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 = "
Print This Page
";
+ $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 .= " ";
+ $page_info2 .= "";
+ }
+ 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")) {
-?>
-
-
-
-
-"; ?>
-
-
-
- Place |
- Brewer(s) |
- Entry Name |
- Style |
- Club |
-
- Score |
-
-
-
-
-
-
- > |
- >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 = "
Print This Page
";
+ $competition_logo = "";
+
+Declare all variables empty at the top of the script. Add on later...
+ $primary_page_info = "";
+ $header1_1 = "";
+ $page_info1 = "";
+ $header1_2 = "";
+ $page_info2 = "";
+
+ $table_head1 = "";
+ $table_body1 = "";
+
+ etc., etc., etc.
+
+ * ---------------- END Rebuild Info --------------------- */
+
+
+
+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
-
-
-
-
- Place |
- Brewer(s) |
-
- Entry Name |
-
- Style |
- Club |
-
- Score |
-
-
-
-
-
-
- > |
- >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 = "
Print This Page
";
+ $competition_logo = "";
+
+Declare all variables empty at the top of the script. Add on later...
+ $primary_page_info = "";
+ $header1_1 = "";
+ $page_info1 = "";
+ $header1_2 = "";
+ $page_info2 = "";
+
+ $table_head1 = "";
+ $table_body1 = "";
+
+ etc., etc., etc.
+
+ * ---------------- END Rebuild Info --------------------- */
+
+$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 = "
Print This Page
";
+ $competition_logo = "";
+
+Declare all variables empty at the top of the script. Add on later...
+ $primary_page_info = "";
+ $header1_1 = "";
+ $page_info1 = "";
+ $header1_2 = "";
+ $page_info2 = "";
+
+ $table_head1 = "";
+ $table_body1 = "";
+
+ etc., etc., etc.
+
+ * ---------------- END Rebuild Info --------------------- */
+
+if ($_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
-
-
-
-
- Place |
- Brewer(s) |
- Entry Name |
- Style |
- Club |
-
- Score |
-
-
-
-
- 28) $style_long = style_convert($row_scores['brewCategorySort'],1);
- else $style_long = $row_scores['brewStyle'];
-?>
-
- > |
- >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 = "
Print This Page
";
+ $competition_logo = "";
+
+Declare all variables empty at the top of the script. Add on later...
+ $primary_page_info = "";
+ $header1_1 = "";
+ $page_info1 = "";
+ $header1_2 = "";
+ $page_info2 = "";
+
+ $table_head1 = "";
+ $table_body1 = "";
+
+ etc., etc., etc.
+
+ * ---------------- END Rebuild Info --------------------- */
+
+if ($_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