First 2.3.3 commits.
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Name:</td>
|
||||
<td class="data"><input type="text" name="maltName" tooltipText="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") echo $row_log['maltName']; ?>" size="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Supplier:</td>
|
||||
<td class="data"><input type="text" name="maltSupplier" tooltiptext="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") echo $row_log['maltSupplier']; ?>" size="40" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Origin:</td>
|
||||
<td class="data"><input type="text" name="maltOrigin" tooltiptext="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") echo $row_log['maltOrigin']; ?>" size="40" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Color:</td>
|
||||
<td class="data"><input type="text" name="maltLovibond" tooltipText="<?php echo $toolTip_decimal; ?>" value="<?php if ($action == "edit") echo $row_log['maltLovibond']; ?>" size="5"> °L</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Info:</td>
|
||||
<td class="data"><textarea name="maltInfo" cols="67" rows="10"><?php if ($action == "edit") echo $row_log['maltInfo']; ?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Type:</td>
|
||||
<td class="data">
|
||||
<select class="text_area" name="maltYield" id="maltYield">
|
||||
<?php do { ?>
|
||||
<option value="<?php echo $row_sugar_type['id']; ?>" <?php if ($action == "edit") { if (!(strcmp($row_log['maltYield'], $row_sugar_type['id']))) {echo "SELECTED";} }?>><?php echo $row_sugar_type['sugarName']." (".$row_sugar_type['sugarPPG']." PPG)"; ?></option>
|
||||
<?php } while ($row_sugar_type = mysql_fetch_assoc($sugar_type)); ?>
|
||||
</select>
|
||||
</td>
|
||||
</table>
|
||||
<input type="hidden" name="maltType" value="Grain" />
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Name:</td>
|
||||
<td class="data"><input type="text" name="maltName" tooltipText="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") echo $row_log['maltName']; ?>" size="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Supplier:</td>
|
||||
<td class="data"><input type="text" name="maltSupplier" tooltiptext="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") echo $row_log['maltSupplier']; ?>" size="40" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Origin:</td>
|
||||
<td class="data"><input type="text" name="maltOrigin" tooltiptext="<?php echo $toolTip_name; ?>" value="<?php if ($action == "edit") echo $row_log['maltOrigin']; ?>" size="40" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Color:</td>
|
||||
<td class="data"><input type="text" name="maltLovibond" tooltipText="<?php echo $toolTip_decimal; ?>" value="<?php if ($action == "edit") echo $row_log['maltLovibond']; ?>" size="5"> °L</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Info:</td>
|
||||
<td class="data"><textarea name="maltInfo" cols="67" rows="10"><?php if ($action == "edit") echo $row_log['maltInfo']; ?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Type:</td>
|
||||
<td class="data">
|
||||
<select class="text_area" name="maltYield" id="maltYield">
|
||||
<?php do { ?>
|
||||
<option value="<?php echo $row_sugar_type['id']; ?>" <?php if ($action == "edit") { if (!(strcmp($row_log['maltYield'], $row_sugar_type['id']))) {echo "SELECTED";} }?>><?php echo $row_sugar_type['sugarName']." (".$row_sugar_type['sugarPPG']." PPG)"; ?></option>
|
||||
<?php } while ($row_sugar_type = mysql_fetch_assoc($sugar_type)); ?>
|
||||
</select>
|
||||
</td>
|
||||
</table>
|
||||
<input type="hidden" name="maltType" value="Grain" />
|
||||
<?php include ('includes/add_edit_buttons.inc.php'); ?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -210,7 +210,7 @@ div.menuBar a.menuButton {
|
||||
position: relative;
|
||||
text-decoration: none;
|
||||
top: 0px;
|
||||
z-index: 200;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
div.menuBar a.menuButton:hover {
|
||||
@@ -225,7 +225,7 @@ div.menuBar a.menuButtonActive:hover {
|
||||
div.menu {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
z-index: 201;
|
||||
z-index: 100;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,411 +1,410 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
|
||||
|
||||
//{{{ License
|
||||
// +------------------------------------------------------------------------+
|
||||
// | Input Beer XML - takes recipe objects from BeerXMLParser |
|
||||
// | and inserts recipes into database |
|
||||
// | |
|
||||
// | NOTES - Augmented by Geoff Humphrey for use in BrewBlogger 2.3 |
|
||||
// | <brewmeister@brewblogger.net> |
|
||||
// | - Added conversion variables based upon BB preferences |
|
||||
// | - Beer XML standards are in Metric for weight/volume, C for temp |
|
||||
// +------------------------------------------------------------------------+
|
||||
// | This program is free software; you can redistribute it and/or |
|
||||
// | modify it under the terms of the GNU General Public License |
|
||||
// | as published by the Free Software Foundation; either version 2 |
|
||||
// | of the License, or (at your option) any later version. |
|
||||
// | |
|
||||
// | This program is distributed in the hope that it will be useful, |
|
||||
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
// | GNU General Public License for more details. |
|
||||
// | |
|
||||
// | You should have received a copy of the GNU General Public License |
|
||||
// | along with this program; if not, write to the Free Software |
|
||||
// | Foundation, Inc., 59 Temple Place - Suite 330, |
|
||||
// | Boston, MA 02111-1307, USA. |
|
||||
// +------------------------------------------------------------------------+
|
||||
// | Author: Oskar Stephens <oskar.stephens@gmail.com> |
|
||||
// +------------------------------------------------------------------------+
|
||||
//}}}
|
||||
include ('parse_beer_xml.inc.php');
|
||||
//{{{ InputBeerXML
|
||||
class InputBeerXML {
|
||||
public $recipes;
|
||||
public $insertedRecipes;
|
||||
public $brewer;
|
||||
//{{{InputBeerXML
|
||||
function InputBeerXML($filename) {
|
||||
$this->brewer = $GLOBALS['loginUsername'];
|
||||
$this->recipes = new BeerXMLParser($filename);
|
||||
}
|
||||
//}}}
|
||||
|
||||
//{{{ convertUnit()
|
||||
function convertUnit($value,$type){
|
||||
include('../Connections/config.php');
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_pref_xml = "SELECT measWeight1,measTemp,measFluid2,measWeight2 FROM preferences";
|
||||
$pref_xml = mysql_query($query_pref_xml, $brewing) or die(mysql_error());
|
||||
$row_pref_xml = mysql_fetch_assoc($pref_xml);
|
||||
$totalRows_pref_xml = mysql_num_rows($pref_xml);
|
||||
|
||||
switch($type){
|
||||
case "hopWeight";
|
||||
if ($row_pref_xml['measWeight1'] == "grams") return round($value * 1000, 2);
|
||||
else return round($value * 35.27396, 2);
|
||||
case "temperature":
|
||||
if ($row_pref_xml['measTemp'] == "F") return round (($value * 1.8) + 32, 0);
|
||||
else return round($value, 0);
|
||||
case "volume":
|
||||
if ($row_pref_xml['measFluid2'] == "gallons") return round($value * 0.26417, 1);
|
||||
else return round($value, 1);
|
||||
case "weight":
|
||||
if ($row_pref_xml['measWeight2'] == "pounds") return round($value * 2.20462, 2);
|
||||
else return round($value, 2);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
//}}}
|
||||
|
||||
|
||||
//{{{ insertRecipes
|
||||
function insertRecipes(){
|
||||
foreach($this->recipes->recipes as $recipe){
|
||||
$this->insertRecipe($recipe);
|
||||
}
|
||||
return $this->insertedRecipes;
|
||||
}
|
||||
//}}}
|
||||
|
||||
//{{{ insertRecipe
|
||||
function insertRecipe($recipe){ // inserts into `recipes` DB table
|
||||
include ('../includes/scrubber.inc.php');
|
||||
$brewing = mysql_connect($GLOBALS['hostname_brewblog'], $GLOBALS['username_brewblog'], $GLOBALS['password_brewblog']) or trigger_error(mysql_error());
|
||||
$sqlQuery = "INSERT INTO recipes ";
|
||||
$fields = "(brewName";
|
||||
$values = " VALUES('" . $recipe->name . "'";
|
||||
$vf = array();
|
||||
$counter = array();
|
||||
|
||||
|
||||
//$vf["brewName"] = $this->strtr($recipe->name, $string);
|
||||
$vf["brewStyle"] = $recipe->style->name;
|
||||
$vf["brewSource"] = $recipe->brewer;
|
||||
$vf["brewYield"] = $this->convertUnit($recipe->batchSize, "volume");
|
||||
$vf["brewNotes"] = strtr($recipe->notes, $string);
|
||||
$vf["brewMethod"] = $recipe->type;
|
||||
$counter["grain"] = 0;
|
||||
$counter["extract"] = 0;
|
||||
$counter["adjunct"] = 0;
|
||||
foreach($recipe->fermentables->fermentables as $fermentable){
|
||||
switch($fermentable->type){
|
||||
case "Grain":
|
||||
$counter["grain"]++;
|
||||
if($counter["grain"] <= 9){
|
||||
$vf["brewGrain" . $counter["grain"]] = $fermentable->name;
|
||||
$vf["brewGrain" . $counter["grain"] . "Weight"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
|
||||
}
|
||||
break;
|
||||
case "Extract":
|
||||
$counter["extract"]++;
|
||||
if($counter["extract"] <= 5){
|
||||
$vf["brewExtract" . $counter["extract"]] = $fermentable->name;
|
||||
$vf["brewExtract" . $counter["extract"] . "Weight"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
case "Dry Extract":
|
||||
$counter["extract"]++;
|
||||
if($counter["extract"] <= 5){
|
||||
$vf["brewExtract" . $counter["extract"]] = $fermentable->name;
|
||||
$vf["brewExtract" . $counter["extract"] . "Weight"] = $this->convertUnit($fermentable->amount,"weight"); ;
|
||||
}
|
||||
break;
|
||||
case "Adjunct":
|
||||
$counter["adjunct"]++;
|
||||
if($counter["adjunct"] <= 9){
|
||||
$vf["brewAddition" . $counter["adjunct"]] = $fermentable->name;
|
||||
$vf["brewAddition" . $counter["adjunct"] . "Amt"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
case "Sugar":
|
||||
$counter["adjunct"]++;
|
||||
if($counter["adjunct"] <= 9){
|
||||
$vf["brewAddition" . $counter["adjunct"]] = $fermentable->name;
|
||||
$vf["brewAddition" . $counter["adjunct"] . "Amt"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$counter["misc"] = 0;
|
||||
foreach($recipe->miscs->miscs as $misc){
|
||||
$counter["misc"]++;
|
||||
if($counter["misc"] <= 4){
|
||||
$vf["brewMisc" . $counter["misc"] . "Name"] = $misc->name;
|
||||
$vf["brewMisc" . $counter["misc"] . "Type"] = $misc->type; // BeerXML differntiates between liquid and volume - BB 2.2 does not - item for future release
|
||||
$vf["brewMisc" . $counter["misc"] . "Use"] = $misc->useFor;
|
||||
$vf["brewMisc" . $counter["misc"] . "Time"] = round($misc->time, 0);
|
||||
$vf["brewMisc" . $counter["misc"] . "Amount"] = round($misc->amount, 2); // Beer XML standard is kg or liters - will need to address in subsequent release
|
||||
}
|
||||
}
|
||||
|
||||
$counter["hops"] = 0;
|
||||
foreach($recipe->hops->hops as $hop){
|
||||
$counter["hops"]++;
|
||||
if($counter["hops"] <= 9){
|
||||
$vf["brewHops" . $counter["hops"]] = $hop->name;
|
||||
$vf["brewHops" . $counter["hops"] . "Weight"] = $this->convertUnit($hop->amount,"hopWeight");
|
||||
$vf["brewHops" . $counter["hops"] . "IBU"] = $hop->alpha;
|
||||
$vf["brewHops" . $counter["hops"] . "Time"] = round($hop->time, 0);
|
||||
$vf["brewHops" . $counter["hops"] . "Use"] = $hop->use;
|
||||
$vf["brewHops" . $counter["hops"] . "Type"] = $hop->type;
|
||||
$vf["brewHops" . $counter["hops"] . "Form"] = $hop->form;
|
||||
}
|
||||
}
|
||||
|
||||
$counter["yeast"] = 0;
|
||||
foreach($recipe->yeasts->yeasts as $yeast){
|
||||
$vf["brewYeast"] = $yeast->name;
|
||||
$vf["brewYeast" . "Man"] = $yeast->laboratory;
|
||||
$vf["brewYeast" . "Form"] = $yeast->form;
|
||||
$vf["brewYeast" . "Type"] = $yeast->type;
|
||||
if($yeast->amountIsWeight == "TRUE"){
|
||||
$vf["brewYeast" . "Amount"] = $this->convertUnit($yeast->amount,"weight");
|
||||
}else {
|
||||
$vf["brewYeast" . "Amount"] = $this->convertUnit($yeast->amount,"volume");
|
||||
}
|
||||
}
|
||||
|
||||
$vf["brewOG"] = $recipe->og; // changed_GH
|
||||
$vf["brewFG"] = $recipe->fg; // changed_GH
|
||||
// $vf["brewProcedure"] = $recipe->notes;
|
||||
if ($recipe->primaryAge != "") { $vf["brewPrimary"] = round($recipe->primaryAge, 0); }
|
||||
if ($recipe->primaryTemp != "") { $vf["brewPrimaryTemp"] = $this->convertUnit($recipe->primaryTemp,"temperature"); }
|
||||
if ($recipe->secondaryAge != "") { $vf["brewSecondary"] = round($recipe->secondaryAge, 0); }
|
||||
if ($recipe->secondaryTemp != "") { $vf["brewSecondaryTemp"] = $this->convertUnit($recipe->secondaryTemp,"temperature"); }
|
||||
if ($recipe->tertiaryAge != "") { $vf["brewTertiary"] = round($recipe->tertiaryAge, 0); }
|
||||
if ($recipe->tertiaryTemp != "") { $vf["brewTertiaryTemp"] = $this->convertUnit($recipe->tertiaryTemp,"temperature"); }
|
||||
if ($recipe->age != "") { $vf["brewAge"] = round($recipe->age, 0); }
|
||||
if ($recipe->ageTemp != "") { $vf["brewAgeTemp"] = $this->convertUnit($recipe->ageTemp,"temperature"); }
|
||||
if ($recipe->ibu != "") { $vf["brewBitterness"] = $recipe->ibu; }
|
||||
if ($recipe->estimatedColor != "") { $vf["brewLovibond"] = 0 . rtrim($recipe->estimatedColor," SRM"); }
|
||||
$vf["brewBrewerID"] = $GLOBALS['loginUsername']; // changed_GH to accomodate club edition
|
||||
|
||||
foreach($vf as $field=>$value){
|
||||
$fields .= "," . $field;
|
||||
$values .= ",'" . $value . "'";
|
||||
}
|
||||
|
||||
$fields .= ")";
|
||||
$values .= ")";
|
||||
$sqlQuery .= $fields . $values;
|
||||
// echo $sqlQuery . "<br />";
|
||||
mysql_select_db($GLOBALS['database_brewing'], $brewing) or die(mysql_error());
|
||||
$Result1 = mysql_query($sqlQuery, $brewing) or die(mysql_error());
|
||||
|
||||
$this->insertedRecipes[mysql_insert_id()] = $recipe->name;
|
||||
}
|
||||
//}}}
|
||||
|
||||
//{{{ insertBlogs
|
||||
function insertBlogs(){
|
||||
foreach($this->recipes->recipes as $recipe){
|
||||
$this->insertBlog($recipe);
|
||||
}
|
||||
return $this->insertedRecipes;
|
||||
}
|
||||
|
||||
//}
|
||||
//}}}
|
||||
|
||||
|
||||
//{{{ insertBlog
|
||||
function insertBlog($recipe){
|
||||
$brewing = mysql_connect($GLOBALS['hostname_brewblog'], $GLOBALS['username_brewblog'], $GLOBALS['password_brewblog']) or trigger_error(mysql_error());
|
||||
mysql_select_db($GLOBALS['database_brewing'], $brewing) or die(mysql_error());
|
||||
|
||||
$sqlQuery = "INSERT INTO brewing ";
|
||||
$fields = "(brewName";
|
||||
$values = " VALUES('" . htmlspecialchars($recipe->name, ENT_QUOTES) . "'";
|
||||
$vf = array();
|
||||
$counter = array();
|
||||
// $batchNumber = " SELECT brewBatchNum FROM `brewing` ORDER BY brewBatchNum DESC LIMIT 1 ";
|
||||
|
||||
//$vf["brewName"] = $recipe->name;
|
||||
$vf["brewStyle"] = $recipe->style->name;
|
||||
$dateCheck = datecharcheck($recipe->date);
|
||||
if ($dateCheck == "true") $vf["brewDate"] = dateconvert($recipe->date, "4");
|
||||
elseif ($dateCheck == "4-") $vf["brewDate"] = $recipe->date;
|
||||
else $vf["brewDate"] = date("Y-m-d");
|
||||
$vf["brewYield"] = $this->convertUnit($recipe->batchSize, "volume");
|
||||
$vf["brewComments"] = strtr($recipe->notes, $string);
|
||||
$vf["brewMethod"] = $recipe->type;
|
||||
$counter["grain"] = 0;
|
||||
$counter["extract"] = 0;
|
||||
$counter["adjunct"] = 0;
|
||||
foreach($recipe->fermentables->fermentables as $fermentable){
|
||||
switch($fermentable->type){
|
||||
case "Grain":
|
||||
$counter["grain"]++;
|
||||
if($counter["grain"] <= 9){
|
||||
$vf["brewGrain" . $counter["grain"]] = $fermentable->name;
|
||||
$vf["brewGrain" . $counter["grain"] . "Weight"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
case "Extract":
|
||||
$counter["extract"]++;
|
||||
if($counter["extract"] <= 5){
|
||||
$vf["brewExtract" . $counter["extract"]] = $fermentable->name;
|
||||
$vf["brewExtract" . $counter["extract"] . "Weight"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
case "Dry Extract":
|
||||
$counter["extract"]++;
|
||||
if($counter["extract"] <= 5){
|
||||
$vf["brewExtract" . $counter["extract"]] = $fermentable->name;
|
||||
$vf["brewExtract" . $counter["extract"] . "Weight"] = $this->convertUnit($fermentable->amount,"weight"); ;
|
||||
}
|
||||
break;
|
||||
case "Adjunct":
|
||||
$counter["adjunct"]++;
|
||||
if($counter["adjunct"] <= 9){
|
||||
$vf["brewAddition" . $counter["adjunct"]] = $fermentable->name;
|
||||
$vf["brewAddition" . $counter["adjunct"] . "Amt"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
case "Sugar":
|
||||
$counter["adjunct"]++;
|
||||
if($counter["adjunct"] <= 9){
|
||||
$vf["brewAddition" . $counter["adjunct"]] = $fermentable->name;
|
||||
$vf["brewAddition" . $counter["adjunct"] . "Amt"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$counter["misc"] = 0;
|
||||
foreach($recipe->miscs->miscs as $misc){
|
||||
$counter["misc"]++;
|
||||
if($counter["misc"] <= 4){
|
||||
$vf["brewMisc" . $counter["misc"] . "Name"] = $misc->name;
|
||||
$vf["brewMisc" . $counter["misc"] . "Type"] = $misc->type; // BeerXML differntiates between liquid and volume - BB 2.2 does not - item for future release
|
||||
$vf["brewMisc" . $counter["misc"] . "Use"] = $misc->useFor;
|
||||
$vf["brewMisc" . $counter["misc"] . "Time"] = round($misc->time, 0);
|
||||
$vf["brewMisc" . $counter["misc"] . "Amount"] = round($misc->amount, 2); // Beer XML standard is kg or liters - will need to address in subsequent release
|
||||
}
|
||||
}
|
||||
|
||||
$counter["hops"] = 0;
|
||||
foreach($recipe->hops->hops as $hop){
|
||||
$counter["hops"]++;
|
||||
if($counter["hops"] <= 9){
|
||||
$vf["brewHops" . $counter["hops"]] = $hop->name;
|
||||
$vf["brewHops" . $counter["hops"] . "Weight"] = $this->convertUnit($hop->amount,"hopWeight");
|
||||
$vf["brewHops" . $counter["hops"] . "IBU"] = $hop->alpha;
|
||||
$vf["brewHops" . $counter["hops"] . "Time"] = round($hop->time, 0);
|
||||
$vf["brewHops" . $counter["hops"] . "Use"] = $hop->use;
|
||||
$vf["brewHops" . $counter["hops"] . "Type"] = $hop->type;
|
||||
$vf["brewHops" . $counter["hops"] . "Form"] = $hop->form;
|
||||
}
|
||||
}
|
||||
|
||||
$counter["yeast"] = 0;
|
||||
foreach($recipe->yeasts->yeasts as $yeast){
|
||||
$vf["brewYeast"] = $yeast->name;
|
||||
$vf["brewYeast" . "Man"] = $yeast->laboratory;
|
||||
$vf["brewYeast" . "Form"] = $yeast->form;
|
||||
$vf["brewYeast" . "Type"] = $yeast->type;
|
||||
if($yeast->amountIsWeight == "TRUE"){
|
||||
$vf["brewYeast" . "Amount"] = $this->convertUnit($yeast->amount,"weight");
|
||||
} else {
|
||||
$vf["brewYeast" . "Amount"] = $this->convertUnit($yeast->amount,"volume");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
$counter["mash"] = 0;
|
||||
//$vf["brewMashGrainWeight"] = $recipe->mash->
|
||||
$vf["brewMashGrainTemp"] = $this->convertUnit($recipe->mash->grainTemp,"temperature");
|
||||
$vf["brewMashTunTemp"] = $this->convertUnit($recipe->mash->tunTemp,"temperature");
|
||||
$vf["brewMashPH"] = $recipe->mash->ph;
|
||||
$vf["brewMashGrainWeight"] = $totalGrainWeight;
|
||||
$vf["brewMashType"] = "Infusion"; // this is hard coded because it is the most common and the beerXML spec does not mention it
|
||||
$vf["brewMashEquipAdjust"] = $recipe->mash->equipAdjust; // FIELDS TO COMPLETE: spargeAmt
|
||||
$vf["brewMashSpargeTemp"] = $this->convertUnit($recipe->mash->spargeTemp,"temperature");
|
||||
$totalSpargeAmount = 0;
|
||||
foreach($recipe->mash->mashSteps as $mashStep){
|
||||
$counter["mash"]++;
|
||||
if($counter["mash"] <= 5){
|
||||
$vf["brewMashStep" . $counter["mash"] . "Name"] = $mashStep->name;
|
||||
$vf["brewMashStep" . $counter["mash"] . "Temp"] = $this->convertUnit($mashStep->stepTemp,"temperature");
|
||||
$vf["brewMashStep" . $counter["mash"] . "Time"] = $mashStep->stepTime;
|
||||
$vf["brewMashStep" . $counter["mash"] . "Desc"] = $mashStep->type;
|
||||
$totalSpargeAmount += $mashStep->infuseAmount;
|
||||
}
|
||||
}
|
||||
$vf["brewMashSpargAmt"] = round($this->convertUnit($totalSpargeAmount,"volume"),3);
|
||||
|
||||
foreach($recipe->waters->waters as $water){
|
||||
$vf["brewWaterName"] = $water->name;
|
||||
$vf["brewWaterAmount"] = $water->amount;
|
||||
$vf["brewWaterCalcium"] = $water->calcium;
|
||||
$vf["brewWaterBicarb"] = $water->bicarbonate;
|
||||
$vf["brewWaterSulfate"] = $water->sulfate;
|
||||
$vf["brewWaterChloride"] = $water->chloride;
|
||||
$vf["brewWaterMagnesium"] = $water->magnesium;
|
||||
$vf["brewWaterPH"] = $water->ph;
|
||||
$vf["brewWaterNotes"] = $water->notes;
|
||||
$vf["brewWaterSodium"] = $water->sodium;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
$vf["brewOG"] = $recipe->og; // changed_GH
|
||||
$vf["brewFG"] = $recipe->fg; // changed_GH
|
||||
$vf["brewComments"] = strtr($recipe->notes, $string);
|
||||
if ($recipe->primaryAge != "") { $vf["brewPrimary"] = round($recipe->primaryAge, 0); }
|
||||
if ($recipe->primaryTemp != "") { $vf["brewPrimaryTemp"] = $this->convertUnit($recipe->primaryTemp,"temperature"); }
|
||||
if ($recipe->secondaryAge != "") { $vf["brewSecondary"] = round($recipe->secondaryAge, 0); }
|
||||
if ($recipe->secondaryTemp != "") { $vf["brewSecondaryTemp"] = $this->convertUnit($recipe->secondaryTemp,"temperature"); }
|
||||
if ($recipe->tertiaryAge != "") { $vf["brewTertiary"] = round($recipe->tertiaryAge, 0); }
|
||||
if ($recipe->tertiaryTemp != "") { $vf["brewTertiaryTemp"] = $this->convertUnit($recipe->tertiaryTemp,"temperature"); }
|
||||
if ($recipe->age != "") { $vf["brewAge"] = round($recipe->age, 0); }
|
||||
if ($recipe->ageTemp != "") { $vf["brewAgeTemp"] = $this->convertUnit($recipe->ageTemp,"temperature"); }
|
||||
if ($recipe->ibu != "") { $vf["brewBitterness"] = $recipe->ibu; }
|
||||
if ($recipe->estimatedColor != "") { $vf["brewLovibond"] = 0 . rtrim($recipe->estimatedColor," SRM"); }
|
||||
$vf["brewBrewerID"] = $GLOBALS['loginUsername'];
|
||||
if ($recipe->efficiency != "") { $vf["brewEfficiency"] = $recipe->efficiency; }
|
||||
if ($recipe->boilSize != "") { $vf["brewPreBoilAmt"] = $this->convertUnit($recipe->boilSize,"volume"); } // changed_GH to accomodate club edition
|
||||
|
||||
foreach($vf as $field=>$value){
|
||||
$fields .= "," . $field;
|
||||
$values .= ",'" . $value . "'";
|
||||
}
|
||||
|
||||
$fields .= ")";
|
||||
$values .= ")";
|
||||
$sqlQuery .= $fields . $values;
|
||||
//echo $sqlQuery . "<br />";
|
||||
$Result1 = mysql_query($sqlQuery, $brewing) or die(mysql_error());
|
||||
|
||||
$this->insertedRecipes[mysql_insert_id()] = $recipe->name;
|
||||
}
|
||||
}
|
||||
|
||||
//}}}
|
||||
//}}}
|
||||
//}}}
|
||||
//}}}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
|
||||
|
||||
//{{{ License
|
||||
// +------------------------------------------------------------------------+
|
||||
// | Input Beer XML - takes recipe objects from BeerXMLParser |
|
||||
// | and inserts recipes into database |
|
||||
// | |
|
||||
// | NOTES - Augmented by Geoff Humphrey for use in BrewBlogger 2.3 |
|
||||
// | <brewmeister@brewblogger.net> |
|
||||
// | - Added conversion variables based upon BB preferences |
|
||||
// | - Beer XML standards are in Metric for weight/volume, C for temp |
|
||||
// +------------------------------------------------------------------------+
|
||||
// | This program is free software; you can redistribute it and/or |
|
||||
// | modify it under the terms of the GNU General Public License |
|
||||
// | as published by the Free Software Foundation; either version 2 |
|
||||
// | of the License, or (at your option) any later version. |
|
||||
// | |
|
||||
// | This program is distributed in the hope that it will be useful, |
|
||||
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
// | GNU General Public License for more details. |
|
||||
// | |
|
||||
// | You should have received a copy of the GNU General Public License |
|
||||
// | along with this program; if not, write to the Free Software |
|
||||
// | Foundation, Inc., 59 Temple Place - Suite 330, |
|
||||
// | Boston, MA 02111-1307, USA. |
|
||||
// +------------------------------------------------------------------------+
|
||||
// | Author: Oskar Stephens <oskar.stephens@gmail.com> |
|
||||
// +------------------------------------------------------------------------+
|
||||
//}}}
|
||||
include ('parse_beer_xml.inc.php');
|
||||
//{{{ InputBeerXML
|
||||
class InputBeerXML {
|
||||
public $recipes;
|
||||
public $insertedRecipes;
|
||||
public $brewer;
|
||||
//{{{InputBeerXML
|
||||
function InputBeerXML($filename) {
|
||||
$this->brewer = $GLOBALS['loginUsername'];
|
||||
$this->recipes = new BeerXMLParser($filename);
|
||||
}
|
||||
//}}}
|
||||
|
||||
//{{{ convertUnit()
|
||||
function convertUnit($value,$type){
|
||||
include('../Connections/config.php');
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_pref_xml = "SELECT measWeight1,measTemp,measFluid2,measWeight2 FROM preferences";
|
||||
$pref_xml = mysql_query($query_pref_xml, $brewing) or die(mysql_error());
|
||||
$row_pref_xml = mysql_fetch_assoc($pref_xml);
|
||||
$totalRows_pref_xml = mysql_num_rows($pref_xml);
|
||||
|
||||
switch($type){
|
||||
case "hopWeight";
|
||||
if ($row_pref_xml['measWeight1'] == "grams") return round($value * 1000, 2);
|
||||
else return round($value * 35.27396, 2);
|
||||
case "temperature":
|
||||
if ($row_pref_xml['measTemp'] == "F") return round (($value * 1.8) + 32, 0);
|
||||
else return round($value, 0);
|
||||
case "volume":
|
||||
if ($row_pref_xml['measFluid2'] == "gallons") return round($value * 0.26417, 1);
|
||||
else return round($value, 1);
|
||||
case "weight":
|
||||
if ($row_pref_xml['measWeight2'] == "pounds") return round($value * 2.20462, 2);
|
||||
else return round($value, 2);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
//}}}
|
||||
|
||||
|
||||
//{{{ insertRecipes
|
||||
function insertRecipes(){
|
||||
foreach($this->recipes->recipes as $recipe){
|
||||
$this->insertRecipe($recipe);
|
||||
}
|
||||
return $this->insertedRecipes;
|
||||
}
|
||||
//}}}
|
||||
|
||||
//{{{ insertRecipe
|
||||
function insertRecipe($recipe){ // inserts into `recipes` DB table
|
||||
include ('../includes/scrubber.inc.php');
|
||||
$brewing = mysql_connect($GLOBALS['hostname_brewblog'], $GLOBALS['username_brewblog'], $GLOBALS['password_brewblog']) or trigger_error(mysql_error());
|
||||
$sqlQuery = "INSERT INTO recipes ";
|
||||
$fields = "(brewName";
|
||||
$values = " VALUES('" . strtr($recipe->name, $html_string) . "'";
|
||||
$vf = array();
|
||||
$counter = array();
|
||||
//$vf["brewName"] = $this->strtr($recipe->name, $html_string);
|
||||
$vf["brewStyle"] = $recipe->style->name;
|
||||
$vf["brewSource"] = $recipe->brewer;
|
||||
$vf["brewYield"] = $this->convertUnit($recipe->batchSize, "volume");
|
||||
$vf["brewNotes"] = strtr($recipe->notes, $html_string);
|
||||
$vf["brewMethod"] = $recipe->type;
|
||||
$counter["grain"] = 0;
|
||||
$counter["extract"] = 0;
|
||||
$counter["adjunct"] = 0;
|
||||
foreach($recipe->fermentables->fermentables as $fermentable){
|
||||
switch($fermentable->type){
|
||||
case "Grain":
|
||||
$counter["grain"]++;
|
||||
if($counter["grain"] <= 9){
|
||||
$vf["brewGrain" . $counter["grain"]] = strtr($fermentable->name, $html_string);
|
||||
$vf["brewGrain" . $counter["grain"] . "Weight"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
|
||||
}
|
||||
break;
|
||||
case "Extract":
|
||||
$counter["extract"]++;
|
||||
if($counter["extract"] <= 5){
|
||||
$vf["brewExtract" . $counter["extract"]] = strtr($fermentable->name, $html_string);
|
||||
$vf["brewExtract" . $counter["extract"] . "Weight"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
case "Dry Extract":
|
||||
$counter["extract"]++;
|
||||
if($counter["extract"] <= 5){
|
||||
$vf["brewExtract" . $counter["extract"]] = strtr($fermentable->name, $html_string);
|
||||
$vf["brewExtract" . $counter["extract"] . "Weight"] = $this->convertUnit($fermentable->amount,"weight"); ;
|
||||
}
|
||||
break;
|
||||
case "Adjunct":
|
||||
$counter["adjunct"]++;
|
||||
if($counter["adjunct"] <= 9){
|
||||
$vf["brewAddition" . $counter["adjunct"]] = strtr($fermentable->name, $html_string);
|
||||
$vf["brewAddition" . $counter["adjunct"] . "Amt"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
case "Sugar":
|
||||
$counter["adjunct"]++;
|
||||
if($counter["adjunct"] <= 9){
|
||||
$vf["brewAddition" . $counter["adjunct"]] = strtr($fermentable->name, $html_string);
|
||||
$vf["brewAddition" . $counter["adjunct"] . "Amt"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$counter["misc"] = 0;
|
||||
foreach($recipe->miscs->miscs as $misc){
|
||||
$counter["misc"]++;
|
||||
if($counter["misc"] <= 4){
|
||||
$vf["brewMisc" . $counter["misc"] . "Name"] = strtr($misc->name, $html_string);
|
||||
$vf["brewMisc" . $counter["misc"] . "Type"] = $misc->type; // BeerXML differntiates between liquid and volume - BB 2.2 does not - item for future release
|
||||
$vf["brewMisc" . $counter["misc"] . "Use"] = $misc->useFor;
|
||||
$vf["brewMisc" . $counter["misc"] . "Time"] = round($misc->time, 0);
|
||||
$vf["brewMisc" . $counter["misc"] . "Amount"] = round($misc->amount, 2); // Beer XML standard is kg or liters - will need to address in subsequent release
|
||||
}
|
||||
}
|
||||
|
||||
$counter["hops"] = 0;
|
||||
foreach($recipe->hops->hops as $hop){
|
||||
$counter["hops"]++;
|
||||
if($counter["hops"] <= 9){
|
||||
$vf["brewHops" . $counter["hops"]] = strtr($hop->name, $html_string);
|
||||
$vf["brewHops" . $counter["hops"] . "Weight"] = $this->convertUnit($hop->amount,"hopWeight");
|
||||
$vf["brewHops" . $counter["hops"] . "IBU"] = $hop->alpha;
|
||||
$vf["brewHops" . $counter["hops"] . "Time"] = round($hop->time, 0);
|
||||
$vf["brewHops" . $counter["hops"] . "Use"] = $hop->use;
|
||||
$vf["brewHops" . $counter["hops"] . "Type"] = $hop->type;
|
||||
$vf["brewHops" . $counter["hops"] . "Form"] = $hop->form;
|
||||
}
|
||||
}
|
||||
|
||||
$counter["yeast"] = 0;
|
||||
foreach($recipe->yeasts->yeasts as $yeast){
|
||||
$vf["brewYeast"] = strtr($yeast->name, $html_string);
|
||||
$vf["brewYeast" . "Man"] = $yeast->laboratory;
|
||||
$vf["brewYeast" . "Form"] = $yeast->form;
|
||||
$vf["brewYeast" . "Type"] = $yeast->type;
|
||||
if($yeast->amountIsWeight == "TRUE"){
|
||||
$vf["brewYeast" . "Amount"] = $this->convertUnit($yeast->amount,"weight");
|
||||
}else {
|
||||
$vf["brewYeast" . "Amount"] = $this->convertUnit($yeast->amount,"volume");
|
||||
}
|
||||
}
|
||||
|
||||
$vf["brewOG"] = $recipe->og; // changed_GH
|
||||
$vf["brewFG"] = $recipe->fg; // changed_GH
|
||||
// $vf["brewProcedure"] = $recipe->notes;
|
||||
if ($recipe->primaryAge != "") { $vf["brewPrimary"] = round($recipe->primaryAge, 0); }
|
||||
if ($recipe->primaryTemp != "") { $vf["brewPrimaryTemp"] = $this->convertUnit($recipe->primaryTemp,"temperature"); }
|
||||
if ($recipe->secondaryAge != "") { $vf["brewSecondary"] = round($recipe->secondaryAge, 0); }
|
||||
if ($recipe->secondaryTemp != "") { $vf["brewSecondaryTemp"] = $this->convertUnit($recipe->secondaryTemp,"temperature"); }
|
||||
if ($recipe->tertiaryAge != "") { $vf["brewTertiary"] = round($recipe->tertiaryAge, 0); }
|
||||
if ($recipe->tertiaryTemp != "") { $vf["brewTertiaryTemp"] = $this->convertUnit($recipe->tertiaryTemp,"temperature"); }
|
||||
if ($recipe->age != "") { $vf["brewAge"] = round($recipe->age, 0); }
|
||||
if ($recipe->ageTemp != "") { $vf["brewAgeTemp"] = $this->convertUnit($recipe->ageTemp,"temperature"); }
|
||||
if ($recipe->ibu != "") { $vf["brewBitterness"] = $recipe->ibu; }
|
||||
if ($recipe->estimatedColor != "") { $vf["brewLovibond"] = 0 . rtrim($recipe->estimatedColor," SRM"); }
|
||||
$vf["brewBrewerID"] = $GLOBALS['loginUsername']; // changed_GH to accomodate club edition
|
||||
|
||||
foreach($vf as $field=>$value){
|
||||
$fields .= "," . $field;
|
||||
$values .= ",'" . $value . "'";
|
||||
}
|
||||
|
||||
$fields .= ")";
|
||||
$values .= ")";
|
||||
$sqlQuery .= $fields . $values;
|
||||
// echo $sqlQuery . "<br />";
|
||||
mysql_select_db($GLOBALS['database_brewing'], $brewing) or die(mysql_error());
|
||||
$Result1 = mysql_query($sqlQuery, $brewing) or die(mysql_error());
|
||||
|
||||
$this->insertedRecipes[mysql_insert_id()] = $recipe->name;
|
||||
}
|
||||
//}}}
|
||||
|
||||
//{{{ insertBlogs
|
||||
function insertBlogs(){
|
||||
foreach($this->recipes->recipes as $recipe){
|
||||
$this->insertBlog($recipe);
|
||||
}
|
||||
return $this->insertedRecipes;
|
||||
}
|
||||
|
||||
//}
|
||||
//}}}
|
||||
|
||||
|
||||
//{{{ insertBlog
|
||||
function insertBlog($recipe){
|
||||
include ('../includes/scrubber.inc.php');
|
||||
$brewing = mysql_connect($GLOBALS['hostname_brewblog'], $GLOBALS['username_brewblog'], $GLOBALS['password_brewblog']) or trigger_error(mysql_error());
|
||||
mysql_select_db($GLOBALS['database_brewing'], $brewing) or die(mysql_error());
|
||||
|
||||
$sqlQuery = "INSERT INTO brewing ";
|
||||
$fields = "(brewName";
|
||||
$values = " VALUES('" . strtr($recipe->name, $html_string) . "'";
|
||||
$vf = array();
|
||||
$counter = array();
|
||||
// $batchNumber = " SELECT brewBatchNum FROM `brewing` ORDER BY brewBatchNum DESC LIMIT 1 ";
|
||||
|
||||
//$vf["brewName"] = $recipe->name;
|
||||
$vf["brewStyle"] = $recipe->style->name;
|
||||
$dateCheck = datecharcheck($recipe->date);
|
||||
if ($dateCheck == "true") $vf["brewDate"] = dateconvert($recipe->date, "4");
|
||||
elseif ($dateCheck == "4-") $vf["brewDate"] = $recipe->date;
|
||||
else $vf["brewDate"] = date("Y-m-d");
|
||||
$vf["brewYield"] = $this->convertUnit($recipe->batchSize, "volume");
|
||||
$vf["brewComments"] = strtr($recipe->notes, $html_string);
|
||||
$vf["brewMethod"] = $recipe->type;
|
||||
$counter["grain"] = 0;
|
||||
$counter["extract"] = 0;
|
||||
$counter["adjunct"] = 0;
|
||||
foreach($recipe->fermentables->fermentables as $fermentable){
|
||||
switch($fermentable->type){
|
||||
case "Grain":
|
||||
$counter["grain"]++;
|
||||
if($counter["grain"] <= 9){
|
||||
$vf["brewGrain" . $counter["grain"]] = strtr($fermentable->name, $html_string);
|
||||
$vf["brewGrain" . $counter["grain"] . "Weight"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
case "Extract":
|
||||
$counter["extract"]++;
|
||||
if($counter["extract"] <= 5){
|
||||
$vf["brewExtract" . $counter["extract"]] = strtr($fermentable->name, $html_string);
|
||||
$vf["brewExtract" . $counter["extract"] . "Weight"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
case "Dry Extract":
|
||||
$counter["extract"]++;
|
||||
if($counter["extract"] <= 5){
|
||||
$vf["brewExtract" . $counter["extract"]] = strtr($fermentable->name, $html_string);
|
||||
$vf["brewExtract" . $counter["extract"] . "Weight"] = $this->convertUnit($fermentable->amount,"weight"); ;
|
||||
}
|
||||
break;
|
||||
case "Adjunct":
|
||||
$counter["adjunct"]++;
|
||||
if($counter["adjunct"] <= 9){
|
||||
$vf["brewAddition" . $counter["adjunct"]] = strtr($fermentable->name, $html_string);
|
||||
$vf["brewAddition" . $counter["adjunct"] . "Amt"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
case "Sugar":
|
||||
$counter["adjunct"]++;
|
||||
if($counter["adjunct"] <= 9){
|
||||
$vf["brewAddition" . $counter["adjunct"]] = strtr($fermentable->name, $html_string);
|
||||
$vf["brewAddition" . $counter["adjunct"] . "Amt"] = $this->convertUnit($fermentable->amount,"weight");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$counter["misc"] = 0;
|
||||
foreach($recipe->miscs->miscs as $misc){
|
||||
$counter["misc"]++;
|
||||
if($counter["misc"] <= 4){
|
||||
$vf["brewMisc" . $counter["misc"] . "Name"] = strtr($misc->name, $html_string);
|
||||
$vf["brewMisc" . $counter["misc"] . "Type"] = $misc->type; // BeerXML differntiates between liquid and volume - BB 2.2 does not - item for future release
|
||||
$vf["brewMisc" . $counter["misc"] . "Use"] = $misc->useFor;
|
||||
$vf["brewMisc" . $counter["misc"] . "Time"] = round($misc->time, 0);
|
||||
$vf["brewMisc" . $counter["misc"] . "Amount"] = round($misc->amount, 2); // Beer XML standard is kg or liters - will need to address in subsequent release
|
||||
}
|
||||
}
|
||||
|
||||
$counter["hops"] = 0;
|
||||
foreach($recipe->hops->hops as $hop){
|
||||
$counter["hops"]++;
|
||||
if($counter["hops"] <= 9){
|
||||
$vf["brewHops" . $counter["hops"]] = strtr($hop->name, $html_string);
|
||||
$vf["brewHops" . $counter["hops"] . "Weight"] = $this->convertUnit($hop->amount,"hopWeight");
|
||||
$vf["brewHops" . $counter["hops"] . "IBU"] = $hop->alpha;
|
||||
$vf["brewHops" . $counter["hops"] . "Time"] = round($hop->time, 0);
|
||||
$vf["brewHops" . $counter["hops"] . "Use"] = $hop->use;
|
||||
$vf["brewHops" . $counter["hops"] . "Type"] = $hop->type;
|
||||
$vf["brewHops" . $counter["hops"] . "Form"] = $hop->form;
|
||||
}
|
||||
}
|
||||
|
||||
$counter["yeast"] = 0;
|
||||
foreach($recipe->yeasts->yeasts as $yeast){
|
||||
$vf["brewYeast"] = strtr($yeast->name, $html_string);
|
||||
$vf["brewYeast" . "Man"] = $yeast->laboratory;
|
||||
$vf["brewYeast" . "Form"] = $yeast->form;
|
||||
$vf["brewYeast" . "Type"] = $yeast->type;
|
||||
if($yeast->amountIsWeight == "TRUE"){
|
||||
$vf["brewYeast" . "Amount"] = $this->convertUnit($yeast->amount,"weight");
|
||||
} else {
|
||||
$vf["brewYeast" . "Amount"] = $this->convertUnit($yeast->amount,"volume");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$counter["mash"] = 0;
|
||||
//$vf["brewMashGrainWeight"] = $recipe->mash->
|
||||
$vf["brewMashGrainTemp"] = $this->convertUnit($recipe->mash->grainTemp,"temperature");
|
||||
$vf["brewMashTunTemp"] = $this->convertUnit($recipe->mash->tunTemp,"temperature");
|
||||
$vf["brewMashPH"] = $recipe->mash->ph;
|
||||
$vf["brewMashGrainWeight"] = $totalGrainWeight;
|
||||
$vf["brewMashType"] = "Infusion"; // this is hard coded because it is the most common and the beerXML spec does not mention it
|
||||
$vf["brewMashEquipAdjust"] = $recipe->mash->equipAdjust; // FIELDS TO COMPLETE: spargeAmt
|
||||
$vf["brewMashSpargeTemp"] = $this->convertUnit($recipe->mash->spargeTemp,"temperature");
|
||||
$totalSpargeAmount = 0;
|
||||
foreach($recipe->mash->mashSteps as $mashStep){
|
||||
$counter["mash"]++;
|
||||
if($counter["mash"] <= 5){
|
||||
$vf["brewMashStep" . $counter["mash"] . "Name"] = strtr($mashStep->name, $html_string);
|
||||
$vf["brewMashStep" . $counter["mash"] . "Temp"] = $this->convertUnit($mashStep->stepTemp,"temperature");
|
||||
$vf["brewMashStep" . $counter["mash"] . "Time"] = $mashStep->stepTime;
|
||||
$vf["brewMashStep" . $counter["mash"] . "Desc"] = $mashStep->type;
|
||||
$totalSpargeAmount += $mashStep->infuseAmount;
|
||||
}
|
||||
}
|
||||
$vf["brewMashSpargAmt"] = round($this->convertUnit($totalSpargeAmount,"volume"),3);
|
||||
|
||||
foreach($recipe->waters->waters as $water){
|
||||
$vf["brewWaterName"] = strtr($water->name, $html_string);
|
||||
$vf["brewWaterAmount"] = $water->amount;
|
||||
$vf["brewWaterCalcium"] = $water->calcium;
|
||||
$vf["brewWaterBicarb"] = $water->bicarbonate;
|
||||
$vf["brewWaterSulfate"] = $water->sulfate;
|
||||
$vf["brewWaterChloride"] = $water->chloride;
|
||||
$vf["brewWaterMagnesium"] = $water->magnesium;
|
||||
$vf["brewWaterPH"] = $water->ph;
|
||||
$vf["brewWaterNotes"] = $water->notes;
|
||||
$vf["brewWaterSodium"] = $water->sodium;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$vf["brewOG"] = $recipe->og; // changed_GH
|
||||
$vf["brewFG"] = $recipe->fg; // changed_GH
|
||||
$vf["brewComments"] = strtr($recipe->notes, $html_string);
|
||||
if ($recipe->primaryAge != "") { $vf["brewPrimary"] = round($recipe->primaryAge, 0); }
|
||||
if ($recipe->primaryTemp != "") { $vf["brewPrimaryTemp"] = $this->convertUnit($recipe->primaryTemp,"temperature"); }
|
||||
if ($recipe->secondaryAge != "") { $vf["brewSecondary"] = round($recipe->secondaryAge, 0); }
|
||||
if ($recipe->secondaryTemp != "") { $vf["brewSecondaryTemp"] = $this->convertUnit($recipe->secondaryTemp,"temperature"); }
|
||||
if ($recipe->tertiaryAge != "") { $vf["brewTertiary"] = round($recipe->tertiaryAge, 0); }
|
||||
if ($recipe->tertiaryTemp != "") { $vf["brewTertiaryTemp"] = $this->convertUnit($recipe->tertiaryTemp,"temperature"); }
|
||||
if ($recipe->age != "") { $vf["brewAge"] = round($recipe->age, 0); }
|
||||
if ($recipe->ageTemp != "") { $vf["brewAgeTemp"] = $this->convertUnit($recipe->ageTemp,"temperature"); }
|
||||
if ($recipe->ibu != "") { $vf["brewBitterness"] = $recipe->ibu; }
|
||||
if ($recipe->estimatedColor != "") { $vf["brewLovibond"] = 0 . rtrim($recipe->estimatedColor," SRM"); }
|
||||
$vf["brewBrewerID"] = $GLOBALS['loginUsername'];
|
||||
if ($recipe->efficiency != "") { $vf["brewEfficiency"] = $recipe->efficiency; }
|
||||
if ($recipe->boilSize != "") { $vf["brewPreBoilAmt"] = $this->convertUnit($recipe->boilSize,"volume"); } // changed_GH to accomodate club edition
|
||||
|
||||
foreach($vf as $field=>$value){
|
||||
$fields .= "," . $field;
|
||||
$values .= ",'" . $value . "'";
|
||||
}
|
||||
|
||||
$fields .= ")";
|
||||
$values .= ")";
|
||||
$sqlQuery .= $fields . $values;
|
||||
//echo $sqlQuery . "<br />";
|
||||
$Result1 = mysql_query($sqlQuery, $brewing) or die(mysql_error());
|
||||
|
||||
$this->insertedRecipes[mysql_insert_id()] = $recipe->name;
|
||||
}
|
||||
}
|
||||
|
||||
//}}}
|
||||
//}}}
|
||||
//}}}
|
||||
//}}}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,26 +1,75 @@
|
||||
<?php
|
||||
$query_sugarPPG1 = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_malt1['maltYield']);
|
||||
$sugarPPG1 = mysql_query($query_sugarPPG1, $brewing) or die(mysql_error());
|
||||
$row_sugarPPG1 = mysql_fetch_assoc($sugarPPG1);
|
||||
|
||||
$query_sugarPPG2 = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_malt2['maltYield']);
|
||||
$sugarPPG2 = mysql_query($query_sugarPPG2, $brewing) or die(mysql_error());
|
||||
$row_sugarPPG2 = mysql_fetch_assoc($sugarPPG2);
|
||||
|
||||
$query_sugarPPG3 = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_malt3['maltYield']);
|
||||
$sugarPPG3 = mysql_query($query_sugarPPG3, $brewing) or die(mysql_error());
|
||||
$row_sugarPPG3 = mysql_fetch_assoc($sugarPPG1);
|
||||
|
||||
$query_sugarPPG4 = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_malt4['maltYield']);
|
||||
$sugarPPG4 = mysql_query($query_sugarPPG4, $brewing) or die(mysql_error());
|
||||
$row_sugarPPG4 = mysql_fetch_assoc($sugarPPG4);
|
||||
|
||||
$query_sugarPPG5 = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_malt5['maltYield']);
|
||||
$sugarPPG5 = mysql_query($query_sugarPPG5, $brewing) or die(mysql_error());
|
||||
$row_sugarPPG5 = mysql_fetch_assoc($sugarPPG5);
|
||||
|
||||
$query_sugarPPG6 = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_malt6['maltYield']);
|
||||
$sugarPPG6 = mysql_query($query_sugarPPG6, $brewing) or die(mysql_error());
|
||||
$row_sugarPPG6 = mysql_fetch_assoc($sugarPPG6);
|
||||
|
||||
$query_sugarPPG7 = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_malt7['maltYield']);
|
||||
$sugarPPG7 = mysql_query($query_sugarPPG7, $brewing) or die(mysql_error());
|
||||
$row_sugarPPG7 = mysql_fetch_assoc($sugarPPG7);
|
||||
|
||||
$query_sugarPPG8 = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_malt8['maltYield']);
|
||||
$sugarPPG8 = mysql_query($query_sugarPPG8, $brewing) or die(mysql_error());
|
||||
$row_sugarPPG8 = mysql_fetch_assoc($sugarPPG8);
|
||||
|
||||
$query_sugarPPG9 = sprintf("SELECT sugarPPG FROM sugar_type WHERE id='%s'", $row_malt9['maltYield']);
|
||||
$sugarPPG9 = mysql_query($query_sugarPPG9, $brewing) or die(mysql_error());
|
||||
$row_sugarPPG9 = mysql_fetch_assoc($sugarPPG9);
|
||||
|
||||
$gravity = $row_log['brewMashGravity'];
|
||||
$wort = $row_log['brewPreBoilAmt'];
|
||||
$grain = $totalGrain;
|
||||
$grain1 = $row_malt1['maltYield'];
|
||||
$grain1 = $row_sugarPPG1['sugarPPG'];
|
||||
$grain1amt = $row_log['brewGrain1Weight'];
|
||||
$grain2 = $row_malt2['maltYield'];
|
||||
$grain2 = $row_sugarPPG2['sugarPPG'];
|
||||
$grain2amt = $row_log['brewGrain2Weight'];
|
||||
$grain3 = $row_malt3['maltYield'];;
|
||||
$grain3 = $row_sugarPPG3['sugarPPG'];;
|
||||
$grain3amt = $row_log['brewGrain3Weight'];
|
||||
$grain4 = $row_malt4['maltYield'];
|
||||
$grain4 = $row_sugarPPG4['sugarPPG'];
|
||||
$grain4amt = $row_log['brewGrain4Weight'];
|
||||
$grain5 = $row_malt5['maltYield'];
|
||||
$grain5 = $row_sugarPPG5['sugarPPG'];
|
||||
$grain5amt = $row_log['brewGrain5Weight'];
|
||||
$grain6 = $row_malt6['maltYield'];
|
||||
$grain6 = $row_sugarPPG6['sugarPPG'];
|
||||
$grain6amt = $row_log['brewGrain6Weight'];
|
||||
$grain7 = $row_malt7['maltYield'];
|
||||
$grain7 = $row_sugarPPG7['sugarPPG'];
|
||||
$grain7amt = $row_log['brewGrain7Weight'];
|
||||
$grain8 = $row_malt8['maltYield'];
|
||||
$grain8 = $row_sugarPPG8['sugarPPG'];
|
||||
$grain8amt = $row_log['brewGrain8Weight'];
|
||||
$grain9 = $row_malt9['maltYield'];
|
||||
$grain9 = $row_sugarPPG9['sugarPPG'];
|
||||
$grain9amt = $row_log['brewGrain9Weight'];
|
||||
$units = $row_pref['measFluid2'];
|
||||
/*
|
||||
echo $gravity."<br>";
|
||||
echo $wort."<br>";
|
||||
echo $grain1." ".$grain1amt."<br>";
|
||||
echo $grain2." ".$grain2amt."<br>";
|
||||
echo $grain3." ".$grain3amt."<br>";
|
||||
echo $grain4." ".$grain4amt."<br>";
|
||||
echo $grain5." ".$grain5amt."<br>";
|
||||
echo $grain6." ".$grain6amt."<br>";
|
||||
echo $grain7." ".$grain7amt."<br>";
|
||||
echo $grain8." ".$grain8amt."<br>";
|
||||
echo $grain9." ".$grain9amt."<br>";;
|
||||
*/
|
||||
|
||||
$ogconvert = ($gravity - 1) * 1000;
|
||||
$ppg = ($ogconvert * $wort) / $grain;
|
||||
@@ -60,10 +109,33 @@ switch ($units)
|
||||
$grain9calc = ($grain9 * ($grain9amt * 2.202))/($wort * .264);
|
||||
break;
|
||||
}
|
||||
$efficiency_sum = ($grain1calc + $grain2calc + $grain3calc + $grain4calc + $grain5calc + $grain6calc + $grain7calc + $grain8calc + $grain9calc);
|
||||
$efficiency_sum = (
|
||||
$grain1calc +
|
||||
$grain2calc +
|
||||
$grain3calc +
|
||||
$grain4calc +
|
||||
$grain5calc +
|
||||
$grain6calc +
|
||||
$grain7calc +
|
||||
$grain8calc +
|
||||
$grain9calc
|
||||
);
|
||||
if (($efficiency_sum != 0) && ($gravity != "")) {
|
||||
$efficiency = ($ogconvert / $efficiency_sum) * 100;
|
||||
}
|
||||
|
||||
/*
|
||||
echo $ogconvert."<br>";
|
||||
echo $efficiency_sum."<br>";
|
||||
echo $grain1calc."<br>";
|
||||
echo $grain2calc."<br>";
|
||||
echo $grain3calc."<br>";
|
||||
echo $grain4calc."<br>";
|
||||
echo $grain5calc."<br>";
|
||||
echo $grain6calc."<br>";
|
||||
echo $grain7calc."<br>";
|
||||
echo $grain8calc."<br>";
|
||||
echo $grain9calc."<br>";
|
||||
echo $efficiency;
|
||||
*/
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,33 +1,65 @@
|
||||
<?php
|
||||
// ---------------------------- Scrubber --------------------------------------------------------------------
|
||||
$string = array(
|
||||
chr(38) => "&",
|
||||
chr(60) => "<",
|
||||
chr(62) => ">",
|
||||
chr(34) => """,
|
||||
chr(35) => "#",
|
||||
chr(39) => "'",
|
||||
chr(176) => "°"
|
||||
);
|
||||
|
||||
$html_string = array(
|
||||
chr(38) => "&",
|
||||
chr(60) => "<",
|
||||
chr(62) => ">",
|
||||
chr(34) => """,
|
||||
chr(39) => "’",
|
||||
"'" => "’",
|
||||
chr(176) => "°"
|
||||
);
|
||||
|
||||
$html_remove = array(
|
||||
"&" => "",
|
||||
"<" => "",
|
||||
">" => "",
|
||||
""" => "",
|
||||
"’" => "",
|
||||
"'" => "",
|
||||
"°" => ""
|
||||
);
|
||||
|
||||
<?php
|
||||
// ---------------------------- Scrubber --------------------------------------------------------------------
|
||||
$string = array(
|
||||
chr(38) => "&",
|
||||
chr(60) => "<",
|
||||
chr(62) => ">",
|
||||
chr(34) => """,
|
||||
chr(35) => "#",
|
||||
chr(39) => "'",
|
||||
chr(176) => "°"
|
||||
);
|
||||
|
||||
$html_string = array(
|
||||
chr(38) => "&",
|
||||
chr(60) => "<",
|
||||
chr(62) => ">",
|
||||
chr(34) => """,
|
||||
chr(39) => "’",
|
||||
chr(37) => "",
|
||||
"'" => "’",
|
||||
"'" => "’",
|
||||
chr(176) => "°",
|
||||
"“" => "“", // left side double smart quote
|
||||
"”" => "”", // right side double smart quote
|
||||
"‘" => "‘", // left side single smart quote
|
||||
"’" => "’", // right side single smart quote
|
||||
"…" => "...", // elipsis
|
||||
"—" => "—", // em dash
|
||||
"–" => "–", // en dash
|
||||
);
|
||||
|
||||
$html_remove = array(
|
||||
"&" => "&",
|
||||
"<" => "<",
|
||||
">" => ">",
|
||||
""" => "\"",
|
||||
"’" => "'",
|
||||
"”" => "\"",
|
||||
"“" => "\"",
|
||||
"‘" => "'",
|
||||
"'" => "\"",
|
||||
"°" => "",
|
||||
"“" => "\"", // left side double smart quote
|
||||
"”" => "\"", // right side double smart quote
|
||||
"‘" => "'", // left side single smart quote
|
||||
"’" => "'", // right side single smart quote
|
||||
"…" => "...", // elipsis
|
||||
"—" => "--", // em dash
|
||||
"–" => "-", // en dash
|
||||
);
|
||||
|
||||
$space_remove = array(
|
||||
"&" => "",
|
||||
"<" => "",
|
||||
">" => "",
|
||||
""" => "",
|
||||
"’" => "",
|
||||
"'" => "",
|
||||
"°" => "",
|
||||
" " => "",
|
||||
" " => ""
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
@@ -83,6 +83,7 @@ tb_show('Carbonation Chart','reference/carbonation.php?KeepThis=true&TB_iframe=t
|
||||
<?php } } } ?>
|
||||
</head>
|
||||
<body <?php if (($printBrowser == "IE") && ($page == "reference") && ($section == "carbonation")) echo "onLoad=\"javascript:popUp('reference/carbonation.php')\""; ?>>
|
||||
|
||||
<div id="maincontainer">
|
||||
<!-- Begin Header -->
|
||||
<div id="header">
|
||||
|
||||
@@ -1,465 +1,478 @@
|
||||
<?php if ($row_pref['mode'] == "2") { ?>
|
||||
<form name="form" id="form">
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Filter By Member:</td>
|
||||
<td class="data">
|
||||
<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">
|
||||
<option value="index.php?page=calendar" <?php if ($filter == "all") echo "SELECTED"; ?>>Club Brewing Calendar</option>
|
||||
<?php do { ?>
|
||||
<option value="index.php?page=calendar&filter=<?php echo $row_members['user_name']; ?>" <?php if ($row_members['user_name'] == $filter) echo "SELECTED"; ?>><?php echo $row_members['realFirstName']." ".$row_members['realLastName']; ?></option>
|
||||
<?php } while ($row_members = mysql_fetch_assoc($members)); ?>
|
||||
</select>
|
||||
<br />
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php }
|
||||
|
||||
// http://phppod.com/Tutorials/PHP-Calendar-Tutorial.html
|
||||
|
||||
function GetTimeStamp($MySqlDate)
|
||||
{ // http://www.weberdev.com/get_example-1385.html
|
||||
$date_array = explode("-",$MySqlDate); // split the array
|
||||
$var_year = $date_array[0];
|
||||
$var_month = $date_array[1];
|
||||
$var_day = $date_array[2];
|
||||
$var_timestamp = mktime(0,0,0,$var_month,$var_day,$var_year);
|
||||
return($var_timestamp); // return it to the user
|
||||
}
|
||||
|
||||
error_reporting('0');
|
||||
ini_set('display_errors', '0');
|
||||
|
||||
// Gather variables
|
||||
|
||||
if(!isset($_REQUEST['date'])){
|
||||
|
||||
//If no date argument is passed, then we'll set one by using the mktime() function for the current month, date and year.
|
||||
|
||||
$date = mktime(0,0,0,date('m'), date('d'), date('Y'));
|
||||
} else {
|
||||
|
||||
$date = $_REQUEST['date'];
|
||||
}
|
||||
|
||||
$day = date('d', $date);
|
||||
$month = date('m', $date);
|
||||
$year = date('Y', $date);
|
||||
|
||||
// Get the first day of the month
|
||||
$month_start = mktime(0,0,0,$month, 1, $year);
|
||||
|
||||
// Get friendly month name
|
||||
$month_name = date('F', $month_start);
|
||||
|
||||
// Figure out which day of the week the month starts on.
|
||||
$month_start_day = date('D', $month_start);
|
||||
|
||||
switch($month_start_day){
|
||||
case "Sun": $offset = 0; break;
|
||||
case "Mon": $offset = 1; break;
|
||||
case "Tue": $offset = 2; break;
|
||||
case "Wed": $offset = 3; break;
|
||||
case "Thu": $offset = 4; break;
|
||||
case "Fri": $offset = 5; break;
|
||||
case "Sat": $offset = 6; break;
|
||||
}
|
||||
|
||||
// determine how many days are in the last month.
|
||||
if($month == 1){
|
||||
$num_days_last = cal_days_in_month(0, 12, ($year -1));
|
||||
} else {
|
||||
$num_days_last = cal_days_in_month(0, ($month -1), $year);
|
||||
}
|
||||
|
||||
// Determine how many days are in the current month.
|
||||
$num_days_current = cal_days_in_month(0, $month, $year);
|
||||
|
||||
// Build an array for the current days in the month
|
||||
for($i = 1; $i <= $num_days_current; $i++){
|
||||
$num_days_array[] = $i;
|
||||
}
|
||||
|
||||
// Build an array for the number of days in last month
|
||||
for($i = 1; $i <= $num_days_last; $i++){
|
||||
$num_days_last_array[] = $i;
|
||||
}
|
||||
|
||||
// If the $offset from the starting day of the week happens to be Sunday, $offset would be 0, so don't need an offset correction.
|
||||
|
||||
if($offset > 0){
|
||||
|
||||
$offset_correction = array_slice ($num_days_last_array, -$offset, $offset);
|
||||
$new_count = array_merge ($offset_correction, $num_days_array);
|
||||
$offset_count = count($offset_correction);
|
||||
}
|
||||
|
||||
// The else statement is to prevent building the $offset array.
|
||||
else {
|
||||
|
||||
$new_count = $num_days_array;
|
||||
}
|
||||
|
||||
// count how many days we have with the two previous arrays merged together
|
||||
$current_num = count($new_count);
|
||||
|
||||
// Since we will have 5 HTML table rows (TR) with 7 table data entries (TD) we need to fill in 35 TDs
|
||||
// We will have to figure out how many days to appened to the end of the final array to make it 35 days.
|
||||
|
||||
if($current_num > 35){
|
||||
$num_weeks = 6;
|
||||
$outset = (42 - $current_num);
|
||||
}
|
||||
|
||||
elseif($current_num < 35){
|
||||
$num_weeks = 5;
|
||||
$outset = (35 - $current_num);
|
||||
}
|
||||
|
||||
if($current_num == 35){
|
||||
$num_weeks = 5;
|
||||
$outset = 0;
|
||||
}
|
||||
|
||||
// Outset Correction
|
||||
for($i = 1; $i <= $outset; $i++){
|
||||
$new_count[] = $i;
|
||||
}
|
||||
|
||||
// Now let's "chunk" the $new_count array into weeks. Each week has 7 days so we will array_chunk it into 7 days.
|
||||
$weeks = array_chunk($new_count, 7);
|
||||
|
||||
// Build the next and previous month links
|
||||
$previous_link = "<a href=\"index.php?page=calendar&filter=$filter&date=";
|
||||
if($month == 1){
|
||||
$previous_link .= mktime(0,0,0,12,$day,($year -1));
|
||||
} else {
|
||||
$previous_link .= mktime(0,0,0,($month -1),$day,$year);
|
||||
}
|
||||
$previous_link .= "\"><img src=\"images/arrow_left.png\" border=\"0\" title=\"Previous Month\"></a>";
|
||||
|
||||
$next_link = "<a href=\"index.php?page=calendar&filter=$filter&date=";
|
||||
if($month == 12){
|
||||
$next_link .= mktime(0,0,0,1,$day,($year + 1));
|
||||
} else {
|
||||
$next_link .= mktime(0,0,0,($month +1),
|
||||
$day,$year);
|
||||
}
|
||||
$next_link .= "\"><img src=\"images/arrow_right.png\" border=\"0\" title=\"Next Month\"></a>";
|
||||
|
||||
|
||||
// Build the heading portion of the calendar table
|
||||
echo "<table class=\"calendar\">\n".
|
||||
"<tr>\n".
|
||||
"<td colspan=\"7\" class=\"header\">\n".
|
||||
"\n<table align=\"center\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\" width=\"100%\">\n".
|
||||
"\n\n<tr>\n".
|
||||
"\n\n\n<td width=\"20%\" align=\"left\" class=\"none\">$previous_link</td>\n".
|
||||
"\n\n\n<td width=\"60%\" align=\"center\" class=\"text_16_bold\">$month_name $year</td>\n".
|
||||
"\n\n\n<td width=\"20%\" align=\"right\" class=\"none\">$next_link</td>\n".
|
||||
"\n\n</tr>\n".
|
||||
"\n</table>\n".
|
||||
"</td>\n".
|
||||
"<tr>\n".
|
||||
|
||||
// The next row indicates which day of the week each column is for.
|
||||
|
||||
"<td width=\"15%\" class=\"weekdays\">Sunday</td>
|
||||
<td width=\"14%\" class=\"weekdays\">Monday</td>
|
||||
<td width=\"14%\" class=\"weekdays\">Tuesday</td>
|
||||
<td width=\"14%\" class=\"weekdays\">Wednesday</td>
|
||||
<td width=\"14%\" class=\"weekdays\">Thursday</td>
|
||||
<td width=\"14%\" class=\"weekdays\">Friday</td>
|
||||
<td width=\"15%\" class=\"weekdays\">Saturday</td>
|
||||
\n".
|
||||
"</tr>\n";
|
||||
|
||||
// Now we break each key of the array into a week and create a new table row for each week with the days of that week in the table data
|
||||
$i = 0;
|
||||
|
||||
foreach($weeks AS $week){
|
||||
|
||||
// We now know that we are inside of a week, so we'll draw the table row (<tr>) for this week and begin draw.
|
||||
echo "<tr>\n";
|
||||
|
||||
foreach($week as $d) {
|
||||
|
||||
if($i < $offset_count){
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_calDays = "SELECT * FROM brewing";
|
||||
if ($filter !="all") $query_calDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$calDays = mysql_query($query_calDays, $brewing) or die(mysql_error());
|
||||
$row_calDays = mysql_fetch_assoc($calDays);
|
||||
$totalRows_calDays = mysql_num_rows($calDays);
|
||||
|
||||
$today0 = mktime(0,0,0,$month -1,$d,$year);
|
||||
$day_link = "<a href=\"index.php?page=calendar&filter=$filter&date=".$today0."\">$d</a>";
|
||||
echo "<td class=\"nonmonthdays day\">$day_link<br>";
|
||||
echo "<table class=\"none\">";
|
||||
do {
|
||||
$str0 = $row_calDays['brewName']; $brewName0 = Truncate6($str0);
|
||||
$MySqlDate0 = $row_calDays['brewDate'];
|
||||
$planned0 = GetTimeStamp($MySqlDate0);
|
||||
$brewday0 = GetTimeStamp($MySqlDate0);
|
||||
$secondary0 = $brewday0 + ($row_calDays['brewPrimary'] * 86400);
|
||||
$tertiary0 = $secondary0 + ($row_calDays['brewSecondary'] * 86400);
|
||||
$lager0 = $tertiary0 + ($row_calDays['brewTertiary'] * 86400);
|
||||
$age0 = $lager0 + ($row_calDays['brewLager'] * 86400);
|
||||
$tap0 = $age0 + ($row_calDays['brewAge'] * 86400);
|
||||
if (($row_calDays['brewStatus'] == "Planned") && (($planned0 == $today0))) echo "<tr><td valign=\"top\" class=\"calInfo\">Plan: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
if (($row_calDays['brewStatus'] != "Planned") && (($brewday0 == $today0))) echo "<tr><td valign=\"top\" class=\"calInfo\">Brew: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
if (($secondary0 == $today0) && ($row_calDays['brewSecondary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Sec: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
if (($tertiary0 == $today0) && ($row_calDays['brewTertiary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Ter: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
if (($lager0 == $today0) && ($row_calDays['brewLager'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Lag: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
if (($age0 == $today0) && ($row_calDays['brewAge'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Age: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
if ($tap0 == $today0) echo "<tr><td valign=\"top\" class=\"calInfo\">Tap: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
}
|
||||
while ($row_calDays = mysql_fetch_assoc($calDays));
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upDays = "SELECT * FROM upcoming";
|
||||
if ($filter !="all") $query_upDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$upDays = mysql_query($query_upDays, $brewing) or die(mysql_error());
|
||||
$row_upDays = mysql_fetch_assoc($upDays);
|
||||
$totalRows_upDays = mysql_num_rows($upDays);
|
||||
|
||||
|
||||
do {
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upRecipe = sprintf("SELECT brewBrewerID FROM recipes WHERE id = '%s'", $row_upDays['upcomingRecipeID']);
|
||||
$upRecipe = mysql_query($query_upRecipe, $brewing) or die(mysql_error());
|
||||
$row_upRecipe = mysql_fetch_assoc($upRecipe);
|
||||
$totalRows_upRecipe = mysql_num_rows($upRecipe);
|
||||
|
||||
$MySqlDate_0 = $row_upDays['upcomingDate'];
|
||||
$upcoming0 = GetTimeStamp($MySqlDate_0);
|
||||
$str_0 = $row_upDays['upcoming'];
|
||||
$upBrewName0 = Truncate6($str_0);
|
||||
|
||||
if ($upcoming0 == $today0) { echo "<tr><td valign=\"top\" class=\"none\">Up: </td><td valign=\"top\" class=\"calInfo\">"; if ($row_upDays['upcomingRecipeID'] != "") echo "<a href=\"index.php?page=recipeDetail&filter=".$row_upRecipe['brewBrewerID']."&id=".$row_upDays['upcomingRecipeID']."\">".$upBrewName0."</a>"; else echo $upBrewName0; echo "</td></tr>"; }
|
||||
}
|
||||
while ($row_upDays = mysql_fetch_assoc($upDays));
|
||||
|
||||
echo "</table></td>\n";
|
||||
}
|
||||
|
||||
//------------------
|
||||
// If the previous IF statement was not TRUE on the result, then nothing would have been drawn yet, so we are going to check and determine if the current day being looped belongs to the month being displayed. At the same time, we need to ensure that it 1.) does not belong to the previous month and 2.) does not belong to the next month. If both of these rules are passed, then the current day must fall into the current month being displayed.
|
||||
//------------------
|
||||
|
||||
if(($i >= $offset_count) && ($i < ($num_weeks * 7) - $outset)){
|
||||
|
||||
//------------------
|
||||
// Alright, here's a catchy part. We will determine if the current day of the $date value (argument passed to the script, or set if no date argument is passed) is the same as the current day being looped for this cycle, if it is, we will not display a hyperlink and we will shade the day with the appropriate CSS style.
|
||||
//------------------
|
||||
|
||||
if($date == mktime(0,0,0,$month,$d,$year)){
|
||||
|
||||
// Make a connection to DB, get necessary data
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_calDays = "SELECT * FROM brewing";
|
||||
if ($filter !="all") $query_calDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$calDays = mysql_query($query_calDays, $brewing) or die(mysql_error());
|
||||
$row_calDays = mysql_fetch_assoc($calDays);
|
||||
$totalRows_calDays = mysql_num_rows($calDays);
|
||||
|
||||
|
||||
echo "<td class=\"today day\">$d<br>";
|
||||
$today1 = mktime(0,0,0,$month,$d,$year);
|
||||
echo "<table class=\"none\">";
|
||||
do {
|
||||
$str1 = $row_calDays['brewName']; $brewName1 = Truncate6($str1);
|
||||
$MySqlDate1 = $row_calDays['brewDate'];
|
||||
$brewday1 = GetTimeStamp($MySqlDate1);
|
||||
$planned1 = GetTimeStamp($MySqlDate1);
|
||||
$secondary1 = $brewday1 + ($row_calDays['brewPrimary'] * 86400);
|
||||
$tertiary1 = $secondary1 + ($row_calDays['brewSecondary'] * 86400);
|
||||
$lager1 = $tertiary1 + ($row_calDays['brewTertiary'] * 86400);
|
||||
$age1 = $lager1 + ($row_calDays['brewLager'] * 86400);
|
||||
$tap1 = $age1 + ($row_calDays['brewAge'] * 86400);
|
||||
if (($row_calDays['brewStatus'] == "Planned") && (($planned1 == $today1))) echo "<tr><td valign=\"top\" class=\"calInfo\">Plan: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
if (($row_calDays['brewStatus'] != "Planned") && (($brewday1 == $today1))) echo "<tr><td valign=\"top\" class=\"calInfo\">Brew: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
if (($secondary1 == $today1) && ($row_calDays['brewSecondary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Sec: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
if (($tertiary1 == $today1) && ($row_calDays['brewTertiary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Ter: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
if (($lager1 == $today1) && ($row_calDays['brewLager'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Lag: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
if (($age1 == $today1) && ($row_calDays['brewAge'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Age: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
if ($tap1 == $today1) echo "<tr><td valign=\"top\" class=\"calInfo\">Tap: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
}
|
||||
while ($row_calDays = mysql_fetch_assoc($calDays));
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upDays = "SELECT * FROM upcoming";
|
||||
if ($filter !="all") $query_upDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$upDays = mysql_query($query_upDays, $brewing) or die(mysql_error());
|
||||
$row_upDays = mysql_fetch_assoc($upDays);
|
||||
$totalRows_upDays = mysql_num_rows($upDays);
|
||||
|
||||
|
||||
do {
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upRecipe = sprintf("SELECT brewBrewerID FROM recipes WHERE id = '%s'", $row_upDays['upcomingRecipeID']);
|
||||
$upRecipe = mysql_query($query_upRecipe, $brewing) or die(mysql_error());
|
||||
$row_upRecipe = mysql_fetch_assoc($upRecipe);
|
||||
$totalRows_upRecipe = mysql_num_rows($upRecipe);
|
||||
|
||||
$MySqlDate_1 = $row_upDays['upcomingDate'];
|
||||
$upcoming1 = GetTimeStamp($MySqlDate_1);
|
||||
$str_1 = $row_upDays['upcoming'];
|
||||
$upBrewName1 = Truncate6($str_1);
|
||||
|
||||
if ($upcoming1 == $today1) { echo "<tr><td valign=\"top\" class=\"calInfo\">Up: </td><td valign=\"top\" class=\"calInfo\">"; if ($row_upDays['upcomingRecipeID'] != "") echo "<a href=\"index.php?page=recipeDetail&filter=".$row_upRecipe['brewBrewerID']."&id=".$row_upDays['upcomingRecipeID']."\">".$upBrewName1."</a>"; else echo $upBrewName1; echo "</td></tr>"; }
|
||||
}
|
||||
while ($row_upDays = mysql_fetch_assoc($upDays));
|
||||
|
||||
|
||||
|
||||
echo "</table></td>\n";
|
||||
} else {
|
||||
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_calDays = "SELECT * FROM brewing";
|
||||
if ($filter !="all") $query_calDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$calDays = mysql_query($query_calDays, $brewing) or die(mysql_error());
|
||||
$row_calDays = mysql_fetch_assoc($calDays);
|
||||
$totalRows_calDays = mysql_num_rows($calDays);
|
||||
|
||||
$today2 = mktime(0,0,0,$month,$d,$year);
|
||||
echo "<td class=\"monthdays\" valign=\"top\">"."<a href=\"index.php?page=calendar&filter=$filter&date=".$today2."\">".$d."</a>";
|
||||
echo "<table class=\"none\">";
|
||||
do {
|
||||
$str2 = $row_calDays['brewName']; $brewName2 = Truncate6($str2);
|
||||
$MySqlDate2 = $row_calDays['brewDate'];
|
||||
$planned2 = GetTimeStamp($MySqlDate2);
|
||||
$brewday2 = GetTimeStamp($MySqlDate2);
|
||||
$secondary2 = $brewday2 + ($row_calDays['brewPrimary'] * 86400);
|
||||
$tertiary2 = $secondary2 + ($row_calDays['brewSecondary'] * 86400);
|
||||
$lager2 = $tertiary2 + ($row_calDays['brewTertiary'] * 86400);
|
||||
$age2 = $lager2 + ($row_calDays['brewLager'] * 86400);
|
||||
$tap2 = $age2 + ($row_calDays['brewAge'] * 86400);
|
||||
if (($row_calDays['brewStatus'] == "Planned") && (($planned2 == $today2))) echo "<tr><td valign=\"top\" class=\"calInfo\">Plan: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
if (($row_calDays['brewStatus'] != "Planned") && (($brewday2 == $today2))) echo "<tr><td valign=\"top\" class=\"calInfo\">Brew: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
if (($secondary2 == $today2) && ($row_calDays['brewSecondary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Sec: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
if (($tertiary2 == $today2) && ($row_calDays['brewTertiary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Ter: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
if (($lager2 == $today2) && ($row_calDays['brewLager'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Lag: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
if (($age2 == $today2) && ($row_calDays['brewAge'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Age: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
if ($tap2 == $today2) echo "<tr><td valign=\"top\" class=\"calInfo\">Tap: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
}
|
||||
while ($row_calDays = mysql_fetch_assoc($calDays));
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upDays = "SELECT * FROM upcoming";
|
||||
if ($filter !="all") $query_upDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$upDays = mysql_query($query_upDays, $brewing) or die(mysql_error());
|
||||
$row_upDays = mysql_fetch_assoc($upDays);
|
||||
$totalRows_upDays = mysql_num_rows($upDays);
|
||||
$recipeID2 = $row_upDays['upcomingRecipeID'];
|
||||
|
||||
do {
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upRecipe = sprintf("SELECT brewBrewerID FROM recipes WHERE id = '%s'", $row_upDays['upcomingRecipeID']);
|
||||
$upRecipe = mysql_query($query_upRecipe, $brewing) or die(mysql_error());
|
||||
$row_upRecipe = mysql_fetch_assoc($upRecipe);
|
||||
$totalRows_upRecipe = mysql_num_rows($upRecipe);
|
||||
|
||||
$MySqlDate_2 = $row_upDays['upcomingDate'];
|
||||
$upcoming2 = GetTimeStamp($MySqlDate_2);
|
||||
$str_2 = $row_upDays['upcoming'];
|
||||
$upBrewName2 = Truncate6($str_2);
|
||||
|
||||
if ($upcoming2 == $today2) { echo "<tr><td valign=\"top\" class=\"calInfo\">Up: </td><td valign=\"top\" class=\"calInfo\">"; if ($row_upDays['upcomingRecipeID'] != "") echo "<a href=\"index.php?page=recipeDetail&filter=".$row_upRecipe['brewBrewerID']."&id=".$row_upDays['upcomingRecipeID']."\">".$upBrewName2."</a>"; else echo $upBrewName2; echo "</td></tr>"; }
|
||||
}
|
||||
while ($row_upDays = mysql_fetch_assoc($upDays));
|
||||
|
||||
echo "</table></td>\n";
|
||||
}
|
||||
|
||||
|
||||
} elseif ($i >= ($num_weeks * 7) - $outset) {
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_calDays = "SELECT * FROM brewing";
|
||||
if ($filter !="all") $query_calDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$calDays = mysql_query($query_calDays, $brewing) or die(mysql_error());
|
||||
$row_calDays = mysql_fetch_assoc($calDays);
|
||||
$totalRows_calDays = mysql_num_rows($calDays);
|
||||
|
||||
|
||||
$today3 = mktime(0,0,0,$month +1,$d,$year);
|
||||
$day_link = "<a href=\"index.php?page=calendar&filter=$filter&date=".$today3."\">$d</a>";
|
||||
echo "<td class=\"nonmonthdays day\">$day_link<br>";
|
||||
echo "<table class=\"none\">";
|
||||
do {
|
||||
$str3 = $row_calDays['brewName']; $brewName3 = Truncate6($str3);
|
||||
$MySqlDate3 = $row_calDays['brewDate'];
|
||||
$planned3 = GetTimeStamp($MySqlDate3);
|
||||
$brewday3 = GetTimeStamp($MySqlDate3);
|
||||
$secondary3 = $brewday3 + ($row_calDays['brewPrimary'] * 86400);
|
||||
$tertiary3 = $secondary3 + ($row_calDays['brewSecondary'] * 86400);
|
||||
$lager3 = $tertiary3 + ($row_calDays['brewTertiary'] * 86400);
|
||||
$age3 = $lager3 + ($row_calDays['brewLager'] * 86400);
|
||||
$tap3 = $age3 + ($row_calDays['brewAge'] * 86400);
|
||||
if (($row_calDays['brewStatus'] == "Planned") && (($planned3 == $today3))) echo "<tr><td valign=\"top\" class=\"calInfo\">Plan: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
if (($row_calDays['brewStatus'] != "Planned") && (($brewday3 == $today3))) echo "<tr><td valign=\"top\" class=\"calInfo\">Brew: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
if (($secondary3 == $today3) && ($row_calDays['brewSecondary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Sec: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
if (($tertiary3 == $today3) && ($row_calDays['brewTertiary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Ter: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
if (($lager3 == $today3) && ($row_calDays['brewLager'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Lag: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
if (($age3 == $today3) && ($row_calDays['brewAge'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Age: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
if ($tap3 == $today3) echo "<tr><td valign=\"top\" class=\"calInfo\">Tap: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
}
|
||||
while ($row_calDays = mysql_fetch_assoc($calDays));
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upDays = "SELECT * FROM upcoming";
|
||||
if ($filter !="all") $query_upDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$upDays = mysql_query($query_upDays, $brewing) or die(mysql_error());
|
||||
$row_upDays = mysql_fetch_assoc($upDays);
|
||||
$totalRows_upDays = mysql_num_rows($upDays);
|
||||
|
||||
|
||||
|
||||
do {
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upRecipe = sprintf("SELECT brewBrewerID FROM recipes WHERE id = '%s'", $row_upDays['upcomingRecipeID']);
|
||||
$upRecipe = mysql_query($query_upRecipe, $brewing) or die(mysql_error());
|
||||
$row_upRecipe = mysql_fetch_assoc($upRecipe);
|
||||
$totalRows_upRecipe = mysql_num_rows($upRecipe);
|
||||
|
||||
$MySqlDate_3 = $row_upDays['upcomingDate'];
|
||||
$upcoming3 = GetTimeStamp($MySqlDate_3);
|
||||
$str_3 = $row_upDays['upcoming'];
|
||||
$upBrewName3 = Truncate6($str_3);
|
||||
|
||||
if ($upcoming3 == $today3) { echo "<tr><td valign=\"top\" class=\"calInfo\">Up: </td><td valign=\"top\" class=\"calInfo\">"; if ($row_upDays['upcomingRecipeID'] != "") echo "<a href=\"index.php?page=recipeDetail&filter=".$row_upRecipe['brewBrewerID']."&id=".$row_upDays['upcomingRecipeID']."\">".$upBrewName3."</a>"; else echo $upBrewName3; echo "</td></tr>"; }
|
||||
}
|
||||
while ($row_upDays = mysql_fetch_assoc($upDays));
|
||||
|
||||
echo "</table></td>\n";
|
||||
}
|
||||
|
||||
//Remember that good ol' $i value? Well, it's time to increment it by 1 for the next day in our loop so that the all of the IF statements we coded will work properly.
|
||||
$i++;
|
||||
|
||||
//Close out the for loop for $week AS $d.
|
||||
|
||||
}
|
||||
|
||||
//Close out the table row for this current week.
|
||||
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
// Now close out your calendar table, PHP and your HTML tags and you're all done!
|
||||
|
||||
// Close out your table and that's it!
|
||||
echo "<tr><td colspan=\"7\" class=\"header\" align=\"center\">";
|
||||
if (isset($_REQUEST['date'])) echo "<a href=\"index.php?page=calendar\">Reset to Today</a>"; else echo " ";
|
||||
echo "</td></tr>";
|
||||
?>
|
||||
|
||||
<?php if ($row_pref['mode'] == "2") { ?>
|
||||
<form name="form" id="form">
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Filter By Member:</td>
|
||||
<td class="data">
|
||||
<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">
|
||||
<option value="index.php?page=calendar" <?php if ($filter == "all") echo "SELECTED"; ?>>Club Brewing Calendar</option>
|
||||
<?php do { ?>
|
||||
<option value="index.php?page=calendar&filter=<?php echo $row_members['user_name']; ?>" <?php if ($row_members['user_name'] == $filter) echo "SELECTED"; ?>><?php echo $row_members['realFirstName']." ".$row_members['realLastName']; ?></option>
|
||||
<?php } while ($row_members = mysql_fetch_assoc($members)); ?>
|
||||
</select>
|
||||
<br />
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php }
|
||||
|
||||
// http://phppod.com/Tutorials/PHP-Calendar-Tutorial.html
|
||||
|
||||
function GetTimeStamp($MySqlDate)
|
||||
{ // http://www.weberdev.com/get_example-1385.html
|
||||
$date_array = explode("-",$MySqlDate); // split the array
|
||||
$var_year = $date_array[0];
|
||||
$var_month = $date_array[1];
|
||||
$var_day = $date_array[2];
|
||||
$var_timestamp = mktime(0,0,0,$var_month,$var_day,$var_year);
|
||||
return($var_timestamp); // return it to the user
|
||||
}
|
||||
|
||||
error_reporting('0');
|
||||
ini_set('display_errors', '0');
|
||||
|
||||
// Gather variables
|
||||
$todaysDate = mktime(0,0,0,date('m'), date('d'), date('Y'));
|
||||
|
||||
if(!isset($_REQUEST['date'])){
|
||||
|
||||
//If no date argument is passed, then we'll set one by using the mktime() function for the current month, date and year.
|
||||
|
||||
$date = mktime(0,0,0,date('m'), date('d'), date('Y'));
|
||||
} else {
|
||||
|
||||
$date = $_REQUEST['date'];
|
||||
}
|
||||
|
||||
$day = date('d', $date);
|
||||
$month = date('m', $date);
|
||||
$year = date('Y', $date);
|
||||
|
||||
// Get the first day of the month
|
||||
$month_start = mktime(0,0,0,$month, 1, $year);
|
||||
|
||||
// Get friendly month name
|
||||
$month_name = date('F', $month_start);
|
||||
|
||||
// Figure out which day of the week the month starts on.
|
||||
$month_start_day = date('D', $month_start);
|
||||
|
||||
switch($month_start_day){
|
||||
case "Sun": $offset = 0; break;
|
||||
case "Mon": $offset = 1; break;
|
||||
case "Tue": $offset = 2; break;
|
||||
case "Wed": $offset = 3; break;
|
||||
case "Thu": $offset = 4; break;
|
||||
case "Fri": $offset = 5; break;
|
||||
case "Sat": $offset = 6; break;
|
||||
}
|
||||
|
||||
// determine how many days are in the last month.
|
||||
if($month == 1){
|
||||
$num_days_last = cal_days_in_month(0, 12, ($year -1));
|
||||
} else {
|
||||
$num_days_last = cal_days_in_month(0, ($month -1), $year);
|
||||
}
|
||||
|
||||
// Determine how many days are in the current month.
|
||||
$num_days_current = cal_days_in_month(0, $month, $year);
|
||||
|
||||
// Build an array for the current days in the month
|
||||
for($i = 1; $i <= $num_days_current; $i++){
|
||||
$num_days_array[] = $i;
|
||||
}
|
||||
|
||||
// Build an array for the number of days in last month
|
||||
for($i = 1; $i <= $num_days_last; $i++){
|
||||
$num_days_last_array[] = $i;
|
||||
}
|
||||
|
||||
// If the $offset from the starting day of the week happens to be Sunday, $offset would be 0, so don't need an offset correction.
|
||||
|
||||
if($offset > 0){
|
||||
|
||||
$offset_correction = array_slice ($num_days_last_array, -$offset, $offset);
|
||||
$new_count = array_merge ($offset_correction, $num_days_array);
|
||||
$offset_count = count($offset_correction);
|
||||
}
|
||||
|
||||
// The else statement is to prevent building the $offset array.
|
||||
else {
|
||||
$new_count = $num_days_array;
|
||||
}
|
||||
|
||||
// count how many days we have with the two previous arrays merged together
|
||||
$current_num = count($new_count);
|
||||
|
||||
// Since we will have 5 HTML table rows (TR) with 7 table data entries (TD) we need to fill in 35 TDs
|
||||
// We will have to figure out how many days to appened to the end of the final array to make it 35 days.
|
||||
|
||||
if($current_num > 35){
|
||||
$num_weeks = 6;
|
||||
$outset = (42 - $current_num);
|
||||
}
|
||||
|
||||
elseif($current_num < 35){
|
||||
$num_weeks = 5;
|
||||
$outset = (35 - $current_num);
|
||||
}
|
||||
|
||||
if($current_num == 35){
|
||||
$num_weeks = 5;
|
||||
$outset = 0;
|
||||
}
|
||||
|
||||
// Outset Correction
|
||||
for($i = 1; $i <= $outset; $i++){
|
||||
$new_count[] = $i;
|
||||
}
|
||||
|
||||
// Now let's "chunk" the $new_count array into weeks. Each week has 7 days so we will array_chunk it into 7 days.
|
||||
$weeks = array_chunk($new_count, 7);
|
||||
|
||||
// Build the next and previous month links
|
||||
$previous_link = "<a href=\"index.php?page=calendar&filter=$filter&date=";
|
||||
if($month == 1){
|
||||
$previous_link .= mktime(0,0,0,12,$day,($year -1));
|
||||
} else {
|
||||
$previous_link .= mktime(0,0,0,($month -1),$day,$year);
|
||||
}
|
||||
$previous_link .= "\"><img src=\"images/arrow_left.png\" border=\"0\" title=\"Previous Month\"></a>";
|
||||
|
||||
$next_link = "<a href=\"index.php?page=calendar&filter=$filter&date=";
|
||||
if($month == 12){
|
||||
$next_link .= mktime(0,0,0,1,$day,($year + 1));
|
||||
} else {
|
||||
$next_link .= mktime(0,0,0,($month +1),
|
||||
$day,$year);
|
||||
}
|
||||
$next_link .= "\"><img src=\"images/arrow_right.png\" border=\"0\" title=\"Next Month\"></a>";
|
||||
|
||||
|
||||
// Build the heading portion of the calendar table
|
||||
echo "<table class=\"calendar\">\n".
|
||||
"<tr>\n".
|
||||
"<td colspan=\"7\" class=\"header\">\n".
|
||||
"\n<table align=\"center\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\" width=\"100%\">\n".
|
||||
"\n\n<tr>\n".
|
||||
"\n\n\n<td width=\"20%\" align=\"left\" class=\"none\">$previous_link</td>\n".
|
||||
"\n\n\n<td width=\"60%\" align=\"center\" class=\"text_16_bold\">$month_name $year</td>\n".
|
||||
"\n\n\n<td width=\"20%\" align=\"right\" class=\"none\">$next_link</td>\n".
|
||||
"\n\n</tr>\n".
|
||||
"\n</table>\n".
|
||||
"</td>\n".
|
||||
"<tr>\n".
|
||||
|
||||
// The next row indicates which day of the week each column is for.
|
||||
|
||||
"<td width=\"15%\" class=\"weekdays\">Sunday</td>
|
||||
<td width=\"14%\" class=\"weekdays\">Monday</td>
|
||||
<td width=\"14%\" class=\"weekdays\">Tuesday</td>
|
||||
<td width=\"14%\" class=\"weekdays\">Wednesday</td>
|
||||
<td width=\"14%\" class=\"weekdays\">Thursday</td>
|
||||
<td width=\"14%\" class=\"weekdays\">Friday</td>
|
||||
<td width=\"15%\" class=\"weekdays\">Saturday</td>
|
||||
\n".
|
||||
"</tr>\n";
|
||||
|
||||
// Now we break each key of the array into a week and create a new table row for each week with the days of that week in the table data
|
||||
$i = 0;
|
||||
|
||||
foreach($weeks AS $week){
|
||||
|
||||
// We now know that we are inside of a week, so we'll draw the table row (<tr>) for this week and begin draw.
|
||||
echo "<tr>\n";
|
||||
|
||||
foreach($week as $d) {
|
||||
|
||||
if($i < $offset_count){
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_calDays = "SELECT * FROM brewing";
|
||||
if ($filter !="all") $query_calDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$calDays = mysql_query($query_calDays, $brewing) or die(mysql_error());
|
||||
$row_calDays = mysql_fetch_assoc($calDays);
|
||||
$totalRows_calDays = mysql_num_rows($calDays);
|
||||
|
||||
$today0 = mktime(0,0,0,$month -1,$d,$year);
|
||||
$day_link = "<a href=\"index.php?page=calendar&filter=$filter&date=".$today0."\">$d</a>";
|
||||
echo "<td class=\"nonmonthdays day\">$day_link<br>";
|
||||
echo "<table class=\"none\">";
|
||||
do {
|
||||
if ($row_calDays['brewArchive'] != "Y") {
|
||||
$str0 = $row_calDays['brewName']; $brewName0 = Truncate6($str0);
|
||||
$MySqlDate0 = $row_calDays['brewDate'];
|
||||
$planned0 = GetTimeStamp($MySqlDate0);
|
||||
$brewday0 = GetTimeStamp($MySqlDate0);
|
||||
if ($row_calDays['brewPrimary'] > 0) $secondary0 = $brewday0 + ($row_calDays['brewPrimary'] * 86400); else $secondary0 = "0";
|
||||
if ($secondary0 > 0) $tertiary0 = $secondary0 + ($row_calDays['brewSecondary'] * 86400); else $tertiary0 = "0";
|
||||
if ($tertiary0 > 0) $lager0 = $tertiary0 + ($row_calDays['brewTertiary'] * 86400); else $lager0 = "0";
|
||||
if ($lager0 > 0) $age0 = $lager0 + ($row_calDays['brewLager'] * 86400); else $age0 = "0";
|
||||
if ($row_calDays['brewTapDate'] != "") $tap0 = GetTimeStamp($row_calDays['brewTapDate']); else { if ($age0 > 0) $tap0 = $age0 + ($row_calDays['brewAge'] * 86400); else $tap0 = "0"; }
|
||||
if (($row_calDays['brewStatus'] == "Planned") && (($planned0 == $today0))) echo "<tr><td valign=\"top\" class=\"calInfo\">Plan: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
if (($row_calDays['brewStatus'] != "Planned") && (($brewday0 == $today0))) echo "<tr><td valign=\"top\" class=\"calInfo\">Brew: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
if (($secondary0 == $today0) && ($row_calDays['brewSecondary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Sec: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
if (($tertiary0 == $today0) && ($row_calDays['brewTertiary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Ter: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
if (($lager0 == $today0) && ($row_calDays['brewLager'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Lag: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
if (($age0 == $today0) && ($row_calDays['brewAge'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Age: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
if ($tap0 == $today0) echo "<tr><td valign=\"top\" class=\"calInfo\">Tap: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName0."</a></td></tr>";
|
||||
}
|
||||
}
|
||||
while ($row_calDays = mysql_fetch_assoc($calDays));
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upDays = "SELECT * FROM upcoming";
|
||||
if ($filter !="all") $query_upDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$upDays = mysql_query($query_upDays, $brewing) or die(mysql_error());
|
||||
$row_upDays = mysql_fetch_assoc($upDays);
|
||||
$totalRows_upDays = mysql_num_rows($upDays);
|
||||
|
||||
|
||||
do {
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upRecipe = sprintf("SELECT brewBrewerID FROM recipes WHERE id = '%s'", $row_upDays['upcomingRecipeID']);
|
||||
$upRecipe = mysql_query($query_upRecipe, $brewing) or die(mysql_error());
|
||||
$row_upRecipe = mysql_fetch_assoc($upRecipe);
|
||||
$totalRows_upRecipe = mysql_num_rows($upRecipe);
|
||||
|
||||
$MySqlDate_0 = $row_upDays['upcomingDate'];
|
||||
$upcoming0 = GetTimeStamp($MySqlDate_0);
|
||||
if ($todaysDate < $upcoming0) {
|
||||
$str_0 = $row_upDays['upcoming'];
|
||||
$upBrewName0 = Truncate6($str_0);
|
||||
if ($upcoming0 == $today0) { echo "<tr><td valign=\"top\" class=\"none\">Up: </td><td valign=\"top\" class=\"calInfo\">"; if ($row_upDays['upcomingRecipeID'] != "") echo "<a href=\"index.php?page=recipeDetail&filter=".$row_upRecipe['brewBrewerID']."&id=".$row_upDays['upcomingRecipeID']."\">".$upBrewName0."</a>"; else echo $upBrewName0; echo "</td></tr>"; }
|
||||
}
|
||||
}
|
||||
while ($row_upDays = mysql_fetch_assoc($upDays));
|
||||
|
||||
echo "</table></td>\n";
|
||||
}
|
||||
|
||||
//------------------
|
||||
// If the previous IF statement was not TRUE on the result, then nothing would have been drawn yet, so we are going to check and determine if the current day being looped belongs to the month being displayed. At the same time, we need to ensure that it 1.) does not belong to the previous month and 2.) does not belong to the next month. If both of these rules are passed, then the current day must fall into the current month being displayed.
|
||||
//------------------
|
||||
|
||||
if(($i >= $offset_count) && ($i < ($num_weeks * 7) - $outset)){
|
||||
|
||||
//------------------
|
||||
// Alright, here's a catchy part. We will determine if the current day of the $date value (argument passed to the script, or set if no date argument is passed) is the same as the current day being looped for this cycle, if it is, we will not display a hyperlink and we will shade the day with the appropriate CSS style.
|
||||
//------------------
|
||||
|
||||
if($date == mktime(0,0,0,$month,$d,$year)){
|
||||
|
||||
// Make a connection to DB, get necessary data
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_calDays = "SELECT * FROM brewing";
|
||||
if ($filter !="all") $query_calDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$calDays = mysql_query($query_calDays, $brewing) or die(mysql_error());
|
||||
$row_calDays = mysql_fetch_assoc($calDays);
|
||||
$totalRows_calDays = mysql_num_rows($calDays);
|
||||
|
||||
|
||||
echo "<td class=\"today day\">$d<br>";
|
||||
$today1 = mktime(0,0,0,$month,$d,$year);
|
||||
echo "<table class=\"none\">";
|
||||
do {
|
||||
if ($row_calDays['brewArchive'] != "Y") {
|
||||
$str1 = $row_calDays['brewName']; $brewName1 = Truncate6($str1);
|
||||
$MySqlDate1 = $row_calDays['brewDate'];
|
||||
$planned1 = GetTimeStamp($MySqlDate1);
|
||||
$brewday1 = GetTimeStamp($MySqlDate1);
|
||||
if ($row_calDays['brewPrimary'] > 0) $secondary1 = $brewday1 + ($row_calDays['brewPrimary'] * 86400); else $secondary1 = "0";
|
||||
if ($secondary1 > 0) $tertiary1 = $secondary1 + ($row_calDays['brewSecondary'] * 86400); else $tertiary1 = "0";
|
||||
if ($tertiary1 > 0) $lager1 = $tertiary1 + ($row_calDays['brewTertiary'] * 86400); else $lager1 = "0";
|
||||
if ($lager1 > 0) $age1 = $lager1 + ($row_calDays['brewLager'] * 86400); else $age1 = "0";
|
||||
if ($row_calDays['brewTapDate'] != "") $tap1 = GetTimeStamp($row_calDays['brewTapDate']); else { if ($age1 > 0) $tap1 = $age1 + ($row_calDays['brewAge'] * 86400); else $tap1 = "0"; }
|
||||
if (($row_calDays['brewStatus'] == "Planned") && (($planned1 == $today1))) echo "<tr><td valign=\"top\" class=\"calInfo\">Plan: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
if (($row_calDays['brewStatus'] != "Planned") && (($brewday1 == $today1))) echo "<tr><td valign=\"top\" class=\"calInfo\">Brew: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
if (($secondary1 == $today1) && ($row_calDays['brewSecondary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Sec: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
if (($tertiary1 == $today1) && ($row_calDays['brewTertiary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Ter: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
if (($lager1 == $today1) && ($row_calDays['brewLager'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Lag: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
if (($age1 == $today1) && ($row_calDays['brewAge'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Age: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
if ($tap1 == $today1) echo "<tr><td valign=\"top\" class=\"calInfo\">Tap: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName1."</a></td></tr>";
|
||||
}
|
||||
}
|
||||
while ($row_calDays = mysql_fetch_assoc($calDays));
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upDays = "SELECT * FROM upcoming";
|
||||
if ($filter !="all") $query_upDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$upDays = mysql_query($query_upDays, $brewing) or die(mysql_error());
|
||||
$row_upDays = mysql_fetch_assoc($upDays);
|
||||
$totalRows_upDays = mysql_num_rows($upDays);
|
||||
|
||||
|
||||
do {
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upRecipe = sprintf("SELECT brewBrewerID FROM recipes WHERE id = '%s'", $row_upDays['upcomingRecipeID']);
|
||||
$upRecipe = mysql_query($query_upRecipe, $brewing) or die(mysql_error());
|
||||
$row_upRecipe = mysql_fetch_assoc($upRecipe);
|
||||
$totalRows_upRecipe = mysql_num_rows($upRecipe);
|
||||
|
||||
$MySqlDate_1 = $row_upDays['upcomingDate'];
|
||||
$upcoming1 = GetTimeStamp($MySqlDate_1);
|
||||
if ($todaysDate < $upcoming1) {
|
||||
$str_1 = $row_upDays['upcoming'];
|
||||
$upBrewName1 = Truncate6($str_1);
|
||||
if ($upcoming1 == $today1) { echo "<tr><td valign=\"top\" class=\"calInfo\">Up: </td><td valign=\"top\" class=\"calInfo\">"; if ($row_upDays['upcomingRecipeID'] != "") echo "<a href=\"index.php?page=recipeDetail&filter=".$row_upRecipe['brewBrewerID']."&id=".$row_upDays['upcomingRecipeID']."\">".$upBrewName1."</a>"; else echo $upBrewName1; echo "</td></tr>"; }
|
||||
}
|
||||
}
|
||||
while ($row_upDays = mysql_fetch_assoc($upDays));
|
||||
|
||||
|
||||
|
||||
echo "</table></td>\n";
|
||||
} else {
|
||||
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_calDays = "SELECT * FROM brewing";
|
||||
if ($filter !="all") $query_calDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$calDays = mysql_query($query_calDays, $brewing) or die(mysql_error());
|
||||
$row_calDays = mysql_fetch_assoc($calDays);
|
||||
$totalRows_calDays = mysql_num_rows($calDays);
|
||||
|
||||
$today2 = mktime(0,0,0,$month,$d,$year);
|
||||
echo "<td class=\"monthdays\" valign=\"top\">"."<a href=\"index.php?page=calendar&filter=$filter&date=".$today2."\">".$d."</a>";
|
||||
echo "<table class=\"none\">";
|
||||
do {
|
||||
if ($row_calDays['brewArchive'] != "Y") {
|
||||
$str2 = $row_calDays['brewName']; $brewName2 = Truncate6($str2);
|
||||
$MySqlDate2 = $row_calDays['brewDate'];
|
||||
$planned2 = GetTimeStamp($MySqlDate2);
|
||||
$brewday2 = GetTimeStamp($MySqlDate2);
|
||||
if ($row_calDays['brewPrimary'] > 0) $secondary2 = $brewday2 + ($row_calDays['brewPrimary'] * 86400); else $secondary2 = "0";
|
||||
if ($secondary2 > 0) $tertiary2 = $secondary2 + ($row_calDays['brewSecondary'] * 86400); else $tertiary2 = "0";
|
||||
if ($tertiary2 > 0) $lager2 = $tertiary2 + ($row_calDays['brewTertiary'] * 86400); else $lager2 = "0";
|
||||
if ($lager2 > 0) $age2 = $lager2 + ($row_calDays['brewLager'] * 86400); else $age2 = "0";
|
||||
if ($row_calDays['brewTapDate'] != "") $tap2 = GetTimeStamp($row_calDays['brewTapDate']); else { if ($age2 > 0) $tap2 = $age2 + ($row_calDays['brewAge'] * 86400); else $tap2 = "0"; }
|
||||
if (($row_calDays['brewStatus'] == "Planned") && (($planned2 == $today2))) echo "<tr><td valign=\"top\" class=\"calInfo\">Plan: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
if (($row_calDays['brewStatus'] != "Planned") && (($brewday2 == $today2))) echo "<tr><td valign=\"top\" class=\"calInfo\">Brew: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
if (($secondary2 == $today2) && ($row_calDays['brewSecondary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Sec: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
if (($tertiary2 == $today2) && ($row_calDays['brewTertiary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Ter: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
if (($lager2 == $today2) && ($row_calDays['brewLager'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Lag: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
if (($age2 == $today2) && ($row_calDays['brewAge'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Age: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
if ($tap2 == $today2) echo "<tr><td valign=\"top\" class=\"calInfo\">Tap: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName2."</a></td></tr>";
|
||||
}
|
||||
}
|
||||
while ($row_calDays = mysql_fetch_assoc($calDays));
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upDays = "SELECT * FROM upcoming";
|
||||
if ($filter !="all") $query_upDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$upDays = mysql_query($query_upDays, $brewing) or die(mysql_error());
|
||||
$row_upDays = mysql_fetch_assoc($upDays);
|
||||
$totalRows_upDays = mysql_num_rows($upDays);
|
||||
$recipeID2 = $row_upDays['upcomingRecipeID'];
|
||||
|
||||
do {
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upRecipe = sprintf("SELECT brewBrewerID FROM recipes WHERE id = '%s'", $row_upDays['upcomingRecipeID']);
|
||||
$upRecipe = mysql_query($query_upRecipe, $brewing) or die(mysql_error());
|
||||
$row_upRecipe = mysql_fetch_assoc($upRecipe);
|
||||
$totalRows_upRecipe = mysql_num_rows($upRecipe);
|
||||
|
||||
$MySqlDate_2 = $row_upDays['upcomingDate'];
|
||||
$upcoming2 = GetTimeStamp($MySqlDate_2);
|
||||
|
||||
if ($todaysDate < $upcoming2) {
|
||||
$str_2 = $row_upDays['upcoming'];
|
||||
$upBrewName2 = Truncate6($str_2);
|
||||
if ($upcoming2 == $today2) { echo "<tr><td valign=\"top\" class=\"calInfo\">Up: </td><td valign=\"top\" class=\"calInfo\">"; if ($row_upDays['upcomingRecipeID'] != "") echo "<a href=\"index.php?page=recipeDetail&filter=".$row_upRecipe['brewBrewerID']."&id=".$row_upDays['upcomingRecipeID']."\">".$upBrewName2."</a>"; else echo $upBrewName2; echo "</td></tr>"; }
|
||||
}
|
||||
}
|
||||
while ($row_upDays = mysql_fetch_assoc($upDays));
|
||||
|
||||
echo "</table></td>\n";
|
||||
}
|
||||
|
||||
|
||||
} elseif ($i >= ($num_weeks * 7) - $outset) {
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_calDays = "SELECT * FROM brewing";
|
||||
if ($filter !="all") $query_calDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$calDays = mysql_query($query_calDays, $brewing) or die(mysql_error());
|
||||
$row_calDays = mysql_fetch_assoc($calDays);
|
||||
$totalRows_calDays = mysql_num_rows($calDays);
|
||||
|
||||
|
||||
$today3 = mktime(0,0,0,$month +1,$d,$year);
|
||||
$day_link = "<a href=\"index.php?page=calendar&filter=$filter&date=".$today3."\">$d</a>";
|
||||
echo "<td class=\"nonmonthdays day\">$day_link<br>";
|
||||
echo "<table class=\"none\">";
|
||||
do {
|
||||
if ($row_calDays['brewArchive'] != "Y") {
|
||||
$str3 = $row_calDays['brewName']; $brewName3 = Truncate6($str3);
|
||||
$MySqlDate3 = $row_calDays['brewDate'];
|
||||
$planned3 = GetTimeStamp($MySqlDate3);
|
||||
$brewday3 = GetTimeStamp($MySqlDate3);
|
||||
if ($row_calDays['brewPrimary'] > 0) $secondary3 = $brewday3 + ($row_calDays['brewPrimary'] * 86400); else $secondary3 = "0";
|
||||
if ($secondary3 > 0) $tertiary3 = $secondary3 + ($row_calDays['brewSecondary'] * 86400); else $tertiary3 = "0";
|
||||
if ($tertiary3 > 0) $lager3 = $tertiary3 + ($row_calDays['brewTertiary'] * 86400); else $lager3 = "0";
|
||||
if ($lager3 > 0) $age3 = $lager3 + ($row_calDays['brewLager'] * 86400); else $age3 = "0";
|
||||
if ($row_calDays['brewTapDate'] != "") $tap3 = GetTimeStamp($row_calDays['brewTapDate']); else { if ($age3 > 0) $tap3 = $age3 + ($row_calDays['brewAge'] * 86400); else $tap3 = "0"; }
|
||||
if (($row_calDays['brewStatus'] == "Planned") && (($planned3 == $today3))) echo "<tr><td valign=\"top\" class=\"calInfo\">Plan: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
if (($row_calDays['brewStatus'] != "Planned") && (($brewday3 == $today3))) echo "<tr><td valign=\"top\" class=\"calInfo\">Brew: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
if (($secondary3 == $today3) && ($row_calDays['brewSecondary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Sec: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
if (($tertiary3 == $today3) && ($row_calDays['brewTertiary'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Ter: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
if (($lager3 == $today3) && ($row_calDays['brewLager'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Lag: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
if (($age3 == $today3) && ($row_calDays['brewAge'] > 0)) echo "<tr><td valign=\"top\" class=\"calInfo\">Age: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
if ($tap3 == $today3) echo "<tr><td valign=\"top\" class=\"calInfo\">Tap: </td><td valign=\"top\" class=\"calInfo\"><a href=\"index.php?page=brewBlogDetail&filter=".$row_calDays['brewBrewerID']."&id=".$row_calDays['id']."\">".$brewName3."</a></td></tr>";
|
||||
}
|
||||
}
|
||||
while ($row_calDays = mysql_fetch_assoc($calDays));
|
||||
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upDays = "SELECT * FROM upcoming";
|
||||
if ($filter !="all") $query_upDays .= " WHERE brewBrewerID = '$filter'";
|
||||
$upDays = mysql_query($query_upDays, $brewing) or die(mysql_error());
|
||||
$row_upDays = mysql_fetch_assoc($upDays);
|
||||
$totalRows_upDays = mysql_num_rows($upDays);
|
||||
|
||||
|
||||
|
||||
do {
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_upRecipe = sprintf("SELECT brewBrewerID FROM recipes WHERE id = '%s'", $row_upDays['upcomingRecipeID']);
|
||||
$upRecipe = mysql_query($query_upRecipe, $brewing) or die(mysql_error());
|
||||
$row_upRecipe = mysql_fetch_assoc($upRecipe);
|
||||
$totalRows_upRecipe = mysql_num_rows($upRecipe);
|
||||
|
||||
$MySqlDate_3 = $row_upDays['upcomingDate'];
|
||||
$upcoming3 = GetTimeStamp($MySqlDate_3);
|
||||
if ($todaysDate < $upcoming3) {
|
||||
$str_3 = $row_upDays['upcoming'];
|
||||
$upBrewName3 = Truncate6($str_3);
|
||||
if ($upcoming3 == $today3) { echo "<tr><td valign=\"top\" class=\"calInfo\">Up: </td><td valign=\"top\" class=\"calInfo\">"; if ($row_upDays['upcomingRecipeID'] != "") echo "<a href=\"index.php?page=recipeDetail&filter=".$row_upRecipe['brewBrewerID']."&id=".$row_upDays['upcomingRecipeID']."\">".$upBrewName3."</a>"; else echo $upBrewName3; echo "</td></tr>"; }
|
||||
}
|
||||
}
|
||||
while ($row_upDays = mysql_fetch_assoc($upDays));
|
||||
|
||||
echo "</table></td>\n";
|
||||
}
|
||||
|
||||
//Remember that good ol' $i value? Well, it's time to increment it by 1 for the next day in our loop so that the all of the IF statements we coded will work properly.
|
||||
$i++;
|
||||
|
||||
//Close out the for loop for $week AS $d.
|
||||
|
||||
}
|
||||
|
||||
//Close out the table row for this current week.
|
||||
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
// Now close out your calendar table, PHP and your HTML tags and you're all done!
|
||||
|
||||
// Close out your table and that's it!
|
||||
echo "<tr><td colspan=\"7\" class=\"header\" align=\"center\">";
|
||||
if (isset($_REQUEST['date'])) echo "<a href=\"index.php?page=calendar\">Reset to Today</a>"; else echo " ";
|
||||
echo "</td></tr>";
|
||||
?>
|
||||
|
||||
</table>
|
||||
@@ -1,182 +1,182 @@
|
||||
<?php
|
||||
if (($row_log['brewPreBoilAmt'] != "") && ($row_log['brewMashGravity'] !="") && (($page == "brewBlogCurrent") || ($page == "brewBlogDetail"))) { include ('includes/efficiency.inc.php'); }
|
||||
if (($row_log['brewPreBoilAmt'] != "") && ($row_log['brewMashGravity'] !="") && ($page == "logPrint")) { include ('../includes/efficiency.inc.php'); } ?>
|
||||
|
||||
<?php if (($row_pref['mashDisplayMethod'] == "1") && ($row_log['brewMashProfile'] != "")) { // Use mash profiles DB ?>
|
||||
<div id="headerContent">Mash Profile</div>
|
||||
<div id="dataContainer">
|
||||
<h3><em><?php echo $row_mash_profiles['mashProfileName']; ?></em></h3>
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Grain Temperature:</td>
|
||||
<td class="data" width="15%"><?php echo $row_mash_profiles['mashGrainTemp']."°".$row_pref['measTemp']; ; ?></td>
|
||||
<td class="dataLabel data" width="10%">Tun Temperature:</td>
|
||||
<td class="data"><?php echo $row_mash_profiles['mashTunTemp']."°".$row_pref['measTemp']; ; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Sparge Temperature:</td>
|
||||
<td class="data"><?php echo $row_mash_profiles['mashSpargeTemp']."°".$row_pref['measTemp']; ?></td>
|
||||
<td class="dataLabel data">PH:</td>
|
||||
<td class="data"><?php echo $row_mash_profiles['mashPH']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) { if ($row_pref['measFluid2'] == "liters") echo "PPK:"; else echo "PPG:"; } elseif ($row_log['brewPPG'] != "") { if ($row_pref['measFluid2'] == "liters") echo "PPK:"; else echo "PPG:"; } else echo ""; ?></td>
|
||||
<td class="data"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) echo round ($ppg_display, 2); else echo $row_log['brewPPG']; if ($row_log['brewEfficiency'] == "") echo ""; ?></td>
|
||||
<td class="dataLabel data"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) echo "Efficiency:"; elseif ($row_log['brewEfficiency'] != "") echo "Efficiency:"; else echo ""; ?></td>
|
||||
<td class="data"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) echo round ($efficiency, 2)."%"; else echo $row_log['brewEfficiency']; if ($row_log['brewEfficiency'] != "") echo "%"; else echo "";?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Notes:</td>
|
||||
<td class="data" colspan="3"><?php echo $row_mash_profiles['mashNotes']; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php if ($totalRows_mash_steps > 0) { ?>
|
||||
<h3>Steps</h3>
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td class="dataHeadingLeft" width="5%" nowrap="nowrap">#</td>
|
||||
<td class="dataHeading" width="25%">Name</td>
|
||||
<td class="dataHeading" width="5%" nowrap="nowrap">Type</td>
|
||||
<td class="dataHeading" width="5%" nowrap="nowrap">Time</td>
|
||||
<td class="dataHeading" width="5%" nowrap="nowrap">Temp.</td>
|
||||
<td class="dataHeading" width="50%">Description</td>
|
||||
</tr>
|
||||
<?php do { ?>
|
||||
<tr>
|
||||
<td class="dataLeft"><?php echo $row_mash_steps['stepNumber']; ?></td>
|
||||
<td class="data"><?php echo $row_mash_steps['stepName']; ?></td>
|
||||
<td class="data"><?php echo $row_mash_steps['stepType']; ?></td>
|
||||
<td class="data" nowrap><?php echo $row_mash_steps['stepTime']; ?> min.</td>
|
||||
<td class="data" nowrap><?php if ($row_pref['measTemp'] == "C") { echo round(((($row_mash_steps['stepTemp'] - 32) / 9) * 5), 1); } else { echo round($row_mash_steps['stepTemp'], 1); } echo "°".$row_pref['measTemp']; ?></td>
|
||||
<td class="data"><?php echo $row_mash_steps['stepDescription']; ?></td>
|
||||
</tr>
|
||||
<?php } while ($row_mash_steps = mysql_fetch_assoc($mash_steps)); ?>
|
||||
</table>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php }
|
||||
if (($row_pref['mashDisplayMethod'] == "2") || (($row_pref['mashDisplayMethod'] == "1") && ($row_log['brewMashProfile'] == ""))) { // unique mash profiles for every log
|
||||
if ($row_log['brewMashType'] != "" ) { // hide entire set of mash rows if first is not present ?>
|
||||
<div id="headerContent">Mash</div>
|
||||
<div id="dataContainer">
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td width="50%">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Mash Type:</td>
|
||||
<td class="data"><?php echo $row_log['brewMashType']; ?></td>
|
||||
</tr>
|
||||
<?php if ($row_log['brewMashPH'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Mash PH:</td>
|
||||
<td class="data"><?php echo $row_log['brewMashPH']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashGrainWeight'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Grain Amt.</td>
|
||||
<td class="data"><?php if ($action == "default") echo $row_log['brewMashGrainWeight']; if ($action == "scale") echo number_format(($row_log['brewMashGrainWeight'] * $scale), 2); echo " ".$row_pref['measWeight2']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) { if ($row_pref['measFluid2'] == "liters") echo "PPK:"; else echo "PPG:"; } elseif ($row_log['brewPPG'] != "") { if ($row_pref['measFluid2'] == "liters") echo "PPK:"; else echo "PPG:"; } else echo ""; ?></td>
|
||||
<td class="data"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) echo round ($ppg_display, 2); else echo $row_log['brewPPG']; if ($row_log['brewEfficiency'] == "") echo ""; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) echo "Efficiency:"; elseif ($row_log['brewEfficiency'] != "") echo "Efficiency:"; else echo ""; ?></td>
|
||||
<td class="data"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) echo round ($efficiency, 2)."%"; else echo $row_log['brewEfficiency']; if ($row_log['brewEfficiency'] != "") echo "%"; else echo "";?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="50%">
|
||||
<table>
|
||||
<?php if ($row_log['brewMashGrainTemp'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Grain Temp.</td>
|
||||
<td class="data"><?php echo $row_log['brewMashGrainTemp']."° ".$row_pref['measTemp']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashTunTemp'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Tun Temp.</td>
|
||||
<td class="data"><?php echo $row_log['brewMashTunTemp']."° ".$row_pref['measTemp']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashSpargAmt'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Sparge Amt.</td>
|
||||
<td class="data"><?php if ($action == "default") echo $row_log['brewMashSpargAmt']; if ($action == "scale") echo number_format(($row_log['brewMashSpargAmt'] * $scale), 2); echo " ".$row_pref['measFluid2']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashSpargeTemp'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Sparge Temp.</td>
|
||||
<td class="data"><?php echo $row_log['brewMashSpargeTemp']."° ".$row_pref['measTemp']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashEquipAdjust'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Equip. Adj.?</td>
|
||||
<td class="data"><?php echo $row_log['brewMashEquipAdjust']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ($row_log['brewMashStep1Name'] != "" ) { ?>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Step</td>
|
||||
<td class="dataLabel data">Description</td>
|
||||
<td class="dataLabel data">Temp.</td>
|
||||
<td class="dataLabel data">Time</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLeft"><?php echo $row_log['brewMashStep1Name']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep1Desc']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep1Temp']."° ".$row_pref['measTemp']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep1Time']; ?> min.</td>
|
||||
</tr>
|
||||
<?php if ($row_log['brewMashStep2Name'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLeft"><?php echo $row_log['brewMashStep2Name']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep2Desc']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep2Temp']."° ".$row_pref['measTemp']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep2Time']; ?> min.</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashStep3Name'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLeft"><?php echo $row_log['brewMashStep3Name']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep3Desc']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep3Temp']."° ".$row_pref['measTemp']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep3Time']; ?> min.</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashStep4Name'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLeft"><?php echo $row_log['brewMashStep4Name']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep4Desc']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep4Temp']."° ".$row_pref['measTemp']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep4Time']; ?> min.</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashStep5Name'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLeft"><?php echo $row_log['brewMashStep5Name']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep5Desc']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep5Temp']."° ".$row_pref['measTemp']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep5Time']; ?> min.</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php }
|
||||
} ?>
|
||||
<?php
|
||||
if (($row_log['brewPreBoilAmt'] != "") && ($row_log['brewMashGravity'] !="") && (($page == "brewBlogCurrent") || ($page == "brewBlogDetail"))) { include ('includes/efficiency.inc.php'); }
|
||||
if (($row_log['brewPreBoilAmt'] != "") && ($row_log['brewMashGravity'] !="") && ($page == "logPrint")) { include ('../includes/efficiency.inc.php'); } ?>
|
||||
|
||||
<?php if (($row_pref['mashDisplayMethod'] == "1") && ($row_log['brewMashProfile'] != "")) { // Use mash profiles DB ?>
|
||||
<div id="headerContent">Mash Profile</div>
|
||||
<div id="dataContainer">
|
||||
<h3><em><?php echo $row_mash_profiles['mashProfileName']; ?></em></h3>
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Grain Temperature:</td>
|
||||
<td class="data" width="15%"><?php echo $row_mash_profiles['mashGrainTemp']."°".$row_pref['measTemp']; ; ?></td>
|
||||
<td class="dataLabel data" width="10%">Tun Temperature:</td>
|
||||
<td class="data"><?php echo $row_mash_profiles['mashTunTemp']."°".$row_pref['measTemp']; ; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Sparge Temperature:</td>
|
||||
<td class="data"><?php echo $row_mash_profiles['mashSpargeTemp']."°".$row_pref['measTemp']; ?></td>
|
||||
<td class="dataLabel data">PH:</td>
|
||||
<td class="data"><?php echo $row_mash_profiles['mashPH']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) { if ($row_pref['measFluid2'] == "liters") echo "PPK:"; else echo "PPG:"; } elseif ($row_log['brewPPG'] != "") { if ($row_pref['measFluid2'] == "liters") echo "PPK:"; else echo "PPG:"; } else echo ""; ?></td>
|
||||
<td class="data"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) echo round ($ppg_display, 2); ?></td>
|
||||
<td class="dataLabel data"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) echo "Efficiency:"; elseif ($row_log['brewEfficiency'] != "") echo "Efficiency:"; else echo ""; ?></td>
|
||||
<td class="data"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) echo round ($efficiency, 2)."%"; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Notes:</td>
|
||||
<td class="data" colspan="3"><?php echo $row_mash_profiles['mashNotes']; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php if ($totalRows_mash_steps > 0) { ?>
|
||||
<h3>Steps</h3>
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td class="dataHeadingLeft" width="5%" nowrap="nowrap">#</td>
|
||||
<td class="dataHeading" width="25%">Name</td>
|
||||
<td class="dataHeading" width="5%" nowrap="nowrap">Type</td>
|
||||
<td class="dataHeading" width="5%" nowrap="nowrap">Time</td>
|
||||
<td class="dataHeading" width="5%" nowrap="nowrap">Temp.</td>
|
||||
<td class="dataHeading" width="50%">Description</td>
|
||||
</tr>
|
||||
<?php do { ?>
|
||||
<tr>
|
||||
<td class="dataLeft"><?php echo $row_mash_steps['stepNumber']; ?></td>
|
||||
<td class="data"><?php echo $row_mash_steps['stepName']; ?></td>
|
||||
<td class="data"><?php echo $row_mash_steps['stepType']; ?></td>
|
||||
<td class="data" nowrap><?php echo $row_mash_steps['stepTime']; ?> min.</td>
|
||||
<td class="data" nowrap><?php if ($row_pref['measTemp'] == "C") { echo round(((($row_mash_steps['stepTemp'] - 32) / 9) * 5), 1); } else { echo round($row_mash_steps['stepTemp'], 1); } echo "°".$row_pref['measTemp']; ?></td>
|
||||
<td class="data"><?php echo $row_mash_steps['stepDescription']; ?></td>
|
||||
</tr>
|
||||
<?php } while ($row_mash_steps = mysql_fetch_assoc($mash_steps)); ?>
|
||||
</table>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php }
|
||||
if (($row_pref['mashDisplayMethod'] == "2") || (($row_pref['mashDisplayMethod'] == "1") && ($row_log['brewMashProfile'] == ""))) { // unique mash profiles for every log
|
||||
if ($row_log['brewMashType'] != "" ) { // hide entire set of mash rows if first is not present ?>
|
||||
<div id="headerContent">Mash</div>
|
||||
<div id="dataContainer">
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td width="50%">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Mash Type:</td>
|
||||
<td class="data"><?php echo $row_log['brewMashType']; ?></td>
|
||||
</tr>
|
||||
<?php if ($row_log['brewMashPH'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Mash PH:</td>
|
||||
<td class="data"><?php echo $row_log['brewMashPH']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashGrainWeight'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Grain Amt.</td>
|
||||
<td class="data"><?php if ($action == "default") echo $row_log['brewMashGrainWeight']; if ($action == "scale") echo number_format(($row_log['brewMashGrainWeight'] * $scale), 2); echo " ".$row_pref['measWeight2']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) { if ($row_pref['measFluid2'] == "liters") echo "PPK:"; else echo "PPG:"; } elseif ($row_log['brewPPG'] != "") { if ($row_pref['measFluid2'] == "liters") echo "PPK:"; else echo "PPG:"; } else echo ""; ?></td>
|
||||
<td class="data"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) echo round ($ppg_display, 2); else echo $row_log['brewPPG']; if ($row_log['brewEfficiency'] == "") echo ""; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelLeft"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) echo "Efficiency:"; elseif ($row_log['brewEfficiency'] != "") echo "Efficiency:"; else echo ""; ?></td>
|
||||
<td class="data"><?php if (($row_log['brewMashGravity'] != "" ) && ($row_log['brewPreBoilAmt'] != "") && ($row_log['brewGrain1'] != "")) echo round ($efficiency, 2)."%"; else echo $row_log['brewEfficiency']; if ($row_log['brewEfficiency'] != "") echo "%"; else echo "";?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width="50%">
|
||||
<table>
|
||||
<?php if ($row_log['brewMashGrainTemp'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Grain Temp.</td>
|
||||
<td class="data"><?php echo $row_log['brewMashGrainTemp']."° ".$row_pref['measTemp']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashTunTemp'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Tun Temp.</td>
|
||||
<td class="data"><?php echo $row_log['brewMashTunTemp']."° ".$row_pref['measTemp']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashSpargAmt'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Sparge Amt.</td>
|
||||
<td class="data"><?php if ($action == "default") echo $row_log['brewMashSpargAmt']; if ($action == "scale") echo number_format(($row_log['brewMashSpargAmt'] * $scale), 2); echo " ".$row_pref['measFluid2']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashSpargeTemp'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Sparge Temp.</td>
|
||||
<td class="data"><?php echo $row_log['brewMashSpargeTemp']."° ".$row_pref['measTemp']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashEquipAdjust'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Equip. Adj.?</td>
|
||||
<td class="data"><?php echo $row_log['brewMashEquipAdjust']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ($row_log['brewMashStep1Name'] != "" ) { ?>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="dataLabelLeft">Step</td>
|
||||
<td class="dataLabel data">Description</td>
|
||||
<td class="dataLabel data">Temp.</td>
|
||||
<td class="dataLabel data">Time</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLeft"><?php echo $row_log['brewMashStep1Name']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep1Desc']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep1Temp']."° ".$row_pref['measTemp']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep1Time']; ?> min.</td>
|
||||
</tr>
|
||||
<?php if ($row_log['brewMashStep2Name'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLeft"><?php echo $row_log['brewMashStep2Name']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep2Desc']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep2Temp']."° ".$row_pref['measTemp']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep2Time']; ?> min.</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashStep3Name'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLeft"><?php echo $row_log['brewMashStep3Name']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep3Desc']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep3Temp']."° ".$row_pref['measTemp']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep3Time']; ?> min.</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashStep4Name'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLeft"><?php echo $row_log['brewMashStep4Name']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep4Desc']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep4Temp']."° ".$row_pref['measTemp']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep4Time']; ?> min.</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_log['brewMashStep5Name'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLeft"><?php echo $row_log['brewMashStep5Name']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep5Desc']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep5Temp']."° ".$row_pref['measTemp']; ?></td>
|
||||
<td class="data"><?php echo $row_log['brewMashStep5Time']; ?> min.</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
@@ -1,205 +1,205 @@
|
||||
<?php
|
||||
require_once('../Connections/config.php');
|
||||
include ('../includes/url_variables.inc.php');
|
||||
include ('../includes/db_connect_log.inc.php');
|
||||
$page = "logPrint";
|
||||
if (isset($_GET['page'])) {
|
||||
$page = (get_magic_quotes_gpc()) ? $_GET['page'] : addslashes($_GET['page']);
|
||||
}
|
||||
//if ($source == "brewLog") { $page == "logPrint"; }
|
||||
//if ($source == "brewLogRecipe") { $page == "recipePrint"; }
|
||||
//if ($source == "recipeDB") { $page == "recipePrint"; }
|
||||
$scale = $amt;
|
||||
$colname_style = "-1";
|
||||
if (isset($_GET['brewStyle'])) {
|
||||
$colname_style = (get_magic_quotes_gpc()) ? $_GET['brewStyle'] : addslashes($_GET['brewStyle']);
|
||||
}
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_style = sprintf("SELECT * FROM styles WHERE brewStyle = '%s'", $colname_style);
|
||||
$style = mysql_query($query_style, $brewing) or die(mysql_error());
|
||||
$row_style = mysql_fetch_assoc($style);
|
||||
$totalRows_style = mysql_num_rows($style);
|
||||
|
||||
include ('../includes/db_connect_universal.inc.php');
|
||||
include ('../includes/abv.inc.php');
|
||||
include ('../includes/color.inc.php');
|
||||
include ('../includes/check_mobile.inc.php');
|
||||
include ('../includes/plug-ins.inc.php');
|
||||
include ('../includes/version.inc.php');
|
||||
?>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<?php if ($view == "limited") { // Yeah, I know it's a hack to get the JS print onload event in Thickbox. But it works.?>
|
||||
<meta http-equiv="refresh" content="0;URL=print.inc.php?page=<?php echo $page; ?>&source=<?php echo $source; ?>&dbTable=<?php echo $dbTable; ?>&brewStyle=<?php echo $colname_style; if ($amt != "default") echo "&amt=".$amt."&action=scale"; ?>&view=print&id=<?php echo $colname_log; ?>">
|
||||
<?php } ?>
|
||||
<title><?php echo $row_log['brewName']; if ($row_name['brewerFirstName'] != "") { ?>: From <?php echo $row_name['brewerFirstName']; ?> <?php echo $row_name['brewerLastName']; ?>'s BrewBlog<?php } ?></title>
|
||||
<link href="../css/html_elements.css" rel="stylesheet" type="text/css">
|
||||
<link href="../css/universal_elements.css" rel="stylesheet" type="text/css">
|
||||
<link href="../css/print.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body <?php if ($view == "print") echo "onload=\"javascript:window.print()\""; ?>>
|
||||
<div id="maincontainer">
|
||||
<div id="contentWrapper">
|
||||
<?php if ($view == "limited") { // if auto print turned off ?>
|
||||
<p><img src="../images/printer.png"><span class="data"><a href="javascript:window.print()">Print</a></span></p>
|
||||
<?php } ?>
|
||||
<div id="contentcolumn">
|
||||
<div id="subtitle"><?php echo $row_log['brewName']; ?></div>
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td><p>From the BrewBlog of <?php echo $row_name['brewerFirstName']; if ($row_name['brewerLastName'] != "" ) echo " ".$row_name['brewerLastName']; ?><br><?php if ($row_name['brewerCity'] != "" ) echo $row_name['brewerCity']; if ($row_name['brewerState'] != "" ) echo ", ".$row_name['brewerState']; if ($row_name['brewerCountry'] != "" ) echo " ".$row_name['brewerCountry']; ?></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Printed <?php print date ( 'F j, Y' );?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
if ($row_pref['allowSpecifics'] == "Y") { include ('specifics.inc.php'); }
|
||||
if ($row_pref['allowGeneral'] == "Y") { include ('general.inc.php'); }
|
||||
if ($row_pref['allowComments'] == "Y") { if ($page == "logPrint") include ('comments.inc.php'); if ($page == "recipePrint") include ('notes.inc.php'); }
|
||||
if ($row_pref['allowRecipe'] == "Y") { include ('recipe.inc.php'); }
|
||||
if ($row_pref['allowMash'] == "Y") { include ('mash.inc.php'); }
|
||||
if (($page == "logPrint") && ($row_pref['allowWater'] == "Y")) { include ('water.inc.php'); }
|
||||
if ($row_pref['allowProcedure'] == "Y") { include ('procedure.inc.php'); }
|
||||
if (($page == "logPrint") && ($row_pref['allowSpecialProcedure'] == "Y")) { include ('special_procedure.inc.php'); }
|
||||
if ($row_pref['allowFermentation'] == "Y") { include ('fermentation.inc.php'); }
|
||||
?>
|
||||
|
||||
</div>
|
||||
<?php include ('water_amounts_calc.inc.php'); ?>
|
||||
<div id="rightcolumn">
|
||||
<div id="sidebarWrapper">
|
||||
<div id="sidebarHeader">BJCP Style Info</div>
|
||||
<table class="dataTable text_10">
|
||||
<tr>
|
||||
<td class="dataLabelWide">Style:</td>
|
||||
<td class="data"><?php echo $row_style['brewStyle']; ?></td>
|
||||
</tr>
|
||||
<?php if ($row_style['brewStyleOG'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide">O.G.:</td>
|
||||
<td class="data"><?php if ($row_style['brewStyleOG'] == "" ) echo "Varies"; elseif ($row_style['brewStyleOG'] == "Varies" ) echo "Varies"; elseif ($row_style['brewStyleOG'] == "N/A" ) echo "N/A"; else echo $row_style['brewStyleOG']." - ".$row_style['brewStyleOGMax']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_style['brewStyleFG'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide">F.G.:</td>
|
||||
<td class="data"><?php if ($row_style['brewStyleFG'] == "" ) echo "Varies"; elseif ($row_style['brewStyleFG'] == "Varies" ) echo "Varies"; elseif ($row_style['brewStyleFG'] == "N/A" ) echo "N/A"; else echo $row_style['brewStyleFG']." - ".$row_style['brewStyleFGMax']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_style['brewStyleABV'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide">ABV:</td>
|
||||
<td class="data"> <?php if ($row_style['brewStyleABV'] == "" ) echo "Varies"; elseif ($row_style['brewStyleABV'] == "Varies" ) echo "Varies"; elseif ($row_style['brewStyleABV'] == "N/A" ) echo "N/A"; else echo $row_style['brewStyleABV']." - ".$row_style['brewStyleABVMax']."%"; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_style['brewStyleIBU'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Bitterness:</td>
|
||||
<td class="data"><?php if ($row_style['brewStyleIBU'] == "" ) echo "Varies"; elseif ($row_style['brewStyleIBU'] == "Varies" ) echo "Varies"; elseif ($row_style['brewStyleIBU'] == "N/A" ) echo "N/A"; else echo $row_style['brewStyleIBU']." - ".$row_style['brewStyleIBUMax']." IBUs"; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_style['brewStyleSRM'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Color:</td>
|
||||
<td class="data"><?php if ($row_style['brewStyleSRM'] == "" ) echo "Varies"; elseif ($row_style['brewStyleSRM'] == "Varies" ) echo "Varies"; elseif ($row_style['brewStyleSRM'] == "N/A" ) echo "N/A"; else echo ltrim($row_style['brewStyleSRM'], "0")." - ".ltrim($row_style['brewStyleSRMMax'], "0")." SRM"; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<?php if ($row_style['brewStyleInfo'] != "" ) { ?>
|
||||
<table class="dataTable text_10">
|
||||
<tr>
|
||||
<td class="dataLabelWide">Info:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $row_style['brewStyleInfo']; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div id="sidebarWrapper">
|
||||
<div id="sidebarHeader">Brew Day Data</div>
|
||||
<table class="dataTable text_10">
|
||||
<?php if ($row_log['brewMethod'] == "All Grain") { ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide "> </td>
|
||||
<td class="data">Target</td>
|
||||
<td class="data">Actual</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Str Water Amt:</td>
|
||||
<td class="data"><?php if ($row_pref['measFluid2'] == "liters") echo round ($mashWaterMet, 1); else echo round ($mashWater, 1); ?></td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Str Water Temp:</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Mash Temp:</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Mash Time:</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Sp Water Amt:</td>
|
||||
<td class="data"><?php if ($row_pref['measFluid2'] == "liters") echo round ($spargeWaterMet, 1); else echo round ($spargeWater, 1); ?></td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Sp Water Temp:</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Pre-Boil Grav:</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Pre-Boil Amt:</td>
|
||||
<td class="data"><?php echo round ($runoffVol, 1); ?></td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Post-Boil Amt:</td>
|
||||
<td class="data"><?php echo $finalBoilVol; ?></td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Boil Time:</td>
|
||||
<td class="data"><?php echo $boilTime; ?></td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">O.G.:</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">____________</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">____________</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footerInclude">Printed using BrewBlogger <?php echo $version; ?>, brewing log software for PHP and MySQL, available at http://www.brewblogger.net.</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
require_once('../Connections/config.php');
|
||||
include ('../includes/url_variables.inc.php');
|
||||
include ('../includes/db_connect_log.inc.php');
|
||||
$page = "logPrint";
|
||||
if (isset($_GET['page'])) {
|
||||
$page = (get_magic_quotes_gpc()) ? $_GET['page'] : addslashes($_GET['page']);
|
||||
}
|
||||
//if ($source == "brewLog") { $page == "logPrint"; }
|
||||
//if ($source == "brewLogRecipe") { $page == "recipePrint"; }
|
||||
//if ($source == "recipeDB") { $page == "recipePrint"; }
|
||||
$scale = $amt;
|
||||
$colname_style = "-1";
|
||||
if (isset($_GET['brewStyle'])) {
|
||||
$colname_style = (get_magic_quotes_gpc()) ? $_GET['brewStyle'] : addslashes($_GET['brewStyle']);
|
||||
}
|
||||
mysql_select_db($database_brewing, $brewing);
|
||||
$query_style = sprintf("SELECT * FROM styles WHERE brewStyle = '%s'", $colname_style);
|
||||
$style = mysql_query($query_style, $brewing) or die(mysql_error());
|
||||
$row_style = mysql_fetch_assoc($style);
|
||||
$totalRows_style = mysql_num_rows($style);
|
||||
|
||||
include ('../includes/db_connect_universal.inc.php');
|
||||
include ('../includes/abv.inc.php');
|
||||
include ('../includes/color.inc.php');
|
||||
include ('../includes/check_mobile.inc.php');
|
||||
include ('../includes/plug-ins.inc.php');
|
||||
include ('../includes/version.inc.php');
|
||||
?>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<?php if ($view == "limited") { // Yeah, I know it's a hack to get the JS print onload event in Thickbox. But it works.?>
|
||||
<meta http-equiv="refresh" content="0;URL=print.inc.php?page=<?php echo $page; ?>&source=<?php echo $source; ?>&dbTable=<?php echo $dbTable; ?>&brewStyle=<?php echo $colname_style; if ($amt != "default") echo "&amt=".$amt."&action=scale"; ?>&view=print&id=<?php echo $colname_log; ?>">
|
||||
<?php } ?>
|
||||
<title><?php echo $row_log['brewName']; if ($row_name['brewerFirstName'] != "") { ?>: From <?php echo $row_name['brewerFirstName']; ?> <?php echo $row_name['brewerLastName']; ?>'s BrewBlog<?php } ?></title>
|
||||
<link href="../css/html_elements.css" rel="stylesheet" type="text/css">
|
||||
<link href="../css/universal_elements.css" rel="stylesheet" type="text/css">
|
||||
<link href="../css/print.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body <?php if ($view == "print") echo "onload=\"javascript:window.print()\""; ?>>
|
||||
<div id="maincontainer">
|
||||
<div id="contentWrapper">
|
||||
<?php if ($view == "limited") { // if auto print turned off ?>
|
||||
<p><img src="../images/printer.png"><span class="data"><a href="javascript:window.print()">Print</a></span></p>
|
||||
<?php } ?>
|
||||
<div id="contentcolumn">
|
||||
<div id="subtitle"><?php echo $row_log['brewName']; ?></div>
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td><p>From the BrewBlog of <?php echo $row_name['brewerFirstName']; if ($row_name['brewerLastName'] != "" ) echo " ".$row_name['brewerLastName']; ?><br><?php if ($row_name['brewerCity'] != "" ) echo $row_name['brewerCity']; if ($row_name['brewerState'] != "" ) echo ", ".$row_name['brewerState']; if ($row_name['brewerCountry'] != "" ) echo " ".$row_name['brewerCountry']; ?></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Printed <?php print date ( 'F j, Y' );?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
if ($row_pref['allowSpecifics'] == "Y") { include ('specifics.inc.php'); }
|
||||
if ($row_pref['allowGeneral'] == "Y") { include ('general.inc.php'); }
|
||||
if ($row_pref['allowComments'] == "Y") { if ($page == "logPrint") include ('comments.inc.php'); if ($page == "recipePrint") include ('notes.inc.php'); }
|
||||
if ($row_pref['allowRecipe'] == "Y") { include ('recipe.inc.php'); }
|
||||
if ($row_pref['allowMash'] == "Y") { include ('mash.inc.php'); }
|
||||
if (($page == "logPrint") && ($row_pref['allowWater'] == "Y")) { include ('water.inc.php'); }
|
||||
if ($row_pref['allowProcedure'] == "Y") { include ('procedure.inc.php'); }
|
||||
if (($page == "logPrint") && ($row_pref['allowSpecialProcedure'] == "Y")) { include ('special_procedure.inc.php'); }
|
||||
if ($row_pref['allowFermentation'] == "Y") { include ('fermentation.inc.php'); }
|
||||
?>
|
||||
|
||||
</div>
|
||||
<?php include ('water_amounts_calc.inc.php'); ?>
|
||||
<div id="rightcolumn">
|
||||
<div id="sidebarWrapper">
|
||||
<div id="sidebarHeader">BJCP Style Info</div>
|
||||
<table class="dataTable text_10">
|
||||
<tr>
|
||||
<td class="dataLabelWide">Style:</td>
|
||||
<td class="data"><?php echo $row_style['brewStyle']; ?></td>
|
||||
</tr>
|
||||
<?php if ($row_style['brewStyleOG'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide">O.G.:</td>
|
||||
<td class="data"><?php if ($row_style['brewStyleOG'] == "" ) echo "Varies"; elseif ($row_style['brewStyleOG'] == "Varies" ) echo "Varies"; elseif ($row_style['brewStyleOG'] == "N/A" ) echo "N/A"; else echo $row_style['brewStyleOG']." - ".$row_style['brewStyleOGMax']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_style['brewStyleFG'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide">F.G.:</td>
|
||||
<td class="data"><?php if ($row_style['brewStyleFG'] == "" ) echo "Varies"; elseif ($row_style['brewStyleFG'] == "Varies" ) echo "Varies"; elseif ($row_style['brewStyleFG'] == "N/A" ) echo "N/A"; else echo $row_style['brewStyleFG']." - ".$row_style['brewStyleFGMax']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_style['brewStyleABV'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide">ABV:</td>
|
||||
<td class="data"> <?php if ($row_style['brewStyleABV'] == "" ) echo "Varies"; elseif ($row_style['brewStyleABV'] == "Varies" ) echo "Varies"; elseif ($row_style['brewStyleABV'] == "N/A" ) echo "N/A"; else echo $row_style['brewStyleABV']." - ".$row_style['brewStyleABVMax']."%"; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_style['brewStyleIBU'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Bitterness:</td>
|
||||
<td class="data"><?php if ($row_style['brewStyleIBU'] == "" ) echo "Varies"; elseif ($row_style['brewStyleIBU'] == "Varies" ) echo "Varies"; elseif ($row_style['brewStyleIBU'] == "N/A" ) echo "N/A"; else echo $row_style['brewStyleIBU']." - ".$row_style['brewStyleIBUMax']." IBUs"; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ($row_style['brewStyleSRM'] != "" ) { ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Color:</td>
|
||||
<td class="data"><?php if ($row_style['brewStyleSRM'] == "" ) echo "Varies"; elseif ($row_style['brewStyleSRM'] == "Varies" ) echo "Varies"; elseif ($row_style['brewStyleSRM'] == "N/A" ) echo "N/A"; else echo ltrim($row_style['brewStyleSRM'], "0")." - ".ltrim($row_style['brewStyleSRMMax'], "0")." SRM"; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<?php if ($row_style['brewStyleInfo'] != "" ) { ?>
|
||||
<table class="dataTable text_10">
|
||||
<tr>
|
||||
<td class="dataLabelWide">Info:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $row_style['brewStyleInfo']; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div id="sidebarWrapper">
|
||||
<div id="sidebarHeader">Brew Day Data</div>
|
||||
<table class="dataTable text_10">
|
||||
<?php if ($row_log['brewMethod'] == "All Grain") { ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide "> </td>
|
||||
<td class="data">Target</td>
|
||||
<td class="data">Actual</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Str Water Amt:</td>
|
||||
<td class="data"><?php if ($row_pref['measFluid2'] == "liters") echo round ($mashWaterMet, 1); else echo round ($mashWater, 1); ?></td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Str Water Temp:</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Mash Temp:</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Mash Time:</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Sp Water Amt:</td>
|
||||
<td class="data"><?php if ($row_pref['measFluid2'] == "liters") echo round ($spargeWaterMet, 1); else echo round ($spargeWater, 1); ?></td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Sp Water Temp:</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Pre-Boil Grav:</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Pre-Boil Amt:</td>
|
||||
<td class="data"><?php echo round ($runoffVol, 1); ?></td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Post-Boil Amt:</td>
|
||||
<td class="data"><?php echo $finalBoilVol; ?></td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td class="dataLabelWide">Boil Time:</td>
|
||||
<td class="data"><?php echo $boilTime; ?></td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">O.G.:</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">____________</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabelWide">____________</td>
|
||||
<td class="data">______</td>
|
||||
<td class="data">______</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footerInclude">Printed using BrewBlogger <?php echo $version; ?>, brewing log software for PHP and MySQL, available at http://www.brewblogger.net.</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -22,8 +22,10 @@ for($i = 1; $i <= 9; ++$i) {
|
||||
$$malt = mysql_query($$query_malt, $brewing) or die(mysql_error());
|
||||
$$row_malt = mysql_fetch_assoc($$malt);
|
||||
$$totalRows_malt = mysql_num_rows($$malt);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Grist percentage calculations
|
||||
$totalExtract = (
|
||||
$row_log['brewExtract1Weight'] +
|
||||
@@ -1282,7 +1284,7 @@ if ($row_log['brewGrain1'] != "" ) { // hide entire set of grain rows if first n
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ((($row_log['brewYeast'] != "") && ($row_log['brewYeastProfile'] == "")) || (($row_log['brewYeast'] == "") && ($row_log['brewYeastProfile'] != ""))) { ?><div id="help"><a href="sections/reference.inc.php?section=yeast&source=log&KeepThis=true&TB_iframe=true&height=450&width=800" title="Yeast Reference" class="thickbox"><img src="<?php echo $imageSrc; ?>information.png" align="absmiddle" border="0" alt="Reference" /></a></div><div id="headerContent">Yeast</div><?php } ?>
|
||||
<?php if (($page == "recipePrint") || ($page == "logPrint")) echo ""; else { if ((($row_log['brewYeast'] != "") && ($row_log['brewYeastProfile'] == "")) || (($row_log['brewYeast'] == "") && ($row_log['brewYeastProfile'] != ""))) { ?><div id="help"><a href="sections/reference.inc.php?section=yeast&source=log&KeepThis=true&TB_iframe=true&height=450&width=800" title="Yeast Reference" class="thickbox"><img src="<?php echo $imageSrc; ?>information.png" align="absmiddle" border="0" alt="Reference" /></a></div><?php } } ?><div id="headerContent">Yeast</div>
|
||||
<?php if ($row_log['brewYeast'] != "") { // hide Yeast section if none listed (6) ?>
|
||||
<div id="dataContainer">
|
||||
<table class="dataTable">
|
||||
@@ -1363,4 +1365,3 @@ if ($row_log['brewYeastAmount'] != "" ) { ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!-- </div> -->
|
||||
|
||||
@@ -99,12 +99,10 @@
|
||||
} while ($row_recipeList = mysql_fetch_assoc($recipeList));
|
||||
?>
|
||||
</table>
|
||||
<?php if ($totalRows_recipeList > 10) { ?>
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
<td><div id="paginate"><?php echo $total." ".$row_pref['menuRecipes']." Total"; if ($total > $display) echo " •"; if ($view == "all") echo " • "; if ($total > $display) { echo " "; paginate($display, $pg, $total); if ($view == "limited") { ?> • <a href="?page=<?php echo $page; ?>&sort=<?php echo $sort; ?>&dir=<?php echo $dir; ?>&filter=<?php echo $filter; ?>&view=all">Entire List of <?php if (($row_pref['mode'] == "2") && ($filter != "all")) echo $row_user2['realFirstName']."'s "; echo $row_pref['menuRecipes']; ?></a><?php } } if ($view == "all") { ?><a href="?page=<?php echo $page; ?>&sort=<?php echo $sort; ?>&dir=<?php echo $dir; ?>&filter=<?php echo $filter; ?>&view=limited">Limited List of <?php if (($row_pref['mode'] == "2")&& ($filter != "all")) echo $row_user2['realFirstName']."'s "; echo $row_pref['menuRecipes']; ?></a><?php } ?></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php } ?>
|
||||
<td><div id="paginate"><?php echo $total." ".$row_pref['menuRecipes']." Total"; if ($total > $display) echo " •"; if ($view == "all") echo " • "; if ($total > $display) { echo " "; paginate($display, $pg, $total); if ($view == "limited") { ?> • <a href="?page=<?php echo $page; ?>&sort=<?php echo $sort; ?>&dir=<?php echo $dir; ?>&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=all">Entire List of <?php if (($row_pref['mode'] == "2") && ($filter != "all")) echo $row_user2['realFirstName']."'s "; echo $row_pref['menuRecipes']; ?></a><?php } } if (($view == "all") && ($total < $display)) { ?><a href="?page=<?php echo $page; ?>&sort=<?php echo $sort; ?>&dir=<?php echo $dir; ?>&filter=<?php echo $filter; ?>&style=<?php echo $style; ?>&view=limited">Limited List of <?php if (($row_pref['mode'] == "2")&& ($filter != "all")) echo $row_user2['realFirstName']."'s "; echo $row_pref['menuRecipes']; ?></a><?php } ?></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php } ?>
|
||||
Reference in New Issue
Block a user