Waters import and home page

Mon, 13 Aug 2018 19:49:42 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 13 Aug 2018 19:49:42 +0200
changeset 15
ccbe79db80b8
parent 14
d9dfd703df83
child 16
522022b4fae4

Waters import and home page

www/css/style.css file | annotate | diff | comparison | revisions
www/import/from_brouwhulp.php file | annotate | diff | comparison | revisions
www/includes/global.inc.php file | annotate | diff | comparison | revisions
www/index.php file | annotate | diff | comparison | revisions
--- a/www/css/style.css	Mon Aug 13 16:10:27 2018 +0200
+++ b/www/css/style.css	Mon Aug 13 19:49:42 2018 +0200
@@ -34,6 +34,19 @@
 }
 
 
+#jqxMenu {
+    border: 2px solid #4297d7;
+}
+
+
+#MainPanel {
+    width: 1278px;
+    height: 628px;
+    border: 2px solid #4297d7;
+    background: #252526;
+}
+
+
 #header {
     width: 1278px;
     height: 38px;
--- a/www/import/from_brouwhulp.php	Mon Aug 13 16:10:27 2018 +0200
+++ b/www/import/from_brouwhulp.php	Mon Aug 13 19:49:42 2018 +0200
@@ -194,12 +194,23 @@
 	if (! $result = mysqli_query($db, $sql)) {
 		printf("Error: %s\n", mysqli_error($db));
 	}
+	$sql = "TRUNCATE TABLE inventory_water_sources;";
+	if (! $result = mysqli_query($db, $sql)) {
+		printf("Error: %s\n", mysqli_error($db));
+	}
 
 	$waters = simplexml_load_file($brouwhulp . '/waters.xml');
 
 	foreach ($waters->WATER as $water) {
 
-		$sql  = "INSERT INTO inventory_water_profiles SET name='" . mysqli_real_escape_string($db, $water->NAME);
+		if (($water->NAME == "Gedemineraliseerd water") || ($water->NAME == "Cristalline") || ($water->NAME == "Montille (Delhaize)") ||
+		    ($water->NAME == "Spa Reine") || ($water->NAME == "Velsen") || ($water->NAME == "Zutphen") || 
+		    ($water->NAME == "Aurele Bronwater (Colruyt)")) {
+			$sql  = "INSERT INTO inventory_water_sources SET name='" . mysqli_real_escape_string($db, $water->NAME);
+		} else {
+			$sql  = "INSERT INTO inventory_water_profiles SET name='" . mysqli_real_escape_string($db, $water->NAME);
+		}
+
 		($water->ALWAYS_ON_STOCK == 'TRUE') ? $sql .= "', always_on_stock='Y" : $sql .= "', always_on_stock='N";
 		if ($water->NOTES)
 			$sql .= "', notes='" . mysqli_real_escape_string($db, $water->NOTES);
@@ -446,10 +457,10 @@
 
 
 
-do_fermentables();
-do_hops();
+//do_fermentables();
+//do_hops();
 //do_yeasts();
-//do_waters();
+do_waters();
 //do_miscs();
 //do_equipments();
 //do_styles();
--- a/www/includes/global.inc.php	Mon Aug 13 16:10:27 2018 +0200
+++ b/www/includes/global.inc.php	Mon Aug 13 19:49:42 2018 +0200
@@ -91,25 +91,47 @@
    <!-- Menu -->
    <div id="jqxMenu">
     <ul>
-     <li><a href="#Home">Home</a></li>
+     <li><a href="index.php">Home</a></li>
      <li>Monitoren
       <ul>
-       <li>Systemen</li>
-       <li>Klimaatkasten</li>
+       <li>Systemen
+	<ul>
+<?php
+$mysqli = new mysqli(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
+$result = $mysqli->query("SELECT uuid,node,online,net_address FROM nodes");
+while($row = $result->fetch_array(MYSQLI_ASSOC)) {
+    echo '         <li><a href="mon_node.php?node='.$row['node'].'">'.$row['node'].'</a></li>'.PHP_EOL;
+}
+mysqli_free_result($result);
+?>
+	</ul>
+       </li>
+       <li>Klimaatkasten
+	<ul>
+<?php
+$result = $mysqli->query("SELECT uuid,node,alias,online,mode FROM fermenters");
+while($row = $result->fetch_array(MYSQLI_ASSOC)) {
+    echo '         <li><a href="mon_fermenter.php?node='.$row['node'].'&amp;alias='.$row['alias'].'">'.$row['node'].'/'.$row['alias'].'</a></li>'.PHP_EOL;
+}
+mysqli_free_result($result);
+?>
+        </ul>
+       </li>
        <li><a href="monitor.php">Probeersel</a></li>
       </ul>
      </li>
      <li>Inventaris
       <ul>
        <li><a href="inv_suppliers.php">Leveranciers</a></li>
-       <li><a href="inv_fermentables.php">Vergistbare producten</a></li>
+       <li><a href="inv_fermentables.php">Vergistbare ingredienten</a></li>
        <li><a href="inv_hops.php">Hoppen</a></li>
-       <li><a href="inv_yeasts.php">Gist</a></li>
-       <li><a href="inv_waters.php">Water profielen</a></li>
-       <li><a href="inv_miscs.php">Diverse ingredienetn</a></li>
-       <li><a href="inv_mashs.php">Maisch profielen</a></li>
+       <li><a href="inv_yeasts.php">Gisten</a></li>
+       <li><a href="inv_miscs.php">Overige ingredienten</a></li>
+       <li><a href="inv_water_sources.php">Water bronnen</a></li>
+       <li><a href="inv_water_profiles.php">Water profielen</a></li>
+       <li><a href="inv_mashs.php">Maisch schemas</a></li>
        <li><a href="inv_equipments.php">Brouw apparatuur</a></li>
-       <li><a href="inv_styles.php">Bier stijlen</a></li>
+       <li><a href="inv_styles.php">Bierstijlen</a></li>
       </ul>
      </li>
      <li>Over
--- a/www/index.php	Mon Aug 13 16:10:27 2018 +0200
+++ b/www/index.php	Mon Aug 13 19:49:42 2018 +0200
@@ -1,32 +1,12 @@
 <?php
-/*****************************************************************************
- * Copyright (C) 2018
- *
- * 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.
- *****************************************************************************/
+require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
+page_header('Hoofdmenu', NULL);
+?>
 
-require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
-
-$outstr  = page_header('Hoofdmenu', NULL);
-
+   <div id="MainPanel">
+    <div id="ContentPanel"></div>
+   </div>
 
-$outstr .= page_footer();
-
-echo $outstr;
+<?php
+page_footer();
 ?>

mercurial