Fixed inventory_hops

Thu, 16 Aug 2018 16:38:20 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 16 Aug 2018 16:38:20 +0200
changeset 19
057a6256bd7b
parent 18
395833e20f88
child 20
22271f3598ac

Fixed inventory_hops

README.design file | annotate | diff | comparison | revisions
www/includes/db_inventory_hops.php file | annotate | diff | comparison | revisions
www/inv_hops.php file | annotate | diff | comparison | revisions
www/js/inv_hops.js file | annotate | diff | comparison | revisions
--- a/README.design	Thu Aug 16 16:01:13 2018 +0200
+++ b/README.design	Thu Aug 16 16:38:20 2018 +0200
@@ -31,7 +31,7 @@
 
 inventory_equipments
 inventory_fermentables		Ok.
-inventory_hops
+inventory_hops			Ok.
 inventory_mash_profiles
 inventory_mash_steps
 inventory_miscs
--- a/www/includes/db_inventory_hops.php	Thu Aug 16 16:01:13 2018 +0200
+++ b/www/includes/db_inventory_hops.php	Thu Aug 16 16:38:20 2018 +0200
@@ -3,7 +3,6 @@
 require($_SERVER['DOCUMENT_ROOT']."/config.php");
 require($_SERVER['DOCUMENT_ROOT']."/version.php");
 
-syslog(LOG_NOTICE, "db_inventory_hops: script start");
 
 #Connect to the database
 $connect = mysqli_connect(DBASE_HOST, DBASE_USER, DBASE_PASS, DBASE_NAME);
@@ -23,7 +22,6 @@
 	$sql .= "', cohumulone='" . $_GET['cohumulone'];
 	$sql .= "', myrcene='" . $_GET['myrcene'];
 	$sql .= "', hsi='" . $_GET['hsi'];
-	$sql .= "', useat='" . $_GET['useat'];
 	$sql .= "', type='" . $_GET['type'];
 	$sql .= "', form='" . $_GET['form'];
 	$sql .= "', notes='" . mysqli_real_escape_string($connect, $_GET['notes']);
@@ -34,8 +32,7 @@
 	$sql .= "', cost='" . $_GET['cost'];
 	$sql .= "', production_date='" . $_GET['production_date'];
 	$sql .= "', tht_date='" . $_GET['tht_date'];
-	$sql .= "', supplier_rec='" . $_GET['supplier_rec'];
-	$sql .= "', total_oil'" . $_GET['total_oil'];
+	$sql .= "', total_oil='" . $_GET['total_oil'];
 	$sql .= "';";
 	$result = mysqli_query($connect, $sql);
 	if (! $result) {
@@ -55,7 +52,6 @@
 	$sql .= "', cohumulone='" . $_GET['cohumulone'];
 	$sql .= "', myrcene='" . $_GET['myrcene'];
 	$sql .= "', hsi='" . $_GET['hsi'];
-	$sql .= "', useat='" . $_GET['useat'];
 	$sql .= "', type='" . $_GET['type'];
 	$sql .= "', form='" . $_GET['form'];
 	$sql .= "', notes='" . mysqli_real_escape_string($connect, $_GET['notes']);
@@ -66,8 +62,7 @@
 	$sql .= "', cost='" . $_GET['cost'];
 	$sql .= "', production_date='" . $_GET['production_date'];
 	$sql .= "', tht_date='" . $_GET['tht_date'];
-	$sql .= "', supplier_rec='" . $_GET['supplier_rec'];
-	$sql .= "', total_oil'" . $_GET['total_oil'];
+	$sql .= "', total_oil='" . $_GET['total_oil'];
 	$sql .= "' WHERE record='" . $_GET['record'] . "';";
 	$result = mysqli_query($connect, $sql);
 	if (! $result) {
@@ -102,7 +97,6 @@
 			'cohumulone' => $row['cohumulone'],
 			'myrcene' => $row['myrcene'],
 			'hsi' => $row['hsi'],
-			'useat' => $row['useat'],
 			'type' => $row['type'],
 			'form' => $row['form'],
 			'notes' => $row['notes'],
@@ -113,7 +107,6 @@
 			'cost' => $row['cost'],
 			'production_date' => $row['production_date'],
 			'tht_date' => $row['tht_date'],
-			'supplier_rec' => $row['supplier_rec'],
 			'total_oil' => $row['total_oil']
 		);
 	}
--- a/www/inv_hops.php	Thu Aug 16 16:01:13 2018 +0200
+++ b/www/inv_hops.php	Thu Aug 16 16:38:20 2018 +0200
@@ -54,12 +54,6 @@
        <td align="right" style="vertical-align: top;">Vervangen door:</td>
        <td align="left" style="vertical-align: top;"><input id="substitutes" /></td>
       </tr>
-<!--      <tr>
-       <td align="right" style="vertical-align: top;">supplier_rec:</td>
-       <td align="left"><div id="supplier_rec"></div></td>
-       <td align="right" style="vertical-align: top;">useat:</td>
-       <td align="left"><div id="useat"></div></td>
-      </tr>  -->
       <tr>
        <td align="right" style="vertical-align: top;">Altijd op voorraad::</td>
        <td align="left" colspan="3"><div id="always_on_stock"></div></td>
