diff -r 481dbe0af222 -r c62ff53cfc3d www/includes/db_product.php --- a/www/includes/db_product.php Sun Dec 01 17:37:22 2019 +0100 +++ b/www/includes/db_product.php Mon Dec 02 13:24:34 2019 +0100 @@ -437,6 +437,13 @@ $yeast .= ',"y_tolerance":' . $item['y_tolerance']; $yeast .= ',"y_inventory":' . $item['y_inventory']; $yeast .= ',"y_use":' . $item['y_use']; + $yeast .= ',"y_sta1":' . $item['y_sta1']; + $yeast .= ',"y_bacteria":' . $item['y_bacteria']; + $yeast .= ',"y_harvest_top":' . $item['y_harvest_top']; + $yeast .= ',"y_harvest_time":' . $item['y_harvest_time']; + $yeast .= ',"y_pitch_temperature":' . $item['y_pitch_temperature']; + $yeast .= ',"y_pofpos":' . $item['y_pofpos']; + $yeast .= ',"y_zymocide":' . $item['y_zymocide']; $yeast .= ',"y_cost":' . $item['y_cost'] . '}'; //syslog(LOG_NOTICE, $yeast); $yeasts .= $yeast; @@ -931,7 +938,8 @@ $yeasts[$i]['y_avail'] = 0; // Ingredient not in db if (! isset($yeasts[$i]['y_tolerance'])) $yeasts[$i]['y_tolerance'] = 0; - $sql2 = "SELECT inventory,tolerance FROM inventory_yeasts "; + $sql2 = "SELECT inventory,tolerance,sta1,bacteria,harvest_top,harvest_time,pitch_temperature,pofpos,zymocide "; + $sql2 .= "FROM inventory_yeasts "; $sql2 .= "WHERE name='".str_replace($rescapers, $rreplacements, $yeasts[$i]['y_name'])."' AND"; $sql2 .= " form='".str_replace($rescapers, $rreplacements, $yeasts[$i]['y_form'])."' AND"; $sql2 .= " laboratory='".str_replace($rescapers, $rreplacements, $yeasts[$i]['y_laboratory'])."' AND"; @@ -940,9 +948,23 @@ if ($obj = mysqli_fetch_object($result2)) { $yeasts[$i]['y_inventory'] = floatval($obj->inventory); $yeasts[$i]['y_avail'] = 1; - if ($yeasts[$i]['y_tolerance'] == 0) { + if ($yeasts[$i]['y_tolerance'] == 0) $yeasts[$i]['y_tolerance'] = floatval($obj->tolerance); // Upgrade alcohol tolerance - } + // Upgrade new fields + if (! isset($yeasts[$i]['y_sta1'])) + $yeasts[$i]['y_sta1'] = intval($obj->sta1); + if (! isset($yeasts[$i]['y_bacteria'])) + $yeasts[$i]['y_bacteria'] = intval($obj->bacteria); + if (! isset($yeasts[$i]['y_harvest_top'])) + $yeasts[$i]['y_harvest_top'] = intval($obj->harvest_top); + if (! isset($yeasts[$i]['y_harvest_time'])) + $yeasts[$i]['y_harvest_time'] = intval($obj->harvest_time); + if (! isset($yeasts[$i]['y_pitch_temperature'])) + $yeasts[$i]['y_pitch_temperature'] = floatval($obj->pitch_temperature); + if (! isset($yeasts[$i]['y_pofpos'])) + $yeasts[$i]['y_pofpos'] = intval($obj->pofpos); + if (! isset($yeasts[$i]['y_zymocide'])) + $yeasts[$i]['y_zymocide'] = intval($obj->zymocide); } mysqli_free_result($result2); }