www/includes/db_inventory_miscs.php

Wed, 16 Oct 2019 21:05:03 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 16 Oct 2019 21:05:03 +0200
changeset 514
3c680d1dea35
parent 296
69fadd1aded2
child 712
65da479b5542
permissions
-rw-r--r--

Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.

21
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 <?php
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 require($_SERVER['DOCUMENT_ROOT']."/config.php");
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 require($_SERVER['DOCUMENT_ROOT']."/version.php");
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
5 require($_SERVER['DOCUMENT_ROOT']."/includes/constants.php");
21
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 #Connect to the database
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 $connect = mysqli_connect(DBASE_HOST, DBASE_USER, DBASE_PASS, DBASE_NAME);
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 if (! $connect) {
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 }
77
a9f8de2d7b2b Fixed most charset problems. Added fpdf library. Added inventory pdf creation.
Michiel Broek <mbroek@mbse.eu>
parents: 37
diff changeset
12 mysqli_set_charset($connect, "utf8" );
21
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13
200
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
14 if (isset($_POST['insert']) || isset($_POST['update'])) {
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
15 if (isset($_POST['insert'])) {
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
16 $sql = "INSERT INTO `inventory_miscs` SET ";
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
17 }
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
18 if (isset($_POST['update'])) {
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
19 $sql = "UPDATE `inventory_miscs` SET ";
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
20 }
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
21
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
22 $sql .= "name='" . mysqli_real_escape_string($connect, $_POST['name']);
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
23 $sql .= "', type='" . array_search($_POST['type'], $misctype);
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
24 $sql .= "', use_use='" . array_search($_POST['use_use'], $miscuse);
200
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
25 $sql .= "', time='" . $_POST['time'];
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
26 ($_POST['amount_is_weight'] == 'true') ? $sql .= "', amount_is_weight='1" : $sql .= "', amount_is_weight='0";
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
27 $sql .= "', use_for='" . mysqli_real_escape_string($connect, $_POST['use_for']);
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
28 $sql .= "', notes='" . mysqli_real_escape_string($connect, $_POST['notes']);
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
29 ($_POST['always_on_stock'] == 'true') ? $sql .= "', always_on_stock='1" : $sql .= "', always_on_stock='0";
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
30 $sql .= "', inventory='" . floatval($_POST['inventory']) / 1000.0;
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
31 $sql .= "', cost='" . $_POST['cost'] . "'";
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
32 if ($_POST['production_date'] == '')
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
33 $sql .= ", production_date=NULL";
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
34 else
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
35 $sql .= ", production_date='" . $_POST['production_date'] . "'";
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
36 if ($_POST['tht_date'] == '')
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
37 $sql .= ", tht_date=NULL";
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
38 else
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
39 $sql .= ", tht_date='" . $_POST['tht_date'] . "'";
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
40
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
41 if (isset($_POST['insert'])) {
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
42 $sql .= ";";
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
43 }
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
44 if (isset($_POST['update'])) {
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
45 $sql .= " WHERE record='" . $_POST['record'] . "';";
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
46 }
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
47 syslog(LOG_NOTICE, $sql);
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
48
21
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49 $result = mysqli_query($connect, $sql);
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 if (! $result) {
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 syslog(LOG_NOTICE, "db_inventory_miscs: ".$sql." result: ".mysqli_error($connect));
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 } else {
200
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
53 if (isset($_POST['update'])) {
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
54 syslog(LOG_NOTICE, "db_inventory_miscs: updated record ".$_POST['record']);
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
55 } else {
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
56 $lastid = mysqli_insert_id($connect);
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
57 syslog(LOG_NOTICE, "db_inventory_miscs: inserted record ".$lastid);
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
58 }
21
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 }
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 echo $result;
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61
200
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
62 } else if (isset($_POST['delete'])) {
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
63 // DELETE COMMAND
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
64 $sql = "DELETE FROM `inventory_miscs` WHERE record='".$_POST['record']."';";
21
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 $result = mysqli_query($connect, $sql);
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 if (! $result) {
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 syslog(LOG_NOTICE, "db_inventory_miscs: ".$sql." result: ".mysqli_error($connect));
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 } else {
200
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
69 syslog(LOG_NOTICE, "db_inventory_miscs: deleted record ".$_POST['record']);
21
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70 }
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 echo $result;
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 } else {
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 // SELECT COMMAND
200
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
75 $query = "SELECT * FROM inventory_miscs ORDER BY name";
21
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 $result = mysqli_query($connect, $query) or die("SQL Error 1: " . mysqli_error($connect));
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 $miscs[] = array(
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 'record' => $row['record'],
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 'name' => $row['name'],
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
81 'type' => $misctype[$row['type']],
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
82 'use_use' => $miscuse[$row['use_use']],
21
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 'time' => $row['time'],
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 'amount_is_weight' => $row['amount_is_weight'],
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 'use_for' => $row['use_for'],
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 'notes' => $row['notes'],
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 'always_on_stock' => $row['always_on_stock'],
200
7b2f11652d67 Miscs from bool to ints. Miscs database uses POST instead of GET. Dropdowns are unsing indexes. Dynamic edit screen adjust for weight and liter. Edit screen redesigned. Friendly show duration of ingredients.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
88 'inventory' => floatval($row['inventory']) * 1000.0,
21
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 'cost' => $row['cost'],
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90 'production_date' => $row['production_date'],
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 'tht_date' => $row['tht_date']
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 );
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 }
296
69fadd1aded2 Updated design document. Add content header application/json to all scripts that produce json output. Chart prints show the beer code and name in the header. Charts don't display the menu anymore.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
94 header("Content-type: application/json");
21
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 echo json_encode($miscs);
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96 }
acb2d8098f19 Added inventory miscs and water sources.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97 ?>

mercurial