- Entries (CSV)
+ Entries and Associated Data (CSV)
diff --git a/admin/entries.admin.php b/admin/entries.admin.php
index 03918cc1..d36b1926 100644
--- a/admin/entries.admin.php
+++ b/admin/entries.admin.php
@@ -1,811 +1,811 @@
-".$edition."";
-
-if ($view == "paid") $header1_1 = "Paid ";
-if ($view == "unpaid") $header1_1 = "Unpaid ";
-if ($dbTable != "default") $header1_2 = " (Archive ".get_suffix($dbTable).")";
-
-$header = $_SESSION['contestName'].": ";
-if ($view == "paid") $header .= "Paid";
-elseif ($view == "unpaid") $header .= "Unpaid";
-else $header .= "All";
-$header .= " Entries ".$header1_2;
-
-if (($filter == "default") && ($bid == "default") && ($view == "default")) $entries_unconfirmed = ($totalRows_entry_count - $totalRows_log_confirmed); else $entries_unconfirmed = ($totalRows_log - $totalRows_log_confirmed);
-if ($filter != "default") $sidebar_extension .= " in this Category";
-if ($bid != "default") $sidebar_extension .= " for this Participant";
-
-if (($filter == "default") && ($bid == "default")) {
- if ($totalRows_log_paid > 0) $sidebar_paid_entries .= "".$totalRows_log_paid." ";
- else $sidebar_paid_entries .= $totalRows_log_paid;
-
- if (($totalRows_entry_count - $totalRows_log_paid) > 0) $sidebar_unpaid_entries .= "".($totalRows_entry_count - $totalRows_log_paid)." ";
- else $sidebar_unpaid_entries .= ($totalRows_entry_count - $totalRows_log_paid);
- }
-else {
- $sidebar_paid_entries .= $totalRows_log_paid." (".$currency_symbol.$total_fees_paid.")";
- $sidebar_unpaid_entries .= ($totalRows_log_confirmed - $totalRows_log_paid);
-}
-// Build table body and associated arrays
-
-do {
-
- if ($dbTable == "default") $brewer_info_filter = "default";
- else $brewer_info_filter = get_suffix($dbTable);
- $brewer_info = brewer_info($row_log['brewBrewerID'],$brewer_info_filter);
- $brewer_info = explode("^",$brewer_info);
-
- $brewer_pro_am = pro_am_check($row_log['brewBrewerID']);
-
- $styleConvert = style_convert($row_log['brewCategorySort'], 1);
- if ($_SESSION['prefsStyleSet'] == "BA") $entry_style = "";
- else $entry_style = $row_log['brewCategorySort']."-".$row_log['brewSubCategory'];
-
- $entry_style_display = "";
- $entry_brewer_display = "";
- $entry_updated_display = "";
- $entry_judging_num_display = "";
- $entry_paid_display = "";
- $entry_received_display = "";
- $entry_box_num_display = "";
- $entry_actions = "";
- $entry_unconfirmed_row = "";
- $entry_allergen_row = "";
- $entry_judging_num = "";
- $entry_judging_num_hidden = "";
- $required_info = "";
- $entry_judging_num = "";
- $entry_judging_num_display = "";
- $entry_admin_notes_display = "";
- $entry_staff_notes_display = "";
- $entry_allergens_display = "";
-
- $entry_number = sprintf("%04s",$row_log['id']);
- $judging_number = sprintf("%06s",$row_log['brewJudgingNumber']);
-
- // Check whether scoresheet file exists, and, if so, provide link.
- $scoresheet_file_name_entry = sprintf("%06s",$entry_number).".pdf";
- $scoresheet_file_name_judging = strtolower($judging_number).".pdf"; // upon upload via the UI, filename is converted to lowercase
-
- if ($dbTable == "default") {
- $scoresheetfile_entry = USER_DOCS.$scoresheet_file_name_entry;
- $scoresheetfile_judging = USER_DOCS.$scoresheet_file_name_judging;
- $scoresheet_prefs = $_SESSION['prefsDisplaySpecial'];
- }
-
- else {
- $scoresheetfile_entry = USER_DOCS.DIRECTORY_SEPARATOR.get_suffix($dbTable).DIRECTORY_SEPARATOR.$scoresheet_file_name_entry;
- $scoresheetfile_judging = USER_DOCS.DIRECTORY_SEPARATOR.get_suffix($dbTable).DIRECTORY_SEPARATOR.$scoresheet_file_name_judging;
- $scoresheet_prefs = $row_archive_prefs['archiveScoresheet'];
- }
-
- $scoresheet = FALSE;
- $scoresheet_entry = FALSE;
- $scoresheet_judging = FALSE;
-
- if ((file_exists($scoresheetfile_entry)) && ($scoresheet_prefs == "E")) {
- $scoresheet = TRUE;
- $scoresheet_entry = TRUE;
- }
-
- elseif ((file_exists($scoresheetfile_judging)) && ($scoresheet_prefs == "J")) {
- $scoresheet = TRUE;
- $scoresheet_judging = TRUE;
- }
-
- $scoresheet_file_name_1 = "";
- $scoresheet_file_name_2 = "";
- if ($scoresheet_entry) $scoresheet_file_name_1 = $scoresheet_file_name_entry;
- if ($scoresheet_judging) $scoresheet_file_name_2 = $scoresheet_file_name_judging;
-
- if ((!empty($row_log['brewInfo'])) || (!empty($row_log['brewMead1'])) || (!empty($row_log['brewMead2'])) || (!empty($row_log['brewMead3']))) {
- $brewInfo = "";
- //$brewInfo .= "Required Info: ";
- if (!empty($row_log['brewInfo'])) $brewInfo .= str_replace("^", " | ", $row_log['brewInfo']);
- if (!empty($row_log['brewMead1'])) $brewInfo .= " ".$row_log['brewMead1'];
- if (!empty($row_log['brewMead2'])) $brewInfo .= " ".$row_log['brewMead2'];
- if (!empty($row_log['brewMead3'])) $brewInfo .= " ".$row_log['brewMead3'];
- // $required_info .= " ";
-
- $required_info .= "Req. Info: ".$brewInfo."
";
- }
-
- if (!empty($row_log['brewInfoOptional'])) {
- // $required_info .= " ";
- $required_info .= "Op. Info: ".$row_log['brewInfoOptional']."
";
- }
-
- if (!empty($row_log['brewPossAllergens'])) {
- $entry_allergens_display .= "".$label_possible_allergens.": ".$row_log['brewPossAllergens']." ";
- //$required_info .= " ";
- $entry_allergen_row = "bg-warning";
- }
-
- if (($row_log['brewConfirmed'] == 0) || (empty($row_log['brewConfirmed']))) $entry_unconfirmed_row = "bg-danger";
- elseif (($_SESSION['prefsStyleSet'] != "BA") && ((check_special_ingredients($entry_style,$row_styles['brewStyleVersion']))) && ($row_log['brewInfo'] == "")) $entry_unconfirmed_row = "bg-warning";
-
- if (isset($row_log['brewJudgingNumber'])) {
- $entry_judging_num_hidden .= "".$judging_number." ";
- $entry_judging_num .= $judging_number;
- }
-
- if (($action != "print") && ($dbTable == "default")) $entry_judging_num_display .= " ".$entry_judging_num_hidden;
- else $entry_judging_num_display = $entry_judging_num;
-
- /*
- $splitter[0] = substr($row_log['brewJudgingNumber'], 0, 2);
- $splitter[1] = substr($row_log['brewJudgingNumber'], 2);
- $add_one = $splitter[1] + 1;
- $entry_judging_num_display .= " ".$splitter[0].$add_one;
-
-
- $splitter = explode("-",$row_log['brewJudgingNumber']);
- $add_one = $splitter[1] + 1;
- $entry_judging_num_display .= " ".sprintf("%02s",$splitter[0])."-".sprintf("%04s",$add_one);
-*/
- // Entry Style
- if ($_SESSION['prefsStyleSet'] == "BA") {
- if ($row_log['brewCategory'] <= 14) $entry_style_display .= $ba_category_names[$row_log['brewCategory']].": ".$row_log['brewStyle'];
- else $entry_style_display .= "Custom: ".$row_log['brewStyle'];
- }
-
- else {
- if ((!empty($row_log['brewCategorySort'])) && ($filter == "default") && ($bid == "default") && ($dbTable == "default"))
- $entry_style_display .= "";
- if ((!empty($row_log['brewCategorySort'])) && ($row_log['brewCategorySort'] != "00")) $entry_style_display .= $row_log['brewCategorySort'].$row_log['brewSubCategory'].": ".$row_log['brewStyle'];
- else $entry_style_display .= "Style NOT Specified ";
- if ((!empty($row_log['brewCategorySort'])) && ($filter == "default") && ($bid == "default") && ($dbTable == "default")) $entry_style_display .= " ";
- }
-
- // Brewer Info
- if (($brewer_info[0] != "") && ($brewer_info[1] != "") && ($pro_edition == 0)) {
- if (($bid == "default") && ($dbTable == "default")) {
- $entry_brewer_display .= "";
- }
- $entry_brewer_display .= $brewer_info[1].", ".$brewer_info[0];
- if (($bid == "default") && ($dbTable == "default")) $entry_brewer_display .= " ";
- $entry_brewer_display .= " ".$brewer_info[11].", ".$brewer_info[12];
- }
- elseif (($brewer_info[15] != " ") && ($pro_edition == 1)) {
- if (($bid == "default") && ($dbTable == "default")) {
- $entry_brewer_display .= "";
- }
- $entry_brewer_display .= $brewer_info[15];
- if (($bid == "default") && ($dbTable == "default")) $entry_brewer_display .= " ";
- $entry_brewer_display .= " ".$brewer_info[11].", ".$brewer_info[12];
- }
- else $entry_brewer_display .= " ";
-
- // Updated
- if ($row_log['brewUpdated'] != "") $entry_updated_display .= "".strtotime($row_log['brewUpdated'])." ".getTimeZoneDateTime($_SESSION['prefsTimeZone'], strtotime($row_log['brewUpdated']), $_SESSION['prefsDateFormat'], $_SESSION['prefsTimeFormat'], "short", "date-time-no-gmt");
- else $entry_updated_display .= " ";
-
- // Paid
- if (($action != "print") && ($dbTable == "default")) {
- $entry_paid_display .= "";
- $entry_paid_display .= " Received";
- $entry_paid_display .= "
";
- $entry_paid_display .= "".$row_log['brewPaid']." ";
- if ($brewer_info[9] == "Y") $entry_paid_display .= " ";
- }
-
- else {
- if ($row_log['brewPaid'] == "1") $entry_paid_display .= " ";
- else $entry_paid_display .= " ";
- }
-
- // Received
- if (($action != "print") && ($dbTable == "default")) {
- $entry_received_display .= " Paid";
- $entry_received_display .= "
";
- $entry_received_display .= "".$row_log['brewReceived']." ";
- }
-
- else {
- if ($row_log['brewReceived'] == "1") $entry_received_display .= " ";
- else $entry_received_display .= " ";
- }
-
- // Box Number
- if (($action != "print") && ($dbTable == "default")) {
- $entry_box_num_display .= "Box: ";
- $entry_box_num_display .= "".$row_log['brewBoxNum']." ";
- }
- else $entry_box_num_display = $row_log['brewBoxNum'];
-
- // Notes to Staff
- if (($action != "print") && ($dbTable == "default")) {
- //$entry_staff_notes_display .= " ";
-
- $entry_staff_notes_display .= "Staff Notes: ".$row_log['brewStaffNotes']."";
- $entry_staff_notes_display.= "".$row_log['brewStaffNotes']." ";
- }
- else $entry_staff_notes_display = $row_log['brewStaffNotes'];
-
- // Notes to Admin
- if (($action != "print") && ($dbTable == "default")) {
- // $entry_admin_notes_display .= " ";
-
- $entry_admin_notes_display .= "Admin Notes: ".$row_log['brewAdminNotes']."";
- $entry_admin_notes_display.= "".$row_log['brewAdminNotes']." ";
- }
- else $entry_admin_notes_display = $row_log['brewAdminNotes'];
-
- if (($action != "print") && ($dbTable == "default")) {
- $entry_actions .= "";
- $entry_actions .= " ";
- $entry_actions .= " ";
- $entry_actions .= " ";
- $entry_actions .= " ";
- $entry_actions .= " ";
- }
-
- $scoresheet_link_1 = "";
- $scoresheet_link_2 = "";
-
- if (($scoresheet) && ($action != "print")) {
-
- if ((!empty($scoresheet_file_name_1)) && ($scoresheet_entry)) {
-
- // The pseudo-random number and the corresponding name of the temporary file are defined each time
- // this brewer_entries.sec.php script is accessed (or refreshed), but the temporary file is created
- // only when the entrant clicks on the gavel icon to access the scoresheet.
- $random_num_str_1 = random_generator(8,2);
- $random_file_name_1 = $random_num_str_1.".pdf";
- $scoresheet_random_file_relative_1 = "user_temp/".$random_file_name_1;
- $scoresheet_random_file_1 = USER_TEMP.$random_file_name_1;
- $scoresheet_random_file_html_1 = $base_url.$scoresheet_random_file_relative_1;
- $scoresheet_link_1 .= "",$brewer_entries_text_006);
- $scoresheet_link_1 .= " ";
- }
-
- if ((!empty($scoresheet_file_name_2)) && ($scoresheet_judging)) {
-
- // The pseudo-random number and the corresponding name of the temporary file are defined each time
- // this brewer_entries.sec.php script is accessed (or refreshed), but the temporary file is created
- // only when the entrant clicks on the gavel icon to access the scoresheet.
-
- $random_num_str_2 = random_generator(8,2);
- $random_file_name_2 = $random_num_str_2.".pdf";
- $scoresheet_random_file_relative_2 = "user_temp/".$random_file_name_2;
- $scoresheet_random_file_2 = USER_TEMP.$random_file_name_2;
- $scoresheet_random_file_html_2 = $base_url.$scoresheet_random_file_relative_2;
-
- $scoresheet_link_2 .= "",$brewer_entries_text_006);
- $scoresheet_link_2 .= " ";
- }
-
- // Clean up temporary scoresheets created for other brewers, when they are at least 1 minute old (just to avoid problems when two entrants try accessing their scoresheets at practically the same time, and clean up previously created scoresheets for the same brewer, regardless of how old they are.
- $tempfiles = array_diff(scandir(USER_TEMP), array('..', '.'));
-
- if (is_array($tempfiles)) {
- foreach ($tempfiles as $file) {
- if ((filectime(USER_TEMP.$file) < time() - 1*60) || ((strpos($file, $scoresheet_file_name_judging) !== FALSE))) {
- unlink(USER_TEMP.$file);
- }
-
- if ((filectime(USER_TEMP.$file) < time() - 1*60) || ((strpos($file, $scoresheet_file_name_entry) !== FALSE))) {
- unlink(USER_TEMP.$file);
- }
- }
- }
-
- if ((($dbTable == "default") && ($_SESSION['prefsDisplaySpecial'] == "E")) || ($dbTable != "default")) $entry_actions .= $scoresheet_link_1;
- if ((($dbTable == "default") && ($_SESSION['prefsDisplaySpecial'] == "J")) || ($dbTable != "default")) $entry_actions .= $scoresheet_link_2;
- }
-
- if ((empty($entry_allergen_row)) && (!empty($entry_unconfirmed_row))) $entry_row_color = $entry_unconfirmed_row;
- elseif ((!empty($entry_allergen_row)) && (empty($entry_unconfirmed_row))) $entry_row_color = $entry_allergen_row;
- elseif ((!empty($entry_allergen_row)) && (!empty($entry_unconfirmed_row))) $entry_row_color = $entry_unconfirmed_row;
- else $entry_row_color = "";
-
- $tbody_rows .= "";
- $tbody_rows .= " ";
- $tbody_rows .= "".sprintf("%04s",$row_log['id'])." ";
- $tbody_rows .= "".$entry_judging_num_display." ";
- $tbody_rows .= "";
- $tbody_rows .= $row_log['brewName'];
- $tbody_rows .= " ";
- $tbody_rows .= "";
-
- $tbody_rows .= "".$row_log['brewCategorySort'].$row_log['brewSubCategory']." ";
-
- if ((!empty($entry_unconfirmed_row)) || (!empty($entry_allergen_row))) {
-
- if (!empty($entry_unconfirmed_row)) $tbody_rows .= "";
- $tbody_rows .= " ";
-
- if (!empty($entry_unconfirmed_row)) $tbody_rows .= " ";
- $tbody_rows .= " ";
- }
-
- if (!empty($required_info)) $tbody_rows .= " ";
-
- // $tbody_rows .= " ";
-
- $tbody_rows .= $entry_style_display;
- $tbody_rows .= $entry_allergens_display;
-
- if (!empty($required_info)) $tbody_rows .= "Entry Info
";
-
- $tbody_rows .= "";
- $tbody_rows .= $required_info;
- $tbody_rows .= "
";
-
- $tbody_rows .= "";
- $tbody_rows .= "Admin Info
";
-
- $tbody_rows .= "";
- $tbody_rows .= " ";
-
-
- // $tbody_rows .= $required_info;
-
- if ($brewer_pro_am == 1) $tbody_rows .= "NOT PRO-AM ELIGIBLE NO PRO-AM
";
- $tbody_rows .= " ";
- $tbody_rows .= "".$entry_brewer_display." ";
- if ($pro_edition == 0) $tbody_rows .= "".$brewer_info[8]." ";
- $tbody_rows .= "".$entry_updated_display." ";
- $tbody_rows .= "".$entry_paid_display." ";
- $tbody_rows .= "".$entry_received_display." ";
- $tbody_rows .= "".$entry_admin_notes_display." ";
- $tbody_rows .= "".$entry_staff_notes_display." ";
- $tbody_rows .= "".$entry_box_num_display." ";
- if ($action != "print") $tbody_rows .= "".$entry_actions." ";
- $tbody_rows .= " ";
-
- // Build all brewer email array
- if (!empty($brewer_info[6])) $copy_paste_all_emails[] = $brewer_info[6];
-
-} while($row_log = mysqli_fetch_assoc($log));
-
-do {
- if ($dbTable == "default") $brewer_info_filter = "default";
- else $brewer_info_filter = get_suffix($dbTable);
- $brewer_info = brewer_info($row_log_paid['brewBrewerID'],$brewer_info_filter);
- $brewer_info = explode("^",$brewer_info);
- if (!empty($brewer_info[6])) $copy_paste_paid_emails[] = $brewer_info[6];
-} while ($row_log_paid = mysqli_fetch_assoc($log_paid));
-
-// Unpaid email addresses
-
-$query_log_unpaid = sprintf("SELECT a.brewerEmail, a.uid, b.brewBrewerID FROM %s a, %s b WHERE a.uid = b.brewBrewerID AND (b.brewPaid <> 1 OR b.brewPaid IS NULL)", $prefix."brewer", $prefix."brewing");
-$log_unpaid = mysqli_query($connection,$query_log_unpaid) or die (mysqli_error($connection));
-$row_log_unpaid = mysqli_fetch_assoc($log_unpaid);
-$totalRows_log_unpaid = mysqli_num_rows($log_unpaid);
-
-if ($totalRows_log_unpaid > 0) {
- do {
- $copy_paste_unpaid_emails [] = $row_log_unpaid['brewerEmail'];
- } while ($row_log_unpaid = mysqli_fetch_assoc($log_unpaid));
-}
-
-if ($action != "print") { ?>
- $_SESSION['prefsRecordLimit'])) {
- $of = $start + $totalRows_log;
- echo "Showing ".$start_display." to ".$of;
- if ($bid != "default") echo " of ".$totalRows_log." entries
";
- if ($bid == "default") echo " of ".$totalRows_entry_count." entries ";
- }
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
+".$edition."";
+
+if ($view == "paid") $header1_1 = "Paid ";
+if ($view == "unpaid") $header1_1 = "Unpaid ";
+if ($dbTable != "default") $header1_2 = " (Archive ".get_suffix($dbTable).")";
+
+$header = $_SESSION['contestName'].": ";
+if ($view == "paid") $header .= "Paid";
+elseif ($view == "unpaid") $header .= "Unpaid";
+else $header .= "All";
+$header .= " Entries ".$header1_2;
+
+if (($filter == "default") && ($bid == "default") && ($view == "default")) $entries_unconfirmed = ($totalRows_entry_count - $totalRows_log_confirmed); else $entries_unconfirmed = ($totalRows_log - $totalRows_log_confirmed);
+if ($filter != "default") $sidebar_extension .= " in this Category";
+if ($bid != "default") $sidebar_extension .= " for this Participant";
+
+if (($filter == "default") && ($bid == "default")) {
+ if ($totalRows_log_paid > 0) $sidebar_paid_entries .= "
".$totalRows_log_paid." ";
+ else $sidebar_paid_entries .= $totalRows_log_paid;
+
+ if (($totalRows_entry_count - $totalRows_log_paid) > 0) $sidebar_unpaid_entries .= "
".($totalRows_entry_count - $totalRows_log_paid)." ";
+ else $sidebar_unpaid_entries .= ($totalRows_entry_count - $totalRows_log_paid);
+ }
+else {
+ $sidebar_paid_entries .= $totalRows_log_paid." (".$currency_symbol.$total_fees_paid.")";
+ $sidebar_unpaid_entries .= ($totalRows_log_confirmed - $totalRows_log_paid);
+}
+// Build table body and associated arrays
+
+do {
+
+ if ($dbTable == "default") $brewer_info_filter = "default";
+ else $brewer_info_filter = get_suffix($dbTable);
+ $brewer_info = brewer_info($row_log['brewBrewerID'],$brewer_info_filter);
+ $brewer_info = explode("^",$brewer_info);
+
+ $brewer_pro_am = pro_am_check($row_log['brewBrewerID']);
+
+ $styleConvert = style_convert($row_log['brewCategorySort'], 1);
+ if ($_SESSION['prefsStyleSet'] == "BA") $entry_style = "";
+ else $entry_style = $row_log['brewCategorySort']."-".$row_log['brewSubCategory'];
+
+ $entry_style_display = "";
+ $entry_brewer_display = "";
+ $entry_updated_display = "";
+ $entry_judging_num_display = "";
+ $entry_paid_display = "";
+ $entry_received_display = "";
+ $entry_box_num_display = "";
+ $entry_actions = "";
+ $entry_unconfirmed_row = "";
+ $entry_allergen_row = "";
+ $entry_judging_num = "";
+ $entry_judging_num_hidden = "";
+ $required_info = "";
+ $entry_judging_num = "";
+ $entry_judging_num_display = "";
+ $entry_admin_notes_display = "";
+ $entry_staff_notes_display = "";
+ $entry_allergens_display = "";
+
+ $entry_number = sprintf("%04s",$row_log['id']);
+ $judging_number = sprintf("%06s",$row_log['brewJudgingNumber']);
+
+ // Check whether scoresheet file exists, and, if so, provide link.
+ $scoresheet_file_name_entry = sprintf("%06s",$entry_number).".pdf";
+ $scoresheet_file_name_judging = strtolower($judging_number).".pdf"; // upon upload via the UI, filename is converted to lowercase
+
+ if ($dbTable == "default") {
+ $scoresheetfile_entry = USER_DOCS.$scoresheet_file_name_entry;
+ $scoresheetfile_judging = USER_DOCS.$scoresheet_file_name_judging;
+ $scoresheet_prefs = $_SESSION['prefsDisplaySpecial'];
+ }
+
+ else {
+ $scoresheetfile_entry = USER_DOCS.DIRECTORY_SEPARATOR.get_suffix($dbTable).DIRECTORY_SEPARATOR.$scoresheet_file_name_entry;
+ $scoresheetfile_judging = USER_DOCS.DIRECTORY_SEPARATOR.get_suffix($dbTable).DIRECTORY_SEPARATOR.$scoresheet_file_name_judging;
+ $scoresheet_prefs = $row_archive_prefs['archiveScoresheet'];
+ }
+
+ $scoresheet = FALSE;
+ $scoresheet_entry = FALSE;
+ $scoresheet_judging = FALSE;
+
+ if ((file_exists($scoresheetfile_entry)) && ($scoresheet_prefs == "E")) {
+ $scoresheet = TRUE;
+ $scoresheet_entry = TRUE;
+ }
+
+ elseif ((file_exists($scoresheetfile_judging)) && ($scoresheet_prefs == "J")) {
+ $scoresheet = TRUE;
+ $scoresheet_judging = TRUE;
+ }
+
+ $scoresheet_file_name_1 = "";
+ $scoresheet_file_name_2 = "";
+ if ($scoresheet_entry) $scoresheet_file_name_1 = $scoresheet_file_name_entry;
+ if ($scoresheet_judging) $scoresheet_file_name_2 = $scoresheet_file_name_judging;
+
+ if ((!empty($row_log['brewInfo'])) || (!empty($row_log['brewMead1'])) || (!empty($row_log['brewMead2'])) || (!empty($row_log['brewMead3']))) {
+ $brewInfo = "";
+ //$brewInfo .= "Required Info: ";
+ if (!empty($row_log['brewInfo'])) $brewInfo .= str_replace("^", " | ", $row_log['brewInfo']);
+ if (!empty($row_log['brewMead1'])) $brewInfo .= " ".$row_log['brewMead1'];
+ if (!empty($row_log['brewMead2'])) $brewInfo .= " ".$row_log['brewMead2'];
+ if (!empty($row_log['brewMead3'])) $brewInfo .= " ".$row_log['brewMead3'];
+ // $required_info .= "
";
+
+ $required_info .= "
Req. Info: ".$brewInfo."
";
+ }
+
+ if (!empty($row_log['brewInfoOptional'])) {
+ // $required_info .= "
";
+ $required_info .= "
Op. Info: ".$row_log['brewInfoOptional']."
";
+ }
+
+ if (!empty($row_log['brewPossAllergens'])) {
+ $entry_allergens_display .= "
".$label_possible_allergens.": ".$row_log['brewPossAllergens']." ";
+ //$required_info .= "
";
+ $entry_allergen_row = "bg-warning";
+ }
+
+ if (($row_log['brewConfirmed'] == 0) || (empty($row_log['brewConfirmed']))) $entry_unconfirmed_row = "bg-danger";
+ elseif (($_SESSION['prefsStyleSet'] != "BA") && ((check_special_ingredients($entry_style,$row_styles['brewStyleVersion']))) && ($row_log['brewInfo'] == "")) $entry_unconfirmed_row = "bg-warning";
+
+ if (isset($row_log['brewJudgingNumber'])) {
+ $entry_judging_num_hidden .= "
".$judging_number." ";
+ $entry_judging_num .= $judging_number;
+ }
+
+ if (($action != "print") && ($dbTable == "default")) $entry_judging_num_display .= "
".$entry_judging_num_hidden;
+ else $entry_judging_num_display = $entry_judging_num;
+
+ /*
+ $splitter[0] = substr($row_log['brewJudgingNumber'], 0, 2);
+ $splitter[1] = substr($row_log['brewJudgingNumber'], 2);
+ $add_one = $splitter[1] + 1;
+ $entry_judging_num_display .= "
".$splitter[0].$add_one;
+
+
+ $splitter = explode("-",$row_log['brewJudgingNumber']);
+ $add_one = $splitter[1] + 1;
+ $entry_judging_num_display .= "
".sprintf("%02s",$splitter[0])."-".sprintf("%04s",$add_one);
+*/
+ // Entry Style
+ if ($_SESSION['prefsStyleSet'] == "BA") {
+ if ($row_log['brewCategory'] <= 14) $entry_style_display .= $ba_category_names[$row_log['brewCategory']].": ".$row_log['brewStyle'];
+ else $entry_style_display .= "Custom: ".$row_log['brewStyle'];
+ }
+
+ else {
+ if ((!empty($row_log['brewCategorySort'])) && ($filter == "default") && ($bid == "default") && ($dbTable == "default"))
+ $entry_style_display .= "
";
+ if ((!empty($row_log['brewCategorySort'])) && ($row_log['brewCategorySort'] != "00")) $entry_style_display .= $row_log['brewCategorySort'].$row_log['brewSubCategory'].": ".$row_log['brewStyle'];
+ else $entry_style_display .= "Style NOT Specified ";
+ if ((!empty($row_log['brewCategorySort'])) && ($filter == "default") && ($bid == "default") && ($dbTable == "default")) $entry_style_display .= " ";
+ }
+
+ // Brewer Info
+ if (($brewer_info[0] != "") && ($brewer_info[1] != "") && ($pro_edition == 0)) {
+ if (($bid == "default") && ($dbTable == "default")) {
+ $entry_brewer_display .= "
";
+ }
+ $entry_brewer_display .= $brewer_info[1].", ".$brewer_info[0];
+ if (($bid == "default") && ($dbTable == "default")) $entry_brewer_display .= " ";
+ $entry_brewer_display .= "
".$brewer_info[11].", ".$brewer_info[12];
+ }
+ elseif (($brewer_info[15] != " ") && ($pro_edition == 1)) {
+ if (($bid == "default") && ($dbTable == "default")) {
+ $entry_brewer_display .= "
";
+ }
+ $entry_brewer_display .= $brewer_info[15];
+ if (($bid == "default") && ($dbTable == "default")) $entry_brewer_display .= " ";
+ $entry_brewer_display .= "
".$brewer_info[11].", ".$brewer_info[12];
+ }
+ else $entry_brewer_display .= " ";
+
+ // Updated
+ if ($row_log['brewUpdated'] != "") $entry_updated_display .= "
".strtotime($row_log['brewUpdated'])." ".getTimeZoneDateTime($_SESSION['prefsTimeZone'], strtotime($row_log['brewUpdated']), $_SESSION['prefsDateFormat'], $_SESSION['prefsTimeFormat'], "short", "date-time-no-gmt");
+ else $entry_updated_display .= " ";
+
+ // Paid
+ if (($action != "print") && ($dbTable == "default")) {
+ $entry_paid_display .= "
";
+ $entry_paid_display .= " Received";
+ $entry_paid_display .= "
";
+ $entry_paid_display .= "
".$row_log['brewPaid']." ";
+ if ($brewer_info[9] == "Y") $entry_paid_display .= "
";
+ }
+
+ else {
+ if ($row_log['brewPaid'] == "1") $entry_paid_display .= "
";
+ else $entry_paid_display .= "
";
+ }
+
+ // Received
+ if (($action != "print") && ($dbTable == "default")) {
+ $entry_received_display .= "
Paid";
+ $entry_received_display .= "
";
+ $entry_received_display .= "
".$row_log['brewReceived']." ";
+ }
+
+ else {
+ if ($row_log['brewReceived'] == "1") $entry_received_display .= "
";
+ else $entry_received_display .= "
";
+ }
+
+ // Box Number
+ if (($action != "print") && ($dbTable == "default")) {
+ $entry_box_num_display .= "
Box: ";
+ $entry_box_num_display .= "
".$row_log['brewBoxNum']." ";
+ }
+ else $entry_box_num_display = $row_log['brewBoxNum'];
+
+ // Notes to Staff
+ if (($action != "print") && ($dbTable == "default")) {
+ //$entry_staff_notes_display .= "
";
+
+ $entry_staff_notes_display .= "
Staff Notes: ".$row_log['brewStaffNotes']."";
+ $entry_staff_notes_display.= "
".$row_log['brewStaffNotes']." ";
+ }
+ else $entry_staff_notes_display = $row_log['brewStaffNotes'];
+
+ // Notes to Admin
+ if (($action != "print") && ($dbTable == "default")) {
+ // $entry_admin_notes_display .= "
";
+
+ $entry_admin_notes_display .= "
Admin Notes: ".$row_log['brewAdminNotes']."";
+ $entry_admin_notes_display.= "
".$row_log['brewAdminNotes']." ";
+ }
+ else $entry_admin_notes_display = $row_log['brewAdminNotes'];
+
+ if (($action != "print") && ($dbTable == "default")) {
+ $entry_actions .= "
";
+ $entry_actions .= " ";
+ $entry_actions .= " ";
+ $entry_actions .= "
";
+ $entry_actions .= "
";
+ $entry_actions .= "
";
+ }
+
+ $scoresheet_link_1 = "";
+ $scoresheet_link_2 = "";
+
+ if (($scoresheet) && ($action != "print")) {
+
+ if ((!empty($scoresheet_file_name_1)) && ($scoresheet_entry)) {
+
+ // The pseudo-random number and the corresponding name of the temporary file are defined each time
+ // this brewer_entries.sec.php script is accessed (or refreshed), but the temporary file is created
+ // only when the entrant clicks on the gavel icon to access the scoresheet.
+ $random_num_str_1 = random_generator(8,2);
+ $random_file_name_1 = $random_num_str_1.".pdf";
+ $scoresheet_random_file_relative_1 = "user_temp/".$random_file_name_1;
+ $scoresheet_random_file_1 = USER_TEMP.$random_file_name_1;
+ $scoresheet_random_file_html_1 = $base_url.$scoresheet_random_file_relative_1;
+ $scoresheet_link_1 .= "
",$brewer_entries_text_006);
+ $scoresheet_link_1 .= " ";
+ }
+
+ if ((!empty($scoresheet_file_name_2)) && ($scoresheet_judging)) {
+
+ // The pseudo-random number and the corresponding name of the temporary file are defined each time
+ // this brewer_entries.sec.php script is accessed (or refreshed), but the temporary file is created
+ // only when the entrant clicks on the gavel icon to access the scoresheet.
+
+ $random_num_str_2 = random_generator(8,2);
+ $random_file_name_2 = $random_num_str_2.".pdf";
+ $scoresheet_random_file_relative_2 = "user_temp/".$random_file_name_2;
+ $scoresheet_random_file_2 = USER_TEMP.$random_file_name_2;
+ $scoresheet_random_file_html_2 = $base_url.$scoresheet_random_file_relative_2;
+
+ $scoresheet_link_2 .= "
",$brewer_entries_text_006);
+ $scoresheet_link_2 .= " ";
+ }
+
+ // Clean up temporary scoresheets created for other brewers, when they are at least 1 minute old (just to avoid problems when two entrants try accessing their scoresheets at practically the same time, and clean up previously created scoresheets for the same brewer, regardless of how old they are.
+ $tempfiles = array_diff(scandir(USER_TEMP), array('..', '.'));
+
+ if (is_array($tempfiles)) {
+ foreach ($tempfiles as $file) {
+ if ((filectime(USER_TEMP.$file) < time() - 1*60) || ((strpos($file, $scoresheet_file_name_judging) !== FALSE))) {
+ unlink(USER_TEMP.$file);
+ }
+
+ if ((filectime(USER_TEMP.$file) < time() - 1*60) || ((strpos($file, $scoresheet_file_name_entry) !== FALSE))) {
+ unlink(USER_TEMP.$file);
+ }
+ }
+ }
+
+ if ((($dbTable == "default") && ($_SESSION['prefsDisplaySpecial'] == "E")) || ($dbTable != "default")) $entry_actions .= $scoresheet_link_1;
+ if ((($dbTable == "default") && ($_SESSION['prefsDisplaySpecial'] == "J")) || ($dbTable != "default")) $entry_actions .= $scoresheet_link_2;
+ }
+
+ if ((empty($entry_allergen_row)) && (!empty($entry_unconfirmed_row))) $entry_row_color = $entry_unconfirmed_row;
+ elseif ((!empty($entry_allergen_row)) && (empty($entry_unconfirmed_row))) $entry_row_color = $entry_allergen_row;
+ elseif ((!empty($entry_allergen_row)) && (!empty($entry_unconfirmed_row))) $entry_row_color = $entry_unconfirmed_row;
+ else $entry_row_color = "";
+
+ $tbody_rows .= "
";
+ $tbody_rows .= " ";
+ $tbody_rows .= "".sprintf("%04s",$row_log['id'])." ";
+ $tbody_rows .= "".$entry_judging_num_display." ";
+ $tbody_rows .= "";
+ $tbody_rows .= $row_log['brewName'];
+ $tbody_rows .= " ";
+ $tbody_rows .= "";
+
+ $tbody_rows .= "".$row_log['brewCategorySort'].$row_log['brewSubCategory']." ";
+
+ if ((!empty($entry_unconfirmed_row)) || (!empty($entry_allergen_row))) {
+
+ if (!empty($entry_unconfirmed_row)) $tbody_rows .= "";
+ $tbody_rows .= " ";
+
+ if (!empty($entry_unconfirmed_row)) $tbody_rows .= " ";
+ $tbody_rows .= " ";
+ }
+
+ if (!empty($required_info)) $tbody_rows .= " ";
+
+ // $tbody_rows .= " ";
+
+ $tbody_rows .= $entry_style_display;
+ $tbody_rows .= $entry_allergens_display;
+
+ if (!empty($required_info)) $tbody_rows .= "Entry Info
";
+
+ $tbody_rows .= "";
+ $tbody_rows .= $required_info;
+ $tbody_rows .= "
";
+
+ $tbody_rows .= "";
+ $tbody_rows .= "Admin Info
";
+
+ $tbody_rows .= "";
+ $tbody_rows .= " ";
+
+
+ // $tbody_rows .= $required_info;
+
+ if ($brewer_pro_am == 1) $tbody_rows .= "NOT PRO-AM ELIGIBLE NO PRO-AM
";
+ $tbody_rows .= " ";
+ $tbody_rows .= "".$entry_brewer_display." ";
+ if ($pro_edition == 0) $tbody_rows .= "".$brewer_info[8]." ";
+ $tbody_rows .= "".$entry_updated_display." ";
+ $tbody_rows .= "".$entry_paid_display." ";
+ $tbody_rows .= "".$entry_received_display." ";
+ $tbody_rows .= "".$entry_admin_notes_display." ";
+ $tbody_rows .= "".$entry_staff_notes_display." ";
+ $tbody_rows .= "".$entry_box_num_display." ";
+ if ($action != "print") $tbody_rows .= "".$entry_actions." ";
+ $tbody_rows .= " ";
+
+ // Build all brewer email array
+ if (!empty($brewer_info[6])) $copy_paste_all_emails[] = $brewer_info[6];
+
+} while($row_log = mysqli_fetch_assoc($log));
+
+do {
+ if ($dbTable == "default") $brewer_info_filter = "default";
+ else $brewer_info_filter = get_suffix($dbTable);
+ $brewer_info = brewer_info($row_log_paid['brewBrewerID'],$brewer_info_filter);
+ $brewer_info = explode("^",$brewer_info);
+ if (!empty($brewer_info[6])) $copy_paste_paid_emails[] = $brewer_info[6];
+} while ($row_log_paid = mysqli_fetch_assoc($log_paid));
+
+// Unpaid email addresses
+
+$query_log_unpaid = sprintf("SELECT a.brewerEmail, a.uid, b.brewBrewerID FROM %s a, %s b WHERE a.uid = b.brewBrewerID AND (b.brewPaid <> 1 OR b.brewPaid IS NULL)", $prefix."brewer", $prefix."brewing");
+$log_unpaid = mysqli_query($connection,$query_log_unpaid) or die (mysqli_error($connection));
+$row_log_unpaid = mysqli_fetch_assoc($log_unpaid);
+$totalRows_log_unpaid = mysqli_num_rows($log_unpaid);
+
+if ($totalRows_log_unpaid > 0) {
+ do {
+ $copy_paste_unpaid_emails [] = $row_log_unpaid['brewerEmail'];
+ } while ($row_log_unpaid = mysqli_fetch_assoc($log_unpaid));
+}
+
+if ($action != "print") { ?>
+ $_SESSION['prefsRecordLimit'])) {
+ $of = $start + $totalRows_log;
+ echo "
Showing ".$start_display." to ".$of;
+ if ($bid != "default") echo " of ".$totalRows_log." entries
";
+ if ($bid == "default") echo " of ".$totalRows_entry_count." entries