www/import/from_brouwhulp.php

changeset 50
6d94167c2697
parent 49
4d27a7fb1265
child 51
7224109adfe1
equal deleted inserted replaced
49:4d27a7fb1265 50:6d94167c2697
462 $sql .= "', efficiency='" . floatval($recipe->EFFICIENCY); 462 $sql .= "', efficiency='" . floatval($recipe->EFFICIENCY);
463 if ($recipe->EST_OG) 463 if ($recipe->EST_OG)
464 $sql .= "', est_og='" . floatval($recipe->EST_OG); 464 $sql .= "', est_og='" . floatval($recipe->EST_OG);
465 if ($recipe->EST_FG) 465 if ($recipe->EST_FG)
466 $sql .= "', est_fg='" . floatval($recipe->EST_FG); 466 $sql .= "', est_fg='" . floatval($recipe->EST_FG);
467 if ($recipe->EST_COLOR) 467 if ($recipe->EST_COLOR) {
468 $sql .= "', est_color='" . floatval($recipe->EST_COLOR); 468 $srm = floatval($recipe->EST_COLOR);
469 $ebc = srm_to_ebc($srm);
470 $sql .= "', est_color='" . $ebc;
471 }
469 if ($recipe->COLOR_METHOD) 472 if ($recipe->COLOR_METHOD)
470 $sql .= "', color_method='" . mysqli_real_escape_string($db, $recipe->COLOR_METHOD); 473 $sql .= "', color_method='" . mysqli_real_escape_string($db, $recipe->COLOR_METHOD);
471 if ($recipe->IBU) 474 if ($recipe->IBU)
472 $sql .= "', est_ibu='" . floatval($recipe->IBU); 475 $sql .= "', est_ibu='" . floatval($recipe->IBU);
473 if ($recipe->IBU_METHOD) 476 if ($recipe->IBU_METHOD)
716 $steps .= ']'; 719 $steps .= ']';
717 $mash .= $steps; 720 $mash .= $steps;
718 } 721 }
719 722
720 $mash .= '}'; 723 $mash .= '}';
721 echo $mash . PHP_EOL; 724 // echo $mash . PHP_EOL;
722 $sql .= "', json_mash='" . $mash; 725 $sql .= "', json_mash='" . $mash;
723 if (strlen($mash) > $len_mash) 726 if (strlen($mash) > $len_mash)
724 $len_mash = strlen($mash); 727 $len_mash = strlen($mash);
725 } 728 }
726 729
743 //do_hops(); 746 //do_hops();
744 //do_yeasts(); 747 //do_yeasts();
745 //do_miscs(); 748 //do_miscs();
746 //do_waters(); 749 //do_waters();
747 //do_equipments(); 750 //do_equipments();
748 //do_styles(); 751 do_styles();
749 //do_mash(); 752 //do_mash();
750 do_recipes(); 753 do_recipes();
751 754
752 755
753 mysqli_close($db); 756 mysqli_close($db);

mercurial