Removed the rest of the database editors, all is now better and completer in the new application.

Mon, 01 Aug 2022 13:26:18 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 01 Aug 2022 13:26:18 +0200
changeset 801
55c2510891b8
parent 800
3775ee26657f
child 802
4a9f469d2201

Removed the rest of the database editors, all is now better and completer in the new application.

www/Makefile file | annotate | diff | comparison | revisions
www/export_equipments.php file | annotate | diff | comparison | revisions
www/export_fermentables.php file | annotate | diff | comparison | revisions
www/export_mashs.php file | annotate | diff | comparison | revisions
www/export_miscs.php file | annotate | diff | comparison | revisions
www/export_styles.php file | annotate | diff | comparison | revisions
www/export_waters.php file | annotate | diff | comparison | revisions
www/export_yeasts.php file | annotate | diff | comparison | revisions
www/includes/global.inc.php file | annotate | diff | comparison | revisions
www/inv_equipments.php file | annotate | diff | comparison | revisions
www/inv_fermentables.php file | annotate | diff | comparison | revisions
www/inv_miscs.php file | annotate | diff | comparison | revisions
www/inv_waters.php file | annotate | diff | comparison | revisions
www/inv_yeasts.php file | annotate | diff | comparison | revisions
www/js/inv_equipments.js file | annotate | diff | comparison | revisions
www/js/inv_fermentables.js file | annotate | diff | comparison | revisions
www/js/inv_miscs.js file | annotate | diff | comparison | revisions
www/js/inv_waters.js file | annotate | diff | comparison | revisions
www/js/inv_yeasts.js file | annotate | diff | comparison | revisions
--- a/www/Makefile	Mon Aug 01 09:56:23 2022 +0200
+++ b/www/Makefile	Mon Aug 01 13:26:18 2022 +0200
@@ -3,16 +3,11 @@
 
 include ../Makefile.global
 
-SRC		= config.php.dist crontasks.php \
-		  export_equipments.php export_fermentables.php export_mashs.php \
-		  export_miscs.php export_styles.php export_waters.php \
-		  export_yeasts.php favicon.ico gen_about.php \
+SRC		= config.php.dist crontasks.php favicon.ico gen_about.php \
 		  getbrewlog.php getco2meter.php getco2pressurelog.php getfermentablesources.php \
 		  getfermenter.php getfermentlog.php gethopsources.php getmiscsources.php getnode.php \
 		  getwatersources.php getyeastsources.php getispindel.php getispindellog.php \
 		  import_ingredients.php index.php \
-		  inv_equipments.php inv_fermentables.php \
-		  inv_miscs.php inv_waters.php inv_yeasts.php \
 		  log_brew.php log_co2pressure.php log_fermentation.php log_ispindel.php \
 		  mon_brewer.php mon_co2meter.php mon_fermenter.php mon_ispindel.php mon_node.php \
 		  prod_archive_code.php prod_archive_date.php prod_archive_name.php prod_beerxml.php \
