Lots of changes with this update. The most significant is the rewrite

of color management. I moved all color functions into a color library
admin/lib/color.lib.php. I also consolidated a lot of code in various
modules. Three color formulas are available now: Morey, Moser and 
Daniels and the user can set their default in preferences.
This commit is contained in:
Kevin Masaryk
2011-08-01 17:39:35 +00:00
parent 31411b4f1a
commit 772f36e6ab
27 changed files with 1958 additions and 2073 deletions

View File

@@ -1,242 +1,269 @@
<?php
/**
* Module: users.add-edit.php
* Description: This module sets up the user preferences form.
*/
?>
<table class="dataTable">
<?php if (($row_log['user_name'] != $loginUsername) && ($row_user['userLevel'] == "2")) { ?>
<tr>
<td colspan="3" class="error">Sorry, you do not have sufficient privileges to access this area.</td>
</tr>
<tr>
<td colspan="3" class="error">Sorry, you do not have sufficient privileges to access this area.</td>
</tr>
<?php }
if (($row_log['user_name'] == $loginUsername) || ($row_user['userLevel'] == "1"))
{ ?>
<?php if ($confirm == "false") { ?>
<tr>
<?php if ($msg == "1") { ?><td colspan="3" class="error">Sorry, that user name has been taken. Please choose another.<br><br></td><?php } ?>
<?php if ($msg == "2") { ?><td colspan="3" class="error">Sorry, the old password did not match the password in the database. Please try again.<br><br></td><?php } ?>
</tr>
<?php } ?>
<input type="hidden" name="user_name" value="<?php echo $filter; ?>" />
<input type="hidden" name="userLevel" value="<?php echo $row_log['userLevel']; ?>">
<tr>
<td class="dataLabelLeft">First Name:</td>
<td class="data" width="10%"><input type="text" name="realFirstName" tooltipText="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") { if (($row_pref['mode'] == "1") && ($row_name['user_name'] == $loginUsername)) echo $row_name['brewerFirstName']; else echo $row_log['realFirstName']; } ?>" size="20"></td>
<td class="data">&nbsp;</td></tr>
<tr>
<td class="dataLabelLeft">Last Name:</td>
<td class="data"><input type="text" name="realLastName" tooltipText="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") { if (($row_pref['mode'] == "1") && ($row_name['user_name'] == $loginUsername)) echo $row_name['brewerLastName']; else echo $row_log['realLastName']; } ?>" size="20"></td>
<td class="data">&nbsp;</td></tr>
<tr>
<td class="dataLabelLeft">Brewing Since (Year):</td>
<td class="data"><input type="text" name="userBrewingSince" value="<?php if (($action == "edit") && ($row_log['userBrewingSince'] != "0000")) echo $row_log['userBrewingSince']; else print date ( 'Y' ); ?>" size="10" maxlength="4"></td>
<td class="data">&nbsp;</td></tr>
<?php if ($row_user['userLevel'] == "1") { ?>
<tr>
<td class="dataLabelLeft">User Level:</td>
<td class="data">
<select name="userLevel" class="text_area" id="userLevel">
<option value="2" <?php if ($action == "edit") { if (!(strcmp($row_log['userLevel'], "2"))) {echo "SELECTED";} } ?>>User</option>
<option value="1" <?php if ($action == "edit") { if (!(strcmp($row_log['userLevel'], "1"))) {echo "SELECTED";} } ?>>Admin</option>
</select>
</td>
<td class="data">User = ability to add/edit/delete only THEIR OWN data.<br>Admin = ability to add/edit/delete access ALL user's data.</td
></tr>
<tr>
<td class="dataLabelLeft">User Name:</td>
<td class="data"><input type="text" name="user_name" tooltipText="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") echo $row_log['user_name']; ?>" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<?php if ($action == "add") { ?>
<tr>
<td class="dataLabelLeft">Password:</td>
<td class="data"><input type="password" name="password" value="" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
if (($row_log['user_name'] == $loginUsername) || ($row_user['userLevel'] == "1")) { ?>
<?php if ($confirm == "false") { ?>
<tr>
<?php if ($msg == "1") { ?><td colspan="3" class="error">Sorry, that user name has been taken. Please choose another.<br><br></td><?php } ?>
<?php if ($msg == "2") { ?><td colspan="3" class="error">Sorry, the old password did not match the password in the database. Please try again.<br><br></td><?php } ?>
</tr>
<?php } ?>
<input type="hidden" name="user_name" value="<?php echo $filter; ?>" />
<input type="hidden" name="userLevel" value="<?php echo $row_log['userLevel']; ?>">
<tr>
<td class="dataLabelLeft">First Name:</td>
<td class="data" width="10%"><input type="text" name="realFirstName" tooltipText="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") { if (($row_pref['mode'] == "1") && ($row_name['user_name'] == $loginUsername)) echo $row_name['brewerFirstName']; else echo $row_log['realFirstName']; } ?>" size="20"></td>
<td class="data">&nbsp;</td></tr>
<tr>
<td class="dataLabelLeft">Last Name:</td>
<td class="data"><input type="text" name="realLastName" tooltipText="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") { if (($row_pref['mode'] == "1") && ($row_name['user_name'] == $loginUsername)) echo $row_name['brewerLastName']; else echo $row_log['realLastName']; } ?>" size="20"></td>
<td class="data">&nbsp;</td></tr>
<tr>
<td class="dataLabelLeft">Brewing Since (Year):</td>
<td class="data"><input type="text" name="userBrewingSince" value="<?php if (($action == "edit") && ($row_log['userBrewingSince'] != "0000")) echo $row_log['userBrewingSince']; else print date ( 'Y' ); ?>" size="10" maxlength="4"></td>
<td class="data">&nbsp;</td>
</tr>
<?php if ($row_user['userLevel'] == "1") { ?>
<tr>
<td class="dataLabelLeft">User Level:</td>
<td class="data">
<select name="userLevel" class="text_area" id="userLevel">
<option value="2" <?php if ($action == "edit") { if (!(strcmp($row_log['userLevel'], "2"))) {echo "SELECTED";} } ?>>User</option>
<option value="1" <?php if ($action == "edit") { if (!(strcmp($row_log['userLevel'], "1"))) {echo "SELECTED";} } ?>>Admin</option>
</select>
</td>
<td class="data">User = ability to add/edit/delete only THEIR OWN data.<br>Admin = ability to add/edit/delete access ALL user's data.</td>
</tr>
<tr>
<td class="dataLabelLeft">User Name:</td>
<td class="data"><input type="text" name="user_name" tooltipText="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") echo $row_log['user_name']; ?>" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<?php if ($action == "add") { ?>
<tr>
<td class="dataLabelLeft">Password:</td>
<td class="data"><input type="password" name="password" value="" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<?php } } ?>
</table>
<div class="headerContentAdmin">User Defaults</div>
<table class="dataTable">
<tr>
<td class="dataLabelLeft">Usual Method:</td>
<td class="data">
<select name="defaultMethod" class="text_area" id="defaultMethod">
<option value="Extract" <?php if ($action == "edit") { if (!(strcmp($row_log['defaultMethod'], "Extract"))) {echo "SELECTED";} } ?>>Extract</option>
<option value="Partial Mash" <?php if ($action == "edit") { if (!(strcmp($row_log['defaultMethod'], "Partial Mash"))) {echo "SELECTED";} } ?>>Partial Mash</option>
<option value="All Grain" <?php if ($action == "edit") { if (!(strcmp($row_log['defaultMethod'], "All Grain"))) {echo "SELECTED";} } ?>>All Grain</option>
</select>&nbsp;indicate your preference and/or current skill level </td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Usual Batch Size:</td>
<td class="data"><input name="defaultBatchSize" type="text" value="<?php echo $row_log['defaultBatchSize']; ?>" size="5" /> <?php echo $row_pref['measFluid2']; ?></td>
<td class="data"></td>
</tr>
<tr>
<td class="dataLabelLeft">Bitterness Formula:</td>
<td class="data" width="5%">
<select name="defaultBitternessFormula" id="defaultBitternessFormula">
<option value="Daniels" <?php if (!(strcmp($row_log['defaultBitternessFormula'], "Daniels"))) echo "SELECTED"; ?>>Daniels</option>
<option value="Garetz" <?php if (!(strcmp($row_log['defaultBitternessFormula'], "Garetz"))) echo "SELECTED"; ?>>Garetz</option>
<option value="Rager" <?php if (!(strcmp($row_log['defaultBitternessFormula'], "Rager"))) echo "SELECTED"; ?>>Rager</option>
<option value="Tinseth" <?php if (!(strcmp($row_log['defaultBitternessFormula'], "Tinseth"))) echo "SELECTED"; ?>>Tinseth</option>
</select> </td>
<td class="data"></td>
</tr>
<tr>
<td class="dataLabelLeft">Equipment Profile:</td>
<td class="data">
<select name="defaultEquipProfile" id="defaultEquipProfile">
<option value=""></option>
<?php do { ?>
<option value="<?php echo $row_equip_profiles['id']; ?>" <?php if (!(strcmp($row_log['defaultEquipProfile'], $row_equip_profiles['id']))) echo "SELECTED"; ?>><?php echo $row_equip_profiles['equipProfileName']; ?></option>
<?php } while ($row_equip_profiles = mysql_fetch_assoc($equip_profiles))?>
</select> </td>
<td class="data"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" border="0" align="absbottom" alt="Add Equipment Profile?" title="Add Equipment Profile?"></span><span class="data"><a href="index.php?action=add&dbTable=equip_profiles">Add Equipment Profiles?</a></span></td>
</tr>
<tr>
<td class="dataLabelLeft">Mash Profile:</td>
<td class="data">
<option value=""></option>
<select name="defaultMashProfile" id="defaultMashProfile">
<?php do { ?>
<option value="<?php echo $row_mash_profiles['id']; ?>" <?php if (!(strcmp($row_log['defaultMashProfile'], $row_mash_profiles['id']))) echo "SELECTED"; ?>><?php echo $row_mash_profiles['mashProfileName']; ?></option>
<?php } while ($row_mash_profiles = mysql_fetch_assoc($mash_profiles))?>
</select> </td>
<td class="data"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" border="0" align="absbottom" alt="Add Mash Profile?" title="Add Mash Profile?"></span><span class="data"><a href="index.php?action=add&dbTable=mash_profiles">Add Mash Profiles?</a></span></td>
</tr>
<tr>
<td class="dataLabelLeft">Mash Thickness:</td>
<td class="data"><input name="defaultWaterRatio" type="text" value="<?php echo $row_log['defaultWaterRatio']; if ($row_log['defaultWaterRatio'] == "") echo "1.33"; ?>" size="5" /> <?php echo $row_pref['measWaterGrainRatio']; ?></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Water Profile:</td>
<td class="data">
<select name="defaultWaterProfile" id="defaultWaterProfile">
<option value=""></option>
<?php do { ?>
<option value="<?php echo $row_water_profiles['id']; ?>" <?php if (!(strcmp($row_log['defaultWaterProfile'], $row_water_profiles['id']))) echo "SELECTED"; ?>><?php echo $row_water_profiles['waterName']; ?></option>
<?php } while ($row_water_profiles = mysql_fetch_assoc($water_profiles))?>
</select> </td>
<td class="data"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" border="0" align="absbottom" alt="Add Water Profile?" title="Add Water Profile?"></span><span class="data"><a href="index.php?action=add&dbTable=water_profiles">Add Water Profiles?</a></span></td>
</tr>
<tr>
<td class="dataLabelLeft">Boil Time:</td>
<td class="data"><input name="defaultBoilTime" type="text" value="<?php echo $row_log['defaultBoilTime']; ?>" size="5" /> min.</td>
<td class="data">&nbsp;</td>
</tr>
</table>
<table class="dataTable">
<div class="headerContentAdmin">Personal Information</div>
<tr>
<td colspan="3" class="error">(*) Indicates the item is only used for printing competition recipes and labels. It's not displayed on the site.</td>
</tr>
<?php if ($row_pref['mode'] == "2") { ?>
<tr>
<td class="dataLabelLeft">Profile:</td>
<td colspan="2" class="data"><textarea name="userProfile" cols="50" rows="10"><?php if ($action == "edit") echo $row_log['userProfile']; ?></textarea></td>
<tr>
<td class="dataLabelLeft">Usual Method:</td>
<td class="data">
<select name="defaultMethod" class="text_area" id="defaultMethod">
<option value="Extract" <?php if ($action == "edit") { if (!(strcmp($row_log['defaultMethod'], "Extract"))) {echo "SELECTED";} } ?>>Extract</option>
<option value="Partial Mash" <?php if ($action == "edit") { if (!(strcmp($row_log['defaultMethod'], "Partial Mash"))) {echo "SELECTED";} } ?>>Partial Mash</option>
<option value="All Grain" <?php if ($action == "edit") { if (!(strcmp($row_log['defaultMethod'], "All Grain"))) {echo "SELECTED";} } ?>>All Grain</option>
</select>&nbsp;indicate your preference and/or current skill level </td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Birthdate:</td>
<td class="data"><input type="text" name="userBirthdate" value="<?php if ($action == "edit") echo $row_log['userBirthdate']; ?>" onfocus="showCalendarControl(this);" size="20"></td>
<tr>
<td class="dataLabelLeft">Usual Batch Size:</td>
<td class="data"><input name="defaultBatchSize" type="text" value="<?php echo $row_log['defaultBatchSize']; ?>" size="5" /> <?php echo $row_pref['measFluid2']; ?></td>
<td class="data"></td>
</tr>
<tr>
<td class="dataLabelLeft">Bitterness Formula:</td>
<td class="data" width="5%">
<select name="defaultBitternessFormula">
<option value="Daniels" <?php if ($row_log['defaultBitternessFormula'] == "Daniels") echo "SELECTED"; ?>>Daniels</option>
<option value="Garetz" <?php if ($row_log['defaultBitternessFormula'] == "Garetz") echo "SELECTED"; ?>>Garetz</option>
<option value="Rager" <?php if ($row_log['defaultBitternessFormula'] == "Rager") echo "SELECTED"; ?>>Rager</option>
<option value="Tinseth" <?php if ($row_log['defaultBitternessFormula'] == "Tinseth") echo "SELECTED"; ?>>Tinseth</option>
</select></td>
<td class="data"></td>
</tr>
<tr>
<td class="dataLabelLeft">Color Formula:</td>
<td class="data" width="5%">
<select name="defaultColorFormula">
<option value="Morey" <?php if ($row_log['defaultColorFormula'] == "Morey") echo "SELECTED"; ?>>Morey</option>
<option value="Daniels" <?php if ($row_log['defaultColorFormula'] == "Daniels") echo "SELECTED"; ?>>Daniels</option>
<option value="Moser" <?php if ($row_log['defaultColorFormula'] == "Moser") echo "SELECTED"; ?>>Moser</option>
</select></td>
<td class="data"></td>
</tr>
<tr>
<td class="dataLabelLeft">Equipment Profile:</td>
<td class="data">
<select name="defaultEquipProfile" id="defaultEquipProfile">
<option value=""></option>
<?php do { ?>
<option value="<?php echo $row_equip_profiles['id']; ?>" <?php if (!(strcmp($row_log['defaultEquipProfile'], $row_equip_profiles['id']))) echo "SELECTED"; ?>><?php echo $row_equip_profiles['equipProfileName']; ?></option>
<?php } while ($row_equip_profiles = mysql_fetch_assoc($equip_profiles))?>
</select></td>
<td class="data"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" border="0" align="absbottom" alt="Add Equipment Profile?" title="Add Equipment Profile?"></span><span class="data"><a href="index.php?action=add&dbTable=equip_profiles">Add Equipment Profiles?</a></span></td>
</tr>
<tr>
<td class="dataLabelLeft">Mash Profile:</td>
<td class="data">
<select name="defaultMashProfile" id="defaultMashProfile">
<option value=""></option>
<?php do { ?>
<option value="<?php echo $row_mash_profiles['id']; ?>" <?php if (!(strcmp($row_log['defaultMashProfile'], $row_mash_profiles['id']))) echo "SELECTED"; ?>><?php echo $row_mash_profiles['mashProfileName']; ?></option>
<?php } while ($row_mash_profiles = mysql_fetch_assoc($mash_profiles))?>
</select></td>
<td class="data"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" border="0" align="absbottom" alt="Add Mash Profile?" title="Add Mash Profile?"></span><span class="data"><a href="index.php?action=add&dbTable=mash_profiles">Add Mash Profiles?</a></span></td>
</tr>
<tr>
<td class="dataLabelLeft">Mash Thickness:</td>
<td class="data"><input name="defaultWaterRatio" type="text" value="<?php echo $row_log['defaultWaterRatio']; if ($row_log['defaultWaterRatio'] == "") echo "1.33"; ?>" size="5" /> <?php echo $row_pref['measWaterGrainRatio']; ?></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Water Profile:</td>
<td class="data">
<select name="defaultWaterProfile" id="defaultWaterProfile">
<option value=""></option>
<?php do { ?>
<option value="<?php echo $row_water_profiles['id']; ?>" <?php if (!(strcmp($row_log['defaultWaterProfile'], $row_water_profiles['id']))) echo "SELECTED"; ?>><?php echo $row_water_profiles['waterName']; ?></option>
<?php } while ($row_water_profiles = mysql_fetch_assoc($water_profiles))?>
</select></td>
<td class="data"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" border="0" align="absbottom" alt="Add Water Profile?" title="Add Water Profile?"></span><span class="data"><a href="index.php?action=add&dbTable=water_profiles">Add Water Profiles?</a></span></td>
</tr>
<tr>
<td class="dataLabelLeft">Boil Time:</td>
<td class="data"><input name="defaultBoilTime" type="text" value="<?php echo $row_log['defaultBoilTime']; ?>" size="5" /> min.</td>
<td class="data">&nbsp;</td>
</tr>
</table>
<table class="dataTable">
<div class="headerContentAdmin">Personal Information</div>
<tr>
<td colspan="3" class="error">(*) Indicates the item is only used for printing competition recipes and labels. It's not displayed on the site.</td>
</tr>
<?php if ($row_pref['mode'] == "2") { ?>
<tr>
<td class="dataLabelLeft">Profile:</td>
<td colspan="2" class="data"><textarea name="userProfile" cols="50" rows="10"><?php if ($action == "edit") echo $row_log['userProfile']; ?></textarea></td>
</tr>
<tr>
<td class="dataLabelLeft">Birthdate:</td>
<td class="data"><input type="text" name="userBirthdate" value="<?php if ($action == "edit") echo $row_log['userBirthdate']; ?>" onfocus="showCalendarControl(this);" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Occupation:</td>
<td class="data"><input type="text" name="userOccupation" value="<?php if ($action == "edit") echo $row_log['userOccupation']; ?>" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Occupation:</td>
<td class="data"><input type="text" name="userOccupation" value="<?php if ($action == "edit") echo $row_log['userOccupation']; ?>" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Hometown:</td>
<td class="data"><input type="text" name="userHometown" value="<?php if ($action == "edit") echo $row_log['userHometown']; ?>" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Other Hobbies:</td>
<td class="data"><input type="text" name="userHobbies" value="<?php if ($action == "edit") echo $row_log['userHobbies']; ?>" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<?php } ?>
<tr>
<td class="dataLabelLeft">Street Address:</td>
<td class="data" width="10%"><input type="text" name="userAddress" value="<?php if ($action == "edit") echo $row_log['userAddress']; ?>" size="20"></td>
<td class="data red"> (*)</td>
</tr>
<tr>
<td class="dataLabelLeft">City:</td>
<td class="data"><input type="text" name="userCity" value="<?php if ($action == "edit") echo $row_log['userCity']; ?>" size="20"></td>
<td class="data red"> (*)</td>
</tr>
<tr>
<td class="dataLabelLeft">State:</td>
<td class="data"><input type="text" name="userState" value="<?php if ($action == "edit") echo $row_log['userState']; ?>" size="20"></td>
<td class="data red"> (*)</td>
</tr>
<tr>
<td class="dataLabelLeft">Zip:</td>
<td class="data"><input type="text" name="userZip" value="<?php if ($action == "edit") echo $row_log['userZip']; ?>" size="20"></td>
<td class="data red"> (*)</td>
</tr>
<tr>
<td class="dataLabelLeft">Home Phone:</td>
<td class="data"><input type="text" name="userPhoneH" value="<?php if ($action == "edit") echo $row_log['userPhoneH']; ?>" size="20"></td>
<td class="data red"> (*)</td>
</tr>
<tr>
<td class="dataLabelLeft">Work Phone:</td>
<td class="data"><input type="text" name="userPhoneW" value="<?php if ($action == "edit") echo $row_log['userPhoneW']; ?>" size="20"></td>
<td class="data red"> (*)</td>
</tr>
<tr>
<td class="dataLabelLeft">Email Address:</td>
<td class="data"><input type="text" name="userEmail" value="<?php if ($action == "edit") echo $row_log['userEmail']; ?>" size="20"> </td>
<td class="data red"> (*)</td>
</tr>
<?php if ($row_pref['mode'] == "2") { ?>
<tr>
<td class="dataLabelLeft">Personal Website Name:</td>
<td class="data"><input type="text" name="userWebsiteName" tooltipText="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") echo $row_log['userWebsiteName']; ?>" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Personal Website URL:</td>
<td class="data"><input type="text" name="userWebsiteURL" tooltipText="<?php echo $toolTip_URL; ?>" value="<?php if ($action == "edit") echo $row_log['userWebsiteURL']; ?>" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Favorite Style(s):</td>
<td class="data"><input type="text" name="userFavStyles" value="<?php if ($action == "edit") echo $row_log['userFavStyles']; ?>" size="30"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Favorite Quote:</td>
<td class="data"><input type="text" name="userFavQuote" value="<?php if ($action == "edit") echo $row_log['userFavQuote']; ?>" size="30"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Favorite Commercial Brews:</td>
<td class="data"><input type="text" name="userFavCommercial" value="<?php if ($action == "edit") echo $row_log['userFavCommercial']; ?>" size="30"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Club Position:</td>
<td class="data"><input type="text" name="userPosition" value="<?php if ($action == "edit") echo $row_log['userPosition']; ?>" size="30"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Past Positions:</td>
<td class="data"><input type="text" name="userPastPosition" value="<?php if ($action == "edit") echo $row_log['userPastPosition']; ?>" size="30"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Your Photo's Name:</td>
<td class="data"><input type="text" name="userPicURL" tooltipText="<?php echo $toolTip_images; ?>" value="<?php if ($action == "edit") echo $row_log['userPicURL']; ?>" size="30"></td>
<td class="data"><a href="includes/upload_image.inc.php?KeepThis=true&TB_iframe=true&height=450&width=800" class="thickbox" title="Upload Profile Image">Upload Your Photo</a> (new window)</td>
</tr>
<tr>
<td class="dataLabelLeft">Display Your Profile?</td>
<td class="data">
<input name="userInfoPrivate" type="radio" class="radiobutton" value="Y" <?php if (!(strcmp("Y", $row_log['userInfoPrivate']))) {echo "CHECKED";} else echo "CHECKED"; ?>>Yes
<input name="userInfoPrivate" type="radio" class="radiobutton" value="N" <?php if (!(strcmp("N", $row_log['userInfoPrivate']))) {echo "CHECKED";} ?>>No </td>
<td class="data">&nbsp;</td>
</tr>
<?php } } ?>
</tr>
<tr>
<td class="dataLabelLeft">Hometown:</td>
<td class="data"><input type="text" name="userHometown" value="<?php if ($action == "edit") echo $row_log['userHometown']; ?>" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Other Hobbies:</td>
<td class="data"><input type="text" name="userHobbies" value="<?php if ($action == "edit") echo $row_log['userHobbies']; ?>" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<?php } ?>
<tr>
<td class="dataLabelLeft">Street Address:</td>
<td class="data" width="10%"><input type="text" name="userAddress" value="<?php if ($action == "edit") echo $row_log['userAddress']; ?>" size="20"></td>
<td class="data red"> (*)</td>
</tr>
<tr>
<td class="dataLabelLeft">City:</td>
<td class="data"><input type="text" name="userCity" value="<?php if ($action == "edit") echo $row_log['userCity']; ?>" size="20"></td>
<td class="data red"> (*)</td>
</tr>
<tr>
<td class="dataLabelLeft">State:</td>
<td class="data"><input type="text" name="userState" value="<?php if ($action == "edit") echo $row_log['userState']; ?>" size="20"></td>
<td class="data red"> (*)</td>
</tr>
<tr>
<td class="dataLabelLeft">Zip:</td>
<td class="data"><input type="text" name="userZip" value="<?php if ($action == "edit") echo $row_log['userZip']; ?>" size="20"></td>
<td class="data red"> (*)</td>
</tr>
<tr>
<td class="dataLabelLeft">Home Phone:</td>
<td class="data"><input type="text" name="userPhoneH" value="<?php if ($action == "edit") echo $row_log['userPhoneH']; ?>" size="20"></td>
<td class="data red"> (*)</td>
</tr>
<tr>
<td class="dataLabelLeft">Work Phone:</td>
<td class="data"><input type="text" name="userPhoneW" value="<?php if ($action == "edit") echo $row_log['userPhoneW']; ?>" size="20"></td>
<td class="data red"> (*)</td>
</tr>
<tr>
<td class="dataLabelLeft">Email Address:</td>
<td class="data"><input type="text" name="userEmail" value="<?php if ($action == "edit") echo $row_log['userEmail']; ?>" size="20"> </td>
<td class="data red"> (*)</td>
</tr>
<?php if ($row_pref['mode'] == "2") { ?>
<tr>
<td class="dataLabelLeft">Personal Website Name:</td>
<td class="data"><input type="text" name="userWebsiteName" tooltipText="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") echo $row_log['userWebsiteName']; ?>" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Personal Website URL:</td>
<td class="data"><input type="text" name="userWebsiteURL" tooltipText="<?php echo $toolTip_URL; ?>" value="<?php if ($action == "edit") echo $row_log['userWebsiteURL']; ?>" size="20"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Favorite Style(s):</td>
<td class="data"><input type="text" name="userFavStyles" value="<?php if ($action == "edit") echo $row_log['userFavStyles']; ?>" size="30"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Favorite Quote:</td>
<td class="data"><input type="text" name="userFavQuote" value="<?php if ($action == "edit") echo $row_log['userFavQuote']; ?>" size="30"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Favorite Commercial Brews:</td>
<td class="data"><input type="text" name="userFavCommercial" value="<?php if ($action == "edit") echo $row_log['userFavCommercial']; ?>" size="30"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Club Position:</td>
<td class="data"><input type="text" name="userPosition" value="<?php if ($action == "edit") echo $row_log['userPosition']; ?>" size="30"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Past Positions:</td>
<td class="data"><input type="text" name="userPastPosition" value="<?php if ($action == "edit") echo $row_log['userPastPosition']; ?>" size="30"></td>
<td class="data">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelLeft">Your Photo's Name:</td>
<td class="data"><input type="text" name="userPicURL" tooltipText="<?php echo $toolTip_images; ?>" value="<?php if ($action == "edit") echo $row_log['userPicURL']; ?>" size="30"></td>
<td class="data"><a href="includes/upload_image.inc.php?KeepThis=true&TB_iframe=true&height=450&width=800" class="thickbox" title="Upload Profile Image">Upload Your Photo</a> (new window)</td>
</tr>
<tr>
<td class="dataLabelLeft">Display Your Profile?</td>
<td class="data">
<input name="userInfoPrivate" type="radio" class="radiobutton" value="Y" <?php if (!(strcmp("Y", $row_log['userInfoPrivate']))) {echo "CHECKED";} else echo "CHECKED"; ?>>Yes
<input name="userInfoPrivate" type="radio" class="radiobutton" value="N" <?php if (!(strcmp("N", $row_log['userInfoPrivate']))) {echo "CHECKED";} ?>>No </td>
<td class="data">&nbsp;</td>
</tr>
<?php } } ?>
</table>
<?php include ('includes/add_edit_buttons.inc.php'); ?>

View File

@@ -2,7 +2,7 @@
<table class="dataTable">
<tr>
<td class="dataLabelLeft" width="5%">Bitterness:</td>
<td class="data" width="15%"><input type="text" name="brewBitterness" size="5" tooltipText="<?php echo $toolTip_decimal; ?>" value="<?php if (($action == "edit") || ($action=="import") || ($action == "importRecipe") || ($action == "reuse")) echo $row_log['brewBitterness']; if ($action == "importCalc") echo round ($brewBitterness[0], 1); ?>">&nbsp;<?php echo $row_pref['measBitter']; ?></td>
<td class="data" width="10%"><input type="text" name="brewBitterness" size="5" tooltipText="<?php echo $toolTip_decimal; ?>" value="<?php if (($action == "edit") || ($action=="import") || ($action == "importRecipe") || ($action == "reuse")) echo $row_log['brewBitterness']; if ($action == "importCalc") echo round ($brewBitterness[0], 1); ?>">&nbsp;<?php echo $row_pref['measBitter']; ?></td>
<td class="dataLabel" width="5%">Formula:</td>
<td class="data">
<select name="brewIBUFormula" id="brewIBUFormula">

View File

@@ -1,7 +1,67 @@
<div class="headerContentAdmin"><div id="help"><a href="../sections/reference.inc.php?section=color&source=log&KeepThis=true&TB_iframe=true&height=370&width=600" title="Color Reference" class="thickbox"><img src="<?php echo $imageSrc; ?>/information.png" border="0"></a></div>Color</div>
<table class="dataTable">
<tr>
<td class="dataLabelLeft">Color:</td>
<td class="data"><input type="text" name="brewLovibond" size="5" tooltipText="<?php echo $toolTip_decimal; ?>" value="<?php if (($action == "edit") || ($action=="import") || ($action == "importRecipe") || ($action=="reuse")) echo $row_log['brewLovibond']; if ($action == "importCalc") { if ($brewLovibond < 10) echo "0"; echo round ($brewLovibond, 1); } ?>">&nbsp;<?php echo $row_pref['measColor']; ?></td>
<td class="dataLabelLeft">Color:</td>
<?php
echo '<td class="data" width="10%"><input type="text" name="brewLovibond" size="5" tooltipText="' . $toolTip_decimal . '" value="';
if ($action == "edit" || $action == "import" || $action == "importRecipe" || $action == "reuse") {
echo round($row_log['brewLovibond'], 1);
} elseif ($action == "importCalc") {
//if ($brewLovibond < 10)
// echo "0";
echo round($brewLovibond, 1);
}
echo '">&nbsp;' . $row_pref['measColor'] . '</td>' . "\n";
?>
<td class="dataLabel" width="5%">Formula:</td>
<td class="data">
<select name="brewColorFormula">
<?php
echo '<option value="Morey" ';
if ($action == "add") {
if ($row_user['defaultColorFormula'] == "Morey")
echo "SELECTED";
} elseif ($action == "edit" || $action == "import" || $action == "importRecipe" || $action == "reuse") {
if ($row_log['brewColorFormula'] == "Morey") {
echo "SELECTED";
}
} elseif ($action == "importCalc") {
if ($brewColorFormula == "Morey") {
echo "SELECTED";
}
}
echo '>Morey</option>' . "\n";
echo '<option value="Daniels" ';
if ($action == "add") {
if ($row_user['defaultColorFormula'] == "Daniels")
echo "SELECTED";
} elseif ($action == "edit" || $action == "import" || $action == "importRecipe" || $action == "reuse") {
if ($row_log['brewColorFormula'] == "Daniels") {
echo "SELECTED";
}
} elseif ($action == "importCalc") {
if ($brewColorFormula == "Daniels") {
echo "SELECTED";
}
}
echo '>Daniels</option>' . "\n";
echo '<option value="Moser" ';
if ($action == "add") {
if ($row_user['defaultColorFormula'] == "Moser")
echo "SELECTED";
} elseif ($action == "edit" || $action == "import" || $action == "importRecipe" || $action == "reuse") {
if ($row_log['brewColorFormula'] == "Moser") {
echo "SELECTED";
}
} elseif ($action == "importCalc") {
if ($brewColorFormula == "Moser") {
echo "SELECTED";
}
}
echo '>Moser</option>' . "\n";
?>
</select>
</tr>
</table>

View File

