www/includes/global.inc.php

Sun, 19 Aug 2018 15:36:13 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 19 Aug 2018 15:36:13 +0200
changeset 30
f5ab22446aa5
parent 23
4b157d7a1cee
child 34
a720353fada9
permissions
-rw-r--r--

Inventory fermentables and hops to standard weight format.

<?php
/*****************************************************************************
 * Copyright (C) 2014-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.
 *****************************************************************************/

/*
 * Look for the style names in the jqwidgets/styles directory.
 *
 * energyblue of ui-redmond
 */
//$my_style = 'black';
//$my_style = 'ui-darkness';
$my_style = 'ui-mbse';
//$my_style = 'android';

require_once($_SERVER['DOCUMENT_ROOT'].'/config.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/version.php');


function page_header($title, $loadjs) {
	global $my_style;
	global $my_version;
?>
<!DOCTYPE html>
<html lang=nl-NL>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>BMS v<?php echo $my_version;?> - <?php echo $title;?></title>
  <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />
  <link type="text/css" href="jqwidgets/styles/jqx.base.css" rel="stylesheet" />
  <link type="text/css" href="jqwidgets/styles/jqx.<?php echo $my_style; ?>.css" rel="stylesheet" />
  <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" />
  <script>
	var theme = "<?php echo $my_style; ?>";
  </script>
  <script src="js/jquery-1.11.1.min.js"></script>
  <script src="jqwidgets/jqxcore.js"></script>
  <script src="jqwidgets/jqxwindow.js"></script>
  <script src="jqwidgets/jqxmenu.js"></script>
  <script src="jqwidgets/jqxwindow.js"></script>
  <script src="jqwidgets/jqxdata.js"></script>
  <script src="jqwidgets/jqxbuttons.js"></script>
  <script src="jqwidgets/jqxscrollbar.js"></script>
  <script src="jqwidgets/jqxgrid.js"></script>
  <script src="jqwidgets/jqxgrid.pager.js"></script>
  <script src="jqwidgets/jqxgrid.filter.js"></script>
  <script src="jqwidgets/jqxgrid.selection.js"></script>
  <script src="jqwidgets/jqxnumberinput.js"></script>
  <script src="jqwidgets/jqxlistbox.js"></script>
  <script src="jqwidgets/jqxdropdownlist.js"></script>
  <script src="jqwidgets/jqxdropdownbutton.js"></script>
  <script src="jqwidgets/jqxinput.js"></script>
  <script src="jqwidgets/jqxeditor.js"></script>
  <script src="jqwidgets/jqxtooltip.js"></script>
  <script src="jqwidgets/jqxcheckbox.js"></script>
  <script src="jqwidgets/jqxdatetimeinput.js"></script>
  <script src="jqwidgets/jqxcalendar.js"></script>
  <script src="jqwidgets/jqxgauge.js"></script>
  <script src="jqwidgets/jqxdraw.js"></script>
  <script src="jqwidgets/globalization/globalize.js"></script>
  <script src="js/global.js"></script>
<?php
if (strlen($loadjs))
    echo  '  <script src="js/'.$loadjs.'.js"></script>'.PHP_EOL;
?>
 </head>

 <body class="default">
  <div id="jqxWidget">

   <!-- Menu -->
   <div id="jqxMenu">
    <ul>
     <li><a href="index.php">Home</a></li>
     <li>Monitoren
      <ul>
       <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?uuid='.$row['uuid'].'">'.$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?uuid='.$row['uuid'].'">'.$row['node'].'/'.$row['alias'].'</a></li>'.PHP_EOL;
}
mysqli_free_result($result);
?>
        </ul>
       </li>
      </ul>
     </li>
     <li>Inventaris
      <ul>
       <li><a href="inv_suppliers.php">Leveranciers</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">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_mash_profiles.php">Maisch schemas</a></li>
       <li><a href="inv_equipments.php">Brouw apparatuur</a></li>
       <li><a href="inv_styles.php">Bierstijlen</a></li>
       <li><a href="inv_instock.php">Voorraad lijst</a></li>
      </ul>
     </li>
     <li>Over
      <ul>
       <li><a href="#aboutWindow">Informatie</a></li>
      </ul>
     </li>
    </ul>
   </div> <!-- End menu -->

   <div id="aboutWindow">
    <div>
     Over BMS
    </div>
    <div>
     The about text comes here
    </div>
   </div>

<?php
}


function confirm_delete() {
?>
   <div id="eventWindow">
    <div>
     Bevestig verwijderen
    </div>
    <div>
     <div>
      Klik "OK" om dit record definitief te verwijderen.<br>
      Druk "Cancel" om te sluiten zonder dit record te verwijderen.
     </div>
     <div>
      <div style="float: right; margin-top: 15px; margin-bottom: 10px;">
       <input type="button" id="delOk" value="OK" style="margin-right: 15px" />
       <input type="button" id="delCancel" value="Cancel" style="margin-right: 65px" />
      </div>
     </div>
    </div>
   </div>

<?php
}


function page_footer() {
?>
  </div> <!-- jqxWidget -->
 </body>
</html>
<?php
}
?>

mercurial