# HG changeset patch # User Michiel Broek # Date 1535555431 -7200 # Node ID 95251bedfab4159db2d5d2a7fa7b09190ce8070d # Parent 6fea20eead568574727aefc3e7913915f4b4ee29 Moved three inventory tables and screens to profiles diff -r 6fea20eead56 -r 95251bedfab4 www/import/from_brouwhulp.php --- a/www/import/from_brouwhulp.php Wed Aug 29 16:23:57 2018 +0200 +++ b/www/import/from_brouwhulp.php Wed Aug 29 17:10:31 2018 +0200 @@ -181,7 +181,7 @@ global $brouwhulp, $db; echo " Start adding waters to the database\n"; - $sql = "TRUNCATE TABLE inventory_water_profiles;"; + $sql = "TRUNCATE TABLE profile_water;"; if (! $result = mysqli_query($db, $sql)) { printf("Error: %s\n", mysqli_error($db)); } @@ -201,7 +201,7 @@ ($water->DEFAULT_WATER == 'TRUE') ? $sql .= "', default_water='1" : $sql .= "', default_water='0"; ($water->ALWAYS_ON_STOCK == 'TRUE') ? $sql .= "', always_on_stock='1" : $sql .= "', always_on_stock='0"; } else { - $sql = "INSERT INTO inventory_water_profiles SET name='" . mysqli_real_escape_string($db, $water->NAME); + $sql = "INSERT INTO profile_water SET name='" . mysqli_real_escape_string($db, $water->NAME); } if ($water->NOTES) @@ -322,7 +322,7 @@ global $brouwhulp, $db; echo " Start adding styles to the database\n"; - $sql = "TRUNCATE TABLE inventory_styles;"; + $sql = "TRUNCATE TABLE profile_styles;"; if (! $result = mysqli_query($db, $sql)) { printf("Error: %s\n", mysqli_error($db)); } @@ -331,7 +331,7 @@ foreach ($styles->STYLE as $style) { - $sql = "INSERT INTO inventory_styles SET name='" . mysqli_real_escape_string($db, $style->NAME); + $sql = "INSERT INTO profile_styles SET name='" . mysqli_real_escape_string($db, $style->NAME); if ($style->NOTES) $sql .= "', notes='" . mysqli_real_escape_string($db, $style->NOTES); if ($style->CATEGORY) @@ -376,7 +376,7 @@ global $brouwhulp, $db; echo " Start adding mash profiles to the database\n"; - $sql = "TRUNCATE TABLE inventory_mash_profiles;"; + $sql = "TRUNCATE TABLE profile_mash;"; if (! $result = mysqli_query($db, $sql)) { printf("Error: %s\n", mysqli_error($db)); } @@ -384,7 +384,7 @@ $mashes = simplexml_load_file($brouwhulp . '/mashs.xml'); foreach ($mashes->MASH as $mash) { - $sql = "INSERT INTO inventory_mash_profiles SET name='" . mysqli_real_escape_string($db, $mash->NAME); + $sql = "INSERT INTO profile_mash SET name='" . mysqli_real_escape_string($db, $mash->NAME); if ($mash->NOTES) $sql .= "', notes='" . mysqli_real_escape_string($db, $mash->NOTES); @@ -433,8 +433,8 @@ do_hops(); do_yeasts(); do_miscs(); -//do_waters(); -//do_equipments(); +do_waters(); +do_equipments(); do_styles(); do_mash(); diff -r 6fea20eead56 -r 95251bedfab4 www/includes/db_inventory_mash_profiles.php --- a/www/includes/db_inventory_mash_profiles.php Wed Aug 29 16:23:57 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ - diff -r 6fea20eead56 -r 95251bedfab4 www/includes/db_inventory_styles.php --- a/www/includes/db_inventory_styles.php Wed Aug 29 16:23:57 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ - $row['record'], - 'name' => $row['name'], - 'category' => $row['category'], - 'category_number' => $row['category_number'], - 'style_letter' => $row['style_letter'], - 'style_guide' => $row['style_guide'], - 'type' => $row['type'], - 'og_min' => $row['og_min'], - 'og_max' => $row['og_max'], - 'fg_min' => $row['fg_min'], - 'fg_max' => $row['fg_max'], - 'ibu_min' => $row['ibu_min'], - 'ibu_max' => $row['ibu_max'], - 'color_min' => $row['color_min'], - 'color_max' => $row['color_max'], - 'carb_min' => $row['carb_min'], - 'carb_max' => $row['carb_max'], - 'abv_min' => $row['abv_min'], - 'abv_max' => $row['abv_max'], - 'notes' => $row['notes'], - 'profile' => $row['profile'], - 'ingredients' => $row['ingredients'], - 'examples' => $row['examples'] - ); - } - echo json_encode($styles); -} -?> diff -r 6fea20eead56 -r 95251bedfab4 www/includes/db_inventory_water_profiles.php --- a/www/includes/db_inventory_water_profiles.php Wed Aug 29 16:23:57 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ - $row['record'], - 'name' => $row['name'], - 'calcium' => $row['calcium'], - 'bicarbonate' => $row['bicarbonate'], - 'sulfate' => $row['sulfate'], - 'chloride' => $row['chloride'], - 'sodium' => $row['sodium'], - 'magnesium' => $row['magnesium'], - 'ph' => $row['ph'], - 'notes' => $row['notes'], - 'total_alkalinity' => $row['total_alkalinity'] - ); - } - echo json_encode($waters); -} -?> diff -r 6fea20eead56 -r 95251bedfab4 www/includes/db_profile_mash.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/includes/db_profile_mash.php Wed Aug 29 17:10:31 2018 +0200 @@ -0,0 +1,74 @@ + diff -r 6fea20eead56 -r 95251bedfab4 www/includes/db_profile_styles.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/includes/db_profile_styles.php Wed Aug 29 17:10:31 2018 +0200 @@ -0,0 +1,123 @@ + $row['record'], + 'name' => $row['name'], + 'category' => $row['category'], + 'category_number' => $row['category_number'], + 'style_letter' => $row['style_letter'], + 'style_guide' => $row['style_guide'], + 'type' => $row['type'], + 'og_min' => $row['og_min'], + 'og_max' => $row['og_max'], + 'fg_min' => $row['fg_min'], + 'fg_max' => $row['fg_max'], + 'ibu_min' => $row['ibu_min'], + 'ibu_max' => $row['ibu_max'], + 'color_min' => $row['color_min'], + 'color_max' => $row['color_max'], + 'carb_min' => $row['carb_min'], + 'carb_max' => $row['carb_max'], + 'abv_min' => $row['abv_min'], + 'abv_max' => $row['abv_max'], + 'notes' => $row['notes'], + 'profile' => $row['profile'], + 'ingredients' => $row['ingredients'], + 'examples' => $row['examples'] + ); + } + echo json_encode($styles); +} +?> diff -r 6fea20eead56 -r 95251bedfab4 www/includes/db_profile_water.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/includes/db_profile_water.php Wed Aug 29 17:10:31 2018 +0200 @@ -0,0 +1,87 @@ + $row['record'], + 'name' => $row['name'], + 'calcium' => $row['calcium'], + 'bicarbonate' => $row['bicarbonate'], + 'sulfate' => $row['sulfate'], + 'chloride' => $row['chloride'], + 'sodium' => $row['sodium'], + 'magnesium' => $row['magnesium'], + 'ph' => $row['ph'], + 'notes' => $row['notes'], + 'total_alkalinity' => $row['total_alkalinity'] + ); + } + echo json_encode($waters); +} +?> diff -r 6fea20eead56 -r 95251bedfab4 www/includes/global.inc.php --- a/www/includes/global.inc.php Wed Aug 29 16:23:57 2018 +0200 +++ b/www/includes/global.inc.php Wed Aug 29 17:10:31 2018 +0200 @@ -115,6 +115,10 @@ +
  • Productie +
  • +
  • Recepten +
  • Inventaris
  • +
  • Profielen + +
  • Over