0, 'G' => 0, 'J' => 0, 'S' => 0); $Name=array('J'=> 'Judge', 'S' => 'Steward'); $query='select brewer_type from brewer where email="'.$brewer['EMAIL'].'"'.($Edit ? ' and brewer != "'.$BrewerNo.'"' : ''); $dup_res=mysqli_query($db, $query); while ($dup_row = mysqli_fetch_row($dup_res)) { ++$Dups[$dup_row[0]]; } $query='select count(*) from brewer where email="'.$brewer['EMAIL'].'"'.($Edit ? ' and brewer != "'.$BrewerNo.'"' : ''); $cnt_res=mysqli_query($db, $query); $cnt_row=mysqli_fetch_row($cnt_res); $Cnt=$cnt_row[0]; ?>
0 ? 'EP' : ''), $Key, $BrewerNo); ?>

Duplicate Email Address Detected

'."\n"; switch ($brewer['BREWER_TYPE']) { case 'G': if ($Dups['G'] > 0) { echo 'There is already '.($Dups['G'] == 1 ? 'a Group Brewer' : $Dups['G'].' Group Brewers').' set up with this email address
'."\n"; $Continue=TRUE; $Recover=TRUE; $Login=TRUE; if ($Edit) { $Discard=TRUE; } } elseif ($Dups['I'] > 0) { echo 'There is already an Individual Brewer set up with this email address
'."\n"; $Continue=TRUE; $Recover=TRUE; $Login=TRUE; if ($Edit) { $Discard=TRUE; } } else { $Pass=TRUE; } break; case 'I': if ($Dups['J'] > 0 || $Dups['S'] > 0) { echo 'There is already a '.disp_brewertype($Dups['J'] > 0 ? 'J' : 'S').' set up with this email address
'."\n"; echo 'You should convert to an Individual Brewer rather than creating a new brewer
'."\n"; $Recover=TRUE; $Login=TRUE; if ($Edit) { $Discard=TRUE; } } elseif ($Dups['I'] > 0) { echo 'There is already an Individual Brewer set up with this email address
'."\n"; $Recover=TRUE; $Login=TRUE; if ($Edit) { $Discard=TRUE; } } else { $Pass=TRUE; } break; case 'J': if ($Dups['I'] > 0) { echo 'There is already an Individual Brewer set up with this email address
'."\n"; echo 'The offer to assist with Judging should be indicated on this brewer
'."\n"; $Recover=TRUE; $Login=TRUE; if ($Edit) { $Discard=TRUE; } } elseif ($Dups['J'] > 0) { echo 'There is already a Judge set up with this email address
'."\n"; $Recover=TRUE; $Login=TRUE; if ($Edit) { $Discard=TRUE; } } elseif ($Dups['S'] > 0) { echo 'There is already a Steward set up with this email address
'."\n"; echo 'You should only offer to assist as either a Judge or a Steward
'."\n"; echo 'You can convert the Judging offer to Stewarding, if that is desired
'."\n"; $Recover=TRUE; $Login=TRUE; if ($Edit) { $Discard=TRUE; } } else { $Pass=TRUE; } break; case 'S': if ($Dups['I'] > 0) { echo 'There is already an Individual Brewer set up with this email address
'."\n"; echo 'The offer to assist with Stewarding should be indicated on this brewer
'."\n"; $Recover=TRUE; $Login=TRUE; if ($Edit) { $Discard=TRUE; } } elseif ($Dups['S'] > 0) { echo 'There is already a Steward set up with this email address
'."\n"; $Recover=TRUE; $Login=TRUE; if ($Edit) { $Discard=TRUE; } } elseif ($Dups['J'] > 0) { echo 'There is already a Judge set up with this email address
'."\n"; echo 'You should only offer to assist as either a Judge or a Steward
'."\n"; echo 'You can convert the Stewarding offer to Judging, if that is desired
'."\n"; $Recover=TRUE; $Login=TRUE; if ($Edit) { $Discard=TRUE; } } else { $Pass=TRUE; } break; } echo ''."\n"; if (!$Pass) { $WP=15; if ($Continue) { $WP+=15; } if ($Discard) { $WP+=15; } if ($Login) { $WP+=15; } if ($Recover) { $WP+=15; } echo ''."\n"; echo ''."\n"; echo ''."\n"; if ($Continue) { echo ''."\n"; } if ($Discard) { echo ''."\n"; } if ($Login) { echo ''."\n"; } if ($Recover) { echo ''."\n"; } echo ''."\n"; echo '
'."\n"; echo '
'."\n"; BuildHidden($brewer, TRUE); echo 'Change '.disp_brewertype($brewer['BREWER_TYPE']).'
Information?

'."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; echo '
'."\n"; BuildHidden($brewer, TRUE); echo ($Edit ? 'Update' : 'Create').'
'.disp_brewertype($brewer['BREWER_TYPE']).'?

'."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; echo '
'."\n"; echo 'Discard
changes?

'."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; echo '
'."\n"; echo 'Login using
existing Brewer?

'."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; echo '
'."\n"; echo 'Recover
Brewer Number'.($Cnt > 1 ? 's' : '').'?

'."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; } ?>
'."\n"; BuildHidden($brewer, TRUE); echo ''."\n"; } echo ''."\n"; ?>