@@ -1,54 +1,57 @@
<?php
/**
* Module: bitterness.lib.php
* Description: This library includes functions necessary for performing IBU
* calculations. Included formulas are: Tinseth, Garetz, Rager
* and Daniels.
*/
//----------------------------------------------------------------//
// This library includes functions necessary for performing IBU
// calculations. Included formulas are: Tinseth, Garetz, Rager
// and Daniels.
//----------------------------------------------------------------//
/*
$pelletFactor represents the utilization difference between
pellets and whole/plug hops. Depending on the
utilization formula used, this value is either
multiplied or divided with the result. For example,
the Tinseth formula is based on whole hops so we need
to multiply the result of the formula with this factor
to produce a result for pellet hops.
// $pelletFactor represents the utilization difference between
// pellets and whole/plug hops. Depending on the
// utilization formula used, this value is either
// multiplied or divided with the result. For example,
// the Tinseth formula is based on whole hops so we need
// to multiply the result of the formula with this factor
// to produce a result for pellet hops.
//
// Hop Union has published data suggesting a 5% - 7% difference
// in utilization between whole and pellet (Type 90) hops.
// Most modern data I've seen supports this range. The 15%
// delta value is a left-over from the old days and appears to
// have been based on speculation at that time.
//
// Leaf, whole and plug can all be considered the same thing as
// there's little difference between whole/leaf and plug, if
// any.
// - Kevin
Hop Union has published data suggesting a 5% - 7% difference
in utilization between whole and pellet (Type 90) hops.
Most modern data I've seen supports this range. The 15%
delta value is a left-over from the old days and appears to
have been based on speculation at that time.
Leaf, whole and plug can all be considered the same thing as
there's little difference between whole/leaf and plug, if
any.
- Kevin
*/
$pelletFactor = $row_pref['hopPelletFactor'];
// --------------------------- Tinseth Method --------------------------- //
// Reference: Tinseth, Glenn. www.realbeer.com/hops, 1995-1999.
// Default form: whole
// Tinseth based all of his data to produce this formula on whole
// hops; Therefore, we produce the IBU result for whole hops first
// and then apply the pelletFactor if needed for pellets.
//
// IBUs = decimal alpha acid utilization * mg/l of added alpha acids
//
// metric
// mg/l of added alpha acids = decimal AA rating * grams hops * 1000
// -------------------------------------
// liters of wort
//
// non-metric
// mg/l of added alpha acids = decimal AA rating * ozs hops * 7490
// -------------------------------------
// gallons of wort
//
// Decimal Alpha Acid Utilization = Bigness Factor * Boil Time Factor
//
// $form = ('pellet' || any other value is treated as whole/leaf/plug)
// $units = ('metric' || 'us')
/* --------------------------- Tinseth Method ---------------------------
Reference: Tinseth, Glenn. www.realbeer.com/hops, 1995-1999.
Default form: whole
Tinseth based all of his data to produce this formula on whole
hops; Therefore, we produce the IBU result for whole hops first
and then apply the pelletFactor if needed for pellets.
IBUs = decimal alpha acid utilization * mg/l of added alpha acids
metric
mg/l of added alpha acids = decimal AA rating * grams hops * 1000
-------------------------------------
liters of wort
non-metric
mg/l of added alpha acids = decimal AA rating * ozs hops * 7490
-------------------------------------
gallons of wort
Decimal Alpha Acid Utilization = Bigness Factor * Boil Time Factor
$form = ('pellet' || any other value is treated as whole/leaf/plug)
$units = ('metric' || 'us')
*/
function calc_bitter_tinseth($boilTime, $sg, $aa, $weight, $vol, $form, $units) {
global $pelletFactor;
@@ -202,22 +205,23 @@ function calc_bitter_garetz($boilTime, $sg, $aa, $weight, $postBoilVol, $form, $
return $ibu;
}
// ----------------------------- Daniels Method ----------------------------- //
// Reference: Daniels, Ray. Designing Great Beers, Brewers
// Publications, 2000.
//
// Equation - U.S.:
// IBU = Weight * Utilization % * Alpha % * 7,489
// -------------------------------------------
// (Final Volume * (1 +[(Boil Time - 1.050) / 0.2)])
//
// Equation - Metric:
// IBU = Weight * Utilization % * Alpha % * 1,000
// -------------------------------------------
// (Final Volume * (1 +[(Boil Time - 1.050) / 0.2)])
//
// $form = ('pellet' || any other value is treated as whole/leaf/plug)
// $units = ('metric' || 'us')
/* ----------------------------- Daniels Method -----------------------------
Reference: Daniels, Ray. Designing Great Beers, Brewers
Publications, 2000.
Equation - U.S.:
IBU = Weight * Utilization % * Alpha % * 7,489
-------------------------------------------------
(Final Volume * (1 +[(Boil Time - 1.050) / 0.2)])
Equation - Metric:
IBU = Weight * Utilization % * Alpha % * 1,000
-------------------------------------------------
(Final Volume * (1 +[(Boil Time - 1.050) / 0.2)])
$form = ('pellet' || any other value is treated as whole/leaf/plug)
$units = ('metric' || 'us')
*/
function calc_bitter_daniels($boilTime, $sg, $aa, $weight, $vol, $form, $units) {
$f = ($units == "us") ? 7489 : 1000;

View File

@@ -269,70 +269,20 @@ if ($results == "true") {
$brewOG = $_POST['brewOG'];
$brewFG = $_POST['brewFG'];
/*
$brewExtract1 = $_POST['brewExtract1'];
$brewExtract2 = $_POST['brewExtract2'];
$brewExtract3 = $_POST['brewExtract3'];
$brewExtract4 = $_POST['brewExtract4'];
$brewExtract5 = $_POST['brewExtract5'];
for ($i = 0; $i < MAX_EXT; $i++) {
$extName[$i] = $_POST['extName'][$i];
$extWeight[$i] = $_POST['extWeight'][$i];
}
$brewExtract1Weight = $_POST['brewExtract1Weight'];
$brewExtract2Weight = $_POST['brewExtract2Weight'];
$brewExtract3Weight = $_POST['brewExtract3Weight'];
$brewExtract4Weight = $_POST['brewExtract4Weight'];
$brewExtract5Weight = $_POST['brewExtract5Weight'];
$brewGrain1 = $_POST['brewGrain1'];
$brewGrain2 = $_POST['brewGrain2'];
$brewGrain3 = $_POST['brewGrain3'];
$brewGrain4 = $_POST['brewGrain4'];
$brewGrain5 = $_POST['brewGrain5'];
$brewGrain6 = $_POST['brewGrain6'];
$brewGrain7 = $_POST['brewGrain7'];
$brewGrain8 = $_POST['brewGrain8'];
$brewGrain9 = $_POST['brewGrain9'];
$brewGrain10 = $_POST['brewGrain10'];
$brewGrain11 = $_POST['brewGrain11'];
$brewGrain12 = $_POST['brewGrain12'];
$brewGrain13 = $_POST['brewGrain13'];
$brewGrain14 = $_POST['brewGrain14'];
$brewGrain15 = $_POST['brewGrain15'];
for ($i = 0; $i < MAX_GRAINS; $i++) {
$grainName[$i] = $_POST['grainName'][$i];
$grainWeight[$i] = $_POST['grainWeight'][$i];
}
$brewGrain1Weight = $_POST['brewGrain1Weight'];
$brewGrain2Weight = $_POST['brewGrain2Weight'];
$brewGrain3Weight = $_POST['brewGrain3Weight'];
$brewGrain4Weight = $_POST['brewGrain4Weight'];
$brewGrain5Weight = $_POST['brewGrain5Weight'];
$brewGrain6Weight = $_POST['brewGrain6Weight'];
$brewGrain7Weight = $_POST['brewGrain7Weight'];
$brewGrain8Weight = $_POST['brewGrain8Weight'];
$brewGrain9Weight = $_POST['brewGrain9Weight'];
$brewGrain10Weight = $_POST['brewGrain10Weight'];
$brewGrain11Weight = $_POST['brewGrain11Weight'];
$brewGrain12Weight = $_POST['brewGrain12Weight'];
$brewGrain13Weight = $_POST['brewGrain13Weight'];
$brewGrain14Weight = $_POST['brewGrain14Weight'];
$brewGrain15Weight = $_POST['brewGrain15Weight'];
$brewAdjunct1 = $_POST['brewAdjunct1'];
$brewAdjunct2 = $_POST['brewAdjunct2'];
$brewAdjunct3 = $_POST['brewAdjunct3'];
$brewAdjunct4 = $_POST['brewAdjunct4'];
$brewAdjunct5 = $_POST['brewAdjunct5'];
$brewAdjunct6 = $_POST['brewAdjunct6'];
$brewAdjunct7 = $_POST['brewAdjunct7'];
$brewAdjunct8 = $_POST['brewAdjunct8'];
$brewAdjunct9 = $_POST['brewAdjunct9'];
$brewAdjunct1Weight = $_POST['brewAdjunct1Weight'];
$brewAdjunct2Weight = $_POST['brewAdjunct2Weight'];
$brewAdjunct3Weight = $_POST['brewAdjunct3Weight'];
$brewAdjunct4Weight = $_POST['brewAdjunct4Weight'];
$brewAdjunct5Weight = $_POST['brewAdjunct5Weight'];
$brewAdjunct6Weight = $_POST['brewAdjunct6Weight'];
$brewAdjunct7Weight = $_POST['brewAdjunct7Weight'];
$brewAdjunct8Weight = $_POST['brewAdjunct8Weight'];
$brewAdjunct9Weight = $_POST['brewAdjunct9Weight'];
for ($i = 0; $i < MAX_ADJ; $i++) {
$adjName[$i] = $_POST['adjName'][$i];
$adjWeight[$i] = $_POST['adjWeight'][$i];
}
for ($i = 0; $i < MAX_HOPS; $i++) {
$brewHopsName[$i] = $_POST['brewHopsName'][$i];
@@ -341,6 +291,5 @@ if ($results == "true") {
$brewHopsTime[$i] = $_POST['brewHopsTime'][$i];
$brewHopsForm[$i] = $_POST['brewHopsForm'][$i];
}
*/
}
?>

View File

@@ -12,20 +12,21 @@
// ----------------------------- General Information ---------------------
require_once 'bitterness.lib.php';
require_once 'color.lib.php';
$brewName = $_POST['brewName'];
$efficiency = ($_POST['efficiency'] * .01);
$attenuation = ($_POST['attenuation'] * .01);
$brewYield = $_POST['brewYield'];
$brewName = $_POST['brewName'];
$efficiency = ($_POST['efficiency'] * .01);
$attenuation = ($_POST['attenuation'] * .01);
$brewYield = $_POST['brewYield'];
$measureWeight1 = $row_pref['measWeight1'];
$mcu = 0;
// $gravity = $_POST['gravity'];
$measureWeight1 = $row_pref['measWeight1'];
// Style
$brewStyle = $_POST['brewStyle'];
$brewStyle = $_POST['brewStyle'];
$query_style1 = "SELECT * FROM styles WHERE brewStyle='$brewStyle'";
$style1 = mysql_query($query_style1, $brewing);
$row_style1 = mysql_fetch_array($style1);
$style1 = mysql_query($query_style1, $brewing);
$row_style1 = mysql_fetch_array($style1);
// ------------------------------ Extracts -------------------------------
@@ -44,43 +45,15 @@ for ($i = 0; $i < MAX_EXT; $i++) {
if ($row_pref['measWeight2'] == "kilograms") {
$extGU[$i] *= 2.2046;
}
$lov = ($extLovLow[$i] + $extLovHigh[$i]) / 2;
if ($row_pref['measWeight2'] == "pounds") {
$mcu += $lov * $extWeight[$i] / $brewYield;
} else {
$mcu += $lov * $extWeight[$i] * 2.2046 / ($brewYield * .2642);
}
}
/*
$brewExtract1 = $_POST['brewExtract1'];
$brewExtract1Weight = $_POST['brewExtract1Weight'];
for($i = 1; $i <= 15; ++$i) {
$query_extract = 'query_extract'.$i;
$extract = 'extract'.$i;
$row_extract = 'row_extract'.$i;
$totalRows_extract = 'totalRows_extract'.$i;
mysql_select_db($database_brewing, $brewing);
$$query_extract = sprintf("SELECT extractYield, extractLovibond FROM extract WHERE extractName='%s'", $_POST['brewExtract'.$i]);
$$extract = mysql_query($$query_extract, $brewing);
$$row_extract = mysql_fetch_array($$extract);
$$totalRows_extract = mysql_num_rows($$extract);
}
mysql_select_db($database_brewing, $brewing);
$query_extractPPG1 = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_extract1['extractYield']);
$extractPPG1 = mysql_query($query_extractPPG1, $brewing);
$row_extractPPG1 = mysql_fetch_array($extractPPG1);
// Extract Gravity Units (GU)
if ($row_pref['measWeight2'] == "pounds") {
$extract1GU = $brewExtract1Weight * $row_extractPPG1['sugarPPG'];
$extract5GU = $brewExtract5Weight * $row_extractPPG5['sugarPPG'];
}
if ($row_pref['measWeight2'] == "kilograms") {
$extract1GU = ($brewExtract1Weight * 2.2046) * $row_extractPPG1['sugarPPG'];
$extract5GU = ($brewExtract5Weight * 2.2046) * $row_extractPPG5['sugarPPG'];
}
*/
// ------------------------------ Grains ---------------------------------
for ($i = 0; $i < MAX_GRAINS; $i++) {
$grainName[$i] = $_POST['grainName'][$i];
@@ -97,46 +70,15 @@ for ($i = 0; $i < MAX_GRAINS; $i++) {
if ($row_pref['measWeight2'] == "kilograms") {
$grainGU[$i] *= 2.2046;
}
$lov = ($grainLovLow[$i] + $grainLovHigh[$i]) / 2;
if ($row_pref['measWeight2'] == "pounds") {
$mcu += $lov * $grainWeight[$i] / $brewYield;
} else {
$mcu += $lov * $grainWeight[$i] * 2.2046 / ($brewYield * .2642);
}
}
/*
$brewGrain1 = $_POST['brewGrain1'];
$brewGrain15 = $_POST['brewGrain15'];
$brewGrain1Weight = $_POST['brewGrain1Weight'];
$brewGrain15Weight = $_POST['brewGrain15Weight'];
for($i = 1; $i <= 15; ++$i) {
$query_grain = 'query_grain'.$i;
$grain = 'grain'.$i;
$row_grain = 'row_grain'.$i;
$totalRows_grain = 'totalRows_grain'.$i;
mysql_select_db($database_brewing, $brewing);
$$query_grain = sprintf("SELECT maltYield, maltLovibond FROM malt WHERE maltName='%s'", $_POST['brewGrain'.$i]);
$$grain = mysql_query($$query_grain, $brewing);
$$row_grain = mysql_fetch_array($$grain);
$$totalRows_grain = mysql_num_rows($$grain);
}
mysql_select_db($database_brewing, $brewing);
$query_grainPPG1 = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_grain1['maltYield']);
$grainPPG1 = mysql_query($query_grainPPG1, $brewing);
$row_grainPPG1 = mysql_fetch_array($grainPPG1);
// Grain Gravity Units (GU)
if ($row_pref['measWeight2'] == "pounds") {
$grain1GU = $brewGrain1Weight * $row_grainPPG1['sugarPPG'];
$grain15GU = $brewGrain15Weight * $row_grainPPG15['sugarPPG'];
}
if ($row_pref['measWeight2'] == "kilograms") {
$grain1GU = ($brewGrain1Weight * 2.2046) * $row_grainPPG1['sugarPPG'];
$grain15GU = ($brewGrain15Weight * 2.2046) * $row_grainPPG15['sugarPPG'];
}
*/
// ------------------------------ Adjuncts -------------------------------
for ($i = 0; $i < MAX_ADJ; $i++) {
$adjName[$i] = $_POST['adjName'][$i];
@@ -153,36 +95,15 @@ for ($i = 0; $i < MAX_ADJ; $i++) {
if ($row_pref['measWeight2'] == "kilograms") {
$adjGU[$i] *= 2.2046;
}
$lov = ($adjLovLow[$i] + $adjLovHigh[$i]) / 2;
if ($row_pref['measWeight2'] == "pounds") {
$mcu += $lov * $adjWeight[$i] / $brewYield;
} else {
$mcu += $lov * $adjWeight[$i] * 2.2046 / ($brewYield * .2642);
}
}
/*
$brewAdjunct1 = $_POST['brewAdjunct1'];
$brewAdjunct9 = $_POST['brewAdjunct9'];
$brewAdjunct1Weight = $_POST['brewAdjunct1Weight'];
$brewAdjunct9Weight = $_POST['brewAdjunct9Weight'];
$query_adjunct1 = "SELECT adjunctYield, adjunctLovibond FROM adjuncts WHERE adjunctName='$brewAdjunct1'";
$adjunct1 = mysql_query($query_adjunct1, $brewing) or die(mysql_error());
$row_adjunct1 = mysql_fetch_array($adjunct1);
$query_adjunct1PPG = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_adjunct1['adjunctYield']);
$adjunct1PPG = mysql_query($query_adjunct1PPG, $brewing) or die(mysql_error());
$row_adjunct1PPG = mysql_fetch_array($adjunct1PPG);
// Adjunct Gravity Units
if ($row_pref['measWeight2'] == "pounds") {
$adjunct1GU = $brewAdjunct1Weight * $row_adjunct1PPG['sugarPPG'];
$adjunct9GU = $brewAdjunct9Weight * $row_adjunct9PPG['sugarPPG'];
}
if ($row_pref['measWeight2'] == "kilograms") {
$adjunct1GU = ($brewAdjunct1Weight * 2.2046) * $row_adjunct1PPG['sugarPPG'];
$adjunct9GU = ($brewAdjunct9Weight * 2.2046) * $row_adjunct9PPG['sugarPPG'];
}
*/
// Total Gravity Units (GU) and grist weight.
$totalGU = 0;
$totalGrist = 0;
@@ -244,7 +165,7 @@ for ($i = 0; $i < MAX_HOPS; $i++) {
$hopsAA[$i] = $_POST['hopsAA'][$i];
$hopsTime[$i] = $_POST['hopsTime'][$i];
$hopsForm[$i] = $_POST['hopsForm'][$i];
}
}
// ------------------------------ Calculations ----------------------------------- //
@@ -286,121 +207,13 @@ if ($ibuAvg > 0) {
}
}
// ---- Color needs to be reworked ------
// Color (SRM)
/*
if ($row_pref['measWeight2'] == "pounds") {
$SRM1 = ($row_extract1['extractLovibond'] * $brewExtract1Weight) / $brewYield;
$SRM2 = ($row_extract2['extractLovibond'] * $brewExtract2Weight) / $brewYield;
$SRM3 = ($row_extract3['extractLovibond'] * $brewExtract3Weight) / $brewYield;
$SRM4 = ($row_extract4['extractLovibond'] * $brewExtract4Weight) / $brewYield;
$SRM5 = ($row_extract5['extractLovibond'] * $brewExtract5Weight) / $brewYield;
$SRM6 = ($row_grain1['maltLovibond'] * $brewGrain1Weight) / $brewYield;
$SRM7 = ($row_grain2['maltLovibond'] * $brewGrain2Weight) / $brewYield;
$SRM8 = ($row_grain3['maltLovibond'] * $brewGrain3Weight) / $brewYield;
$SRM9 = ($row_grain4['maltLovibond'] * $brewGrain4Weight) / $brewYield;
$SRM10 = ($row_grain5['maltLovibond'] * $brewGrain5Weight) / $brewYield;
$SRM11 = ($row_grain6['maltLovibond'] * $brewGrain6Weight) / $brewYield;
$SRM12 = ($row_grain7['maltLovibond'] * $brewGrain7Weight) / $brewYield;
$SRM13 = ($row_grain8['maltLovibond'] * $brewGrain8Weight) / $brewYield;
$SRM14 = ($row_grain9['maltLovibond'] * $brewGrain9Weight) / $brewYield;
$SRM24 = ($row_grain10['maltLovibond'] * $brewGrain10Weight) / $brewYield;
$SRM25 = ($row_grain11['maltLovibond'] * $brewGrain11Weight) / $brewYield;
$SRM26 = ($row_grain12['maltLovibond'] * $brewGrain12Weight) / $brewYield;
$SRM27 = ($row_grain13['maltLovibond'] * $brewGrain13Weight) / $brewYield;
$SRM28 = ($row_grain14['maltLovibond'] * $brewGrain14Weight) / $brewYield;
$SRM29 = ($row_grain15['maltLovibond'] * $brewGrain15Weight) / $brewYield;
$SRM15 = ($row_adjunct1['adjunctLovibond'] * $brewAdjunct1Weight) / $brewYield;
$SRM16 = ($row_adjunct2['adjunctLovibond'] * $brewAdjunct2Weight) / $brewYield;
$SRM17 = ($row_adjunct3['adjunctLovibond'] * $brewAdjunct3Weight) / $brewYield;
$SRM18 = ($row_adjunct4['adjunctLovibond'] * $brewAdjunct4Weight) / $brewYield;
$SRM19 = ($row_adjunct5['adjunctLovibond'] * $brewAdjunct5Weight) / $brewYield;
$SRM20 = ($row_adjunct6['adjunctLovibond'] * $brewAdjunct6Weight) / $brewYield;
$SRM21 = ($row_adjunct7['adjunctLovibond'] * $brewAdjunct7Weight) / $brewYield;
$SRM22 = ($row_adjunct8['adjunctLovibond'] * $brewAdjunct8Weight) / $brewYield;
$SRM23 = ($row_adjunct9['adjunctLovibond'] * $brewAdjunct9Weight) / $brewYield;
}
// --------------------------- Color ------------------------------------
if ($row_pref['measWeight2'] == "kilograms") {
$SRM1 = ($row_srm_extract1['extractLovibond'] * ($brewExtract1Weight * 2.2046)) / ($brewYield * .2642);
$SRM2 = ($row_srm_extract2['extractLovibond'] * ($brewExtract2Weight * 2.2046)) / ($brewYield * .2642);
$SRM3 = ($row_srm_extract3['extractLovibond'] * ($brewExtract3Weight * 2.2046)) / ($brewYield * .2642);
$SRM4 = ($row_srm_extract4['extractLovibond'] * ($brewExtract4Weight * 2.2046)) / ($brewYield * .2642);
$SRM5 = ($row_srm_extract5['extractLovibond'] * ($brewExtract5Weight * 2.2046)) / ($brewYield * .2642);
$SRM6 = ($row_grain1['maltLovibond'] * ($brewGrain1Weight * 2.2046)) / ($brewYield * .2642);
$SRM7 = ($row_grain2['maltLovibond'] * ($brewGrain2Weight * 2.2046)) / ($brewYield * .2642);
$SRM8 = ($row_grain3['maltLovibond'] * ($brewGrain3Weight * 2.2046)) / ($brewYield * .2642);
$SRM9 = ($row_grain4['maltLovibond'] * ($brewGrain4Weight * 2.2046)) / ($brewYield * .2642);
$SRM10 = ($row_grain5['maltLovibond'] * ($brewGrain5Weight * 2.2046)) / ($brewYield * .2642);
$SRM11 = ($row_grain6['maltLovibond'] * ($brewGrain6Weight * 2.2046)) / ($brewYield * .2642);
$SRM12 = ($row_grain7['maltLovibond'] * ($brewGrain7Weight * 2.2046)) / ($brewYield * .2642);
$SRM13 = ($row_grain8['maltLovibond'] * ($brewGrain8Weight * 2.2046)) / ($brewYield * .2642);
$SRM14 = ($row_grain9['maltLovibond'] * ($brewGrain9Weight * 2.2046)) / ($brewYield * .2642);
$SRM24 = ($row_grain10['maltLovibond'] * ($brewGrain10Weight * 2.2046)) / ($brewYield * .2642);
$SRM25 = ($row_grain11['maltLovibond'] * ($brewGrain11Weight * 2.2046)) / ($brewYield * .2642);
$SRM26 = ($row_grain12['maltLovibond'] * ($brewGrain12Weight * 2.2046)) / ($brewYield * .2642);
$SRM27 = ($row_grain13['maltLovibond'] * ($brewGrain13Weight * 2.2046)) / ($brewYield * .2642);
$SRM28 = ($row_grain14['maltLovibond'] * ($brewGrain14Weight * 2.2046)) / ($brewYield * .2642);
$SRM29 = ($row_grain15['maltLovibond'] * ($brewGrain15Weight * 2.2046)) / ($brewYield * .2642);
$SRM15 = ($row_adjunct1['adjunctLovibond'] * ($brewAdjunct1Weight * 2.2046)) / ($brewYield * .2642);
$SRM16 = ($row_adjunct2['adjunctLovibond'] * ($brewAdjunct2Weight * 2.2046)) / ($brewYield * .2642);
$SRM17 = ($row_adjunct3['adjunctLovibond'] * ($brewAdjunct3Weight * 2.2046)) / ($brewYield * .2642);
$SRM18 = ($row_adjunct4['adjunctLovibond'] * ($brewAdjunct4Weight * 2.2046)) / ($brewYield * .2642);
$SRM19 = ($row_adjunct5['adjunctLovibond'] * ($brewAdjunct5Weight * 2.2046)) / ($brewYield * .2642);
$SRM20 = ($row_adjunct6['adjunctLovibond'] * ($brewAdjunct6Weight * 2.2046)) / ($brewYield * .2642);
$SRM21 = ($row_adjunct7['adjunctLovibond'] * ($brewAdjunct7Weight * 2.2046)) / ($brewYield * .2642);
$SRM22 = ($row_adjunct8['adjunctLovibond'] * ($brewAdjunct8Weight * 2.2046)) / ($brewYield * .2642);
$SRM23 = ($row_adjunct9['adjunctLovibond'] * ($brewAdjunct9Weight * 2.2046)) / ($brewYield * .2642);
}
$SRMTotal =
$SRM1 +
$SRM2 +
$SRM3 +
$SRM4 +
$SRM5 +
$SRM6 +
$SRM7 +
$SRM8 +
$SRM9 +
$SRM10 +
$SRM11 +
$SRM12 +
$SRM13 +
$SRM14 +
$SRM15 +
$SRM16 +
$SRM17 +
$SRM18 +
$SRM19 +
$SRM20 +
$SRM21 +
$SRM22 +
$SRM23 +
$SRM24 +
$SRM25 +
$SRM26 +
$SRM27 +
$SRM28 +
$SRM29;
*/
// TMP amount until fix
$SRMTotal = 1;
if (($SRMTotal >= 1) && ($SRMTotal <= 11)) $SRM = $SRMTotal;
if (($SRMTotal >= 11) && ($SRMTotal < 21)) $SRM = $SRMTotal * .66;
if (($SRMTotal >= 21) && ($SRMTotal < 31)) $SRM = $SRMTotal * .51;
if (($SRMTotal >= 31) && ($SRMTotal < 41)) $SRM = $SRMTotal * .44;
if (($SRMTotal >= 41) && ($SRMTotal < 51)) $SRM = $SRMTotal * .41;
if (($SRMTotal >= 51) && ($SRMTotal < 85)) $SRM = $SRMTotal * .375;
if ($SRMTotal >= 85) $SRM = $SRMTotal * .35;
if ($row_pref['measColor'] == "EBC") {
$EBC = (2.65 * $SRM) - 1.2;
}
// $SRM = $SRMTotal * $efficiency * .49 * 1.25;
// formula from http://www.picobrewery.com/askarchive/color.html - best one I could find.
$srmMorey = calc_srm_morey($mcu);
$ebcMorey = srm_to_ebc($srmMorey);
$srmDaniels = calc_srm_daniels($mcu);
$ebcDaniels = srm_to_ebc($srmDaniels);
$srmMoser = calc_srm_moser($mcu);
$ebcMoser = srm_to_ebc($srmMoser);
?>

87
admin/lib/color.lib.php Normal file
View File

@@ -0,0 +1,87 @@
<?php
/**
* Module: color.lib.php
* Description: This library provides all the functions needed to calculate SRM
* values and convert between SRM and EBC.
*/
/**
* The Daniels, Moser and Morey methods are all well documented in numerous
* brewing texts. Moser came first and then Daniels modified that formula
* in Brewing Techniques - Vol. 3 Nos. 4-6, "Beer Color Demystified - Part
* I-III." Morey came last in a response to the BT article by Daneils:
* http://www.brewingtechniques.com/brewingtechniques/beerslaw/morey.html
* The Morey formula is considered to be the most accurate since it's
* exponential instead of linear and, therefore, follows the data
* more accurately. Wikipedia's "Standard Reference Method" page is also
* a good source as is Palmer's "How to Brew" book.
*
* The SRM/EBC conversions are based on the definition of SRM from the
* ASBC.
*/
// Convert SRM to EBC
function srm_to_ebc($srm) {
return round((1.97 * $srm), 1);
}
// Convert EBC to SRM
function ebc_to_srm($ebc) {
return round(($ebc / 1.97), 1);
}
// Calculate SRM using the Daniels method.
function calc_srm_daniels($mcu) {
return ($mcu * 0.2) + 8.4;
}
// Calculate SRM using the Moser method.
function calc_srm_moser($mcu) {
return ($mcu * 0.3) + 4.7;
}
// Calculate the SRM using the Morey method.
function calc_srm_morey($mcu) {
return 1.4922 * pow($mcu, 0.6859);
}
// Convert SRM value to hex color code for web display.
function get_display_color($srm) {
$srm = round($srm);
if ($srm >= 01 && $srm < 02) { $displayColor ="#f3f993"; }
elseif ($srm >= 02 && $srm < 03) { $displayColor = "#f5f75c"; }
elseif ($srm >= 03 && $srm < 04) { $displayColor = "#f6f513"; }
elseif ($srm >= 04 && $srm < 05) { $displayColor = "#eae615"; }
elseif ($srm >= 05 && $srm < 06) { $displayColor = "#e0d01b"; }
elseif ($srm >= 06 && $srm < 07) { $displayColor = "#d5bc26"; }
elseif ($srm >= 07 && $srm < 08) { $displayColor = "#cdaa37"; }
elseif ($srm >= 08 && $srm < 09) { $displayColor = "#c1963c"; }
elseif ($srm >= 09 && $srm < 10) { $displayColor = "#be8c3a"; }
elseif ($srm >= 10 && $srm < 11) { $displayColor = "#be823a"; }
elseif ($srm >= 11 && $srm < 12) { $displayColor = "#c17a37"; }
elseif ($srm >= 12 && $srm < 13) { $displayColor = "#bf7138"; }
elseif ($srm >= 13 && $srm < 14) { $displayColor = "#bc6733"; }
elseif ($srm >= 14 && $srm < 15) { $displayColor = "#b26033"; }
elseif ($srm >= 15 && $srm < 16) { $displayColor = "#a85839"; }
elseif ($srm >= 16 && $srm < 17) { $displayColor = "#985336"; }
elseif ($srm >= 17 && $srm < 18) { $displayColor = "#8d4c32"; }
elseif ($srm >= 18 && $srm < 19) { $displayColor = "#7c452d"; }
elseif ($srm >= 19 && $srm < 20) { $displayColor = "#6b3a1e"; }
elseif ($srm >= 20 && $srm < 21) { $displayColor = "#5d341a"; }
elseif ($srm >= 21 && $srm < 22) { $displayColor = "#4e2a0c"; }
elseif ($srm >= 22 && $srm < 23) { $displayColor = "#4a2727"; }
elseif ($srm >= 23 && $srm < 24) { $displayColor = "#361f1b"; }
elseif ($srm >= 24 && $srm < 25) { $displayColor = "#261716"; }
elseif ($srm >= 25 && $srm < 26) { $displayColor = "#231716"; }
elseif ($srm >= 26 && $srm < 27) { $displayColor = "#19100f"; }
elseif ($srm >= 27 && $srm < 28) { $displayColor = "#16100f"; }
elseif ($srm >= 28 && $srm < 29) { $displayColor = "#120d0c"; }
elseif ($srm >= 29 && $srm < 30) { $displayColor = "#100b0a"; }
elseif ($srm >= 30 && $srm < 31) { $displayColor = "#050b0a"; }
elseif ($srm > 31) { $displayColor = "#000000"; }
else { $displayColor = "#ffffff"; }
return $displayColor;
}

View File

@@ -1,18 +1,27 @@
<?php
/**
* Module: importFormVar.lib.php
* Description: This module is part of the recipe calculation process. It makes form vars available
* for processing before they're added to the recipe or blog db.
* Description: This module is part of the recipe calculation process. It ultimately makes form vars
* available to fill out a new blog or recipe if the user decides to "import" the
* calculated data. When $action == "calculate", either predicted.lib.php or
* verify.lib.php are hiding data which is not being used in the calculations since
* that data won't be part of the POST data otherwise. This data gets loaded by
* admin/index.php --> add.admin.php to create a new blog or recipe form in the
* $action = "importCalc" section.
*/
// $action == "calculate" if we're updating an existing recipe or blog; otherwise, $action = "importCalc"
if ($action == "calculate") { ?>
// Can't a bunch of this be deleted?...not sure.
<input type="hidden" name="brewName" value="<?php echo strtr($brewName, $html_string); ?>">
<input type="hidden" name="brewYeastAmt" value="<?php echo $brewYeastAmt; ?>">
<input type="hidden" name="brewYield" value="<?php echo $brewYield; ?>">
<input type="hidden" name="brewStyle" value="<?php echo $brewStyle; ?>">
<input type="hidden" name="brewLovibond" value="<?php if ($row_pref['measColor'] == "EBC") echo $EBC; else echo $SRM; ?>">
<input type="hidden" name="srmMorey" value="<?php echo $srmMorey; ?>">
<input type="hidden" name="srmDaniels" value="<?php echo $srmDaniels; ?>">
<input type="hidden" name="srmMoser" value="<?php echo $srmMoser; ?>">
<input type="hidden" name="ibuR" value="<?php echo $ibuR; ?>">
<input type="hidden" name="ibuG" value="<?php echo $ibuG; ?>">
@@ -20,92 +29,22 @@ if ($action == "calculate") { ?>
<input type="hidden" name="ibuD" value="<?php echo $ibuD; ?>">
<input type="hidden" name="ibuAvg" value="<?php echo $ibuAvg; ?>">
<?php
<?php
for ($i = 0; $i < MAX_EXT; $i++) {
echo '<input type="hidden" name="extName['.$i.']" value="'.$extName[$i].'">' . "\n";
echo '<input type="hidden" name="extWeight['.$i.']" value="'.$extWeight[$i].'">' . "\n";
}
/*
<input type="hidden" name="brewExtract1" value="<?php echo $brewExtract1; ?>">
<input type="hidden" name="brewExtract2" value="<?php echo $brewExtract2; ?>">
<input type="hidden" name="brewExtract3" value="<?php echo $brewExtract3; ?>">
<input type="hidden" name="brewExtract4" value="<?php echo $brewExtract4; ?>">
<input type="hidden" name="brewExtract5" value="<?php echo $brewExtract5; ?>">
<input type="hidden" name="brewExtract1Weight" value="<?php echo $brewExtract1Weight; ?>">
<input type="hidden" name="brewExtract2Weight" value="<?php echo $brewExtract2Weight; ?>">
<input type="hidden" name="brewExtract3Weight" value="<?php echo $brewExtract3Weight; ?>">
<input type="hidden" name="brewExtract4Weight" value="<?php echo $brewExtract4Weight; ?>">
<input type="hidden" name="brewExtract5Weight" value="<?php echo $brewExtract5Weight; ?>">
*/
for ($i = 0; $i < MAX_GRAINS; $i++) {
echo '<input type="hidden" name="grainName['.$i.']" value="'.$grainName[$i].'">' . "\n";
echo '<input type="hidden" name="grainWeight['.$i.']" value="'.$grainWeight[$i].'">' . "\n";
}
/*
<input type="hidden" name="brewGrain1" value="<?php echo $brewGrain1; ?>">
<input type="hidden" name="brewGrain2" value="<?php echo $brewGrain2; ?>">
<input type="hidden" name="brewGrain3" value="<?php echo $brewGrain3; ?>">
<input type="hidden" name="brewGrain4" value="<?php echo $brewGrain4; ?>">
<input type="hidden" name="brewGrain5" value="<?php echo $brewGrain5; ?>">
<input type="hidden" name="brewGrain6" value="<?php echo $brewGrain6; ?>">
<input type="hidden" name="brewGrain7" value="<?php echo $brewGrain7; ?>">
<input type="hidden" name="brewGrain8" value="<?php echo $brewGrain8; ?>">
<input type="hidden" name="brewGrain9" value="<?php echo $brewGrain9; ?>">
<input type="hidden" name="brewGrain10" value="<?php echo $brewGrain10; ?>">
<input type="hidden" name="brewGrain11" value="<?php echo $brewGrain11; ?>">
<input type="hidden" name="brewGrain12" value="<?php echo $brewGrain12; ?>">
<input type="hidden" name="brewGrain13" value="<?php echo $brewGrain13; ?>">
<input type="hidden" name="brewGrain14" value="<?php echo $brewGrain14; ?>">
<input type="hidden" name="brewGrain15" value="<?php echo $brewGrain15; ?>">
<input type="hidden" name="brewGrain1Weight" value="<?php echo $brewGrain1Weight; ?>">
<input type="hidden" name="brewGrain2Weight" value="<?php echo $brewGrain2Weight; ?>">
<input type="hidden" name="brewGrain3Weight" value="<?php echo $brewGrain3Weight; ?>">
<input type="hidden" name="brewGrain4Weight" value="<?php echo $brewGrain4Weight; ?>">
<input type="hidden" name="brewGrain5Weight" value="<?php echo $brewGrain5Weight; ?>">
<input type="hidden" name="brewGrain6Weight" value="<?php echo $brewGrain6Weight; ?>">
<input type="hidden" name="brewGrain7Weight" value="<?php echo $brewGrain7Weight; ?>">
<input type="hidden" name="brewGrain8Weight" value="<?php echo $brewGrain8Weight; ?>">
<input type="hidden" name="brewGrain9Weight" value="<?php echo $brewGrain9Weight; ?>">
<input type="hidden" name="brewGrain10Weight" value="<?php echo $brewGrain10Weight; ?>">
<input type="hidden" name="brewGrain11Weight" value="<?php echo $brewGrain11Weight; ?>">
<input type="hidden" name="brewGrain12Weight" value="<?php echo $brewGrain12Weight; ?>">
<input type="hidden" name="brewGrain13Weight" value="<?php echo $brewGrain13Weight; ?>">
<input type="hidden" name="brewGrain14Weight" value="<?php echo $brewGrain14Weight; ?>">
<input type="hidden" name="brewGrain15Weight" value="<?php echo $brewGrain15Weight; ?>">
*/
for ($i = 0; $i < MAX_ADJ; $i++) {
echo '<input type="hidden" name="adjName['.$i.']" value="'.$adjName[$i].'">' . "\n";
echo '<input type="hidden" name="adjWeight['.$i.']" value="'.$adjWeight[$i].'">' . "\n";
}
/*
<input type="hidden" name="brewAdjunct1" value="<?php echo $brewAdjunct1; ?>">
<input type="hidden" name="brewAdjunct2" value="<?php echo $brewAdjunct2; ?>">
<input type="hidden" name="brewAdjunct3" value="<?php echo $brewAdjunct3; ?>">
<input type="hidden" name="brewAdjunct4" value="<?php echo $brewAdjunct4; ?>">
<input type="hidden" name="brewAdjunct5" value="<?php echo $brewAdjunct5; ?>">
<input type="hidden" name="brewAdjunct6" value="<?php echo $brewAdjunct6; ?>">
<input type="hidden" name="brewAdjunct7" value="<?php echo $brewAdjunct7; ?>">
<input type="hidden" name="brewAdjunct8" value="<?php echo $brewAdjunct8; ?>">
<input type="hidden" name="brewAdjunct9" value="<?php echo $brewAdjunct9; ?>">
<input type="hidden" name="brewAdjunct1Weight" value="<?php echo $brewAdjunct1Weight; ?>">
<input type="hidden" name="brewAdjunct2Weight" value="<?php echo $brewAdjunct2Weight; ?>">
<input type="hidden" name="brewAdjunct3Weight" value="<?php echo $brewAdjunct3Weight; ?>">
<input type="hidden" name="brewAdjunct4Weight" value="<?php echo $brewAdjunct4Weight; ?>">
<input type="hidden" name="brewAdjunct5Weight" value="<?php echo $brewAdjunct5Weight; ?>">
<input type="hidden" name="brewAdjunct6Weight" value="<?php echo $brewAdjunct6Weight; ?>">
<input type="hidden" name="brewAdjunct7Weight" value="<?php echo $brewAdjunct7Weight; ?>">
<input type="hidden" name="brewAdjunct8Weight" value="<?php echo $brewAdjunct8Weight; ?>">
<input type="hidden" name="brewAdjunct9Weight" value="<?php echo $brewAdjunct9Weight; ?>">
*/
for ($i = 0; $i < MAX_HOPS; $i++) {
echo '<input type="hidden" name="hopsName['.$i.']" value="'.$hopsName[$i].'" />';
echo '<input type="hidden" name="hopsWeight['.$i.']" value="'.$hopsWeight[$i].'" />';
@@ -115,6 +54,7 @@ if ($action == "calculate") { ?>
}
if ($assoc == "import") { ?>
// What's so special about this section?
<input type="hidden" name="brewMisc1Name" value="<?php echo $row_recipeRecalc['brewMisc1Name']; ?>" />
<input type="hidden" name="brewMisc1Time" value="<?php echo $row_recipeRecalc['brewMisc1Time']; ?>" />
<input type="hidden" name="brewMisc1Amount" value="<?php echo $row_recipeRecalc['brewMisc1Amount']; ?>" />
@@ -133,91 +73,33 @@ if ($action == "calculate") { ?>
} else {
// This code runs when we import to a recipe or blog from the calculator.
$brewBrewerID = $_POST['brewBrewerID'];
$brewYield = $_POST['brewYield'];
$brewName = $_POST['brewName'];
$brewStyle = $_POST['brewStyle'];
$brewOG = $_POST['brewOG'];
$brewFG = $_POST['brewFG'];
$brewTargetOG = $_POST['brewTargetOG'];
$brewTargetFG = $_POST['brewTargetFG'];
list($brewBitterness, $brewIBUFormula) = explode("-", $_POST['brewBitterness']);
list($brewLovibond, $brewColorFormula) = explode("-", $_POST['brewLovibond']);
for ($i = 0; $i < MAX_EXT; $i++) {
$extName[$i] = $_POST['extName'][$i];
$extWeight[$i] = $_POST['extWeight'][$i];
}
/*
$brewExtract1 = $_POST['brewExtract1'];
$brewExtract2 = $_POST['brewExtract2'];
$brewExtract3 = $_POST['brewExtract3'];
$brewExtract4 = $_POST['brewExtract4'];
$brewExtract5 = $_POST['brewExtract5'];
$brewExtract1Weight = $_POST['brewExtract1Weight'];
$brewExtract2Weight = $_POST['brewExtract2Weight'];
$brewExtract3Weight = $_POST['brewExtract3Weight'];
$brewExtract4Weight = $_POST['brewExtract4Weight'];
$brewExtract5Weight = $_POST['brewExtract5Weight'];
*/
for ($i = 0; $i < MAX_GRAINS; $i++) {
$grainName[$i] = $_POST['grainName'][$i];
$grainWeight[$i] = $_POST['grainWeight'][$i];
}
/*
$brewGrain1 = $_POST['brewGrain1'];
$brewGrain2 = $_POST['brewGrain2'];
$brewGrain3 = $_POST['brewGrain3'];
$brewGrain4 = $_POST['brewGrain4'];
$brewGrain5 = $_POST['brewGrain5'];
$brewGrain6 = $_POST['brewGrain6'];
$brewGrain7 = $_POST['brewGrain7'];
$brewGrain8 = $_POST['brewGrain8'];
$brewGrain9 = $_POST['brewGrain9'];
$brewGrain10 = $_POST['brewGrain10'];
$brewGrain11 = $_POST['brewGrain11'];
$brewGrain12 = $_POST['brewGrain12'];
$brewGrain13 = $_POST['brewGrain13'];
$brewGrain14 = $_POST['brewGrain14'];
$brewGrain15 = $_POST['brewGrain15'];
$brewGrain1Weight = $_POST['brewGrain1Weight'];
$brewGrain2Weight = $_POST['brewGrain2Weight'];
$brewGrain3Weight = $_POST['brewGrain3Weight'];
$brewGrain4Weight = $_POST['brewGrain4Weight'];
$brewGrain5Weight = $_POST['brewGrain5Weight'];
$brewGrain6Weight = $_POST['brewGrain6Weight'];
$brewGrain7Weight = $_POST['brewGrain7Weight'];
$brewGrain8Weight = $_POST['brewGrain8Weight'];
$brewGrain9Weight = $_POST['brewGrain9Weight'];
$brewGrain10Weight = $_POST['brewGrain10Weight'];
$brewGrain11Weight = $_POST['brewGrain11Weight'];
$brewGrain12Weight = $_POST['brewGrain12Weight'];
$brewGrain13Weight = $_POST['brewGrain13Weight'];
$brewGrain14Weight = $_POST['brewGrain14Weight'];
$brewGrain15Weight = $_POST['brewGrain15Weight'];
*/
for ($i = 0; $i < MAX_ADJ; $i++) {
$adjName[$i] = $_POST['adjName'][$i];
$adjWeight[$i] = $_POST['adjWeight'][$i];
}
/*
$brewAdjunct1 = $_POST['brewAdjunct1'];
$brewAdjunct2 = $_POST['brewAdjunct2'];
$brewAdjunct3 = $_POST['brewAdjunct3'];
$brewAdjunct4 = $_POST['brewAdjunct4'];
$brewAdjunct5 = $_POST['brewAdjunct5'];
$brewAdjunct6 = $_POST['brewAdjunct6'];
$brewAdjunct7 = $_POST['brewAdjunct7'];
$brewAdjunct8 = $_POST['brewAdjunct8'];
$brewAdjunct9 = $_POST['brewAdjunct9'];
$brewAdjunct1Amt = $_POST['brewAdjunct1Weight'];
$brewAdjunct2Amt = $_POST['brewAdjunct2Weight'];
$brewAdjunct3Amt = $_POST['brewAdjunct3Weight'];
$brewAdjunct4Amt = $_POST['brewAdjunct4Weight'];
$brewAdjunct5Amt = $_POST['brewAdjunct5Weight'];
$brewAdjunct6Amt = $_POST['brewAdjunct6Weight'];
$brewAdjunct7Amt = $_POST['brewAdjunct7Weight'];
$brewAdjunct8Amt = $_POST['brewAdjunct8Weight'];
$brewAdjunct9Amt = $_POST['brewAdjunct9Weight'];
*/
for ($i = 0; $i < MAX_HOPS; $i++) {
$hopsName[$i] = $_POST['hopsName'][$i];
$hopsWeight[$i] = $_POST['hopsWeight'][$i];
@@ -225,16 +107,5 @@ if ($action == "calculate") { ?>
$hopsTime[$i] = $_POST['hopsTime'][$i];
$hopsForm[$i] = $_POST['hopsForm'][$i];
}
$brewBrewerID = $_POST['brewBrewerID'];
$brewYield = $_POST['brewYield'];
$brewName = $_POST['brewName'];
$brewStyle = $_POST['brewStyle'];
$brewLovibond = $_POST['brewLovibond'];
$brewBitterness = explode("-", $_POST['brewBitterness']);
$brewOG = $_POST['brewOG'];
$brewFG = $_POST['brewFG'];
$brewTargetOG = $_POST['brewTargetOG'];
$brewTargetFG = $_POST['brewTargetFG'];
}
?>

View File

@@ -9,169 +9,205 @@
<div id="calculate">
<div id="calculateInner">
<table class="dataTable">
<tr>
<td colspan="2" class="text_14_bold">Predicted Results</td>
<td class="text_14_bold data">BJCP</td>
</tr>
<tr>
<td colspan="3"><hr></td>
</tr>
<tr>
<td class="dataLabelWide">Name:</td>
<td class="data"><?php echo $brewName; ?></td>
<td class=" bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide">Style:</td>
<td class="data"><?php echo $brewStyle; ?></td>
<td class="data bdr1L_black"><a href="<?php echo $row_style1['brewStyleLink']; ?>" target="_blank"><?php echo $row_style1['brewStyleGroup'].$row_style1['brewStyleNum']; ?></a></td>
</tr>
<tr>
<td class="dataLabelWide">Color:</td>
<td class="data">
<?php include ('../includes/color.inc.php'); ?>
<table>
<tr>
<td class="colorTable" align="center" bgcolor="<?php echo $beercolor; ?>"><?php if ($SRM >= 15) echo "<font color=\"#ffffff\">"; else echo "<font color=\"#000000\">"; echo round ($SRM, 1)."/"; echo colorconvert($SRM, "EBC"); ?></td>
<td class="data">SRM/EBC</td>
</tr>
</table>
</td>
<td class="data bdr1L_black"><?php include ('../includes/colorStyle.inc.php'); ?>
<?php
if ($row_style1['brewStyleSRM'] == "") { echo "Varies"; }
elseif ($row_style1['brewStyleSRM'] == "N/A") { echo "N/A"; }
elseif ($row_style1['brewStyleSRM'] != "")
{
$SRMmin = ltrim ($row_style1['brewStyleSRM'], "0");
$SRMmax = ltrim ($row_style1['brewStyleSRMMax'], "0");
echo "<table><tr><td align=\"center\" bgcolor=".$beercolorMin." class=\"colorTable\">";
if ($SRMmin > "15") echo "<font color=\"#ffffff\">";
else echo "<font color=\"#000000\">";
echo $SRMmin."/".round(colorconvert($SRMmin, "EBC"), 0)."</font></td>
<td width=\"2\">&ndash;</td>
<td align=\"center\" bgcolor=".$beercolorMax." class=\"colorTable\">";
if ($SRMmax > "15") echo "<font color=\"#ffffff\">";
else echo "<font color=\"#000000\">";
echo $SRMmax."/".round(colorconvert($SRMmax, "EBC"), 0)."</font></td></tr></table>";
} else { echo "&nbsp;"; }
?>
</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>Bitterness:</td>
<td class="data" nowrap>
<table>
<tr>
<td>Garetz:&nbsp;</td>
<td><?php echo round ($ibuG, 1); ?>&nbsp;</td>
<td>IBU</td>
</tr>
<tr>
<td>Rager:&nbsp;</td>
<td><?php echo round ($ibuR, 1); ?>&nbsp;</td>
<td>IBU</td>
</tr>
<tr>
<td>Tinseth:&nbsp;</td>
<td><?php echo round ($ibuT, 1); ?>&nbsp;</td>
<td>IBU</td>
</tr>
<tr>
<td>Daniels:&nbsp;</td>
<td><?php echo round ($ibuD, 1); ?>&nbsp;</td>
<td>IBU</td>
</tr>
<tr>
<td>Avg:&nbsp;</td>
<td><strong><?php echo round($ibuAvg, 1); ?></strong>&nbsp;</td>
<td>IBU</td>
</tr>
</table>
</td>
<td class="data bdr1L_black" nowrap><?php
if ($row_style1['brewStyleIBU'] == "") { echo "Varies"; }
elseif ($row_style1['brewStyleIBU'] == "N/A") { echo "N/A"; }
elseif ($row_style1['brewStyleIBU'] != "") { $IBUmin = ltrim ($row_style1['brewStyleIBU'], "0"); $IBUmax = ltrim ($row_style1['brewStyleIBUMax'], "0"); echo $IBUmin." - ".$IBUmax." IBU"; }
else { echo "&nbsp;"; }
?>
</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>ABV:</td>
<td class="data" nowrap><?php echo round ($abv, 1); ?>%</td>
<td class="data bdr1L_black" nowrap>
<?php
if ($row_style1['brewStyleABV'] == "") { echo "Varies"; }
elseif ($row_style1['brewStyleABV'] != "" ) { echo $row_style1['brewStyleABV']." - ".$row_style1['brewStyleABVMax']."%"; }
else { echo "&nbsp;"; } ?>
</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>ABW:</td>
<td class="data" nowrap><?php echo round ($abw, 1); ?>%</td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>OG:</td>
<td class="data" nowrap><?php echo number_format ($og, 3); ?></td>
<td class="data bdr1L_black" nowrap>
<?php
if ($row_style1['brewStyleOG'] == "") { echo "Varies"; }
elseif ($row_style1['brewStyleOG'] != "") { echo $row_style1['brewStyleOG']." - ".$row_style1['brewStyleOGMax']; }
else { echo "&nbsp;"; }
?>
</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>FG:</td>
<td class="data" nowrap><?php echo number_format ($fg, 3); ?></td>
<td class="data bdr1L_black" nowrap>
<?php
if ($row_style1['brewStyleFG'] == "") { echo "Varies"; }
elseif ($row_style1['brewStyleFG'] != "") { echo $row_style1['brewStyleFG']." - ".$row_style1['brewStyleFGMax']; }
else { echo "&nbsp;"; }
?>
</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>Plato (I):</td>
<td class="data" nowrap><?php echo round ($plato_i, 1); ?></td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>Plato (F):</td>
<td class="data" nowrap><?php echo round ($plato_f, 1); ?></td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>Real Ext:</td>
<td class="data" nowrap><?php echo round ($real_extract, 1); ?></td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>App. Atten.:</td>
<td class="data" nowrap><?php echo round ($aa, 1); ?></td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>Real Atten.:</td>
<td class="data" nowrap><?php echo round ($ra, 1); ?></td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>Calories:</td>
<td class="data" nowrap><?php echo round ($calories, 0); ?> per 12 oz.</td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>BU/GU:</td>
<td class="data" nowrap><?php echo round ($bugu, 2); ?></td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
</table>
<table class="dataTable">
<tr>
<td colspan="2" class="text_14_bold">Predicted Results</td>
<td class="text_14_bold data">BJCP</td>
</tr>
<tr>
<td colspan="3"><hr></td>
</tr>
<tr>
<td class="dataLabelWide">Name:</td>
<td class="data"><?php echo $brewName; ?></td>
<td class=" bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide">Style:</td>
<td class="data"><?php echo $brewStyle; ?></td>
<td class="data bdr1L_black"><a href="<?php echo $row_style1['brewStyleLink']; ?>" target="_blank"><?php echo $row_style1['brewStyleGroup'] . $row_style1['brewStyleNum']; ?></a></td>
</tr>
<tr>
<td class="dataLabelWide">Color:</td>
<td class="data">
<table>
<tr>
<td>Morey:&nbsp;</td>
<?php
$fontColor = ($srmMorey >= 15) ? "#ffffff" : "#000000";
$bkColor = get_display_color($srmMorey);
?>
<td class="colorTable" style="text-align: center; background: <?php echo $bkColor ?>; color: <?php echo $fontColor ?>;">
<?php echo round($srmMorey, 1) . '/' . srm_to_ebc($srmMorey); ?></td>
<td>&nbsp;SRM/EBC</td>
</tr>
<tr>
<td>Daniels:&nbsp;</td>
<?php
$fontColor = ($srmDaniels >= 15) ? "#ffffff" : "#000000";
$bkColor = get_display_color($srmDaniels);
?>
<td class="colorTable" style="text-align: center; background: <?php echo $bkColor ?>; color: <?php echo $fontColor ?>;">
<?php echo round($srmDaniels, 1) . '/' . srm_to_ebc($srmDaniels); ?></td>
<td>&nbsp;SRM/EBC</td>
</tr>
<tr>
<td>Moser:&nbsp;</td>
<?php
$fontColor = ($srmMoser >= 15) ? "#ffffff" : "#000000";
$bkColor = get_display_color($srmMoser);
?>
<td class="colorTable" style="text-align: center; background: <?php echo $bkColor ?>; color: <?php echo $fontColor ?>;">
<?php echo round($srmMoser, 1) . '/' . srm_to_ebc($srmMoser); ?></td>
<td>&nbsp;SRM/EBC</td>
</tr>
</table>
</td>
<td class="data bdr1L_black">
<?php
if ($row_style1['brewStyleSRM'] == "") {
echo "Varies";
} elseif ($row_style1['brewStyleSRM'] == "N/A") {
echo "N/A";
} elseif ($row_style1['brewStyleSRM'] != "") {
$SRMmin = ltrim($row_style1['brewStyleSRM'], "0");
$SRMmax = ltrim($row_style1['brewStyleSRMMax'], "0");
$bkColorMin = get_display_color($SRMmin);
$bkColorMax = get_display_color($SRMmax);
$fontColor = ($SRMmin > "15") ? "#ffffff" : "#000000";
$fontColorMax = ($SRMmax > "15") ? "#ffffff" : "#000000";
echo '<table><tr><td style="text-align: center; background: ' . $bkColorMin . '; color: ' . $fontColorMin . ';" class="colorTable">';
echo $SRMmin . '/' . round(srm_to_ebc($SRMmin), 0) . '</td>';
echo '<td width="2">&ndash;</td>';
echo '<td style="text-align: center; background: ' . $bkColorMax . '; color: ' . $fontColorMax . ';" class="colorTable">';
echo $SRMmax . '/' . round(srm_to_ebc($SRMmax), 0) . '</td></tr></table>';
} else {
echo "&nbsp;";
}
?>
</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>Bitterness:</td>
<td class="data" nowrap>
<table>
<tr>
<td>Garetz:&nbsp;</td>
<td><?php echo round($ibuG, 1); ?>&nbsp;</td>
<td>IBU</td>
</tr>
<tr>
<td>Rager:&nbsp;</td>
<td><?php echo round($ibuR, 1); ?>&nbsp;</td>
<td>IBU</td>
</tr>
<tr>
<td>Tinseth:&nbsp;</td>
<td><?php echo round($ibuT, 1); ?>&nbsp;</td>
<td>IBU</td>
</tr>
<tr>
<td>Daniels:&nbsp;</td>
<td><?php echo round($ibuD, 1); ?>&nbsp;</td>
<td>IBU</td>
</tr>
<tr>
<td>Avg:&nbsp;</td>
<td style="font-weight: bold;"><?php echo round($ibuAvg, 1); ?>&nbsp;</td>
<td>IBU</td>
</tr>
</table>
</td>
<td class="data bdr1L_black" nowrap>
<?php
if ($row_style1['brewStyleIBU'] == "") {
echo "Varies";
} elseif ($row_style1['brewStyleIBU'] == "N/A") {
echo "N/A";
} elseif ($row_style1['brewStyleIBU'] != "") {
$IBUmin = ltrim ($row_style1['brewStyleIBU'], "0");
$IBUmax = ltrim ($row_style1['brewStyleIBUMax'], "0");
echo $IBUmin . " - " . $IBUmax . " IBU";
} else {
echo "&nbsp;";
}
?>
</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>ABV:</td>
<td class="data" nowrap><?php echo round ($abv, 1); ?>%</td>
<td class="data bdr1L_black" nowrap>
<?php
if ($row_style1['brewStyleABV'] == "") { echo "Varies"; }
elseif ($row_style1['brewStyleABV'] != "" ) { echo $row_style1['brewStyleABV']." - ".$row_style1['brewStyleABVMax']."%"; }
else { echo "&nbsp;"; }
?>
</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>ABW:</td>
<td class="data" nowrap><?php echo round ($abw, 1); ?>%</td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>OG:</td>
<td class="data" nowrap><?php echo number_format ($og, 3); ?></td>
<td class="data bdr1L_black" nowrap>
<?php
if ($row_style1['brewStyleOG'] == "") { echo "Varies"; }
elseif ($row_style1['brewStyleOG'] != "") { echo $row_style1['brewStyleOG']." - ".$row_style1['brewStyleOGMax']; }
else { echo "&nbsp;"; }
?>
</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>FG:</td>
<td class="data" nowrap><?php echo number_format ($fg, 3); ?></td>
<td class="data bdr1L_black" nowrap>
<?php
if ($row_style1['brewStyleFG'] == "") { echo "Varies"; }
elseif ($row_style1['brewStyleFG'] != "") { echo $row_style1['brewStyleFG']." - ".$row_style1['brewStyleFGMax']; }
else { echo "&nbsp;"; }
?>
</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>Plato (I):</td>
<td class="data" nowrap><?php echo round ($plato_i, 1); ?></td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>Plato (F):</td>
<td class="data" nowrap><?php echo round ($plato_f, 1); ?></td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>Real Ext:</td>
<td class="data" nowrap><?php echo round ($real_extract, 1); ?></td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>App. Atten.:</td>
<td class="data" nowrap><?php echo round ($aa, 1); ?></td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>Real Atten.:</td>
<td class="data" nowrap><?php echo round ($ra, 1); ?></td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>Calories:</td>
<td class="data" nowrap><?php echo round ($calories, 0); ?> per 12 oz.</td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
<tr>
<td class="dataLabelWide" nowrap>BU/GU:</td>
<td class="data" nowrap><?php echo round ($bugu, 2); ?></td>
<td class="bdr1L_black">&nbsp;</td>
</tr>
</table>
<?php if (isset($_SESSION["loginUsername"])) { ?>
<table class="dataTable">
<tr>

View File

@@ -7,9 +7,51 @@
* to the old values.
*/
include_once 'lib/color.lib.php';
// Load form vars
$brewBrewerID = $_POST['loginUsername'];
$brewName = $_POST['brewName'];
$brewYield = $_POST['brewYield'];
$brewStyle = $_POST['brewStyle'];
$srmMorey = $_POST['srmMorey'];
$srmDaniels = $_POST['srmDaniels'];
$srmMoser = $_POST['srmMoser'];
$ibuR = $_POST['ibuR'];
$ibuG = $_POST['ibuG'];
$ibuT = $_POST['ibuT'];
$ibuD = $_POST['ibuD'];
$ibuAvg = $_POST['ibuAvg'];
$brewOG = $_POST['brewOG'];
$brewFG = $_POST['brewFG'];
for ($i = 0; $i < MAX_EXT; $i++) {
$extName[$i] = $_POST['extName'][$i];
$extWeight[$i] = $_POST['extWeight'][$i];
}
for ($i = 0; $i < MAX_GRAINS; $i++) {
$grainName[$i] = $_POST['grainName'][$i];
$grainWeight[$i] = $_POST['grainWeight'][$i];
}
for ($i = 0; $i < MAX_ADJ; $i++) {
$adjName[$i] = $_POST['adjName'][$i];
$adjWeight[$i] = $_POST['adjWeight'][$i];
}
for ($i = 0; $i < MAX_HOPS; $i++) {
$hopsName[$i] = $_POST['hopsName'][$i];
$hopsWeight[$i] = $_POST['hopsWeight'][$i];
$hopsAA[$i] = $_POST['hopsAA'][$i];
$hopsTime[$i] = $_POST['hopsTime'][$i];
$hopsForm[$i] = $_POST['hopsForm'][$i];
}
// $assoc will either be "import" or "update"
if ($assoc == "import") $importDB = $_POST['importDB'];
?>
<div id="breadcrumbAdmin"><a href="index.php">Administration</a> &gt; <?php echo $page_title; ?></div>
<table class="dataTable">
<tr>
@@ -36,47 +78,159 @@ if ($assoc == "import") $importDB = $_POST['importDB'];
<?php if ($row_recipeRecalc['id'] != "") { ?><td class="data"><?php echo $row_recipeRecalc['brewStyle']; ?></td><?php } ?>
<td class="data"><?php echo $brewStyle; ?></td>
</tr>
<tr class="bknd_ultra_lt">
<td class="dataLabelLeft" nowrap>Color:</td>
<?php if ($row_recipeRecalc['id'] != "") { ?><td class="data"><?php echo round($row_recipeRecalc['brewLovibond'],1)." ".$row_pref['measColor']; ?></td><?php } ?>
<td class="data"><?php echo round($brewLovibond,1)." ".$row_pref['measColor']; ?></td>
</tr>
<tr>
<td class="dataLabelLeft" nowrap>Bitterness:</td>
<?php if ($row_recipeRecalc['id'] != "") { ?><td class="data"><?php echo round($row_recipeRecalc['brewBitterness'],1); ?></td><?php } ?>
<td class="dataLabelLeft" nowrap>Bitterness (IBU):</td>
<?php if ($row_recipeRecalc['id'] != "") { ?>
<td class="data">
<table>
<tr>
<td><?php echo round($row_recipeRecalc['brewBitterness'], 1); ?></td>
<td>&nbsp;<?php echo $row_recipeRecalc['brewIBUFormula']; ?></td>
</tr>
</table>
</td>
<?php } ?>
<td class="data">
<table>
<tr>
<td><input type="radio" name="brewBitterness" value="<?php echo round($ibuD, 1); echo "-Daniels"; ?>" <?php if ($row_user['defaultBitternessFormula'] == "Daniels") echo "checked"; ?> /></td>
<td>&nbsp;<?php echo round($ibuD,1); ?></td>
<td>&nbsp;(Daniels)</td>
<td>&nbsp;<?php echo round($ibuD, 1); ?></td>
<td>&nbsp;Daniels</td>
<td><input type="radio" name="brewBitterness" value="<?php echo round($ibuG, 1); echo "-Garetz"; ?>" <?php if ($row_user['defaultBitternessFormula'] == "Garetz") echo "checked"; ?> /></td>
<td>&nbsp;<?php echo round($ibuG,1); ?></td>
<td>&nbsp;(Garetz)&nbsp;</td>
<td>&nbsp;<?php echo round($ibuG, 1); ?></td>
<td>&nbsp;Garetz&nbsp;</td>
</tr>
<tr>
<td><input type="radio" name="brewBitterness" value="<?php echo round($ibuR, 1); echo "-Rager"; ?>" <?php if ($row_user['defaultBitternessFormula'] == "Rager") echo "checked"; ?> /></td>
<td>&nbsp;<?php echo round($ibuR,1); ?></td>
<td>&nbsp;(Rager)</td>
<td>&nbsp;<?php echo round($ibuR, 1); ?></td>
<td>&nbsp;Rager</td>
<td><input type="radio" name="brewBitterness" value="<?php echo round($ibuT, 1); echo "-Tinseth"; ?>" <?php if ($row_user['defaultBitternessFormula'] == "Tinseth") echo "checked"; ?> /></td>
<td>&nbsp;<?php echo round($ibuT,1); ?></td>
<td>&nbsp;(Tinseth)&nbsp;</td>
<td>&nbsp;<?php echo round($ibuT, 1); ?></td>
<td>&nbsp;Tinseth&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="dataLabelLeft" nowrap>Color (<?php echo $row_pref['measColor']; ?>):</td>
<td class="data">
<?php
if ($row_recipeRecalc['id'] != "") {
echo '<table>' . "\n";
echo '<tr>' . "\n";
$brewLov = $row_recipeRecalc['brewLovibond'];
if ($row_pref['measColor'] == "EBC")
$brewLov = ebc_to_srm($brewLov);
$fontColor = ($brewLov >= 15) ? "#ffffff" : "#000000";
$bkColor = get_display_color($brewLov);
echo '<td class="colorTable" style="text-align: center; background: ' . $bkColor . '; color: ' . $fontColor . ';">&nbsp;&nbsp;';
echo round($row_recipeRecalc['brewLovibond'], 1);
echo '&nbsp;&nbsp;</td>' . "\n";
echo '<td style="vertical-align: middle;">';
if ($row_recipeRecalc['brewColorFormula'] == "") {
echo "&nbsp;formula unknown";
} else {
echo '&nbsp;' . $row_recipeRecalc['brewColorFormula'];
}
echo '</td>' . "\n";
echo '</tr>' . "\n";
echo '</table>' . "\n";
} ?>
</td>
<td class="data">
<table>
<tr>
<?php
echo '<td><input type="radio" name="brewLovibond" value="';
if ($row_pref['measColor'] == "SRM") {
echo $srmMorey;
} else {
echo srm_to_ebc($srmMorey);
}
echo '-Morey" ';
if ($row_user['defaultColorFormula'] == "Morey")
echo "checked";
echo '/>&nbsp;</td>' . "\n";
$fontColor = ($srmMorey >= 15) ? "#ffffff" : "#000000";
$bkColor = get_display_color($srmMorey);
echo '<td class="colorTable" style="text-align: center; background: ' . $bkColor . '; color: ' . $fontColor . ';">&nbsp;&nbsp;';
if ($row_pref['measColor'] == "SRM") {
echo round($srmMorey, 1);
} else {
echo round(srm_to_ebc($srmMorey), 1);
}
echo '&nbsp;&nbsp;</td>' . "\n";
?>
<td style="vertical-align: middle;">&nbsp;Morey&nbsp;</td>
</tr>
<tr>
<?php
echo '<td><input type="radio" name="brewLovibond" value="';
if ($row_pref['measColor'] == "SRM") {
echo $srmDaniels;
} else {
echo srm_to_ebc($srmDaniels);
}
echo '-Daniels" ';
if ($row_user['defaultColorFormula'] == "Daniels")
echo "checked";
echo '/>&nbsp;</td>' . "\n";
$fontColor = ($srmDaniels >= 15) ? "#ffffff" : "#000000";
$bkColor = get_display_color($srmDaniels);
echo '<td class="colorTable" style="text-align: center; background: ' . $bkColor . '; color: ' . $fontColor . ';">&nbsp;&nbsp;';
if ($row_pref['measColor'] == "SRM") {
echo round($srmDaniels, 1);
} else {
echo round(srm_to_ebc($srmDaniels), 1);
}
echo '&nbsp;&nbsp;</td>' . "\n";
?>
<td style="vertical-align: middle;">&nbsp;Daniels&nbsp;</td>
</tr>
<tr>
<?php
echo '<td><input type="radio" name="brewLovibond" value="';
if ($row_pref['measColor'] == "SRM") {
echo $srmMoser;
} else {
echo srm_to_ebc($srmMoser);
}
echo '-Moser" ';
if ($row_user['defaultColorFormula'] == "Moser")
echo "checked";
echo '/>&nbsp;</td>' . "\n";
$fontColor = ($srmMoser >= 15) ? "#ffffff" : "#000000";
$bkColor = get_display_color($srmMoser);
echo '<td class="colorTable" style="text-align: center; background: ' . $bkColor . '; color: ' . $fontColor . ';">&nbsp;&nbsp;';
if ($row_pref['measColor'] == "SRM") {
echo round($srmMoser, 1);
} else {
echo round(srm_to_ebc($srmMoser), 1);
}
echo '&nbsp;&nbsp;</td>' . "\n";
?>
<td style="vertical-align: middle;">&nbsp;Moser&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr class="bknd_ultra_lt">
<td class="dataLabelLeft" nowrap>Yield<?php if ($assoc != "import") echo " (Choose)"; ?>:</td>
<td class="dataLabelLeft" nowrap>Yield:</td>
<?php if ($row_recipeRecalc['id'] != "") { ?><td class="data"><?php if ($assoc != "import") { ?><input type="radio" name="brewYield" value ="<?php echo $row_recipeRecalc['brewYield']; ?>">&nbsp;<?php } ?><?php echo $row_recipeRecalc['brewYield']; ?></td><?php } ?>
<td class="data"><?php if ($assoc != "import") { ?><input type="radio" name="brewYield" value ="<?php echo $brewYield; ?>" checked="checked">&nbsp;<?php } ?><?php echo $brewYield; ?></td>
</tr>
<tr>
<td class="dataLabelLeft" nowrap>OG<?php if ($assoc != "import") echo " (Choose)"; ?>:</td>
<td class="dataLabelLeft" nowrap>OG:</td>
<?php if ($row_recipeRecalc['id'] != "") { ?><td class="data"><?php if ($assoc != "import") { ?><input type="radio" name="brewOG" value ="<?php if ($source == "brewing") echo number_format($row_recipeRecalc['brewTargetOG'], 3); elseif ($row_recipeRecalc['brewOG'] > 0) echo number_format($row_recipeRecalc['brewOG'], 3); else echo ""; ?>" checked="checked">&nbsp;<?php } ?><?php if ($source == "brewing") echo number_format($row_recipeRecalc['brewTargetOG'], 3); elseif ($row_recipeRecalc['brewOG'] > 0) echo number_format($row_recipeRecalc['brewOG'], 3); else echo "None entered" ?></td><?php } ?>
<td class="data"><?php if ($assoc != "import") { ?><input type="radio" name="brewOG" value ="<?php if ($brewOG > 0) echo number_format ($brewOG, 3); ?>">&nbsp;<?php } ?><?php if ($brewOG > 0) echo number_format ($brewOG, 3); ?></td>
</tr>
<tr class="bknd_ultra_lt">
<td class="dataLabelLeft" nowrap>FG<?php if ($assoc != "import") echo " (Choose)"; ?>:</td>
<td class="dataLabelLeft" nowrap>FG:</td>
<?php if ($row_recipeRecalc['id'] != "") { ?><td class="data"><?php if ($assoc != "import") { ?><input type="radio" name="brewFG" value ="<?php if ($source == "brewing") echo number_format($row_recipeRecalc['brewTargetFG'], 3); elseif ($row_recipeRecalc['brewFG'] > 0) echo number_format($row_recipeRecalc['brewFG'], 3); else echo ""; ?>" checked="checked">&nbsp;<?php } ?><?php if ($source == "brewing") echo number_format($row_recipeRecalc['brewTargetFG'], 3); elseif ($row_recipeRecalc['brewFG'] > 0) echo number_format($row_recipeRecalc['brewFG'], 3); else echo "None entered" ?></td><?php } ?>
<td class="data"><?php if ($assoc != "import") { ?><input type="radio" name="brewFG" value ="<?php echo number_format ($brewFG, 3); ?>">&nbsp;<?php } ?><?php echo number_format ($brewFG, 3); ?></td>
</tr>
@@ -92,20 +246,6 @@ if ($assoc == "import") $importDB = $_POST['importDB'];
echo $row_recipeRecalc[$keyWeight] . ' ' . $row_pref['measWeight2'] . ' ' . $row_recipeRecalc[$keyName] . '<br />';
}
}
/*
if ($row_recipeRecalc['brewExtract2'] != "") {
echo $row_recipeRecalc['brewExtract2Weight']." ".$row_pref['measWeight2']." ".$row_recipeRecalc['brewExtract2']."<br />";
}
if ($row_recipeRecalc['brewExtract3'] != "") {
echo $row_recipeRecalc['brewExtract3Weight']." ".$row_pref['measWeight2']." ".$row_recipeRecalc['brewExtract3']."<br />";
}
if ($row_recipeRecalc['brewExtract4'] != "") {
echo $row_recipeRecalc['brewExtract4Weight']." ".$row_pref['measWeight2']." ".$row_recipeRecalc['brewExtract4']."<br />";
}
if ($row_recipeRecalc['brewExtract5'] != "") {
echo $row_recipeRecalc['brewExtract5Weight']." ".$row_pref['measWeight2']." ".$row_recipeRecalc['brewExtract5'];
}
*/
echo '</td>' . "\n";
}
echo '<td class="data">';
@@ -114,13 +254,6 @@ if ($assoc == "import") $importDB = $_POST['importDB'];
echo $extWeight[$i] . ' ' . $row_pref['measWeight2'] . ' ' . $extName[$i] . '<br />';
}
}
/*
if ($brewExtract1 != "") { echo $brewExtract1Weight." ".$row_pref['measWeight2']." ".$brewExtract1."<br />"; }
if ($brewExtract2 != "") { echo $brewExtract2Weight." ".$row_pref['measWeight2']." ".$brewExtract2."<br />"; }
if ($brewExtract3 != "") { echo $brewExtract3Weight." ".$row_pref['measWeight2']." ".$brewExtract3."<br />"; }
if ($brewExtract4 != "") { echo $brewExtract4Weight." ".$row_pref['measWeight2']." ".$brewExtract4."<br />"; }
if ($brewExtract5 != "") { echo $brewExtract5Weight." ".$row_pref['measWeight2']." ".$brewExtract5; }
*/
?>
</td>
</tr>
@@ -136,10 +269,6 @@ if ($assoc == "import") $importDB = $_POST['importDB'];
echo $row_recipeRecalc[$keyWeight] . ' ' . $row_pref['measWeight2'] . ' ' . $row_recipeRecalc[$keyName] . '<br />' . "\n";;
}
}
/*
if ($row_recipeRecalc['brewGrain1'] != "") echo $row_recipeRecalc['brewGrain1Weight']." ".$row_pref['measWeight2']." ".$row_recipeRecalc['brewGrain1']."<br>";
if ($row_recipeRecalc['brewGrain15'] != "") echo $row_recipeRecalc['brewGrain15Weight']." ".$row_pref['measWeight2']." ".$row_recipeRecalc['brewGrain15'];
*/
echo '</td>' . "\n";
}
echo '<td class="data">' . "\n";
@@ -147,10 +276,6 @@ if ($assoc == "import") $importDB = $_POST['importDB'];
if ($grainName[$i] != "") {
echo $grainWeight[$i] . ' ' . $row_pref['measWeight2'] . ' ' . $grainName[$i] . '<br />' . "\n";
}
/*
if ($brewGrain1 != "") echo $brewGrain1Weight." ".$row_pref['measWeight2']." ".$brewGrain1."<br>";
if ($brewGrain15 != "") echo $brewGrain15Weight." ".$row_pref['measWeight2']." ".$brewGrain15;
*/
}
?>
</td>
@@ -167,10 +292,6 @@ if ($assoc == "import") $importDB = $_POST['importDB'];
echo $row_recipeRecalc[$keyAmt] . ' ' . $row_pref['measWeight2'] . ' ' . $row_recipeRecalc[$keyName] . '<br />' . "\n";
}
}
/*
if ($row_recipeRecalc['brewAddition1'] != "") echo $row_recipeRecalc['brewAddition1Amt']." ".$row_pref['measWeight2']." ".$row_recipeRecalc['brewAddition1']."<br>";
if ($row_recipeRecalc['brewAddition9'] != "") echo $row_recipeRecalc['brewAddition9Amt']." ".$row_pref['measWeight2']." ".$row_recipeRecalc['brewAddition9'];
*/
echo '</td>' . "\n";
}
echo '<td class="data">';
@@ -179,17 +300,6 @@ if ($assoc == "import") $importDB = $_POST['importDB'];
echo $adjWeight[$i] . ' ' . $row_pref['measWeight2'] . ' ' . $adjName[$i] . '<br />' . "\n";
}
}
/*
if ($brewAdjunct1 != "") echo $brewAdjunct1Weight." ".$row_pref['measWeight2']." ".$brewAdjunct1."<br>";
if ($brewAdjunct2 != "") echo $brewAdjunct2Weight." ".$row_pref['measWeight2']." ".$brewAdjunct2."<br>";
if ($brewAdjunct3 != "") echo $brewAdjunct3Weight." ".$row_pref['measWeight2']." ".$brewAdjunct3."<br>";
if ($brewAdjunct4 != "") echo $brewAdjunct4Weight." ".$row_pref['measWeight2']." ".$brewAdjunct4."<br>";
if ($brewAdjunct5 != "") echo $brewAdjunct5Weight." ".$row_pref['measWeight2']." ".$brewAdjunct5."<br>";
if ($brewAdjunct6 != "") echo $brewAdjunct6Weight." ".$row_pref['measWeight2']." ".$brewAdjunct6."<br>";
if ($brewAdjunct7 != "") echo $brewAdjunct7Weight." ".$row_pref['measWeight2']." ".$brewAdjunct7."<br>";
if ($brewAdjunct8 != "") echo $brewAdjunct8Weight." ".$row_pref['measWeight2']." ".$brewAdjunct8."<br>";
if ($brewAdjunct9 != "") echo $brewAdjunct9Weight." ".$row_pref['measWeight2']." ".$brewAdjunct9;
*/
?>
</td>
</tr>

