Inventory yeasts is now ok.

Thu, 16 Aug 2018 17:17:40 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 16 Aug 2018 17:17:40 +0200
changeset 20
22271f3598ac
parent 19
057a6256bd7b
child 21
acb2d8098f19

Inventory yeasts is now ok.

README.design file | annotate | diff | comparison | revisions
www/import/from_brouwhulp.php file | annotate | diff | comparison | revisions
www/includes/db_inventory_yeasts.php file | annotate | diff | comparison | revisions
www/inv_yeasts.php file | annotate | diff | comparison | revisions
www/js/inv_yeasts.js file | annotate | diff | comparison | revisions
--- a/README.design	Thu Aug 16 16:38:20 2018 +0200
+++ b/README.design	Thu Aug 16 17:17:40 2018 +0200
@@ -39,7 +39,7 @@
 inventory_suppliers		Ok.
 inventory_water_profiles
 inventory_water_sources
-inventory_yeasts
+inventory_yeasts		Ok.
 
 
 Database:
--- a/www/import/from_brouwhulp.php	Thu Aug 16 16:38:20 2018 +0200
+++ b/www/import/from_brouwhulp.php	Thu Aug 16 17:17:40 2018 +0200
@@ -150,9 +150,6 @@
 		$sql  = "INSERT INTO inventory_yeasts SET name='" . mysqli_real_escape_string($db, $yeast->NAME);
 		$sql .= "', type='" . $yeast->TYPE;
 		$sql .= "', form='" . $yeast->FORM;
-		if ($yeast->AMOUNT)
-			$sql .= "', amount='" . $yeast->AMOUNT;
-		($yeast->AMOUNT_IS_WEIGHT == 'TRUE') ? $sql .= "', amount_is_weight='Y" : $sql .= "', amount_is_weight='N";
 		$sql .= "', laboratory='" . mysqli_real_escape_string($db, $yeast->LABORATORY);
 		$sql .= "', product_id='" . mysqli_real_escape_string($db, $yeast->PRODUCT_ID);
 		if ($yeast->MIN_TEMPERATURE)
@@ -164,8 +161,6 @@
 			$sql .= "', attenuation='" . $yeast->ATTENUATION;
 		$sql .= "', notes='" . mysqli_real_escape_string($db, $yeast->NOTES);
 		$sql .= "', best_for='" . mysqli_real_escape_string($db, $yeast->BEST_FOR);
-		if ($yeast->TIMES_CULTURED)
-			$sql .= "', times_cultured='" . $yeast->TIMES_CULTURED;
 		if ($yeast->MAX_REUSE)
 			$sql .= "', max_reuse='" . $yeast->MAX_REUSE;
 		if ($yeast->INVENTORY)
@@ -459,8 +454,8 @@
 
 //do_fermentables();
 //do_hops();
-//do_yeasts();
-do_waters();
+do_yeasts();
+//do_waters();
 //do_miscs();
 //do_equipments();
 //do_styles();
--- a/www/includes/db_inventory_yeasts.php	Thu Aug 16 16:38:20 2018 +0200
+++ b/www/includes/db_inventory_yeasts.php	Thu Aug 16 17:17:40 2018 +0200
@@ -16,8 +16,6 @@
 	$sql  = "INSERT INTO `inventory_yeasts` SET name='" . mysqli_real_escape_string($connect, $_GET['name']);
 	$sql .= "', type='" . $_GET['type'];
 	$sql .= "', form='" . $_GET['form'];
-	$sql .= "', amount='" . $_GET['amount'];
-	($_GET['amount_is_weight'] == 'true') ? $sql .= "', amount_is_weight='1" : $sql .= "', amount_is_weight='0";
 	$sql .= "', laboratory='" . mysqli_real_escape_string($connect, $_GET['laboratory']);
 	$sql .= "', product_id='" . mysqli_real_escape_string($connect, $_GET['product_id']);
 	$sql .= "', min_temperature='" . $_GET['min_temperature'];
@@ -26,9 +24,7 @@
 	$sql .= "', attenuation='" . $_GET['attenuation'];
 	$sql .= "', notes='" . mysqli_real_escape_string($connect, $_GET['notes']);
 	$sql .= "', best_for='" . mysqli_real_escape_string($connect, $_GET['best_for']);
-	$sql .= "', times_cultured='" . $_GET['times_cultured'];
 	$sql .= "', max_reuse='" . $_GET['max_reuse'];
-	($_GET['add_to_secondary'] == 'true') ? $sql .= "', add_to_secondary='1" : $sql .= "', add_to_secondary='0";
 	$sql .= "', inventory='" . $_GET['inventory'];
 	$sql .= "', cost='" . $_GET['cost'];
 	$sql .= "', production_date='" . $_GET['production_date'];
@@ -47,8 +43,6 @@
 	$sql  = "UPDATE `inventory_yeasts` SET name='" . mysqli_real_escape_string($connect, $_GET['name']);
 	$sql .= "', type='" . $_GET['type'];
 	$sql .= "', form='" . $_GET['form'];
