# HG changeset patch # User Michiel Broek # Date 1551047161 -3600 # Node ID 12aa92828e2445ecac82d7b580bfcbe9c574c48e # Parent 4082c41f45e974d85d90c02f0010698696c6f117 Added view archives by name diff -r 4082c41f45e9 -r 12aa92828e24 README.design --- a/README.design Sun Feb 24 22:29:00 2019 +0100 +++ b/README.design Sun Feb 24 23:26:01 2019 +0100 @@ -139,3 +139,15 @@ ----------------------------------------------------------------------------- +TODO: + +Copieren recepten tussen products en recipes, maar ook dupliceren. Import. +Menu voor archive products. +Cron uitbreiden met test op nieuw verschenen logfiles. Of nog slimmer, zet de +logfile aan zodra een product in een gistkast geladen is. +Download gist temperatuur grenzen naar thermferm zodat die opgevraagd kunnen +worden door de monitor. Die kan dan de kleuren op de thermometers aanpassen. +Download en import brouw logs van de brouwcontroller. +Import van ingredienten vanuit xml bestanden zoals die van brouwhulp. +Export ingredienten naar xml. + diff -r 4082c41f45e9 -r 12aa92828e24 www/includes/db_product.php --- a/www/includes/db_product.php Sun Feb 24 22:29:00 2019 +0100 +++ b/www/includes/db_product.php Sun Feb 24 23:26:01 2019 +0100 @@ -436,6 +436,22 @@ return; } + if (isset($_GET['select']) && ($_GET['select'] == "archname")) { + $query = "SELECT record,name,code,birth,batch_size FROM products WHERE stage = '11' ORDER BY name,birth;"; + $result = mysqli_query($connect, $query) or die("SQL Error 1: " . mysqli_error($connect)); + while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { + $brews[] = array( + 'record' => $row['record'], + 'name' => $row['name'], + 'code' => $row['code'], + 'birth' => $row['birth'], + 'batch_size' => $row['batch_size'] + ); + } + echo json_encode($brews, JSON_UNESCAPED_UNICODE); + return; + } + /* * SELECT, produce a list of products that can be fermented. */ diff -r 4082c41f45e9 -r 12aa92828e24 www/includes/global.inc.php --- a/www/includes/global.inc.php Sun Feb 24 22:29:00 2019 +0100 +++ b/www/includes/global.inc.php Sun Feb 24 23:26:01 2019 +0100 @@ -217,7 +217,7 @@
  • Start nieuw
  • Archief diff -r 4082c41f45e9 -r 12aa92828e24 www/js/prod_archive_name.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/js/prod_archive_name.js Sun Feb 24 23:26:01 2019 +0100 @@ -0,0 +1,60 @@ +/***************************************************************************** + * Copyright (C) 2019 + * + * Michiel Broek + * + * This file is part of BMS + * + * 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. + *****************************************************************************/ + + +$(document).ready(function () { + var source = { + datatype: "json", + cache: false, + datafields: [ + { name: 'record', type: 'number' }, + { name: 'name', type: 'string' }, + { name: 'code', type: 'string' }, + { name: 'birth', type: 'string' }, + { name: 'batch_size', type: 'float' }, + ], + id: 'record', + url: "includes/db_product.php?select=archname" + }; + var dataAdapter = new $.jqx.dataAdapter(source); + // initialize jqxGrid + $("#jqxgrid").jqxGrid({ + width: 1280, + height: 630, + source: dataAdapter, + theme: theme, + columns: [ + { text: 'Naam', datafield: 'name' }, + { text: 'Datum', datafield: 'birth', width: 120 }, + { text: 'Code', datafield: 'code', width: 120 }, + { text: 'Liters', datafield: 'batch_size', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, + { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function () { + return "Bekijk"; + }, buttonclick: function (row) { + var datarecord = dataAdapter.records[row]; + var url= "prod_edit.php?record=" + datarecord.record + "&select=archname&return=prod_archive_name.php"; + window.location.href = url; + } + } + ], + }); +}); diff -r 4082c41f45e9 -r 12aa92828e24 www/prod_archive_name.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/prod_archive_name.php Sun Feb 24 23:26:01 2019 +0100 @@ -0,0 +1,14 @@ + + +
    +
    +
    +
    +
    + +