www/import/from_brouwhulp.php

changeset 60
dbbe408108ea
parent 59
ad28e09e3abd
child 61
3469979f83be
--- a/www/import/from_brouwhulp.php	Fri Sep 21 17:10:41 2018 +0200
+++ b/www/import/from_brouwhulp.php	Sat Sep 22 15:02:43 2018 +0200
@@ -612,6 +612,13 @@
 				$hops .= ',"h_myrcene":' . floatval($hop->MYRCENE);
 				if ($hop->TOTAL_OIL)
 					$hops .= ',"h_total_oil":' . floatval($hop->TOTAL_OIL);
+				else
+					$hops .= ',"h_total_oil":0';
+				if ($hop->ORIGIN)
+					$hops .= ',"h_origin":"' . mysqli_real_escape_string($db, $hop->ORIGIN) . '"';
+				else
+					$hops .= ',"h_origin":""';
+
 				$hops .= "}";
 			}
 
@@ -636,11 +643,15 @@
 				$miscs .= ',"m_amount":' . floatval($misc->AMOUNT);
 				if ($misc->COST)
 					$miscs .= ',"m_cost":' . floatval($misc->COST);
+				else
+					$miscs .= ',"m_cost":0';
 				$miscs .= ',"m_type":"' . mysqli_real_escape_string($db, $misc->TYPE) . '"';
-				$miscs .= ',"m_use":"' . mysqli_real_escape_string($db, $misc->USE) . '"';
+				$miscs .= ',"m_use_use":"' . mysqli_real_escape_string($db, $misc->USE) . '"';
 				($misc->AMOUNT_IS_WEIGHT== "TRUE") ? $miscs .= ',"m_amount_is_weight":true' : $miscs.= ',"m_amount_is_weight":false';
 				if ($misc->TIME)
 					$miscs .= ',"m_time":' . floatval($misc->TIME);
+				else
+					$miscs .= ',"m_time":0';
 				$miscs .= "}";
 			}
 

mercurial