diff -r 217ba4596c4d -r 3c680d1dea35 www/includes/db_inventory_hops.php --- a/www/includes/db_inventory_hops.php Mon Oct 14 23:13:40 2019 +0200 +++ b/www/includes/db_inventory_hops.php Wed Oct 16 21:05:03 2019 +0200 @@ -2,6 +2,7 @@ require($_SERVER['DOCUMENT_ROOT']."/config.php"); require($_SERVER['DOCUMENT_ROOT']."/version.php"); +require($_SERVER['DOCUMENT_ROOT']."/includes/constants.php"); #Connect to the database @@ -27,8 +28,8 @@ $sql .= "', cohumulone='" . $_POST['cohumulone']; $sql .= "', myrcene='" . $_POST['myrcene']; $sql .= "', hsi='" . $_POST['hsi']; - $sql .= "', type='" . $_POST['type']; - $sql .= "', form='" . $_POST['form']; + $sql .= "', type='" . array_search($_POST['type'], $hoptype); + $sql .= "', form='" . array_search($_POST['form'], $hopform); $sql .= "', notes='" . mysqli_real_escape_string($connect, $_POST['notes']); $sql .= "', origin='" . mysqli_real_escape_string($connect, $_POST['origin']); $sql .= "', substitutes='" . mysqli_real_escape_string($connect, $_POST['substitutes']); @@ -91,8 +92,8 @@ 'cohumulone' => $row['cohumulone'], 'myrcene' => $row['myrcene'], 'hsi' => $row['hsi'], - 'type' => $row['type'], - 'form' => $row['form'], + 'type' => $hoptype[$row['type']], + 'form' => $hopform[$row['form']], 'notes' => $row['notes'], 'origin' => $row['origin'], 'substitutes' => $row['substitutes'],