# HG changeset patch # User Michiel Broek # Date 1583058202 -3600 # Node ID 9034e65b0d7ab49f47742cfb893973e3cf5be60a # Parent f51754bce08e7e0a2c1fa60eb89cd3f2286835b8 Added CO2 carbonation log to the products database. Added button in the packaging tab. diff -r f51754bce08e -r 9034e65b0d7a www/crontasks.php --- a/www/crontasks.php Sat Feb 29 15:42:12 2020 +0100 +++ b/www/crontasks.php Sun Mar 01 11:23:22 2020 +0100 @@ -74,9 +74,9 @@ /* - * Check fementation logs. + * Check several logs. */ -$query = "SELECT record,code,name,log_brew,log_fermentation,log_ispindel FROM products;"; +$query = "SELECT record,code,name,log_brew,log_fermentation,log_ispindel,log_co2pressure FROM products;"; $result = mysqli_query($connect, $query); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $logfile = "log/fermentation/" . $row['code'] . " " . $row['name'] . ".log"; @@ -99,6 +99,16 @@ syslog(LOG_NOTICE, $query); $result1 = mysqli_query($connect, $query); } + $logfile = "log/co2pressure/" . $row['code'] . " " . $row['name'] . ".log"; + if (file_exists($logfile)) + $ok = 1; + else + $ok = 0; + if ($ok != $row['log_co2pressure']) { + $query = "UPDATE products SET log_co2pressure='" . $ok . "' WHERE record='" . $row['record'] . "';"; + syslog(LOG_NOTICE, $query); + $result1 = mysqli_query($connect, $query); + } } diff -r f51754bce08e -r 9034e65b0d7a www/includes/db_divides.php --- a/www/includes/db_divides.php Sat Feb 29 15:42:12 2020 +0100 +++ b/www/includes/db_divides.php Sun Mar 01 11:23:22 2020 +0100 @@ -102,6 +102,7 @@ $sql .= "', log_brew='" . $row['log_brew']; $sql .= "', log_fermentation='" . $row['log_fermentation']; $sql .= "', log_ispindel='" . $row['log_ispindel']; + $sql .= "', log_co2pressure='" . $row['log_co2pressure']; $sql .= "', inventory_reduced='" . $row['inventory_reduced'];; $sql .= "', locked='" . $row['locked'];; // Equipment diff -r f51754bce08e -r 9034e65b0d7a www/includes/db_product.php --- a/www/includes/db_product.php Sat Feb 29 15:42:12 2020 +0100 +++ b/www/includes/db_product.php Sun Mar 01 11:23:22 2020 +0100 @@ -41,6 +41,7 @@ $sql .= "', log_brew='" . $_POST['log_brew']; $sql .= "', log_fermentation='" . $_POST['log_fermentation']; $sql .= "', log_ispindel='" . $_POST['log_ispindel']; + $sql .= "', log_co2pressure='" . $_POST['log_co2pressure']; $sql .= "', inventory_reduced='" . $_POST['inventory_reduced']; $sql .= "', locked='" . $_POST['locked']; // Equipment @@ -683,6 +684,7 @@ $brew .= '","log_brew":' . $row['log_brew']; $brew .= ',"log_fermentation":' . $row['log_fermentation']; $brew .= ',"log_ispindel":' . $row['log_ispindel']; + $brew .= ',"log_co2pressure":' . $row['log_co2pressure']; $brew .= ',"inventory_reduced":' . $row['inventory_reduced']; $brew .= ',"locked":' . $row['locked']; $brew .= ',"eq_name":"' . str_replace($escapers, $replacements, $row['eq_name']); diff -r f51754bce08e -r 9034e65b0d7a www/js/prod_divide.js --- a/www/js/prod_divide.js Sat Feb 29 15:42:12 2020 +0100 +++ b/www/js/prod_divide.js Sun Mar 01 11:23:22 2020 +0100 @@ -84,6 +84,7 @@ { name: 'log_brew', type: 'int' }, { name: 'log_fermentation', type: 'int' }, { name: 'log_ispindel', type: 'int' }, + { name: 'log_co2pressure', type: 'int' }, { name: 'inventory_reduced', type: 'int' }, { name: 'locked', type: 'int' }, { name: 'eq_name', type: 'string' }, diff -r f51754bce08e -r 9034e65b0d7a www/js/prod_edit.js --- a/www/js/prod_edit.js Sat Feb 29 15:42:12 2020 +0100 +++ b/www/js/prod_edit.js Sun Mar 01 11:23:22 2020 +0100 @@ -118,6 +118,7 @@ { name: 'log_brew', type: 'int' }, { name: 'log_fermentation', type: 'int' }, { name: 'log_ispindel', type: 'int' }, + { name: 'log_co2pressure', type: 'int' }, { name: 'inventory_reduced', type: 'int' }, { name: 'locked', type: 'int' }, { name: 'eq_name', type: 'string' }, @@ -4125,6 +4126,7 @@ $('#BLog').jqxButton({ disabled: (dataRecord.log_brew) ? false : true}); $('#FLog').jqxButton({ disabled: (dataRecord.log_fermentation) ? false : true}); $('#ILog').jqxButton({ disabled: (dataRecord.log_ispindel) ? false : true}); + $('#CLog').jqxButton({ disabled: (dataRecord.log_co2pressure) ? false : true}); } $('#styleSelect').jqxDropDownList({ @@ -4251,6 +4253,7 @@ log_brew: dataRecord.log_brew, log_fermentation: dataRecord.log_fermentation, log_ispindel: dataRecord.log_ispindel, + log_co2pressure: dataRecord.log_co2pressure, inventory_reduced: dataRecord.inventory_reduced, locked: dataRecord.locked, eq_name: $('#eq_name').val(), @@ -5993,6 +5996,11 @@ $('#bottle_priming_amount,#keg_priming_amount,#bottle_priming_total,#bottle_pressure,#keg_priming_total,#keg_pressure').jqxNumberInput(Show1dec); $('#bottle_abv,#keg_abv').jqxNumberInput(Show2dec); $('#bottle_carbonation_temp,#keg_carbonation_temp').jqxNumberInput(YeastT); + $('#CLog').jqxButton({ template: 'info', width: '150px', theme: theme }); + $('#CLog').click(function() { + // Open log in a new tab. + window.open('log_co2pressure.php?code=' + dataRecord.code + '&name=' + dataRecord.name); + }); // Tab 12, Tasting $('#taste_date').jqxTooltip({ content: 'De proef datum van dit bier.' }); diff -r f51754bce08e -r 9034e65b0d7a www/js/prod_new.js --- a/www/js/prod_new.js Sat Feb 29 15:42:12 2020 +0100 +++ b/www/js/prod_new.js Sun Mar 01 11:23:22 2020 +0100 @@ -257,6 +257,7 @@ log_brew: 0, log_fermentation: 0, log_ispindel: 0, + log_co2pressure: 0, inventory_reduced: 0, locked: 0, eq_name: $('#eq_name').val(), diff -r f51754bce08e -r 9034e65b0d7a www/prod_duplicate.php --- a/www/prod_duplicate.php Sat Feb 29 15:42:12 2020 +0100 +++ b/www/prod_duplicate.php Sun Mar 01 11:23:22 2020 +0100 @@ -34,6 +34,7 @@ $sql .= "', log_brew='0"; $sql .= "', log_fermentation='0"; $sql .= "', log_ispindel='0"; +$sql .= "', log_co2pressure='0"; $sql .= "', inventory_reduced='0"; $sql .= "', locked='0"; // Equipment diff -r f51754bce08e -r 9034e65b0d7a www/prod_edit.php --- a/www/prod_edit.php Sat Feb 29 15:42:12 2020 +0100 +++ b/www/prod_edit.php Sun Mar 01 11:23:22 2020 +0100 @@ -844,6 +844,9 @@
+
+ +
diff -r f51754bce08e -r 9034e65b0d7a www/rec_toproduct.php --- a/www/rec_toproduct.php Sat Feb 29 15:42:12 2020 +0100 +++ b/www/rec_toproduct.php Sun Mar 01 11:23:22 2020 +0100 @@ -33,7 +33,7 @@ $sql .= "', birth='" . date("Y-m-d"); $sql .= "', stage='1"; $sql .= "', notes='" . mysqli_real_escape_string($link, $row['notes']); -$sql .= "', log_brew='0', log_fermentation='0', log_ispindel='0', inventory_reduced='0', locked='0"; +$sql .= "', log_brew='0', log_fermentation='0', log_ispindel='0', log_co2pressure='0', inventory_reduced='0', locked='0"; // Equipment $sql .= "', eq_name='Kies zelf een installatie!"; $sql .= "', eq_boil_size='" . $row['boil_size'];