--- a/www/export_equipments.php	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/config.php');
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php');
-
-
-$link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
-if (! $link) {
-	die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
-}
-if (! mysqli_set_charset($link, "utf8" )) {
-	echo "error";
-	return 1;
-}
-
-$result = mysqli_query($link, "SELECT * FROM inventory_equipments ORDER BY name");
-
-
-/*
- * Create beerxml output
- */
-$xw = xmlwriter_open_memory();
-xmlwriter_set_indent($xw, 1);
-$res = xmlwriter_set_indent_string($xw, ' ');
-
-xmlwriter_start_document($xw, '1.0', 'UTF-8');
-
-
-xmlwriter_start_element($xw, 'EQUIPMENTS');
-while ($row = mysqli_fetch_array($result)) {
-
-	xmlwriter_start_element($xw, 'EQUIPMENT');
-
-	xmlwriter_start_element($xw, 'VERSION');
-	xmlwriter_text($xw, '1');
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'NAME');
-	xmlwriter_text($xw, $row['name']);
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'NOTES');
-        xmlwriter_text($xw, $row['notes']);
-        xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'BOIL_SIZE');
-        xmlwriter_text($xw, sprintf("%.4f", floatval($row['boil_size'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'BATCH_SIZE');
-        xmlwriter_text($xw, sprintf("%.4f", floatval($row['batch_size'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'TUN_VOLUME');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['tun_volume'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'TUN_WEIGHT');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['tun_weight'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'TUN_SPECIFIC_HEAT');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['tun_specific_heat'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'TUN_HEIGHT');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['tun_height'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'TRUB_CHILLER_LOSS');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['trub_chiller_loss'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'EVAP_RATE');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['evap_rate'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'BOIL_TIME');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['boil_time'])));
-        xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'CALC_BOIL_VOLUME');
-        ($row['calc_boil_volume'] > 0) ? xmlwriter_text($xw, 'TRUE') : xmlwriter_text($xw, 'FALSE');
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'TOP_UP_KETTLE');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['top_up_kettle'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'HOP_UTILIZATION');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['hop_utilization'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'LAUTER_VOLUME');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['lauter_volume'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'LAUTER_HEIGHT');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['lauter_height'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'LAUTER_DEADSPACE');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['lauter_deadspace'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'KETTLE_VOLUME');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['kettle_volume'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'KETTLE_HEIGHT');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['kettle_height'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'MASH_VOLUME');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['mash_volume'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'EFFICIENCY');
-        xmlwriter_text($xw, sprintf("%.5f", floatval($row['efficiency'])));
-        xmlwriter_end_element($xw);
-
-	xmlwriter_end_element($xw);	// EQUIPMENT
-}
-xmlwriter_end_element($xw);	// EQUIPMENTS
-
-$beerxml = xmlwriter_output_memory($xw);
-
-Header('Content-type: text/xml');
-header('Content-Disposition: attachment; filename="equipments.xml"');
-header('Content-Transfer-Encoding: binary');
-header('Expires: 0');
-header('Pragma: no-cache');
-header('Content-Length: '.strlen($beerxml));
-exit($beerxml);
--- a/www/export_fermentables.php	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/config.php');
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php');
-
-
-$link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
-if (! $link) {
-	die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
-}
-if (! mysqli_set_charset($link, "utf8" )) {
-	echo "error";
-	return 1;
-}
-
-$result = mysqli_query($link, "SELECT * FROM inventory_fermentables ORDER BY supplier,name");
-
-
-$fermentabletype = array( 'Grain', 'Sugar', 'Extract', 'Dry extract', 'Adjunct' );
-$graintype = array( 'Base', 'Roast', 'Crystal', 'Kilned', 'Sour malt', 'Special', 'No malt' );
-$addedtype = array( 'Mash', 'Boil', 'Fermentation', 'Lagering', 'Bottle', 'Kegs' );
-
-/*
- * Create beerxml output
- */
-$xw = xmlwriter_open_memory();
-xmlwriter_set_indent($xw, 1);
-$res = xmlwriter_set_indent_string($xw, ' ');
-
-xmlwriter_start_document($xw, '1.0', 'UTF-8');
-
-
-xmlwriter_start_element($xw, 'FERMENTABLES');
-while ($row = mysqli_fetch_array($result)) {
-
-	xmlwriter_start_element($xw, 'FERMENTABLE');
-
-	xmlwriter_start_element($xw, 'VERSION');
-	xmlwriter_text($xw, '1');
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'NAME');
-	xmlwriter_text($xw, $row['name']);
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'NOTES');
-        xmlwriter_text($xw, $row['notes']);
-        xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'TYPE');
-	xmlwriter_text($xw, $fermentabletype[$row['type']]);
-	xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'YIELD');
-        xmlwriter_text($xw, sprintf("%.5f",floatval($row['yield'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'COLOR');
-        xmlwriter_text($xw, sprintf("%.3f",ebc_to_srm(floatval($row['color']))));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'ADD_AFTER_BOIL');
-        ($row['add_after_boil']) ? xmlwriter_text($xw, 'TRUE') : xmlwriter_text($xw, 'FALSE');
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'ORIGIN');
-        xmlwriter_text($xw, $row['origin']);
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'SUPPLIER');
-        xmlwriter_text($xw, $row['supplier']);
-        xmlwriter_end_element($xw);
-
-        if (floatval($row['coarse_fine_diff'])) {
-                xmlwriter_start_element($xw, 'COARSE_FINE_DIFF');
-                xmlwriter_text($xw, sprintf("%.4f",floatval($row['coarse_fine_diff'])));
-                xmlwriter_end_element($xw);
-        }
-
-        if (floatval($row['moisture'])) {
-                xmlwriter_start_element($xw, 'MOISTURE');
-                xmlwriter_text($xw, sprintf("%.4f",floatval($row['moisture'])));
-                xmlwriter_end_element($xw);
-        }
-
-        if (floatval($row['diastatic_power'])) {
-                xmlwriter_start_element($xw, 'DIASTATIC_POWER');
-                xmlwriter_text($xw, sprintf("%.4f",floatval($row['diastatic_power'])));
-                xmlwriter_end_element($xw);
-        }
-
-        if (floatval($row['protein'])) {
-                xmlwriter_start_element($xw, 'PROTEIN');
-                xmlwriter_text($xw, sprintf("%.4f",floatval($row['protein'])));
-                xmlwriter_end_element($xw);
-        }
-
-        if (floatval($row['max_in_batch'])) {
-                xmlwriter_start_element($xw, 'MAX_IN_BATCH');
-                xmlwriter_text($xw, sprintf("%.3f",floatval($row['max_in_batch'])));
-                xmlwriter_end_element($xw);
-        }
-
-        xmlwriter_start_element($xw, 'RECOMMEND_MASH');
-        ($row['recommend_mash']) ? xmlwriter_text($xw, 'TRUE') : xmlwriter_text($xw, 'FALSE');
-        xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'DISPLAY_COLOR');
-        xmlwriter_text($xw, sprintf("%.0f EBC",floatval($row['color'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'GRAINTYPE');
-        xmlwriter_text($xw, $graintype[$row['graintype']]);
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'ADDED');
-        xmlwriter_text($xw, $addedtype[$row['added']]);
-        xmlwriter_end_element($xw);
-
-	if (floatval($row['di_ph'])) {
-                xmlwriter_start_element($xw, 'DI_pH');
-                xmlwriter_text($xw, sprintf("%.5f",floatval($row['di_ph'])));
-                xmlwriter_end_element($xw);
-        }
-
-	if (floatval($row['acid_to_ph_57'])) {
-                xmlwriter_start_element($xw, 'ACID_TO_pH_5.7');
-                xmlwriter_text($xw, sprintf("%.5f",floatval($row['acid_to_ph_57'])));
-                xmlwriter_end_element($xw);
-        }
-
-	xmlwriter_end_element($xw);	// FERMENTABLE
-}
-xmlwriter_end_element($xw);	// FERMENTABLES
-
-$beerxml = xmlwriter_output_memory($xw);
-
-Header('Content-type: text/xml');
-header('Content-Disposition: attachment; filename="fermentables.xml"');
-header('Content-Transfer-Encoding: binary');
-header('Expires: 0');
-header('Pragma: no-cache');
-header('Content-Length: '.strlen($beerxml));
-exit($beerxml);
--- a/www/export_mashs.php	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/config.php');
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php');
-
-
-$link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
-if (! $link) {
-	die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
-}
-if (! mysqli_set_charset($link, "utf8" )) {
-	echo "error";
-	return 1;
-}
-
-$result = mysqli_query($link, "SELECT * FROM profile_mash ORDER BY name");
-
-
-$mashsteptype = array( 'Infusion', 'Temperature', 'Decoction' );
-
-
-/*
- * Create beerxml output
- */
-$xw = xmlwriter_open_memory();
-xmlwriter_set_indent($xw, 1);
-$res = xmlwriter_set_indent_string($xw, ' ');
-
-xmlwriter_start_document($xw, '1.0', 'UTF-8');
-
-
-xmlwriter_start_element($xw, 'MASHS');
-while ($row = mysqli_fetch_array($result)) {
-
-	xmlwriter_start_element($xw, 'MASH');
-
-	xmlwriter_start_element($xw, 'VERSION');
-	xmlwriter_text($xw, '1');
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'NAME');
-	xmlwriter_text($xw, $row['name']);
-	xmlwriter_end_element($xw);
-
-	if (strlen($row['notes'])) {
-        	xmlwriter_start_element($xw, 'NOTES');
-        	xmlwriter_text($xw, $row['notes']);
-        	xmlwriter_end_element($xw);
-	}
-
-	xmlwriter_start_element($xw, 'MASH_STEPS');
-	$arr = json_decode($row['steps'], true);
-	foreach($arr as $item) { //foreach element in $arr
-        	xmlwriter_start_element($xw, 'MASH_STEP');
-
-        	xmlwriter_start_element($xw, 'VERSION');
-        	xmlwriter_text($xw, '1');
-        	xmlwriter_end_element($xw);
-
-        	xmlwriter_start_element($xw, 'NAME');
-        	xmlwriter_text($xw, $item['step_name']);
-        	xmlwriter_end_element($xw);
-
-        	xmlwriter_start_element($xw, 'TYPE');
-        	xmlwriter_text($xw, $mashsteptype[$item['step_type']]);
-        	xmlwriter_end_element($xw);
-
-        	xmlwriter_start_element($xw, 'STEP_TEMP');
-        	xmlwriter_text($xw, sprintf("%.4f",floatval($item['step_temp'])));
-        	xmlwriter_end_element($xw);
-
-        	xmlwriter_start_element($xw, 'STEP_TIME');
-        	xmlwriter_text($xw, sprintf("%.3f",floatval($item['step_time'])));
-        	xmlwriter_end_element($xw);
-
-        	xmlwriter_start_element($xw, 'RAMP_TIME');
-        	xmlwriter_text($xw, sprintf("%.3f",floatval($item['ramp_time'])));
-        	xmlwriter_end_element($xw);
-
-        	xmlwriter_start_element($xw, 'END_TEMP');
-        	xmlwriter_text($xw, sprintf("%.4f",floatval($item['end_temp'])));
-        	xmlwriter_end_element($xw);
-
-        	xmlwriter_end_element($xw);     // MASH_STEP
-	}
-
-	xmlwriter_end_element($xw);     // MASH_STEPS
-	xmlwriter_end_element($xw);	// MASH
-}
-xmlwriter_end_element($xw);	// MASHS
-
-$beerxml = xmlwriter_output_memory($xw);
-
-Header('Content-type: text/xml');
-header('Content-Disposition: attachment; filename="mashs.xml"');
-header('Content-Transfer-Encoding: binary');
-header('Expires: 0');
-header('Pragma: no-cache');
-header('Content-Length: '.strlen($beerxml));
-exit($beerxml);
--- a/www/export_miscs.php	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/config.php');
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php');
-
-
-$link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
-if (! $link) {
-	die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
-}
-if (! mysqli_set_charset($link, "utf8" )) {
-	echo "error";
-	return 1;
-}
-
-$result = mysqli_query($link, "SELECT * FROM inventory_miscs ORDER BY name");
-
-
-$misctype = array( 'Spice', 'Herb', 'Flavor', 'Fining', 'Water agent', 'Yeast nutrient', 'Other' );
-$miscuse = array( 'Starter', 'Mash', 'Boil', 'Primary', 'Secondary', 'Bottling' );
-
-
-
-/*
- * Create beerxml output
- */
-$xw = xmlwriter_open_memory();
-xmlwriter_set_indent($xw, 1);
-$res = xmlwriter_set_indent_string($xw, ' ');
-
-xmlwriter_start_document($xw, '1.0', 'UTF-8');
-
-
-xmlwriter_start_element($xw, 'MISCS');
-while ($row = mysqli_fetch_array($result)) {
-
-	xmlwriter_start_element($xw, 'MISC');
-
-	xmlwriter_start_element($xw, 'VERSION');
-	xmlwriter_text($xw, '1');
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'NAME');
-	xmlwriter_text($xw, $row['name']);
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'TYPE');
-	xmlwriter_text($xw, $misctype[$row['type']]);
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'AMOUNT_IS_WEIGHT');
-	($row['amount_is_weight']) ? xmlwriter_text($xw, 'TRUE') : xmlwriter_text($xw, 'FALSE');
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'USE');
-	xmlwriter_text($xw, $miscuse[$row['use_use']]);
-	xmlwriter_end_element($xw);
-
-	if (floatval($row['time']) > 0) {
-		xmlwriter_start_element($xw, 'TIME');
-		xmlwriter_text($xw, sprintf("%.3f",floatval($row['time'])));
-		xmlwriter_end_element($xw);
-	}
-
-	if (floatval($row['cost']) > 0) {
-		xmlwriter_start_element($xw, 'COST');
-		xmlwriter_text($xw, sprintf("%.5f",floatval($row['cost'])));
-		xmlwriter_end_element($xw);
-	}
-
-	xmlwriter_start_element($xw, 'ALWAYS_ON_STOCK');
-	($row['always_on_stock']) ? xmlwriter_text($xw, 'TRUE') : xmlwriter_text($xw, 'FALSE');
-	xmlwriter_end_element($xw);
-
-	if (strlen($row['notes'])) {
-		xmlwriter_start_element($xw, 'NOTES');
-		xmlwriter_text($xw, $row['notes']);
-		xmlwriter_end_element($xw);
-	}
-
-	if (strlen($row['use_for'])) {
-		xmlwriter_start_element($xw, 'USE_FOR');
-		xmlwriter_text($xw, $row['use_for']);
-		xmlwriter_end_element($xw);
-	}
-
-	xmlwriter_end_element($xw);	// MISC
-}
-xmlwriter_end_element($xw);	// MISCS
-
-$beerxml = xmlwriter_output_memory($xw);
-
-Header('Content-type: text/xml');
-header('Content-Disposition: attachment; filename="miscs.xml"');
-header('Content-Transfer-Encoding: binary');
-header('Expires: 0');
-header('Pragma: no-cache');
-header('Content-Length: '.strlen($beerxml));
-exit($beerxml);
--- a/www/export_styles.php	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/config.php');
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php');
-
-
-$link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
-if (! $link) {
-	die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
-}
-if (! mysqli_set_charset($link, "utf8" )) {
-	echo "error";
-	return 1;
-}
-
-$result = mysqli_query($link, "SELECT * FROM profile_styles ORDER BY style_guide,style_letter,name");
-
-
-$styletype = array( 'Lager', 'Ale', 'Mead', 'Wheat', 'Mixed', 'Cider' );
-
-
-/*
- * Create beerxml output
- */
-$xw = xmlwriter_open_memory();
-xmlwriter_set_indent($xw, 1);
-$res = xmlwriter_set_indent_string($xw, ' ');
-
-xmlwriter_start_document($xw, '1.0', 'UTF-8');
-
-
-xmlwriter_start_element($xw, 'STYLES');
-while ($row = mysqli_fetch_array($result)) {
-
-	xmlwriter_start_element($xw, 'STYLE');
-
-	xmlwriter_start_element($xw, 'VERSION');
-	xmlwriter_text($xw, '1');
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'NAME');
-	xmlwriter_text($xw, $row['name']);
-	xmlwriter_end_element($xw);
-
-//	if (strlen($row['category'])) {
-		xmlwriter_start_element($xw, 'CATEGORY');
-		xmlwriter_text($xw, $row['category']);
-		xmlwriter_end_element($xw);
-
-		xmlwriter_start_element($xw, 'CATEGORY_NUMBER');
-		xmlwriter_text($xw, $row['category_number']);
-		xmlwriter_end_element($xw);
-//	}
-
-	xmlwriter_start_element($xw, 'STYLE_LETTER');
-	xmlwriter_text($xw, $row['style_letter']);
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'STYLE_GUIDE');
-	xmlwriter_text($xw, $row['style_guide']);
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'TYPE');
-	xmlwriter_text($xw, $styletype[$row['type']]);
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'OG_MIN');
-	xmlwriter_text($xw, sprintf("%.6f",floatval($row['og_min'])));
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'OG_MAX');
-	xmlwriter_text($xw, sprintf("%.6f",floatval($row['og_max'])));
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'FG_MIN');
-	xmlwriter_text($xw, sprintf("%.6f",floatval($row['fg_min'])));
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'FG_MAX');
-	xmlwriter_text($xw, sprintf("%.6f",floatval($row['fg_max'])));
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'IBU_MIN');
-	xmlwriter_text($xw, sprintf("%.3f",floatval($row['ibu_min'])));
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'IBU_MAX');
-	xmlwriter_text($xw, sprintf("%.3f",floatval($row['ibu_max'])));
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'COLOR_MIN');
-	xmlwriter_text($xw, sprintf("%.3f",ebc_to_srm(floatval($row['color_min']))));
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'COLOR_MAX');
-	xmlwriter_text($xw, sprintf("%.3f",ebc_to_srm(floatval($row['color_max']))));
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'CARB_MIN');
-	xmlwriter_text($xw, sprintf("%.4f",floatval($row['carb_min'])));
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'CARB_MAX');
-	xmlwriter_text($xw, sprintf("%.4f",floatval($row['carb_max'])));
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'ABV_MIN');
-	xmlwriter_text($xw, sprintf("%.4f",floatval($row['abv_min'])));
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'ABV_MAX');
-	xmlwriter_text($xw, sprintf("%.4f",floatval($row['abv_max'])));
-	xmlwriter_end_element($xw);
-
-	if (strlen($row['notes'])) {
-		xmlwriter_start_element($xw, 'NOTES');
-        	xmlwriter_text($xw, $row['notes']);
-        	xmlwriter_end_element($xw);
-	}
-
-        if (strlen($row['profile'])) {
-                xmlwriter_start_element($xw, 'PROFILE');
-                xmlwriter_text($xw, $row['profile']);
-                xmlwriter_end_element($xw);
-        }
-
-        if (strlen($row['ingredients'])) {
-                xmlwriter_start_element($xw, 'INGREDIENTS');
-                xmlwriter_text($xw, $row['ingredients']);
-                xmlwriter_end_element($xw);
-        }
-
-        if (strlen($row['examples'])) {
-                xmlwriter_start_element($xw, 'EXAMPLES');
-                xmlwriter_text($xw, $row['examples']);
-                xmlwriter_end_element($xw);
-        }
-
-	xmlwriter_end_element($xw);	// STYLE
-}
-xmlwriter_end_element($xw);	// STYLES
-
-$beerxml = xmlwriter_output_memory($xw);
-
-Header('Content-type: text/xml');
-header('Content-Disposition: attachment; filename="styles.xml"');
-header('Content-Transfer-Encoding: binary');
-header('Expires: 0');
-header('Pragma: no-cache');
-header('Content-Length: '.strlen($beerxml));
-exit($beerxml);
--- a/www/export_waters.php	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/config.php');
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php');
-
-
-$link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
-if (! $link) {
-	die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
-}
-if (! mysqli_set_charset($link, "utf8" )) {
-	echo "error";
-	return 1;
-}
-
-$result = mysqli_query($link, "SELECT * FROM inventory_waters ORDER BY name");
-
-
-
-/*
- * Create beerxml output
- */
-$xw = xmlwriter_open_memory();
-xmlwriter_set_indent($xw, 1);
-$res = xmlwriter_set_indent_string($xw, ' ');
-
-xmlwriter_start_document($xw, '1.0', 'UTF-8');
-
-
-xmlwriter_start_element($xw, 'WATERS');
-while ($row = mysqli_fetch_array($result)) {
-
-	xmlwriter_start_element($xw, 'WATER');
-
-	xmlwriter_start_element($xw, 'VERSION');
-	xmlwriter_text($xw, '1');
-	xmlwriter_end_element($xw);
-
-	xmlwriter_start_element($xw, 'NAME');
-	xmlwriter_text($xw, $row['name']);
-	xmlwriter_end_element($xw);
-
-	if (floatval($row['cost']) > 0) {
-                xmlwriter_start_element($xw, 'COST');
-                xmlwriter_text($xw, sprintf("%.5f",floatval($row['cost'])));
-                xmlwriter_end_element($xw);
-        }
-
-        if (strlen($row['notes'])) {
-                xmlwriter_start_element($xw, 'NOTES');
-                xmlwriter_text($xw, $row['notes']);
-                xmlwriter_end_element($xw);
-        }
-
-	xmlwriter_start_element($xw, 'CALCIUM');
-        xmlwriter_text($xw, sprintf("%.4f",floatval($row['calcium'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'BICARBONATE');
-        xmlwriter_text($xw, sprintf("%.4f",floatval($row['bicarbonate'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'SULFATE');
-        xmlwriter_text($xw, sprintf("%.4f",floatval($row['sulfate'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'CHLORIDE');
-        xmlwriter_text($xw, sprintf("%.4f",floatval($row['chloride'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'SODIUM');
-        xmlwriter_text($xw, sprintf("%.4f",floatval($row['sodium'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'MAGNESIUM');
-        xmlwriter_text($xw, sprintf("%.4f",floatval($row['magnesium'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'TOTAL_ALKALINITY');
-        xmlwriter_text($xw, sprintf("%.4f",floatval($row['total_alkalinity'])));
-        xmlwriter_end_element($xw);
-
-        xmlwriter_start_element($xw, 'PH');
-        xmlwriter_text($xw, sprintf("%.5f",floatval($row['ph'])));
-        xmlwriter_end_element($xw);
-
-	xmlwriter_end_element($xw);	// WATER
-}
-xmlwriter_end_element($xw);	// WATERS
-
-$beerxml = xmlwriter_output_memory($xw);
-
-Header('Content-type: text/xml');
-header('Content-Disposition: attachment; filename="waters.xml"');
-header('Content-Transfer-Encoding: binary');
-header('Expires: 0');
-header('Pragma: no-cache');
-header('Content-Length: '.strlen($beerxml));
-exit($beerxml);
--- a/www/export_yeasts.php	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/config.php');
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php');
-
-
-$link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
-if (! $link) {
-	die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
-}
-if (! mysqli_set_charset($link, "utf8" )) {
-	echo "error";
-	return 1;
-}
-
-$result = mysqli_query($link, "SELECT * FROM inventory_yeasts ORDER BY laboratory,product_id,name");
-
-function field($x, $field, $value) {
-        xmlwriter_start_element($x, $field);
-        xmlwriter_text($x, $value);
-        xmlwriter_end_element($x);
-}
-
-$yeasttype = array( 'Lager', 'Ale', 'Wheat', 'Wine', 'Champagne', 'Other', 'Other', 'Other', 'Other', 'Other' );
-$yeastform = array( 'Liquid', 'Dry', 'Slant', 'Culture', 'Frozen', 'Bottle', 'Dry' );
-$yeastflocculation = array( 'Low', 'Medium', 'High', 'Very high' );
-
-
-/*
- * Create beerxml output
- */
-$xw = xmlwriter_open_memory();
-xmlwriter_set_indent($xw, 1);
-$res = xmlwriter_set_indent_string($xw, ' ');
-
-xmlwriter_start_document($xw, '1.0', 'UTF-8');
-
-
-xmlwriter_start_element($xw, 'YEASTS');
-while ($row = mysqli_fetch_array($result)) {
-
-	xmlwriter_start_element($xw, 'YEAST');
-
-	field($xw, 'VERSION', '1');
-	field($xw, 'NAME', $row['name']);
-	field($xw, 'TYPE', $yeasttype[$row['type']]);
-	field($xw, 'FORM', $yeastform[$row['form']]);
-	field($xw, 'AMOUNT_IS_WEIGHT', ($row['form'] == '1' || $row['form'] == '6') ? 'TRUE':'FALSE');
-	field($xw, 'LABORATORY', $row['laboratory']);
-	if (strlen($row['product_id']))
-		field($xw, 'PRODUCT_ID', $row['product_id']);
-	field($xw, 'MIN_TEMPERATURE', sprintf("%.4f",floatval($row['min_temperature'])));
-	field($xw, 'MAX_TEMPERATURE', sprintf("%.4f",floatval($row['max_temperature'])));
-	field($xw, 'ATTENUATION', sprintf("%.4f",floatval($row['attenuation'])));
-	field($xw, 'ADD_TO_SECONDARY', ($row['use'] == 0) ? 'FALSE':'TRUE');
-	field($xw, 'FLOCCULATION', $yeastflocculation[$row['flocculation']]);
-	field($xw, 'MAX_REUSE', $row['max_reuse']);
-	if (floatval($row['cost']) > 0)
-		field($xw, 'COST', sprintf("%.5f",floatval($row['cost'])));
-	if (strlen($row['notes']))
-		field($xw, 'NOTES', $row['notes']);
-
-	xmlwriter_end_element($xw);	// YEAST
-}
-xmlwriter_end_element($xw);	// YEASTS
-
-$beerxml = xmlwriter_output_memory($xw);
-
-Header('Content-type: text/xml');
-header('Content-Disposition: attachment; filename="yeasts.xml"');
-header('Content-Transfer-Encoding: binary');
-header('Expires: 0');
-header('Pragma: no-cache');
-header('Content-Length: '.strlen($beerxml));
-exit($beerxml);
--- a/www/includes/global.inc.php	Mon Aug 01 09:56:23 2022 +0200
+++ b/www/includes/global.inc.php	Mon Aug 01 13:26:18 2022 +0200
@@ -253,15 +253,6 @@
        <li><img style='float: left; margin-right: 5px;' src='images/insert-object.png' /><a href="rec_import.php">Import beerxml</a></li>
       </ul>
      </li>
-     <li style='width: 80px;'>Inventaris
-      <ul style='width: 250px;'>
-       <li><img style='float: left; margin-right: 5px;' src='images/graan.png' /><a href="inv_fermentables.php">Vergistbare ingredienten</a></li>
-       <li><img style='float: left; margin-left: 4px; margin-right: 9px;' src='images/erlenmeyer.png' /><a href="inv_yeasts.php">Gisten</a></li>
-       <li><img style='float: left; margin-right: 5px;' src='images/peper.png' /><a href="inv_miscs.php">Overige ingredienten</a></li>
-       <li><img style='float: left; margin-left: 3px; margin-right: 9px;' src='images/water.png' /><a href="inv_waters.php">Brouwwater</a></li>
-       <li><img style='float: left; margin-right: 5px;' src='images/mash.png' /><a href="inv_equipments.php">Brouw apparatuur</a></li>
-      </ul>
-     </li>
      <li style='width: 80px;'>Over
       <ul style='width: 150px;'>
        <li><img style='float: left; margin-right: 5px;' src='images/help-about.png' /><a href="gen_about.php">Informatie</a></li>
--- a/www/inv_equipments.php	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
-page_header('Brouw apparatuur', 'inv_equipments');
-?>
-
-   <div id="jqxgrid"></div>
-   <div style="margin-top: 30px;">
-    <div id="cellbegineditevent"></div>
-    <div style="margin-top: 10px;" id="cellendeditevent"></div>
-   </div>
-
-   <!-- Popup editor window. -->
-   <div id="popupWindow">
-    <div>Wijzig brouw apparatuur.</div>
-    <div style="overflow: hidden;">
-     <table style="width: 100%;">
-      <tr>
-       <td style="vertical-align: top; float: right;">Installatie naam:</td>
-       <td style="vertical-align: top;"><input id="name" /></td>
-       <td style="vertical-align: top; float: right;">Bereken kook volume:</td>
-       <td><div id="calc_boil_volume"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Opmerkingen:</td>
-       <td colspan="3"><textarea id="notes"></textarea></td>
-      </tr>
-      <tr>
-       <th style="text-align: center;" colspan="2">Maischen</th>
-       <th style="text-align: center;" colspan="2">Koken</th>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Maischkuip volume L:</td>
-       <td><div id="tun_volume"></div></td>
-       <td style="vertical-align: top; float: right;">Kookketel volume L:</td>
-       <td><div id="kettle_volume"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Maischkuip hoogte cm:</td>
-       <td><div id="tun_height"></div></td>
-       <td style="vertical-align: top; float: right;">Kookketel hoogte cm:</td>
-       <td><div id="kettle_height"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Maischkuip gewicht kg:</td>
-       <td><div id="tun_weight"></div></td>
-       <td style="vertical-align: top; float: right;">Kook volume L:</td>
-       <td><div id="boil_size"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Maischkuip materiaal:</td>
-       <td><div id="tun_material"></div></td>
-       <td style="vertical-align: top; float: right;">Verdamping per uur L:</td>
-       <td><div id="evap_rate"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Maischkuip specific heat:</td>
-       <td><div id="tun_specific_heat"></div></td>
-       <td style="vertical-align: top; float: right;">Kooktijd in minuten:</td>
-       <td><div id="boil_time"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Maischwater L:</td>
-       <td><div id="mash_volume"></div></td>
-       <td style="vertical-align: top; float: right;">Extra water bij koken L:</td>
-       <td><div id="top_up_kettle"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Maximum moutstort kg:</td>
-       <td><div id="mash_max"></div></td>
-       <td style="vertical-align: top; float: right;">Hopfactor %:</td>
-       <td><div id="hop_utilization"></div></td>
-      </tr>
-      <tr>
-       <th style="text-align: center;" colspan="2">Filteren</th>
-       <td style="vertical-align: top; float: right;">Volume eind koken L:</td>
-       <td><div id="batch_size"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Filter volume L:</td>
-       <td><div id="lauter_volume"></div></td>
-       <th style="text-align: center;" colspan="2">Koelen</th>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Filterkuip hoogte cm:</td>
-       <td><div id="lauter_height"></div></td>
-       <td style="vertical-align: top; float: right;">Trub verlies kookketel L:</td>
-       <td><div id="trub_chiller_loss"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Filterkuip verlies L:</td>
-       <td><div id="lauter_deadspace"></div></td>
-       <td style="vertical-align: top; float: right;">Extra water in het gistvat L:</td>
-       <td><div id="top_up_water"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Brouwzaalrendement %:</td>
-       <td><div id="efficiency"></div></td>
-       <td style="vertical-align: top; float: right;">Volume naar het gistvat L:</td>
-       <td><div id="vol_fermenter"></div></td>
-      </tr>
-      <tr>
-       <td style="padding-top: 20px;" align="right"><input type="button" id="Delete" value="Verwijder" /></td>
-       <td style="padding-top: 20px;" align="left"><input type="button" id="Clone" value="Kloon" /></td>
-       <td style="padding-top: 20px;" align="right"><input type="button" id="Save" value="Sla op" /></td>
-       <td style="padding-top: 20px;" align="left"><input id="Cancel" type="button" value="Annuleer" /></td>
-      </tr>
-     </table>
-    </div>
-   </div>
-
-<?php
-confirm_delete();
-page_footer();
-?>
--- a/www/inv_fermentables.php	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
-page_header('Vergistbare producten', 'inv_fermentables');
-?>
-
-   <div id="jqxgrid"></div>
-   <div style="margin-top: 30px;">
-    <div id="cellbegineditevent"></div>
-    <div style="margin-top: 10px;" id="cellendeditevent"></div>
-   </div>
-
-   <!-- Popup editor window. -->
-   <div id="popupWindow">
-    <div>Wijzig vergistbaar product</div>
-    <div style="overflow: hidden;">
-     <table style="width: 100%;">
-      <tr>
-       <td align="right" style="vertical-align: top;">Product naam:</td>
-       <td align="left" colspan="3" style="vertical-align: top;"><input id="name" /></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Opmerkingen:</td>
-       <td align="left" colspan="3"><textarea id="notes"></textarea></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Type:</td>
-       <td align="left"><div id="type"></div></td>
-       <td align="right" style="vertical-align: top;">Opbrengst %:</td>
-       <td align="left"><div id="yield"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Mout type:</td>
-       <td align="left"><div id="graintype"></div></td>
-       <td align="right" style="vertical-align: top;">Kleur EBC:</td>
-       <td align="left"><div id="color"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Herkomst:</td>
-       <td align="left" style="vertical-align: top;"><input id="origin" /></td>
-       <td align="right" style="vertical-align: top;">Vochtgehalte %:</td>
-       <td align="left"><div id="moisture"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Leverancier:</td>
-       <td align="left" style="vertical-align: top;"><input id="supplier" /></td>
-       <td align="right" style="vertical-align: top;">Grof/fijn verschil %:</td>
-       <td align="left"><div id="coarse_fine_diff"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Max. in stort %:</td>
-       <td align="left"><div id="max_in_batch"></div></td>
-       <td align="right" style="vertical-align: top;">Eiwitgehalte %:</td>
-       <td align="left"><div id="protein"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Maischen nodig:</td>
-       <td align="left"><div id="recommend_mash"></div></td>
-       <td align="right" style="vertical-align: top;">Opgelost eiwit %:</td>
-       <td align="left"><div id="dissolved_protein"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Toevoegen na koken:</td>
-       <td align="left"><div id="add_after_boil"></div></td>
-       <td align="right" style="vertical-align: top;">Enzymkracht &deg;WK:</td>
-       <td align="left"><div id="diastatic_power"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Toevoegen bij:</td>
-       <td align="left"><div id="added"></div></td>
-       <td align="right" style="vertical-align: top;">pH in demiwater:</td>
-       <td align="left"><div id="di_ph"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Altijd op voorraad:</td>
-       <td align="left"><div id="always_on_stock"></div></td>
-       <td align="right" style="vertical-align: top;">Base tot pH 5,7 mEq/l:</td>
-       <td align="left"><div id="acid_to_ph_57"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Voorraad:</td>
-       <td align="left"><div id="inventory"></div></td>
-       <td align="right" style="vertical-align: top;">Productie datum:</td>
-       <td align="left" style="vertical-align: top;"><div id="production_date"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Prijs per kg:</td>
-       <td align="left"><div id="cost"></div></td>
-       <td align="right" style="vertical-align: top;">Gebruik voor datum:</td>
-       <td align="left" style="vertical-align: top;"><div id="tht_date"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Waarde voorraad:</td>
-       <td align="left" colspan="3"><div id="totval"></div></td>
-      </tr>
-      <tr>
-       <td style="padding-top: 15px;" align="right"><input type="button" id="Delete" value="Verwijder" /></td>
-       <td style="padding-top: 15px;" align="left"><input type="button" id="Clone" value="Kloon" /></td>
-       <td align="right"></td>
-       <td style="padding-top: 15px;" align="left"><input style="margin-right: 5px;" type="button" id="Save" value="Sla op" /><input id="Cancel" type="button" value="Annuleer" /></td>
-      </tr>
-     </table>
-    </div>
-   </div>
-
-<?php
-confirm_delete();
-page_footer();
-
--- a/www/inv_miscs.php	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
-page_header('Diverse ingredienten', 'inv_miscs');
-?>
-
-   <div id="jqxgrid"></div>
-   <div style="margin-top: 30px;">
-    <div id="cellbegineditevent"></div>
-    <div style="margin-top: 10px;" id="cellendeditevent"></div>
-   </div>
-
-   <!-- Popup editor window. -->
-   <div id="popupWindow">
-    <div>Wijzig ingredient.</div>
-    <div style="overflow: hidden;">
-     <table style="width: 100%;">
-      <tr>
-       <td align="right" style="vertical-align: top;">Ingredient naam:</td>
-       <td align="left" colspan="3" style="vertical-align: top;"><input id="name" /></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Opmerkingen:</td>
-       <td align="left" colspan="3"><textarea id="notes"></textarea></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Type:</td>
-       <td align="left"><div id="type" /></div></td>
-       <td align="right" style="vertical-align: top;"><div id="pmpt_inventory">Voorraad xx:</div></td>
-       <td align="left"><div id="inventory"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Eenheid is gewicht:</td>
-       <td align="left"><div id="amount_is_weight"></div></td>
-       <td align="right" style="vertical-align: top;"><div id="pmpt_cost">Prijs per xx:</div></td>
-       <td align="left"><div id="cost"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Toevoegen:</td>
-       <td align="left"><div id="use_use" /></div></td>
-       <td align="right" style="vertical-align: top;">Waarde voorraad:</td>
-       <td align="left"><div id="totval"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Tijd minuten:</td>
-       <td align="left"><div id="time" /></div></td>
-       <td align="right" style="vertical-align: top;">Altijd op voorraad::</td>
-       <td align="left"><div id="always_on_stock"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Toepassing:</td>
-       <td align="left"i colspan="3"><textarea id="use_for"></textarea></td>
-      </tr>
-      <tr>
-       <td colspan="4">&nbsp;</td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Productie datum:</td>
-       <td align="left" style="vertical-align: top;"><div id="production_date"></div></td>
-       <td align="right" style="vertical-align: top;">Gebruik voor datum:</td>
-       <td align="left" style="vertical-align: top;"><div id="tht_date"></div></td>
-      </tr>
-      <tr>
-       <td style="padding-top: 100px;" align="right"><input type="button" id="Delete" value="Verwijder" /></td>
-       <td style="padding-top: 100px;" align="left"><input type="button" id="Clone" value="Kloon" /></td>
-       <td style="padding-top: 100px;" align="right"><input type="button" id="Save" value="Sla op" /></td>
-       <td style="padding-top: 100px;" align="left"><input id="Cancel" type="button" value="Annuleer" /></td>
-      </tr>
-     </table>
-    </div>
-   </div>
-
-<?php
-confirm_delete();
-page_footer();
-?>
--- a/www/inv_waters.php	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
-page_header('Brouwwater voorraad', 'inv_waters');
-?>
-
-   <div id="jqxgrid"></div>
-   <div style="margin-top: 30px;">
-    <div id="cellbegineditevent"></div>
-    <div style="margin-top: 10px;" id="cellendeditevent"></div>
-   </div>
-
-   <!-- Popup editor window. -->
-   <div id="popupWindow">
-    <div>Wijzig brouwwater.</div>
-    <div style="overflow: hidden;">
-     <table style="width: 100%;">
-      <tr>
-       <td style="vertical-align: top; float: right;">Water naam:</td>
-       <td align="left" colspan="3" style="vertical-align: top;"><input id="name" /></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Opmerkingen:</td>
-       <td colspan="3"><textarea id="notes"></textarea></td>
-      </tr>
-      <tr>
-       <td colspan="4">&nbsp;</td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Calcium (Ca) mg/L:</td>
-       <td><div id="calcium"></div></td>
-       <td style="vertical-align: top; float: right;">Sulfaat (CaSO4) mg/L:</td>
-       <td><div id="sulfate"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Magnesium (Mg) mg/L:</td>
-       <td><div id="magnesium"></div></td>
-       <td style="vertical-align: top; float: right;">Chloride (Cl) mg/L:</td>
-       <td><div id="chloride"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Natrium (Na) mg/L:</td>
-       <td><div id="sodium"></div></td>
-       <td style="vertical-align: top; float: right;">Bicarbonaat (HCO3) mg/L:</td> <!-- Input for total_alkalinity -->
-       <td><div id="bicarbonate"></div></td>
-      </tr>
-      <tr>
-       <td></td>
-       <td></td>
-       <td style="vertical-align: top; float: right;">Totale alkaliteit (CaCO3) mg/L:</td>
-       <td><div id="total_alkalinity"></div></td>
-      </tr>
-      <tr>
-       <td colspan="4">&nbsp;</td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Zuurgraad (pH):</td>
-       <td><div id="ph"></div></td>
-       <td style="vertical-align: top; float: right;">Ionen balans meq/L:</td>
-       <td><div style="float: left;" id="balance"></div><div style="float: left; margin-left: 10px;" id="wr_balance"></div></td>
-      </tr>
-      <tr>
-       <td colspan="4">&nbsp;</td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Onbeperkt op voorraad:</td>
-       <td colspan="3"><div id="unlimited_stock"></div></td>
-      </tr>
-      <tr>
-       <td style="vertical-align: top; float: right;">Voorraad:</td>
-       <td><div id="inventory"></div></td>
-       <td style="vertical-align: top; float: right;">Prijs per liter:</td>
-       <td><div id="cost"></div></td>
-      </tr>
-      <tr>
-       <td style="padding-top: 70px; float: right;"><input type="button" id="Delete" value="Verwijder" /></td>
-       <td></td>
-       <td></td>
-       <td style="padding-top: 70px;"><input style="margin-right: 5px;" type="button" id="Save" value="Sla op" /><input id="Cancel" type="button" value="Annuleer" /></td>
-      </tr>
-     </table>
-    </div>
-   </div>
-
-<?php
-confirm_delete();
-page_footer();
-?>
--- a/www/inv_yeasts.php	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
-page_header('Gist inventaris', 'inv_yeasts');
-?>
-
-   <div id="jqxgrid"></div>
-   <div style="margin-top: 30px;">
-    <div id="cellbegineditevent"></div>
-    <div style="margin-top: 10px;" id="cellendeditevent"></div>
-   </div>
-
-   <!-- Popup editor window. -->
-   <div id="popupWindow">
-    <div>Wijzig gist</div>
-    <div style="overflow: hidden;">
-     <table style="width: 100%;">
-      <tr>
-       <td align="right" style="vertical-align: top;">Gist naam:</td>
-       <td align="left" colspan="5" style="vertical-align: top;"><input id="name" /></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Productcode:</td>
-       <td align="left" colspan="5" style="vertical-align: top;"><input id="product_id" /></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Opmerkingen:</td>
-       <td align="left" colspan="5"><textarea id="notes"></textarea></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Type:</td>
-       <td align="left"><div id="type"></div></td>
-       <td align="right" class="yeast_dry" style="vertical-align: top;">Ent van g/hl:</td>
-       <td align="left" class="yeast_dry" style="vertical-align: top;"><input id="pitch_lo" readonly /><input type="button" id="but_pitch_lo" value="?" style="margin-left: 10px" /></td>
-       <td class="yeast_wet"></td>
-       <td class="yeast_wet"></td>
-       <td align="right" style="vertical-align: top;">Min temperatuur &deg;C:</td>
-       <td align="left"><div id="min_temperature"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Gist vorm:</td>
-       <td align="left"><div id="form"></div></td>
-       <td align="right" class="yeast_dry" style="vertical-align: top;">Ent tot g/hl:</td>
-       <td align="left" class="yeast_dry" style="vertical-align: top;"><input id="pitch_hi" readonly /><input type="button" id="but_pitch_hi" value="?" style="margin-left: 10px" /></td>
-       <td class="yeast_wet"></td>
-       <td class="yeast_wet"></td>
-       <td align="right" style="vertical-align: top;">Max temperatuur &deg;C:</td>
-       <td align="left"><div id="max_temperature"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Laboratorium:</td>
-       <td align="left" colspan="3" style="vertical-align: top;"><input id="laboratory" /></td>
-       <td align="right" style="vertical-align: top;">Vergistingsgraad %:</td>
-       <td align="left"><div id="attenuation"></div></td>
-      </tr>
-      <tr>
-       <td rowspan="4" align="right" style="vertical-align: top;">Geschikt voor:</td>
-       <td rowspan="4" align="left" colspan="3"><textarea id="best_for"></textarea></td>
-       <td align="right" style="vertical-align: top;">Alcohol tolerantie:</td>
-       <td align="left"><div id="tolerance"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Flocculatie:</td>
-       <td align="left"><div id="flocculation"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;"><div id="pmpt_cells">cells:</div></td>
-       <td align="left"><div id="cells"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Maximum Hergebruik:</td>
-       <td align="left"><div id="max_reuse"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Gistbank tekst:</td>
-       <td align="left" colspan="3" style="vertical-align: top;"><input id="short_desc" /></td>
-       <td align="right" style="vertical-align: top;">Ent temperatuur &deg;C:</td>
-       <td align="left"><div id="pitch_temperature"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">POF+:</td>
-       <td align="left"><div id="pofpos"></div></td>
-       <td align="right" style="vertical-align: top;">Zymocide+:</td>
-       <td align="left"><div id="zymocide"></div></td>
-       <td align="right" style="vertical-align: top;">Oogst tijd uren:</td>
-       <td align="left"><div id="harvest_time"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">STA1 (diastatic) gen:</td>
-       <td align="left"><div id="sta1"></div></td>
-       <td align="right" style="vertical-align: top;">Oogst van boven:</td>
-       <td align="left"><div id="harvest_top"></div></td>
-       <td align="right" style="vertical-align: top;">Bevat bacteri&euml;n:</td>
-       <td align="left"><div id="bacteria"></div></td>
-      </tr>
-      <tr>
-       <td colspan="6"><hr></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;"><div id="pmpt_inventory">Voorraad xx:</div></td>
-       <td align="left"><div id="inventory"></div></td>
-       <td></td><td></td>
-       <td align="right" style="vertical-align: top;">Productie datum:</td>
-       <td align="left" style="vertical-align: top;"><div id="production_date"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;"><div id="pmpt_cost">Prijs per xx:</div></td>
-       <td align="left"><div id="cost"></div></td>
-       <td align="right" style="vertical-align: top;">Waarde voorraad &euro;:</td>
-       <td align="left"><div id="totval"></div></td>
-       <td align="right" style="vertical-align: top;">THT datum:</td>
-       <td align="left" style="vertical-align: top;"><div id="tht_date"></div></td>
-      </tr>
-      <tr>
-       <td style="padding-top: 20px;" align="right"><input type="button" id="Delete" value="Verwijder" /></td>
-       <td style="padding-top: 20px;" align="left"><input type="button" id="Clone" value="Kloon" /></td>
-       <td></td><td></td>
-       <td align="right"></td>
-       <td style="padding-top: 20px;" align="left"><input style="margin-right: 5px;" type="button" id="Save" value="Sla op" /><input id="Cancel" type="button" value="Annuleer" /></td>
-      </tr>
-     </table>
-    </div>
-   </div>
-
-   <div id="pitchloWindow">
-    <div>Enten droge gist ondergrens</div>
-    <div style="overflow: hidden;">
-     <table style="width: 100%;">
-      <col width="50%">
-      <col width="50%">
-      <tr>
-       <td align="right" style="vertical-align: top;">Enten gram/hl:</td>
-       <td style="padding: 3px;"><div id="gr_hl_lo"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Bij dit SG:</td>
-       <td style="padding: 3px;"><div id="sg_lo" /></div></td>
-      </tr>
-      <tr>
-       <td style="padding-top: 30px;" colspan="2" align="center">
-        <input id="pitchloReady" type="button" value="Ok" />
-       </td>
-      </tr>
-     </table>
-    </div>
-   </div>
-
-   <div id="pitchhiWindow">
-    <div>Enten droge gist bovengrens</div>
-    <div style="overflow: hidden;">
-     <table style="width: 100%;">
-      <col width="50%">
-      <col width="50%">
-      <tr>
-       <td align="right" style="vertical-align: top;">Enten gram/hl:</td>
-       <td style="padding: 3px;"><div id="gr_hl_hi"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Bij dit SG:</td>
-       <td style="padding: 3px;"><div id="sg_hi" /></div></td>
-      </tr>
-      <tr>
-       <td style="padding-top: 30px;" colspan="2" align="center">
-        <input id="pitchhiReady" type="button" value="Ok" />
-       </td>
-      </tr>
-     </table>
-    </div>
-   </div>
-
-<?php
-confirm_delete();
-page_footer();
-?>
--- a/www/js/inv_equipments.js	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,451 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 2014-2022
- *
- * Michiel Broek <mbroek at mbse dot eu>
- *
- * This file is part of Brewery Management System
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * BrewCloud is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ThermFerm; see the file COPYING.  If not, write to the Free
- * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- *****************************************************************************/
-
-
-function createDelElements() {
- $('#eventWindow').jqxWindow({
-  theme: theme,
-  position: { x: 490, y: 210 },
-  width: 300,
-  height: 175,
-  resizable: false,
-  isModal: true,
-  modalOpacity: 0.4,
-  okButton: $('#delOk'),
-  cancelButton: $('#delCancel'),
-  initContent: function() {
-   $('#delOk').jqxButton({ template: 'danger', width: '65px', theme: theme });
-   $('#delCancel').jqxButton({ template: 'success', width: '65px', theme: theme });
-   $('#delCancel').focus();
-  }
- });
- $('#eventWindow').jqxWindow('hide');
-}
-
-
-$(document).ready(function() {
-
- function calcBatchVolume() {
-  var calc = $('#calc_boil_volume').val(),
-  boil_size = parseFloat($('#boil_size').jqxNumberInput('decimal')),
-  evap_rate = parseFloat($('#evap_rate').jqxNumberInput('decimal')),
-  boil_time = parseFloat($('#boil_time').jqxNumberInput('decimal')),
-  top_up = parseFloat($('#top_up_kettle').jqxNumberInput('decimal')),
-  batch = parseFloat($('#batch_size').jqxNumberInput('decimal'));
-
-  if (calc) { // If checked, calculate the batch size.
-   batch = boil_size - (evap_rate * boil_time / 60) + top_up;
-   $('#batch_size').val(batch);
-  }
-  $('#vol_fermenter').val((batch / 1.04) + parseFloat($('#top_up_water').jqxNumberInput('decimal')) - parseFloat($('#trub_chiller_loss').jqxNumberInput('decimal')));
- }
-
- // tooltips
- $('#name').jqxTooltip({ content: 'De unieke naam van deze brouw installatie.' });
- $('#notes').jqxTooltip({ content: 'Extra opmerkingen over deze installatie.' });
- $('#tun_volume').jqxTooltip({ content: 'Maisch kuip volume.' });
- $('#tun_height').jqxTooltip({ content: 'Maisch kuip hoogte in cm.' });
- $('#tun_weight').jqxTooltip({ content: 'Maisch kuip gewicht in Kg.' });
- $('#tun_material').jqxTooltip({ content: 'Maisch kuip materiaal. Nodig om de juiste inmaisch temperatuur te berekenen.' });
- $('#mash_volume').jqxTooltip({ content: 'Liters maisch water voor de eerste maisch stap.' });
- $('#mash_max').jqxTooltip({ content: 'Maximale moutstort voor deze installatie in Kg.' });
- $('#lauter_volume').jqxTooltip({ content: 'Totaal filter volume.' });
- $('#lauter_height').jqxTooltip({ content: 'Hoogte van de filterpan in cm.' });
- $('#lauter_deadspace').jqxTooltip({ content: 'Volume verlies in de filterpan.' });
- $('#efficiency').jqxTooltip({ content: 'Gemiddeld brouwzaalrendement.' });
- $('#kettle_volume').jqxTooltip({ content: 'Kook ketel volume in liters.' });
- $('#kettle_height').jqxTooltip({ content: 'Kook ketel hoogte in cm.' });
- $('#boil_size').jqxTooltip({ content: 'Volume in liters voor de kook bij 100&deg;C in de kook ketel.' });
- $('#evap_rate').jqxTooltip({ content: 'Verdamping in liters per uur.' });
- $('#boil_time').jqxTooltip({ content: 'Kooktijd in minuten.' });
- $('#top_up_kettle').jqxTooltip({ content: 'Extra water toevoegen tijdens het koken.' });
- $('#hop_utilization').jqxTooltip({ content: '100% voor kleinere installaties, hoger voor grote brouwerijen.' });
- $('#batch_size').jqxTooltip({ content: 'Volume bij 100&deg;C aan het einde van de kook.' });
- $('#trub_chiller_loss').jqxTooltip({ content: 'Standaard verlies in liters tijdens koelen en overbrengen van de wort naar het gistvat.' });
- $('#top_up_water').jqxTooltip({ content: 'Extra water toe te voegen in het gistvat.' });
- $('#vol_fermenter').jqxTooltip({ content: 'Het aantal liters in het gistvat.' });
-
- var dataRecord = {},
- url = 'includes/db_inventory_equipments.php',
- // prepare the data
- source = {
-  datatype: 'json',
-  cache: false,
-  datafields: [
-   { name: 'record', type: 'number' },
-   { name: 'uuid', type: 'string' },
-   { name: 'name', type: 'string' },
-   { name: 'boil_size', type: 'float' },
-   { name: 'batch_size', type: 'float' },
-   { name: 'tun_volume', type: 'float' },
-   { name: 'tun_weight', type: 'float' },
-   { name: 'tun_specific_heat', type: 'float' },
-   { name: 'tun_material', type: 'int' },
-   { name: 'tun_height', type: 'float' },
-   { name: 'top_up_water', type: 'float' },
-   { name: 'trub_chiller_loss', type: 'float' },
-   { name: 'evap_rate', type: 'float' },
-   { name: 'boil_time', type: 'float' },
-   { name: 'calc_boil_volume', type: 'int' },
-   { name: 'top_up_kettle', type: 'float' },
-   { name: 'hop_utilization', type: 'float' },
-   { name: 'notes', type: 'string' },
-   { name: 'lauter_volume', type: 'float' },
-   { name: 'lauter_height', type: 'float' },
-   { name: 'lauter_deadspace', type: 'float' },
-   { name: 'kettle_volume', type: 'float' },
-   { name: 'kettle_height', type: 'float' },
-   { name: 'mash_volume', type: 'float' },
-   { name: 'mash_max', type: 'float' },
-   { name: 'efficiency', type: 'float' }
-  ],
-  id: 'record',
-  url: url,
-  deleterow: function(rowid, commit) {
-   // synchronize with the server - send delete command
-   var data = 'delete=true&' + $.param({ record: rowid });
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('delete: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('delete: success');
-     }
-     //commit(true);
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  },
-  addrow: function(rowid, rowdata, position, commit) {
-   var data = 'insert=true&' + $.param(rowdata);
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('insert: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('insert: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  },
-  updaterow: function(rowid, rowdata, commit) {
-   var data = 'update=true&' + $.param(rowdata);
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('updaterow: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('updaterow: success');
-     }
-     //commit(true);
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { console.log('updaterow: ' + textStatus); commit(false); }
-   });
-  }
- },
- dataAdapter = new $.jqx.dataAdapter(source),
- editrow = -1;
-
- // initialize the input fields.
- $('#name').jqxInput({ theme: theme, width: 250, height: 23 });
- $('#notes').jqxInput({ theme: theme, width: 640, height: 100 });
- $('#boil_size').jqxNumberInput(Spin1dec);
- $('#batch_size').jqxNumberInput(Spin2dec);
- $('#batch_size').jqxNumberInput({ spinButtonsStep: 0.5 });
- $('#tun_volume').jqxNumberInput(Spin1dec);
- $('#tun_weight').jqxNumberInput(Spin2dec);
- $('#tun_specific_heat').jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 3 });
- $('#tun_material').jqxDropDownList({
-  theme: theme,
-  source: MaterialAdapter,
-  valueMember: 'id',
-  displayMember: 'nl',
-  width: 180,
-  height: 23,
-  autoDropDownHeight: true
- });
- $('#tun_height').jqxNumberInput(Spin1dec);
- $('#top_up_water').jqxNumberInput(Spin1dec);
- $('#trub_chiller_loss').jqxNumberInput(Spin1dec);
- $('#evap_rate').jqxNumberInput(Spin2dec);
- $('#boil_time').jqxNumberInput(PosInt);
- $('#boil_time').jqxNumberInput({ max: 1440 });
- $('#calc_boil_volume').jqxCheckBox({ theme: theme, width: 120, height: 23 });
- $('#calc_boil_volume').on('checked', function(event) {
-  $('#batch_size').jqxNumberInput({ readOnly: true, width: 90, spinButtons: false });
- });
- $('#calc_boil_volume').on('unchecked', function(event) {
-  $('#batch_size').jqxNumberInput({ readOnly: false, width: 110, spinButtons: true });
- });
- $('#top_up_kettle').jqxNumberInput(Spin1dec);
- $('#hop_utilization').jqxNumberInput(Perc0);
- $('#hop_utilization').jqxNumberInput({ Max: 200 });
- $('#lauter_volume').jqxNumberInput(Spin1dec);
- $('#lauter_height').jqxNumberInput(Spin1dec);
- $('#lauter_deadspace').jqxNumberInput(Spin1dec);
- $('#kettle_volume').jqxNumberInput(Spin1dec);
- $('#kettle_height').jqxNumberInput(Spin1dec);
- $('#mash_volume').jqxNumberInput(Spin1dec);
- $('#mash_max').jqxNumberInput(Spin1dec);
- $('#efficiency').jqxNumberInput(Perc1dec);
- $('#vol_fermenter').jqxNumberInput(Show2dec);
-
- // initialize jqxGrid
- $('#jqxgrid').jqxGrid({
-  width: 1280,
-  height: 630,
-  source: dataAdapter,
-  theme: theme,
-  showstatusbar: true,
-  renderstatusbar: function(statusbar) {
-   var rowCount = $("#jqxgrid").jqxGrid('getrows').length;
-   statusbar.append('<div style="float: left; margin: 8px; color: orange !important;">Aantal items: ' + rowCount + '</div>');
-   var addButton, container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');
-   addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Nieuw</span></div>');
-   expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/database.png"/><span style="margin-left: 4px; position: relative; top: -10px;">Export</span></div>');
-   container.append(addButton);
-   container.append(expButton);
-   statusbar.append(container);
-   addButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   expButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   // add new row.
-   addButton.click(function(event) {
-    editrow = -1;
-    $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
-    $('#name').val('Nieuwe brouwset');
-    dataRecord.uuid = '';
-    $('#boil_size').val(18);
-    $('#batch_size').val(15.3);
-    $('#vol_fermenter').val(14.2);
-    $('#tun_volume').val(20);
-    $('#tun_weight').val(2);
-    $('#tun_specific_heat').val(0.11);
-    $('#tun_material').val(0);
-    $('#tun_height').val(20);
-    $('#top_up_water').val(0);
-    $('#trub_chiller_loss').val(0.5);
-    $('#evap_rate').val(1.8);
-    $('#boil_time').val(90);
-    $('#calc_boil_volume').val(1);
-    $('#top_up_kettle').val(0);
-    $('#hop_utilization').val(100);
-    $('#notes').val('');
-    $('#lauter_volume').val(20);
-    $('#lauter_height').val(20);
-    $('#lauter_deadspace').val(0.5);
-    $('#kettle_volume').val(20);
-    $('#kettle_height').val(20);
-    $('#mash_volume').val(18);
-    $('#mash_max').val(6);
-    $('#efficiency').val(75);
-    $('#popupWindow').jqxWindow('open');
-   });
-   expButton.click(function(event) {
-    window.open('export_equipments.php');
-   });
-  },
-  filterable: false,
-  ready: function() {
-   $('#boil_size').on('change', function(event) { calcBatchVolume(); });
-   $('#evap_rate').on('change', function(event) { calcBatchVolume(); });
-   $('#boil_time').on('change', function(event) { calcBatchVolume(); });
-   $('#top_up_kettle').on('change', function(event) { calcBatchVolume(); });
-   $('#calc_boil_volume').on('change', function(event) { calcBatchVolume(); });
-   $('#top_up_water').on('change', function(event) { calcBatchVolume(); });
-   $('#trub_chiller_loss').on('change', function(event) { calcBatchVolume(); });
-   $('#tun_material').on('select', function(event) {
-    dataRecord.tun_specific_heat = MaterialData[event.args.index].sh;
-    $('#tun_specific_heat').val(dataRecord.tun_specific_heat);
-   });
-  },
-  columns: [
-   { text: 'Installatie naam', datafield: 'name', width: 200 },
-   { text: 'Kook volume', datafield: 'boil_size', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-   { text: 'Batch volume', datafield: 'batch_size', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-   { text: 'Opmerkingen', datafield: 'notes' },
-   { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function() {
-    return 'Wijzig';
-    }, buttonclick: function(row) {
-     // open the popup window when the user clicks a button.
-     editrow = row;
-     $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
-     // get the clicked row's data and initialize the input fields.
-     dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow);
-     $('#name').val(dataRecord.name);
-     $('#boil_size').val(dataRecord.boil_size);
-     $('#batch_size').val(dataRecord.batch_size);
-     $('#tun_volume').val(dataRecord.tun_volume);
-     $('#tun_weight').val(dataRecord.tun_weight);
-     $('#tun_specific_heat').val(dataRecord.tun_specific_heat);
-     $('#tun_material').val(dataRecord.tun_material);
-     $('#tun_height').val(dataRecord.tun_height);
-     $('#top_up_water').val(dataRecord.top_up_water);
-     $('#trub_chiller_loss').val(dataRecord.trub_chiller_loss);
-     $('#evap_rate').val(dataRecord.evap_rate);
-     $('#boil_time').val(dataRecord.boil_time);
-     $('#calc_boil_volume').val(dataRecord.calc_boil_volume);
-     $('#top_up_kettle').val(dataRecord.top_up_kettle);
-     $('#hop_utilization').val(dataRecord.hop_utilization);
-     $('#notes').val(dataRecord.notes);
-     $('#lauter_volume').val(dataRecord.lauter_volume);
-     $('#lauter_height').val(dataRecord.lauter_height);
-     $('#lauter_deadspace').val(dataRecord.lauter_deadspace);
-     $('#kettle_volume').val(dataRecord.kettle_volume);
-     $('#kettle_height').val(dataRecord.kettle_height);
-     $('#mash_volume').val(dataRecord.mash_volume);
-     $('#mash_max').val(dataRecord.mash_max);
-     $('#efficiency').val(dataRecord.efficiency);
-     // show the popup window.
-     $('#popupWindow').jqxWindow('open');
-    }
-   }
-  ]
- });
- // initialize the popup window and buttons.
- $('#popupWindow').jqxWindow({
-  width: 1050,
-  height: 600,
-  resizable: false,
-  theme: theme,
-  isModal: true,
-  autoOpen: false,
-  cancelButton: $('#Cancel'),
-  modalOpacity: 0.40
- });
- $('#popupWindow').on('open', function() {
-  $('#name').jqxInput('selectAll');
- });
- $('#Delete').jqxButton({ template: 'danger', width: '90px', theme: theme });
- $('#Delete').click(function() {
-  if (editrow >= 0) {
-   // Open a popup to confirm this action.
-   $('#eventWindow').jqxWindow('open');
-   $('#delOk').click(function() {
-    var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-    $('#jqxgrid').jqxGrid('deleterow', rowID);
-   });
-  }
-  $('#popupWindow').jqxWindow('hide');
- });
- $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme });
- $('#Clone').jqxButton({ template: 'warning', width: '90px', theme: theme });
- $('#Clone').click(function() {
-  var row = {
-   record: -1,
-   name: $('#name').val() + ' kopie',
-   uuid: '',
-   boil_size: parseFloat($('#boil_size').jqxNumberInput('decimal')),
-   batch_size: parseFloat($('#batch_size').jqxNumberInput('decimal')),
-   tun_volume: parseFloat($('#tun_volume').jqxNumberInput('decimal')),
-   tun_weight: parseFloat($('#tun_weight').jqxNumberInput('decimal')),
-   tun_specific_heat: parseFloat($('#tun_specific_heat').jqxNumberInput('decimal')),
-   tun_material: $('#tun_material').val(),
-   tun_height: parseFloat($('#tun_height').jqxNumberInput('decimal')),
-   top_up_water: parseFloat($('#top_up_water').jqxNumberInput('decimal')),
-   trub_chiller_loss: parseFloat($('#trub_chiller_loss').jqxNumberInput('decimal')),
-   evap_rate: parseFloat($('#evap_rate').jqxNumberInput('decimal')),
-   boil_time: parseFloat($('#boil_time').jqxNumberInput('decimal')),
-   calc_boil_volume: $('#calc_boil_volume').val(),
-   top_up_kettle: parseFloat($('#top_up_kettle').jqxNumberInput('decimal')),
-   hop_utilization: parseFloat($('#hop_utilization').jqxNumberInput('decimal')),
-   notes: $('#notes').val(),
-   lauter_volume: parseFloat($('#lauter_volume').jqxNumberInput('decimal')),
-   lauter_height: parseFloat($('#lauter_height').jqxNumberInput('decimal')),
-   lauter_deadspace: parseFloat($('#lauter_deadspace').jqxNumberInput('decimal')),
-   kettle_volume: parseFloat($('#kettle_volume').jqxNumberInput('decimal')),
-   kettle_height: parseFloat($('#kettle_height').jqxNumberInput('decimal')),
-   mash_volume: parseFloat($('#mash_volume').jqxNumberInput('decimal')),
-   mash_max: parseFloat($('#mash_max').jqxNumberInput('decimal')),
-   efficiency: parseFloat($('#efficiency').jqxNumberInput('decimal'))
-  };
-  $('#jqxgrid').jqxGrid('addrow', null, row);
-  $('#popupWindow').jqxWindow('hide');
- });
- $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme });
- // update the edited row when the user clicks the 'Save' button.
- $('#Save').click(function() {
-  var row, rowID = -1;
-  if (editrow >= 0) {
-   rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-  }
-  row = {
-   record: rowID,
-   name: $('#name').val(),
-   uuid: dataRecord.uuid,
-   boil_size: parseFloat($('#boil_size').jqxNumberInput('decimal')),
-   batch_size: parseFloat($('#batch_size').jqxNumberInput('decimal')),
-   tun_volume: parseFloat($('#tun_volume').jqxNumberInput('decimal')),
-   tun_weight: parseFloat($('#tun_weight').jqxNumberInput('decimal')),
-   tun_specific_heat: parseFloat($('#tun_specific_heat').jqxNumberInput('decimal')),
-   tun_material: $('#tun_material').val(),
-   tun_height: parseFloat($('#tun_height').jqxNumberInput('decimal')),
-   top_up_water: parseFloat($('#top_up_water').jqxNumberInput('decimal')),
-   trub_chiller_loss: parseFloat($('#trub_chiller_loss').jqxNumberInput('decimal')),
-   evap_rate: parseFloat($('#evap_rate').jqxNumberInput('decimal')),
-   boil_time: parseFloat($('#boil_time').jqxNumberInput('decimal')),
-   calc_boil_volume: $('#calc_boil_volume').val(),
-   top_up_kettle: parseFloat($('#top_up_kettle').jqxNumberInput('decimal')),
-   hop_utilization: parseFloat($('#hop_utilization').jqxNumberInput('decimal')),
-   notes: $('#notes').val(),
-   lauter_volume: parseFloat($('#lauter_volume').jqxNumberInput('decimal')),
-   lauter_height: parseFloat($('#lauter_height').jqxNumberInput('decimal')),
-   lauter_deadspace: parseFloat($('#lauter_deadspace').jqxNumberInput('decimal')),
-   kettle_volume: parseFloat($('#kettle_volume').jqxNumberInput('decimal')),
-   kettle_height: parseFloat($('#kettle_height').jqxNumberInput('decimal')),
-   mash_volume: parseFloat($('#mash_volume').jqxNumberInput('decimal')),
-   mash_max: parseFloat($('#mash_max').jqxNumberInput('decimal')),
-   efficiency: parseFloat($('#efficiency').jqxNumberInput('decimal'))
-  };
-  if (editrow >= 0) {
-   $('#jqxgrid').jqxGrid('updaterow', rowID, row);
-  } else {
-   $('#jqxgrid').jqxGrid('addrow', null, row);
-  }
-  $('#popupWindow').jqxWindow('hide');
- });
- createDelElements();
-});
-
--- a/www/js/inv_fermentables.js	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,446 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 2014-2022
- *
- * Michiel Broek <mbroek at mbse dot eu>
- *
- * This file is part of Brewery Management System
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * BrewCloud is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ThermFerm; see the file COPYING.  If not, write to the Free
- * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- *****************************************************************************/
-
-
-function createDelElements() {
- $('#eventWindow').jqxWindow({
-  theme: theme,
-  position: { x: 490, y: 210 },
-  width: 300,
-  height: 175,
-  resizable: false,
-  isModal: true,
-  modalOpacity: 0.4,
-  okButton: $('#delOk'),
-  cancelButton: $('#delCancel'),
-  initContent: function() {
-   $('#delOk').jqxButton({ template: 'danger', width: '65px', theme: theme });
-   $('#delCancel').jqxButton({ template: 'success', width: '65px', theme: theme });
-   $('#delCancel').focus();
-  }
- });
- $('#eventWindow').jqxWindow('hide');
-}
-
-
-$(document).ready(function() {
-
- function calcTotal(cost, inventory) {
-  $('#totval').val(cost * inventory);
- }
-
- var dataRecord = {},
- url = 'includes/db_inventory_fermentables.php',
- source = {
-  datatype: 'json',
-  cache: false,
-  datafields: [
-   { name: 'record', type: 'number' },
-   { name: 'uuid', type: 'string' },
-   { name: 'name', type: 'string' },
-   { name: 'type', type: 'string' },
-   { name: 'yield', type: 'float' },
-   { name: 'color', type: 'float' },
-   { name: 'add_after_boil', type: 'int' },
-   { name: 'origin', type: 'string' },
-   { name: 'supplier', type: 'string' },
-   { name: 'notes', type: 'string' },
-   { name: 'coarse_fine_diff', type: 'float' },
-   { name: 'moisture', type: 'float' },
-   { name: 'diastatic_power', type: 'float' },
-   { name: 'protein', type: 'float' },
-   { name: 'dissolved_protein', type: 'float' },
-   { name: 'max_in_batch', type: 'float' },
-   { name: 'recommend_mash', type: 'int' },
-   { name: 'added', type: 'string' },
-   { name: 'always_on_stock', type: 'int' },
-   { name: 'di_ph', type: 'float' },
-   { name: 'acid_to_ph_57', type: 'float' },
-   { name: 'graintype', type: 'string' },
-   { name: 'inventory', type: 'float' },
-   { name: 'cost', type: 'float' },
-   { name: 'production_date', type: 'string' },
-   { name: 'tht_date', type: 'string' }
-  ],
-  id: 'record',
-  url: url,
-  deleterow: function(rowid, commit) {
-   var data = 'delete=true&' + $.param({ record: rowid });
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('delete: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('delete: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  },
-  addrow: function(rowid, rowdata, position, commit) {
-   var data = 'insert=true&' + $.param(rowdata);
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('insert: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('insert: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  },
-  updaterow: function(rowid, rowdata, commit) {
-   var data = 'update=true&' + $.param(rowdata);
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('updaterow: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('updaterow: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  }
- },
- dataAdapter = new $.jqx.dataAdapter(source),
- editrow = -1;
-
- // initialize the input fields.
- $('#name').jqxInput({ theme: theme, width: 640, height: 23 });
- $('#type').jqxDropDownList({
-  theme: theme,
-  source: FermentableTypeAdapter,
-  valueMember: 'nl',
-  displayMember: 'nl',
-  width: 180,
-  height: 23,
-  autoDropDownHeight: true
- });
- $('#yield').jqxNumberInput(Spin1dec);
- $('#color').jqxNumberInput(Spin1dec);
- $('#add_after_boil').jqxCheckBox({ theme: theme, width: 120, height: 23 });
- $('#origin').jqxInput({ theme: theme, width: 250, height: 23 });
- $('#supplier').jqxInput({ theme: theme, width: 250, height: 23 });
- $('#notes').jqxInput({ theme: theme, width: 640, height: 100 });
- $('#coarse_fine_diff').jqxNumberInput(Spin1dec);
- $('#moisture').jqxNumberInput(Spin1dec);
- $('#diastatic_power').jqxNumberInput(PosInt);
- $('#protein').jqxNumberInput(Spin1dec);
- $('#dissolved_protein').jqxNumberInput(Spin1dec);
- $('#max_in_batch').jqxNumberInput(Perc1dec);
- $('#recommend_mash').jqxCheckBox({ theme: theme, width: 120, height: 23 });
- $('#added').jqxDropDownList({
-  theme: theme,
-  source: AddedAdapter,
-  valueMember: 'nl',
-  displayMember: 'nl',
-  width: 180,
-  height: 23,
-  autoDropDownHeight: true
- });
- $('#always_on_stock').jqxCheckBox({ theme: theme, width: 120, height: 23 });
- $('#di_ph').jqxNumberInput(Spin2pH);
- $('#acid_to_ph_57').jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: -1000, max: 1000, decimalDigits: 4, spinButtons: true });
- $('#graintype').jqxDropDownList({
-  theme: theme,
-  source: GrainTypeAdapter,
-  valueMember: 'nl',
-  displayMember: 'nl',
-  width: 180,
-  height: 23,
-  autoDropDownHeight: true
- });
- $('#inventory').jqxNumberInput(Spin3dec);
- $('#production_date').jqxDateTimeInput(Dateopts);
- $('#cost').jqxNumberInput(Spin2dec);
- $('#tht_date').jqxDateTimeInput(Dateopts);
- $('#totval').jqxNumberInput(Show2dec);
-
- var  localizationobj = {};
- localizationobj.filterchoosestring= "Keuze:";
-
- // initialize jqxGrid
- $('#jqxgrid').jqxGrid({
-  width: 1280,
-  height: 630,
-  source: dataAdapter,
-  theme: theme,
-  showstatusbar: true,
-  renderstatusbar: function(statusbar) {
-   var rowCount = $("#jqxgrid").jqxGrid('getrows').length;
-   statusbar.append('<div style="float: left; margin: 8px; color: orange !important;">Aantal items: ' + rowCount + '</div>');
-   var container, addButton, impButton;
-   container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');
-   addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Nieuw</span></div>');
-   impButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Import</span></div>');
-   expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/database.png"/><span style="margin-left: 4px; position: relative; top: -10px;">Export</span></div>');
-   container.append(addButton);
-   container.append(impButton);
-   container.append(expButton);
-   statusbar.append(container);
-   addButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   impButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   expButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   // add new row.
-   addButton.click(function(event) {
-    editrow = -1;
-    $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
-    $('#name').val('Nieuw product');
-    dataRecord.uuid = '';
-    $('#type').val('Mout');
-    $('#origin').val('');
-    $('#supplier').val('');
-    $('#notes').val('');
-    $('#yield').val(80);
-    $('#color').val(3);
-    $('#coarse_fine_diff').val(3);
-    $('#moisture').val(4);
-    $('#diastatic_power').val(0);
-    $('#protein').val(0);
-    $('#dissolved_protein').val(0);
-    $('#max_in_batch').val(100);
-    $('#recommend_mash').val(1);
-    $('#always_on_stock').val(0);
-    $('#di_ph').val(0);
-    $('#acid_to_ph_57').val(0);
-    $('#graintype').val('Basismout');
-    $('#add_after_boil').val(0);
-    $('#added').val('Maischen');
-    $('#inventory').val(0);
-    $('#cost').val(0);
-    $('#production_date').val('');
-    $('#tht_date').val('');
-    $('#popupWindow').jqxWindow('open');
-   });
-   impButton.click(function(event) {
-    window.location.href = 'import_ingredients.php?select=fermentables';
-   });
-   expButton.click(function(event) {
-    window.open('export_fermentables.php');
-   });
-  },
-  ready: function () {
-   $("#jqxgrid").jqxGrid('localizestrings', localizationobj);
-  },
-  filterable: true,
-  showfilterrow: true,
-  columns: [
-   { text: 'Herkomst', datafield: 'origin', width: 150, filtertype: 'list' },
-   { text: 'Producent', datafield: 'supplier', width: 140, filtertype: 'list' },
-   { text: 'Vergistbaar product', datafield: 'name', filtertype: 'textbox' },
-   { text: 'Soort', datafield: 'type', width: 135, filtertype: 'list' },
-   { text: 'Graan type', datafield: 'graintype',  width: 125, align: 'center', cellsalign: 'center', filtertype: 'list' },
-   { text: 'EBC', datafield: 'color', width: 70, align: 'right', cellsalign: 'right', filtertype: 'number' },
-   { text: 'Opbrengst', datafield: 'yield', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'p1', filterable: false },
-   { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', filtertype: 'number', filtercondition: 'not_equal',
-    cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) {
-     var amount = '';
-     if (value > 0) {
-      if (value < 1.000)
-       amount = dataAdapter.formatNumber(value * 1000, 'f0') + ' gr';
-      else
-       amount = dataAdapter.formatNumber(value, 'f1') + ' kg';
-     }
-     return '<span style="margin: 3px; margin-top: 6px; float: right;">' + amount + '</span>';
-    }
-   },
-   { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', filterable: false,
-    cellsrenderer: function() {
-     return 'Wijzig';
-    }, buttonclick: function(row) {
-     // open the popup window when the user clicks a button.
-     editrow = row;
-     $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
-     // get the clicked row's data and initialize the input fields.
-     dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow);
-     $('#name').val(dataRecord.name);
-     $('#type').val(dataRecord.type);
-     $('#yield').val(dataRecord.yield);
-     $('#color').val(dataRecord.color);
-     $('#add_after_boil').val(dataRecord.add_after_boil);
-     $('#origin').val(dataRecord.origin);
-     $('#supplier').val(dataRecord.supplier);
-     $('#notes').val(dataRecord.notes);
-     $('#coarse_fine_diff').val(dataRecord.coarse_fine_diff);
-     $('#moisture').val(dataRecord.moisture);
-     $('#diastatic_power').val(lintner_to_kolbach(dataRecord.diastatic_power));
-     $('#protein').val(dataRecord.protein);
-     $('#dissolved_protein').val(dataRecord.dissolved_protein);
-     $('#max_in_batch').val(dataRecord.max_in_batch);
-     $('#recommend_mash').val(dataRecord.recommend_mash);
-     $('#added').val(dataRecord.added);
-     $('#always_on_stock').val(dataRecord.always_on_stock);
-     $('#di_ph').val(dataRecord.di_ph);
-     $('#acid_to_ph_57').val(dataRecord.acid_to_ph_57);
-     $('#graintype').val(dataRecord.graintype);
-     $('#inventory').val(dataRecord.inventory);
-     $('#cost').val(dataRecord.cost);
-     $('#production_date').val(dataRecord.production_date);
-     $('#tht_date').val(dataRecord.tht_date);
-     calcTotal(dataRecord.cost, dataRecord.inventory);
-     // show the popup window.
-     $('#popupWindow').jqxWindow('open');
-    }
-   }
-  ]
- });
-
- $('#cost').on('change', function(event) {
-  dataRecord.cost = parseFloat(event.args.value);
-  calcTotal(dataRecord.cost, dataRecord.inventory);
- });
- $('#inventory').on('change', function(event) {
-  dataRecord.inventory = parseFloat(event.args.value);
-  calcTotal(dataRecord.cost, dataRecord.inventory);
- });
-
- // initialize the popup window and buttons.
- $('#popupWindow').jqxWindow({
-  width: 1050,
-  height: 550,
-  resizable: false,
-  theme: theme,
-  isModal: true,
-  autoOpen: false,
-  cancelButton: $('#Cancel'),
-  modalOpacity: 0.40
- });
- $('#popupWindow').on('open', function() {
-  $('#name').jqxInput('selectAll');
- });
- $('#Delete').jqxButton({ template: 'danger', width: '90px', theme: theme });
- $('#Delete').click(function() {
-  if (editrow >= 0) {
-   // Open a popup to confirm this action.
-   $('#eventWindow').jqxWindow('open');
-   $('#delOk').click(function() {
-    var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-    $('#jqxgrid').jqxGrid('deleterow', rowID);
-   });
-  }
-  $('#popupWindow').jqxWindow('hide');
- });
- $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme });
- $('#Clone').jqxButton({ template: 'warning', width: '90px', theme: theme });
- $('#Clone').click(function() {
-  var row = {
-   record: -1,
-   name: $('#name').val() + ' kopie',
-   uuid: '',
-   type: $('#type').val(),
-   yield: parseFloat($('#yield').jqxNumberInput('decimal')),
-   color: parseFloat($('#color').jqxNumberInput('decimal')),
-   add_after_boil: $('#add_after_boil').val(),
-   origin: $('#origin').val(),
-   supplier: $('#supplier').val(),
-   notes: $('#notes').val(),
-   coarse_fine_diff: parseFloat($('#coarse_fine_diff').jqxNumberInput('decimal')),
-   moisture: parseFloat($('#moisture').jqxNumberInput('decimal')),
-   diastatic_power: kolbach_to_lintner(parseFloat($('#diastatic_power').jqxNumberInput('decimal'))),
-   protein: parseFloat($('#protein').jqxNumberInput('decimal')),
-   dissolved_protein: parseFloat($('#dissolved_protein').jqxNumberInput('decimal')),
-   max_in_batch: parseFloat($('#max_in_batch').jqxNumberInput('decimal')),
-   recommend_mash: $('#recommend_mash').val(),
-   added: $('#added').val(),
-   always_on_stock: $('#always_on_stock').val(),
-   di_ph: parseFloat($('#di_ph').jqxNumberInput('decimal')),
-   acid_to_ph_57: parseFloat($('#acid_to_ph_57').jqxNumberInput('decimal')),
-   graintype: $('#graintype').val(),
-   inventory: 0,
-   cost: parseFloat($('#cost').jqxNumberInput('decimal')),
-   production_date: '',
-   tht_date: ''
-  };
-  $('#jqxgrid').jqxGrid('addrow', null, row);
-  $('#popupWindow').jqxWindow('hide');
- });
- $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme });
- // update the edited row when the user clicks the 'Save' button.
- $('#Save').click(function() {
-  var row, rowID = -1;
-  if (editrow >= 0) {
-   rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-  }
-  row = {
-   record: rowID,
-   name: $('#name').val(),
-   uuid: dataRecord.uuid,
-   type: $('#type').val(),
-   yield: parseFloat($('#yield').jqxNumberInput('decimal')),
-   color: parseFloat($('#color').jqxNumberInput('decimal')),
-   add_after_boil: $('#add_after_boil').val(),
-   origin: $('#origin').val(),
-   supplier: $('#supplier').val(),
-   notes: $('#notes').val(),
-   coarse_fine_diff: parseFloat($('#coarse_fine_diff').jqxNumberInput('decimal')),
-   moisture: parseFloat($('#moisture').jqxNumberInput('decimal')),
-   diastatic_power: kolbach_to_lintner(parseFloat($('#diastatic_power').jqxNumberInput('decimal'))),
-   protein: parseFloat($('#protein').jqxNumberInput('decimal')),
-   dissolved_protein: parseFloat($('#dissolved_protein').jqxNumberInput('decimal')),
-   max_in_batch: parseFloat($('#max_in_batch').jqxNumberInput('decimal')),
-   recommend_mash: $('#recommend_mash').val(),
-   added: $('#added').val(),
-   always_on_stock: $('#always_on_stock').val(),
-   di_ph: parseFloat($('#di_ph').jqxNumberInput('decimal')),
-   acid_to_ph_57: parseFloat($('#acid_to_ph_57').jqxNumberInput('decimal')),
-   graintype: $('#graintype').val(),
-   inventory: parseFloat($('#inventory').jqxNumberInput('decimal')),
-   cost: parseFloat($('#cost').jqxNumberInput('decimal')),
-   production_date: $('#production_date').val(),
-   tht_date: $('#tht_date').val(),
-  };
-  if (editrow >= 0) {
-   $('#jqxgrid').jqxGrid('updaterow', rowID, row);
-  } else {
-   $('#jqxgrid').jqxGrid('addrow', null, row);
-  }
-  $('#popupWindow').jqxWindow('hide');
- });
- createDelElements();
-});
-
--- a/www/js/inv_miscs.js	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,406 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 2014-2022
- *
- * Michiel Broek <mbroek at mbse dot eu>
- *
- * This file is part of Brewery Management System
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * BrewCloud is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ThermFerm; see the file COPYING.  If not, write to the Free
- * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- *****************************************************************************/
-
-
-function createDelElements() {
- $('#eventWindow').jqxWindow({
-  theme: theme,
-  position: { x: 490, y: 210 },
-  width: 300,
-  height: 175,
-  resizable: false,
-  isModal: true,
-  modalOpacity: 0.4,
-  okButton: $('#delOk'),
-  cancelButton: $('#delCancel'),
-  initContent: function() {
-   $('#delOk').jqxButton({ template: 'danger', width: '65px', theme: theme });
-   $('#delCancel').jqxButton({ template: 'success', width: '65px', theme: theme });
-   $('#delCancel').focus();
-  }
- });
- $('#eventWindow').jqxWindow('hide');
-}
-
-
-$(document).ready(function() {
-
- function calcTotal(cost, inventory) {
-
-  $('#totval').val(cost * (inventory / 1000));
- }
-
- function prompts(isweight) {
-
-  if (isweight) {
-   $('#pmpt_cost').html('Prijs per kg:');
-   $('#pmpt_inventory').html('Voorraad gram:');
-  } else {
-   $('#pmpt_cost').html('Prijs per liter:');
-   $('#pmpt_inventory').html('Voorraad ml:');
-  }
- }
-
- var dataRecord = {},
- url = 'includes/db_inventory_miscs.php',
- // prepare the data
- source = {
-  datatype: 'json',
-  cache: false,
-  datafields: [
-   { name: 'record', type: 'number' },
-   { name: 'name', type: 'string' },
-   { name: 'uuid', type: 'string' },
-   { name: 'type', type: 'string' },
-   { name: 'use_use', type: 'string' },
-   { name: 'time', type: 'int' },
-   { name: 'amount', type: 'float' },
-   { name: 'amount_is_weight', type: 'int' },
-   { name: 'use_for', type: 'string' },
-   { name: 'notes', type: 'string' },
-   { name: 'always_on_stock', type: 'int' },
-   { name: 'inventory', type: 'float' },
-   { name: 'cost', type: 'float' },
-   { name: 'production_date', type: 'string' },
-   { name: 'tht_date', type: 'string' }
-  ],
-  id: 'record',
-  url: url,
-  deleterow: function(rowid, commit) {
-   // synchronize with the server - send delete command
-   var data = 'delete=true&' + $.param({ record: rowid });
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('delete: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('delete: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  },
-  addrow: function(rowid, rowdata, position, commit) {
-   var data = 'insert=true&' + $.param(rowdata);
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('insert: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('insert: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  },
-  updaterow: function(rowid, rowdata, commit) {
-   var data = 'update=true&' + $.param(rowdata);
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('updaterow: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('updaterow: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  }
- },
- dataAdapter = new $.jqx.dataAdapter(source),
- editrow = -1;
-
- // initialize the input fields.
- $('#name').jqxInput({ theme: theme, width: 640, height: 23 });
- $('#notes').jqxInput({ theme: theme, width: 800, height: 100 });
-
- $('#type').jqxDropDownList({theme: theme,
-  source: MiscTypeAdapter,
-  valueMember: 'nl',
-  displayMember: 'nl',
-  width: 180,
-  height: 23,
-  autoDropDownHeight: true
- });
- $('#use_use').jqxDropDownList({
-  theme: theme,
-  source: MiscUseAdapter,
-  valueMember: 'nl',
-  displayMember: 'nl',
-  width: 180,
-  height: 23,
-  autoDropDownHeight: true
- });
- $('#time').jqxNumberInput(PosInt);
- $('#amount_is_weight').jqxCheckBox({ theme: theme, width: 120, height: 23 });
- $('#use_for').jqxInput({ theme: theme, width: 640, height: 48 });
- $('#always_on_stock').jqxCheckBox({ theme: theme, width: 120, height: 23 });
- $('#inventory').jqxNumberInput(Spin1dec);
- $('#production_date').jqxDateTimeInput(Dateopts);
- $('#cost').jqxNumberInput(Spin2dec);
- $('#tht_date').jqxDateTimeInput(Dateopts);
- $('#totval').jqxNumberInput(Show2dec);
-
- var  localizationobj = {};
- localizationobj.filterchoosestring= "Keuze:";
-
- // initialize jqxGrid
- $('#jqxgrid').jqxGrid({
-  width: 1280,
-  height: 630,
-  source: dataAdapter,
-  theme: theme,
-  showstatusbar: true,
-  renderstatusbar: function(statusbar) {
-   var rowCount = $("#jqxgrid").jqxGrid('getrows').length;
-   statusbar.append('<div style="float: left; margin: 8px; color: orange !important;">Aantal items: ' + rowCount + '</div>');
-   var container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');
-   var addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Nieuw</span></div>');
-   var impButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Import</span></div>');
-   var expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/database.png"/><span style="margin-left: 4px; position: relative; top: -10px;">Export</span></div>');
-   container.append(addButton);
-   container.append(impButton);
-   container.append(expButton);
-   statusbar.append(container);
-   addButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   impButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   expButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   // add new row.
-   addButton.click(function(event) {
-    editrow = -1;
-    $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
-    $('#name').val('');
-    dataRecord.uuid = '';
-    $('#type').val('Specerij');
-    $('#use_use').val('Starter');
-    $('#time').val(0);
-    $('#amount_is_weight').val(1);
-    $('#use_for').val('');
-    $('#notes').val('');
-    $('#always_on_stock').val(0);
-    $('#inventory').val(0);
-    $('#cost').val(0);
-    $('#production_date').val('');
-    $('#tht_date').val('');
-    $('#popupWindow').jqxWindow('open');
-   });
-   impButton.click(function(event) {
-    window.location.href = 'import_ingredients.php?select=miscs';
-   });
-   expButton.click(function(event) {
-    window.open('export_miscs.php');
-   });
-  },
-  ready: function () {
-   $("#jqxgrid").jqxGrid('localizestrings', localizationobj);
-  },
-  filterable: true,
-  showfilterrow: true,
-  columns: [
-   { text: 'Ingredient naam', datafield: 'name', filtertype: 'textbox' },
-   { text: 'Type', datafield: 'type', align: 'left', width: 120, filtertype: 'list' },
-   { text: 'Gebruik', datafield: 'use_use', align: 'left', width: 120, filtertype: 'list' },
-   { text: 'Tijd', datafield: 'time', width: 90, align: 'left', filterable: false,
-    cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) {
-     var duration = '';
-     if (value > 0) {
-      if (value == 1)
-       duration = '1 minuut';
-      else if (value < 60)
-       duration = dataAdapter.formatNumber(value, 'f0') + ' minuten';
-      else if (value == 60)
-       duration = '1 uur';
-      else if (value < 1440)
-       duration = dataAdapter.formatNumber(value / 60, 'f0') + ' uren';
-      else if (value == 1440)
-       duration = '1 dag';
-      else
-       duration = dataAdapter.formatNumber(value / 1440, 'f0') + ' dagen';
-     }
-     return '<span style="margin: 3px; margin-top: 6px; float: left;">' + duration + '</span>';
-    }
-   },
-   { text: 'Voorraad', datafield: 'inventory', width: 110, align: 'right', filtertype: 'number', filtercondition: 'not_equal',
-    cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) {
-     var amount = '';
-     if (value > 0) {
-      if (rowdata.amount_is_weight)
-       amount = dataAdapter.formatNumber(value, 'f1') + ' gr';
-      else
-       amount = dataAdapter.formatNumber(value, 'f1') + ' ml';
-     }
-     return '<span style="margin: 3px; margin-top: 6px; float: right;">' + amount + '</span>';
-    }
-   },
-   { text: 'THT datum', datafield: 'tht_date', width: 100, align: 'center', cellsalign: 'center', filtertype: 'date' },
-   { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', filterable: false,
-    cellsrenderer: function() {
-     return 'Wijzig';
-    }, buttonclick: function(row) {
-     // open the popup window when the user clicks a button.
-     editrow = row;
-     $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
-     // get the clicked row's data and initialize the input fields.
-     dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow);
-     $('#name').val(dataRecord.name);
-     $('#type').val(dataRecord.type);
-     $('#use_use').val(dataRecord.use_use);
-     $('#time').val(dataRecord.time);
-     $('#amount_is_weight').val(dataRecord.amount_is_weight);
-     $('#use_for').val(dataRecord.use_for);
-     $('#notes').val(dataRecord.notes);
-     $('#always_on_stock').val(dataRecord.always_on_stock);
-     $('#inventory').val(dataRecord.inventory);
-     $('#cost').val(dataRecord.cost);
-     $('#production_date').val(dataRecord.production_date);
-     $('#tht_date').val(dataRecord.tht_date);
-     calcTotal(dataRecord.cost, dataRecord.inventory);
-     prompts(dataRecord.amount_is_weight);
-     // show the popup window.
-     $('#popupWindow').jqxWindow('open');
-    }
-   }
-  ]
- });
-
- $('#cost').on('change', function(event) {
-  dataRecord.cost = parseFloat(event.args.value);
-  calcTotal(dataRecord.cost, dataRecord.inventory);
- });
- $('#inventory').on('change', function(event) {
-  dataRecord.inventory = parseFloat(event.args.value);
-  calcTotal(dataRecord.cost, dataRecord.inventory);
- });
- $('#amount_is_weight').on('checked', function(event) {
-  dataRecord.amount_is_weight = true;
-  prompts(true);
- });
- $('#amount_is_weight').on('unchecked', function(event) {
-  dataRecord.amount_is_weight = false;
-  prompts(false);
- });
-
- // initialize the popup window and buttons.
- $('#popupWindow').jqxWindow({
-  width: 1050,
-  height: 550,
-  resizable: false,
-  theme: theme,
-  isModal: true,
-  autoOpen: false,
-  cancelButton: $('#Cancel'),
-  modalOpacity: 0.40
- });
- $('#popupWindow').on('open', function() {
-  $('#name').jqxInput('selectAll');
- });
- $('#Delete').jqxButton({ template: 'danger', width: '90px', theme: theme });
- $('#Delete').click(function() {
-  if (editrow >= 0) {
-   // Open a popup to confirm this action.
-   $('#eventWindow').jqxWindow('open');
-   $('#delOk').click(function() {
-    var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-    $('#jqxgrid').jqxGrid('deleterow', rowID);
-   });
-  }
-  $('#popupWindow').jqxWindow('hide');
- });
- $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme });
- $('#Clone').jqxButton({ template: 'warning', width: '90px', theme: theme });
- $('#Clone').click(function() {
-  var row = {
-   record: -1,
-   name: $('#name').val() + ' kopie',
-   uuid: '',
-   type: $('#type').val(),
-   use_use: $('#use_use').val(),
-   time: parseFloat($('#time').jqxNumberInput('decimal')),
-   amount_is_weight: $('#amount_is_weight').val(),
-   use_for: $('#use_for').val(),
-   notes: $('#notes').val(),
-   always_on_stock: $('#always_on_stock').val(),
-   inventory: 0,
-   cost: parseFloat($('#cost').jqxNumberInput('decimal')),
-   production_date: '',
-   tht_date: ''
-  };
-  $('#jqxgrid').jqxGrid('addrow', null, row);
-  $('#popupWindow').jqxWindow('hide');
- });
- $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme });
- // update the edited row when the user clicks the 'Save' button.
- $('#Save').click(function() {
-  var row, rowID = -1;
-  if (editrow >= 0) {
-   rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-  }
-  row = {
-   record: rowID,
-   name: $('#name').val(),
-   uuid: dataRecord.uuid,
-   type: $('#type').val(),
-   use_use: $('#use_use').val(),
-   time: parseFloat($('#time').jqxNumberInput('decimal')),
-   amount_is_weight: $('#amount_is_weight').val(),
-   use_for: $('#use_for').val(),
-   notes: $('#notes').val(),
-   always_on_stock: $('#always_on_stock').val(),
-   inventory: parseFloat($('#inventory').jqxNumberInput('decimal')),
-   cost: parseFloat($('#cost').jqxNumberInput('decimal')),
-   production_date: $('#production_date').val(),
-   tht_date: $('#tht_date').val()
-  };
-  if (editrow >= 0) {
-   $('#jqxgrid').jqxGrid('updaterow', rowID, row);
-  } else {
-   $('#jqxgrid').jqxGrid('addrow', null, row);
-  }
-  $('#popupWindow').jqxWindow('hide');
- });
- createDelElements();
-});
-
--- a/www/js/inv_waters.js	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,362 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 2014-2022
- *
- * Michiel Broek <mbroek at mbse dot eu>
- *
- * This file is part of Brewery Management System
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * BrewCloud is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ThermFerm; see the file COPYING.  If not, write to the Free
- * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- *****************************************************************************/
-
-
-function createDelElements() {
- $('#eventWindow').jqxWindow({
-  theme: theme,
-  position: { x: 490, y: 210 },
-  width: 300,
-  height: 175,
-  resizable: false,
-  isModal: true,
-  modalOpacity: 0.4,
-  okButton: $('#delOk'),
-  cancelButton: $('#delCancel'),
-  initContent: function() {
-   $('#delOk').jqxButton({ template: 'danger', width: '65px', theme: theme });
-   $('#delCancel').jqxButton({ template: 'success', width: '65px', theme: theme });
-   $('#delCancel').focus();
-  }
- });
- $('#eventWindow').jqxWindow('hide');
-}
-
-
-$(document).ready(function() {
-
- // tooltips
- $('#name').jqxTooltip({ content: 'De unieke naam van dit brouwwater.' });
- $('#notes').jqxTooltip({ content: 'Extra opmerkingen over dit water.' });
- $('#unlimited_stock').jqxTooltip({ content: 'Onbeperkte voorraad zoals kraanwater en bronnen.' });
- $('#calcium').jqxTooltip({ content: 'Calcium (Ca).' });
- $('#bicarbonate').jqxTooltip({ content: 'Bicarbonaat (HCO3). Berekend meteen de Totale alkaliteit.' });
- $('#sulfate').jqxTooltip({ content: 'Calcium Sulfaat (CaSO4).' });
- $('#chloride').jqxTooltip({ content: 'Chloride (Cl).' });
- $('#sodium').jqxTooltip({ content: 'Natrium, oftewel keukenzout (Na). In berekeningen ook vaak als Sodium.' });
- $('#magnesium').jqxTooltip({ content: 'Magnesium (Mg).' });
- $('#ph').jqxTooltip({ content: 'De zuurgraad (pH).' });
- $('#total_alkalinity').jqxTooltip({ content: 'Totale alkaliniteit. Berekend meteen de Bicarbonaat.' });
- $('#balance').jqxTooltip({ content: 'De ionen balans van het water. Ideaal minder dan 0.1 verschil tussen kationen en anionen. Meer dan 0.5 is een fout in het waterraport.' });
- $('#inventory').jqxTooltip({ content: 'Voorraad in liters.' });
- $('#cost').jqxTooltip({ content: 'Kostprijs per liter. 5 cijfers achter de comma zodat het kraanwater er ook in kan.' });
-
- var dataRecord = {},
- url = 'includes/db_inventory_water.php',
- // prepare the data
- source = {
-  datatype: 'json',
-  cache: false,
-  datafields: [
-   { name: 'record', type: 'number' },
-   { name: 'uuid', type: 'string' },
-   { name: 'name', type: 'string' },
-   { name: 'unlimited_stock', type: 'int' },
-   { name: 'calcium', type: 'float' },
-   { name: 'bicarbonate', type: 'float' },
-   { name: 'sulfate', type: 'float' },
-   { name: 'chloride', type: 'float' },
-   { name: 'sodium', type: 'float' },
-   { name: 'magnesium', type: 'float' },
-   { name: 'ph', type: 'float' },
-   { name: 'notes', type: 'string' },
-   { name: 'total_alkalinity', type: 'float' },
-   { name: 'inventory', type: 'float' },
-   { name: 'cost', type: 'float' }
-  ],
-  id: 'record',
-  url: url,
-  deleterow: function(rowid, commit) {
-   // synchronize with the server - send delete command
-   var data = 'delete=true&' + $.param({ record: rowid });
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('delete: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('delete: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  },
-  addrow: function(rowid, rowdata, position, commit) {
-   var data = 'insert=true&' + $.param(rowdata);
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('insert: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('insert: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  },
-  updaterow: function(rowid, rowdata, commit) {
-   var data = 'update=true&' + $.param(rowdata);
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('updaterow: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('updaterow: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  }
- },
- dataAdapter = new $.jqx.dataAdapter(source),
- editrow = -1;
-
- // initialize the input fields.
- $('#name').jqxInput({ theme: theme, width: 640, height: 23 });
- $('#notes').jqxInput({ theme: theme, width: 640, height: 100 });
- $('#unlimited_stock').jqxCheckBox({ theme: theme, width: 120, height: 23 });
- $('#calcium').jqxNumberInput(Spin1dec);
- $('#bicarbonate').jqxNumberInput(Spin1dec);
- $('#sulfate').jqxNumberInput(Spin1dec);
- $('#chloride').jqxNumberInput(Spin1dec);
- $('#sodium').jqxNumberInput(Spin1dec);
- $('#magnesium').jqxNumberInput(Spin1dec);
- $('#ph').jqxNumberInput(Spin2pH);
- $('#total_alkalinity').jqxNumberInput(Spin1dec);
- $('#balance').jqxNumberInput(Show2dec);
- $('#inventory').jqxNumberInput(Spin1dec);
- $('#cost').jqxNumberInput({inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 5, spinButtons: true });
-
- // initialize jqxGrid
- $('#jqxgrid').jqxGrid({
-  width: 1280,
-  height: 630,
-  source: dataAdapter,
-  theme: theme,
-  showstatusbar: true,
-  renderstatusbar: function(statusbar) {
-   var rowCount = $("#jqxgrid").jqxGrid('getrows').length;
-   statusbar.append('<div style="float: left; margin: 8px; color: orange !important;">Aantal items: ' + rowCount + '</div>');
-   var addButton, container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');
-   addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Nieuw</span></div>');
-   expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/database.png"/><span style="margin-left: 4px; position: relative; top: -10px;">Export</span></div>');
-   container.append(addButton);
-   container.append(expButton);
-   statusbar.append(container);
-   addButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   expButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   // add new row.
-   addButton.click(function(event) {
-    editrow = -1;
-    $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
-    $('#name').val('Nieuw brouwwater');
-    dataRecord.uuid = '';
-    $('#unlimited_stock').val(0);
-    $('#calcium').val(0);
-    $('#bicarbonate').val(0);
-    $('#sulfate').val(0);
-    $('#chloride').val(0);
-    $('#sodium').val(0);
-    $('#magnesium').val(0);
-    $('#ph').val(7);
-    $('#notes').val('');
-    $('#total_alkalinity').val(0);
-    $('#inventory').val(0);
-    $('#cost').val(0);
-    $('#popupWindow').jqxWindow('open');
-   });
-   expButton.click(function(event) {
-    window.open('export_waters.php');
-   });
-  },
-  filterable: false,
-  columns: [
-   { text: 'Water leverancier', datafield: 'name', width: 225 },
-   { text: 'Opmerkingen', datafield: 'notes' },
-   { text: 'Onbeperkt', datafield: 'unlimited_stock', columntype: 'checkbox', width: 80 },
-   { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1',
-    cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) {
-     var amount = '';
-     if (value > 0 && rowdata.unlimited_stock == 0)
-      amount = dataAdapter.formatNumber(value, 'f1') + ' L';
-     return '<span style="margin: 3px; margin-top: 6px; float: right;">' + amount + '</span>';
-    }
-   },
-   { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button',
-    cellsrenderer: function() {
-     return 'Wijzig';
-    }, buttonclick: function(row) {
-     // open the popup window when the user clicks a button.
-     editrow = row;
-     $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
-     // get the clicked row's data and initialize the input fields.
-     dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow);
-     $('#name').val(dataRecord.name);
-     $('#unlimited_stock').val(dataRecord.unlimited_stock);
-     $('#calcium').val(dataRecord.calcium);
-     $('#bicarbonate').val(dataRecord.bicarbonate);
-     $('#sulfate').val(dataRecord.sulfate);
-     $('#chloride').val(dataRecord.chloride);
-     $('#sodium').val(dataRecord.sodium);
-     $('#magnesium').val(dataRecord.magnesium);
-     $('#ph').val(dataRecord.ph);
-     $('#notes').val(dataRecord.notes);
-     $('#total_alkalinity').val(dataRecord.total_alkalinity);
-     $('#inventory').val(dataRecord.inventory);
-     $('#cost').val(dataRecord.cost);
-     // show the popup window.
-     calcBalance();
-     $('#popupWindow').jqxWindow('open');
-    }
-   }
-  ]
- });
-
- function calcBalance() {
-  var cations = (dataRecord.calcium / 20.039) + (dataRecord.magnesium / 12.1525) + (dataRecord.sodium / 22.989);
-  var anions = (dataRecord.bicarbonate / 61.016) + (dataRecord.sulfate / 48.031) + (dataRecord.chloride / 35.4527);
-  var balance = Round(cations - anions, 2);
-  $('#balance').val(balance);
-  if (balance <= 0.1 && balance >= -0.1)
-   $('#wr_balance').html("<img src='images/dialog-ok-apply.png'>");
-  else if (balance <= 0.5 && balance >= -0.5)
-   $('#wr_balance').html("<img src='images/dialog-ok.png'>");
-  else
-   $('#wr_balance').html("<img src='images/dialog-error.png'>");
- }
-
- $('#calcium').on('change', function(event) {
-  dataRecord.calcium = parseFloat(event.args.value);
-  calcBalance();
- });
- $('#magnesium').on('change', function(event) {
-  dataRecord.magnesium = parseFloat(event.args.value);
-  calcBalance();
- });
- $('#sodium').on('change', function(event) {
-  dataRecord.sodium = parseFloat(event.args.value);
-  calcBalance();
- });
- $('#total_alkalinity').on('change', function(event) {
-  dataRecord.total_alkalinity = parseFloat(event.args.value);
-  dataRecord.bicarbonate = parseFloat(event.args.value) * 1.22;
-  $('#bicarbonate').val(dataRecord.bicarbonate);
-  calcBalance();
- });
- $('#bicarbonate').on('change', function(event) {
-  dataRecord.bicarbonate = parseFloat(event.args.value);
-  dataRecord.total_alkalinity = parseFloat(event.args.value) * 50 / 61;
-  $('#total_alkalinity').val(dataRecord.total_alkalinity);
-  calcBalance();
- });
- $('#sulfate').on('change', function(event) {
-  dataRecord.sulfate = parseFloat(event.args.value);
-  calcBalance();
- });
- $('#chloride').on('change', function(event) {
-  dataRecord.chloride = parseFloat(event.args.value);
-  calcBalance();
- });
-
- // initialize the popup window and buttons.
- $('#popupWindow').jqxWindow({
-  width: 1050,
-  height: 550,
-  resizable: false,
-  theme: theme,
-  isModal: true,
-  autoOpen: false,
-  cancelButton: $('#Cancel'),
-  modalOpacity: 0.40
- });
- $('#popupWindow').on('open', function() {
-  $('#name').jqxInput('selectAll');
- });
- $('#Delete').jqxButton({ template: 'danger', width: '90px', theme: theme });
- $('#Delete').click(function() {
-  if (editrow >= 0) {
-   // Open a popup to confirm this action.
-   $('#eventWindow').jqxWindow('open');
-   $('#delOk').click(function() {
-    var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-    $('#jqxgrid').jqxGrid('deleterow', rowID);
-   });
-  }
-  $('#popupWindow').jqxWindow('hide');
- });
- $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme });
- $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme });
- // update the edited row when the user clicks the 'Save' button.
- $('#Save').click(function() {
-  var row, rowID = -1;
-  if (editrow >= 0) {
-   rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-  }
-  row = {
-   record: rowID,
-   name: $('#name').val(),
-   uuid: dataRecord.uuid,
-   unlimited_stock: $('#unlimited_stock').val(),
-   calcium: parseFloat($('#calcium').jqxNumberInput('decimal')),
-   bicarbonate: parseFloat($('#bicarbonate').jqxNumberInput('decimal')),
-   sulfate: parseFloat($('#sulfate').jqxNumberInput('decimal')),
-   chloride: parseFloat($('#chloride').jqxNumberInput('decimal')),
-   sodium: parseFloat($('#sodium').jqxNumberInput('decimal')),
-   magnesium: parseFloat($('#magnesium').jqxNumberInput('decimal')),
-   ph: parseFloat($('#ph').jqxNumberInput('decimal')),
-   notes: $('#notes').val(),
-   total_alkalinity: parseFloat($('#total_alkalinity').jqxNumberInput('decimal')),
-   inventory: parseFloat($('#inventory').jqxNumberInput('decimal')),
-   cost: parseFloat($('#cost').jqxNumberInput('decimal'))
-  };
-  if (editrow >= 0) {
-   $('#jqxgrid').jqxGrid('updaterow', rowID, row);
-  } else {
-   $('#jqxgrid').jqxGrid('addrow', null, row);
-  }
-  $('#popupWindow').jqxWindow('hide');
- });
- createDelElements();
-});
-
--- a/www/js/inv_yeasts.js	Mon Aug 01 09:56:23 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,613 +0,0 @@
-/*****************************************************************************
- * Copyright (C) 2014-2022
- *
- * Michiel Broek <mbroek at mbse dot eu>
- *
- * This file is part of Brewery Management System
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * BrewCloud is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ThermFerm; see the file COPYING.  If not, write to the Free
- * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- *****************************************************************************/
-
-
-function createDelElements() {
- $('#eventWindow').jqxWindow({
-  theme: theme,
-  position: { x: 490, y: 210 },
-  width: 300,
-  height: 175,
-  resizable: false,
-  isModal: true,
-  modalOpacity: 0.4,
-  okButton: $('#delOk'),
-  cancelButton: $('#delCancel'),
-  initContent: function() {
-   $('#delOk').jqxButton({ template: 'danger', width: '65px', theme: theme });
-   $('#delCancel').jqxButton({ template: 'success', width: '65px', theme: theme });
-   $('#delCancel').focus();
-  }
- });
- $('#eventWindow').jqxWindow('hide');
-}
-
-
-$(document).ready(function() {
-
- function calcTotal() {
-
-  $('#totval').val(dataRecord.cost * dataRecord.inventory);
-  if (dataRecord.form == 'Vloeibaar') { // Liquid
-   $('#pmpt_cost').html('Prijs per pak:');
-   $('#pmpt_inventory').html('Voorraad pak(ken):');
-   $('#pmpt_cells').html('Miljard cellen per pak:');
-   $('#inventory').jqxNumberInput({ decimalDigits: 0 });
-  } else if (dataRecord.form == 'Droog' || dataRecord.form == 'Gedroogd') { // Dry
-   $('#pmpt_cost').html('Prijs per kg:');
-   $('#pmpt_inventory').html('Voorraad gram:');
-   $('#pmpt_cells').html('Miljard cellen per gram:');
-   $('#inventory').jqxNumberInput({ decimalDigits: 1 });
-  } else {
-   $('#pmpt_cost').html('Prijs per liter:');
-   $('#pmpt_inventory').html('Voorraad ml:');
-   $('#pmpt_cells').html('Miljard cellen per ml:');
-   $('#inventory').jqxNumberInput({ decimalDigits: 1 });
-  }
- }
-
- var dataRecord = {},
- url = 'includes/db_inventory_yeasts.php',
- source = {
-  datatype: 'json',
-  cache: false,
-  datafields: [
-   { name: 'record', type: 'number' },
-   { name: 'uuid', type: 'string' },
-   { name: 'name', type: 'string' },
-   { name: 'type', type: 'string' },
-   { name: 'form', type: 'string' },
-   { name: 'laboratory', type: 'string' },
-   { name: 'product_id', type: 'string' },
-   { name: 'min_temperature', type: 'float' },
-   { name: 'max_temperature', type: 'float' },
-   { name: 'flocculation', type: 'int' },
-   { name: 'attenuation', type: 'float' },
-   { name: 'notes', type: 'string' },
-   { name: 'best_for', type: 'string' },
-   { name: 'max_reuse', type: 'int' },
-   { name: 'inventory', type: 'float' },
-   { name: 'cost', type: 'float' },
-   { name: 'production_date', type: 'string' },
-   { name: 'tht_date', type: 'string' },
-   { name: 'cells', type: 'float' },
-   { name: 'tolerance', type: 'float' },
-   { name: 'sta1', type: 'int' },
-   { name: 'bacteria', type: 'int' },
-   { name: 'harvest_top', type: 'int' },
-   { name: 'harvest_time', type: 'int' },
-   { name: 'pitch_temperature', type: 'float' },
-   { name: 'pofpos', type: 'int' },
-   { name: 'zymocide', type: 'int' },
-   { name: 'gr_hl_lo', type: 'int' },
-   { name: 'sg_lo', type: 'float' },
-   { name: 'gr_hl_hi', type: 'int' },
-   { name: 'sg_hi', type: 'float' },
-   { name: 'short_desc', type: 'string' }
-  ],
-  id: 'record',
-  url: url,
-  deleterow: function(rowid, commit) {
-   // synchronize with the server - send delete command
-   var data = 'delete=true&' + $.param({ record: rowid });
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('delete: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('delete: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  },
-  addrow: function(rowid, rowdata, position, commit) {
-   var data = 'insert=true&' + $.param(rowdata);
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('insert: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('insert: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  },
-  updaterow: function(rowid, rowdata, commit) {
-   var data = 'update=true&' + $.param(rowdata);
-   $.ajax({
-    dataType: 'json',
-    url: url,
-    cache: false,
-    data: data,
-    type: 'POST',
-    success: function(data) {
-     if (data.error) {
-      console.log('updaterow: ' + data.msg);
-      alert('Fout: ' + data.msg);
-     } else {
-      console.log('updaterow: success');
-     }
-     location.reload(true);
-    },
-    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
-   });
-  }
- },
- dataAdapter = new $.jqx.dataAdapter(source),
- editrow = -1;
-
- // initialize the input fields.
- $('#name').jqxInput({ theme: theme, width: 640, height: 23 });
- $('#laboratory').jqxInput({ theme: theme, width: 320, height: 23 });
- $('#short_desc').jqxInput({ theme: theme, width: 320, height: 23 });
- $('#product_id').jqxInput({ theme: theme, width: 320, height: 23 });
- $('#type').jqxDropDownList({
-  theme: theme,
-  source: YeastTypeAdapter,
-  valueMember: 'nl',
-  displayMember: 'nl',
-  width: 180,
-  height: 23,
-  autoDropDownHeight: true
- });
- $('#form').jqxDropDownList({
-  theme: theme,
-  source: YeastFormAdapter,
-  valueMember: 'nl',
-  displayMember: 'nl',
-  width: 180,
-  height: 23,
-  autoDropDownHeight: true
- });
- $('#gr_hl_lo').jqxNumberInput(PosInt);
- $('#gr_hl_lo').jqxNumberInput({ min: 2, max: 400 });
- $('#sg_lo').jqxNumberInput(SGopts);
- $('#gr_hl_hi').jqxNumberInput(PosInt);
- $('#gr_hl_hi').jqxNumberInput({ min: 5, max: 400 });
- $('#sg_hi').jqxNumberInput(SGopts);
- $('#pitch_lo').jqxInput({ theme: theme, width: 100, height: 23 });
- $('#but_pitch_lo').jqxButton({ template: 'success', width: '23px', height: 23, theme: theme });
- $('#but_pitch_lo').bind('click', function() { $('#pitchloWindow').jqxWindow('open'); });
- $('#pitchloReady').jqxButton({ template: 'success', width: '90px', theme: theme });
- $('#pitchloReady').click(function() {
-  $('#pitch_lo').val($('#gr_hl_lo').val() + '@' + $('#sg_lo').val().toFixed(3));
- });
- $('#pitch_hi').jqxInput({ theme: theme, width: 100, height: 23 });
- $('#but_pitch_hi').jqxButton({ template: 'success', width: '23px', height: 23, theme: theme });
- $('#but_pitch_hi').bind('click', function() { $('#pitchhiWindow').jqxWindow('open'); });
- $('#pitchhiReady').jqxButton({ template: 'success', width: '90px', theme: theme });
- $('#pitchhiReady').click(function() {
-  $('#pitch_hi').val($('#gr_hl_hi').val() + '@' + $('#sg_hi').val().toFixed(3));
- });
- $('#notes').jqxInput({ theme: theme, width: 800, height: 120 });
- $('#best_for').jqxInput({ theme: theme, width: 320, height: 100 });
- $('#inventory').jqxNumberInput(Spin1dec);
- $('#production_date').jqxDateTimeInput(Dateopts);
- $('#min_temperature').jqxNumberInput(YeastT);
- $('#max_temperature').jqxNumberInput(YeastT);
- $('#flocculation').jqxDropDownList({
-  theme: theme,
-  source: FlocculationAdapter,
-  valueMember: 'id',
-  displayMember: 'nl',
-  width: 180,
-  height: 23,
-  autoDropDownHeight: true
- });
- $('#attenuation').jqxNumberInput(Perc1dec);
- $('#max_reuse').jqxNumberInput(PosInt);
- $('#max_reuse').jqxNumberInput({ max: 10 });
- $('#cost').jqxNumberInput(Spin2dec);
- $('#tht_date').jqxDateTimeInput(Dateopts);
- $('#totval').jqxNumberInput(Show2dec);
- $('#cells').jqxNumberInput(Spin1dec);
- $('#tolerance').jqxTooltip({ content: 'Alcohol tolerantie van de gist' });
- $('#tolerance').jqxNumberInput(Perc1dec);
- $('#tolerance').jqxNumberInput({ max: 25 });
- $('#sta1').jqxCheckBox({ theme: theme, width: 120, height: 23 });
-// $('#sta1').jqxTooltip({ position: 'top-left', content: 'STA1 gen (var diastaticus), ook wel glucoamlylase+ genoemd.' });
- $('#sta1').on('checked', function(event) { dataRecord.sta1 = 1; });
- $('#sta1').on('unchecked', function(event) { dataRecord.sta1 = 0; });
- $('#bacteria').jqxCheckBox({ theme: theme, width: 120, height: 23 });
- $('#bacteria').on('checked', function(event) { dataRecord.bacteria = 1; });
- $('#bacteria').on('unchecked', function(event) { dataRecord.bacteria = 0; });
- $('#harvest_top').jqxCheckBox({ theme: theme, width: 120, height: 23 });
- $('#harvest_top').on('checked', function(event) { dataRecord.harvest_top = 1; });
- $('#harvest_top').on('unchecked', function(event) { dataRecord.harvest_top = 0; });
- $('#harvest_time').jqxNumberInput(PosInt);
- $('#pitch_temperature').jqxNumberInput(YeastT);
- $('#pofpos').jqxCheckBox({ theme: theme, width: 120, height: 23 });
-// $('#pofpos').jqxTooltip({ position: 'top-left', content: 'POF+ gist' });
- $('#pofpos').on('checked', function(event) { dataRecord.pofpos = 1; });
- $('#pofpos').on('unchecked', function(event) { dataRecord.pofpos = 0; });
- $('#zymocide').jqxDropDownList({
-  theme: theme,
-  source: ZymocideAdapter,
-  valueMember: 'id',
-  displayMember: 'nl',
-  width: 80,
-  height: 23,
-  autoDropDownHeight: true
- });
-
- var  localizationobj = {};
- localizationobj.filterchoosestring= "Keuze:";
-
- // initialize jqxGrid
- $('#jqxgrid').jqxGrid({
-  width: 1280,
-  height: 630,
-  source: dataAdapter,
-  theme: theme,
-  showstatusbar: true,
-  renderstatusbar: function(statusbar) {
-   var rowCount = $("#jqxgrid").jqxGrid('getrows').length;
-   statusbar.append('<div style="float: left; margin: 8px; color: orange !important;">Aantal items: ' + rowCount + '</div>');
-   var container, addButton, impButton;
-   container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');
-   addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Nieuw</span></div>');
-   impButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Import</span></div>');
-   expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' +
-     'src="images/database.png"/><span style="margin-left: 4px; position: relative; top: -10px;">Export</span></div>');
-   container.append(addButton);
-   container.append(impButton);
-   container.append(expButton);
-   statusbar.append(container);
-   addButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   impButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   expButton.jqxButton({ theme: theme, width: 90, height: 17 });
-   // add new row.
-   addButton.click(function(event) {
-    editrow = -1;
-    $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
-    $('#name').val('');
-    dataRecord.uuid = '';
-    $('#laboratory').val('');
-    $('#short_desc').val('');
-    $('#product_id').val('');
-    $('#type').val('Bovengist');
-    $('#form').val('Vloeibaar');
-    $('#min_temperature').val(18);
-    $('#max_temperature').val(22);
-    $('#flocculation').val(0);
-    $('#attenuation').val(77);
-    $('#notes').val('');
-    $('#best_for').val('');
-    $('#max_reuse').val(10);
-    $('#inventory').val(0);
-    $('#cost').val(0);
-    $('#production_date').val('');
-    $('#tht_date').val('');
-    $('#cells').val(1);
-    $('#tolerance').val(0);
-    $('#sta1').val(0);
-    $('#bacteria').val(0);
-    $('#harvest_top').val(0);
-    $('#harvest_time').val(0);
-    $('#pitch_temperature').val(0);
-    $('#pofpos').val(0);
-    $('#zymocide').val(0);
-    $('#gr_hl_lo').val(50);
-    $('#sg_lo').val(1.050);
-    $('#gr_hl_hi').val(80);
-    $('#sg_hi').val(1.080);
-    $('#popupWindow').jqxWindow('open');
-   });
-   impButton.click(function(event) {
-    window.location.href = 'import_ingredients.php?select=yeasts';
-   });
-   expButton.click(function(event) {
-    window.open('export_yeasts.php');
-   });
-  },
-  ready: function () {
-   $("#jqxgrid").jqxGrid('localizestrings', localizationobj);
-  },
-  filterable: true,
-  showfilterrow: true,
-  columns: [
-   { text: 'Laboratorium', datafield: 'laboratory', width: 150, filtertype: 'list' },
-   { text: 'Product ID', datafield: 'product_id', width: 120, filtertype: 'textbox' },
-   { text: 'Gist naam', datafield: 'name', filtertype: 'textbox' },
-   { text: 'Type', datafield: 'type', align: 'center', cellsalign: 'center', width: 105, filtertype: 'list' },
-   { text: 'Vorm', datafield: 'form', align: 'center', cellsalign: 'center', width: 105, filtertype: 'list' },
-   { text: 'SVG', datafield: 'attenuation', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'p1', filtertype: 'number' },
-   { text: 'Tol%', datafield: 'tolerance', width: 60, align: 'right', cellsalign: 'right', filtertype: 'number',
-    cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) {
-     var amount = '';
-     if (value > 0)
-      amount = dataAdapter.formatNumber(value, 'p1');
-     return '<span style="margin: 4px; margin-top: 6px; float: right;">' + amount + '</span>';
-    }
-   },
-   { text: 'POF+', datafield: 'pofpos', width: 60, align: 'center', cellsalign: 'center',
-    cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) {
-      if (value == 0)
-       return '<span></span>';
-      return '<span><img style="float:left; margin-left:25px; margin-top:4px;" src="images/dialog-ok-apply.png"></span>';
-    }
-   },
-   { text: 'STA1', datafield: 'sta1', width: 60, align: 'center', cellsalign: 'center',
-    cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) {
-      if (value == 0)
-       return '<span></span>';
-      return '<span><img style="float:left; margin-left:25px; margin-top:4px;" src="images/dialog-ok-apply.png"></span>';
-    }
-   },
-   { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', filtertype: 'number', filtercondition: 'not_equal',
-    cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) {
-     var amount = '';
-     if (value > 0) {
-      if ((rowdata.form == 'Vloeibaar') && (value > 1))
-       amount = dataAdapter.formatNumber(value, 'f0') + ' pakken';
-      else if (rowdata.form == 'Vloeibaar')
-       amount = dataAdapter.formatNumber(value, 'f0') + ' pak';
-      else if (rowdata.form == 'Droog' || rowdata.form == 'Gedroogd')
-       amount = dataAdapter.formatNumber(value * 1000, 'f1') + ' gram';
-      else
-       amount = dataAdapter.formatNumber(value * 1000, 'f1') + ' ml';
-     }
-     return '<span style="margin: 3px; margin-top: 6px; float: right;">' + amount + '</span>';
-    }
-   },
-   { text: '', datafield: 'Edit', columntype: 'button', width: 80, align: 'center', filterable: false, cellsrenderer: function() {
-    return 'Wijzig';
-    }, buttonclick: function(row) {
-     // open the popup window when the user clicks a button.
-     editrow = row;
-     $('#popupWindow').jqxWindow({ position: { x: 110, y: 15 } });
-     // get the clicked row's data and initialize the input fields.
-     dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow);
-     $('#name').val(dataRecord.name);
-     $('#laboratory').val(dataRecord.laboratory);
-     $('#product_id').val(dataRecord.product_id);
-     $('#type').val(dataRecord.type);
-     $('#form').val(dataRecord.form);
-     $('#min_temperature').val(parseFloat(dataRecord.min_temperature));
-     $('#max_temperature').val(parseFloat(dataRecord.max_temperature));
-     $('#flocculation').val(dataRecord.flocculation);
-     $('#attenuation').val(dataRecord.attenuation);
-     $('#notes').val(dataRecord.notes);
-     $('#best_for').val(dataRecord.best_for);
-     $('#max_reuse').val(dataRecord.max_reuse);
-     if (dataRecord.form == 'Vloeibaar')
-      $('#inventory').val(dataRecord.inventory);
-     else
-      $('#inventory').val(dataRecord.inventory * 1000);
-     $('#cost').val(dataRecord.cost);
-     $('#production_date').val(dataRecord.production_date);
-     $('#tht_date').val(dataRecord.tht_date);
-     $('#cells').val(dataRecord.cells);
-     $('#tolerance').val(dataRecord.tolerance);
-     $('#sta1').val(dataRecord.sta1);
-     $('#bacteria').val(dataRecord.bacteria);
-     $('#harvest_top').val(dataRecord.harvest_top);
-     $('#harvest_time').val(dataRecord.harvest_time);
-     $('#pitch_temperature').val(parseFloat(dataRecord.pitch_temperature));
-     $('#pofpos').val(dataRecord.pofpos);
-     $('#zymocide').val(dataRecord.zymocide);
-     $('#gr_hl_lo').val(dataRecord.gr_hl_lo);
-     $('#sg_lo').val(parseFloat(dataRecord.sg_lo));
-     $('#pitch_lo').val(dataRecord.gr_hl_lo + '@' + parseFloat(dataRecord.sg_lo).toFixed(3));
-     $('#gr_hl_hi').val(dataRecord.gr_hl_hi);
-     $('#sg_hi').val(parseFloat(dataRecord.sg_hi));
-     $('#pitch_hi').val(dataRecord.gr_hl_hi + '@' + parseFloat(dataRecord.sg_hi).toFixed(3));
-     $('#short_desc').val(dataRecord.short_desc);
-     if (dataRecord.form == 'Droog') {
-      $('.yeast_wet').hide();
-      $('.yeast_dry').show();
-     } else {
-      $('.yeast_wet').show();
-      $('.yeast_dry').hide();
-     }
-     calcTotal();
-     // show the popup window.
-     $('#popupWindow').jqxWindow('open');
-    }
-   }
-  ]
- });
-
- $('#popupWindow').on('open', function(event) { calcTotal(); });
- $('#cost').on('change', function(event) {
-  dataRecord.cost = parseFloat(event.args.value);
-  calcTotal();
- });
- $('#inventory').on('change', function(event) {
-  if (dataRecord.form == 'Vloeibaar')
-   dataRecord.inventory = parseFloat(event.args.value);
-  else
-   dataRecord.inventory = parseFloat(event.args.value) / 1000.0;
-  calcTotal();
- });
- $('#form').on('select', function(event) {
-  dataRecord.form = $('#form').val();
-  calcTotal();
-  if (dataRecord.form == 'Droog') {
-   $('.yeast_wet').hide();
-   $('.yeast_dry').show();
-  } else {
-   $('.yeast_wet').show();
-   $('.yeast_dry').hide();
-  }
- });
-
- // initialize the popup window and buttons.
- $('#pitchloWindow').jqxWindow({
-  theme: theme,
-  position: { x: 380, y: 210 },
-  width: 500,
-  height: 200,
-  resizable: false,
-  isModal: true,
-  modalOpacity: 0.4,
-  autoOpen: false,
-  cancelButton: $('#pitchloReady')
- });
- $('#pitchhiWindow').jqxWindow({
-  theme: theme,
-  position: { x: 380, y: 210 },
-  width: 500,
-  height: 200,
-  resizable: false,
-  isModal: true,
-  modalOpacity: 0.4,
-  autoOpen: false,
-  cancelButton: $('#pitchhiReady')
- });
- $('#popupWindow').jqxWindow({
-  width: 1050,
-  height: 625,
-  resizable: false,
-  theme: theme,
-  isModal: true,
-  autoOpen: false,
-  cancelButton: $('#Cancel'),
-  modalOpacity: 0.40
- });
- $('#popupWindow').on('open', function() {
-  $('#name').jqxInput('selectAll');
- });
- $('#Delete').jqxButton({ template: 'danger', width: '90px', theme: theme });
- $('#Delete').click(function() {
-  if (editrow >= 0) {
-   // Open a popup to confirm this action.
-   $('#eventWindow').jqxWindow('open');
-   $('#delOk').click(function() {
-    var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-    $('#jqxgrid').jqxGrid('deleterow', rowID);
-   });
-  }
-  $('#popupWindow').jqxWindow('hide');
- });
- $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme });
- $('#Clone').jqxButton({ template: 'warning', width: '90px', theme: theme });
- $('#Clone').click(function() {
-  var row = {
-   record: -1,
-   name: $('#name').val() + ' kopie',
-   uuid: '',
-   type: $('#type').val(),
-   form: $('#form').val(),
-   laboratory: $('#laboratory').val(),
-   product_id: $('#product_id').val(),
-   min_temperature: parseFloat($('#min_temperature').jqxNumberInput('decimal')),
-   max_temperature: parseFloat($('#max_temperature').jqxNumberInput('decimal')),
-   flocculation: $('#flocculation').val(),
-   attenuation: parseFloat($('#attenuation').jqxNumberInput('decimal')),
-   notes: $('#notes').val(),
-   best_for: $('#best_for').val(),
-   max_reuse: parseInt($('#max_reuse').jqxNumberInput('decimal')),
-   inventory: 0,
-   cost: parseFloat($('#cost').jqxNumberInput('decimal')),
-   production_date: '',
-   tht_date: '',
-   cells: parseFloat($('#cells').jqxNumberInput('decimal')),
-   tolerance: parseFloat($('#tolerance').jqxNumberInput('decimal')),
-   sta1: $('#sta1').val(),
-   bacteria: $('#bacteria').val(),
-   harvest_top: $('#harvest_top').val(),
-   harvest_time: $('#harvest_time').val(),
-   pitch_temperature: parseFloat($('#pitch_temperature').jqxNumberInput('decimal')),
-   pofpos: $('#pofpos').val(),
-   zymocide: $('#zymocide').val(),
-   gr_hl_lo: $('#gr_hl_lo').val(),
-   sg_lo: parseFloat($('#sg_lo').jqxNumberInput('decimal')),
-   gr_hl_hi: $('#gr_hl_hi').val(),
-   sg_hi: parseFloat($('#sg_hi').jqxNumberInput('decimal'))
-  };
-  $('#jqxgrid').jqxGrid('addrow', null, row);
-  $('#popupWindow').jqxWindow('hide');
- });
- $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme });
- // update the edited row when the user clicks the 'Save' button.
- $('#Save').click(function() {
-  var n_inventory, row, rowID = -1;
-  if (editrow >= 0) {
-   rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-  }
-  if (dataRecord.form == 'Vloeibaar')
-   n_inventory = parseFloat($('#inventory').jqxNumberInput('decimal'));
-  else
-   n_inventory = parseFloat($('#inventory').jqxNumberInput('decimal')) / 1000.0;
-  row = {
-   record: rowID,
-   name: $('#name').val(),
-   uuid: dataRecord.uuid,
-   type: $('#type').val(),
-   form: $('#form').val(),
-   laboratory: $('#laboratory').val(),
-   product_id: $('#product_id').val(),
-   min_temperature: parseFloat($('#min_temperature').jqxNumberInput('decimal')),
-   max_temperature: parseFloat($('#max_temperature').jqxNumberInput('decimal')),
-   flocculation: $('#flocculation').val(),
-   attenuation: parseFloat($('#attenuation').jqxNumberInput('decimal')),
-   notes: $('#notes').val(),
-   best_for: $('#best_for').val(),
-   max_reuse: parseInt($('#max_reuse').jqxNumberInput('decimal')),
-   inventory: n_inventory,
-   cost: parseFloat($('#cost').jqxNumberInput('decimal')),
-   production_date: $('#production_date').val(),
-   tht_date: $('#tht_date').val(),
-   cells: parseFloat($('#cells').jqxNumberInput('decimal')),
-   tolerance: parseFloat($('#tolerance').jqxNumberInput('decimal')),
-   sta1: $('#sta1').val(),
-   bacteria: $('#bacteria').val(),
-   harvest_top: $('#harvest_top').val(),
-   harvest_time: $('#harvest_time').val(),
-   pitch_temperature: parseFloat($('#pitch_temperature').jqxNumberInput('decimal')),
-   pofpos: $('#pofpos').val(),
-   zymocide: $('#zymocide').val(),
-   gr_hl_lo: $('#gr_hl_lo').val(),
-   sg_lo: parseFloat($('#sg_lo').jqxNumberInput('decimal')),
-   gr_hl_hi: $('#gr_hl_hi').val(),
-   sg_hi: parseFloat($('#sg_hi').jqxNumberInput('decimal')),
-   short_desc: $('#short_desc').val()
-  };
-  if (editrow >= 0) {
-   $('#jqxgrid').jqxGrid('updaterow', rowID, row);
-  } else {
-   $('#jqxgrid').jqxGrid('addrow', null, row);
-  }
-  $('#popupWindow').jqxWindow('hide');
- });
- createDelElements();
-});
-

mercurial