View File

@@ -92,7 +92,6 @@ function load_recipe_brewing_common_data($update) {
$fieldData["brewStyle"] = GetSQLValueString($_POST['brewStyle'], "text");
$fieldData["brewYield"] = GetSQLValueString($_POST['brewYield'], "text");
$fieldData["brewBrewerID"] = GetSQLValueString($_POST['brewBrewerID'], "text");
$fieldData["brewLovibond"] = GetSQLValueString($_POST['brewLovibond'], "text");
for ($i = 0; $i < MAX_EXT; $i++) {
$key = "brewExtract" . ($i + 1);
@@ -101,19 +100,6 @@ function load_recipe_brewing_common_data($update) {
$fieldData[$key] = GetSQLValueString($_POST['extWeight'][$i], "text");
}
/*
$fieldData["brewExtract1"] = GetSQLValueString($_POST['brewExtract1'], "text");
$fieldData["brewExtract1Weight"] = GetSQLValueString($_POST['brewExtract1Weight'], "text");
$fieldData["brewExtract2"] = GetSQLValueString($_POST['brewExtract2'], "text");
$fieldData["brewExtract2Weight"] = GetSQLValueString($_POST['brewExtract2Weight'], "text");
$fieldData["brewExtract3"] = GetSQLValueString($_POST['brewExtract3'], "text");
$fieldData["brewExtract3Weight"] = GetSQLValueString($_POST['brewExtract3Weight'], "text");
$fieldData["brewExtract4"] = GetSQLValueString($_POST['brewExtract4'], "text");
$fieldData["brewExtract4Weight"] = GetSQLValueString($_POST['brewExtract4Weight'], "text");
$fieldData["brewExtract5"] = GetSQLValueString($_POST['brewExtract5'], "text");
$fieldData["brewExtract5Weight"] = GetSQLValueString($_POST['brewExtract5Weight'], "text");
*/
for ($i = 0; $i < MAX_GRAINS; $i++) {
$key = "brewGrain" . ($i + 1);
$fieldData[$key] = GetSQLValueString($_POST['grainName'][$i], "text");
@@ -121,39 +107,6 @@ function load_recipe_brewing_common_data($update) {
$fieldData[$key] = GetSQLValueString($_POST['grainWeight'][$i], "text");
}
/*
$fieldData["brewGrain1"] = GetSQLValueString($_POST['brewGrain1'], "text");
$fieldData["brewGrain1Weight"] = GetSQLValueString($_POST['brewGrain1Weight'], "text");
$fieldData["brewGrain2"] = GetSQLValueString($_POST['brewGrain2'], "text");
$fieldData["brewGrain2Weight"] = GetSQLValueString($_POST['brewGrain2Weight'], "text");
$fieldData["brewGrain3"] = GetSQLValueString($_POST['brewGrain3'], "text");
$fieldData["brewGrain3Weight"] = GetSQLValueString($_POST['brewGrain3Weight'], "text");
$fieldData["brewGrain4"] = GetSQLValueString($_POST['brewGrain4'], "text");
$fieldData["brewGrain4Weight"] = GetSQLValueString($_POST['brewGrain4Weight'], "text");
$fieldData["brewGrain5"] = GetSQLValueString($_POST['brewGrain5'], "text");
$fieldData["brewGrain5Weight"] = GetSQLValueString($_POST['brewGrain5Weight'], "text");
$fieldData["brewGrain6"] = GetSQLValueString($_POST['brewGrain6'], "text");
$fieldData["brewGrain6Weight"] = GetSQLValueString($_POST['brewGrain6Weight'], "text");
$fieldData["brewGrain7"] = GetSQLValueString($_POST['brewGrain7'], "text");
$fieldData["brewGrain7Weight"] = GetSQLValueString($_POST['brewGrain7Weight'], "text");
$fieldData["brewGrain8"] = GetSQLValueString($_POST['brewGrain8'], "text");
$fieldData["brewGrain8Weight"] = GetSQLValueString($_POST['brewGrain8Weight'], "text");
$fieldData["brewGrain9"] = GetSQLValueString($_POST['brewGrain9'], "text");
$fieldData["brewGrain9Weight"] = GetSQLValueString($_POST['brewGrain9Weight'], "text");
$fieldData["brewGrain10"] = GetSQLValueString($_POST['brewGrain10'], "text");
$fieldData["brewGrain10Weight"] = GetSQLValueString($_POST['brewGrain10Weight'], "text");
$fieldData["brewGrain11"] = GetSQLValueString($_POST['brewGrain11'], "text");
$fieldData["brewGrain11Weight"] = GetSQLValueString($_POST['brewGrain11Weight'], "text");
$fieldData["brewGrain12"] = GetSQLValueString($_POST['brewGrain12'], "text");
$fieldData["brewGrain12Weight"] = GetSQLValueString($_POST['brewGrain12Weight'], "text");
$fieldData["brewGrain13"] = GetSQLValueString($_POST['brewGrain13'], "text");
$fieldData["brewGrain13Weight"] = GetSQLValueString($_POST['brewGrain13Weight'], "text");
$fieldData["brewGrain14"] = GetSQLValueString($_POST['brewGrain14'], "text");
$fieldData["brewGrain14Weight"] = GetSQLValueString($_POST['brewGrain14Weight'], "text");
$fieldData["brewGrain15"] = GetSQLValueString($_POST['brewGrain15'], "text");
$fieldData["brewGrain15Weight"] = GetSQLValueString($_POST['brewGrain15Weight'], "text");
*/
for ($i = 0; $i < MAX_ADJ; $i++) {
$key = "brewAddition" . ($i + 1);
$fieldData[$key] = GetSQLValueString($_POST['adjName'][$i], "text");
@@ -161,27 +114,6 @@ function load_recipe_brewing_common_data($update) {
$fieldData[$key] = GetSQLValueString($_POST['adjWeight'][$i], "text");
}
/*
$fieldData["brewAddition1"] = GetSQLValueString($_POST['brewAdjunct1'], "text");
$fieldData["brewAddition1Amt"] = GetSQLValueString($_POST['brewAdjunct1Weight'], "text");
$fieldData["brewAddition2"] = GetSQLValueString($_POST['brewAdjunct2'], "text");
$fieldData["brewAddition2Amt"] = GetSQLValueString($_POST['brewAdjunct2Weight'], "text");
$fieldData["brewAddition3"] = GetSQLValueString($_POST['brewAdjunct3'], "text");
$fieldData["brewAddition3Amt"] = GetSQLValueString($_POST['brewAdjunct3Weight'], "text");
$fieldData["brewAddition4"] = GetSQLValueString($_POST['brewAdjunct4'], "text");
$fieldData["brewAddition4Amt"] = GetSQLValueString($_POST['brewAdjunct4Weight'], "text");
$fieldData["brewAddition5"] = GetSQLValueString($_POST['brewAdjunct5'], "text");
$fieldData["brewAddition5Amt"] = GetSQLValueString($_POST['brewAdjunct5Weight'], "text");
$fieldData["brewAddition6"] = GetSQLValueString($_POST['brewAdjunct6'], "text");
$fieldData["brewAddition6Amt"] = GetSQLValueString($_POST['brewAdjunct6Weight'], "text");
$fieldData["brewAddition7"] = GetSQLValueString($_POST['brewAdjunct7'], "text");
$fieldData["brewAddition7Amt"] = GetSQLValueString($_POST['brewAdjunct7Weight'], "text");
$fieldData["brewAddition8"] = GetSQLValueString($_POST['brewAdjunct8'], "text");
$fieldData["brewAddition8Amt"] = GetSQLValueString($_POST['brewAdjunct8Weight'], "text");
$fieldData["brewAddition9"] = GetSQLValueString($_POST['brewAdjunct9'], "text");
$fieldData["brewAddition9Amt"] = GetSQLValueString($_POST['brewAdjunct9Weight'], "text");
*/
for ($i = 0; $i < MAX_HOPS; $i++) {
$key = "brewHops" . ($i + 1);
$fieldData[$key] = GetSQLValueString($_POST['hopsName'][$i], "text");
@@ -203,10 +135,13 @@ function load_recipe_brewing_common_data($update) {
}
if (!$update) {
$fieldData["brewMethod"] = GetSQLValueString($_POST['brewMethod'], "text");
$fieldData["brewProcedure"] = GetSQLValueString($_POST['brewProcedure'], "text");
$fieldData["brewBitterness"] = GetSQLValueString($_POST['brewBitterness'], "text");
$fieldData["brewIBUFormula"] = GetSQLValueString($_POST['brewIBUFormula'], "text");
$fieldData["brewMethod"] = GetSQLValueString($_POST['brewMethod'], "text");
$fieldData["brewProcedure"] = GetSQLValueString($_POST['brewProcedure'], "text");
$fieldData["brewBitterness"] = GetSQLValueString($_POST['brewBitterness'], "text");
$fieldData["brewIBUFormula"] = GetSQLValueString($_POST['brewIBUFormula'], "text");
$fieldData["brewLovibond"] = GetSQLValueString($_POST['brewLovibond'], "text");
$fieldData["brewColorFormula"] = GetSQLValueString($_POST['brewColorFormula'], "text");
$fieldData["brewFeatured"] = GetSQLValueString($_POST['brewFeatured'], "text");
$fieldData["brewArchive"] = GetSQLValueString($_POST['brewArchive'], "text");
$fieldData["brewBoilTime"] = GetSQLValueString($_POST['brewBoilTime'], "text");
@@ -341,6 +276,10 @@ function load_recipe_brewing_update_data($table) {
$fieldData["brewBitterness"] = GetSQLValueString($brewBitterness[0], "text");
$fieldData["brewIBUFormula"] = GetSQLValueString($brewBitterness[1], "text");
$brewLovibond = explode("-", $_POST['brewLovibond']);
$fieldData["brewLovibond"] = GetSQLValueString($brewLovibond[0], "text");
$fieldData["brewColorFormula"] = GetSQLValueString($brewLovibond[1], "text");
// Hop Use and Type aren't considered in the calculator so we have to make some assumptions here.
$boilTime = $_POST['brewBoilTime'];
for ($i = 0; $i < MAX_HOPS; $i++) {
@@ -480,7 +419,7 @@ if (($action == "update") && (($dbTable == "brewing") || ($dbTable == "recipes")
header(sprintf("Location: %s", $updateGoTo));
}
// --------------------------- If Adding or Copying a Recipe ------------------------------ //
// --------------------------- If Adding a new Recipe --------------------------------------- //
if ((($action == "add") || ($action == "importRecipe") || ($action == "importCalc") ||
($action == "reuse") || ($action == "import")) && ($dbTable=="recipes")) {
@@ -532,9 +471,9 @@ if (($action == "edit") && ($dbTable == "recipes")) {
$fieldData["brewYeastAmount"] = GetSQLValueString($_POST['brewYeastAmount'], "scrubbed");
$fieldData["brewYeastProfile"] = GetSQLValueString($_POST['brewYeastProfile'], "text");
$insert = "";
$count = count($fieldData);
$i = 1;
$data = "";
$count = count($fieldData);
$i = 1;
foreach ($fieldData as $k => $v) {
$data .= "$k = $v";
@@ -759,187 +698,155 @@ if (($action == "edit") && ($dbTable == "brewerlinks")) {
// --------------------------- If Adding a User ------------------------------ //
if (($action == "add") && ($dbTable == "users")) {
$password = md5($_POST['password']);
$insertSQL = sprintf("INSERT INTO users (
user_name,
password,
realFirstName,
realLastName,
userLevel,
userProfile,
userPicURL,
userFavStyles,
userFavCommercial,
userFavQuote,
userDesignations,
userOccupation,
userHobbies,
userBirthdate,
userHometown,
userBrewingSince,
userWebsiteName,
userWebsiteURL,
userPosition,
userPastPosition,
userInfoPrivate,
userAddress,
userCity,
userState,
userZip,
userPhoneH,
userPhoneW,
userEmail,
defaultBoilTime,
defaultEquipProfile,
defaultMashProfile,
defaultWaterProfile,
defaultBitternessFormula,
defaultMethod,
defaultBatchSize,
defaultWaterRatio
)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['user_name'], "text"),
GetSQLValueString($password, "text"),
GetSQLValueString($_POST['realFirstName'], "scrubbed"),
GetSQLValueString($_POST['realLastName'], "scrubbed"),
GetSQLValueString($_POST['userLevel'], "text"),
GetSQLValueString($_POST['userProfile'], "text"),
GetSQLValueString($_POST['userPicURL'], "text"),
GetSQLValueString($_POST['userFavStyles'], "scrubbed"),
GetSQLValueString($_POST['userFavCommercial'], "scrubbed"),
GetSQLValueString($_POST['userFavQuote'], "scrubbed"),
GetSQLValueString($_POST['userDesignations'], "scrubbed"),
GetSQLValueString($_POST['userOccupation'], "scrubbed"),
GetSQLValueString($_POST['userHobbies'], "scrubbed"),
GetSQLValueString($_POST['userBirthdate'], "text"),
GetSQLValueString($_POST['userHometown'], "scrubbed"),
GetSQLValueString($_POST['userBrewingSince'], "text"),
GetSQLValueString($_POST['userWebsiteName'], "scrubbed"),
GetSQLValueString($_POST['userWebsiteURL'], "text"),
GetSQLValueString($_POST['userPosition'], "scrubbed"),
GetSQLValueString($_POST['userPastPosition'], "scrubbed"),
GetSQLValueString($_POST['userInfoPrivate'], "text"),
GetSQLValueString($_POST['userAddress'], "scrubbed"),
GetSQLValueString($_POST['userCity'], "scrubbed"),
GetSQLValueString($_POST['userState'], "scrubbed"),
GetSQLValueString($_POST['userZip'], "text"),
GetSQLValueString($_POST['userPhoneH'], "text"),
GetSQLValueString($_POST['userPhoneW'], "text"),
GetSQLValueString($_POST['userEmail'], "text"),
GetSQLValueString($_POST['defaultBoilTime'], "text"),
GetSQLValueString($_POST['defaultEquipProfile'], "text"),
GetSQLValueString($_POST['defaultMashProfile'], "text"),
GetSQLValueString($_POST['defaultWaterProfile'], "text"),
GetSQLValueString($_POST['defaultBitternessFormula'], "text"),
GetSQLValueString($_POST['defaultMethod'], "text"),
GetSQLValueString($_POST['defaultBatchSize'], "text"),
GetSQLValueString($_POST['defaultWaterRatio'], "text")
);
$password = md5($_POST['password']);
mysql_select_db($database_brewing, $brewing);
$Result1 = mysql_query($insertSQL, $brewing) or die(mysql_error());
$fieldData["user_name"] = GetSQLValueString($_POST['user_name'], "text");
$fieldData["password"] = GetSQLValueString($password, "text");
$fieldData["realFirstName"] = GetSQLValueString($_POST['realFirstName'], "scrubbed");
$fieldData["realLastName"] = GetSQLValueString($_POST['realLastName'], "scrubbed");
$fieldData["userLevel"] = GetSQLValueString($_POST['userLevel'], "text");
$fieldData["userProfile"] = GetSQLValueString($_POST['userProfile'], "text");
$fieldData["userPicURL"] = GetSQLValueString($_POST['userPicURL'], "text");
$fieldData["userFavStyles"] = GetSQLValueString($_POST['userFavStyles'], "scrubbed");
$fieldData["userFavCommercial"] = GetSQLValueString($_POST['userFavCommercial'], "scrubbed");
$fieldData["userFavQuote"] = GetSQLValueString($_POST['userFavQuote'], "scrubbed");
$fieldData["userDesignations"] = GetSQLValueString($_POST['userDesignations'], "scrubbed");
$fieldData["userOccupation"] = GetSQLValueString($_POST['userOccupation'], "scrubbed");
$fieldData["userHobbies"] = GetSQLValueString($_POST['userHobbies'], "scrubbed");
$fieldData["userBirthdate"] = GetSQLValueString($_POST['userBirthdate'], "text");
$fieldData["userHometown"] = GetSQLValueString($_POST['userHometown'], "scrubbed");
$fieldData["userBrewingSince"] = GetSQLValueString($_POST['userBrewingSince'], "scrubbed");
$fieldData["userWebsiteName"] = GetSQLValueString($_POST['userWebsiteName'], "scrubbed");
$fieldData["userWebsiteURL"] = GetSQLValueString($_POST['userWebsiteURL'], "text");
$fieldData["userPosition"] = GetSQLValueString($_POST['userPosition'], "scrubbed");
$fieldData["userPastPosition"] = GetSQLValueString($_POST['userPastPosition'], "scrubbed");
$fieldData["userInfoPrivate"] = GetSQLValueString($_POST['userInfoPrivate'], "text");
$fieldData["userAddress"] = GetSQLValueString($_POST['userAddress'], "scrubbed");
$fieldData["userCity"] = GetSQLValueString($_POST['userCity'], "scrubbed");
$fieldData["userState"] = GetSQLValueString($_POST['userState'], "scrubbed");
$fieldData["userZip"] = GetSQLValueString($_POST['userZip'], "text");
$fieldData["userPhoneH"] = GetSQLValueString($_POST['userPhoneH'], "text");
$fieldData["userPhoneW"] = GetSQLValueString($_POST['userPhoneW'], "text");
$fieldData["userEmail"] = GetSQLValueString($_POST['userEmail'], "text");
$fieldData["defaultBoilTime"] = GetSQLValueString($_POST['defaultBoilTime'], "text");
$fieldData["defaultEquipProfile"] = GetSQLValueString($_POST['defaultEquipProfile'], "text");
$fieldData["defaultMashProfile"] = GetSQLValueString($_POST['defaultMashProfile'], "text");
$fieldData["defaultWaterProfile"] = GetSQLValueString($_POST['defaultWaterProfile'], "text");
$fieldData["defaultBitternessFormula"] = GetSQLValueString($_POST['defaultBitternessFormula'], "text");
$fieldData["defaultMethod"] = GetSQLValueString($_POST['defaultMethod'], "text");
$fieldData["defaultBatchSize"] = GetSQLValueString($_POST['defaultBatchSize'], "text");
$fieldData["defaultWaterRatio"] = GetSQLValueString($_POST['defaultWaterRatio'], "text");
$fieldData["defaultColorFormula"] = GetSQLValueString($_POST['defaultColorFormula'], "text");
$insertGoTo = "index.php?action=list&dbTable=users&confirm=true&msg=1";
header(sprintf("Location: %s", $insertGoTo));
$columns = array();
$data = array();
foreach ($fieldData as $k => $v) {
$columns[] = $k;
if ($v != "") {
$data[] = $v;
} else {
$data[] = "NULL";
}
}
$cols = implode(",", $columns);
$vals = implode(",", $data);
$insertSQL = "INSERT INTO users ($cols) VALUES ($vals)";
mysql_select_db($database_brewing, $brewing);
$Result1 = mysql_query($insertSQL, $brewing) or die(mysql_error());
$insertGoTo = "index.php?action=list&dbTable=users&confirm=true&msg=1";
header(sprintf("Location: %s", $insertGoTo));
}
// --------------------------- If Editing a User ----------------------------- //
if (($action == "edit") && ($dbTable == "users") && ($section == "password"))
{
$admin = $_POST['admin'];
mysql_select_db($database_brewing, $brewing);
$query_user5 = sprintf("SELECT user_name,password FROM users WHERE id = '%s'", $id);
$user5 = mysql_query($query_user5, $brewing) or die(mysql_error());
$row_user5 = mysql_fetch_assoc($user5);
$totalRows_user5 = mysql_num_rows($user5);
$password = md5($_POST['password']);
if (($reset == "default") && ($admin == "nonpriv")){
$passwordOld = md5($_POST['passwordOld']); $confirmPass = $row_user5['password'];
if ($confirmPass != $passwordOld)
header ("Location: index.php?action=edit&dbTable=users&id=".$id."&confirm=false&section=password&msg=2");
}
if (($confirmPass == $passwordOld) || ($reset == "true") || ($admin == "admin"))
{
$updateSQL = sprintf("UPDATE users SET password=%s WHERE id=%s",
GetSQLValueString($password, "text"),
GetSQLValueString($id, "int"));
if (($action == "edit") && ($dbTable == "users") && ($section == "password")) {
$admin = $_POST['admin'];
mysql_select_db($database_brewing, $brewing);
$Result1 = mysql_query($updateSQL, $brewing) or die(mysql_error());
$query_user5 = sprintf("SELECT user_name,password FROM users WHERE id = '%s'", $id);
$user5 = mysql_query($query_user5, $brewing) or die(mysql_error());
$row_user5 = mysql_fetch_assoc($user5);
$totalRows_user5 = mysql_num_rows($user5);
$updateGoTo = "index.php?action=list&dbTable=users&confirm=true&section=password&msg=2";
if ($admin == "admin") $updateGoTo .= "&filter=".$row_user5['user_name']."&assoc=".$_POST['password'];
header(sprintf("Location: %s", $updateGoTo));
}
}
if (($action == "edit") && ($dbTable == "users") && ($section == "default"))
{
$updateSQL = sprintf("UPDATE users SET user_name=%s, realFirstName=%s, realLastName=%s,
userLevel=%s, userProfile=%s, userPicURL=%s, userFavStyles=%s, userFavCommercial=%s, userFavQuote=%s,
userDesignations=%s, userOccupation=%s, userHobbies=%s, userBirthdate=%s, userHometown=%s,
userBrewingSince=%s, userWebsiteName=%s, userWebsiteURL=%s, userPosition=%s, userPastPosition=%s, userInfoPrivate=%s,
userAddress=%s, userCity=%s, userState=%s, userZip=%s, userPhoneH=%s, userPhoneW=%s, userEmail=%s,
defaultBoilTime=%s,
defaultEquipProfile=%s,
defaultMashProfile=%s,
defaultWaterProfile=%s,
defaultBitternessFormula=%s,
defaultMethod=%s,
defaultBatchSize=%s,
defaultWaterRatio=%s
WHERE id=%s",
GetSQLValueString($_POST['user_name'], "text"),
GetSQLValueString($_POST['realFirstName'], "scrubbed"),
GetSQLValueString($_POST['realLastName'], "scrubbed"),
GetSQLValueString($_POST['userLevel'], "text"),
GetSQLValueString($_POST['userProfile'], "text"),
GetSQLValueString($_POST['userPicURL'], "text"),
GetSQLValueString($_POST['userFavStyles'], "scrubbed"),
GetSQLValueString($_POST['userFavCommercial'], "scrubbed"),
GetSQLValueString($_POST['userFavQuote'], "scrubbed"),
GetSQLValueString($_POST['userDesignations'], "scrubbed"),
GetSQLValueString($_POST['userOccupation'], "scrubbed"),
GetSQLValueString($_POST['userHobbies'], "scrubbed"),
GetSQLValueString($_POST['userBirthdate'], "text"),
GetSQLValueString($_POST['userHometown'], "scrubbed"),
GetSQLValueString($_POST['userBrewingSince'], "scrubbed"),
GetSQLValueString($_POST['userWebsiteName'], "scrubbed"),
GetSQLValueString($_POST['userWebsiteURL'], "text"),
GetSQLValueString($_POST['userPosition'], "scrubbed"),
GetSQLValueString($_POST['userPastPosition'], "scrubbed"),
GetSQLValueString($_POST['userInfoPrivate'], "text"),
GetSQLValueString($_POST['userAddress'], "scrubbed"),
GetSQLValueString($_POST['userCity'], "scrubbed"),
GetSQLValueString($_POST['userState'], "scrubbed"),
GetSQLValueString($_POST['userZip'], "text"),
GetSQLValueString($_POST['userPhoneH'], "text"),
GetSQLValueString($_POST['userPhoneW'], "text"),
GetSQLValueString($_POST['userEmail'], "text"),
GetSQLValueString($_POST['defaultBoilTime'], "text"),
GetSQLValueString($_POST['defaultEquipProfile'], "text"),
GetSQLValueString($_POST['defaultMashProfile'], "text"),
GetSQLValueString($_POST['defaultWaterProfile'], "text"),
GetSQLValueString($_POST['defaultBitternessFormula'], "text"),
GetSQLValueString($_POST['defaultMethod'], "text"),
GetSQLValueString($_POST['defaultBatchSize'], "text"),
GetSQLValueString($_POST['defaultWaterRatio'], "text"),
GetSQLValueString($id, "int"));
$password = md5($_POST['password']);
if (($reset == "default") && ($admin == "nonpriv")) {
$passwordOld = md5($_POST['passwordOld']); $confirmPass = $row_user5['password'];
if ($confirmPass != $passwordOld) {
header ("Location: index.php?action=edit&dbTable=users&id=".$id."&confirm=false&section=password&msg=2");
}
}
if (($confirmPass == $passwordOld) || ($reset == "true") || ($admin == "admin")) {
$updateSQL = sprintf("UPDATE users SET password=%s WHERE id=%s",
GetSQLValueString($password, "text"),
GetSQLValueString($id, "int"));
mysql_select_db($database_brewing, $brewing);
$Result1 = mysql_query($updateSQL, $brewing) or die(mysql_error());
$updateGoTo = "index.php?action=list&dbTable=users&confirm=true&section=password&msg=2";
if ($admin == "admin") $updateGoTo .= "&filter=".$row_user5['user_name']."&assoc=".$_POST['password']; {
header(sprintf("Location: %s", $updateGoTo));
}
}
}
if (($action == "edit") && ($dbTable == "users") && ($section == "default")) {
$fieldData["user_name"] = GetSQLValueString($_POST['user_name'], "text");
$fieldData["realFirstName"] = GetSQLValueString($_POST['realFirstName'], "scrubbed");
$fieldData["realLastName"] = GetSQLValueString($_POST['realLastName'], "scrubbed");
$fieldData["userLevel"] = GetSQLValueString($_POST['userLevel'], "text");
$fieldData["userProfile"] = GetSQLValueString($_POST['userProfile'], "text");
$filedData["userPicURL"] = GetSQLValueString($_POST['userPicURL'], "text");
$fieldData["userFavStyles"] = GetSQLValueString($_POST['userFavStyles'], "scrubbed");
$fieldData["userFavCommercial"] = GetSQLValueString($_POST['userFavCommercial'], "scrubbed");
$fieldData["userFavQuote"] = GetSQLValueString($_POST['userFavQuote'], "scrubbed");
$fieldData["userDesignations"] = GetSQLValueString($_POST['userDesignations'], "scrubbed");
$fieldData["userOccupation"] = GetSQLValueString($_POST['userOccupation'], "scrubbed");
$fieldData["userHobbies"] = GetSQLValueString($_POST['userHobbies'], "scrubbed");
$fieldData["userBirthdate"] = GetSQLValueString($_POST['userBirthdate'], "text");
$fieldData["userHometown"] = GetSQLValueString($_POST['userHometown'], "scrubbed");
$fieldData["userBrewingSince"] = GetSQLValueString($_POST['userBrewingSince'], "scrubbed");
$fieldData["userWebsiteName"] = GetSQLValueString($_POST['userWebsiteName'], "scrubbed");
$fieldData["userWebsiteURL"] = GetSQLValueString($_POST['userWebsiteURL'], "text");
$fieldData["userPosition"] = GetSQLValueString($_POST['userPosition'], "scrubbed");
$fieldData["userPastPosition"] = GetSQLValueString($_POST['userPastPosition'], "scrubbed");
$fieldData["userInfoPrivate"] = GetSQLValueString($_POST['userInfoPrivate'], "text");
$fieldData["userAddress"] = GetSQLValueString($_POST['userAddress'], "scrubbed");
$fieldData["userCity"] = GetSQLValueString($_POST['userCity'], "scrubbed");
$fieldData["userState"] = GetSQLValueString($_POST['userState'], "scrubbed");
$fieldData["userZip"] = GetSQLValueString($_POST['userZip'], "text");
$fieldData["userPhoneH"] = GetSQLValueString($_POST['userPhoneH'], "text");
$fieldData["userPhoneW"] = GetSQLValueString($_POST['userPhoneW'], "text");
$fieldData["userEmail"] = GetSQLValueString($_POST['userEmail'], "text");
$fieldData["defaultBoilTime"] = GetSQLValueString($_POST['defaultBoilTime'], "text");
$fieldData["defaultEquipProfile"] = GetSQLValueString($_POST['defaultEquipProfile'], "text");
$fieldData["defaultMashProfile"] = GetSQLValueString($_POST['defaultMashProfile'], "text");
$fieldData["defaultWaterProfile"] = GetSQLValueString($_POST['defaultWaterProfile'], "text");
$fieldData["defaultBitternessFormula"] = GetSQLValueString($_POST['defaultBitternessFormula'], "text");
$fieldData["defaultMethod"] = GetSQLValueString($_POST['defaultMethod'], "text");
$fieldData["defaultBatchSize"] = GetSQLValueString($_POST['defaultBatchSize'], "text");
$fieldData["defaultWaterRatio"] = GetSQLValueString($_POST['defaultWaterRatio'], "text");
$fieldData["defaultColorFormula"] = GetSQLValueString($_POST['defaultColorFormula'], "text");
$data = "";
$count = count($fieldData);
$i = 1;
foreach ($fieldData as $k => $v) {
$data .= "$k = $v";
if ($i < $count) {
$data .= ", ";
}
$i++;
}
$updateSQL = "UPDATE users SET $data WHERE id=" . GetSQLValueString($id, "int");
mysql_select_db($database_brewing, $brewing);
$Result1 = mysql_query($updateSQL, $brewing) or die(mysql_error());

View File

@@ -8,6 +8,280 @@
$imageSrc = "../images/";
//-----------
// Functions
//-----------
function create_extract_entries($start, $end) {
global $extName, $extWeight, $row_extracts, $row_pref, $row_recipeRecalc,
$extracts, $id, $totalGrist, $results;
for ($i = 0; $i < $end; $i++) {
echo '<tr>' . "\n";
echo '<td class="dataLabelLeft">Extract ' . ($i + 1) . ':</td>' . "\n";
echo '<td class="data" width="5%"><select name="extName['.$i.']">' . "\n";
echo '<option value=""></option>' . "\n";
do {
echo '<option value="' . $row_extracts['extractName'] . '" ';
$key = "brewExtract" . ($i + 1);
if ((($results == "true") && ($extName[$i] == $row_extracts['extractName'])) ||
(($id != "default") && ($results == "false") && ($row_recipeRecalc[$key] == $row_extracts['extractName']))) {
echo "SELECTED";
}
echo '>' . $row_extracts['extractName'] . '</option>' . "\n";
} while ($row_extracts = mysql_fetch_array($extracts));
echo '</select></td>' . "\n";
// Reset $row_extracts to first row
$rows = mysql_num_rows($extracts);
if ($rows > 0) {
mysql_data_seek($extracts, 0);
$row_extracts = mysql_fetch_array($extracts);
}
echo '<td class="dataLabel">Weight:</td>' . "\n";
echo '<td class="data" width="5%"><input name="extWeight['.$i.']" type="text" size="5" value="';
if ($results == "true") {
echo $extWeight[$i];
}
if (($id != "default") && ($results == "false")) {
$key = "brewExtract" . ($i + 1) . "Weight";
echo $row_recipeRecalc[$key];
}
echo '"></td>' . "\n";
echo '<td class="data" ';
if ($results == "true") {
echo 'width="5%"';
}
echo '>' . $row_pref['measWeight2'] . '</td>' . "\n";
if ($results == "true") {
if ($extWeight[$i] != "") {
$pctGrist = $extWeight[$i] / $totalGrist * 100;
echo '<td class="data">' . round($pctGrist, 1) . '%</td>';
} else {
echo '<td>&nbsp;</td>';
}
}
echo '</tr>' . "\n";
}
}
function create_grain_entries($start, $end) {
global $grainName, $grainWeight, $row_grains, $row_recipeRecalc,
$grains, $id, $totalGrist, $results, $row_pref;
for ($i = $start; $i < $end; $i++) {
echo '<tr>' . "\n";
echo '<td class="dataLabelLeft">Grain ' . ($i + 1) . ':</td>' . "\n";
echo '<td class="data" width="5%"><select name="grainName['.$i.']">' . "\n";
echo '<option value=""></option>' . "\n";
do {
echo '<option value="' . $row_grains['maltName'] . '" ';
$key = "brewGrain" . ($i + 1);
if ((($results == "true") && ($grainName[$i] == $row_grains['maltName'])) ||
(($results == "false") && ($id != "default") && ($row_recipeRecalc[$key] == $row_grains['maltName']))) {
echo "SELECTED";
}
echo '>' . $row_grains['maltName'] . '</option>' . "\n";
} while ($row_grains = mysql_fetch_array($grains));
echo '</select></td>' . "\n";
// Reset $row_grains to first row
$rows = mysql_num_rows($grains);
if ($rows > 0) {
mysql_data_seek($grains, 0);
$row_grains = mysql_fetch_array($grains);
}
echo '<td class="dataLabel">Weight:</td>' . "\n";
echo '<td class="data" width="5%"><input name="grainWeight['.$i.']" type="text" size="5" value="';
if ($results == "true") {
echo $grainWeight[$i];
} elseif ($id != "default") {
$key = "brewGrain" . ($i + 1) . "Weight";
echo $row_recipeRecalc[$key];
}
echo '"></td>' . "\n";
echo '<td class="data" ';
if ($results == "true") {
echo 'width="5%"';
}
echo '>' . $row_pref['measWeight2'] . '</td>' . "\n";
if ($results == "true") {
if ($grainWeight[$i] != "") {
$pctGrist = $grainWeight[$i] / $totalGrist * 100;
echo '<td class="data">' . round($pctGrist, 1) . '%</td>' . "\n";
} else {
echo '<td>&nbsp;</td>';
}
}
echo '</tr>' . "\n";
}
}
function create_adj_entries($start, $end) {
global $adjName, $adjWeight, $row_adjuncts, $row_pref, $row_recipeRecalc,
$adjuncts, $id, $results;
for ($i = $start; $i < $end; $i++) {
echo '<tr>' . "\n";
echo '<td class="dataLabelLeft">Adjunct ' . ($i + 1) . ':</td>' . "\n";
echo '<td class="data" width="5%"><select name="adjName['.$i.']">' . "\n";
echo '<option value=""></option>' . "\n";
do {
echo '<option value="' . $row_adjuncts['adjunctName'] . '" ';
$key = "brewAddition" . ($i + 1);
if ((($results == "true") && ($adjName[$i] == $row_adjuncts['adjunctName'])) ||
(($results == "false") && ($id != "default") && ($row_recipeRecalc[$key] == $row_adjuncts['adjunctName']))) {
echo "SELECTED";
}
echo '>' . $row_adjuncts['adjunctName'] . '</option>' . "\n";
} while ($row_adjuncts = mysql_fetch_array($adjuncts));
echo '</select></td>' . "\n";
// Reset $row_adjuncts to first row
$rows = mysql_num_rows($adjuncts);
if ($rows > 0) {
mysql_data_seek($adjuncts, 0);
$row_adjuncts = mysql_fetch_array($adjuncts);
}
echo '<td class="dataLabel">Weight:</td>' . "\n";
$key = "brewAddition" . ($i + 1) . "Amt";
echo '<td class="data" width="5%"><input name="adjWeight['.$i.']" type="text" size="5" value="';
if ($results == "true") {
echo $adjWeight[$i];
} elseif ($id != "default") {
echo $row_recipeRecalc[$key];
}
echo '">' . "\n";
echo '<td class="data">' . $row_pref['measWeight2'] . '</td>' . "\n";
}
}
function create_hop_entries($start, $end) {
global $hopsName, $hopsWeight, $hopsAA, $hopsTime, $hopsForm, $hopsAAU, $hops, $row_hops,
$row_recipeRecalc, $id, $results, $row_pref;
for ($i = $start; $i < $end; $i++) {
echo '<tr>' . "\n";
echo '<td nowrap class="dataLabelLeft">Hop ' . ($i + 1) . ':</td>' . "\n";
echo '<td class="data" width="5%"><select name="hopsName['.$i.']">' . "\n";
echo '<option value=""></option>' . "\n";
do {
echo '<option value="' . $row_hops['hopsName'] . '" ';
$key = "brewHops" . ($i + 1);
if ((($results == "true") && ($hopsName[$i] == $row_hops['hopsName'])) ||
(($results == "false") && ($id != "default") && ($row_recipeRecalc[$key] == $row_hops['hopsName']))) {
echo 'SELECTED';
}
echo '>' . $row_hops['hopsName'] . '</option>' . "\n";
} while ($row_hops = mysql_fetch_array($hops));
echo '</select></td>' . "\n";
// Reset $row_hops to first row
$rows = mysql_num_rows($hops);
if ($rows > 0) {
mysql_data_seek($hops, 0);
$row_hops = mysql_fetch_array($hops);
}
echo '<td class="data" width="5%"><input name="hopsWeight['.$i.']" type="text" size="3" value="';
if ($results == "true") {
echo $hopsWeight[$i];
} elseif ($id != "default") {
$key = "brewHops" . ($i + 1) . "Weight";
echo $row_recipeRecalc[$key];
}
echo '"></td>' . "\n";
echo '<td class="data" width="5%" nowrap>';
if ($row_pref['measWeight1'] == "ounces") {
echo 'oz.';
} else {
echo 'g.';
}
echo '</td>' . "\n";
echo '<td class="data" width="5%"><input name="hopsAA['.$i.']" type="text" size="3" value="';
if ($results == "true") {
echo $hopsAA[$i];
} elseif ($id != "default") {
$key = "brewHops" . ($i + 1) . "IBU";
echo $row_recipeRecalc[$key];
}
echo '"></td>' . "\n";
echo '<td class="data" width="5%">%</td>' . "\n";
echo '<td class="data" width="5%"><input name="hopsTime['.$i.']" type="text" size="3" value="';
if ($results == "true") {
echo $hopsTime[$i];
} elseif ($id != "default") {
$key = "brewHops" . ($i + 1) . "Time";
echo $row_recipeRecalc[$key];
}
echo '"></td>' . "\n";
echo '<td class="data" width="5%">min.</td>' . "\n";
echo '<td class="data" width="5%"><input type="radio" name="hopsForm['.$i.']" value="Pellets" ';
if ($results == "true") {
if (($hopsName[$i] != "") && ($hopsForm[$i] == "Pellets")) {
echo 'CHECKED';
}
} else {
$key = "brewHops" . ($i + 1) . "Form";
if ((($id != "default") && ($row_recipeRecalc[$key] == "Pellets")) ||
($source == "calculator")) {
echo 'CHECKED';
}
}
echo '/><span class="data">Pellets</span></td>' . "\n";
echo '<td class="data" width="5%"><input type="radio" name="hopsForm['.$i.']" value="Leaf" ';
if ($results == "true") {
if (($hopsName[$i] != "") && ($hopsForm[$i] == "Leaf")) {
echo 'CHECKED';
}
} else {
$key = "brewHops" . ($i + 1) . "Form";
if (($id != "default") && ($row_recipeRecalc[$key] == "Leaf")) {
echo 'CHECKED';
}
}
echo '/><span class="data">Leaf</span></td>' . "\n";
echo '<td class="data"';
if ($results == "true") {
echo ' width="5%"';
}
echo '><input type="radio" name="hopsForm['.$i.']" value="Plug" ';
if ($results == "true") {
if (($hopsName[$i] != "") && ($hopsForm[$i] == "Plug")) {
echo 'CHECKED';
}
} else {
$key = "brewHops" . ($i + 1) . "Form";
if (($id != "default") && ($row_recipeRecalc[$key] == "Plug")) {
echo "CHECKED";
}
}
echo '/><span class="data">Plug</span></td>' . "\n";
if (($results == "true") && ($hopsAAU[$i] != 0)) {
echo '<td class="data">' . round($hopsAAU[$i], 1) . '</td>' . "\n";
}
echo '</tr>' . "\n";
}
}
//------
// Main
//------
// If recalculating an existing recipe or blog, get info from db.
if ($id != "default") {
mysql_select_db($database_brewing, $brewing);
@@ -26,24 +300,16 @@ if ($id != "default") {
}
if ($action == "calculate") {
if (($results == "true") || ($results == "verify")) {
// If we're verifying then all the calcs have already been done and there shouldn't be
// any reason to include the following two libs. So, if $results == "verify" can't we
// skip this section?
include 'lib/calculations.lib.php';
include 'lib/calcFormVar.lib.php';
mysql_select_db($database_brewing, $brewing);
$query_hops = "SELECT * FROM hops";
$hops = mysql_query($query_hops, $brewing);
$row_hops = mysql_fetch_array($hops);
}
if ($results != "verify") { ?>
<div id="breadcrumbAdmin"><a href="index.php">Administration</a> &gt; <?php echo $page_title; ?></div>
<div id="subtitleAdmin"><?php echo $page_title; ?></div>
<?php if ($results == "true") include 'lib/predicted.lib.php'; ?>
<?php
if ($results == "true") {
include 'lib/calculations.lib.php';
include 'lib/predicted.lib.php';
}
?>
<form id="form3" action="index.php?action=calculate&results=true&filter=<?php echo $filter; if ($source != "default") echo "&source=".$source; if ($id != "default") echo "&id=".$id; ?>" method="post" name="form3" onSubmit="return CheckRequiredFields()">
<input type="hidden" name="brewBrewerID" value="<?php echo $filter; ?>">
@@ -84,257 +350,50 @@ if ($action == "calculate") {
</tr>
</table>
<!-- Extracts -->
<div class="headerContentAdmin">Malt Extracts</div>
<table>
<tr>
<td colspan="5" class="dataListLeft"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" align="absmiddle" border="0" alt="Add Extracts?" title="Add Extracts?"></span>&nbsp;<a href="index.php?action=add&dbTable=extract">Add Extracts?</a></td>
</tr>
** START LOOP **
<?php
function create_extract_entries($start, $end) {
global $extName, $extWeight, $row_extracts, $row_pref, $row_recipeRecalc,
$extracts, $id, $totalGrist, $results;
for ($i = 0; $i < $end; $i++) {
echo '<tr>' . "\n";
echo '<td class="dataLabelLeft">Extract ' . ($i + 1) . ':</td>' . "\n";
echo '<td class="data" width="5%"><select name="extName['.$i.']">' . "\n";
echo '<option value=""></option>' . "\n";
do {
echo '<option value="' . $row_extracts['extractName'] . '" ';
$key = "brewExtract" . ($i + 1);
if ((($results == "true") && ($extName[$i] == $row_extracts['extractName'])) ||
(($id != "default") && ($results == "false") && ($row_recipeRecalc[$key] == $row_extracts['extractName']))) {
echo "SELECTED";
}
echo '>' . $row_extracts['extractName'] . '</option>' . "\n";
} while ($row_extracts = mysql_fetch_array($extracts));
echo '</select></td>' . "\n";
# Reset $row_extracts to first row
$rows = mysql_num_rows($extracts);
if ($rows > 0) {
mysql_data_seek($extracts, 0);
$row_extracts = mysql_fetch_array($extracts);
}
echo '<td class="dataLabel">Weight:</td>' . "\n";
echo '<td class="data" width="5%"><input name="extWeight['.$i.']" type="text" size="5" value="';
if ($results == "true") {
echo $extWeight[$i];
}
if (($id != "default") && ($results == "false")) {
$key = "brewExtract" . ($i + 1) . "Weight";
echo $row_recipeRecalc[$key];
}
echo '"></td>' . "\n";
echo '<td class="data" ';
if ($results == "true") {
echo 'width="5%"';
}
echo '>' . $row_pref['measWeight2'] . '</td>' . "\n";
if ($results == "true") {
if ($extWeight[$i] != "") {
$pctGrist = $extWeight[$i] / $totalGrist * 100;
echo '<td class="data">' . round($pctGrist, 1) . '%</td>';
} else {
echo '<td>&nbsp;</td>';
}
}
echo '</tr>' . "\n";
}
}
create_extract_entries(0, MAX_EXT);
/*
<tr>
<td class="dataLabelLeft">Extract 1:</td>
<td class="data" width="5%">
<select name="brewExtract1" id="brewExtract1">
<option value=""></option>
<?php do { ?>
<option value="<?php echo $row_extracts['extractName']; ?>" <?php if ($results == "true") { if ($brewExtract1 == $row_extracts['extractName']) echo "SELECTED"; } if ((($source == "recipes") || ($source == "brewing")) && ($results == "false")) { if ($row_recipeRecalc['brewExtract1'] == $row_extracts['extractName']) echo "SELECTED"; } ?>><?php echo $row_extracts['extractName']; ?></option>
<?php } while ($row_extracts = mysql_fetch_array($extracts)); $rows = mysql_num_rows($extracts); if($rows > 0) { mysql_data_seek($extracts, 0); $row_extracts = mysql_fetch_array($extracts); } ?>
</select>
</td>
<td class="dataLabel">Weight:</td>
<td class="data" width="5%"><input name="brewExtract1Weight" type="text" id="brewExtract1Weight" size="5" value="<?php if ($results == "true") echo $brewExtract1Weight; if ((($source == "recipes") || ($source == "brewing")) && ($results == "false")) echo $row_recipeRecalc['brewExtract1Weight']; ?>">
<td class="data" <?php if ($results == "true") echo "width=\"5%\""; ?>><?php echo $row_pref['measWeight2']; ?></td>
<?php if (($results == "true") && ($brewExtract1Weight != "")) { $e1Grist = $brewExtract1Weight/$totalGrist * 100;echo "<td class=\"data\">".round ($e1Grist, 1)."%</td>"; } if (($results == "true") && ($brewExtract1Weight == "")) echo "<td>&nbsp;</td>"; ?>
</tr>
*/ ?>
</table>
<!-- Extracts -->
<div class="headerContentAdmin">Malt Extracts</div>
<table>
<tr>
<td colspan="5" class="dataListLeft"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" align="absmiddle" border="0" alt="Add Extracts?" title="Add Extracts?"></span>&nbsp;<a href="index.php?action=add&dbTable=extract">Add Extracts?</a></td>
</tr>
<?php create_extract_entries(0, MAX_EXT); ?>
</table>
<!-- Grains -->
<?php if (($id != "default") && ($results == "false")) { ?>
<div class="red"><em>**If any dropdown menu is blank, the recipe\'s original extract is not in the database. For caculations to function, please choose another from the list or <a href="index.php?action=add&dbTable=extract">add another to the database</a>.</em></div>
<?php } ?>
<div class="headerContentAdmin"><div id="help"><a href="../sections/reference.inc.php?section=grains&source=log&KeepThis=true&TB_iframe=true&height=450&width=800" title="Grains Reference" class="thickbox"><img src="<?php echo $imageSrc; ?>information.png" border="0"></a></div>Grains</div>
<table>
<tr>
<td colspan="5" class="dataListLeft"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" align="absmiddle" border="0" alt="Add Grains?" title="Add Grains?"></span>&nbsp;<a href="index.php?action=add&dbTable=malt">Add Grains?</a></td>
</tr>
** START LOOP **
<?php
function create_grain_entries($start, $end) {
global $grainName, $grainWeight, $row_grains, $row_recipeRecalc,
$grains, $id, $totalGrist, $results, $row_pref;
for ($i = $start; $i < $end; $i++) {
echo '<tr>' . "\n";
echo '<td class="dataLabelLeft">Grain ' . ($i + 1) . ':</td>' . "\n";
echo '<td class="data" width="5%"><select name="grainName['.$i.']">' . "\n";
echo '<option value=""></option>' . "\n";
do {
echo '<option value="' . $row_grains['maltName'] . '" ';
$key = "brewGrain" . ($i + 1);
if ((($results == "true") && ($grainName[$i] == $row_grains['maltName'])) ||
(($results == "false") && ($id != "default") && ($row_recipeRecalc[$key] == $row_grains['maltName']))) {
echo "SELECTED";
}
echo '>' . $row_grains['maltName'] . '</option>' . "\n";
} while ($row_grains = mysql_fetch_array($grains));
echo '</select></td>' . "\n";
# Reset $row_grains to first row
$rows = mysql_num_rows($grains);
if ($rows > 0) {
mysql_data_seek($grains, 0);
$row_grains = mysql_fetch_array($grains);
}
echo '<td class="dataLabel">Weight:</td>' . "\n";
echo '<td class="data" width="5%"><input name="grainWeight['.$i.']" type="text" size="5" value="';
if ($results == "true") {
echo $grainWeight[$i];
} elseif ($id != "default") {
$key = "brewGrain" . ($i + 1) . "Weight";
echo $row_recipeRecalc[$key];
}
echo '"></td>' . "\n";
echo '<td class="data" ';
if ($results == "true") {
echo 'width="5%"';
}
echo '>' . $row_pref['measWeight2'] . '</td>' . "\n";
if ($results == "true") {
if ($grainWeight[$i] != "") {
$pctGrist = $grainWeight[$i] / $totalGrist * 100;
echo '<td class="data">' . round($pctGrist, 1) . '%</td>' . "\n";
} else {
echo '<td>&nbsp;</td>';
}
}
echo '</tr>' . "\n";
}
}
create_grain_entries(0, MAX_GRAINS);
/*
<tr>
<td class="dataLabelLeft">Grain 1:</td>
<td class="data" width="5%">
<select name="brewGrain1" id="brewGrain1">
<option value=""></option>
<?php do { ?>
<option value="<?php echo $row_grains['maltName']; ?>" <?php if ($results == "true") { if ($brewGrain1 == $row_grains['maltName']) echo "SELECTED"; } if ((($source == "recipes") || ($source == "brewing")) && ($results == "false")) { if ($row_recipeRecalc['brewGrain1'] == $row_grains['maltName']) echo "SELECTED"; } ?>><?php echo $row_grains['maltName']; ?></option>
<?php } while ($row_grains = mysql_fetch_array($grains)); $rows = mysql_num_rows($grains); if($rows > 0) { mysql_data_seek($grains, 0); $row_grains = mysql_fetch_array($grains); } ?>
</select>
</td>
<td class="dataLabel">Weight:</td>
<td class="data" width="5%"><input name="brewGrain1Weight" type="text" id="brewGrain1Weight" size="5" value="<?php if ($results == "true") echo $brewGrain1Weight; if ((($source == "recipes") || ($source == "brewing")) && ($results == "false")) echo $row_recipeRecalc['brewGrain1Weight']; ?>">
<td class="data" <?php if ($results == "true") echo "width=\"5%\""; ?>><?php echo $row_pref['measWeight2']; ?></td>
</td>
<?php if (($results == "true") && ($brewGrain1Weight != "")) { $g1Grist = $brewGrain1Weight/$totalGrist * 100; echo "<td class=\"data\">".round ($g1Grist, 1)."%</td>"; } if (($results == "true") && ($brewGrain1Weight == "")) echo "<td>&nbsp;</td>"; ?>
</tr>
*/ ?>
</table>
<!-- Grains -->
<?php if (($id != "default") && ($results == "false")) { ?>
<div class="red"><em>**If any dropdown menu is blank, the recipe\'s original extract is not in the database. For caculations to function, please choose another from the list or <a href="index.php?action=add&dbTable=extract">add another to the database</a>.</em></div>
<?php } ?>
<div class="headerContentAdmin"><div id="help"><a href="../sections/reference.inc.php?section=grains&source=log&KeepThis=true&TB_iframe=true&height=450&width=800" title="Grains Reference" class="thickbox"><img src="<?php echo $imageSrc; ?>information.png" border="0"></a></div>Grains</div>
<table>
<tr>
<td colspan="5" class="dataListLeft"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" align="absmiddle" border="0" alt="Add Grains?" title="Add Grains?"></span>&nbsp;<a href="index.php?action=add&dbTable=malt">Add Grains?</a></td>
</tr>
<?php create_grain_entries(0, MAX_GRAINS); ?>
</table>
<!-- Adjuncts -->
<?php if (($id != "default") && ($results == "false")) { ?>
<div class="red"><em>**If any dropdown menu is blank, the recipe\'s original grain is not in the database. For caculations to function, please choose another from the list or <a href="index.php?action=add&dbTable=malt">add another to the database</a>.</em></div>
<?php } ?>
<div class="headerContentAdmin">Adjuncts</div>
<table>
<tr>
<td colspan="5" class="dataListLeft"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" align="absmiddle" border="0" alt="Add Adjuncts?" title="Add Adjuncts?"></span>&nbsp;<a href="index.php?action=add&dbTable=adjuncts">Add Adjuncts?</a></td>
</tr>
<!-- Adjuncts -->
<?php if (($id != "default") && ($results == "false")) { ?>
<div class="red"><em>**If any dropdown menu is blank, the recipe\'s original grain is not in the database. For caculations to function, please choose another from the list or <a href="index.php?action=add&dbTable=malt">add another to the database</a>.</em></div>
<?php } ?>
<div class="headerContentAdmin">Adjuncts</div>
<table>
<tr>
<td colspan="5" class="dataListLeft"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" align="absmiddle" border="0" alt="Add Adjuncts?" title="Add Adjuncts?"></span>&nbsp;<a href="index.php?action=add&dbTable=adjuncts">Add Adjuncts?</a></td>
</tr>
<?php create_adj_entries(0, MAX_ADJ); ?>
</table>
** START LOOP **
<?php
function create_adj_entries($start, $end) {
global $adjName, $adjWeight, $row_adjuncts, $row_pref, $row_recipeRecalc,
$adjuncts, $id, $results;
<?php if (($id != "default") && ($results == "false")) { ?>
<div class="red"><em>**If any dropdown menu is blank, the recipe\'s original adjunct is not in the database. For caculations to function, please choose another from the list or <a href="index.php?action=add&dbTable=adjuncts">add another to the database</a>.</em></div>
<?php } ?>
for ($i = $start; $i < $end; $i++) {
echo '<tr>' . "\n";
echo '<td class="dataLabelLeft">Adjunct ' . ($i + 1) . ':</td>' . "\n";
echo '<td class="data" width="5%"><select name="adjName['.$i.']">' . "\n";
echo '<option value=""></option>' . "\n";
do {
echo '<option value="' . $row_adjuncts['adjunctName'] . '" ';
$key = "brewAddition" . ($i + 1);
if ((($results == "true") && ($adjName[$i] == $row_adjuncts['adjunctName'])) ||
(($results == "false") && ($id != "default") && ($row_recipeRecalc[$key] == $row_adjuncts['adjunctName']))) {
echo "SELECTED";
}
echo '>' . $row_adjuncts['adjunctName'] . '</option>' . "\n";
} while ($row_adjuncts = mysql_fetch_array($adjuncts));
echo '</select></td>' . "\n";
# Reset $row_adjuncts to first row
$rows = mysql_num_rows($adjuncts);
if ($rows > 0) {
mysql_data_seek($adjuncts, 0);
$row_adjuncts = mysql_fetch_array($adjuncts);
}
echo '<td class="dataLabel">Weight:</td>' . "\n";
$key = "brewAddition" . ($i + 1) . "Amt";
echo '<td class="data" width="5%"><input name="adjWeight['.$i.']" type="text" size="5" value="';
if ($results == "true") {
echo $adjWeight[$i];
} elseif ($id != "default") {
echo $row_recipeRecalc[$key];
}
echo '">' . "\n";
echo '<td class="data">' . $row_pref['measWeight2'] . '</td>' . "\n";
}
}
create_adj_entries(0, MAX_ADJ);
/*
<tr>
<td class="dataLabelLeft">Adjunct 1:</td>
<td class="data" width="5%">
<select name="brewAdjunct1" id="brewAdjunct1">
<option value=""></option>
<?php do { ?>
<option value="<?php echo $row_adjuncts['adjunctName']; ?>" <?php if ($results == "true") { if ($brewAdjunct1 == $row_adjuncts['adjunctName']) echo "SELECTED"; } if ((($source == "recipes") || ($source == "brewing")) && ($results == "false")) { if ($row_recipeRecalc['brewAddition1'] == $row_adjuncts['adjunctName']) echo "SELECTED"; } ?>><?php echo $row_adjuncts['adjunctName']; ?></option>
<?php } while ($row_adjuncts = mysql_fetch_array($adjuncts)); $rows = mysql_num_rows($adjuncts); if($rows > 0) { mysql_data_seek($adjuncts, 0); $row_adjuncts = mysql_fetch_array($adjuncts); } ?>
</select>
</td>
<td class="dataLabel">Weight:</td>
<td class="data" width="5%"><input name="brewAdjunct1Weight" type="text" id="brewAdjunct1Weight" size="5" value="<?php if ($results == "true") echo $brewAdjunct1Weight; if ((($source == "recipes") || ($source == "brewing")) && ($results == "false")) echo $row_recipeRecalc['brewAddition1Amt']; ?>">
<td class="data"><?php echo $row_pref['measWeight2']; ?></td>
</tr>
*/ ?>
</table>
<?php if (($id != "default") && ($results == "false")) { ?>
<div class="red"><em>**If any dropdown menu is blank, the recipe\'s original adjunct is not in the database. For caculations to function, please choose another from the list or <a href="index.php?action=add&dbTable=adjuncts">add another to the database</a>.</em></div>
<?php } ?>
<!-- Hops Section -->
<div class="headerContentAdmin"><div id="help"><a href="../sections/reference.inc.php?section=hops&source=log&KeepThis=true&TB_iframe=true&height=450&width=800" title="Hops Reference" class="thickbox"><img src="<?php echo $imageSrc; ?>information.png" border="0"></a></div>Hops</div>
<table>
<tr>
<!-- Hops Section -->
<div class="headerContentAdmin"><div id="help"><a href="../sections/reference.inc.php?section=hops&source=log&KeepThis=true&TB_iframe=true&height=450&width=800" title="Hops Reference" class="thickbox"><img src="<?php echo $imageSrc; ?>information.png" border="0"></a></div>Hops</div>
<table>
<tr>
<td colspan="11" class="dataListLeft"><span class="data_icon"><img src="<?php echo $imageSrc; ?>add.png" align="absmiddle" border="0" alt="Add Hops?" title="Add Hops?"></span>&nbsp;<a href="index.php?action=add&dbTable=hops">Add Hops?</a></td>
</tr>
<tr>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td colspan="2" class="dataLabelWide data">Weight</td>
@@ -342,152 +401,29 @@ if ($action == "calculate") {
<td colspan="2" class="dataLabelWide data">Time</td>
<td colspan="3" class="dataLabelWide data">Form</td>
<?php if ($results == "true") { ?><td class="dataLabelWide data">AAUs</td><?php } ?>
</tr>
</tr>
<?php create_hop_entries(0, MAX_HOPS); ?>
</table>
<?php
// Functions should be moved to the top of the file.
function create_hop_entries($start, $end) {
global $hopsName, $hopsWeight, $hopsAA, $hopsTime, $hopsForm, $hopsAAU, $hops, $row_hops,
$row_recipeRecalc, $id, $results, $row_pref;
<?php if (($id != "default") && ($results == "false")) { ?>
<div class="red"><em>**If any dropdown menu is blank, the recipe\'s original hop is not in the database. For caculations to function, please choose another from the list or <a href="index.php?action=add&dbTable=hops">add another to the database</a>.</em></div>
<?php } ?>
for ($i = $start; $i < $end; $i++) {
echo '<tr>' . "\n";
echo '<td nowrap class="dataLabelLeft">Hop ' . ($i + 1) . ':</td>' . "\n";
<table class="dataTable">
<tr>
<td><div class="right"><input type="image" src="<?php echo $imageSrc.$row_colorChoose['themeName']; ?>/button_calculate_<?php echo $row_colorChoose['themeName']; ?>.png" alt="Calculate" class="radiobutton" value="Calculate"></div></td>
</tr>
</table>
echo '<td class="data" width="5%"><select name="hopsName['.$i.']">' . "\n";
echo '<option value=""></option>' . "\n";
do {
echo '<option value="' . $row_hops['hopsName'] . '" ';
$key = "brewHops" . ($i + 1);
if ((($results == "true") && ($hopsName[$i] == $row_hops['hopsName'])) ||
(($results == "false") && ($id != "default") && ($row_recipeRecalc[$key] == $row_hops['hopsName']))) {
echo 'SELECTED';
}
echo '>' . $row_hops['hopsName'] . '</option>' . "\n";
} while ($row_hops = mysql_fetch_array($hops));
echo '</select></td>' . "\n";
// Reset $row_hops to first row
$rows = mysql_num_rows($hops);
if ($rows > 0) {
mysql_data_seek($hops, 0);
$row_hops = mysql_fetch_array($hops);
}
echo '<td class="data" width="5%"><input name="hopsWeight['.$i.']" type="text" size="3" value="';
if ($results == "true") {
echo $hopsWeight[$i];
} elseif ($id != "default") {
$key = "brewHops" . ($i + 1) . "Weight";
echo $row_recipeRecalc[$key];
}
echo '"></td>' . "\n";
echo '<td class="data" width="5%" nowrap>';
if ($row_pref['measWeight1'] == "ounces") {
echo 'oz.';
} else {
echo 'g.';
}
echo '</td>' . "\n";
echo '<td class="data" width="5%"><input name="hopsAA['.$i.']" type="text" size="3" value="';
if ($results == "true") {
echo $hopsAA[$i];
} elseif ($id != "default") {
$key = "brewHops" . ($i + 1) . "IBU";
echo $row_recipeRecalc[$key];
}
echo '"></td>' . "\n";
echo '<td class="data" width="5%">%</td>' . "\n";
echo '<td class="data" width="5%"><input name="hopsTime['.$i.']" type="text" size="3" value="';
if ($results == "true") {
echo $hopsTime[$i];
} elseif ($id != "default") {
$key = "brewHops" . ($i + 1) . "Time";
echo $row_recipeRecalc[$key];
}
echo '"></td>' . "\n";
echo '<td class="data" width="5%">min.</td>' . "\n";
echo '<td class="data" width="5%"><input type="radio" name="hopsForm['.$i.']" value="Pellets" ';
if ($results == "true") {
if (($hopsName[$i] != "") && ($hopsForm[$i] == "Pellets")) {
echo 'CHECKED';
}
} else {
$key = "brewHops" . ($i + 1) . "Form";
if ((($id != "default") && ($row_recipeRecalc[$key] == "Pellets")) ||
($source == "calculator")) {
echo 'CHECKED';
}
}
echo '/><span class="data">Pellets</span></td>' . "\n";
echo '<td class="data" width="5%"><input type="radio" name="hopsForm['.$i.']" value="Leaf" ';
if ($results == "true") {
if (($hopsName[$i] != "") && ($hopsForm[$i] == "Leaf")) {
echo 'CHECKED';
}
} else {
$key = "brewHops" . ($i + 1) . "Form";
if (($id != "default") && ($row_recipeRecalc[$key] == "Leaf")) {
echo 'CHECKED';
}
}
echo '/><span class="data">Leaf</span></td>' . "\n";
echo '<td class="data"';
if ($results == "true") {
echo ' width="5%"';
}
echo '><input type="radio" name="hopsForm['.$i.']" value="Plug" ';
if ($results == "true") {
if (($hopsName[$i] != "") && ($hopsForm[$i] == "Plug")) {
echo 'CHECKED';
}
} else {
$key = "brewHops" . ($i + 1) . "Form";
if (($id != "default") && ($row_recipeRecalc[$key] == "Plug")) {
echo "CHECKED";
}
}
echo '/><span class="data">Plug</span></td>' . "\n";
if (($results == "true") && ($hopsAAU[$i] != 0)) {
echo '<td class="data">' . round($hopsAAU[$i], 1) . '</td>' . "\n";
}
echo '</tr>' . "\n";
}
}
create_hop_entries(0, MAX_HOPS);
?>
</table>
<?php if (($id != "default") && ($results == "false")) { ?>
<div class="red"><em>**If any dropdown menu is blank, the recipe\'s original hop is not in the database. For caculations to function, please choose another from the list or <a href="index.php?action=add&dbTable=hops">add another to the database</a>.</em></div>
<?php } ?>
<table class="dataTable">
<tr>
<td><div class="right"><input type="image" src="<?php echo $imageSrc.$row_colorChoose['themeName']; ?>/button_calculate_<?php echo $row_colorChoose['themeName']; ?>.png" alt="Calculate" class="radiobutton" value="Calculate"></div></td>
</tr>
</table>
</form>
<?php
</form>
<?php
} //end if ($results != "verify")
else {
include ('lib/verify.lib.php');
include 'lib/verify.lib.php';
}
} // ends if ($action == "calculate")
else { ?>
// Doesn't $action always == "calculate" in this file? Is this block ever executed?
// $action != "calculate" if there's an auth issue.
<div id="breadcrumbWide"><a href="index.php">Administration</a> &gt; <?php echo $page_title; ?></div>
<div id="subtitleWide"><?php echo $page_title; ?></div>
<div class="headerContentAdmin">Recalculated <php if ($source == "brewing") echo "BrewBlog "; ?>Recipe</div>

View File

@@ -1,79 +1,30 @@
<?php
// THIS FILE CAN PROBABLY BE DELETED
/**
* Module: includes/color.inc.php
* Description: Assign color vars for displaying web colors.
*/
/*
if ($page == "recipeList") {
$colorSRM = $row_recipeList['brewLovibond'];
$colorSRM_featured = $row_featured['brewLovibond'];
}
elseif (($page == "brewBlogCurrent") || ($page == "brewBlogDetail") || ($page == "brewBlogList") || ($page == "recipeDetail") || ($page == "logPrint")) {
if ($row_pref['measColor'] == "EBC") $colorSRM = colorconvert($row_log['brewLovibond'], "SRM"); else $colorSRM = $row_log['brewLovibond'];
if ($row_pref['measColor'] == "EBC") $colorSRM_featured = colorconvert($row_featured['brewLovibond'], "SRM"); else $colorSRM_featured = $row_featured['brewLovibond'];
$colorSRM = $row_recipeList['brewLovibond'];
//$colorSRM_featured = $row_featured['brewLovibond'];
} elseif (($page == "brewBlogCurrent") || ($page == "brewBlogDetail") || ($page == "brewBlogList") ||
($page == "recipeDetail") || ($page == "logPrint")) {
if ($row_pref['measColor'] == "EBC") {
$colorSRM = ebc_to_srm($row_log['brewLovibond']);
//$colorSRM_featured = ebc_to_srm($row_featured['brewLovibond']);
} else {
$colorSRM = $row_log['brewLovibond'];
//$colorSRM_featured = $row_featured['brewLovibond'];
}
} else {
$colorSRM = "1";
}
else if ($action == "calculate") $colorSRM = $SRM;
else { $colorSRM = "1"; }
if ($colorSRM >= 01 && $colorSRM < 02) { $beercolor ="#f3f993"; }
elseif ($colorSRM >= 02 && $colorSRM < 03) { $beercolor ="#f5f75c"; }
elseif ($colorSRM >= 03 && $colorSRM < 04) { $beercolor ="#f6f513"; }
elseif ($colorSRM >= 04 && $colorSRM < 05) { $beercolor ="#eae615"; }
elseif ($colorSRM >= 05 && $colorSRM < 06) { $beercolor ="#e0d01b"; }
elseif ($colorSRM >= 06 && $colorSRM < 07) { $beercolor ="#d5bc26"; }
elseif ($colorSRM >= 07 && $colorSRM < 08) { $beercolor ="#cdaa37"; }
elseif ($colorSRM >= 08 && $colorSRM < 09) { $beercolor ="#c1963c"; }
elseif ($colorSRM >= 09 && $colorSRM < 10) { $beercolor ="#be8c3a"; }
elseif ($colorSRM >= 10 && $colorSRM < 11) { $beercolor ="#be823a"; }
elseif ($colorSRM >= 11 && $colorSRM < 12) { $beercolor ="#c17a37"; }
elseif ($colorSRM >= 12 && $colorSRM < 13) { $beercolor ="#bf7138"; }
elseif ($colorSRM >= 13 && $colorSRM < 14) { $beercolor ="#bc6733"; }
elseif ($colorSRM >= 14 && $colorSRM < 15) { $beercolor ="#b26033"; }
elseif ($colorSRM >= 15 && $colorSRM < 16) { $beercolor ="#a85839"; }
elseif ($colorSRM >= 16 && $colorSRM < 17) { $beercolor ="#985336"; }
elseif ($colorSRM >= 17 && $colorSRM < 18) { $beercolor ="#8d4c32"; }
elseif ($colorSRM >= 18 && $colorSRM < 19) { $beercolor ="#7c452d"; }
elseif ($colorSRM >= 19 && $colorSRM < 20) { $beercolor ="#6b3a1e"; }
elseif ($colorSRM >= 20 && $colorSRM < 21) { $beercolor ="#5d341a"; }
elseif ($colorSRM >= 21 && $colorSRM < 22) { $beercolor ="#4e2a0c"; }
elseif ($colorSRM >= 22 && $colorSRM < 23) { $beercolor ="#4a2727"; }
elseif ($colorSRM >= 23 && $colorSRM < 24) { $beercolor ="#361f1b"; }
elseif ($colorSRM >= 24 && $colorSRM < 25) { $beercolor ="#261716"; }
elseif ($colorSRM >= 25 && $colorSRM < 26) { $beercolor ="#231716"; }
elseif ($colorSRM >= 26 && $colorSRM < 27) { $beercolor ="#19100f"; }
elseif ($colorSRM >= 27 && $colorSRM < 28) { $beercolor ="#16100f"; }
elseif ($colorSRM >= 28 && $colorSRM < 29) { $beercolor ="#120d0c"; }
elseif ($colorSRM >= 29 && $colorSRM < 30) { $beercolor ="#100b0a"; }
elseif ($colorSRM >= 30 && $colorSRM < 31) { $beercolor ="#050b0a"; }
elseif ($colorSRM > 31) { $beercolor ="#000000"; }
else { $beercolor ="#ffffff"; }
if ($colorSRM_featured >= 01 && $colorSRM_featured < 02) { $beercolor_featured ="#f3f993"; }
elseif ($colorSRM_featured >= 02 && $colorSRM_featured < 03) { $beercolor_featured ="#f5f75c"; }
elseif ($colorSRM_featured >= 03 && $colorSRM_featured < 04) { $beercolor_featured ="#f6f513"; }
elseif ($colorSRM_featured >= 04 && $colorSRM_featured < 05) { $beercolor_featured ="#eae615"; }
elseif ($colorSRM_featured >= 05 && $colorSRM_featured < 06) { $beercolor_featured ="#e0d01b"; }
elseif ($colorSRM_featured >= 06 && $colorSRM_featured < 07) { $beercolor_featured ="#d5bc26"; }
elseif ($colorSRM_featured >= 07 && $colorSRM_featured < 08) { $beercolor_featured ="#cdaa37"; }
elseif ($colorSRM_featured >= 08 && $colorSRM_featured < 09) { $beercolor_featured ="#c1963c"; }
elseif ($colorSRM_featured >= 09 && $colorSRM_featured < 10) { $beercolor_featured ="#be8c3a"; }
elseif ($colorSRM_featured >= 10 && $colorSRM_featured < 11) { $beercolor_featured ="#be823a"; }
elseif ($colorSRM_featured >= 11 && $colorSRM_featured < 12) { $beercolor_featured ="#c17a37"; }
elseif ($colorSRM_featured >= 12 && $colorSRM_featured < 13) { $beercolor_featured ="#bf7138"; }
elseif ($colorSRM_featured >= 13 && $colorSRM_featured < 14) { $beercolor_featured ="#bc6733"; }
elseif ($colorSRM_featured >= 14 && $colorSRM_featured < 15) { $beercolor_featured ="#b26033"; }
elseif ($colorSRM_featured >= 15 && $colorSRM_featured < 16) { $beercolor_featured ="#a85839"; }
elseif ($colorSRM_featured >= 16 && $colorSRM_featured < 17) { $beercolor_featured ="#985336"; }
elseif ($colorSRM_featured >= 17 && $colorSRM_featured < 18) { $beercolor_featured ="#8d4c32"; }
elseif ($colorSRM_featured >= 18 && $colorSRM_featured < 19) { $beercolor_featured ="#7c452d"; }
elseif ($colorSRM_featured >= 19 && $colorSRM_featured < 20) { $beercolor_featured ="#6b3a1e"; }
elseif ($colorSRM_featured >= 20 && $colorSRM_featured < 21) { $beercolor_featured ="#5d341a"; }
elseif ($colorSRM_featured >= 21 && $colorSRM_featured < 22) { $beercolor_featured ="#4e2a0c"; }
elseif ($colorSRM_featured >= 22 && $colorSRM_featured < 23) { $beercolor_featured ="#4a2727"; }
elseif ($colorSRM_featured >= 23 && $colorSRM_featured < 24) { $beercolor_featured ="#361f1b"; }
elseif ($colorSRM_featured >= 24 && $colorSRM_featured < 25) { $beercolor_featured ="#261716"; }
elseif ($colorSRM_featured >= 25 && $colorSRM_featured < 26) { $beercolor_featured ="#231716"; }
elseif ($colorSRM_featured >= 26 && $colorSRM_featured < 27) { $beercolor_featured ="#19100f"; }
elseif ($colorSRM_featured >= 27 && $colorSRM_featured < 28) { $beercolor_featured ="#16100f"; }
elseif ($colorSRM_featured >= 28 && $colorSRM_featured < 29) { $beercolor_featured ="#120d0c"; }
elseif ($colorSRM_featured >= 29 && $colorSRM_featured < 30) { $beercolor_featured ="#100b0a"; }
elseif ($colorSRM_featured >= 30 && $colorSRM_featured < 31) { $beercolor_featured ="#050b0a"; }
elseif ($colorSRM_featured > 31) { $beercolor_featured ="#000000"; }
else { $beercolor_featured ="#ffffff"; }
$beercolor = get_display_color($colorSRM);
//$beercolor_featured = get_display_color($colorSRM_featured);
*/
?>

View File

@@ -1,71 +1,13 @@
<?php
if ($action == "calculate") $colorSRMmin = $row_style1['brewStyleSRM'];
else $colorSRMmin = $row_styles['brewStyleSRM'];
if ($colorSRMmin >= 01 && $colorSRMmin < 02) { $beercolorMin ="#f3f993"; }
elseif ($colorSRMmin >= 02 && $colorSRMmin < 03) { $beercolorMin ="#f5f75c"; }
elseif ($colorSRMmin >= 03 && $colorSRMmin < 04) { $beercolorMin ="#f6f513"; }
elseif ($colorSRMmin >= 04 && $colorSRMmin < 05) { $beercolorMin ="#eae615"; }
elseif ($colorSRMmin >= 05 && $colorSRMmin < 06) { $beercolorMin ="#e0d01b"; }
elseif ($colorSRMmin >= 06 && $colorSRMmin < 07) { $beercolorMin ="#d5bc26"; }
elseif ($colorSRMmin >= 07 && $colorSRMmin < 08) { $beercolorMin ="#cdaa37"; }
elseif ($colorSRMmin >= 08 && $colorSRMmin < 09) { $beercolorMin ="#c1963c"; }
elseif ($colorSRMmin >= 09 && $colorSRMmin < 10) { $beercolorMin ="#be8c3a"; }
elseif ($colorSRMmin >= 10 && $colorSRMmin < 11) { $beercolorMin ="#be823a"; }
elseif ($colorSRMmin >= 11 && $colorSRMmin < 12) { $beercolorMin ="#c17a37"; }
elseif ($colorSRMmin >= 12 && $colorSRMmin < 13) { $beercolorMin ="#bf7138"; }
elseif ($colorSRMmin >= 13 && $colorSRMmin < 14) { $beercolorMin ="#bc6733"; }
elseif ($colorSRMmin >= 14 && $colorSRMmin < 15) { $beercolorMin ="#b26033"; }
elseif ($colorSRMmin >= 15 && $colorSRMmin < 16) { $beercolorMin ="#a85839"; }
elseif ($colorSRMmin >= 16 && $colorSRMmin < 17) { $beercolorMin ="#985336"; }
elseif ($colorSRMmin >= 17 && $colorSRMmin < 18) { $beercolorMin ="#8d4c32"; }
elseif ($colorSRMmin >= 18 && $colorSRMmin < 19) { $beercolorMin ="#7c452d"; }
elseif ($colorSRMmin >= 19 && $colorSRMmin < 20) { $beercolorMin ="#6b3a1e"; }
elseif ($colorSRMmin >= 20 && $colorSRMmin < 21) { $beercolorMin ="#5d341a"; }
elseif ($colorSRMmin >= 21 && $colorSRMmin < 22) { $beercolorMin ="#4e2a0c"; }
elseif ($colorSRMmin >= 22 && $colorSRMmin < 23) { $beercolorMin ="#4a2727"; }
elseif ($colorSRMmin >= 23 && $colorSRMmin < 24) { $beercolorMin ="#361f1b"; }
elseif ($colorSRMmin >= 24 && $colorSRMmin < 25) { $beercolorMin ="#261716"; }
elseif ($colorSRMmin >= 25 && $colorSRMmin < 26) { $beercolorMin ="#231716"; }
elseif ($colorSRMmin >= 26 && $colorSRMmin < 27) { $beercolorMin ="#19100f"; }
elseif ($colorSRMmin >= 27 && $colorSRMmin < 28) { $beercolorMin ="#16100f"; }
elseif ($colorSRMmin >= 28 && $colorSRMmin < 29) { $beercolorMin ="#120d0c"; }
elseif ($colorSRMmin >= 29 && $colorSRMmin < 30) { $beercolorMin ="#100b0a"; }
elseif ($colorSRMmin >= 30 && $colorSRMmin < 31) { $beercolorMin ="#050b0a"; }
elseif ($colorSRMmin > 31) { $beercolorMin ="#000000"; }
else { $beercolorMin ="#ffffff"; }
if ($action == "calculate") {
$colorSRMmin = $row_style1['brewStyleSRM'];
$colorSRMmax = $row_style1['brewStyleSRMMax'];
} else {
$colorSRMmin = $row_styles['brewStyleSRM'];
$colorSRMmax = $row_styles['brewStyleSRMMax'];
}
$beercolorMin = get_display_color($colorSRMmin);
$beercolorMax = get_display_color($colorSRMmax);
if ($action == "calculate") $colorSRMmax = $row_style1['brewStyleSRMMax'];
else $colorSRMmax = $row_styles['brewStyleSRMMax'];
if ($colorSRMmax >= 01 && $colorSRMmax < 02) { $beercolorMax ="#f3f993"; }
elseif ($colorSRMmax >= 02 && $colorSRMmax < 03) { $beercolorMax ="#f5f75c"; }
elseif ($colorSRMmax >= 03 && $colorSRMmax < 04) { $beercolorMax ="#f6f513"; }
elseif ($colorSRMmax >= 04 && $colorSRMmax < 05) { $beercolorMax ="#eae615"; }
elseif ($colorSRMmax >= 05 && $colorSRMmax < 06) { $beercolorMax ="#e0d01b"; }
elseif ($colorSRMmax >= 06 && $colorSRMmax < 07) { $beercolorMax ="#d5bc26"; }
elseif ($colorSRMmax >= 07 && $colorSRMmax < 08) { $beercolorMax ="#cdaa37"; }
elseif ($colorSRMmax >= 08 && $colorSRMmax < 09) { $beercolorMax ="#c1963c"; }
elseif ($colorSRMmax >= 09 && $colorSRMmax < 10) { $beercolorMax ="#be8c3a"; }
elseif ($colorSRMmax >= 10 && $colorSRMmax < 11) { $beercolorMax ="#be823a"; }
elseif ($colorSRMmax >= 11 && $colorSRMmax < 12) { $beercolorMax ="#c17a37"; }
elseif ($colorSRMmax >= 12 && $colorSRMmax < 13) { $beercolorMax ="#bf7138"; }
elseif ($colorSRMmax >= 13 && $colorSRMmax < 14) { $beercolorMax ="#bc6733"; }
elseif ($colorSRMmax >= 14 && $colorSRMmax < 15) { $beercolorMax ="#b26033"; }
elseif ($colorSRMmax >= 15 && $colorSRMmax < 16) { $beercolorMax ="#a85839"; }
elseif ($colorSRMmax >= 16 && $colorSRMmax < 17) { $beercolorMax ="#985336"; }
elseif ($colorSRMmax >= 17 && $colorSRMmax < 18) { $beercolorMax ="#8d4c32"; }
elseif ($colorSRMmax >= 18 && $colorSRMmax < 19) { $beercolorMax ="#7c452d"; }
elseif ($colorSRMmax >= 19 && $colorSRMmax < 20) { $beercolorMax ="#6b3a1e"; }
elseif ($colorSRMmax >= 20 && $colorSRMmax < 21) { $beercolorMax ="#5d341a"; }
elseif ($colorSRMmax >= 21 && $colorSRMmax < 22) { $beercolorMax ="#4e2a0c"; }
elseif ($colorSRMmax >= 22 && $colorSRMmax < 23) { $beercolorMax ="#4a2727"; }
elseif ($colorSRMmax >= 23 && $colorSRMmax < 24) { $beercolorMax ="#361f1b"; }
elseif ($colorSRMmax >= 24 && $colorSRMmax < 25) { $beercolorMax ="#261716"; }
elseif ($colorSRMmax >= 25 && $colorSRMmax < 26) { $beercolorMax ="#231716"; }
elseif ($colorSRMmax >= 26 && $colorSRMmax < 27) { $beercolorMax ="#19100f"; }
elseif ($colorSRMmax >= 27 && $colorSRMmax < 28) { $beercolorMax ="#16100f"; }
elseif ($colorSRMmax >= 28 && $colorSRMmax < 29) { $beercolorMax ="#120d0c"; }
elseif ($colorSRMmax >= 29 && $colorSRMmax < 30) { $beercolorMax ="#100b0a"; }
elseif ($colorSRMmax >= 30 && $colorSRMmax < 31) { $beercolorMax ="#050b0a"; }
elseif ($colorSRMmax > 31) { $beercolorMax ="#000000"; }
else { $beercolorMax ="#ffffff"; }
?>

View File

@@ -1,17 +1,31 @@
<?php
if ($page != "recipeList") {
if ($row_pref['measColor'] == "EBC") $SRM = colorconvert($row_log['brewLovibond'], "SRM"); else $SRM = ltrim($row_log['brewLovibond'], "0"); //echo $SRM;
if ($SRM > "15") $fcolor = "#ffffff";
if ($SRM < "15") $fcolor = "#000000";
if ($row_pref['measColor'] == "SRM") { echo "<table class=\"colorTable\"><tr><td style=\"background: ".$beercolor."; color: ".$fcolor."; padding: 0 3px 0 3px\">"; echo round ($row_log['brewLovibond'], 1)."/"; echo colorconvert($row_log['brewLovibond'], "EBC"); echo "</td></table>"; }
if ($row_pref['measColor'] == "EBC") { echo "<table class=\"colorTable\"><tr><td style=\"background: ".$beercolor."; color: ".$fcolor."; padding: 0 3px 0 3px\">"; echo round ($row_log['brewLovibond'], 1)."/"; echo colorconvert($row_log['brewLovibond'], "SRM"); echo "</td></table>"; }
}
$brewColor = ($page == "recipeList") ? $row_recipeList['brewLovibond'] : $row_log['brewLovibond'];
if ($page == "recipeList") {
if ($row_pref['measColor'] == "EBC") $SRM = colorconvert($row_recipeList['brewLovibond'], "SRM"); else $SRM = ltrim($row_recipeList['brewLovibond'], "0"); //echo $SRM;
if ($SRM > "15") $fcolor = "#ffffff";
if ($SRM < "15") $fcolor = "#000000";
if ($row_pref['measColor'] == "SRM") { echo "<table class=\"colorTable\"><tr><td style=\"background: ".$beercolor."; color: ".$fcolor."; padding: 0 3px 0 3px\">"; echo round ($row_recipeList['brewLovibond'], 1)."/"; echo colorconvert($row_recipeList['brewLovibond'], "EBC"); echo "</td></table>"; }
if ($row_pref['measColor'] == "EBC") { echo "<table class=\"colorTable\"><tr><td style=\"background: ".$beercolor."; color: ".$fcolor."; padding: 0 3px 0 3px\">"; echo round ($row_recipeList['brewLovibond'], 1)."/"; echo colorconvert($row_recipeList['brewLovibond'], "SRM"); echo "</td></table>"; }
$color = $row_recipeList['brewLovibond'];
$colorFormula = ($row_recipeList['brewColorFormula'] != "") ? $row_recipeList['brewColorFormula'] : "formula unknkown";
} else {
$color = $row_log['brewLovibond'];
$colorFormula = ($row_log['brewColorFormula'] != "") ? $row_log['brewColorFormula'] : "formula unknown";
}
if ($row_pref['measColor'] == "EBC") {
$srm = ebc_to_srm($color);
} else {
$srm = ltrim($color, "0");
}
$bkColor = get_display_color($srm);
$fontColor = ($srm > "15") ? "#ffffff" : "#000000";
echo '<table>' . "\n";
echo '<tr>' . "\n";
echo '<td class="colorTable" style="background: ' . $bkColor . '; color: ' . $fontColor . '; padding: 0 3px 0 3px">';
echo '&nbsp;&nbsp;' . round($color, 1) . '&nbsp;&nbsp;</td>' . "\n";
if ($page != "recipeList" && $page != "brewBlogList")
echo '<td>&nbsp;(' . $colorFormula . ')</td>' . "\n";
echo '</tr>' . "\n";
echo '</table>' . "\n";
?>

View File

@@ -1,7 +1,15 @@
<?php
if ($row_pref['measColor'] == "EBC") $SRM = colorconvert($row_featured['brewLovibond'], "SRM"); else $SRM = ltrim($row_featured['brewLovibond'], "0"); //echo $SRM;
if ($SRM > "15") $fcolor = "#ffffff";
if ($SRM < "15") $fcolor = "#000000";
if ($row_pref['measColor'] == "SRM") { echo "<table class=\"colorTable\"><tr><td style=\"background: ".$beercolor_featured."; color: ".$fcolor."; padding: 0 3px 0 3px\">"; echo round ($row_featured['brewLovibond'], 1)."/"; echo colorconvert($row_featured['brewLovibond'], "EBC"); echo "</td></table>"; }
if ($row_pref['measColor'] == "EBC") { echo "<table class=\"colorTable\"><tr><td style=\"background: ".$beercolor_featured."; color: ".$fcolor."; padding: 0 3px 0 3px\">"; echo round ($row_featured['brewLovibond'], 1)."/"; echo colorconvert($row_featured['brewLovibond'], "SRM"); echo "</td></table>"; }
if ($row_pref['measColor'] == "EBC") {
$srm = ebc_to_srm($row_featured['brewLovibond']);
} else {
$srm = ltrim($row_featured['brewLovibond'], "0");
}
$bkColor = get_display_color($srm);
$fontColor = ($srm > "15") ? "#ffffff" : "#000000";
echo '<table class="colorTable"><tr><td style="background: ' . $bkColor . '; color: ' . $fontColor . '; padding: 0 3px 0 3px">';
echo round($row_featured['brewLovibond'], 1);
echo '</td></table>';
?>

View File

@@ -6,7 +6,6 @@
* centralaized in a library.
*/
/*
$query_sugarPPG1 = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_malt1['maltYield']);
$sugarPPG1 = mysql_query($query_sugarPPG1, $brewing) or die(mysql_error());
@@ -31,7 +30,7 @@ $units = $row_pref['measFluid2'];
$grainsPPG = array();
for ($i = 0; $i < MAX_GRAINS; $i++) {
$key = "brewGrain" . ($i + 1);
$query = "SELECT maltPPG FROM malt WHERE maltName=" . $row_log[$key];
$query = 'SELECT maltPPG FROM malt WHERE maltName="' . $row_log[$key] . '"';
$grainsPPG[$i] = mysql_query($query, $brewing) or die(mysql_error());
$key = "brewGrain" . ($i + 1) . "Weight";
$grainsWeight[$i] = $row_log[$key];

View File

@@ -10,20 +10,6 @@ if (strstr($agent, "MSIE")) $printBrowser = "IE"; else $printBrowser = "notIE";
//echo $agent."<br>";
//echo $printBrowser."<br>";
// ---------------------------- Color Conversion ------------------------------------------------------------
// Calculations based upon Daniels, R. (2000, pg. 44). Designing great beers. Boulder, CO: Brewer's Publications.
function colorconvert($color, $c) {
if ($c == "SRM") { // EBC to SRM
$ccon = $color / 1.97;
return round ($ccon, 1);
}
if ($c == "EBC") { // SRM to EBC
$ccon = $color * 1.97;
return round ($ccon, 1);
}
}
// ---------------------------- Temperature, Weight, and Volume Conversion ----------------------------------
function tempconvert($temp,$t) { // $t = desired output, defined at function call

202
index.php
View File

@@ -40,7 +40,10 @@ include (INCLUDES.'abv.inc.php');
include (INCLUDES.'plug-ins.inc.php');
//figure out SRM and a hex value for displaying beer color
include (INCLUDES.'color.inc.php');
//include (INCLUDES.'color.inc.php');
// Load color library functions
require_once ('admin/lib/color.lib.php');
//determine if club edition or personal edition is in use
include (INCLUDES.'version.inc.php');
@@ -110,87 +113,128 @@ tb_show('Carbonation Chart','reference/carbonation.php?KeepThis=true&TB_iframe=t
<div id="<?php if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail") || ($page == "recipeDetail") || ($page == "about") || ($page == "profile")) echo "breadcrumb"; else echo "breadcrumbWide"; ?>"><?php echo $breadcrumb; ?></div>
<?php if (($row_pref['mode'] == "2") && ($row_pref['home'] == $page) && ($row_pref['allowNews'] == "Y") && ($totalRows_newsGen > 0)) include (SECTIONS.'news.inc.php'); ?>
<div id="<?php if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail") || ($page == "recipeDetail") || ($page == "about") || ($page == "profile")) echo "subtitle"; else echo "subtitleWide"; ?>">
<div id="icon"><img src="<?php echo $imageSrc.$icon.".png"; ?>" align="bottom"></div>
<?php
if ($page == "brewBlogCurrent") echo $row_log['brewName'];
elseif ($page == "brewBlogDetail") { if ($row_pref['mode'] == "1") echo $row_log['brewName']; else echo "BrewBlog: ".$row_log['brewName']; }
elseif ($page == "recipeDetail") { if ($row_pref['mode'] == "1") echo $row_log['brewName']; else echo "Recipe: ".$row_log['brewName']; }
elseif ($page == "about") echo $page_title.$page_title_extension;
elseif ($page == "login") echo $page_title.$page_title_extension;
else echo $page_title;
?>
</div> <!-- end subtitle or subtitleWide -->
<?php
if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail")) {
if ($row_pref['allowSpecifics'] == "Y") include (SECTIONS.'recipe_specifics.inc.php');
if ($row_pref['allowGeneral'] == "Y") include (SECTIONS.'recipe_general.inc.php');
if ($row_pref['allowComments'] == "Y") include (SECTIONS.'recipe_comments.inc.php');
if ($row_pref['allowRecipe'] == "Y") include (SECTIONS.'recipe.inc.php');
include (SECTIONS.'recipe_equipment.inc.php');
if ($row_pref['allowMash'] == "Y") include (SECTIONS.'recipe_mash.inc.php');
if ($row_pref['allowWater'] == "Y") include (SECTIONS.'recipe_water.inc.php');
if ($row_pref['allowProcedure'] == "Y") include (SECTIONS.'recipe_procedure.inc.php');
if ($row_pref['allowSpecialProcedure'] == "Y") include (SECTIONS.'recipe_special_procedure.inc.php');
if ($row_pref['allowFermentation'] == "Y") include (SECTIONS.'recipe_fermentation.inc.php');
if (checkmobile()) echo ""; else { if ($row_pref['allowReviews'] == "Y") include (SECTIONS.'recipe_reviews.inc.php'); }
}
if ($page == "brewBlogList") include(SECTIONS.'brewblogList.inc.php');
if ($page == "recipeList") include(SECTIONS.'recipeList.inc.php');
if ($page == "awardsList") include(SECTIONS.'awardsList.inc.php');
if ($page == "login") include (SECTIONS.'login.inc.php');
if ($page == "tools") include (SECTIONS.'tools.inc.php');
if ($page == "about") include (SECTIONS.'about.inc.php');
if ($page == "reference") include (SECTIONS.'reference.inc.php');
if (($row_pref['allowCalendar'] == "Y") && ($page == "calendar")) include (SECTIONS.'calendar.inc.php');
if (($row_pref['allowCalendar'] == "N") && ($page == "calendar")) echo "<p class=\"error\">This feature has been disabled by the site administrator.</p>";
if (($row_pref['mode'] == "2") && ($page == "members")) include(SECTIONS.'memberList.inc.php');
if (($row_pref['mode'] == "2") && ($page == "profile")) include (SECTIONS.'profile.inc.php');
if (($row_pref['mode'] == "2") && ($page == "news")) include (SECTIONS.'news.inc.php');
if ($page == "recipeDetail") {
// Include sections according to set preferences
if ($row_pref['allowSpecifics'] == "Y") { include (SECTIONS.'recipe_specifics.inc.php'); }
if ($row_pref['allowGeneral'] == "Y") { include (SECTIONS.'recipe_general.inc.php'); }
if ($row_pref['allowRecipe'] == "Y") { include (SECTIONS.'recipe.inc.php'); }
if ($row_pref['allowProcedure'] == "Y") { include (SECTIONS.'recipe_procedure.inc.php'); }
if ($row_pref['allowFermentation'] == "Y") { include (SECTIONS.'recipe_fermentation.inc.php'); }
if ($row_pref['allowComments'] == "Y") { include (SECTIONS.'recipe_notes.inc.php'); }
}
?>
<div id="icon"><img src="<?php echo $imageSrc.$icon.".png"; ?>" align="bottom"></div>
<?php
if ($page == "brewBlogCurrent") {
echo $row_log['brewName'];
} elseif ($page == "brewBlogDetail") {
if ($row_pref['mode'] == "1")
echo $row_log['brewName'];
else echo "BrewBlog: " . $row_log['brewName'];
} elseif ($page == "recipeDetail") {
if ($row_pref['mode'] == "1")
echo $row_log['brewName'];
else
echo "Recipe: " . $row_log['brewName'];
} elseif ($page == "about") {
echo $page_title.$page_title_extension;
} elseif ($page == "login") {
echo $page_title.$page_title_extension;
} else {
echo $page_title;
}
echo '</div> <!-- end subtitle or subtitleWide -->' . "\n";
if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail")) {
if ($row_pref['allowSpecifics'] == "Y")
include (SECTIONS.'recipe_specifics.inc.php');
if ($row_pref['allowGeneral'] == "Y")
include (SECTIONS.'recipe_general.inc.php');
if ($row_pref['allowComments'] == "Y")
include (SECTIONS.'recipe_comments.inc.php');
if ($row_pref['allowRecipe'] == "Y")
include (SECTIONS.'recipe.inc.php');
include (SECTIONS.'recipe_equipment.inc.php');
if ($row_pref['allowMash'] == "Y")
include (SECTIONS.'recipe_mash.inc.php');
if ($row_pref['allowWater'] == "Y")
include (SECTIONS.'recipe_water.inc.php');
if ($row_pref['allowProcedure'] == "Y")
include (SECTIONS.'recipe_procedure.inc.php');
if ($row_pref['allowSpecialProcedure'] == "Y")
include (SECTIONS.'recipe_special_procedure.inc.php');
if ($row_pref['allowFermentation'] == "Y")
include (SECTIONS.'recipe_fermentation.inc.php');
if (checkmobile())
echo "";
else {
if ($row_pref['allowReviews'] == "Y")
include (SECTIONS.'recipe_reviews.inc.php');
}
} elseif ($page == "brewBlogList") {
include(SECTIONS.'brewblogList.inc.php');
} elseif ($page == "recipeList") {
include(SECTIONS.'recipeList.inc.php');
} elseif ($page == "awardsList") {
include(SECTIONS.'awardsList.inc.php');
} elseif ($page == "login") {
include (SECTIONS.'login.inc.php');
} elseif ($page == "tools") {
include (SECTIONS.'tools.inc.php');
} elseif ($page == "about") {
include (SECTIONS.'about.inc.php');
} elseif ($page == "reference") {
include (SECTIONS.'reference.inc.php');
} elseif (($row_pref['allowCalendar'] == "Y") && ($page == "calendar")) {
include (SECTIONS.'calendar.inc.php');
} elseif (($row_pref['allowCalendar'] == "N") && ($page == "calendar")) {
echo "<p class=\"error\">This feature has been disabled by the site administrator.</p>";
} elseif (($row_pref['mode'] == "2") && ($page == "members")) {
include(SECTIONS.'memberList.inc.php');
} elseif (($row_pref['mode'] == "2") && ($page == "profile")) {
include (SECTIONS.'profile.inc.php');
} elseif (($row_pref['mode'] == "2") && ($page == "news")) {
include (SECTIONS.'news.inc.php');
} elseif ($page == "recipeDetail") {
// Include sections according to set preferences
if ($row_pref['allowSpecifics'] == "Y")
include (SECTIONS.'recipe_specifics.inc.php');
if ($row_pref['allowGeneral'] == "Y")
include (SECTIONS.'recipe_general.inc.php');
if ($row_pref['allowRecipe'] == "Y")
include (SECTIONS.'recipe.inc.php');
if ($row_pref['allowProcedure'] == "Y")
include (SECTIONS.'recipe_procedure.inc.php');
if ($row_pref['allowFermentation'] == "Y")
include (SECTIONS.'recipe_fermentation.inc.php');
if ($row_pref['allowComments'] == "Y")
include (SECTIONS.'recipe_notes.inc.php');
}
?>
<!--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lobortis pharetra elit non porta. Nullam vel ipsum turpis, quis volutpat odio. Nullam posuere fringilla lacus eget vulputate. Nullam at eros sit amet est iaculis egestas sit amet quis nunc. Sed pretium laoreet neque sed fringilla. Mauris rutrum vulputate velit, eu tincidunt orci rhoncus nec. Suspendisse adipiscing massa vitae purus egestas fermentum. Cras pulvinar, velit ac commodo posuere, dui felis aliquet tellus, quis pulvinar quam urna pellentesque justo. Aenean mattis tellus ipsum, venenatis vehicula diam. Curabitur quis ipsum ante, ullamcorper commodo nulla. Curabitur ultrices egestas libero a sagittis.</p>-->
</div><!-- End contentcolumn -->
<?php if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail") || ($page == "about") || ($page == "recipeDetail") || ($page == "profile")) { ?>
<div id="rightcolumn">
<?php
if ($page == "about") { include (SECTIONS.'list.inc.php'); }
<?php if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail") || ($page == "about") || ($page == "recipeDetail") || ($page == "profile")) { ?>
<div id="rightcolumn">
<?php
if ($page == "about") { include (SECTIONS.'list.inc.php'); }
if (($page == "brewBlogCurrent") || ($page == "brewBlogDetail")) {
if (checkmobile()) echo ""; else {
// Include printing, BeerXML buttons according to preferences
if ($row_pref['allowPrintLog'] == "Y") { include (SECTIONS.'printLog.inc.php'); }
if ($row_pref['allowPrintRecipe'] == "Y") { include (SECTIONS.'printRecipe.inc.php'); echo "&nbsp;"; }
if ($row_pref['allowPrintXML'] == "Y") { include (SECTIONS.'printXML.inc.php'); }
}
if (($row_pref['mode'] == "2") && ($filter != "all")) echo "<div id=\"sidebarWrapper\"><span class=\"text_9\"><span class=\"data_icon\"><img src = \"".$imageSrc."calendar_view_month.png\" alt=\"Calendar\" border=\"0\" align=\"absmiddle\"></span><span class=\"data\"><a href=\"index.php?page=calendar&filter=".$filter."\">View ".$row_user2['realFirstName']."'s Brewing Calendar</a></span></span></div>";
{ include (SECTIONS.'quick_edit.inc.php'); }
if (checkmobile()) echo ""; else {
// Include sidebar sections according to preferences
if ($row_pref['allowLabel'] == "Y") { include (SECTIONS.'label.inc.php'); }
}
if ($row_pref['allowAwards'] == "Y") { include (SECTIONS.'awards.inc.php'); }
if ($row_pref['allowRelated'] == "Y") { include (SECTIONS.'related.inc.php'); }
include (SECTIONS.'list.inc.php');
if ($row_pref['allowStatus'] == "Y") { include (SECTIONS.'status.inc.php'); }
if ($row_pref['allowUpcoming'] == "Y") { include (SECTIONS.'upcoming.inc.php'); }
}
if ($page == "recipeDetail") {
// Include sidebar sections according to preferences
if ($row_pref['allowPrintRecipe'] == "Y") { include (SECTIONS.'printRecipe.inc.php'); echo "&nbsp;"; }
if ($row_pref['allowPrintXML'] == "Y") { include (SECTIONS.'printXML.inc.php'); }
{ include (SECTIONS.'quick_edit.inc.php'); }
if ($row_pref['allowAwards'] == "Y") { include (SECTIONS.'awards.inc.php'); }
if ($row_pref['allowRelated'] == "Y") { include (SECTIONS.'related.inc.php'); }
if ($row_pref['allowList'] == "Y") { include (SECTIONS.'list.inc.php'); }
}
if (checkmobile()) echo ""; else {
// Include printing, BeerXML buttons according to preferences
if ($row_pref['allowPrintLog'] == "Y") { include (SECTIONS.'printLog.inc.php'); }
if ($row_pref['allowPrintRecipe'] == "Y") { include (SECTIONS.'printRecipe.inc.php'); echo "&nbsp;"; }
if ($row_pref['allowPrintXML'] == "Y") { include (SECTIONS.'printXML.inc.php'); }
}
if (($row_pref['mode'] == "2") && ($filter != "all")) echo "<div id=\"sidebarWrapper\"><span class=\"text_9\"><span class=\"data_icon\"><img src = \"".$imageSrc."calendar_view_month.png\" alt=\"Calendar\" border=\"0\" align=\"absmiddle\"></span><span class=\"data\"><a href=\"index.php?page=calendar&filter=".$filter."\">View ".$row_user2['realFirstName']."'s Brewing Calendar</a></span></span></div>"; { include (SECTIONS.'quick_edit.inc.php'); }
if (checkmobile()) echo ""; else {
// Include sidebar sections according to preferences
if ($row_pref['allowLabel'] == "Y") { include (SECTIONS.'label.inc.php'); }
}
if ($row_pref['allowAwards'] == "Y") { include (SECTIONS.'awards.inc.php'); }
if ($row_pref['allowRelated'] == "Y") { include (SECTIONS.'related.inc.php'); }
include (SECTIONS.'list.inc.php');
if ($row_pref['allowStatus'] == "Y") { include (SECTIONS.'status.inc.php'); }
if ($row_pref['allowUpcoming'] == "Y") { include (SECTIONS.'upcoming.inc.php'); }
}
if ($page == "recipeDetail") {
// Include sidebar sections according to preferences
if ($row_pref['allowPrintRecipe'] == "Y") { include (SECTIONS.'printRecipe.inc.php'); echo "&nbsp;"; }
if ($row_pref['allowPrintXML'] == "Y") { include (SECTIONS.'printXML.inc.php'); }
{ include (SECTIONS.'quick_edit.inc.php'); }
if ($row_pref['allowAwards'] == "Y") { include (SECTIONS.'awards.inc.php'); }
if ($row_pref['allowRelated'] == "Y") { include (SECTIONS.'related.inc.php'); }
if ($row_pref['allowList'] == "Y") { include (SECTIONS.'list.inc.php'); }
}
if ($page == "profile") include (SECTIONS.'userPic.inc.php');
?>

View File

@@ -1,45 +1,45 @@
<div id="referenceHeader">Color Chart (SRM/EBC)</div>
<table class="colorTableRef">
<tr align="center" valign="middle">
<td width="20%" bgcolor="#f3f993" class="colorTableRef2">1/<?php echo round (colorconvert("1", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#f5f75c" class="colorTableRef2">2/<?php echo round (colorconvert("2", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#f6f513" class="colorTableRef2">3/<?php echo round (colorconvert("3", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#eae615" class="colorTableRef2">4/<?php echo round (colorconvert("4", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#e0d01b" class="colorTableRef2">5/<?php echo round (colorconvert("5", "EBC"), 0); ?></td>
</tr>
<tr align="center" valign="middle">
<td width="20%" bgcolor="#d5bc26" class="colorTableRef2">6/<?php echo round (colorconvert("6", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#cdaa37" class="colorTableRef2">7/<?php echo round (colorconvert("7", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#c1963c" class="colorTableRef2">8/<?php echo round (colorconvert("8", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#be8c3a" class="colorTableRef2">9/<?php echo round (colorconvert("9", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#be823a" class="colorTableRef2">10/<?php echo round (colorconvert("10", "EBC"), 0); ?></td>
</tr>
<tr align="center" valign="middle">
<td width="20%" bgcolor="#c17a37" class="colorTableRef2">11/<?php echo round (colorconvert("11", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#bf7138" class="colorTableRef2">12/<?php echo round (colorconvert("12", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#bc6733" class="colorTableRef2">13/<?php echo round (colorconvert("13", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#b26033" class="colorTableRef2">14/<?php echo round (colorconvert("14", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#a85839" class="colorTableRef2">15/<?php echo round (colorconvert("15", "EBC"), 0); ?></td>
</tr>
<tr align="center" valign="middle">
<td width="20%" bgcolor="#985336" class="colorTableRef3">16/<?php echo round (colorconvert("16", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#8d4c32" class="colorTableRef3">17/<?php echo round (colorconvert("17", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#7c452d" class="colorTableRef3">18/<?php echo round (colorconvert("18", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#6b3a1e" class="colorTableRef3">19/<?php echo round (colorconvert("19", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#5d341a" class="colorTableRef3">20/<?php echo round (colorconvert("20", "EBC"), 0); ?></td>
</tr>
<tr align="center" valign="middle">
<td width="20%" bgcolor="#4e2a0c" class="colorTableRef3">21/<?php echo round (colorconvert("21", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#4a2727" class="colorTableRef3">22/<?php echo round (colorconvert("22", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#361f1b" class="colorTableRef3">23/<?php echo round (colorconvert("23", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#261716" class="colorTableRef3">24/<?php echo round (colorconvert("24", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#231716" class="colorTableRef3">25/<?php echo round (colorconvert("25", "EBC"), 0); ?></td>
</tr>
<tr align="center" valign="middle">
<td width="20%" bgcolor="#19100f" class="colorTableRef3">26/<?php echo round (colorconvert("26", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#16100f" class="colorTableRef3">27/<?php echo round (colorconvert("27", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#120d0c" class="colorTableRef3">28/<?php echo round (colorconvert("28", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#100b0a" class="colorTableRef3">29/<?php echo round (colorconvert("29", "EBC"), 0); ?></td>
<td width="20%" bgcolor="#050b0a" class="colorTableRef3">30/<?php echo round (colorconvert("30", "EBC"), 0); ?></td>
</tr>
</table>
<table class="colorTableRef">
<tr align="center" valign="middle">
<td width="20%" bgcolor="#f3f993" class="colorTableRef2">1/<?php echo round(srm_to_ebc("1"), 0); ?></td>
<td width="20%" bgcolor="#f5f75c" class="colorTableRef2">2/<?php echo round(srm_to_ebc("2"), 0); ?></td>
<td width="20%" bgcolor="#f6f513" class="colorTableRef2">3/<?php echo round(srm_to_ebc("3"), 0); ?></td>
<td width="20%" bgcolor="#eae615" class="colorTableRef2">4/<?php echo round(srm_to_ebc("4"), 0); ?></td>
<td width="20%" bgcolor="#e0d01b" class="colorTableRef2">5/<?php echo round(srm_to_ebc("5"), 0); ?></td>
</tr>
<tr align="center" valign="middle">
<td width="20%" bgcolor="#d5bc26" class="colorTableRef2">6/<?php echo round(srm_to_ebc("6"), 0); ?></td>
<td width="20%" bgcolor="#cdaa37" class="colorTableRef2">7/<?php echo round(srm_to_ebc("7"), 0); ?></td>
<td width="20%" bgcolor="#c1963c" class="colorTableRef2">8/<?php echo round(srm_to_ebc("8"), 0); ?></td>
<td width="20%" bgcolor="#be8c3a" class="colorTableRef2">9/<?php echo round(srm_to_ebc("9"), 0); ?></td>
<td width="20%" bgcolor="#be823a" class="colorTableRef2">10/<?php echo round(srm_to_ebc("10"), 0); ?></td>
</tr>
<tr align="center" valign="middle">
<td width="20%" bgcolor="#c17a37" class="colorTableRef2">11/<?php echo round(srm_to_ebc("11"), 0); ?></td>
<td width="20%" bgcolor="#bf7138" class="colorTableRef2">12/<?php echo round(srm_to_ebc("12"), 0); ?></td>
<td width="20%" bgcolor="#bc6733" class="colorTableRef2">13/<?php echo round(srm_to_ebc("13"), 0); ?></td>
<td width="20%" bgcolor="#b26033" class="colorTableRef2">14/<?php echo round(srm_to_ebc("14"), 0); ?></td>
<td width="20%" bgcolor="#a85839" class="colorTableRef2">15/<?php echo round(srm_to_ebc("15"), 0); ?></td>
</tr>
<tr align="center" valign="middle">
<td width="20%" bgcolor="#985336" class="colorTableRef3">16/<?php echo round(srm_to_ebc("16"), 0); ?></td>
<td width="20%" bgcolor="#8d4c32" class="colorTableRef3">17/<?php echo round(srm_to_ebc("17"), 0); ?></td>
<td width="20%" bgcolor="#7c452d" class="colorTableRef3">18/<?php echo round(srm_to_ebc("18"), 0); ?></td>
<td width="20%" bgcolor="#6b3a1e" class="colorTableRef3">19/<?php echo round(srm_to_ebc("19"), 0); ?></td>
<td width="20%" bgcolor="#5d341a" class="colorTableRef3">20/<?php echo round(srm_to_ebc("20"), 0); ?></td>
</tr>
<tr align="center" valign="middle">
<td width="20%" bgcolor="#4e2a0c" class="colorTableRef3">21/<?php echo round(srm_to_ebc("21"), 0); ?></td>
<td width="20%" bgcolor="#4a2727" class="colorTableRef3">22/<?php echo round(srm_to_ebc("22"), 0); ?></td>
<td width="20%" bgcolor="#361f1b" class="colorTableRef3">23/<?php echo round(srm_to_ebc("23"), 0); ?></td>
<td width="20%" bgcolor="#261716" class="colorTableRef3">24/<?php echo round(srm_to_ebc("24"), 0); ?></td>
<td width="20%" bgcolor="#231716" class="colorTableRef3">25/<?php echo round(srm_to_ebc("25"), 0); ?></td>
</tr>
<tr align="center" valign="middle">
<td width="20%" bgcolor="#19100f" class="colorTableRef3">26/<?php echo round(srm_to_ebc("26"), 0); ?></td>
<td width="20%" bgcolor="#16100f" class="colorTableRef3">27/<?php echo round(srm_to_ebc("27"), 0); ?></td>
<td width="20%" bgcolor="#120d0c" class="colorTableRef3">28/<?php echo round(srm_to_ebc("28"), 0); ?></td>
<td width="20%" bgcolor="#100b0a" class="colorTableRef3">29/<?php echo round(srm_to_ebc("29"), 0); ?></td>
<td width="20%" bgcolor="#050b0a" class="colorTableRef3">30/<?php echo round(srm_to_ebc("30"), 0); ?></td>
</tr>
</table>

View File

@@ -1,119 +1,207 @@
<?php if (($sort == "brewStyleSRM") && (($row_styles['brewStyleSRM'] == "") || ($row_styles['brewStyleSRM'] == "N/A"))) echo "";
<?php
if (($sort == "brewStyleSRM") && (($row_styles['brewStyleSRM'] == "") || ($row_styles['brewStyleSRM'] == "N/A"))) echo "";
elseif (($sort == "brewStyleIBU") && (($row_styles['brewStyleIBU'] == "") || ($row_styles['brewStyleIBU'] == "N/A"))) echo "";
elseif (($sort == "brewStyleOG") && ($row_styles['brewStyleOG'] == "")) echo "";
elseif (($sort == "brewStyleFG") && ($row_styles['brewStyleFG'] == "")) echo "";
elseif (($sort == "brewStyleABV") && ($row_styles['brewStyleABV'] == "")) echo "";
else { ?>
<div id="referenceHeader"><?php echo $row_styles['brewStyle']; ?> &mdash; BJCP Style Information</div>
<table>
<tr>
<td class="dataLabelLeft">Category:</td>
<td class="data">
<?php
if ($row_styles['brewStyleGroup'] == "01") echo "Light Lager";
if ($row_styles['brewStyleGroup'] == "02") echo "Pilsner";
if ($row_styles['brewStyleGroup'] == "03") echo "European Amber Lager";
if ($row_styles['brewStyleGroup'] == "04") echo "Dark Lager";
if ($row_styles['brewStyleGroup'] == "05") echo "Bock";
if ($row_styles['brewStyleGroup'] == "06") echo "Light Hybrid Beer";
if ($row_styles['brewStyleGroup'] == "07") echo "Amber Hybrid Beer";
if ($row_styles['brewStyleGroup'] == "08") echo "English Pale Ale";
if ($row_styles['brewStyleGroup'] == "09") echo "Scottish and Irish Ale";
if ($row_styles['brewStyleGroup'] == "10") echo "American Ale";
if ($row_styles['brewStyleGroup'] == "11") echo "English Brown Ale";
if ($row_styles['brewStyleGroup'] == "12") echo "Porter";
if ($row_styles['brewStyleGroup'] == "13") echo "Stout";
if ($row_styles['brewStyleGroup'] == "14") echo "India Pale Ale (IPA)";
if ($row_styles['brewStyleGroup'] == "15") echo "German Wheat and Rye Beer";
if ($row_styles['brewStyleGroup'] == "16") echo "Belgian and French Ale";
if ($row_styles['brewStyleGroup'] == "17") echo "Sour Ale";
if ($row_styles['brewStyleGroup'] == "18") echo "Belgian Strong Ale";
if ($row_styles['brewStyleGroup'] == "19") echo "Strong Ale";
if ($row_styles['brewStyleGroup'] == "20") echo "Fruit Beer";
if ($row_styles['brewStyleGroup'] == "21") echo "Spice/Herb/Vegetable Beer";
if ($row_styles['brewStyleGroup'] == "22") echo "Smoke-Flavored and Wood-Aged Beer";
if ($row_styles['brewStyleGroup'] == "23") echo "Specialty Beer";
if ($row_styles['brewStyleGroup'] == "24") echo "Traditional Mead";
if ($row_styles['brewStyleGroup'] == "25") echo "Melomel (Fruit Mead)";
if ($row_styles['brewStyleGroup'] == "26") echo "Other Mead";
if ($row_styles['brewStyleGroup'] == "27") echo "Standard Cider and Perry";
if ($row_styles['brewStyleGroup'] == "28") echo "Specialty Cider and Perry";
?>
</td>
</tr>
</tr>
<td class="dataLabelLeft">Number:</td>
<td class="data"><?php echo $row_styles['brewStyleGroup']; ?><?php echo $row_styles['brewStyleNum']; ?></td>
</tr>
</table>
<table>
<tr>
<td><?php echo $row_styles['brewStyleInfo']; ?></td>
</tr>
</table>
<table class="dataTable">
<tr>
<td class="dataHeadingLeft">OG</td>
<td class="dataHeading">FG</td>
<td class="dataHeading">ABV</td>
<td class="dataHeading">Bitterness</td>
<td class="dataHeading">Color (SRM/EBC)</td>
</tr>
<tr>
<td nowrap="nowrap" class="dataLeft">
<?php
if ($row_styles['brewStyleOG'] == "") { echo "Varies"; }
elseif ($row_styles['brewStyleOG'] != "") { echo $row_styles['brewStyleOG']." &ndash; ".$row_styles['brewStyleOGMax']; }
else { echo "&nbsp;"; }
?>
</td>
<td nowrap="nowrap" class="data">
<?php
if ($row_styles['brewStyleFG'] == "") { echo "Varies"; }
elseif ($row_styles['brewStyleFG'] != "") { echo $row_styles['brewStyleFG']." &ndash; ".$row_styles['brewStyleFGMax']; }
else { echo "&nbsp;"; }
?>
</td>
<td nowrap="nowrap" class="data">
<?php
if ($row_styles['brewStyleABV'] == "") { echo "Varies"; }
elseif ($row_styles['brewStyleABV'] != "" ) { echo $row_styles['brewStyleABV']." &ndash; ".$row_styles['brewStyleABVMax']."%"; }
else { echo "&nbsp;"; }
?>
</td>
<td nowrap="nowrap" class="data">
<?php
if ($row_styles['brewStyleIBU'] == "") { echo "Varies"; }
elseif ($row_styles['brewStyleIBU'] == "N/A") { echo "N/A"; }
elseif ($row_styles['brewStyleIBU'] != "") { $IBUmin = ltrim ($row_styles['brewStyleIBU'], "0"); $IBUmax = ltrim ($row_styles['brewStyleIBUMax'], "0"); echo $IBUmin." &ndash; ".$IBUmax." IBU"; }
else { echo "&nbsp;"; }
?> </td>
<td nowrap="nowrap" class="data">
<?php
if (($page == "reference") || ($page == "brewBlogCurrent") || ($page == "brewBlogDetail") || ($page == "recipeDetail") || ($page == "recipeList") || ($page == "brewBlogList") || ($page == "awardsList")) { include ('includes/colorStyle.inc.php'); } else { include ('../includes/colorStyle.inc.php'); }
if ($row_styles['brewStyleSRM'] == "") { echo "Varies"; }
elseif ($row_styles['brewStyleSRM'] == "N/A") { echo "N/A"; }
elseif ($row_styles['brewStyleSRM'] != "")
{
$SRMmin = ltrim ($row_styles['brewStyleSRM'], "0");
$SRMmax = ltrim ($row_styles['brewStyleSRMMax'], "0");
echo "<table width=\"80\"><tr><td width=\"48%\"><table class=\"colorTable\"><tr><td bgcolor=".$beercolorMin.">";
if ($SRMmin > "15") echo "<font color=\"#ffffff\">";
else echo "<font color=\"#000000\">";
echo $SRMmin."/".round(colorconvert($SRMmin, "EBC"), 0)."</font></td></tr></table></td><td width=\"4%\">&nbsp;&ndash;&nbsp;</td><td width=\"48%\"><table class=\"colorTable\"><tr><td bgcolor=".$beercolorMax.">";
if ($SRMmax > "15") echo "<font color=\"#ffffff\">";
else echo "<font color=\"#000000\">";
echo $SRMmax."/".round(colorconvert($SRMmax, "EBC"), 0)."</font></td></tr></table></td></tr></table>";
}
else { echo "&nbsp;"; }
?> </td>
</tr>
</table>
<?php if ($page == "reference") { ?>
<table style="margin-bottom: 10px;">
<tr>
<td><a href="<?php echo $row_styles['brewStyleLink']; ?>" target="_blank">More Info</a> (link to Beer Judge Certification Program Style Guidelines)</td>
</tr>
<div id="referenceHeader"><?php echo $row_styles['brewStyle']; ?> &mdash; BJCP Style Information</div>
<table>
<tr>
<td class="dataLabelLeft">Category:</td>
<td class="data">
<?php
switch ($row_styles['brewStyleGroup']) {
case "01":
echo "Light Lager";
break;
case "02":
echo "Pilsner";
break;
case "03":
echo "European Amber Lager";
break;
case "04":
echo "Dark Lager";
break;
case "05":
echo "Bock";
break;
case "06":
echo "Light Hybrid Beer";
break;
case "07":
echo "Amber Hybrid Beer";
break;
case "08":
echo "English Pale Ale";
break;
case "09":
echo "Scottish and Irish Ale";
break;
case "10":
echo "American Ale";
break;
case "11":
echo "English Brown Ale";
break;
case "12":
echo "Porter";
break;
case "13":
echo "Stout";
break;
case "14":
echo "India Pale Ale (IPA)";
break;
case "15":
echo "German Wheat and Rye Beer";
break;
case "16":
echo "Belgian and French Ale";
break;
case "17":
echo "Sour Ale";
break;
case "18":
echo "Belgian Strong Ale";
break;
case "19":
echo "Strong Ale";
break;
case "20":
echo "Fruit Beer";
break;
case "21":
echo "Spice/Herb/Vegetable Beer";
break;
case "22":
echo "Smoke-Flavored and Wood-Aged Beer";
break;
case "23":
echo "Specialty Beer";
break;
case "24":
echo "Traditional Mead";
break;
case "25":
echo "Melomel (Fruit Mead)";
break;
case "26":
echo "Other Mead";
break;
case "27":
echo "Standard Cider and Perry";
break;
case "28":
echo "Specialty Cider and Perry";
break;
}
?>
</td>
</tr>
</tr>
<td class="dataLabelLeft">Number:</td>
<td class="data"><?php echo $row_styles['brewStyleGroup']; ?><?php echo $row_styles['brewStyleNum']; ?></td>
</tr>
</table>
<?php } ?>
<?php } ?>
<table>
<tr>
<td><?php echo $row_styles['brewStyleInfo']; ?></td>
</tr>
</table>
<table class="dataTable">
<tr>
<td class="dataHeadingLeft">OG</td>
<td class="dataHeading">FG</td>
<td class="dataHeading">ABV</td>
<td class="dataHeading">Bitterness</td>
<td class="dataHeading">Color (SRM/EBC)</td>
</tr>
<tr>
<td nowrap="nowrap" class="dataLeft">
<?php
if ($row_styles['brewStyleOG'] == "") {
echo "Varies";
} elseif ($row_styles['brewStyleOG'] != "") {
echo $row_styles['brewStyleOG'] . " &ndash; " . $row_styles['brewStyleOGMax'];
} else {
echo "&nbsp;";
}
?>
</td>
<td nowrap="nowrap" class="data">
<?php
if ($row_styles['brewStyleFG'] == "") {
echo "Varies";
} elseif ($row_styles['brewStyleFG'] != "") {
echo $row_styles['brewStyleFG'] . " &ndash; " . $row_styles['brewStyleFGMax'];
} else {
echo "&nbsp;";
}
?>
</td>
<td nowrap="nowrap" class="data">
<?php
if ($row_styles['brewStyleABV'] == "") {
echo "Varies";
} elseif ($row_styles['brewStyleABV'] != "" ) {
echo $row_styles['brewStyleABV'] . " &ndash; " . $row_styles['brewStyleABVMax']."%";
} else {
echo "&nbsp;";
}
?>
</td>
<td nowrap="nowrap" class="data">
<?php
if ($row_styles['brewStyleIBU'] == "") {
echo "Varies";
} elseif ($row_styles['brewStyleIBU'] == "N/A") {
echo "N/A";
} elseif ($row_styles['brewStyleIBU'] != "") {
$IBUmin = ltrim ($row_styles['brewStyleIBU'], "0");
$IBUmax = ltrim ($row_styles['brewStyleIBUMax'], "0");
echo $IBUmin . " &ndash; " . $IBUmax . " IBU";
} else {
echo "&nbsp;";
}
?>
</td>
<td nowrap="nowrap" class="data">
<?php
if (($page == "reference") || ($page == "brewBlogCurrent") || ($page == "brewBlogDetail") || ($page == "recipeDetail") ||
($page == "recipeList") || ($page == "brewBlogList") || ($page == "awardsList")) {
include ('includes/colorStyle.inc.php');
} else {
include ('../includes/colorStyle.inc.php');
}
if ($row_styles['brewStyleSRM'] == "") {
echo "Varies";
} elseif ($row_styles['brewStyleSRM'] == "N/A") {
echo "N/A";
} elseif ($row_styles['brewStyleSRM'] != "") {
$SRMmin = ltrim ($row_styles['brewStyleSRM'], "0");
$SRMmax = ltrim ($row_styles['brewStyleSRMMax'], "0");
$fontColor = ($SRMmin > "15") ? "#ffffff" : "#000000";
echo '<table width="80"><tr><td width="48%"><table class="colorTable"><tr><td style="color: ' . $fontColor . '; background: ' . $beercolorMin . ';">';
echo $SRMmin . '/' . round(srm_to_ebc($SRMmin), 0) . '</td></tr></table></td><td width="4%">&nbsp;&ndash;&nbsp;</td><td width="48%">';
$fontColor = ($SRMmax > "15") ? "#ffffff" : "#000000";
echo '<table class="colorTable"><tr><td style="color: ' . $fontColor . '; background: ' . $beercolorMax . ';">';
echo $SRMmax . '/' . round(srm_to_ebc($SRMmax), 0) . '</td></tr></table></td></tr></table>';
} else {
echo "&nbsp;";
}
?></td>
</tr>
</table>
<?php if ($page == "reference") { ?>
<table style="margin-bottom: 10px;">
<tr>
<td><a href="<?php echo $row_styles['brewStyleLink']; ?>" target="_blank">More Info</a> (link to Beer Judge Certification Program Style Guidelines)</td>
</tr>
</table>
<?php }
}

View File

@@ -36,7 +36,13 @@
<td class="dataHeadingList" width="10%">Date<?php if (!checkmobile()) { ?>&nbsp;<a href="<?php echo "http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']; ?>?page=<?php echo $page; ?>&sort=brewDate&dir=ASC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewDate&dir=DESC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<td class="dataHeadingList" width="25%">Style<?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewStyle&dir=ASC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewStyle&dir=DESC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<td class="dataHeadingList" width="10%">Method<?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewMethod&dir=ASC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewMethod&dir=DESC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<td class="dataHeadingList" width="10%"><?php if ($row_pref['measColor'] == "EBC") echo "EBC"; else echo "SRM"; ?>/<?php if ($row_pref['measColor'] == "EBC") echo "SRM"; else echo "EBC"; if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewLovibond&dir=ASC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewLovibond&dir=DESC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<td class="dataHeadingList" width="10%"><?php if ($row_pref['measColor'] == "EBC") echo "EBC"; else echo "SRM"; ?><?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewLovibond&dir=ASC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewLovibond&dir=DESC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<?php /*
<!-- <td class="dataHeadingList" width="10%"><?php if ($row_pref['measColor'] == "EBC") echo "EBC"; else echo "SRM"; ?>/<?php if ($row_pref['measColor'] == "EBC") echo "SRM"; else echo "EBC"; if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewLovibond&dir=ASC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewLovibond&dir=DESC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
*/?>
<td class="dataHeadingList" width="5%">IBU<?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewBitterness&dir=ASC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewBitterness&dir=DESC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<td class="dataHeadingList" width="5%">ABV<?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewOG&dir=ASC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewOG&dir=DESC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<?php if (($row_pref['mode'] == "2") && ($filter == "all")) { ?><td class="dataHeadingList">Contributor<?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewBrewerID&dir=ASC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewBrewerID&dir=DESC&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td><?php } ?>

View File

@@ -8,7 +8,7 @@
<td class="dataHeadingList" width="25%">Style&nbsp;<img src="<?php echo $imageSrc; ?>spacer.gif" border="0" width="16" height="5"></td>
<td class="dataHeadingList" width="10%">Method&nbsp;<img src="<?php echo $imageSrc; ?>spacer.gif" border="0" width="16" height="5"></td>
<td class="dataHeadingList" width="10%"><?php if ($row_pref['measColor'] == "EBC") echo "EBC"; else echo "SRM"; ?>/<?php if ($row_pref['measColor'] == "EBC") echo "SRM"; else echo "EBC";?>&nbsp;<img src="<?php echo $imageSrc; ?>spacer.gif" border="0" width="16" height="5"></td>
<td class="dataHeadingList" width="10%"><?php if ($row_pref['measColor'] == "EBC") echo "EBC"; else echo "SRM"; ?>&nbsp;<img src="<?php echo $imageSrc; ?>spacer.gif" border="0" width="16" height="5"></td>
<td class="dataHeadingList" width="5%">IBU&nbsp;<img src="<?php echo $imageSrc; ?>spacer.gif" border="0" width="16" height="5"></td>
<td class="dataHeadingList" width="5%">ABV&nbsp;<img src="<?php echo $imageSrc; ?>spacer.gif" border="0" width="16" height="5"></td>
<?php if (($row_pref['mode'] == "2") && ($filter == "all")) { ?>

View File

@@ -35,7 +35,7 @@
<td class="dataHeadingList" width="25%"><?php echo $dbName; ?><?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewName&dir=ASC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewName&dir=DESC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"><?php } ?></td>
<td class="dataHeadingList" width="25%">Style<?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewStyle&dir=ASC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewStyle&dir=DESC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<td class="dataHeadingList" width="10%">Method<?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewMethod&dir=ASC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewMethod&dir=DESC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<td class="dataHeadingList" width="10%"><?php if ($row_pref['measColor'] == "EBC") echo "EBC"; else echo "SRM"; ?>/<?php if ($row_pref['measColor'] == "EBC") echo "SRM"; else echo "EBC"; if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewLovibond&dir=ASC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewLovibond&dir=DESC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<td class="dataHeadingList" width="10%"><?php if ($row_pref['measColor'] == "EBC") echo "EBC"; else echo "SRM"; ?><?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewLovibond&dir=ASC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewLovibond&dir=DESC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<td class="dataHeadingList" width="5%">IBU<?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewBitterness&dir=ASC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewBitterness&dir=DESC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<td class="dataHeadingList" width="5%">ABV<?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewOG&dir=ASC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewOG&dir=DESC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td>
<?php if (($row_pref['mode'] == "2") && ($filter == "all")) { ?><td class="dataHeadingList">Contributor<?php if (!checkmobile()) { ?>&nbsp;<a href="?page=<?php echo $page; ?>&sort=brewBrewerID&dir=ASC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_up.gif" border="0" alt="Sort Ascending"></a><a href="?page=<?php echo $page; ?>&sort=brewBrewerID&dir=DESC&filter=<?php echo $filter; ?>&view=<?php echo $view; ?>"><img src="<?php echo $imageSrc; ?>sort_down.gif" border="0" alt="Sort Descending"></a><?php } ?></td><?php } ?>

View File

@@ -1,4 +1,7 @@
<?php mysql_select_db($database_brewing, $brewing);
<?php
require_once('admin/lib/color.lib.php');
mysql_select_db($database_brewing, $brewing);
$query_styles = sprintf("SELECT * FROM styles WHERE brewStyle='%s'", $row_log['brewStyle']);
$styles = mysql_query($query_styles, $brewing) or die(mysql_error());
$row_styles = mysql_fetch_assoc($styles);
@@ -44,39 +47,70 @@ $totalRows_styles = mysql_num_rows($styles);
<td class="dataLabelLeft">Yield:</td>
<td class="data"><?php if (($action == "default") || ($action == "print") || ($action == "reset")) echo $row_log['brewYield']; if ($action == "scale") echo $amt; echo "&nbsp;".$row_pref['measFluid2']; ?></td>
</tr>
<?php } // Yield ?>
<?php if ($row_log['brewLovibond'] != "" ) { ?>
<tr>
<td class="dataLabelLeft"><?php if (($page == "recipePrint") || ($page == "logPrint")) echo ""; else { ?><div id="help"><a href="sections/reference.inc.php?section=color&source=log&KeepThis=true&TB_iframe=true&height=350&width=600" title="SRM Color Reference" class="thickbox"><img src="<?php echo $imageSrc; ?>information.png" align="absmiddle" border="0" alt="Reference"></a></div><?php } ?>Color (<?php if ($row_pref['measColor'] == "EBC") echo "EBC"; else echo "SRM"; ?>/<?php if ($row_pref['measColor'] == "EBC") echo "SRM"; else echo "EBC"; ?>):</td>
<td class="data">
<?php
if (($page != "logPrint") && ($page != "recipePrint")) include (INCLUDES.'color_display.inc.php');
if (($page == "logPrint") || ($page == "recipePrint")) {
if ($row_pref['measColor'] == "SRM") { echo round ($row_log['brewLovibond'], 1)."/"; echo colorconvert($row_log['brewLovibond'], "EBC"); }
if ($row_pref['measColor'] == "EBC") { echo round ($row_log['brewLovibond'], 1)."/"; echo colorconvert($row_log['brewLovibond'], "SRM"); }
}
?>
</td>
</tr>
<?php } // Lovibond ?>
<?php if ($row_log['brewBitterness'] != "") { ?>
<tr>
<td class="dataLabelLeft">Bitterness (Calc):</td>
<td class="data"><?php $IBU = ltrim ($row_log['brewBitterness'], "0"); echo round ($IBU,1)." ".$row_pref['measBitter']; if ($row_log['brewIBUFormula'] != "") echo " (".$row_log['brewIBUFormula'].")"; ?></td>
</tr>
<?php } // Bitterness ?>
<?php if (($row_log['brewOG'] == "" ) || ($row_log['brewFG'] == "" )) echo ""; else { ?>
<?php if ($row_log['brewBitterness'] != "") { ?>
<tr>
<td class="dataLabelLeft">BU/GU:</td>
<td class="data"><?php $bugu = $row_log['brewBitterness']/(($row_log['brewOG'] - 1) * 1000); echo round ($bugu, 2); ?></td>
</tr>
<?php } ?>
<tr>
<?php } // Yield
// Color
if ($row_log['brewLovibond'] != "" ) {
echo '<tr>' . "\n";
echo '<td class="dataLabelLeft">';
if (($page == "recipePrint") || ($page == "logPrint")) {
echo "";
} else {
echo '<div id="help"><a href="sections/reference.inc.php?section=color&source=log&KeepThis=true&TB_iframe=true&height=350&width=600" title="SRM Color Reference" class="thickbox"><img src="' . $imageSrc . 'information.png" align="absmiddle" border="0" alt="Reference"></a></div>';
}
echo 'Color (' . $row_pref['measColor'] . '):</td>' . "\n";
echo '<td class="data">';
if ($page == "logPrint" || $page == "recipePrint") {
echo round($row_log['brewLovibond'], 1);
} else {
echo '<table><tr>' . "\n";
$brewLov = $row_log['brewLovibond'];
if ($row_pref['measColor'] == "EBC")
$brewLov = ebc_to_srm($brewLov);
$fontColor = ($brewLov >= 15) ? "#ffffff" : "#000000";
$bkColor = get_display_color($brewLov);
echo '<td class="colorTable" style="text-align: center; background: ' . $bkColor . '; color: ' . $fontColor . '; padding: 0 3px 0 3px">&nbsp;&nbsp;';
echo round($row_log['brewLovibond'], 1);
echo '&nbsp;&nbsp;</td>' . "\n";
echo '<td>&nbsp;(';
if ($row_log['brewColorFormula'] == "") {
echo "formula unknown";
} else {
echo $row_log['brewColorFormula'];
}
echo ')</td>' . "\n";
echo '</tr></table>' . "\n";
}
echo '</td>' . "\n";
echo '</tr>' . "\n";
}
// Bitterness
if ($row_log['brewBitterness'] != "") {
echo '<tr>' . "\n";
echo '<td class="dataLabelLeft">Bitterness:</td>' . "\n";
echo '<td class="data">' . round(ltrim($row_log['brewBitterness'], "0"), 1) . ' ' . $row_pref['measBitter'];
if ($row_log['brewIBUFormula'] != "")
echo " (" . $row_log['brewIBUFormula'] . ")";
echo '</td>' . "\n";
echo '</tr>' . "\n";
}
if (($row_log['brewOG'] == "" ) || ($row_log['brewFG'] == "" ))
echo "";
else {
if ($row_log['brewBitterness'] != "") { ?>
<tr>
<td class="dataLabelLeft">BU/GU:</td>
<td class="data"><?php $bugu = $row_log['brewBitterness']/(($row_log['brewOG'] - 1) * 1000); echo round ($bugu, 2); ?></td>
</tr>
<?php } ?>
<tr>
<td class="dataLabelLeft">Calories:</td>
<td class="data"><?php echo round ($calories, 0); ?> (12 ounces)</td>
</tr>
</tr>
<?php } ?>
<?php if (($page !="recipeDetail") && ($page !="recipePrint")) { ?>
<?php if ($row_log['brewCondition'] != "" ) { ?>
<tr>

View File

@@ -456,6 +456,7 @@ CREATE TABLE IF NOT EXISTS `brewing` (
`brewBitterness` float default NULL,
`brewIBUFormula` varchar(250) default NULL,
`brewLovibond` float default NULL,
`brewColorFormula` varchar(50) default NULL,
`brewComments` text,
`brewMashType` varchar(250) default NULL,
`brewMashGrainWeight` varchar(10) default NULL,
@@ -519,10 +520,10 @@ CREATE TABLE IF NOT EXISTS `brewing` (
-- Dumping data for table `brewing`
--
INSERT INTO `brewing` (`id`, `brewName`, `brewStyle`, `brewBatchNum`, `brewCondition`, `brewDate`, `brewYield`, `brewMethod`, `brewCost`, `brewLink1`, `brewLink1Name`, `brewLink2`, `brewLink2Name`, `brewInfo`, `brewExtract1`, `brewExtract1Weight`, `brewExtract2`, `brewExtract2Weight`, `brewExtract3`, `brewExtract3Weight`, `brewExtract4`, `brewExtract4Weight`, `brewExtract5`, `brewExtract5Weight`, `brewGrain1`, `brewGrain1Weight`, `brewGrain2`, `brewGrain2Weight`, `brewGrain3`, `brewGrain3Weight`, `brewGrain4`, `brewGrain4Weight`, `brewGrain5`, `brewGrain5Weight`, `brewGrain6`, `brewGrain6Weight`, `brewGrain7`, `brewGrain7Weight`, `brewGrain8`, `brewGrain8Weight`, `brewGrain9`, `brewGrain9Weight`, `brewGrain10`, `brewGrain10Weight`, `brewGrain11`, `brewGrain11Weight`, `brewGrain12`, `brewGrain12Weight`, `brewGrain13`, `brewGrain13Weight`, `brewGrain14`, `brewGrain14Weight`, `brewGrain15`, `brewGrain15Weight`, `brewAddition1`, `brewAddition1Amt`, `brewAddition2`, `brewAddition2Amt`, `brewAddition3`, `brewAddition3Amt`, `brewAddition4`, `brewAddition4Amt`, `brewAddition5`, `brewAddition5Amt`, `brewAddition6`, `brewAddition6Amt`, `brewAddition7`, `brewAddition7Amt`, `brewAddition8`, `brewAddition8Amt`, `brewAddition9`, `brewAddition9Amt`, `brewMisc1Name`, `brewMisc2Name`, `brewMisc3Name`, `brewMisc4Name`, `brewMisc1Type`, `brewMisc2Type`, `brewMisc3Type`, `brewMisc4Type`, `brewMisc1Use`, `brewMisc2Use`, `brewMisc3Use`, `brewMisc4Use`, `brewMisc1Time`, `brewMisc2Time`, `brewMisc3Time`, `brewMisc4Time`, `brewMisc1Amount`, `brewMisc2Amount`, `brewMisc3Amount`, `brewMisc4Amount`, `brewHops1`, `brewHops1Weight`, `brewHops1IBU`, `brewHops1Time`, `brewHops2`, `brewHops2Weight`, `brewHops2IBU`, `brewHops2Time`, `brewHops3`, `brewHops3Weight`, `brewHops3IBU`, `brewHops3Time`, `brewHops4`, `brewHops4Weight`, `brewHops4IBU`, `brewHops4Time`, `brewHops5`, `brewHops5Weight`, `brewHops5IBU`, `brewHops5Time`, `brewHops6`, `brewHops6Weight`, `brewHops6IBU`, `brewHops6Time`, `brewHops7`, `brewHops7Weight`, `brewHops7IBU`, `brewHops7Time`, `brewHops8`, `brewHops8Weight`, `brewHops8IBU`, `brewHops8Time`, `brewHops9`, `brewHops9Weight`, `brewHops9IBU`, `brewHops9Time`, `brewHops1Use`, `brewHops2Use`, `brewHops3Use`, `brewHops4Use`, `brewHops5Use`, `brewHops6Use`, `brewHops7Use`, `brewHops8Use`, `brewHops9Use`, `brewHops1Type`, `brewHops2Type`, `brewHops3Type`, `brewHops4Type`, `brewHops5Type`, `brewHops6Type`, `brewHops7Type`, `brewHops8Type`, `brewHops9Type`, `brewHops1Form`, `brewHops2Form`, `brewHops3Form`, `brewHops4Form`, `brewHops5Form`, `brewHops6Form`, `brewHops7Form`, `brewHops8Form`, `brewHops9Form`, `brewHops10`, `brewHops10Weight`, `brewHops10IBU`, `brewHops10Time`, `brewHops10Use`, `brewHops10Type`, `brewHops10Form`, `brewHops11`, `brewHops11Weight`, `brewHops11IBU`, `brewHops11Time`, `brewHops11Use`, `brewHops11Type`, `brewHops11Form`, `brewHops12`, `brewHops12Weight`, `brewHops12IBU`, `brewHops12Time`, `brewHops12Use`, `brewHops12Type`, `brewHops12Form`, `brewHops13`, `brewHops13Weight`, `brewHops13IBU`, `brewHops13Time`, `brewHops13Use`, `brewHops13Type`, `brewHops13Form`, `brewHops14`, `brewHops14Weight`, `brewHops14IBU`, `brewHops14Time`, `brewHops14Use`, `brewHops14Type`, `brewHops14Form`, `brewHops15`, `brewHops15Weight`, `brewHops15IBU`, `brewHops15Time`, `brewHops15Use`, `brewHops15Type`, `brewHops15Form`, `brewYeast`, `brewYeastMan`, `brewYeastForm`, `brewYeastType`, `brewYeastAmount`, `brewLabelImage`, `brewOG`, `brewFG`, `brewGravity1`, `brewGravity1Days`, `brewGravity2`, `brewGravity2Days`, `brewProcedure`, `brewSpecialProcedure`, `brewPrimary`, `brewPrimaryTemp`, `brewSecondary`, `brewSecondaryTemp`, `brewTertiary`, `brewTertiaryTemp`, `brewLager`, `brewLagerTemp`, `brewAge`, `brewAgeTemp`, `brewBitterness`, `brewIBUFormula`, `brewLovibond`, `brewComments`, `brewMashType`, `brewMashGrainWeight`, `brewMashGrainTemp`, `brewMashTunTemp`, `brewMashSpargAmt`, `brewMashSpargeTemp`, `brewMashEquipAdjust`, `brewMashPH`, `brewMashStep1Name`, `brewMashStep1Desc`, `brewMashStep1Temp`, `brewMashStep1Time`, `brewMashStep2Name`, `brewMashStep2Desc`, `brewMashStep2Temp`, `brewMashStep2Time`, `brewMashStep3Name`, `brewMashStep3Desc`, `brewMashStep3Temp`, `brewMashStep3Time`, `brewMashStep4Name`, `brewMashStep4Desc`, `brewMashStep4Temp`, `brewMashStep4Time`, `brewMashStep5Name`, `brewMashStep5Desc`, `brewMashStep5Temp`, `brewMashStep5Time`, `brewWaterName`, `brewWaterAmount`, `brewWaterCalcium`, `brewWaterBicarb`, `brewWaterSulfate`, `brewWaterChloride`, `brewWaterMagnesium`, `brewWaterPH`, `brewWaterNotes`, `brewWaterSodium`, `brewEfficiency`, `brewPPG`, `brewStatus`, `brewTapDate`, `brewMashGravity`, `brewPreBoilAmt`, `brewBrewerID`, `brewTargetOG`, `brewTargetFG`, `brewMashProfile`, `brewWaterProfile`, `brewYeastProfile`, `brewEquipProfile`, `brewBoilTime`, `brewFeatured`, `brewWaterRatio`, `brewArchive`) VALUES
(1, 'Sample Log #3', 'Belgian Blond Ale', '03_BB', 'Bottles', '2009-08-01', '5', 'All Grain', '$32.40', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Belgian Plisen Malt', '10.50', 'German Light Munich Malt', '0.50', 'German Wheat Malt Light', '0.50', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Sucrose (Table Sugar)', '2.00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Golding', '0.65', '7.0', '90', 'Golding', '0.75', '7.0', '30', 'Saaz', '0.50', '5.8', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', 'Boil', 'Boil', NULL, NULL, NULL, NULL, NULL, NULL, 'Bittering', 'Both', 'Aroma', NULL, NULL, NULL, NULL, NULL, NULL, 'Pellets', 'Pellets', 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1000 ml', 'sample.jpg', '1.068', '1.005', '1.020', '5', '1.010', '10', NULL, NULL, '7', '72', '7', '70', NULL, NULL, NULL, NULL, '45', '61', 29.4, 'Rager', 3.8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Secondary', '2009-09-27', '1.055', '6', 'admin', '1.068', '1.008', 19, 8, 54, 1, 90, 'Y', '1.33', 'No'),
(2, 'Sample Log #1', 'American Brown Ale', '01_BB', 'Keg', '2009-06-01', '5', 'All Grain', '$31.10', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'British Maris Otter Pale Malt', '11.00', 'German Light Munich Malt', '0.66', 'Crystal Malt 60L', '0.66', 'British Chocolate Malt', '0.50', 'British Roasted Barley', '0.12', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Brown Sugar (Dark)', '0.50', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Whirlfloc', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '15', NULL, NULL, NULL, '1 tablet', NULL, NULL, NULL, 'Magnum', '1.00', '13.6', '60', 'Challenger', '0.25', '6.7', '60', 'Mount Hood', '1.00', '4.2', '0', 'Kent Golding', '0.50', '4.5', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', 'Boil', 'Boil', 'Dry Hop', NULL, NULL, NULL, NULL, NULL, 'Bittering', 'Bittering', 'Aroma', 'Aroma', NULL, NULL, NULL, NULL, NULL, 'Pellets', 'Pellets', 'Pellets', 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1000 ml', NULL, '1.068', '1.010', '1.015', '4', '1.012', '7', NULL, NULL, '7', '68', '21', '68', NULL, NULL, NULL, NULL, '21', '61', 55.4, 'Daniels', 25.9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'On Tap', '2009-09-01', '1.049', '6.0', 'nonpriv', '1.066', '1.010', 15, 9, 124, 6, 90, 'N', '1.25', 'No'),
(3, 'Sample Log #2', 'Blonde Ale', '02_BB', 'Bottles', '2009-07-01', '10', 'All Grain', '$27.29', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'American Pale Malt (2-Row)', '18.00', 'German Light Munich Malt', '4.00', 'Crystal Malt 40L', '0.25', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Fermcap', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '60', NULL, NULL, NULL, '1/2 tsp.', NULL, NULL, NULL, 'Magnum', '1.00', '13.0', '60', 'Amarillo', '1.00', '8.2', '3', 'Amarillo', '1.00', '8.2', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', 'Boil', 'Dry Hop', NULL, NULL, NULL, NULL, NULL, NULL, 'Bittering', 'Aroma', 'Aroma', NULL, NULL, NULL, NULL, NULL, NULL, 'Pellets', 'Pellets', 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2000 ml', 'sample.jpg', '1.060', '1.010', '1.020', '7', '1.015', '14', NULL, NULL, '7', '66', '14', '66', '21', '66', '35', '34', '28', '50', 25.6, 'Rager', 6.2, '<p>The latest iteration. Added dry hop addition.</p>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Bottled', '2009-09-01', '1.041', '12', 'admin', '1.058', '1.010', 14, 8, 69, 1, 90, 'N', '1.50', 'No');
INSERT INTO `brewing` (`id`, `brewName`, `brewStyle`, `brewBatchNum`, `brewCondition`, `brewDate`, `brewYield`, `brewMethod`, `brewCost`, `brewLink1`, `brewLink1Name`, `brewLink2`, `brewLink2Name`, `brewInfo`, `brewExtract1`, `brewExtract1Weight`, `brewExtract2`, `brewExtract2Weight`, `brewExtract3`, `brewExtract3Weight`, `brewExtract4`, `brewExtract4Weight`, `brewExtract5`, `brewExtract5Weight`, `brewGrain1`, `brewGrain1Weight`, `brewGrain2`, `brewGrain2Weight`, `brewGrain3`, `brewGrain3Weight`, `brewGrain4`, `brewGrain4Weight`, `brewGrain5`, `brewGrain5Weight`, `brewGrain6`, `brewGrain6Weight`, `brewGrain7`, `brewGrain7Weight`, `brewGrain8`, `brewGrain8Weight`, `brewGrain9`, `brewGrain9Weight`, `brewGrain10`, `brewGrain10Weight`, `brewGrain11`, `brewGrain11Weight`, `brewGrain12`, `brewGrain12Weight`, `brewGrain13`, `brewGrain13Weight`, `brewGrain14`, `brewGrain14Weight`, `brewGrain15`, `brewGrain15Weight`, `brewAddition1`, `brewAddition1Amt`, `brewAddition2`, `brewAddition2Amt`, `brewAddition3`, `brewAddition3Amt`, `brewAddition4`, `brewAddition4Amt`, `brewAddition5`, `brewAddition5Amt`, `brewAddition6`, `brewAddition6Amt`, `brewAddition7`, `brewAddition7Amt`, `brewAddition8`, `brewAddition8Amt`, `brewAddition9`, `brewAddition9Amt`, `brewMisc1Name`, `brewMisc2Name`, `brewMisc3Name`, `brewMisc4Name`, `brewMisc1Type`, `brewMisc2Type`, `brewMisc3Type`, `brewMisc4Type`, `brewMisc1Use`, `brewMisc2Use`, `brewMisc3Use`, `brewMisc4Use`, `brewMisc1Time`, `brewMisc2Time`, `brewMisc3Time`, `brewMisc4Time`, `brewMisc1Amount`, `brewMisc2Amount`, `brewMisc3Amount`, `brewMisc4Amount`, `brewHops1`, `brewHops1Weight`, `brewHops1IBU`, `brewHops1Time`, `brewHops2`, `brewHops2Weight`, `brewHops2IBU`, `brewHops2Time`, `brewHops3`, `brewHops3Weight`, `brewHops3IBU`, `brewHops3Time`, `brewHops4`, `brewHops4Weight`, `brewHops4IBU`, `brewHops4Time`, `brewHops5`, `brewHops5Weight`, `brewHops5IBU`, `brewHops5Time`, `brewHops6`, `brewHops6Weight`, `brewHops6IBU`, `brewHops6Time`, `brewHops7`, `brewHops7Weight`, `brewHops7IBU`, `brewHops7Time`, `brewHops8`, `brewHops8Weight`, `brewHops8IBU`, `brewHops8Time`, `brewHops9`, `brewHops9Weight`, `brewHops9IBU`, `brewHops9Time`, `brewHops1Use`, `brewHops2Use`, `brewHops3Use`, `brewHops4Use`, `brewHops5Use`, `brewHops6Use`, `brewHops7Use`, `brewHops8Use`, `brewHops9Use`, `brewHops1Type`, `brewHops2Type`, `brewHops3Type`, `brewHops4Type`, `brewHops5Type`, `brewHops6Type`, `brewHops7Type`, `brewHops8Type`, `brewHops9Type`, `brewHops1Form`, `brewHops2Form`, `brewHops3Form`, `brewHops4Form`, `brewHops5Form`, `brewHops6Form`, `brewHops7Form`, `brewHops8Form`, `brewHops9Form`, `brewHops10`, `brewHops10Weight`, `brewHops10IBU`, `brewHops10Time`, `brewHops10Use`, `brewHops10Type`, `brewHops10Form`, `brewHops11`, `brewHops11Weight`, `brewHops11IBU`, `brewHops11Time`, `brewHops11Use`, `brewHops11Type`, `brewHops11Form`, `brewHops12`, `brewHops12Weight`, `brewHops12IBU`, `brewHops12Time`, `brewHops12Use`, `brewHops12Type`, `brewHops12Form`, `brewHops13`, `brewHops13Weight`, `brewHops13IBU`, `brewHops13Time`, `brewHops13Use`, `brewHops13Type`, `brewHops13Form`, `brewHops14`, `brewHops14Weight`, `brewHops14IBU`, `brewHops14Time`, `brewHops14Use`, `brewHops14Type`, `brewHops14Form`, `brewHops15`, `brewHops15Weight`, `brewHops15IBU`, `brewHops15Time`, `brewHops15Use`, `brewHops15Type`, `brewHops15Form`, `brewYeast`, `brewYeastMan`, `brewYeastForm`, `brewYeastType`, `brewYeastAmount`, `brewLabelImage`, `brewOG`, `brewFG`, `brewGravity1`, `brewGravity1Days`, `brewGravity2`, `brewGravity2Days`, `brewProcedure`, `brewSpecialProcedure`, `brewPrimary`, `brewPrimaryTemp`, `brewSecondary`, `brewSecondaryTemp`, `brewTertiary`, `brewTertiaryTemp`, `brewLager`, `brewLagerTemp`, `brewAge`, `brewAgeTemp`, `brewBitterness`, `brewIBUFormula`, `brewLovibond`, `brewColorFormula`, `brewComments`, `brewMashType`, `brewMashGrainWeight`, `brewMashGrainTemp`, `brewMashTunTemp`, `brewMashSpargAmt`, `brewMashSpargeTemp`, `brewMashEquipAdjust`, `brewMashPH`, `brewMashStep1Name`, `brewMashStep1Desc`, `brewMashStep1Temp`, `brewMashStep1Time`, `brewMashStep2Name`, `brewMashStep2Desc`, `brewMashStep2Temp`, `brewMashStep2Time`, `brewMashStep3Name`, `brewMashStep3Desc`, `brewMashStep3Temp`, `brewMashStep3Time`, `brewMashStep4Name`, `brewMashStep4Desc`, `brewMashStep4Temp`, `brewMashStep4Time`, `brewMashStep5Name`, `brewMashStep5Desc`, `brewMashStep5Temp`, `brewMashStep5Time`, `brewWaterName`, `brewWaterAmount`, `brewWaterCalcium`, `brewWaterBicarb`, `brewWaterSulfate`, `brewWaterChloride`, `brewWaterMagnesium`, `brewWaterPH`, `brewWaterNotes`, `brewWaterSodium`, `brewEfficiency`, `brewPPG`, `brewStatus`, `brewTapDate`, `brewMashGravity`, `brewPreBoilAmt`, `brewBrewerID`, `brewTargetOG`, `brewTargetFG`, `brewMashProfile`, `brewWaterProfile`, `brewYeastProfile`, `brewEquipProfile`, `brewBoilTime`, `brewFeatured`, `brewWaterRatio`, `brewArchive`) VALUES
(1, 'Sample Log #3', 'Belgian Blond Ale', '03_BB', 'Bottles', '2009-08-01', '5', 'All Grain', '$32.40', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Belgian Plisen Malt', '10.50', 'German Light Munich Malt', '0.50', 'German Wheat Malt Light', '0.50', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Sucrose (Table Sugar)', '2.00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Golding', '0.65', '7.0', '90', 'Golding', '0.75', '7.0', '30', 'Saaz', '0.50', '5.8', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', 'Boil', 'Boil', NULL, NULL, NULL, NULL, NULL, NULL, 'Bittering', 'Both', 'Aroma', NULL, NULL, NULL, NULL, NULL, NULL, 'Pellets', 'Pellets', 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1000 ml', 'sample.jpg', '1.068', '1.005', '1.020', '5', '1.010', '10', NULL, NULL, '7', '72', '7', '70', NULL, NULL, NULL, NULL, '45', '61', 29.4, 'Rager', 3.8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Secondary', '2009-09-27', '1.055', '6', 'admin', '1.068', '1.008', 19, 8, 54, 1, 90, 'Y', '1.33', 'No'),
(2, 'Sample Log #1', 'American Brown Ale', '01_BB', 'Keg', '2009-06-01', '5', 'All Grain', '$31.10', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'British Maris Otter Pale Malt', '11.00', 'German Light Munich Malt', '0.66', 'Crystal Malt 60L', '0.66', 'British Chocolate Malt', '0.50', 'British Roasted Barley', '0.12', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Brown Sugar (Dark)', '0.50', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Whirlfloc', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '15', NULL, NULL, NULL, '1 tablet', NULL, NULL, NULL, 'Magnum', '1.00', '13.6', '60', 'Challenger', '0.25', '6.7', '60', 'Mount Hood', '1.00', '4.2', '0', 'Kent Golding', '0.50', '4.5', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', 'Boil', 'Boil', 'Dry Hop', NULL, NULL, NULL, NULL, NULL, 'Bittering', 'Bittering', 'Aroma', 'Aroma', NULL, NULL, NULL, NULL, NULL, 'Pellets', 'Pellets', 'Pellets', 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1000 ml', NULL, '1.068', '1.010', '1.015', '4', '1.012', '7', NULL, NULL, '7', '68', '21', '68', NULL, NULL, NULL, NULL, '21', '61', 55.4, 'Daniels', 25.9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'On Tap', '2009-09-01', '1.049', '6.0', 'nonpriv', '1.066', '1.010', 15, 9, 124, 6, 90, 'N', '1.25', 'No'),
(3, 'Sample Log #2', 'Blonde Ale', '02_BB', 'Bottles', '2009-07-01', '10', 'All Grain', '$27.29', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'American Pale Malt (2-Row)', '18.00', 'German Light Munich Malt', '4.00', 'Crystal Malt 40L', '0.25', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Fermcap', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '60', NULL, NULL, NULL, '1/2 tsp.', NULL, NULL, NULL, 'Magnum', '1.00', '13.0', '60', 'Amarillo', '1.00', '8.2', '3', 'Amarillo', '1.00', '8.2', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', 'Boil', 'Dry Hop', NULL, NULL, NULL, NULL, NULL, NULL, 'Bittering', 'Aroma', 'Aroma', NULL, NULL, NULL, NULL, NULL, NULL, 'Pellets', 'Pellets', 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2000 ml', 'sample.jpg', '1.060', '1.010', '1.020', '7', '1.015', '14', NULL, NULL, '7', '66', '14', '66', '21', '66', '35', '34', '28', '50', 25.6, 'Rager', 6.2, NULL, '<p>The latest iteration. Added dry hop addition.</p>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Bottled', '2009-09-01', '1.041', '12', 'admin', '1.058', '1.010', 14, 8, 69, 1, 90, 'N', '1.50', 'No');
-- --------------------------------------------------------
@@ -849,6 +850,7 @@ CREATE TABLE IF NOT EXISTS `recipes` (
`brewBitterness` float default NULL,
`brewIBUFormula` varchar(250) default NULL,
`brewLovibond` float default NULL,
`brewColorFormula` varchar(50) default NULL,
`brewBrewerID` varchar(250) default NULL,
`brewBoilTime` int(4) default NULL,
`brewFeatured` char(1) default NULL,
@@ -863,12 +865,12 @@ CREATE TABLE IF NOT EXISTS `recipes` (
-- Dumping data for table `recipes`
--
INSERT INTO `recipes` (`id`, `brewName`, `brewStyle`, `brewSource`, `brewYield`, `brewMethod`, `brewLink1`, `brewLink1Name`, `brewLink2`, `brewLink2Name`, `brewNotes`, `brewExtract1`, `brewExtract1Weight`, `brewExtract2`, `brewExtract2Weight`, `brewExtract3`, `brewExtract3Weight`, `brewExtract4`, `brewExtract4Weight`, `brewExtract5`, `brewExtract5Weight`, `brewGrain1`, `brewGrain1Weight`, `brewGrain2`, `brewGrain2Weight`, `brewGrain3`, `brewGrain3Weight`, `brewGrain4`, `brewGrain4Weight`, `brewGrain5`, `brewGrain5Weight`, `brewGrain6`, `brewGrain6Weight`, `brewGrain7`, `brewGrain7Weight`, `brewGrain8`, `brewGrain8Weight`, `brewGrain9`, `brewGrain9Weight`, `brewGrain10`, `brewGrain10Weight`, `brewGrain11`, `brewGrain11Weight`, `brewGrain12`, `brewGrain12Weight`, `brewGrain13`, `brewGrain13Weight`, `brewGrain14`, `brewGrain14Weight`, `brewGrain15`, `brewGrain15Weight`, `brewAddition1`, `brewAddition1Amt`, `brewAddition2`, `brewAddition2Amt`, `brewAddition3`, `brewAddition3Amt`, `brewAddition4`, `brewAddition4Amt`, `brewAddition5`, `brewAddition5Amt`, `brewAddition6`, `brewAddition6Amt`, `brewAddition7`, `brewAddition7Amt`, `brewAddition8`, `brewAddition8Amt`, `brewAddition9`, `brewAddition9Amt`, `brewMisc1Name`, `brewMisc2Name`, `brewMisc3Name`, `brewMisc4Name`, `brewMisc1Type`, `brewMisc2Type`, `brewMisc3Type`, `brewMisc4Type`, `brewMisc1Use`, `brewMisc2Use`, `brewMisc3Use`, `brewMisc4Use`, `brewMisc1Time`, `brewMisc2Time`, `brewMisc3Time`, `brewMisc4Time`, `brewMisc1Amount`, `brewMisc2Amount`, `brewMisc3Amount`, `brewMisc4Amount`, `brewHops1`, `brewHops1Weight`, `brewHops1IBU`, `brewHops1Time`, `brewHops2`, `brewHops2Weight`, `brewHops2IBU`, `brewHops2Time`, `brewHops3`, `brewHops3Weight`, `brewHops3IBU`, `brewHops3Time`, `brewHops4`, `brewHops4Weight`, `brewHops4IBU`, `brewHops4Time`, `brewHops5`, `brewHops5Weight`, `brewHops5IBU`, `brewHops5Time`, `brewHops6`, `brewHops6Weight`, `brewHops6IBU`, `brewHops6Time`, `brewHops7`, `brewHops7Weight`, `brewHops7IBU`, `brewHops7Time`, `brewHops8`, `brewHops8Weight`, `brewHops8IBU`, `brewHops8Time`, `brewHops9`, `brewHops9Weight`, `brewHops9IBU`, `brewHops9Time`, `brewHops1Use`, `brewHops2Use`, `brewHops3Use`, `brewHops4Use`, `brewHops5Use`, `brewHops6Use`, `brewHops7Use`, `brewHops8Use`, `brewHops9Use`, `brewHops1Type`, `brewHops2Type`, `brewHops3Type`, `brewHops4Type`, `brewHops5Type`, `brewHops6Type`, `brewHops7Type`, `brewHops8Type`, `brewHops9Type`, `brewHops1Form`, `brewHops2Form`, `brewHops3Form`, `brewHops4Form`, `brewHops5Form`, `brewHops6Form`, `brewHops7Form`, `brewHops8Form`, `brewHops9Form`, `brewHops10`, `brewHops10Weight`, `brewHops10IBU`, `brewHops10Time`, `brewHops10Use`, `brewHops10Type`, `brewHops10Form`, `brewHops11`, `brewHops11Weight`, `brewHops11IBU`, `brewHops11Time`, `brewHops11Use`, `brewHops11Type`, `brewHops11Form`, `brewHops12`, `brewHops12Weight`, `brewHops12IBU`, `brewHops12Time`, `brewHops12Use`, `brewHops12Type`, `brewHops12Form`, `brewHops13`, `brewHops13Weight`, `brewHops13IBU`, `brewHops13Time`, `brewHops13Use`, `brewHops13Type`, `brewHops13Form`, `brewHops14`, `brewHops14Weight`, `brewHops14IBU`, `brewHops14Time`, `brewHops14Use`, `brewHops14Type`, `brewHops14Form`, `brewHops15`, `brewHops15Weight`, `brewHops15IBU`, `brewHops15Time`, `brewHops15Use`, `brewHops15Type`, `brewHops15Form`, `brewYeast`, `brewYeastMan`, `brewYeastForm`, `brewYeastType`, `brewYeastAmount`, `brewLabelImage`, `brewOG`, `brewFG`, `brewProcedure`, `brewPrimary`, `brewPrimaryTemp`, `brewSecondary`, `brewSecondaryTemp`, `brewTertiary`, `brewTertiaryTemp`, `brewLager`, `brewLagerTemp`, `brewAge`, `brewAgeTemp`, `brewBitterness`, `brewIBUFormula`, `brewLovibond`, `brewBrewerID`, `brewBoilTime`, `brewFeatured`, `brewMashProfile`, `brewWaterProfile`, `brewYeastProfile`, `brewArchive`) VALUES
(1, 'Orange Krush', 'Witbier', 'BrewBlogger.net', '5.25', 'Partial Mash', NULL, NULL, NULL, NULL, '<p>Intended to be spicy and "orangy."</p>', 'LME - Extra Light', '3.00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'German Wheat Malt Light', '3.00', 'Flaked Oats', '1.00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1.00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Gypsum', 'Orange Zest (Peel)', 'Corriander (Crushed)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '60', '20', '20', NULL, '1 tsp.', '2.0 ounces', '2.0 ounces', NULL, 'Admiral', '0.50', '5.50', '60', 'Cascade', '0.25', '5.50', '15', 'Cascade', '0.25', '5.50', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', 'Boil', 'Boil', NULL, NULL, NULL, NULL, NULL, NULL, 'Bittering', 'Both', 'Aroma', NULL, NULL, NULL, NULL, NULL, NULL, 'Pellets', 'Pellets', 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1500 ml', NULL, '1.036', '1.009', '<ul>\r\n<li>Mash grains in&nbsp;2.0 gallons of 152&deg; water for 60 minutes</li>\r\n<li>Sparge with&nbsp;2.0 gallons of 168&deg; water for 15 minutes</li>\r\n<li>Collect wort in kettle, bring to a boil</li>\r\n<li>Add extract and bring to a boil again</li>\r\n<li>Add hops according to schedule</li>\r\n<li>Cool wort in a sink filled with cold water and ice, swirl every 3 minutes</li>\r\n<li>Add wort to primary, fill to 5.25 gallons with water</li>\r\n<li>Pitch yeast when wort reaches 75&deg; or lower</li>\r\n</ul>', '10', '65', '10', '65', NULL, NULL, NULL, NULL, '28', '60', 15.9, 'Daniels', 1.61905, 'nonpriv', NULL, 'N', NULL, NULL, 65, NULL),
(2, 'Steamer', 'California Common Beer', 'BrewBlogger.net', '5.0', 'Extract', NULL, NULL, NULL, NULL, NULL, 'DME - Extra Light', '6.00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'German Light Munich Malt', '1.00', 'British Carastan Malt', '1.00', 'Crystal Malt 80L', '0.50', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Northern Brewer', '0.75', '8.2', '60', 'Northern Brewer', '0.75', '8.2', '15', 'Northern Brewer', '0.50', '8.2', '3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Sanfrancisco Lager', 'White Labs', 'Liquid', NULL, NULL, NULL, '1.050', '1.013', NULL, '10', '62', '14', '62', NULL, NULL, '14', '40', NULL, NULL, 3.7, 'Daniels', 12.276, 'nonpriv', NULL, 'N', NULL, NULL, NULL, 'No'),
(3, '60-Minute Ticker', 'American IPA', 'BrewBlogger.net', '5', 'All Grain', NULL, NULL, NULL, NULL, '<p>All-grain version of the 60-Minute IPA recipe in the book <em>Extreme Brewing</em>.</p>\r\n<p>The target IBU level is approx. 60 and this recipe will achieve that. However, to achieve truly authenitc results, a blend of the first 3 hops listed should be added continuously over the course of the 60 minute boil. Hence the name.</p>\r\n<p>Sub White Labs British Ale (WLP005) if you cant find the Wyeast Ringwood Ale.</p>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'American Pale Malt (2-Row)', '11.24', 'Belgian Biscuit Malt', '0.24', 'Crystal Malt 120L', '0.13', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Nugget', '0.6', '13', '60', 'Simcoe', '0.6', '13', '45', 'Amarillo', '0.5', '8.4', '30', 'Amarillo', '0.5', '8.4', '0', 'Amarillo', '1', '8.4', '0', 'Simcoe', '1.4', '13', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', 'Boil', 'Boil', 'Aroma', 'Dry Hop', 'Dry Hop', NULL, NULL, NULL, 'Both', 'Both', 'Both', 'Aroma', 'Aroma', 'Aroma', NULL, NULL, NULL, 'Pellets', 'Pellets', 'Pellets', 'Pellets', 'Pellets', 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Ringwood Ale (1187)', NULL, 'Liquid', NULL, NULL, NULL, '1.063', '1.010', NULL, '7', '68', '14', '55', '0', '32', NULL, NULL, '21', '55', 66.3, 'Daniels', 8.3, 'admin', NULL, 'Y', NULL, NULL, NULL, NULL),
(4, 'Lupulus Imperialus Premiumus', 'Premium American Lager', 'BrewBlogger.net', '5', 'All Grain', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'American Pilsen Malt', '10.00', 'American Dextrin (Cara-Pils) Malt', '2.00', 'Crystal Malt 120L', '0.125', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '5.2 Stabilizer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '60', NULL, NULL, NULL, '1 tbsp.', NULL, NULL, NULL, 'Zeus', '1.00', '13.0', '60', 'Amarillo', '0.25', '8.2', '20', 'Amarillo', '0.75', '8.2', '0', 'Amarillo', '1.00', '8.2', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', 'Boil', 'Aroma', 'Dry Hop', NULL, NULL, NULL, NULL, NULL, 'Bittering', 'Aroma', 'Aroma', 'Aroma', NULL, NULL, NULL, NULL, NULL, 'Pellets', 'Pellets', 'Pellets', 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1000 ml', NULL, '1.063', '1.016', NULL, '7', '50', '2', '60', NULL, NULL, '42', '32', NULL, NULL, 52.5, 'Rager', 6.6, 'admin', NULL, 'Y', NULL, NULL, 37, 'No'),
(5, 'The Power of the Darkside', 'Munich Dunkel', 'BrewBlogger.net', '5', 'All Grain', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'American Pilsen Malt', '3.00', 'German Dark Munich Malt', '7.00', 'British Pale Chocolate', '0.125', 'German Carafa III De-Husked Malt', '0.125', 'German Melanoidin Malt', '0.75', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Magnum', '0.50', '13.0', '60', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Bittering', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2500 ml', NULL, '1.057', '1.014', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 28.4, 'Daniels', 16.06, 'nonpriv', NULL, 'N', NULL, NULL, 56, 'No');
INSERT INTO `recipes` (`id`, `brewName`, `brewStyle`, `brewSource`, `brewYield`, `brewMethod`, `brewLink1`, `brewLink1Name`, `brewLink2`, `brewLink2Name`, `brewNotes`, `brewExtract1`, `brewExtract1Weight`, `brewExtract2`, `brewExtract2Weight`, `brewExtract3`, `brewExtract3Weight`, `brewExtract4`, `brewExtract4Weight`, `brewExtract5`, `brewExtract5Weight`, `brewGrain1`, `brewGrain1Weight`, `brewGrain2`, `brewGrain2Weight`, `brewGrain3`, `brewGrain3Weight`, `brewGrain4`, `brewGrain4Weight`, `brewGrain5`, `brewGrain5Weight`, `brewGrain6`, `brewGrain6Weight`, `brewGrain7`, `brewGrain7Weight`, `brewGrain8`, `brewGrain8Weight`, `brewGrain9`, `brewGrain9Weight`, `brewGrain10`, `brewGrain10Weight`, `brewGrain11`, `brewGrain11Weight`, `brewGrain12`, `brewGrain12Weight`, `brewGrain13`, `brewGrain13Weight`, `brewGrain14`, `brewGrain14Weight`, `brewGrain15`, `brewGrain15Weight`, `brewAddition1`, `brewAddition1Amt`, `brewAddition2`, `brewAddition2Amt`, `brewAddition3`, `brewAddition3Amt`, `brewAddition4`, `brewAddition4Amt`, `brewAddition5`, `brewAddition5Amt`, `brewAddition6`, `brewAddition6Amt`, `brewAddition7`, `brewAddition7Amt`, `brewAddition8`, `brewAddition8Amt`, `brewAddition9`, `brewAddition9Amt`, `brewMisc1Name`, `brewMisc2Name`, `brewMisc3Name`, `brewMisc4Name`, `brewMisc1Type`, `brewMisc2Type`, `brewMisc3Type`, `brewMisc4Type`, `brewMisc1Use`, `brewMisc2Use`, `brewMisc3Use`, `brewMisc4Use`, `brewMisc1Time`, `brewMisc2Time`, `brewMisc3Time`, `brewMisc4Time`, `brewMisc1Amount`, `brewMisc2Amount`, `brewMisc3Amount`, `brewMisc4Amount`, `brewHops1`, `brewHops1Weight`, `brewHops1IBU`, `brewHops1Time`, `brewHops2`, `brewHops2Weight`, `brewHops2IBU`, `brewHops2Time`, `brewHops3`, `brewHops3Weight`, `brewHops3IBU`, `brewHops3Time`, `brewHops4`, `brewHops4Weight`, `brewHops4IBU`, `brewHops4Time`, `brewHops5`, `brewHops5Weight`, `brewHops5IBU`, `brewHops5Time`, `brewHops6`, `brewHops6Weight`, `brewHops6IBU`, `brewHops6Time`, `brewHops7`, `brewHops7Weight`, `brewHops7IBU`, `brewHops7Time`, `brewHops8`, `brewHops8Weight`, `brewHops8IBU`, `brewHops8Time`, `brewHops9`, `brewHops9Weight`, `brewHops9IBU`, `brewHops9Time`, `brewHops1Use`, `brewHops2Use`, `brewHops3Use`, `brewHops4Use`, `brewHops5Use`, `brewHops6Use`, `brewHops7Use`, `brewHops8Use`, `brewHops9Use`, `brewHops1Type`, `brewHops2Type`, `brewHops3Type`, `brewHops4Type`, `brewHops5Type`, `brewHops6Type`, `brewHops7Type`, `brewHops8Type`, `brewHops9Type`, `brewHops1Form`, `brewHops2Form`, `brewHops3Form`, `brewHops4Form`, `brewHops5Form`, `brewHops6Form`, `brewHops7Form`, `brewHops8Form`, `brewHops9Form`, `brewHops10`, `brewHops10Weight`, `brewHops10IBU`, `brewHops10Time`, `brewHops10Use`, `brewHops10Type`, `brewHops10Form`, `brewHops11`, `brewHops11Weight`, `brewHops11IBU`, `brewHops11Time`, `brewHops11Use`, `brewHops11Type`, `brewHops11Form`, `brewHops12`, `brewHops12Weight`, `brewHops12IBU`, `brewHops12Time`, `brewHops12Use`, `brewHops12Type`, `brewHops12Form`, `brewHops13`, `brewHops13Weight`, `brewHops13IBU`, `brewHops13Time`, `brewHops13Use`, `brewHops13Type`, `brewHops13Form`, `brewHops14`, `brewHops14Weight`, `brewHops14IBU`, `brewHops14Time`, `brewHops14Use`, `brewHops14Type`, `brewHops14Form`, `brewHops15`, `brewHops15Weight`, `brewHops15IBU`, `brewHops15Time`, `brewHops15Use`, `brewHops15Type`, `brewHops15Form`, `brewYeast`, `brewYeastMan`, `brewYeastForm`, `brewYeastType`, `brewYeastAmount`, `brewLabelImage`, `brewOG`, `brewFG`, `brewProcedure`, `brewPrimary`, `brewPrimaryTemp`, `brewSecondary`, `brewSecondaryTemp`, `brewTertiary`, `brewTertiaryTemp`, `brewLager`, `brewLagerTemp`, `brewAge`, `brewAgeTemp`, `brewBitterness`, `brewIBUFormula`, `brewLovibond`, `brewColorFormula`, `brewBrewerID`, `brewBoilTime`, `brewFeatured`, `brewMashProfile`, `brewWaterProfile`, `brewYeastProfile`, `brewArchive`) VALUES
(1, 'Orange Krush', 'Witbier', 'BrewBlogger.net', '5.25', 'Partial Mash', NULL, NULL, NULL, NULL, '<p>Intended to be spicy and "orangy."</p>', 'LME - Extra Light', '3.00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'German Wheat Malt Light', '3.00', 'Flaked Oats', '1.00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1.00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Gypsum', 'Orange Zest (Peel)', 'Corriander (Crushed)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '60', '20', '20', NULL, '1 tsp.', '2.0 ounces', '2.0 ounces', NULL, 'Admiral', '0.50', '5.50', '60', 'Cascade', '0.25', '5.50', '15', 'Cascade', '0.25', '5.50', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', 'Boil', 'Boil', NULL, NULL, NULL, NULL, NULL, NULL, 'Bittering', 'Both', 'Aroma', NULL, NULL, NULL, NULL, NULL, NULL, 'Pellets', 'Pellets', 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1500 ml', NULL, '1.036', '1.009', '<ul>\r\n<li>Mash grains in&nbsp;2.0 gallons of 152&deg; water for 60 minutes</li>\r\n<li>Sparge with&nbsp;2.0 gallons of 168&deg; water for 15 minutes</li>\r\n<li>Collect wort in kettle, bring to a boil</li>\r\n<li>Add extract and bring to a boil again</li>\r\n<li>Add hops according to schedule</li>\r\n<li>Cool wort in a sink filled with cold water and ice, swirl every 3 minutes</li>\r\n<li>Add wort to primary, fill to 5.25 gallons with water</li>\r\n<li>Pitch yeast when wort reaches 75&deg; or lower</li>\r\n</ul>', '10', '65', '10', '65', NULL, NULL, NULL, NULL, '28', '60', 15.9, 'Daniels', 1.61905, NULL, 'nonpriv', NULL, 'N', NULL, NULL, 65, NULL),
(2, 'Steamer', 'California Common Beer', 'BrewBlogger.net', '5.0', 'Extract', NULL, NULL, NULL, NULL, NULL, 'DME - Extra Light', '6.00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'German Light Munich Malt', '1.00', 'British Carastan Malt', '1.00', 'Crystal Malt 80L', '0.50', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Northern Brewer', '0.75', '8.2', '60', 'Northern Brewer', '0.75', '8.2', '15', 'Northern Brewer', '0.50', '8.2', '3', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Sanfrancisco Lager', 'White Labs', 'Liquid', NULL, NULL, NULL, '1.050', '1.013', NULL, '10', '62', '14', '62', NULL, NULL, '14', '40', NULL, NULL, 3.7, 'Daniels', 12.276, NULL, 'nonpriv', NULL, 'N', NULL, NULL, NULL, 'No'),
(3, '60-Minute Ticker', 'American IPA', 'BrewBlogger.net', '5', 'All Grain', NULL, NULL, NULL, NULL, '<p>All-grain version of the 60-Minute IPA recipe in the book <em>Extreme Brewing</em>.</p>\r\n<p>The target IBU level is approx. 60 and this recipe will achieve that. However, to achieve truly authenitc results, a blend of the first 3 hops listed should be added continuously over the course of the 60 minute boil. Hence the name.</p>\r\n<p>Sub White Labs British Ale (WLP005) if you cant find the Wyeast Ringwood Ale.</p>', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'American Pale Malt (2-Row)', '11.24', 'Belgian Biscuit Malt', '0.24', 'Crystal Malt 120L', '0.13', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Nugget', '0.6', '13', '60', 'Simcoe', '0.6', '13', '45', 'Amarillo', '0.5', '8.4', '30', 'Amarillo', '0.5', '8.4', '0', 'Amarillo', '1', '8.4', '0', 'Simcoe', '1.4', '13', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', 'Boil', 'Boil', 'Aroma', 'Dry Hop', 'Dry Hop', NULL, NULL, NULL, 'Both', 'Both', 'Both', 'Aroma', 'Aroma', 'Aroma', NULL, NULL, NULL, 'Pellets', 'Pellets', 'Pellets', 'Pellets', 'Pellets', 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Ringwood Ale (1187)', NULL, 'Liquid', NULL, NULL, NULL, '1.063', '1.010', NULL, '7', '68', '14', '55', '0', '32', NULL, NULL, '21', '55', 66.3, 'Daniels', 8.3, NULL, 'admin', NULL, 'Y', NULL, NULL, NULL, NULL),
(4, 'Lupulus Imperialus Premiumus', 'Premium American Lager', 'BrewBlogger.net', '5', 'All Grain', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'American Pilsen Malt', '10.00', 'American Dextrin (Cara-Pils) Malt', '2.00', 'Crystal Malt 120L', '0.125', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '5.2 Stabilizer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '60', NULL, NULL, NULL, '1 tbsp.', NULL, NULL, NULL, 'Zeus', '1.00', '13.0', '60', 'Amarillo', '0.25', '8.2', '20', 'Amarillo', '0.75', '8.2', '0', 'Amarillo', '1.00', '8.2', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', 'Boil', 'Aroma', 'Dry Hop', NULL, NULL, NULL, NULL, NULL, 'Bittering', 'Aroma', 'Aroma', 'Aroma', NULL, NULL, NULL, NULL, NULL, 'Pellets', 'Pellets', 'Pellets', 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1000 ml', NULL, '1.063', '1.016', NULL, '7', '50', '2', '60', NULL, NULL, '42', '32', NULL, NULL, 52.5, 'Rager', 6.6, NULL, 'admin', NULL, 'Y', NULL, NULL, 37, 'No'),
(5, 'The Power of the Darkside', 'Munich Dunkel', 'BrewBlogger.net', '5', 'All Grain', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'American Pilsen Malt', '3.00', 'German Dark Munich Malt', '7.00', 'British Pale Chocolate', '0.125', 'German Carafa III De-Husked Malt', '0.125', 'German Melanoidin Malt', '0.75', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Magnum', '0.50', '13.0', '60', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Boil', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Bittering', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Pellets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2500 ml', NULL, '1.057', '1.014', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 28.4, 'Daniels', 16.06, NULL, 'nonpriv', NULL, 'N', NULL, NULL, 56, 'No');
-- --------------------------------------------------------
@@ -1542,20 +1544,22 @@ CREATE TABLE IF NOT EXISTS `users` (
`defaultEquipProfile` int(8) default NULL,
`defaultMashProfile` int(8) default NULL,
`defaultWaterProfile` int(8) default NULL,
`defaultBitternessFormula` varchar(255) default NULL,
`defaultBitternessFormula` varchar(50) NOT NULL default 'Tinseth',
`defaultMethod` varchar(255) default NULL,
`defaultBatchSize` int(8) default NULL,
`defaultWaterRatio` varchar(8) default NULL,
`defaultColorFormula` varchar(50) NOT NULL default 'Morey',
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `user_name`, `password`, `realFirstName`, `realLastName`, `userLevel`, `userProfile`, `userPicURL`, `userFavStyles`, `userFavCommercial`, `userFavQuote`, `userDesignations`, `userOccupation`, `userHobbies`, `userBirthdate`, `userHometown`, `userBrewingSince`, `userWebsiteName`, `userWebsiteURL`, `userInfoPrivate`, `userPosition`, `userPastPosition`, `userAddress`, `userCity`, `userState`, `userZip`, `userPhoneH`, `userPhoneW`, `userEmail`, `defaultBoilTime`, `defaultEquipProfile`, `defaultMashProfile`, `defaultWaterProfile`, `defaultBitternessFormula`, `defaultMethod`, `defaultBatchSize`, `defaultWaterRatio`) VALUES
(1, 'admin', 'ee11cbb19052e40b07aac0ca060c23ee', 'Joe', 'Brewer', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1996, NULL, NULL, NULL, NULL, NULL, '1234 Main', 'Anytown', 'CO', '80111', '555-555-5555', '555-555-1234', 'you@email.com', 90, 8, 2, 5, 'Rager', 'All Grain', 10, NULL),
(2, 'nonpriv', 'ee11cbb19052e40b07aac0ca060c23ee', 'Billy', 'Brewer', '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, 8, 1, 2, 'Daniels', 'Extract', NULL, NULL);
INSERT INTO `users` (`id`, `user_name`, `password`, `realFirstName`, `realLastName`, `userLevel`, `userProfile`, `userPicURL`, `userFavStyles`, `userFavCommercial`, `userFavQuote`, `userDesignations`, `userOccupation`, `userHobbies`, `userBirthdate`, `userHometown`, `userBrewingSince`, `userWebsiteName`, `userWebsiteURL`, `userInfoPrivate`, `userPosition`, `userPastPosition`, `userAddress`, `userCity`, `userState`, `userZip`, `userPhoneH`, `userPhoneW`, `userEmail`, `defaultBoilTime`, `defaultEquipProfile`, `defaultMashProfile`, `defaultWaterProfile`, `defaultBitternessFormula`, `defaultMethod`, `defaultBatchSize`, `defaultWaterRatio`, `defaultColorFormula`) VALUES
(1, 'admin', 'ee11cbb19052e40b07aac0ca060c23ee', 'Joe', 'Brewer', '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1996, NULL, NULL, NULL, NULL, NULL, '1234 Main', 'Anytown', 'CO', '80111', '555-555-5555', '555-555-1234', 'you@email.com', 90, 8, 2, 5, 'Rager', 'All Grain', 10, NULL, 'Morey'),
(2, 'nonpriv', 'ee11cbb19052e40b07aac0ca060c23ee', 'Billy', 'Brewer', '2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 60, 8, 1, 2, 'Daniels', 'Extract', NULL, NULL, 'Morey');
-- --------------------------------------------------------

View File

@@ -96,4 +96,13 @@ UPDATE adjuncts SET adjunctPPG = 43.00 WHERE adjunctName = "Lactose (Milk Sugar)
--
-- Don't drop sugar_type table yet. Leave it for reference in case we run in to bugs in this update.
--
--
--
-- Updates to user table
--
ALTER TABLE users ADD defaultColorFormula VARCHAR(50) NOT NULL DEFAULT 'Morey';
ALTER TABLE users MODIFY defaultBitternessFormula VARCHAR(50) NOT NULL DEFAULT 'Tinseth';
ALTER TABLE recipes ADD brewColorFormula VARCHAR(50) AFTER brewLovibond;
ALTER TABLE brewing ADD brewColorFormula VARCHAR(50) AFTER brewLovibond;