www/includes/db_inventory_hops.php

changeset 33
2ee6ad5d6f14
parent 30
f5ab22446aa5
child 37
9362eb9e9e5b
--- a/www/includes/db_inventory_hops.php	Sun Aug 19 17:35:16 2018 +0200
+++ b/www/includes/db_inventory_hops.php	Sun Aug 19 21:46:56 2018 +0200
@@ -28,7 +28,7 @@
 	$sql .= "', origin='" . mysqli_real_escape_string($connect, $_GET['origin']);
 	$sql .= "', substitutes='" . mysqli_real_escape_string($connect, $_GET['substitutes']);
 	($_GET['always_on_stock'] == 'true') ? $sql .= "', always_on_stock='1" : $sql .= "', always_on_stock='0";
-	$sql .= "', inventory='" . $_GET['inventory'] / 1000.0;
+	$sql .= "', inventory='" . floatval($_GET['inventory']) / 1000.0;
 	$sql .= "', cost='" . $_GET['cost'];
 	$sql .= "', production_date='" . $_GET['production_date'];
 	$sql .= "', tht_date='" . $_GET['tht_date'];
@@ -58,7 +58,7 @@
 	$sql .= "', origin='" . mysqli_real_escape_string($connect, $_GET['origin']);
 	$sql .= "', substitutes='" . mysqli_real_escape_string($connect, $_GET['substitutes']);
 	($_GET['always_on_stock'] == 'true') ? $sql .= "', always_on_stock='1" : $sql .= "', always_on_stock='0";
-	$sql .= "', inventory='" . $_GET['inventory'] / 1000.0;
+	$sql .= "', inventory='" . floatval($_GET['inventory']) / 1000.0;
 	$sql .= "', cost='" . $_GET['cost'];
 	$sql .= "', production_date='" . $_GET['production_date'];
 	$sql .= "', tht_date='" . $_GET['tht_date'];
@@ -103,7 +103,7 @@
 			'origin' => $row['origin'],
 			'substitutes' => $row['substitutes'],
 			'always_on_stock' => $row['always_on_stock'],
-			'inventory' => $row['inventory'] * 1000,
+			'inventory' => floatval($row['inventory']) * 1000.0,
 			'cost' => $row['cost'],
 			'production_date' => $row['production_date'],
 			'tht_date' => $row['tht_date'],

mercurial