--- a/www/js/inv_hops.js	Thu Aug 16 16:01:13 2018 +0200
+++ b/www/js/inv_hops.js	Thu Aug 16 16:38:20 2018 +0200
@@ -58,7 +58,6 @@
 			{ name: 'cohumulone', type: 'float' },
 			{ name: 'myrcene', type: 'float' },
 			{ name: 'hsi', type: 'float' },
-			{ name: 'useat', type: 'string' },
 			{ name: 'type', type: 'string' },
 			{ name: 'form', type: 'string' },
 			{ name: 'notes', type: 'string' },
@@ -69,7 +68,6 @@
 			{ name: 'cost', type: 'float' },
 			{ name: 'production_date', type: 'string' },
 			{ name: 'tht_date', type: 'string' },
-			{ name: 'supplier_rec', type: 'number' },
 			{ name: 'total_oil', type: 'float' }
 		],
 		id: 'record',
@@ -136,7 +134,6 @@
 	$("#myrcene").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
 	$("#hsi").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
 
-//	$("#useat").jqxDropDownList({ theme: theme, source: srcUse, width: 90, height: 23, dropDownHeight: 130 });	// Only in recipes
 	$("#type").jqxDropDownList({ theme: theme, source: srcType, width: 90, height: 23, dropDownHeight: 95 });
 	$("#form").jqxDropDownList({ theme: theme, source: srcForm, width: 90, height: 23, dropDownHeight: 95 });
 	$("#notes").jqxInput({ theme: theme, width: 640, height: 100 });
@@ -147,7 +144,6 @@
 	$("#production_date").jqxDateTimeInput({ theme: theme, width: 100, height: 23, formatString: 'yyyy-MM-dd' });
 	$("#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' });
-//	$("#supplier_rec").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });  // Implement later.
 	$("#total_oil").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
 	var dataAdapter = new $.jqx.dataAdapter(source);
 	var editrow = -1;
@@ -177,7 +173,6 @@
 				$("#cohumulone").val('');
 				$("#myrcene").val('');
 				$("#hsi").val('');
-				//$("#useat").val('Boil');
 				$("#type").val('Bittering');
 				$("#form").val('Pellet');
 				$("#notes").val('');
@@ -188,7 +183,6 @@
 				$("#cost").val('');
 				$("#production_date").val('');
 				$("#tht_date").val('');
-				//$("#supplier_rec").val('');
 				$("#total_oil").val('');
 				$("#popupWindow").jqxWindow('open');
 			});
@@ -223,7 +217,6 @@
 					$("#cohumulone").val(dataRecord.cohumulone);
 					$("#myrcene").val(dataRecord.myrcene);
 					$("#hsi").val(dataRecord.hsi);
-					//$("#useat").val(dataRecord.useat);
 					$("#type").val(dataRecord.type);
 					$("#form").val(dataRecord.form);
 					$("#notes").val(dataRecord.notes);
@@ -234,7 +227,6 @@
 					$("#cost").val(dataRecord.cost);
 					$("#production_date").val(dataRecord.production_date);
 					$("#tht_date").val(dataRecord.tht_date);
-					//$("#supplier_rec").val(dataRecord.supplier_rec);
 					$("#total_oil").val(dataRecord.total_oil);
 					// show the popup window.
 					$("#popupWindow").jqxWindow('open');
@@ -277,7 +269,6 @@
 				cohumulone: parseFloat($("#cohumulone").jqxNumberInput('decimal')),
 				myrcene: parseFloat($("#myrcene").jqxNumberInput('decimal')),
 				hsi: parseFloat($("#hsi").jqxNumberInput('decimal')),
-				//useat: $("#useat").val(),
 				type: $("#type").val(),
 				form: $("#form").val(),
 				notes: $("#notes").val(),
@@ -288,7 +279,6 @@
 		                cost: parseFloat($("#cost").jqxNumberInput('decimal')),
 		                production_date: $("#production_date").val(),
 		                tht_date: $("#tht_date").val(),
-		                //supplier_rec: parseFloat($("#supplier_rec").jqxNumberInput('decimal')),
 				total_oil: parseFloat($("#total_oil").jqxNumberInput('decimal'))
 			};
 			$('#jqxgrid').jqxGrid('updaterow', rowID, row);
@@ -305,7 +295,6 @@
 				cohumulone: parseFloat($("#cohumulone").jqxNumberInput('decimal')),
 				myrcene: parseFloat($("#myrcene").jqxNumberInput('decimal')),
 				hsi: parseFloat($("#hsi").jqxNumberInput('decimal')),
-				//useat: $("#useat").val(),
 				type: $("#type").val(),
 				form: $("#form").val(),
 				notes: $("#notes").val(),
@@ -316,7 +305,6 @@
 				cost: parseFloat($("#cost").jqxNumberInput('decimal')),
 				production_date: $("#production_date").val(),
 				tht_date: $("#tht_date").val(),
-				//supplier_rec: parseFloat($("#supplier_rec").jqxNumberInput('decimal')),
 				total_oil: parseFloat($("#total_oil").jqxNumberInput('decimal'))
 			};
 			$('#jqxgrid').jqxGrid('addrow', null, newrow);

mercurial