www/includes/db_inventory_yeasts.php

changeset 33
2ee6ad5d6f14
parent 20
22271f3598ac
child 37
9362eb9e9e5b
--- a/www/includes/db_inventory_yeasts.php	Sun Aug 19 17:35:16 2018 +0200
+++ b/www/includes/db_inventory_yeasts.php	Sun Aug 19 21:46:56 2018 +0200
@@ -25,7 +25,7 @@
 	$sql .= "', notes='" . mysqli_real_escape_string($connect, $_GET['notes']);
 	$sql .= "', best_for='" . mysqli_real_escape_string($connect, $_GET['best_for']);
 	$sql .= "', max_reuse='" . $_GET['max_reuse'];
-	$sql .= "', inventory='" . $_GET['inventory'];
+	$sql .= "', inventory='" . floatval($_GET['inventory']) / 1000.0;
 	$sql .= "', cost='" . $_GET['cost'];
 	$sql .= "', production_date='" . $_GET['production_date'];
 	$sql .= "', tht_date='" . $_GET['tht_date'];
@@ -52,7 +52,7 @@
 	$sql .= "', notes='" . mysqli_real_escape_string($connect, $_GET['notes']);
 	$sql .= "', best_for='" . mysqli_real_escape_string($connect, $_GET['best_for']);
 	$sql .= "', max_reuse='" . $_GET['max_reuse'];
-	$sql .= "', inventory='" . $_GET['inventory'];
+	$sql .= "', inventory='" . floatval($_GET['inventory']) / 1000.0;
 	$sql .= "', cost='" . $_GET['cost'];
 	$sql .= "', production_date='" . $_GET['production_date'];
 	$sql .= "', tht_date='" . $_GET['tht_date'];
@@ -94,7 +94,7 @@
 			'notes' => $row['notes'],
 			'best_for' => $row['best_for'],
 			'max_reuse' => $row['max_reuse'],
-			'inventory' => $row['inventory'],
+			'inventory' => floatval($row['inventory']) * 1000.0,
 			'cost' => $row['cost'],
 			'production_date' => $row['production_date'],
 			'tht_date' => $row['tht_date']

mercurial