www/includes/db_divides.php

changeset 774
92e1e8f175a2
parent 754
30abc8024afe
--- a/www/includes/db_divides.php	Sat Aug 21 16:14:44 2021 +0200
+++ b/www/includes/db_divides.php	Tue Aug 31 20:48:37 2021 +0200
@@ -354,6 +354,7 @@
 
 	$mashs = json_decode($row['json_mashs'], true);
 	for ($i = 0; $i < count($mashs); $i++) {
+	    $mashs[$i]['step_volume'] = sprintf("%.5f", $mashs[$i]['step_volume'] * $factor);
 	    $mashs[$i]['step_infuse_amount'] = sprintf("%.5f", $mashs[$i]['step_infuse_amount'] * $factor);
 	}
 	// syslog(LOG_NOTICE, "db_divide: " . str_replace($rescapers,$rreplacements,json_encode($mashs, JSON_UNESCAPED_UNICODE)));
@@ -394,12 +395,16 @@
 			$sql3 .= "', code='" . mysqli_real_escape_string($link, $split['code']);
 			$sql3 .= "', name='" . mysqli_real_escape_string($link, $split['name']);
 			$sql3 .= "', pv_mlt='" . $row3['pv_mlt'];
-			$sql3 .= "', pv_hlt='" . $row3['pv_hlt'];
-			$sql3 .= "', pv_room='" . $row3['pv_room'];
+			if (strlen($row3['pv_hlt']))
+			    $sql3 .= "', pv_hlt='" . $row3['pv_hlt'];
+			if (strlen($row3['pv_room']))
+			    $sql3 .= "', pv_room='" . $row3['pv_room'];
 			$sql3 .= "', sp_mlt='" . $row3['sp_mlt'];
-			$sql3 .= "', sp_hlt='" . $row3['sp_hlt'];
+			if (strlen($row3['sp_hlt']))
+			    $sql3 .= "', sp_hlt='" . $row3['sp_hlt'];
 			$sql3 .= "', pwm_mlt='" . $row3['pwm_mlt'];
-			$sql3 .= "', pwm_hlt='" . $row3['pwm_hlt'];
+			if (strlen($row3['pwm_hlt']))
+			    $sql3 .= "', pwm_hlt='" . $row3['pwm_hlt'];
 			$sql3 .= "', event='" . $row3['event'] . "';";
 			$result4 = mysqli_query($link, $sql3);
 			if (! $result4) {

mercurial