-	$sql .= "', amount='" . $_GET['amount'];
-	($_GET['amount_is_weight'] == 'true') ? $sql .= "', amount_is_weight='1" : $sql .= "', amount_is_weight='0";
 	$sql .= "', laboratory='" . mysqli_real_escape_string($connect, $_GET['laboratory']);
 	$sql .= "', product_id='" . mysqli_real_escape_string($connect, $_GET['product_id']);
 	$sql .= "', min_temperature='" . $_GET['min_temperature'];
@@ -57,9 +51,7 @@
 	$sql .= "', attenuation='" . $_GET['attenuation'];
 	$sql .= "', notes='" . mysqli_real_escape_string($connect, $_GET['notes']);
 	$sql .= "', best_for='" . mysqli_real_escape_string($connect, $_GET['best_for']);
-	$sql .= "', times_cultured='" . $_GET['times_cultured'];
 	$sql .= "', max_reuse='" . $_GET['max_reuse'];
-	($_GET['add_to_secondary'] == 'true') ? $sql .= "', add_to_secondary='1" : $sql .= "', add_to_secondary='0";
 	$sql .= "', inventory='" . $_GET['inventory'];
 	$sql .= "', cost='" . $_GET['cost'];
 	$sql .= "', production_date='" . $_GET['production_date'];
@@ -93,8 +85,6 @@
 			'name' => $row['name'],
 			'type' => $row['type'],
 			'form' => $row['form'],
-			'amount' => $row['amount'],
-			'amount_is_weight' => $row['amount_is_weight'],
 			'laboratory' => $row['laboratory'],
 			'product_id' => $row['product_id'],
 			'min_temperature' => $row['min_temperature'],
@@ -103,9 +93,7 @@
 			'attenuation' => $row['attenuation'],
 			'notes' => $row['notes'],
 			'best_for' => $row['best_for'],
-			'times_cultured' => $row['times_cultured'],
 			'max_reuse' => $row['max_reuse'],
-			'add_to_secondary' => $row['add_to_secondary'],
 			'inventory' => $row['inventory'],
 			'cost' => $row['cost'],
 			'production_date' => $row['production_date'],
--- a/www/inv_yeasts.php	Thu Aug 16 16:38:20 2018 +0200
+++ b/www/inv_yeasts.php	Thu Aug 16 17:17:40 2018 +0200
@@ -41,21 +41,9 @@
       <tr>
        <td align="right" style="vertical-align: top;">Gist vorm:</td>
        <td align="left"><div id="form"></div></td>
-<!--       <td align="right" style="vertical-align: top;">Maximum hergebruik:</td>
-       <td align="left"><div id="times_cultured"></div></td>
-      </tr>
-      <tr>
-       <td align="right" style="vertical-align: top;">Amount:</td>
-       <td align="left"><div id="amount"></div></td> -->
        <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;">Amount is Weight:</td>
-       <td align="left"><div id="amount_is_weight"></div></td>
-       <td align="right" style="vertical-align: top;">Add to Secondary:</td>
-       <td align="left"><div id="add_to_secondary"></div></td>
-      </tr>  -->
       <tr>
        <td align="right" style="vertical-align: top;">Opmerkingen:</td>
        <td align="left" colspan="3"><textarea id="notes"></textarea></td>
--- a/www/js/inv_yeasts.js	Thu Aug 16 16:38:20 2018 +0200
+++ b/www/js/inv_yeasts.js	Thu Aug 16 17:17:40 2018 +0200
@@ -53,8 +53,6 @@
 			{ name: 'name', type: 'string' },
 			{ name: 'type', type: 'string' },
 			{ name: 'form', type: 'string' },
-			{ name: 'amount', type: 'float' },
-			{ name: 'amount_is_weight', type: 'bool' },
 			{ name: 'laboratory', type: 'string' },
 			{ name: 'product_id', type: 'string' },
 			{ name: 'min_temperature', type: 'number' },
@@ -63,9 +61,7 @@
 			{ name: 'attenuation', type: 'float' },
 			{ name: 'notes', type: 'string' },
 			{ name: 'best_for', type: 'string' },
-			{ name: 'times_cultured', type: 'number' },
 			{ name: 'max_reuse', type: 'number' },
-			{ name: 'add_to_secondary', type: 'bool' },
 			{ name: 'inventory', type: 'float' },
 			{ name: 'cost', type: 'float' },
 			{ name: 'production_date', type: 'string' },
@@ -131,9 +127,6 @@
 	$("#product_id").jqxInput({ theme: theme, width: 120, height: 23 });
 	$("#type").jqxDropDownList({ theme: theme, source: srcType, width: 90, height: 23, dropDownHeight: 170 });
 	$("#form").jqxDropDownList({ theme: theme, source: srcForm, selectedIndex: 0, width: 90, height: 23, dropDownHeight: 195 });
