www/includes/db_inventory_yeasts.php

changeset 201
f9b7e3f6be7c
parent 198
f0ec83e1e01f
child 296
69fadd1aded2
--- a/www/includes/db_inventory_yeasts.php	Thu Jan 24 20:54:45 2019 +0100
+++ b/www/includes/db_inventory_yeasts.php	Fri Jan 25 13:33:10 2019 +0100
@@ -31,7 +31,8 @@
 	$sql .= "', notes='" . mysqli_real_escape_string($connect, $_POST['notes']);
 	$sql .= "', best_for='" . mysqli_real_escape_string($connect, $_POST['best_for']);
 	$sql .= "', max_reuse='" . $_POST['max_reuse'];
-	$sql .= "', inventory='" . floatval($_POST['inventory']) / 1000.0;
+	$sql .= "', cells='" . floatval($_POST['cells']) * 1000000000.0;
+	$sql .= "', inventory='" . $_POST['inventory'];
 	$sql .= "', cost='" . $_POST['cost'] . "'";
 	if ($_POST['production_date'] == '')
 		$sql .= ", production_date=NULL";
@@ -92,10 +93,11 @@
 			'notes' => $row['notes'],
 			'best_for' => $row['best_for'],
 			'max_reuse' => $row['max_reuse'],
-			'inventory' => floatval($row['inventory']) * 1000.0,
+			'inventory' => $row['inventory'],
 			'cost' => $row['cost'],
 			'production_date' => $row['production_date'],
-			'tht_date' => $row['tht_date']
+			'tht_date' => $row['tht_date'],
+			'cells' => floatval($row['cells']) / 1000000000.0
 		);
 	}
 	echo json_encode($yeasts);

mercurial