-	//$("#amount").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
-	//$("#amount_is_weight").jqxCheckBox({ theme: theme, width: 120, height: 23 });
-
 	$("#notes").jqxInput({ theme: theme, width: 640, height: 120 });
 	$("#best_for").jqxInput({ theme: theme, width: 640, height: 23 });
 	$("#inventory").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
@@ -144,9 +137,7 @@
 	$("#flocculation").jqxDropDownList({ theme: theme, source: srcFlocculation, width: 90, height: 23, dropDownHeight: 130 });
 	$("#attenuation").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 50, max: 100, decimalDigits: 1, spinButtons: true });
 
-	//$("#times_cultured").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, max: 10, decimalDigits: 0, spinButtons: true });
 	$("#max_reuse").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, max: 10, decimalDigits: 0, spinButtons: true });
-	//$("#add_to_secondary").jqxCheckBox({ theme: theme, width: 120, height: 23 });
 	$("#cost").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 2, spinButtons: true });
 	$("#tht_date").jqxDateTimeInput({ theme: theme, width: 100, height: 23, formatString: 'yyyy-MM-dd' });
 
@@ -175,17 +166,13 @@
 				$("#product_id").val('');
 				$("#type").val('Ale');
 				$("#form").val('Liquid');
-				$("#amount").val('0.0');
-				$("#amount_is_weight").val('false');
 				$("#min_temperature").val('');
 				$("#max_temperature").val('');
 				$("#flocculation").val('Low');
 				$("#attenuation").val('75.0');
 				$("#notes").val('');
 				$("#best_for").val('');
-				$("#times_cultured").val('');
 				$("#max_reuse").val('');
-				$("#add_to_secondary").val('false');
 				$("#inventory").val('');
 				$("#cost").val('');
 				$("#production_date").val('');
@@ -216,17 +203,13 @@
 					$("#product_id").val(dataRecord.product_id);
 					$("#type").val(dataRecord.type);
 					$("#form").val(dataRecord.form);
-					$("#amount").val(dataRecord.amount);
-					$("#amount_is_weight").val(dataRecord.amount_is_weight);
 					$("#min_temperature").val(dataRecord.min_temperature);
 					$("#max_temperature").val(dataRecord.max_temperature);
 					$("#flocculation").val(dataRecord.flocculation);
 					$("#attenuation").val(dataRecord.attenuation);
 					$("#notes").val(dataRecord.notes);
 					$("#best_for").val(dataRecord.best_for);
-					$("#times_cultured").val(dataRecord.times_cultured);
 					$("#max_reuse").val(dataRecord.max_reuse);
-					$("#add_to_secondary").val(dataRecord.add_to_secondary);
 					$("#inventory").val(dataRecord.inventory);
 					$("#cost").val(dataRecord.cost);
 					$("#production_date").val(dataRecord.production_date);
@@ -267,8 +250,6 @@
 				name: $("#name").val(),
 				type: $("#type").val(),
 				form: $("#form").val(),
-				amount: parseFloat($("#amount").jqxNumberInput('decimal')),
-				amount_is_weight: $("#amount_is_weight").val(),
 				laboratory: $("#laboratory").val(),
 				product_id: $("#product_id").val(),
 				min_temperature: parseInt($("#min_temperature").jqxNumberInput('decimal')),
@@ -277,9 +258,7 @@
 				attenuation: parseFloat($("#attenuation").jqxNumberInput('decimal')),
 				notes: $("#notes").val(),
 				best_for: $("#best_for").val(),
-				times_recultured: parseInt($("#times_cultured").jqxNumberInput('decimal')),
 				max_reuse: parseInt($("#max_reuse").jqxNumberInput('decimal')),
-				add_to_secondary: $("#add_to_secondary").val(),
 				inventory: parseFloat($("#inventory").jqxNumberInput('decimal')),
 				cost: parseFloat($("#cost").jqxNumberInput('decimal')),
 				production_date: $("#production_date").val(),
@@ -294,8 +273,6 @@
 				name: $("#name").val(),
 				type: $("#type").val(),
 				form: $("#form").val(),
-				amount: parseFloat($("#amount").jqxNumberInput('decimal')),
-				amount_is_weight: $("#amount_is_weight").val(),
 				laboratory: $("#laboratory").val(),
 				product_id: $("#product_id").val(),
 				min_temperature: parseInt($("#min_temperature").jqxNumberInput('decimal')),
@@ -304,9 +281,7 @@
 				attenuation: parseFloat($("#attenuation").jqxNumberInput('decimal')),
 				notes: $("#notes").val(),
 				best_for: $("#best_for").val(),
-				times_recultured: parseInt($("#times_cultured").jqxNumberInput('decimal')),
 				max_reuse: parseInt($("#max_reuse").jqxNumberInput('decimal')),
-				add_to_secondary: $("#add_to_secondary").val(),
 				inventory: parseFloat($("#inventory").jqxNumberInput('decimal')),
 				cost: parseFloat($("#cost").jqxNumberInput('decimal')),
 				production_date: $("#production_date").val(),

mercurial