# HG changeset patch # User Michiel Broek # Date 1571252703 -7200 # Node ID 3c680d1dea3560c5d28d673b9988b929c4d4fd9f # Parent 217ba4596c4d0d06288043d16138bc20e96b0278 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. diff -r 217ba4596c4d -r 3c680d1dea35 www/includes/constants.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/includes/constants.php Wed Oct 16 21:05:03 2019 +0200 @@ -0,0 +1,27 @@ + diff -r 217ba4596c4d -r 3c680d1dea35 www/includes/db_inventory_fermentables.php --- a/www/includes/db_inventory_fermentables.php Mon Oct 14 23:13:40 2019 +0200 +++ b/www/includes/db_inventory_fermentables.php Wed Oct 16 21:05:03 2019 +0200 @@ -2,6 +2,7 @@ require($_SERVER['DOCUMENT_ROOT']."/config.php"); require($_SERVER['DOCUMENT_ROOT']."/version.php"); +require($_SERVER['DOCUMENT_ROOT']."/includes/constants.php"); #Connect to the database @@ -21,7 +22,7 @@ } $sql .= "name='" . mysqli_real_escape_string($connect, $_POST['name']); - $sql .= "', type='" . $_POST['type']; + $sql .= "', type='" . array_search($_POST['type'], $fermentabletype); $sql .= "', yield='" . $_POST['yield']; $sql .= "', color='" . $_POST['color']; ($_POST['add_after_boil'] == 'true') ? $sql .= "', add_after_boil='1" : $sql .= "', add_after_boil='0"; @@ -35,11 +36,11 @@ $sql .= "', dissolved_protein='" . $_POST['dissolved_protein']; $sql .= "', max_in_batch='" . $_POST['max_in_batch']; ($_POST['recommend_mash'] == 'true') ? $sql .= "', recommend_mash='1" : $sql .= "', recommend_mash='0"; - $sql .= "', added='" . $_POST['added']; + $sql .= "', added='" . array_search($_POST['added'], $added); ($_POST['always_on_stock'] == 'true') ? $sql .= "', always_on_stock='1" : $sql .= "', always_on_stock='0"; $sql .= "', di_ph='" . $_POST['di_ph']; $sql .= "', acid_to_ph_57='" . $_POST['acid_to_ph_57']; - $sql .= "', graintype='" . $_POST['graintype']; + $sql .= "', graintype='" . array_search($_POST['graintype'], $graintype); $sql .= "', inventory='" . $_POST['inventory']; $sql .= "', cost='" . $_POST['cost'] . "'"; if ($_POST['production_date'] == '') @@ -90,7 +91,7 @@ $fermentables[] = array( 'record' => $row['record'], 'name' => $row['name'], - 'type' => $row['type'], + 'type' => $fermentabletype[$row['type']], 'yield' => $row['yield'], 'color' => $row['color'], 'add_after_boil' => $row['add_after_boil'], @@ -104,11 +105,11 @@ 'dissolved_protein' => $row['dissolved_protein'], 'max_in_batch' => $row['max_in_batch'], 'recommend_mash' => $row['recommend_mash'], - 'added' => $row['added'], + 'added' => $added[$row['added']], 'always_on_stock' => $row['always_on_stock'], 'di_ph' => $row['di_ph'], 'acid_to_ph_57' => $row['acid_to_ph_57'], - 'graintype' => $row['graintype'], + 'graintype' => $graintype[$row['graintype']], 'inventory' => $row['inventory'], 'cost' => $row['cost'], 'production_date' => $row['production_date'], diff -r 217ba4596c4d -r 3c680d1dea35 www/includes/db_inventory_hops.php --- a/www/includes/db_inventory_hops.php Mon Oct 14 23:13:40 2019 +0200 +++ b/www/includes/db_inventory_hops.php Wed Oct 16 21:05:03 2019 +0200 @@ -2,6 +2,7 @@ require($_SERVER['DOCUMENT_ROOT']."/config.php"); require($_SERVER['DOCUMENT_ROOT']."/version.php"); +require($_SERVER['DOCUMENT_ROOT']."/includes/constants.php"); #Connect to the database @@ -27,8 +28,8 @@ $sql .= "', cohumulone='" . $_POST['cohumulone']; $sql .= "', myrcene='" . $_POST['myrcene']; $sql .= "', hsi='" . $_POST['hsi']; - $sql .= "', type='" . $_POST['type']; - $sql .= "', form='" . $_POST['form']; + $sql .= "', type='" . array_search($_POST['type'], $hoptype); + $sql .= "', form='" . array_search($_POST['form'], $hopform); $sql .= "', notes='" . mysqli_real_escape_string($connect, $_POST['notes']); $sql .= "', origin='" . mysqli_real_escape_string($connect, $_POST['origin']); $sql .= "', substitutes='" . mysqli_real_escape_string($connect, $_POST['substitutes']); @@ -91,8 +92,8 @@ 'cohumulone' => $row['cohumulone'], 'myrcene' => $row['myrcene'], 'hsi' => $row['hsi'], - 'type' => $row['type'], - 'form' => $row['form'], + 'type' => $hoptype[$row['type']], + 'form' => $hopform[$row['form']], 'notes' => $row['notes'], 'origin' => $row['origin'], 'substitutes' => $row['substitutes'], diff -r 217ba4596c4d -r 3c680d1dea35 www/includes/db_inventory_miscs.php --- a/www/includes/db_inventory_miscs.php Mon Oct 14 23:13:40 2019 +0200 +++ b/www/includes/db_inventory_miscs.php Wed Oct 16 21:05:03 2019 +0200 @@ -2,6 +2,7 @@ require($_SERVER['DOCUMENT_ROOT']."/config.php"); require($_SERVER['DOCUMENT_ROOT']."/version.php"); +require($_SERVER['DOCUMENT_ROOT']."/includes/constants.php"); #Connect to the database $connect = mysqli_connect(DBASE_HOST, DBASE_USER, DBASE_PASS, DBASE_NAME); @@ -19,8 +20,8 @@ } $sql .= "name='" . mysqli_real_escape_string($connect, $_POST['name']); - $sql .= "', type='" . $_POST['type']; - $sql .= "', use_use='" . $_POST['use_use']; + $sql .= "', type='" . array_search($_POST['type'], $misctype); + $sql .= "', use_use='" . array_search($_POST['use_use'], $miscuse); $sql .= "', time='" . $_POST['time']; ($_POST['amount_is_weight'] == 'true') ? $sql .= "', amount_is_weight='1" : $sql .= "', amount_is_weight='0"; $sql .= "', use_for='" . mysqli_real_escape_string($connect, $_POST['use_for']); @@ -77,8 +78,8 @@ $miscs[] = array( 'record' => $row['record'], 'name' => $row['name'], - 'type' => $row['type'], - 'use_use' => $row['use_use'], + 'type' => $misctype[$row['type']], + 'use_use' => $miscuse[$row['use_use']], 'time' => $row['time'], 'amount_is_weight' => $row['amount_is_weight'], 'use_for' => $row['use_for'], diff -r 217ba4596c4d -r 3c680d1dea35 www/includes/db_inventory_yeasts.php --- a/www/includes/db_inventory_yeasts.php Mon Oct 14 23:13:40 2019 +0200 +++ b/www/includes/db_inventory_yeasts.php Wed Oct 16 21:05:03 2019 +0200 @@ -2,6 +2,7 @@ require($_SERVER['DOCUMENT_ROOT']."/config.php"); require($_SERVER['DOCUMENT_ROOT']."/version.php"); +require($_SERVER['DOCUMENT_ROOT']."/includes/constants.php"); #Connect to the database $connect = mysqli_connect(DBASE_HOST, DBASE_USER, DBASE_PASS, DBASE_NAME); @@ -10,6 +11,7 @@ } mysqli_set_charset($connect, "utf8" ); + // get data and store in a json array if (isset($_POST['insert']) || isset($_POST['update'])) { if (isset($_POST['insert'])) { @@ -20,8 +22,8 @@ } $sql .= "name='" . mysqli_real_escape_string($connect, $_POST['name']); - $sql .= "', type='" . $_POST['type']; - $sql .= "', form='" . $_POST['form']; + $sql .= "', type='" . array_search($_POST['type'], $yeasttype); + $sql .= "', form='" . array_search($_POST['form'], $yeastform); $sql .= "', laboratory='" . mysqli_real_escape_string($connect, $_POST['laboratory']); $sql .= "', product_id='" . mysqli_real_escape_string($connect, $_POST['product_id']); $sql .= "', min_temperature='" . $_POST['min_temperature']; @@ -90,8 +92,8 @@ $yeasts[] = array( 'record' => $row['record'], 'name' => $row['name'], - 'type' => $row['type'], - 'form' => $row['form'], + 'type' => $yeasttype[$row['type']], + 'form' => $yeastform[$row['form']], 'laboratory' => $row['laboratory'], 'product_id' => $row['product_id'], 'min_temperature' => $row['min_temperature'], diff -r 217ba4596c4d -r 3c680d1dea35 www/inv_instock.php --- a/www/inv_instock.php Mon Oct 14 23:13:40 2019 +0200 +++ b/www/inv_instock.php Wed Oct 16 21:05:03 2019 +0200 @@ -1,5 +1,6 @@ AddCol( 26,'Type','L'); $this->AddCol( 26,'Leverancier','L'); $this->AddCol( 68,'Vergistbaar ingredient','L'); @@ -85,7 +87,6 @@ $this->ColorIndex=0; $this->ProcessingTable=true; - $type = array( 'Mout', 'Suiker', 'V Extract', 'Extract', 'Ongemout graan' ); $sql = "SELECT type,name,supplier,inventory,cost FROM inventory_fermentables WHERE inventory > 0 ORDER BY type,supplier,name"; $result = mysqli_query($link, $sql); $tot_fermentables = 0.0; @@ -97,7 +98,7 @@ $this->SetX($this->TableX); $ci=$this->ColorIndex; $this->SetFillColor($this->RowColors[$ci][0],$this->RowColors[$ci][1],$this->RowColors[$ci][2]); - $this->Cell(26,5,$type[$row['type']],0,0,'L',true); + $this->Cell(26,5,$fermentabletype[$row['type']],0,0,'L',true); $this->Cell(26,5,iconv('UTF-8','windows-1252',$row['supplier']),0,0,'L',true); $this->Cell(68,5,iconv('UTF-8','windows-1252',$row['name']),0,0,'L',true); $this->Cell(30,5,sprintf("%10.3f kg",$row['inventory']),0,0,'R',true); @@ -119,6 +120,7 @@ } function TableHops($link,$prop) { + global $hopform; $this->AddCol( 30,'Land','L'); $this->AddCol( 75,'Hoppen','L'); $this->AddCol( 15,'Soort','L'); @@ -135,7 +137,6 @@ $this->ColorIndex=0; $this->ProcessingTable=true; - $type = array( 'Pellets', 'Plugs', 'Bellen' ); $result = mysqli_query($link, "SELECT name,form,origin,inventory,cost FROM inventory_hops WHERE inventory > 0 ORDER BY origin,name"); $tot_hops = 0.0; @@ -149,7 +150,7 @@ $this->SetFillColor($this->RowColors[$ci][0],$this->RowColors[$ci][1],$this->RowColors[$ci][2]); $this->Cell(30,5,iconv('UTF-8','windows-1252',$row['origin']),0,0,'L',true); $this->Cell(75,5,iconv('UTF-8','windows-1252',$row['name']),0,0,'L',true); - $this->Cell(15,5,$type[$row['form']],0,0,'L',true); + $this->Cell(15,5,$hopform[$row['form']],0,0,'L',true); $this->Cell(30,5,sprintf("%10.1f gr",$stock),0,0,'R',true); $this->Cell(20,5,sprintf("%8.2f ",$row['cost']).EURO,0,0,'R',true); $this->Cell(20,5,sprintf("%8.2f ",$value).EURO,0,0,'R',true); @@ -223,6 +224,7 @@ } function TableMiscs($link,$prop) { + global $misctype; $this->AddCol( 30,'Type','L'); $this->AddCol( 90,'Ingredient','L'); $this->AddCol( 30,'Voorraad','R'); @@ -240,7 +242,6 @@ $result = mysqli_query($link, "SELECT name,type,amount_is_weight,inventory,cost FROM inventory_miscs WHERE inventory > 0 ORDER BY type,name"); $tot_miscs = 0.0; - $type = array( 'Specerij', 'Kruid', 'Smaakstof', 'Klaringsmiddel', 'Brouwzout', 'Gistvoeding', 'Anders' ); while($row=mysqli_fetch_array($result)) { $value = $row['inventory'] * $row['cost']; @@ -251,7 +252,7 @@ $this->SetX($this->TableX); $ci=$this->ColorIndex; $this->SetFillColor($this->RowColors[$ci][0],$this->RowColors[$ci][1],$this->RowColors[$ci][2]); - $this->Cell(30,5,$type[$row['type']],0,0,'L',true); + $this->Cell(30,5,$misctype[$row['type']],0,0,'L',true); $this->Cell(90,5,iconv('UTF-8','windows-1252',$row['name']),0,0,'L',true); $this->Cell(30,5,sprintf("%10.1f ",$stock).$amount,0,0,'R',true); $this->Cell(20,5,sprintf("%8.2f ",$row['cost']).EURO,0,0,'R',true); diff -r 217ba4596c4d -r 3c680d1dea35 www/js/global-min.js --- a/www/js/global-min.js Mon Oct 14 23:13:40 2019 +0200 +++ b/www/js/global-min.js Wed Oct 16 21:05:03 2019 +0200 @@ -1,1 +1,1 @@ -var StageData=[{id:0,en:"Plan",nl:"Plan"},{id:1,en:"Wait",nl:"Wacht"},{id:2,en:"Brew",nl:"Brouwen"},{id:3,en:"Primary",nl:"Hoofdgisting"},{id:4,en:"Secondary",nl:"Nagisting"},{id:5,en:"Tertiary",nl:"Lagering"},{id:6,en:"Package",nl:"Afvullen"},{id:7,en:"Carbonation",nl:"Hergisten"},{id:8,en:"Mature",nl:"Rijpen"},{id:9,en:"Taste",nl:"Proeven"},{id:10,en:"Ready",nl:"Gereed"},{id:11,en:"Closed",nl:"Afgesloten"}],StageSource={localdata:StageData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},StageAdapter=new $.jqx.dataAdapter(StageSource),SplitData=[{id:0,en:"Not divided",nl:"Niet gesplitst",ok:100},{id:1,en:"After mash",nl:"Na maischen",ok:2},{id:2,en:"After boil",nl:"Na koken",ok:2},{id:3,en:"After cooling",nl:"Na koelen",ok:2},{id:4,en:"After primary",nl:"Na hoofdgisting",ok:3},{id:5,en:"After secondary",nl:"Na nagisting",ok:4},{id:6,en:"After tertiary",nl:"Na lageren",ok:5}],SplitSource={localdata:SplitData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"ok"}]},SplitAdapter=new $.jqx.dataAdapter(SplitSource),MaterialData=[{id:0,en:"Stainless Steel",nl:"RVS",sh:0.11},{id:1,en:"Aluminium",nl:"Aluminium",sh:0.22},{id:2,en:"Plastics",nl:"Kunststof",sh:0.46},{id:3,en:"Copper",nl:"Koper",sh:0.092}],MaterialSource={localdata:MaterialData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"sh"}]},MaterialAdapter=new $.jqx.dataAdapter(MaterialSource),FermentableTypeData=[{id:0,en:"Grain",nl:"Mout"},{id:1,en:"Sugar",nl:"Suiker"},{id:2,en:"Extract",nl:"Vloeibaar extract"},{id:3,en:"Dry extract",nl:"Droog extract"},{id:4,en:"Adjunct",nl:"Ongemout graan"}],FermentableTypeSource={localdata:FermentableTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},FermentableTypeAdapter=new $.jqx.dataAdapter(FermentableTypeSource),GrainTypeData=[{id:0,en:"Base",nl:"Basismout"},{id:1,en:"Roast",nl:"Geroosterde mout"},{id:2,en:"Crystal",nl:"Cara- of crystalmout"},{id:3,en:"Kilned",nl:"Geëeste mout"},{id:4,en:"Sour malt",nl:"Zuurmout"},{id:5,en:"Special",nl:"Speciale mout"},{id:6,en:"No malt",nl:"Geen mout"}],GrainTypeSource={localdata:GrainTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},GrainTypeAdapter=new $.jqx.dataAdapter(GrainTypeSource),AddedData=[{id:0,en:"Mash",nl:"Maischen"},{id:1,en:"Boil",nl:"Koken"},{id:2,en:"Fermentation",nl:"Vergisten"},{id:3,en:"Lagering",nl:"Nagisten/lageren"},{id:4,en:"Bottle",nl:"Bottelen"},{id:5,en:"Kegs",nl:"Fust"}],AddedSource={localdata:AddedData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},AddedAdapter=new $.jqx.dataAdapter(AddedSource),HopTypeData=[{id:0,en:"Bittering",nl:"Bitterhop"},{id:1,en:"Aroma",nl:"Aromahop"},{id:2,en:"Both",nl:"Beide"}],HopTypeSource={localdata:HopTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},HopTypeAdapter=new $.jqx.dataAdapter(HopTypeSource),HopFormData=[{id:0,en:"Pellet",nl:"Pellets"},{id:1,en:"Plug",nl:"Plugs"},{id:2,en:"Leaf",nl:"Bloemen"},{id:3,en:"Leaf wet",nl:"Hop nat"},{id:4,en:"Cryo",nl:"Cryo"}],HopFormSource={localdata:HopFormData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},HopFormAdapter=new $.jqx.dataAdapter(HopFormSource),HopUseData=[{id:0,en:"Mash",nl:"Maischhop"},{id:1,en:"First wort",nl:"First wort hop"},{id:2,en:"Boil",nl:"Koken"},{id:3,en:"Aroma",nl:"Vlamuit"},{id:4,en:"Whirlpool",nl:"Whirlpool"},{id:5,en:"Dry hop",nl:"Koudhop"}],HopUseSource={localdata:HopUseData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},HopUseAdapter=new $.jqx.dataAdapter(HopUseSource),YeastTypeData=[{id:0,en:"Lager",nl:"Ondergist"},{id:1,en:"Ale",nl:"Bovengist"},{id:2,en:"Wheat",nl:"Tarwegist"},{id:3,en:"Wine",nl:"Wijngist"},{id:4,en:"Champagne",nl:"Champagnegist"},{id:5,en:"Brett",nl:"Brett"},{id:6,en:"Kveik",nl:"Kveik"},{id:7,en:"Hybrid",nl:"Hybride"}],YeastTypeSource={localdata:YeastTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},YeastTypeAdapter=new $.jqx.dataAdapter(YeastTypeSource),YeastFormData=[{id:0,en:"Liquid",nl:"Vloeibaar",cells:100000000000},{id:1,en:"Dry",nl:"Korrel",cells:15000000000},{id:2,en:"Slant",nl:"Schuine buis",cells:1700000000},{id:3,en:"Culture",nl:"Slurry",cells:1700000000},{id:4,en:"Frozen",nl:"Ingevroren",cells:1700000000},{id:5,en:"Bottle",nl:"Depot",cells:1700000000}],YeastFormSource={localdata:YeastFormData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"cells"}]},YeastFormAdapter=new $.jqx.dataAdapter(YeastFormSource),YeastUseData=[{id:0,en:"Primary",nl:"Hoofdgisting"},{id:1,en:"Secondary",nl:"Nagisting"},{id:2,en:"Tertiary",nl:"Lagering"},{id:3,en:"Bottle",nl:"Bottelen"}],YeastUseSource={localdata:YeastUseData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"cells"}]},YeastUseAdapter=new $.jqx.dataAdapter(YeastUseSource),FlocculationData=[{id:0,en:"Low",nl:"Laag"},{id:1,en:"Medium",nl:"Medium"},{id:2,en:"High",nl:"Hoog"},{id:3,en:"Very high",nl:"Zeer hoog"}],FlocculationSource={localdata:FlocculationData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},FlocculationAdapter=new $.jqx.dataAdapter(FlocculationSource),ZymocideData=[{id:0,en:"None",nl:"Niet"},{id:1,en:"K1",nl:"K1"},{id:2,en:"K2",nl:"K2"},{id:3,en:"K28",nl:"K28"},{id:4,en:"Klus",nl:"Klus"}],ZymocideSource={localdata:ZymocideData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},ZymocideAdapter=new $.jqx.dataAdapter(ZymocideSource),StarterTypeData=[{id:0,en:"Stirred",nl:"Geroerd"},{id:1,en:"Shaken",nl:"Geschud"},{id:2,en:"Simple",nl:"Simpel"}],StarterTypeSource={localdata:StarterTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},StarterTypeAdapter=new $.jqx.dataAdapter(StarterTypeSource),MiscTypeData=[{id:0,en:"Spice",nl:"Specerij"},{id:1,en:"Herb",nl:"Kruid"},{id:2,en:"Flavor",nl:"Smaakstof"},{id:3,en:"Fining",nl:"Klaringsmiddel"},{id:4,en:"Water agent",nl:"Brouwzout"},{id:5,en:"Yeast nutrient",nl:"Gistvoeding"},{id:6,en:"Other",nl:"Overig"}],MiscTypeSource={localdata:MiscTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},MiscTypeAdapter=new $.jqx.dataAdapter(MiscTypeSource),MiscUseData=[{id:0,en:"Starter",nl:"Starter"},{id:1,en:"Mash",nl:"Maischen"},{id:2,en:"Boil",nl:"Koken"},{id:3,en:"Primary",nl:"Hoofdvergisting"},{id:4,en:"Secondary",nl:"Nagisting/lagering"},{id:5,en:"Bottling",nl:"Bottelen"}],MiscUseSource={localdata:MiscUseData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},MiscUseAdapter=new $.jqx.dataAdapter(MiscUseSource),StyleTypeData=[{id:0,en:"Lager",nl:"Ondergistend bier"},{id:1,en:"Ale",nl:"Bovengistend bier"},{id:2,en:"Mead",nl:"Mede"},{id:3,en:"Wheat",nl:"Tarwebier"},{id:4,en:"Mixed",nl:"Gemengd"},{id:5,en:"Cider",nl:"Cider"}],StyleTypeSource={localdata:StyleTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},StyleTypeAdapter=new $.jqx.dataAdapter(StyleTypeSource),MashStepTypeData=[{id:0,en:"Infusion",nl:"Infusie"},{id:1,en:"Temperature",nl:"Verwarming"},{id:2,en:"Decoction",nl:"Decoctie"}],MashStepTypeSource={localdata:MashStepTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},MashStepTypeAdapter=new $.jqx.dataAdapter(MashStepTypeSource),RecipeTypeData=[{id:0,en:"Extract",nl:"Extract"},{id:1,en:"Partial Mash",nl:"Deelmaisch"},{id:2,en:"All Grain",nl:"Mout"}],RecipeTypeSource={localdata:RecipeTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},RecipeTypeAdapter=new $.jqx.dataAdapter(RecipeTypeSource),IBUmethodData=[{id:0,en:"Tinseth",nl:"Tinseth"},{id:1,en:"Rager",nl:"Rager"},{id:2,en:"Daniels",nl:"Daniels"}],IBUmethodSource={localdata:IBUmethodData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},IBUmethodAdapter=new $.jqx.dataAdapter(IBUmethodSource),ColorMethodData=[{id:0,en:"Morey",nl:"Morey"},{id:1,en:"Mosher",nl:"Mosher"},{id:2,en:"Daniels",nl:"Daniels"},{id:3,en:"Halberstadt",nl:"Halberstadt"},{id:4,en:"Naudts",nl:"Naudts"}],ColorMethodSource={localdata:ColorMethodData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},ColorMethodAdapter=new $.jqx.dataAdapter(ColorMethodSource),CoolingTypeData=[{id:0,en:"-",nl:"-"},{id:1,en:"Emersion chiller",nl:"Dompelkoeler"},{id:2,en:"Counterflow chiller",nl:"Tegenstroomkoeler"},{id:3,en:"Au bain marie",nl:"Au bain marie"},{id:4,en:"Natural",nl:"Laten afkoelen"}],CoolingTypeSource={localdata:CoolingTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},CoolingTypeAdapter=new $.jqx.dataAdapter(CoolingTypeSource),AerationTypeData=[{id:0,en:"None",nl:"Geen"},{id:1,en:"Air",nl:"Lucht"},{id:2,en:"Oxygen",nl:"Zuurstof"}],AerationTypeSource={localdata:AerationTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},AerationTypeAdapter=new $.jqx.dataAdapter(AerationTypeSource),AcidTypeData=[{id:0,en:"Lactic",nl:"Melkzuur"},{id:1,en:"Hydrochloric",nl:"Zoutzuur"},{id:2,en:"Phosphoric",nl:"Fosforzuur"},{id:3,en:"Sulfuric",nl:"Zwavelzuur"}],AcidTypeSource={localdata:AcidTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},AcidTypeAdapter=new $.jqx.dataAdapter(AcidTypeSource),BaseTypeData=[{id:0,en:"Sodiumbicarbonate",nl:"NaHCO3"},{id:1,en:"Sodiumcarbonate",nl:"Na2CO3"},{id:2,en:"Calciumcarbonate",nl:"CaCO3"},{id:3,en:"Calciumhydroxide",nl:"Ca(OH)2"}],BaseTypeSource={localdata:BaseTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},BaseTypeAdapter=new $.jqx.dataAdapter(BaseTypeSource),SpargeSourceData=[{id:0,en:"Source 1",nl:"Bron 1"},{id:1,en:"Source 2",nl:"Bron 2"},{id:2,en:"Mixed",nl:"Gemengd"}],SpargeSourceSource={localdata:SpargeSourceData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},SpargeSourceAdapter=new $.jqx.dataAdapter(SpargeSourceSource),Show1wat={inputMode:"simple",theme:theme,width:74,height:23,decimalDigits:1,readOnly:true},Show2wat={inputMode:"simple",theme:theme,width:74,height:23,decimalDigits:2,readOnly:true},Show3wat={inputMode:"simple",theme:theme,width:74,height:23,decimalDigits:3,readOnly:true},Smal0dec={inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:0,readOnly:true},Smal1dec={inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:1,readOnly:true},Show0dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:0},Show1dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:1},Show2dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:2},Show3dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:3},SGopts={inputMode:"simple",theme:theme,width:110,height:23,min:0.99,max:1.199,decimalDigits:3,spinButtons:true},Spin1dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:1,spinButtons:true},Spin2dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:2,spinButtons:true},Spin3dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:3,spinButtons:true},SpinpH={inputMode:"simple",theme:theme,width:110,height:23,min:1,max:14,decimalDigits:1,spinButtons:true},Spin2pH={inputMode:"simple",theme:theme,width:110,height:23,min:1,max:14,decimalDigits:2,spinButtons:true},YeastT={inputMode:"simple",theme:theme,width:110,height:23,min:0,max:50,decimalDigits:1,spinButtons:true},PosInt={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:0,spinButtons:true},Perc1dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,max:100,decimalDigits:1,spinButtons:true},Perc0={inputMode:"simple",theme:theme,width:110,height:23,min:0,max:100,decimalDigits:0,spinButtons:true},Dateopts={theme:theme,width:150,height:23,allowNullDate:true,todayString:"Vandaag",clearString:"Wissen",showFooter:true,formatString:"yyyy-MM-dd",enableBrowserBoundsDetection:true},DateTimeopts={theme:theme,width:230,height:23,allowNullDate:true,todayString:"Vandaag",clearString:"Wissen",showFooter:true,formatString:"yyyy-MM-dd HH:mm:ss",enableBrowserBoundsDetection:true,showTimeButton:true},sugardensity=1.611,stylesSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"category",type:"string"},{name:"category_number",type:"number"},{name:"style_letter",type:"string"},{name:"style_guide",type:"string"},{name:"type",type:"int"},{name:"og_min",type:"float"},{name:"og_max",type:"float"},{name:"fg_min",type:"float"},{name:"fg_max",type:"float"},{name:"ibu_min",type:"float"},{name:"ibu_max",type:"float"},{name:"color_min",type:"float"},{name:"color_max",type:"float"},{name:"carb_min",type:"float"},{name:"carb_max",type:"float"},{name:"abv_min",type:"float"},{name:"abv_max",type:"float"},{name:"notes",type:"string"},{name:"profile",type:"string"},{name:"ingredients",type:"string"},{name:"examples",type:"string"}],url:"includes/db_profile_styles.php"},styleslist=new $.jqx.dataAdapter(stylesSource),equipmentSource={datatype:"json",datafields:[{name:"name",type:"string"},{name:"boil_size",type:"float"},{name:"batch_size",type:"float"},{name:"tun_volume",type:"float"},{name:"tun_weight",type:"float"},{name:"tun_specific_heat",type:"float"},{name:"tun_material",type:"int"},{name:"tun_height",type:"float"},{name:"top_up_water",type:"float"},{name:"trub_chiller_loss",type:"float"},{name:"evap_rate",type:"float"},{name:"boil_time",type:"float"},{name:"calc_boil_volume",type:"int"},{name:"top_up_kettle",type:"float"},{name:"hop_utilization",type:"float"},{name:"notes",type:"string"},{name:"lauter_volume",type:"float"},{name:"lauter_height",type:"float"},{name:"lauter_deadspace",type:"float"},{name:"kettle_volume",type:"float"},{name:"kettle_height",type:"float"},{name:"mash_volume",type:"float"},{name:"mash_max",type:"float"},{name:"efficiency",type:"float"}],url:"includes/db_inventory_equipments.php"},equipmentlist=new $.jqx.dataAdapter(equipmentSource),fermentableInvSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"int"},{name:"yield",type:"float"},{name:"color",type:"float"},{name:"add_after_boil",type:"int"},{name:"origin",type:"string"},{name:"supplier",type:"string"},{name:"coarse_fine_diff",type:"float"},{name:"moisture",type:"float"},{name:"diastatic_power",type:"float"},{name:"protein",type:"float"},{name:"dissolved_protein",type:"float"},{name:"max_in_batch",type:"float"},{name:"recommend_mash",type:"int"},{name:"graintype",type:"int"},{name:"di_ph",type:"float"},{name:"acid_to_ph_57",type:"float"},{name:"inventory",type:"float"},{name:"cost",type:"float"}],url:"getfermentablesources.php"},fermentableinstock=false,fermentablelist=new $.jqx.dataAdapter(fermentableInvSource,{beforeLoadComplete:function(a){var d,b,c=new Array();for(b=0;b299){c=299}e=[250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,249,248,247,246,245,244,243,242,241,240,239,238,237,236,235,234,233,232,231,230,229,228,227,226,225,224,223,222,221,220,219,218,217,216,215,214,213,212,211,210,209,208,207,206,205,204,203,202,201,200,200,199,199,198,198,197,197,196,196,195,195,194,194,193,193,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,191,190,189,188,187,186,185,184,183,182,181,180,179,178,177,175,174,172,171,169,168,167,195,164,162,161,159,158,157,155,154,152,151,149,148,147,145,144,142,141,139,138,137,135,134,132,131,129,128,127,125,124,122,121,119,118,117,115,114,112,111,109,108,107,105,104,102,101,99,98,97,95,94,92,91,89,88,87,85,84,82,81,79,78,77,75,74,72,71,69,68,67,65,64,62,61,59,58,57,55,54,52,51,49,48,47,45,44,43,41,39,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8];d=[250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,249,248,247,246,245,244,242,240,238,236,234,232,230,228,226,224,222,220,218,216,214,212,210,208,206,204,202,200,198,196,194,192,190,188,186,184,182,180,178,176,174,172,170,168,166,164,162,160,158,156,154,152,150,148,146,144,142,141,140,139,139,138,137,136,136,135,134,133,133,132,131,130,130,129,128,127,127,126,125,124,124,123,122,121,121,120,119,118,118,117,116,115,115,114,113,112,112,111,110,109,109,108,107,106,106,105,104,103,103,102,101,100,100,99,98,97,97,96,95,94,94,93,92,91,91,90,89,88,88,87,86,85,85,84,83,82,82,81,80,79,78,77,76,75,75,74,73,72,72,71,70,69,69,68,67,66,66,65,64,63,63,62,61,60,60,59,58,57,57,56,55,54,54,53,52,51,51,50,49,48,48,47,46,45,45,44,43,42,42,41,40,39,39,38,37,36,36,35,34,33,33,32,31,30,30,29,28,27,27,26,25,24,24,23,22,22,22,21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,16,16,16,15,15,15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9,9,9,8,8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3];f=[210,204,199,193,188,182,177,171,166,160,155,149,144,138,133,127,122,116,111,105,100,94,89,83,78,72,67,61,56,50,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,55,55,55,55,54,54,54,54,53,53,53,53,52,52,52,52,51,51,51,51,50,50,50,50,49,49,48,47,47,46,45,45,44,43,43,42,41,41,40,39,39,38,37,37,36,35,34,33,32,31,29,28,27,26,25,24,23,21,20,19,18,17,16,15,13,12,11,10,9,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,17,16,16,15,15,15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9,9,9,8,8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3,2,2,2];b=e[c]*65536+d[c]*256+f[c];a=b.toString(16).toUpperCase();if(a.length<6){a="0"+a}return"#"+a}function sg_to_plato(a){return((135.997*a-630.272)*a+1111.14)*a-616.868}function plato_to_sg(a){return 1+(a/(258.6-((a/258.2)*227.1)))}function brix_to_sg(a){if(my_brix_correction>0){return plato_to_sg(a/my_brix_correction)}else{return plato_to_sg(a)}}function sg_to_brix(a){return sg_to_plato(a)*my_brix_correction}function estimate_sg(c,e){var a,d,b;a=100*c/e;d=plato_to_sg(a);for(b=0;b<20;b++){if(d>0){a=100*c/(e*d)}d=plato_to_sg(a)}return Round(d,4)}function estimate_fg(f,i,e,h,c,g,j){var b,d,a;if(f>40){f=0}if(i>50){i=0}if((e>0)&&(h>0)){b=e;if(b<2){b=2}if(b>5.5){b=5.5}if(c<60){c=60}if(c>72){c=72}}else{b=3.5;c=67;h=75}if(g<30){g=77}d=0.00825*g+0.00817*b-0.00684*c+0.00026*h-0.00356*i+0.00553*f+0.547;a=Round(1+(1-d)*(j-1),4);return a}function CalcFrac(f,e,d,b){var g,a,i,k,h,c,j;g=Math.pow(10,f-e);a=Math.pow(10,f-d);i=Math.pow(10,f-b);k=1/(1+g+g*a+g*a*i);h=g*k;c=g*a*k;j=g*a*i*k;return h+2*c+3*j}function lintner_to_kolbach(a){return(3.5*a)-16}function kolbach_to_lintner(a){return(a+16)/3.5}; \ No newline at end of file +var StageData=[{id:0,en:"Plan",nl:"Plan"},{id:1,en:"Wait",nl:"Wacht"},{id:2,en:"Brew",nl:"Brouwen"},{id:3,en:"Primary",nl:"Hoofdgisting"},{id:4,en:"Secondary",nl:"Nagisting"},{id:5,en:"Tertiary",nl:"Lagering"},{id:6,en:"Package",nl:"Afvullen"},{id:7,en:"Carbonation",nl:"Hergisten"},{id:8,en:"Mature",nl:"Rijpen"},{id:9,en:"Taste",nl:"Proeven"},{id:10,en:"Ready",nl:"Gereed"},{id:11,en:"Closed",nl:"Afgesloten"}],StageSource={localdata:StageData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},StageAdapter=new $.jqx.dataAdapter(StageSource),SplitData=[{id:0,en:"Not divided",nl:"Niet gesplitst",ok:100},{id:1,en:"After mash",nl:"Na maischen",ok:2},{id:2,en:"After boil",nl:"Na koken",ok:2},{id:3,en:"After cooling",nl:"Na koelen",ok:2},{id:4,en:"After primary",nl:"Na hoofdgisting",ok:3},{id:5,en:"After secondary",nl:"Na nagisting",ok:4},{id:6,en:"After tertiary",nl:"Na lageren",ok:5}],SplitSource={localdata:SplitData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"ok"}]},SplitAdapter=new $.jqx.dataAdapter(SplitSource),MaterialData=[{id:0,en:"Stainless Steel",nl:"RVS",sh:0.11},{id:1,en:"Aluminium",nl:"Aluminium",sh:0.22},{id:2,en:"Plastics",nl:"Kunststof",sh:0.46},{id:3,en:"Copper",nl:"Koper",sh:0.092}],MaterialSource={localdata:MaterialData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"sh"}]},MaterialAdapter=new $.jqx.dataAdapter(MaterialSource),FermentableTypeData=[{id:0,en:"Grain",nl:"Mout"},{id:1,en:"Sugar",nl:"Suiker"},{id:2,en:"Extract",nl:"Vloeibaar extract"},{id:3,en:"Dry extract",nl:"Droog extract"},{id:4,en:"Adjunct",nl:"Ongemout graan"}],FermentableTypeSource={localdata:FermentableTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},FermentableTypeAdapter=new $.jqx.dataAdapter(FermentableTypeSource),GrainTypeData=[{id:0,en:"Base",nl:"Basismout"},{id:1,en:"Roast",nl:"Geroosterde mout"},{id:2,en:"Crystal",nl:"Cara- of crystalmout"},{id:3,en:"Kilned",nl:"Geëeste mout"},{id:4,en:"Sour malt",nl:"Zuurmout"},{id:5,en:"Special",nl:"Speciale mout"},{id:6,en:"No malt",nl:"Geen mout"}],GrainTypeSource={localdata:GrainTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},GrainTypeAdapter=new $.jqx.dataAdapter(GrainTypeSource),AddedData=[{id:0,en:"Mash",nl:"Maischen"},{id:1,en:"Boil",nl:"Koken"},{id:2,en:"Fermentation",nl:"Vergisten"},{id:3,en:"Lagering",nl:"Nagisten/lageren"},{id:4,en:"Bottle",nl:"Bottelen"},{id:5,en:"Kegs",nl:"Fust"}],AddedSource={localdata:AddedData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},AddedAdapter=new $.jqx.dataAdapter(AddedSource),HopTypeData=[{id:0,en:"Bittering",nl:"Bitterhop"},{id:1,en:"Aroma",nl:"Aromahop"},{id:2,en:"Both",nl:"Beide"}],HopTypeSource={localdata:HopTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},HopTypeAdapter=new $.jqx.dataAdapter(HopTypeSource),HopFormData=[{id:0,en:"Pellet",nl:"Pellets"},{id:1,en:"Plug",nl:"Plugs"},{id:2,en:"Leaf",nl:"Bloemen"},{id:3,en:"Leaf wet",nl:"Hop nat"},{id:4,en:"Cryo",nl:"Cryo"}],HopFormSource={localdata:HopFormData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},HopFormAdapter=new $.jqx.dataAdapter(HopFormSource),HopUseData=[{id:0,en:"Mash",nl:"Maischhop"},{id:1,en:"First wort",nl:"First wort hop"},{id:2,en:"Boil",nl:"Koken"},{id:3,en:"Aroma",nl:"Vlamuit"},{id:4,en:"Whirlpool",nl:"Whirlpool"},{id:5,en:"Dry hop",nl:"Koudhop"}],HopUseSource={localdata:HopUseData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},HopUseAdapter=new $.jqx.dataAdapter(HopUseSource),YeastTypeData=[{id:0,en:"Lager",nl:"Ondergist"},{id:1,en:"Ale",nl:"Bovengist"},{id:2,en:"Wheat",nl:"Tarwegist"},{id:3,en:"Wine",nl:"Wijngist"},{id:4,en:"Champagne",nl:"Champagnegist"},{id:5,en:"Brett",nl:"Brett"},{id:6,en:"Kveik",nl:"Kveik"},{id:7,en:"Hybrid",nl:"Hybride"}],YeastTypeSource={localdata:YeastTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},YeastTypeAdapter=new $.jqx.dataAdapter(YeastTypeSource),YeastFormData=[{id:0,en:"Liquid",nl:"Vloeibaar",cells:100000000000},{id:1,en:"Dry",nl:"Droog",cells:15000000000},{id:2,en:"Slant",nl:"Schuine buis",cells:1700000000},{id:3,en:"Culture",nl:"Slurry",cells:1700000000},{id:4,en:"Frozen",nl:"Ingevroren",cells:1700000000},{id:5,en:"Bottle",nl:"Depot",cells:1700000000}],YeastFormSource={localdata:YeastFormData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"cells"}]},YeastFormAdapter=new $.jqx.dataAdapter(YeastFormSource),YeastUseData=[{id:0,en:"Primary",nl:"Hoofdgisting"},{id:1,en:"Secondary",nl:"Nagisting"},{id:2,en:"Tertiary",nl:"Lagering"},{id:3,en:"Bottle",nl:"Bottelen"}],YeastUseSource={localdata:YeastUseData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"cells"}]},YeastUseAdapter=new $.jqx.dataAdapter(YeastUseSource),FlocculationData=[{id:0,en:"Low",nl:"Laag"},{id:1,en:"Medium",nl:"Medium"},{id:2,en:"High",nl:"Hoog"},{id:3,en:"Very high",nl:"Zeer hoog"}],FlocculationSource={localdata:FlocculationData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},FlocculationAdapter=new $.jqx.dataAdapter(FlocculationSource),ZymocideData=[{id:0,en:"None",nl:"Niet"},{id:1,en:"K1",nl:"K1"},{id:2,en:"K2",nl:"K2"},{id:3,en:"K28",nl:"K28"},{id:4,en:"Klus",nl:"Klus"}],ZymocideSource={localdata:ZymocideData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},ZymocideAdapter=new $.jqx.dataAdapter(ZymocideSource),StarterTypeData=[{id:0,en:"Stirred",nl:"Geroerd"},{id:1,en:"Shaken",nl:"Geschud"},{id:2,en:"Simple",nl:"Simpel"}],StarterTypeSource={localdata:StarterTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},StarterTypeAdapter=new $.jqx.dataAdapter(StarterTypeSource),MiscTypeData=[{id:0,en:"Spice",nl:"Specerij"},{id:1,en:"Herb",nl:"Kruid"},{id:2,en:"Flavor",nl:"Smaakstof"},{id:3,en:"Fining",nl:"Klaringsmiddel"},{id:4,en:"Water agent",nl:"Brouwzout"},{id:5,en:"Yeast nutrient",nl:"Gistvoeding"},{id:6,en:"Other",nl:"Overig"}],MiscTypeSource={localdata:MiscTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},MiscTypeAdapter=new $.jqx.dataAdapter(MiscTypeSource),MiscUseData=[{id:0,en:"Starter",nl:"Starter"},{id:1,en:"Mash",nl:"Maischen"},{id:2,en:"Boil",nl:"Koken"},{id:3,en:"Primary",nl:"Hoofdvergisting"},{id:4,en:"Secondary",nl:"Nagisting/lagering"},{id:5,en:"Bottling",nl:"Bottelen"}],MiscUseSource={localdata:MiscUseData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},MiscUseAdapter=new $.jqx.dataAdapter(MiscUseSource),StyleTypeData=[{id:0,en:"Lager",nl:"Ondergistend bier"},{id:1,en:"Ale",nl:"Bovengistend bier"},{id:2,en:"Mead",nl:"Mede"},{id:3,en:"Wheat",nl:"Tarwebier"},{id:4,en:"Mixed",nl:"Gemengd"},{id:5,en:"Cider",nl:"Cider"}],StyleTypeSource={localdata:StyleTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},StyleTypeAdapter=new $.jqx.dataAdapter(StyleTypeSource),MashStepTypeData=[{id:0,en:"Infusion",nl:"Infusie"},{id:1,en:"Temperature",nl:"Verwarming"},{id:2,en:"Decoction",nl:"Decoctie"}],MashStepTypeSource={localdata:MashStepTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},MashStepTypeAdapter=new $.jqx.dataAdapter(MashStepTypeSource),RecipeTypeData=[{id:0,en:"Extract",nl:"Extract"},{id:1,en:"Partial Mash",nl:"Deelmaisch"},{id:2,en:"All Grain",nl:"Mout"}],RecipeTypeSource={localdata:RecipeTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},RecipeTypeAdapter=new $.jqx.dataAdapter(RecipeTypeSource),IBUmethodData=[{id:0,en:"Tinseth",nl:"Tinseth"},{id:1,en:"Rager",nl:"Rager"},{id:2,en:"Daniels",nl:"Daniels"}],IBUmethodSource={localdata:IBUmethodData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},IBUmethodAdapter=new $.jqx.dataAdapter(IBUmethodSource),ColorMethodData=[{id:0,en:"Morey",nl:"Morey"},{id:1,en:"Mosher",nl:"Mosher"},{id:2,en:"Daniels",nl:"Daniels"},{id:3,en:"Halberstadt",nl:"Halberstadt"},{id:4,en:"Naudts",nl:"Naudts"}],ColorMethodSource={localdata:ColorMethodData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},ColorMethodAdapter=new $.jqx.dataAdapter(ColorMethodSource),CoolingTypeData=[{id:0,en:"-",nl:"-"},{id:1,en:"Emersion chiller",nl:"Dompelkoeler"},{id:2,en:"Counterflow chiller",nl:"Tegenstroomkoeler"},{id:3,en:"Au bain marie",nl:"Au bain marie"},{id:4,en:"Natural",nl:"Laten afkoelen"}],CoolingTypeSource={localdata:CoolingTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},CoolingTypeAdapter=new $.jqx.dataAdapter(CoolingTypeSource),AerationTypeData=[{id:0,en:"None",nl:"Geen"},{id:1,en:"Air",nl:"Lucht"},{id:2,en:"Oxygen",nl:"Zuurstof"}],AerationTypeSource={localdata:AerationTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},AerationTypeAdapter=new $.jqx.dataAdapter(AerationTypeSource),AcidTypeData=[{id:0,en:"Lactic",nl:"Melkzuur"},{id:1,en:"Hydrochloric",nl:"Zoutzuur"},{id:2,en:"Phosphoric",nl:"Fosforzuur"},{id:3,en:"Sulfuric",nl:"Zwavelzuur"}],AcidTypeSource={localdata:AcidTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},AcidTypeAdapter=new $.jqx.dataAdapter(AcidTypeSource),BaseTypeData=[{id:0,en:"Sodiumbicarbonate",nl:"NaHCO3"},{id:1,en:"Sodiumcarbonate",nl:"Na2CO3"},{id:2,en:"Calciumcarbonate",nl:"CaCO3"},{id:3,en:"Calciumhydroxide",nl:"Ca(OH)2"}],BaseTypeSource={localdata:BaseTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},BaseTypeAdapter=new $.jqx.dataAdapter(BaseTypeSource),SpargeSourceData=[{id:0,en:"Source 1",nl:"Bron 1"},{id:1,en:"Source 2",nl:"Bron 2"},{id:2,en:"Mixed",nl:"Gemengd"}],SpargeSourceSource={localdata:SpargeSourceData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},SpargeSourceAdapter=new $.jqx.dataAdapter(SpargeSourceSource),Show1wat={inputMode:"simple",theme:theme,width:74,height:23,decimalDigits:1,readOnly:true},Show2wat={inputMode:"simple",theme:theme,width:74,height:23,decimalDigits:2,readOnly:true},Show3wat={inputMode:"simple",theme:theme,width:74,height:23,decimalDigits:3,readOnly:true},Smal0dec={inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:0,readOnly:true},Smal1dec={inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:1,readOnly:true},Show0dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:0},Show1dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:1},Show2dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:2},Show3dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:3},SGopts={inputMode:"simple",theme:theme,width:110,height:23,min:0.99,max:1.199,decimalDigits:3,spinButtons:true},Spin1dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:1,spinButtons:true},Spin2dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:2,spinButtons:true},Spin3dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:3,spinButtons:true},SpinpH={inputMode:"simple",theme:theme,width:110,height:23,min:1,max:14,decimalDigits:1,spinButtons:true},Spin2pH={inputMode:"simple",theme:theme,width:110,height:23,min:1,max:14,decimalDigits:2,spinButtons:true},YeastT={inputMode:"simple",theme:theme,width:110,height:23,min:0,max:50,decimalDigits:1,spinButtons:true},PosInt={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:0,spinButtons:true},Perc1dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,max:100,decimalDigits:1,spinButtons:true},Perc0={inputMode:"simple",theme:theme,width:110,height:23,min:0,max:100,decimalDigits:0,spinButtons:true},Dateopts={theme:theme,width:150,height:23,allowNullDate:true,todayString:"Vandaag",clearString:"Wissen",showFooter:true,formatString:"yyyy-MM-dd",enableBrowserBoundsDetection:true},DateTimeopts={theme:theme,width:230,height:23,allowNullDate:true,todayString:"Vandaag",clearString:"Wissen",showFooter:true,formatString:"yyyy-MM-dd HH:mm:ss",enableBrowserBoundsDetection:true,showTimeButton:true},sugardensity=1.611,stylesSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"category",type:"string"},{name:"category_number",type:"number"},{name:"style_letter",type:"string"},{name:"style_guide",type:"string"},{name:"type",type:"int"},{name:"og_min",type:"float"},{name:"og_max",type:"float"},{name:"fg_min",type:"float"},{name:"fg_max",type:"float"},{name:"ibu_min",type:"float"},{name:"ibu_max",type:"float"},{name:"color_min",type:"float"},{name:"color_max",type:"float"},{name:"carb_min",type:"float"},{name:"carb_max",type:"float"},{name:"abv_min",type:"float"},{name:"abv_max",type:"float"},{name:"notes",type:"string"},{name:"profile",type:"string"},{name:"ingredients",type:"string"},{name:"examples",type:"string"}],url:"includes/db_profile_styles.php"},styleslist=new $.jqx.dataAdapter(stylesSource),equipmentSource={datatype:"json",datafields:[{name:"name",type:"string"},{name:"boil_size",type:"float"},{name:"batch_size",type:"float"},{name:"tun_volume",type:"float"},{name:"tun_weight",type:"float"},{name:"tun_specific_heat",type:"float"},{name:"tun_material",type:"int"},{name:"tun_height",type:"float"},{name:"top_up_water",type:"float"},{name:"trub_chiller_loss",type:"float"},{name:"evap_rate",type:"float"},{name:"boil_time",type:"float"},{name:"calc_boil_volume",type:"int"},{name:"top_up_kettle",type:"float"},{name:"hop_utilization",type:"float"},{name:"notes",type:"string"},{name:"lauter_volume",type:"float"},{name:"lauter_height",type:"float"},{name:"lauter_deadspace",type:"float"},{name:"kettle_volume",type:"float"},{name:"kettle_height",type:"float"},{name:"mash_volume",type:"float"},{name:"mash_max",type:"float"},{name:"efficiency",type:"float"}],url:"includes/db_inventory_equipments.php"},equipmentlist=new $.jqx.dataAdapter(equipmentSource),fermentableInvSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"int"},{name:"yield",type:"float"},{name:"color",type:"float"},{name:"add_after_boil",type:"int"},{name:"origin",type:"string"},{name:"supplier",type:"string"},{name:"coarse_fine_diff",type:"float"},{name:"moisture",type:"float"},{name:"diastatic_power",type:"float"},{name:"protein",type:"float"},{name:"dissolved_protein",type:"float"},{name:"max_in_batch",type:"float"},{name:"recommend_mash",type:"int"},{name:"graintype",type:"int"},{name:"di_ph",type:"float"},{name:"acid_to_ph_57",type:"float"},{name:"inventory",type:"float"},{name:"cost",type:"float"}],url:"getfermentablesources.php"},fermentableinstock=false,fermentablelist=new $.jqx.dataAdapter(fermentableInvSource,{beforeLoadComplete:function(a){var d,b,c=new Array();for(b=0;b299){c=299}e=[250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,249,248,247,246,245,244,243,242,241,240,239,238,237,236,235,234,233,232,231,230,229,228,227,226,225,224,223,222,221,220,219,218,217,216,215,214,213,212,211,210,209,208,207,206,205,204,203,202,201,200,200,199,199,198,198,197,197,196,196,195,195,194,194,193,193,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,191,190,189,188,187,186,185,184,183,182,181,180,179,178,177,175,174,172,171,169,168,167,195,164,162,161,159,158,157,155,154,152,151,149,148,147,145,144,142,141,139,138,137,135,134,132,131,129,128,127,125,124,122,121,119,118,117,115,114,112,111,109,108,107,105,104,102,101,99,98,97,95,94,92,91,89,88,87,85,84,82,81,79,78,77,75,74,72,71,69,68,67,65,64,62,61,59,58,57,55,54,52,51,49,48,47,45,44,43,41,39,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8];d=[250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,249,248,247,246,245,244,242,240,238,236,234,232,230,228,226,224,222,220,218,216,214,212,210,208,206,204,202,200,198,196,194,192,190,188,186,184,182,180,178,176,174,172,170,168,166,164,162,160,158,156,154,152,150,148,146,144,142,141,140,139,139,138,137,136,136,135,134,133,133,132,131,130,130,129,128,127,127,126,125,124,124,123,122,121,121,120,119,118,118,117,116,115,115,114,113,112,112,111,110,109,109,108,107,106,106,105,104,103,103,102,101,100,100,99,98,97,97,96,95,94,94,93,92,91,91,90,89,88,88,87,86,85,85,84,83,82,82,81,80,79,78,77,76,75,75,74,73,72,72,71,70,69,69,68,67,66,66,65,64,63,63,62,61,60,60,59,58,57,57,56,55,54,54,53,52,51,51,50,49,48,48,47,46,45,45,44,43,42,42,41,40,39,39,38,37,36,36,35,34,33,33,32,31,30,30,29,28,27,27,26,25,24,24,23,22,22,22,21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,16,16,16,15,15,15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9,9,9,8,8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3];f=[210,204,199,193,188,182,177,171,166,160,155,149,144,138,133,127,122,116,111,105,100,94,89,83,78,72,67,61,56,50,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,55,55,55,55,54,54,54,54,53,53,53,53,52,52,52,52,51,51,51,51,50,50,50,50,49,49,48,47,47,46,45,45,44,43,43,42,41,41,40,39,39,38,37,37,36,35,34,33,32,31,29,28,27,26,25,24,23,21,20,19,18,17,16,15,13,12,11,10,9,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,17,16,16,15,15,15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9,9,9,8,8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3,2,2,2];b=e[c]*65536+d[c]*256+f[c];a=b.toString(16).toUpperCase();if(a.length<6){a="0"+a}return"#"+a}function sg_to_plato(a){return((135.997*a-630.272)*a+1111.14)*a-616.868}function plato_to_sg(a){return 1+(a/(258.6-((a/258.2)*227.1)))}function brix_to_sg(a){if(my_brix_correction>0){return plato_to_sg(a/my_brix_correction)}else{return plato_to_sg(a)}}function sg_to_brix(a){return sg_to_plato(a)*my_brix_correction}function estimate_sg(c,e){var a,d,b;a=100*c/e;d=plato_to_sg(a);for(b=0;b<20;b++){if(d>0){a=100*c/(e*d)}d=plato_to_sg(a)}return Round(d,4)}function estimate_fg(f,i,e,h,c,g,j){var b,d,a;if(f>40){f=0}if(i>50){i=0}if((e>0)&&(h>0)){b=e;if(b<2){b=2}if(b>5.5){b=5.5}if(c<60){c=60}if(c>72){c=72}}else{b=3.5;c=67;h=75}if(g<30){g=77}d=0.00825*g+0.00817*b-0.00684*c+0.00026*h-0.00356*i+0.00553*f+0.547;a=Round(1+(1-d)*(j-1),4);return a}function CalcFrac(f,e,d,b){var g,a,i,k,h,c,j;g=Math.pow(10,f-e);a=Math.pow(10,f-d);i=Math.pow(10,f-b);k=1/(1+g+g*a+g*a*i);h=g*k;c=g*a*k;j=g*a*i*k;return h+2*c+3*j}function lintner_to_kolbach(a){return(3.5*a)-16}function kolbach_to_lintner(a){return(a+16)/3.5}; \ No newline at end of file diff -r 217ba4596c4d -r 3c680d1dea35 www/js/global.js --- a/www/js/global.js Mon Oct 14 23:13:40 2019 +0200 +++ b/www/js/global.js Wed Oct 16 21:05:03 2019 +0200 @@ -146,7 +146,7 @@ HopUseData = [ { id: 0, en: 'Mash', nl: 'Maischhop' }, - { id: 1, en: 'First wort', nl: 'First wort hop' }, + { id: 1, en: 'First wort', nl: 'First wort' }, { id: 2, en: 'Boil', nl: 'Koken' }, { id: 3, en: 'Aroma', nl: 'Vlamuit' }, { id: 4, en: 'Whirlpool', nl: 'Whirlpool' }, @@ -181,7 +181,7 @@ YeastFormData = [ { id: 0, en: 'Liquid', nl: 'Vloeibaar', cells: 100000000000 }, - { id: 1, en: 'Dry', nl: 'Korrel', cells: 15000000000 }, + { id: 1, en: 'Dry', nl: 'Droog', cells: 15000000000 }, { id: 2, en: 'Slant', nl: 'Schuine buis', cells: 1700000000 }, { id: 3, en: 'Culture', nl: 'Slurry', cells: 1700000000 }, { id: 4, en: 'Frozen', nl: 'Ingevroren', cells: 1700000000 }, @@ -253,7 +253,7 @@ { id: 3, en: 'Fining', nl: 'Klaringsmiddel' }, { id: 4, en: 'Water agent', nl: 'Brouwzout' }, { id: 5, en: 'Yeast nutrient', nl: 'Gistvoeding' }, - { id: 6, en: 'Other', nl: 'Overig' } + { id: 6, en: 'Other', nl: 'Anders' } ], MiscTypeSource = { localdata: MiscTypeData, diff -r 217ba4596c4d -r 3c680d1dea35 www/js/inv_fermentables-min.js --- a/www/js/inv_fermentables-min.js Mon Oct 14 23:13:40 2019 +0200 +++ b/www/js/inv_fermentables-min.js Wed Oct 16 21:05:03 2019 +0200 @@ -1,1 +1,1 @@ -function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){function d(h,g){$("#totval").val(h*g)}var b={},a="includes/db_inventory_fermentables.php",e={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"int"},{name:"yield",type:"float"},{name:"color",type:"float"},{name:"add_after_boil",type:"int"},{name:"origin",type:"string"},{name:"supplier",type:"string"},{name:"notes",type:"string"},{name:"coarse_fine_diff",type:"float"},{name:"moisture",type:"float"},{name:"diastatic_power",type:"float"},{name:"protein",type:"float"},{name:"dissolved_protein",type:"float"},{name:"max_in_batch",type:"float"},{name:"recommend_mash",type:"int"},{name:"added",type:"int"},{name:"always_on_stock",type:"int"},{name:"di_ph",type:"float"},{name:"acid_to_ph_57",type:"float"},{name:"graintype",type:"int"},{name:"inventory",type:"float"},{name:"cost",type:"float"},{name:"production_date",type:"string"},{name:"tht_date",type:"string"}],id:"record",url:a,deleterow:function(g,i){var h="delete=true&"+$.param({record:g});$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(k,j,l){i(true);location.reload(true)},error:function(j,l,k){i(false)}})},addrow:function(h,k,g,j){var i="insert=true&"+$.param(k);$.ajax({dataType:"json",url:a,cache:false,data:i,type:"POST",success:function(m,l,n){j(true);location.reload(true)},error:function(l,n,m){j(false)}})},updaterow:function(g,j,i){var h="update=true&"+$.param(j);$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(l,k,m){i(true);location.reload(true)},error:function(k,m,l){i(false)}})}},f=new $.jqx.dataAdapter(e),c=-1;$("#name").jqxInput({theme:theme,width:640,height:23});$("#type").jqxDropDownList({theme:theme,source:FermentableTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#yield").jqxNumberInput(Spin1dec);$("#color").jqxNumberInput(Spin1dec);$("#add_after_boil").jqxCheckBox({theme:theme,width:120,height:23});$("#origin").jqxInput({theme:theme,width:250,height:23});$("#supplier").jqxInput({theme:theme,width:250,height:23});$("#notes").jqxInput({theme:theme,width:640,height:100});$("#coarse_fine_diff").jqxNumberInput(Spin1dec);$("#moisture").jqxNumberInput(Spin1dec);$("#diastatic_power").jqxNumberInput(PosInt);$("#protein").jqxNumberInput(Spin1dec);$("#dissolved_protein").jqxNumberInput(Spin1dec);$("#max_in_batch").jqxNumberInput(Perc1dec);$("#recommend_mash").jqxCheckBox({theme:theme,width:120,height:23});$("#added").jqxDropDownList({theme:theme,source:AddedAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#always_on_stock").jqxCheckBox({theme:theme,width:120,height:23});$("#di_ph").jqxNumberInput(Spin2pH);$("#acid_to_ph_57").jqxNumberInput({inputMode:"simple",theme:theme,width:110,height:23,min:-1000,max:1000,decimalDigits:4,spinButtons:true});$("#graintype").jqxDropDownList({theme:theme,source:GrainTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#inventory").jqxNumberInput(Spin3dec);$("#production_date").jqxDateTimeInput(Dateopts);$("#cost").jqxNumberInput(Spin2dec);$("#tht_date").jqxDateTimeInput(Dateopts);$("#totval").jqxNumberInput(Show2dec);$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var g,h,j;g=$("
");h=$("
Nieuw
");j=$("
Import
");g.append(h);g.append(j);i.append(g);h.jqxButton({theme:theme,width:90,height:20});j.jqxButton({theme:theme,width:90,height:20});h.click(function(k){c=-1;$("#popupWindow").jqxWindow({position:{x:110,y:30}});$("#name").val("Nieuw product");$("#type").val(0);$("#origin").val("");$("#supplier").val("");$("#notes").val("");$("#yield").val(80);$("#color").val(3);$("#coarse_fine_diff").val(3);$("#moisture").val(4);$("#diastatic_power").val(0);$("#protein").val(0);$("#dissolved_protein").val(0);$("#max_in_batch").val(100);$("#recommend_mash").val(1);$("#always_on_stock").val(0);$("#di_ph").val(0);$("#acid_to_ph_57").val(0);$("#graintype").val(0);$("#add_after_boil").val(0);$("#added").val(0);$("#inventory").val(0);$("#cost").val(0);$("#production_date").val("");$("#tht_date").val("");$("#popupWindow").jqxWindow("open")});j.click(function(k){window.location.href="import_ingredients.php?select=fermentables"})},filterable:true,filtermode:"excel",columns:[{text:"Herkomst",datafield:"origin",width:150},{text:"Producent",datafield:"supplier",width:140},{text:"Vergistbaar product",datafield:"name",menu:false},{text:"Soort",width:135,filtertype:"list",datafield:"type",cellsrenderer:function(h,g,k,j,i,l){return""+FermentableTypeData[k].nl+""}},{text:"Graan type",datafield:"graintype",align:"center",cellsalign:"center",width:125,cellsrenderer:function(h,g,k,j,i,l){return""+GrainTypeData[k].nl+""}},{text:"EBC",datafield:"color",width:60,align:"right",menu:false,cellsalign:"right"},{text:"Opbrengst",datafield:"yield",width:70,align:"right",menu:false,cellsalign:"right",cellsformat:"p1"},{text:"Voorraad",datafield:"inventory",width:100,align:"right",menu:false,cellsrenderer:function(h,g,l,k,j,m){var i="";if(l>0){if(l<1){i=f.formatNumber(l*1000,"f0")+" gr"}else{i=f.formatNumber(l,"f1")+" kg"}}return""+i+""}},{text:"",datafield:"Edit",width:100,align:"center",menu:false,columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(g){c=g;$("#popupWindow").jqxWindow({position:{x:110,y:30}});b=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(b.name);$("#type").val(b.type);$("#yield").val(b.yield);$("#color").val(b.color);$("#add_after_boil").val(b.add_after_boil);$("#origin").val(b.origin);$("#supplier").val(b.supplier);$("#notes").val(b.notes);$("#coarse_fine_diff").val(b.coarse_fine_diff);$("#moisture").val(b.moisture);$("#diastatic_power").val(lintner_to_kolbach(b.diastatic_power));$("#protein").val(b.protein);$("#dissolved_protein").val(b.dissolved_protein);$("#max_in_batch").val(b.max_in_batch);$("#recommend_mash").val(b.recommend_mash);$("#added").val(b.added);$("#always_on_stock").val(b.always_on_stock);$("#di_ph").val(b.di_ph);$("#acid_to_ph_57").val(b.acid_to_ph_57);$("#graintype").val(b.graintype);$("#inventory").val(b.inventory);$("#cost").val(b.cost);$("#production_date").val(b.production_date);$("#tht_date").val(b.tht_date);d(b.cost,b.inventory);$("#popupWindow").jqxWindow("open")}}]});$("#cost").on("change",function(g){b.cost=parseFloat(g.args.value);d(b.cost,b.inventory)});$("#inventory").on("change",function(g){b.inventory=parseFloat(g.args.value);d(b.cost,b.inventory)});$("#popupWindow").jqxWindow({width:1050,height:550,resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(c>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var g=$("#jqxgrid").jqxGrid("getrowid",c);$("#jqxgrid").jqxGrid("deleterow",g)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Clone").jqxButton({template:"warning",width:"90px",theme:theme});$("#Clone").click(function(){var g={record:-1,name:$("#name").val()+" kopie",type:$("#type").val(),yield:parseFloat($("#yield").jqxNumberInput("decimal")),color:parseFloat($("#color").jqxNumberInput("decimal")),add_after_boil:$("#add_after_boil").val(),origin:$("#origin").val(),supplier:$("#supplier").val(),notes:$("#notes").val(),coarse_fine_diff:parseFloat($("#coarse_fine_diff").jqxNumberInput("decimal")),moisture:parseFloat($("#moisture").jqxNumberInput("decimal")),diastatic_power:kolbach_to_lintner(parseFloat($("#diastatic_power").jqxNumberInput("decimal"))),protein:parseFloat($("#protein").jqxNumberInput("decimal")),dissolved_protein:parseFloat($("#dissolved_protein").jqxNumberInput("decimal")),max_in_batch:parseFloat($("#max_in_batch").jqxNumberInput("decimal")),recommend_mash:$("#recommend_mash").val(),added:$("#added").val(),always_on_stock:$("#always_on_stock").val(),di_ph:parseFloat($("#di_ph").jqxNumberInput("decimal")),acid_to_ph_57:parseFloat($("#acid_to_ph_57").jqxNumberInput("decimal")),graintype:$("#graintype").val(),inventory:0,cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:"",tht_date:""};$("#jqxgrid").jqxGrid("addrow",null,g);$("#popupWindow").jqxWindow("hide")});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var h,g=-1;if(c>=0){g=$("#jqxgrid").jqxGrid("getrowid",c)}h={record:g,name:$("#name").val(),type:$("#type").val(),yield:parseFloat($("#yield").jqxNumberInput("decimal")),color:parseFloat($("#color").jqxNumberInput("decimal")),add_after_boil:$("#add_after_boil").val(),origin:$("#origin").val(),supplier:$("#supplier").val(),notes:$("#notes").val(),coarse_fine_diff:parseFloat($("#coarse_fine_diff").jqxNumberInput("decimal")),moisture:parseFloat($("#moisture").jqxNumberInput("decimal")),diastatic_power:kolbach_to_lintner(parseFloat($("#diastatic_power").jqxNumberInput("decimal"))),protein:parseFloat($("#protein").jqxNumberInput("decimal")),dissolved_protein:parseFloat($("#dissolved_protein").jqxNumberInput("decimal")),max_in_batch:parseFloat($("#max_in_batch").jqxNumberInput("decimal")),recommend_mash:$("#recommend_mash").val(),added:$("#added").val(),always_on_stock:$("#always_on_stock").val(),di_ph:parseFloat($("#di_ph").jqxNumberInput("decimal")),acid_to_ph_57:parseFloat($("#acid_to_ph_57").jqxNumberInput("decimal")),graintype:$("#graintype").val(),inventory:parseFloat($("#inventory").jqxNumberInput("decimal")),cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:$("#production_date").val(),tht_date:$("#tht_date").val(),};if(c>=0){$("#jqxgrid").jqxGrid("updaterow",g,h)}else{$("#jqxgrid").jqxGrid("addrow",null,h)}$("#popupWindow").jqxWindow("hide")});createDelElements()}); \ No newline at end of file +function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){function d(h,g){$("#totval").val(h*g)}var b={},a="includes/db_inventory_fermentables.php",e={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"string"},{name:"yield",type:"float"},{name:"color",type:"float"},{name:"add_after_boil",type:"int"},{name:"origin",type:"string"},{name:"supplier",type:"string"},{name:"notes",type:"string"},{name:"coarse_fine_diff",type:"float"},{name:"moisture",type:"float"},{name:"diastatic_power",type:"float"},{name:"protein",type:"float"},{name:"dissolved_protein",type:"float"},{name:"max_in_batch",type:"float"},{name:"recommend_mash",type:"int"},{name:"added",type:"string"},{name:"always_on_stock",type:"int"},{name:"di_ph",type:"float"},{name:"acid_to_ph_57",type:"float"},{name:"graintype",type:"string"},{name:"inventory",type:"float"},{name:"cost",type:"float"},{name:"production_date",type:"string"},{name:"tht_date",type:"string"}],id:"record",url:a,deleterow:function(g,i){var h="delete=true&"+$.param({record:g});$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(k,j,l){i(true);location.reload(true)},error:function(j,l,k){i(false)}})},addrow:function(h,k,g,j){var i="insert=true&"+$.param(k);$.ajax({dataType:"json",url:a,cache:false,data:i,type:"POST",success:function(m,l,n){j(true);location.reload(true)},error:function(l,n,m){j(false)}})},updaterow:function(g,j,i){var h="update=true&"+$.param(j);$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(l,k,m){i(true);location.reload(true)},error:function(k,m,l){i(false)}})}},f=new $.jqx.dataAdapter(e),c=-1;$("#name").jqxInput({theme:theme,width:640,height:23});$("#type").jqxDropDownList({theme:theme,source:FermentableTypeAdapter,valueMember:"nl",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#yield").jqxNumberInput(Spin1dec);$("#color").jqxNumberInput(Spin1dec);$("#add_after_boil").jqxCheckBox({theme:theme,width:120,height:23});$("#origin").jqxInput({theme:theme,width:250,height:23});$("#supplier").jqxInput({theme:theme,width:250,height:23});$("#notes").jqxInput({theme:theme,width:640,height:100});$("#coarse_fine_diff").jqxNumberInput(Spin1dec);$("#moisture").jqxNumberInput(Spin1dec);$("#diastatic_power").jqxNumberInput(PosInt);$("#protein").jqxNumberInput(Spin1dec);$("#dissolved_protein").jqxNumberInput(Spin1dec);$("#max_in_batch").jqxNumberInput(Perc1dec);$("#recommend_mash").jqxCheckBox({theme:theme,width:120,height:23});$("#added").jqxDropDownList({theme:theme,source:AddedAdapter,valueMember:"nl",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#always_on_stock").jqxCheckBox({theme:theme,width:120,height:23});$("#di_ph").jqxNumberInput(Spin2pH);$("#acid_to_ph_57").jqxNumberInput({inputMode:"simple",theme:theme,width:110,height:23,min:-1000,max:1000,decimalDigits:4,spinButtons:true});$("#graintype").jqxDropDownList({theme:theme,source:GrainTypeAdapter,valueMember:"nl",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#inventory").jqxNumberInput(Spin3dec);$("#production_date").jqxDateTimeInput(Dateopts);$("#cost").jqxNumberInput(Spin2dec);$("#tht_date").jqxDateTimeInput(Dateopts);$("#totval").jqxNumberInput(Show2dec);$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var g,h,j;g=$("
");h=$("
Nieuw
");j=$("
Import
");g.append(h);g.append(j);i.append(g);h.jqxButton({theme:theme,width:90,height:20});j.jqxButton({theme:theme,width:90,height:20});h.click(function(k){c=-1;$("#popupWindow").jqxWindow({position:{x:110,y:30}});$("#name").val("Nieuw product");$("#type").val("Mout");$("#origin").val("");$("#supplier").val("");$("#notes").val("");$("#yield").val(80);$("#color").val(3);$("#coarse_fine_diff").val(3);$("#moisture").val(4);$("#diastatic_power").val(0);$("#protein").val(0);$("#dissolved_protein").val(0);$("#max_in_batch").val(100);$("#recommend_mash").val(1);$("#always_on_stock").val(0);$("#di_ph").val(0);$("#acid_to_ph_57").val(0);$("#graintype").val("Basismout");$("#add_after_boil").val(0);$("#added").val("Maischen");$("#inventory").val(0);$("#cost").val(0);$("#production_date").val("");$("#tht_date").val("");$("#popupWindow").jqxWindow("open")});j.click(function(k){window.location.href="import_ingredients.php?select=fermentables"})},filterable:true,filtermode:"excel",columns:[{text:"Herkomst",datafield:"origin",width:150},{text:"Producent",datafield:"supplier",width:140},{text:"Vergistbaar product",datafield:"name",menu:false},{text:"Soort",width:135,filtertype:"list",datafield:"type"},{text:"Graan type",datafield:"graintype",align:"center",cellsalign:"center",width:125},{text:"EBC",datafield:"color",width:60,align:"right",menu:false,cellsalign:"right"},{text:"Opbrengst",datafield:"yield",width:70,align:"right",menu:false,cellsalign:"right",cellsformat:"p1"},{text:"Voorraad",datafield:"inventory",width:100,align:"right",menu:false,cellsrenderer:function(h,g,l,k,j,m){var i="";if(l>0){if(l<1){i=f.formatNumber(l*1000,"f0")+" gr"}else{i=f.formatNumber(l,"f1")+" kg"}}return""+i+""}},{text:"",datafield:"Edit",width:100,align:"center",menu:false,columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(g){c=g;$("#popupWindow").jqxWindow({position:{x:110,y:30}});b=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(b.name);$("#type").val(b.type);$("#yield").val(b.yield);$("#color").val(b.color);$("#add_after_boil").val(b.add_after_boil);$("#origin").val(b.origin);$("#supplier").val(b.supplier);$("#notes").val(b.notes);$("#coarse_fine_diff").val(b.coarse_fine_diff);$("#moisture").val(b.moisture);$("#diastatic_power").val(lintner_to_kolbach(b.diastatic_power));$("#protein").val(b.protein);$("#dissolved_protein").val(b.dissolved_protein);$("#max_in_batch").val(b.max_in_batch);$("#recommend_mash").val(b.recommend_mash);$("#added").val(b.added);$("#always_on_stock").val(b.always_on_stock);$("#di_ph").val(b.di_ph);$("#acid_to_ph_57").val(b.acid_to_ph_57);$("#graintype").val(b.graintype);$("#inventory").val(b.inventory);$("#cost").val(b.cost);$("#production_date").val(b.production_date);$("#tht_date").val(b.tht_date);d(b.cost,b.inventory);$("#popupWindow").jqxWindow("open")}}]});$("#cost").on("change",function(g){b.cost=parseFloat(g.args.value);d(b.cost,b.inventory)});$("#inventory").on("change",function(g){b.inventory=parseFloat(g.args.value);d(b.cost,b.inventory)});$("#popupWindow").jqxWindow({width:1050,height:550,resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(c>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var g=$("#jqxgrid").jqxGrid("getrowid",c);$("#jqxgrid").jqxGrid("deleterow",g)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Clone").jqxButton({template:"warning",width:"90px",theme:theme});$("#Clone").click(function(){var g={record:-1,name:$("#name").val()+" kopie",type:$("#type").val(),yield:parseFloat($("#yield").jqxNumberInput("decimal")),color:parseFloat($("#color").jqxNumberInput("decimal")),add_after_boil:$("#add_after_boil").val(),origin:$("#origin").val(),supplier:$("#supplier").val(),notes:$("#notes").val(),coarse_fine_diff:parseFloat($("#coarse_fine_diff").jqxNumberInput("decimal")),moisture:parseFloat($("#moisture").jqxNumberInput("decimal")),diastatic_power:kolbach_to_lintner(parseFloat($("#diastatic_power").jqxNumberInput("decimal"))),protein:parseFloat($("#protein").jqxNumberInput("decimal")),dissolved_protein:parseFloat($("#dissolved_protein").jqxNumberInput("decimal")),max_in_batch:parseFloat($("#max_in_batch").jqxNumberInput("decimal")),recommend_mash:$("#recommend_mash").val(),added:$("#added").val(),always_on_stock:$("#always_on_stock").val(),di_ph:parseFloat($("#di_ph").jqxNumberInput("decimal")),acid_to_ph_57:parseFloat($("#acid_to_ph_57").jqxNumberInput("decimal")),graintype:$("#graintype").val(),inventory:0,cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:"",tht_date:""};$("#jqxgrid").jqxGrid("addrow",null,g);$("#popupWindow").jqxWindow("hide")});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var h,g=-1;if(c>=0){g=$("#jqxgrid").jqxGrid("getrowid",c)}h={record:g,name:$("#name").val(),type:$("#type").val(),yield:parseFloat($("#yield").jqxNumberInput("decimal")),color:parseFloat($("#color").jqxNumberInput("decimal")),add_after_boil:$("#add_after_boil").val(),origin:$("#origin").val(),supplier:$("#supplier").val(),notes:$("#notes").val(),coarse_fine_diff:parseFloat($("#coarse_fine_diff").jqxNumberInput("decimal")),moisture:parseFloat($("#moisture").jqxNumberInput("decimal")),diastatic_power:kolbach_to_lintner(parseFloat($("#diastatic_power").jqxNumberInput("decimal"))),protein:parseFloat($("#protein").jqxNumberInput("decimal")),dissolved_protein:parseFloat($("#dissolved_protein").jqxNumberInput("decimal")),max_in_batch:parseFloat($("#max_in_batch").jqxNumberInput("decimal")),recommend_mash:$("#recommend_mash").val(),added:$("#added").val(),always_on_stock:$("#always_on_stock").val(),di_ph:parseFloat($("#di_ph").jqxNumberInput("decimal")),acid_to_ph_57:parseFloat($("#acid_to_ph_57").jqxNumberInput("decimal")),graintype:$("#graintype").val(),inventory:parseFloat($("#inventory").jqxNumberInput("decimal")),cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:$("#production_date").val(),tht_date:$("#tht_date").val(),};if(c>=0){$("#jqxgrid").jqxGrid("updaterow",g,h)}else{$("#jqxgrid").jqxGrid("addrow",null,h)}$("#popupWindow").jqxWindow("hide")});createDelElements()}); \ No newline at end of file diff -r 217ba4596c4d -r 3c680d1dea35 www/js/inv_fermentables.js --- a/www/js/inv_fermentables.js Mon Oct 14 23:13:40 2019 +0200 +++ b/www/js/inv_fermentables.js Wed Oct 16 21:05:03 2019 +0200 @@ -58,7 +58,7 @@ datafields: [ { name: 'record', type: 'number' }, { name: 'name', type: 'string' }, - { name: 'type', type: 'int' }, + { name: 'type', type: 'string' }, { name: 'yield', type: 'float' }, { name: 'color', type: 'float' }, { name: 'add_after_boil', type: 'int' }, @@ -72,11 +72,11 @@ { name: 'dissolved_protein', type: 'float' }, { name: 'max_in_batch', type: 'float' }, { name: 'recommend_mash', type: 'int' }, - { name: 'added', type: 'int' }, + { name: 'added', type: 'string' }, { name: 'always_on_stock', type: 'int' }, { name: 'di_ph', type: 'float' }, { name: 'acid_to_ph_57', type: 'float' }, - { name: 'graintype', type: 'int' }, + { name: 'graintype', type: 'string' }, { name: 'inventory', type: 'float' }, { name: 'cost', type: 'float' }, { name: 'production_date', type: 'string' }, @@ -145,7 +145,7 @@ $("#type").jqxDropDownList({ theme: theme, source: FermentableTypeAdapter, - valueMember: 'id', + valueMember: 'nl', displayMember: 'nl', width: 180, height: 23, @@ -167,7 +167,7 @@ $("#added").jqxDropDownList({ theme: theme, source: AddedAdapter, - valueMember: 'id', + valueMember: 'nl', displayMember: 'nl', width: 180, height: 23, @@ -179,7 +179,7 @@ $("#graintype").jqxDropDownList({ theme: theme, source: GrainTypeAdapter, - valueMember: 'id', + valueMember: 'nl', displayMember: 'nl', width: 180, height: 23, @@ -213,7 +213,7 @@ editrow = -1; $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); $("#name").val('Nieuw product'); - $("#type").val(0); + $("#type").val('Mout'); $("#origin").val(''); $("#supplier").val(''); $("#notes").val(''); @@ -229,9 +229,9 @@ $("#always_on_stock").val(0); $("#di_ph").val(0); $("#acid_to_ph_57").val(0); - $("#graintype").val(0); + $("#graintype").val('Basismout'); $("#add_after_boil").val(0); - $("#added").val(0); + $("#added").val('Maischen'); $("#inventory").val(0); $("#cost").val(0); $("#production_date").val(''); @@ -248,16 +248,8 @@ { text: 'Herkomst', datafield: 'origin', width: 150 }, { text: 'Producent', datafield: 'supplier', width: 140 }, { text: 'Vergistbaar product', datafield: 'name', menu: false }, - { text: 'Soort', width: 135, filtertype: 'list', datafield: 'type', - cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { - return "" + FermentableTypeData[value].nl + ""; - } - }, - { text: 'Graan type', datafield: 'graintype', align: 'center', cellsalign: 'center', width: 125, - cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { - return "" + GrainTypeData[value].nl + ""; - } - }, + { text: 'Soort', width: 135, filtertype: 'list', datafield: 'type' }, + { text: 'Graan type', datafield: 'graintype', align: 'center', cellsalign: 'center', width: 125 }, { text: 'EBC', datafield: 'color', width: 60, align: 'right', menu: false, cellsalign: 'right' }, { text: 'Opbrengst', datafield: 'yield', width: 70, align: 'right', menu: false, cellsalign: 'right', cellsformat: 'p1' }, { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', menu: false, diff -r 217ba4596c4d -r 3c680d1dea35 www/js/inv_hops.js --- a/www/js/inv_hops.js Mon Oct 14 23:13:40 2019 +0200 +++ b/www/js/inv_hops.js Wed Oct 16 21:05:03 2019 +0200 @@ -65,8 +65,8 @@ { name: 'cohumulone', type: 'float' }, { name: 'myrcene', type: 'float' }, { name: 'hsi', type: 'float' }, - { name: 'type', type: 'int' }, - { name: 'form', type: 'int' }, + { name: 'type', type: 'string' }, + { name: 'form', type: 'string' }, { name: 'notes', type: 'string' }, { name: 'origin', type: 'string' }, { name: 'substitutes', type: 'string' }, @@ -148,7 +148,7 @@ $("#type").jqxDropDownList({ theme: theme, source: HopTypeAdapter, - valueMember: 'id', + valueMember: 'nl', displayMember: 'nl', width: 150, height: 23, @@ -157,7 +157,7 @@ $("#form").jqxDropDownList({ theme: theme, source: HopFormAdapter, - valueMember: 'id', + valueMember: 'nl', displayMember: 'nl', width: 150, height: 23, @@ -203,8 +203,8 @@ $("#cohumulone").val(0); $("#myrcene").val(0); $("#hsi").val(0); - $("#type").val(0); - $("#form").val(0); + $("#type").val('Bitterhop'); + $("#form").val('Pellets'); $("#notes").val(''); $("#origin").val(''); $("#substitutes").val(''); @@ -225,16 +225,8 @@ columns: [ { text: 'Herkomst', datafield: 'origin', width: 150 }, { text: 'Hop Naam', datafield: 'name', menu: false }, - { text: 'Soort', datafield: 'type', align: 'left', menu: false, width: 90, - cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { - return '' + HopTypeData[value].nl + ''; - } - }, - { text: 'Vorm', datafield: 'form', align: 'left', menu: false, width: 90, - cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { - return '' + HopFormData[value].nl + ''; - } - }, + { text: 'Soort', datafield: 'type', align: 'left', width: 90 }, + { text: 'Vorm', datafield: 'form', align: 'left', width: 90 }, { text: 'Alpha %', datafield: 'alpha', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, { text: 'Beta %', datafield: 'beta', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, { text: 'Cohumuloon %%', datafield: 'cohumulone', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, diff -r 217ba4596c4d -r 3c680d1dea35 www/js/inv_miscs.js --- a/www/js/inv_miscs.js Mon Oct 14 23:13:40 2019 +0200 +++ b/www/js/inv_miscs.js Wed Oct 16 21:05:03 2019 +0200 @@ -67,8 +67,8 @@ datafields: [ { name: 'record', type: 'number' }, { name: 'name', type: 'string' }, - { name: 'type', type: 'int' }, - { name: 'use_use', type: 'int' }, + { name: 'type', type: 'string' }, + { name: 'use_use', type: 'string' }, { name: 'time', type: 'int' }, { name: 'amount', type: 'float' }, { name: 'amount_is_weight', type: 'int' }, @@ -144,7 +144,7 @@ $("#type").jqxDropDownList({theme: theme, source: MiscTypeAdapter, - valueMember: 'id', + valueMember: 'nl', displayMember: 'nl', width: 180, height: 23, @@ -153,7 +153,7 @@ $("#use_use").jqxDropDownList({ theme: theme, source: MiscUseAdapter, - valueMember: 'id', + valueMember: 'nl', displayMember: 'nl', width: 180, height: 23, @@ -191,8 +191,8 @@ editrow = -1; $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); $("#name").val(''); - $("#type").val(0); - $("#use_use").val(0); + $("#type").val('Specerij'); + $("#use_use").val('Starter'); $("#time").val(0); $("#amount_is_weight").val(1); $("#use_for").val(''); @@ -212,16 +212,8 @@ filtermode: 'excel', columns: [ { text: 'Ingredient naam', datafield: 'name', menu: false }, - { text: 'Type', datafield: 'type', align: 'left', width: 120, - cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { - return "" + MiscTypeData[value].nl + ""; - } - }, - { text: 'Gebruik', datafield: 'use_use', align: 'left', width: 120, - cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { - return "" + MiscUseData[value].nl + ""; - } - }, + { text: 'Type', datafield: 'type', align: 'left', width: 120 }, + { text: 'Gebruik', datafield: 'use_use', align: 'left', width: 120 }, { text: 'Tijd', datafield: 'time', width: 90, align: 'left', menu: false, cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { var duration = ""; diff -r 217ba4596c4d -r 3c680d1dea35 www/js/inv_yeasts-min.js --- a/www/js/inv_yeasts-min.js Mon Oct 14 23:13:40 2019 +0200 +++ b/www/js/inv_yeasts-min.js Wed Oct 16 21:05:03 2019 +0200 @@ -1,1 +1,1 @@ -function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){function d(){$("#totval").val(b.cost*b.inventory);if(b.form==0){$("#pmpt_cost").html("Prijs per pak:");$("#pmpt_inventory").html("Voorraad pak(ken):");$("#pmpt_cells").html("Miljard cellen per pak:");$("#inventory").jqxNumberInput({decimalDigits:0})}else{if(b.form==1){$("#pmpt_cost").html("Prijs per kg:");$("#pmpt_inventory").html("Voorraad gram:");$("#pmpt_cells").html("Miljard cellen per gram:");$("#inventory").jqxNumberInput({decimalDigits:1})}else{$("#pmpt_cost").html("Prijs per liter:");$("#pmpt_inventory").html("Voorraad ml:");$("#pmpt_cells").html("Miljard cellen per ml:");$("#inventory").jqxNumberInput({decimalDigits:1})}}}var b={},a="includes/db_inventory_yeasts.php",e={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"int"},{name:"form",type:"int"},{name:"laboratory",type:"string"},{name:"product_id",type:"string"},{name:"min_temperature",type:"float"},{name:"max_temperature",type:"float"},{name:"flocculation",type:"int"},{name:"attenuation",type:"float"},{name:"notes",type:"string"},{name:"best_for",type:"string"},{name:"max_reuse",type:"int"},{name:"inventory",type:"float"},{name:"cost",type:"float"},{name:"production_date",type:"string"},{name:"tht_date",type:"string"},{name:"cells",type:"float"},{name:"tolerance",type:"float"},{name:"sta1",type:"int"},{name:"bacteria",type:"int"},{name:"harvest_top",type:"int"},{name:"harvest_time",type:"int"},{name:"pitch_temperature",type:"float"},{name:"pofpos",type:"int"},{name:"zymocide",type:"int"}],id:"record",url:a,deleterow:function(g,i){var h="delete=true&"+$.param({record:g});$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(k,j,l){i(true);location.reload(true)},error:function(j,l,k){i(false)}})},addrow:function(h,k,g,j){var i="insert=true&"+$.param(k);$.ajax({dataType:"json",url:a,cache:false,data:i,type:"POST",success:function(m,l,n){j(true);location.reload(true)},error:function(l,n,m){j(false)}})},updaterow:function(g,j,i){var h="update=true&"+$.param(j);$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(l,k,m){i(true);location.reload(true)},error:function(k,m,l){i(false)}})}},f=new $.jqx.dataAdapter(e),c=-1;$("#name").jqxInput({theme:theme,width:640,height:23});$("#laboratory").jqxInput({theme:theme,width:320,height:23});$("#product_id").jqxInput({theme:theme,width:320,height:23});$("#type").jqxDropDownList({theme:theme,source:YeastTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#form").jqxDropDownList({theme:theme,source:YeastFormAdapter,valueMember:"id",displayMember:"nl",selectedIndex:0,width:180,height:23,autoDropDownHeight:true});$("#notes").jqxInput({theme:theme,width:800,height:120});$("#best_for").jqxInput({theme:theme,width:320,height:100});$("#inventory").jqxNumberInput(Spin1dec);$("#production_date").jqxDateTimeInput(Dateopts);$("#min_temperature").jqxNumberInput(YeastT);$("#max_temperature").jqxNumberInput(YeastT);$("#flocculation").jqxDropDownList({theme:theme,source:FlocculationAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#attenuation").jqxNumberInput(Perc1dec);$("#max_reuse").jqxNumberInput(PosInt);$("#max_reuse").jqxNumberInput({max:10});$("#cost").jqxNumberInput(Spin2dec);$("#tht_date").jqxDateTimeInput(Dateopts);$("#totval").jqxNumberInput(Show2dec);$("#cells").jqxNumberInput(Spin1dec);$("#tolerance").jqxNumberInput(Perc1dec);$("#tolerance").jqxNumberInput({max:25});$("#sta1").jqxCheckBox({theme:theme,width:120,height:23});$("#sta1").on("checked",function(g){b.sta1=1});$("#sta1").on("unchecked",function(g){b.sta1=0});$("#bacteria").jqxCheckBox({theme:theme,width:120,height:23});$("#bacteria").on("checked",function(g){b.bacteria=1});$("#bacteria").on("unchecked",function(g){b.bacteria=0});$("#harvest_top").jqxCheckBox({theme:theme,width:120,height:23});$("#harvest_top").on("checked",function(g){b.harvest_top=1});$("#harvest_top").on("unchecked",function(g){b.harvest_top=0});$("#harvest_time").jqxNumberInput(PosInt);$("#pitch_temperature").jqxNumberInput(YeastT);$("#pofpos").jqxCheckBox({theme:theme,width:120,height:23});$("#pofpos").on("checked",function(g){b.pofpos=1});$("#pofpos").on("unchecked",function(g){b.pofpos=0});$("#zymocide").jqxDropDownList({theme:theme,source:ZymocideAdapter,valueMember:"id",displayMember:"nl",width:80,height:23,autoDropDownHeight:true});$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var g,h,j;g=$("
");h=$("
Nieuw
");j=$("
Import
");g.append(h);g.append(j);i.append(g);h.jqxButton({theme:theme,width:90,height:20});j.jqxButton({theme:theme,width:90,height:20});h.click(function(k){c=-1;$("#popupWindow").jqxWindow({position:{x:110,y:30}});$("#name").val("");$("#laboratory").val("");$("#product_id").val("");$("#type").val(0);$("#form").val(0);$("#min_temperature").val(18);$("#max_temperature").val(22);$("#flocculation").val(0);$("#attenuation").val(77);$("#notes").val("");$("#best_for").val("");$("#max_reuse").val(10);$("#inventory").val(0);$("#cost").val(0);$("#production_date").val("");$("#tht_date").val("");$("#cells").val(1);$("#tolerance").val(0);$("#sta1").val(0);$("#bacteria").val(0);$("#harvest_top").val(0);$("#harvest_time").val(0);$("pitch_temperature#").val(0);$("#pofpos").val(0);$("#zymocide").val(0);$("#popupWindow").jqxWindow("open")});j.click(function(k){window.location.href="import_ingredients.php?select=yeasts"})},filterable:true,filtermode:"excel",columns:[{text:"Laboratorium",datafield:"laboratory",width:150},{text:"Product ID",datafield:"product_id",width:120,menu:false},{text:"Gist naam",datafield:"name",menu:false},{text:"Type",datafield:"type",align:"center",cellsalign:"center",menu:false,width:110,cellsrenderer:function(h,g,k,j,i,l){return"
"+YeastTypeData[k].nl+"
"}},{text:"Vorm",datafield:"form",align:"center",cellsalign:"center",menu:false,width:110,cellsrenderer:function(h,g,k,j,i,l){return"
"+YeastFormData[k].nl+"
"}},{text:"SVG",datafield:"attenuation",width:70,align:"right",cellsalign:"right",menu:false,cellsformat:"p1"},{text:"Tol%",datafield:"tolerance",width:60,align:"right",cellsalign:"right",menu:false,cellsrenderer:function(h,g,l,k,j,m){var i="";if(l>0){i=f.formatNumber(l,"p0")}return''+i+""}},{text:"Voorraad",datafield:"inventory",width:100,align:"right",menu:false,cellsrenderer:function(h,g,l,k,j,m){var i="";if(l>0){if((m.form==0)&&(l>1)){i=f.formatNumber(l,"f0")+" pakken"}else{if(m.form==0){i=f.formatNumber(l,"f0")+" pak"}else{if(m.form==1){i=f.formatNumber(l*1000,"f1")+" gram"}else{i=f.formatNumber(l*1000,"f1")+" ml"}}}}return""+i+""}},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",menu:false,cellsrenderer:function(){return"Wijzig"},buttonclick:function(g){c=g;$("#popupWindow").jqxWindow({position:{x:110,y:15}});b=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(b.name);$("#laboratory").val(b.laboratory);$("#product_id").val(b.product_id);$("#type").val(b.type);$("#form").val(b.form);$("#min_temperature").val(parseFloat(b.min_temperature));$("#max_temperature").val(parseFloat(b.max_temperature));$("#flocculation").val(b.flocculation);$("#attenuation").val(b.attenuation);$("#notes").val(b.notes);$("#best_for").val(b.best_for);$("#max_reuse").val(b.max_reuse);if(b.form==0){$("#inventory").val(b.inventory)}else{$("#inventory").val(b.inventory*1000)}$("#cost").val(b.cost);$("#production_date").val(b.production_date);$("#tht_date").val(b.tht_date);$("#cells").val(b.cells);$("#tolerance").val(b.tolerance);$("#sta1").val(b.sta1);$("#bacteria").val(b.bacteria);$("#harvest_top").val(b.harvest_top);$("#harvest_time").val(b.harvest_time);$("#pitch_temperature").val(parseFloat(b.pitch_temperature));$("#pofpos").val(b.pofpos);$("#zymocide").val(b.zymocide);d();$("#popupWindow").jqxWindow("open")}}]});$("#popupWindow").on("open",function(g){d()});$("#cost").on("change",function(g){b.cost=parseFloat(g.args.value);d()});$("#inventory").on("change",function(g){if(b.form==0){b.inventory=parseFloat(g.args.value)}else{b.inventory=parseFloat(g.args.value)/1000}d()});$("#form").on("select",function(g){if(g.args){b.form=g.args.index;d()}});$("#popupWindow").jqxWindow({width:1050,height:625,resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(c>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var g=$("#jqxgrid").jqxGrid("getrowid",c);$("#jqxgrid").jqxGrid("deleterow",g)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Clone").jqxButton({template:"warning",width:"90px",theme:theme});$("#Clone").click(function(){var g={record:-1,name:$("#name").val()+" kopie",type:$("#type").val(),form:$("#form").val(),laboratory:$("#laboratory").val(),product_id:$("#product_id").val(),min_temperature:parseFloat($("#min_temperature").jqxNumberInput("decimal")),max_temperature:parseFloat($("#max_temperature").jqxNumberInput("decimal")),flocculation:$("#flocculation").val(),attenuation:parseFloat($("#attenuation").jqxNumberInput("decimal")),notes:$("#notes").val(),best_for:$("#best_for").val(),max_reuse:parseInt($("#max_reuse").jqxNumberInput("decimal")),inventory:0,cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:"",tht_date:"",cells:parseFloat($("#cells").jqxNumberInput("decimal")),tolerance:parseFloat($("#tolerance").jqxNumberInput("decimal")),sta1:$("#sta1").val(),bacteria:$("#bacteria").val(),harvest_top:$("#harvest_top").val(),harvest_time:$("#harvest_time").val(),pitch_temperature:parseFloat($("#pitch_temperature").jqxNumberInput("decimal")),pofpos:$("#pofpos").val(),zymocide:$("#zymocide").val()};$("#jqxgrid").jqxGrid("addrow",null,g);$("#popupWindow").jqxWindow("hide")});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var g,i,h=-1;if(c>=0){h=$("#jqxgrid").jqxGrid("getrowid",c)}if(b.form==0){g=parseFloat($("#inventory").jqxNumberInput("decimal"))}else{g=parseFloat($("#inventory").jqxNumberInput("decimal"))/1000}i={record:h,name:$("#name").val(),type:$("#type").val(),form:$("#form").val(),laboratory:$("#laboratory").val(),product_id:$("#product_id").val(),min_temperature:parseFloat($("#min_temperature").jqxNumberInput("decimal")),max_temperature:parseFloat($("#max_temperature").jqxNumberInput("decimal")),flocculation:$("#flocculation").val(),attenuation:parseFloat($("#attenuation").jqxNumberInput("decimal")),notes:$("#notes").val(),best_for:$("#best_for").val(),max_reuse:parseInt($("#max_reuse").jqxNumberInput("decimal")),inventory:g,cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:$("#production_date").val(),tht_date:$("#tht_date").val(),cells:parseFloat($("#cells").jqxNumberInput("decimal")),tolerance:parseFloat($("#tolerance").jqxNumberInput("decimal")),sta1:$("#sta1").val(),bacteria:$("#bacteria").val(),harvest_top:$("#harvest_top").val(),harvest_time:$("#harvest_time").val(),pitch_temperature:parseFloat($("#pitch_temperature").jqxNumberInput("decimal")),pofpos:$("#pofpos").val(),zymocide:$("#zymocide").val()};if(c>=0){$("#jqxgrid").jqxGrid("updaterow",h,i)}else{$("#jqxgrid").jqxGrid("addrow",null,i)}$("#popupWindow").jqxWindow("hide")});createDelElements()}); \ No newline at end of file +function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){function d(){$("#totval").val(b.cost*b.inventory);if(b.form=="Vloeibaar"){$("#pmpt_cost").html("Prijs per pak:");$("#pmpt_inventory").html("Voorraad pak(ken):");$("#pmpt_cells").html("Miljard cellen per pak:");$("#inventory").jqxNumberInput({decimalDigits:0})}else{if(b.form=="Droog"){$("#pmpt_cost").html("Prijs per kg:");$("#pmpt_inventory").html("Voorraad gram:");$("#pmpt_cells").html("Miljard cellen per gram:");$("#inventory").jqxNumberInput({decimalDigits:1})}else{$("#pmpt_cost").html("Prijs per liter:");$("#pmpt_inventory").html("Voorraad ml:");$("#pmpt_cells").html("Miljard cellen per ml:");$("#inventory").jqxNumberInput({decimalDigits:1})}}}var b={},a="includes/db_inventory_yeasts.php",e={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"string"},{name:"form",type:"string"},{name:"laboratory",type:"string"},{name:"product_id",type:"string"},{name:"min_temperature",type:"float"},{name:"max_temperature",type:"float"},{name:"flocculation",type:"int"},{name:"attenuation",type:"float"},{name:"notes",type:"string"},{name:"best_for",type:"string"},{name:"max_reuse",type:"int"},{name:"inventory",type:"float"},{name:"cost",type:"float"},{name:"production_date",type:"string"},{name:"tht_date",type:"string"},{name:"cells",type:"float"},{name:"tolerance",type:"float"},{name:"sta1",type:"int"},{name:"bacteria",type:"int"},{name:"harvest_top",type:"int"},{name:"harvest_time",type:"int"},{name:"pitch_temperature",type:"float"},{name:"pofpos",type:"int"},{name:"zymocide",type:"int"}],id:"record",url:a,deleterow:function(g,i){var h="delete=true&"+$.param({record:g});$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(k,j,l){i(true);location.reload(true)},error:function(j,l,k){i(false)}})},addrow:function(h,k,g,j){var i="insert=true&"+$.param(k);$.ajax({dataType:"json",url:a,cache:false,data:i,type:"POST",success:function(m,l,n){j(true);location.reload(true)},error:function(l,n,m){j(false)}})},updaterow:function(g,j,i){var h="update=true&"+$.param(j);$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(l,k,m){i(true);location.reload(true)},error:function(k,m,l){i(false)}})}},f=new $.jqx.dataAdapter(e),c=-1;$("#name").jqxInput({theme:theme,width:640,height:23});$("#laboratory").jqxInput({theme:theme,width:320,height:23});$("#product_id").jqxInput({theme:theme,width:320,height:23});$("#type").jqxDropDownList({theme:theme,source:YeastTypeAdapter,valueMember:"nl",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#form").jqxDropDownList({theme:theme,source:YeastFormAdapter,valueMember:"nl",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#notes").jqxInput({theme:theme,width:800,height:120});$("#best_for").jqxInput({theme:theme,width:320,height:100});$("#inventory").jqxNumberInput(Spin1dec);$("#production_date").jqxDateTimeInput(Dateopts);$("#min_temperature").jqxNumberInput(YeastT);$("#max_temperature").jqxNumberInput(YeastT);$("#flocculation").jqxDropDownList({theme:theme,source:FlocculationAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#attenuation").jqxNumberInput(Perc1dec);$("#max_reuse").jqxNumberInput(PosInt);$("#max_reuse").jqxNumberInput({max:10});$("#cost").jqxNumberInput(Spin2dec);$("#tht_date").jqxDateTimeInput(Dateopts);$("#totval").jqxNumberInput(Show2dec);$("#cells").jqxNumberInput(Spin1dec);$("#tolerance").jqxNumberInput(Perc1dec);$("#tolerance").jqxNumberInput({max:25});$("#sta1").jqxCheckBox({theme:theme,width:120,height:23});$("#sta1").on("checked",function(g){b.sta1=1});$("#sta1").on("unchecked",function(g){b.sta1=0});$("#bacteria").jqxCheckBox({theme:theme,width:120,height:23});$("#bacteria").on("checked",function(g){b.bacteria=1});$("#bacteria").on("unchecked",function(g){b.bacteria=0});$("#harvest_top").jqxCheckBox({theme:theme,width:120,height:23});$("#harvest_top").on("checked",function(g){b.harvest_top=1});$("#harvest_top").on("unchecked",function(g){b.harvest_top=0});$("#harvest_time").jqxNumberInput(PosInt);$("#pitch_temperature").jqxNumberInput(YeastT);$("#pofpos").jqxCheckBox({theme:theme,width:120,height:23});$("#pofpos").on("checked",function(g){b.pofpos=1});$("#pofpos").on("unchecked",function(g){b.pofpos=0});$("#zymocide").jqxDropDownList({theme:theme,source:ZymocideAdapter,valueMember:"id",displayMember:"nl",width:80,height:23,autoDropDownHeight:true});$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var g,h,j;g=$("
");h=$("
Nieuw
");j=$("
Import
");g.append(h);g.append(j);i.append(g);h.jqxButton({theme:theme,width:90,height:20});j.jqxButton({theme:theme,width:90,height:20});h.click(function(k){c=-1;$("#popupWindow").jqxWindow({position:{x:110,y:30}});$("#name").val("");$("#laboratory").val("");$("#product_id").val("");$("#type").val("Bovengist");$("#form").val("Vloeibaar");$("#min_temperature").val(18);$("#max_temperature").val(22);$("#flocculation").val(0);$("#attenuation").val(77);$("#notes").val("");$("#best_for").val("");$("#max_reuse").val(10);$("#inventory").val(0);$("#cost").val(0);$("#production_date").val("");$("#tht_date").val("");$("#cells").val(1);$("#tolerance").val(0);$("#sta1").val(0);$("#bacteria").val(0);$("#harvest_top").val(0);$("#harvest_time").val(0);$("#pitch_temperature").val(0);$("#pofpos").val(0);$("#zymocide").val(0);$("#popupWindow").jqxWindow("open")});j.click(function(k){window.location.href="import_ingredients.php?select=yeasts"})},filterable:true,filtermode:"excel",columns:[{text:"Laboratorium",datafield:"laboratory",width:150},{text:"Product ID",datafield:"product_id",width:120,menu:false},{text:"Gist naam",datafield:"name",menu:false},{text:"Type",datafield:"type",align:"center",cellsalign:"center",width:110},{text:"Vorm",datafield:"form",align:"center",cellsalign:"center",width:110},{text:"SVG",datafield:"attenuation",width:70,align:"right",cellsalign:"right",menu:false,cellsformat:"p1"},{text:"Tol%",datafield:"tolerance",width:60,align:"right",cellsalign:"right",menu:false,cellsrenderer:function(h,g,l,k,j,m){var i="";if(l>0){i=f.formatNumber(l,"p0")}return''+i+""}},{text:"Voorraad",datafield:"inventory",width:100,align:"right",menu:false,cellsrenderer:function(h,g,l,k,j,m){var i="";if(l>0){if((m.form=="Vloeibaar")&&(l>1)){i=f.formatNumber(l,"f0")+" pakken"}else{if(m.form=="Vloeibaar"){i=f.formatNumber(l,"f0")+" pak"}else{if(m.form=="Droog"){i=f.formatNumber(l*1000,"f1")+" gram"}else{i=f.formatNumber(l*1000,"f1")+" ml"}}}}return""+i+""}},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",menu:false,cellsrenderer:function(){return"Wijzig"},buttonclick:function(g){c=g;$("#popupWindow").jqxWindow({position:{x:110,y:15}});b=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(b.name);$("#laboratory").val(b.laboratory);$("#product_id").val(b.product_id);$("#type").val(b.type);$("#form").val(b.form);$("#min_temperature").val(parseFloat(b.min_temperature));$("#max_temperature").val(parseFloat(b.max_temperature));$("#flocculation").val(b.flocculation);$("#attenuation").val(b.attenuation);$("#notes").val(b.notes);$("#best_for").val(b.best_for);$("#max_reuse").val(b.max_reuse);if(b.form=="Vloeibaar"){$("#inventory").val(b.inventory)}else{$("#inventory").val(b.inventory*1000)}$("#cost").val(b.cost);$("#production_date").val(b.production_date);$("#tht_date").val(b.tht_date);$("#cells").val(b.cells);$("#tolerance").val(b.tolerance);$("#sta1").val(b.sta1);$("#bacteria").val(b.bacteria);$("#harvest_top").val(b.harvest_top);$("#harvest_time").val(b.harvest_time);$("#pitch_temperature").val(parseFloat(b.pitch_temperature));$("#pofpos").val(b.pofpos);$("#zymocide").val(b.zymocide);d();$("#popupWindow").jqxWindow("open")}}]});$("#popupWindow").on("open",function(g){d()});$("#cost").on("change",function(g){b.cost=parseFloat(g.args.value);d()});$("#inventory").on("change",function(g){if(b.form=="Vloeibaar"){b.inventory=parseFloat(g.args.value)}else{b.inventory=parseFloat(g.args.value)/1000}d()});$("#form").on("select",function(g){b.form=$("#form").val();d()});$("#popupWindow").jqxWindow({width:1050,height:625,resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(c>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var g=$("#jqxgrid").jqxGrid("getrowid",c);$("#jqxgrid").jqxGrid("deleterow",g)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Clone").jqxButton({template:"warning",width:"90px",theme:theme});$("#Clone").click(function(){var g={record:-1,name:$("#name").val()+" kopie",type:$("#type").val(),form:$("#form").val(),laboratory:$("#laboratory").val(),product_id:$("#product_id").val(),min_temperature:parseFloat($("#min_temperature").jqxNumberInput("decimal")),max_temperature:parseFloat($("#max_temperature").jqxNumberInput("decimal")),flocculation:$("#flocculation").val(),attenuation:parseFloat($("#attenuation").jqxNumberInput("decimal")),notes:$("#notes").val(),best_for:$("#best_for").val(),max_reuse:parseInt($("#max_reuse").jqxNumberInput("decimal")),inventory:0,cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:"",tht_date:"",cells:parseFloat($("#cells").jqxNumberInput("decimal")),tolerance:parseFloat($("#tolerance").jqxNumberInput("decimal")),sta1:$("#sta1").val(),bacteria:$("#bacteria").val(),harvest_top:$("#harvest_top").val(),harvest_time:$("#harvest_time").val(),pitch_temperature:parseFloat($("#pitch_temperature").jqxNumberInput("decimal")),pofpos:$("#pofpos").val(),zymocide:$("#zymocide").val()};$("#jqxgrid").jqxGrid("addrow",null,g);$("#popupWindow").jqxWindow("hide")});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var g,i,h=-1;if(c>=0){h=$("#jqxgrid").jqxGrid("getrowid",c)}if(b.form=="Vloeibaar"){g=parseFloat($("#inventory").jqxNumberInput("decimal"))}else{g=parseFloat($("#inventory").jqxNumberInput("decimal"))/1000}i={record:h,name:$("#name").val(),type:$("#type").val(),form:$("#form").val(),laboratory:$("#laboratory").val(),product_id:$("#product_id").val(),min_temperature:parseFloat($("#min_temperature").jqxNumberInput("decimal")),max_temperature:parseFloat($("#max_temperature").jqxNumberInput("decimal")),flocculation:$("#flocculation").val(),attenuation:parseFloat($("#attenuation").jqxNumberInput("decimal")),notes:$("#notes").val(),best_for:$("#best_for").val(),max_reuse:parseInt($("#max_reuse").jqxNumberInput("decimal")),inventory:g,cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:$("#production_date").val(),tht_date:$("#tht_date").val(),cells:parseFloat($("#cells").jqxNumberInput("decimal")),tolerance:parseFloat($("#tolerance").jqxNumberInput("decimal")),sta1:$("#sta1").val(),bacteria:$("#bacteria").val(),harvest_top:$("#harvest_top").val(),harvest_time:$("#harvest_time").val(),pitch_temperature:parseFloat($("#pitch_temperature").jqxNumberInput("decimal")),pofpos:$("#pofpos").val(),zymocide:$("#zymocide").val()};if(c>=0){$("#jqxgrid").jqxGrid("updaterow",h,i)}else{$("#jqxgrid").jqxGrid("addrow",null,i)}$("#popupWindow").jqxWindow("hide")});createDelElements()}); \ No newline at end of file diff -r 217ba4596c4d -r 3c680d1dea35 www/js/inv_yeasts.js --- a/www/js/inv_yeasts.js Mon Oct 14 23:13:40 2019 +0200 +++ b/www/js/inv_yeasts.js Wed Oct 16 21:05:03 2019 +0200 @@ -47,12 +47,12 @@ function calcTotal() { $('#totval').val(dataRecord.cost * dataRecord.inventory); - if (dataRecord.form == 0) { // Liquid + if (dataRecord.form == 'Vloeibaar') { // Liquid $("#pmpt_cost").html('Prijs per pak:'); $("#pmpt_inventory").html('Voorraad pak(ken):'); $("#pmpt_cells").html('Miljard cellen per pak:'); $("#inventory").jqxNumberInput({ decimalDigits: 0 }); - } else if (dataRecord.form == 1) { // Dry + } else if (dataRecord.form == 'Droog') { // Dry $("#pmpt_cost").html('Prijs per kg:'); $("#pmpt_inventory").html('Voorraad gram:'); $("#pmpt_cells").html('Miljard cellen per gram:'); @@ -73,8 +73,8 @@ datafields: [ { name: 'record', type: 'number' }, { name: 'name', type: 'string' }, - { name: 'type', type: 'int' }, - { name: 'form', type: 'int' }, + { name: 'type', type: 'string' }, + { name: 'form', type: 'string' }, { name: 'laboratory', type: 'string' }, { name: 'product_id', type: 'string' }, { name: 'min_temperature', type: 'float' }, @@ -163,7 +163,7 @@ $("#type").jqxDropDownList({ theme: theme, source: YeastTypeAdapter, - valueMember: 'id', + valueMember: 'nl', displayMember: 'nl', width: 180, height: 23, @@ -172,9 +172,9 @@ $("#form").jqxDropDownList({ theme: theme, source: YeastFormAdapter, - valueMember: 'id', + valueMember: 'nl', displayMember: 'nl', - selectedIndex: 0, + // selectedIndex: 0, width: 180, height: 23, autoDropDownHeight: true @@ -251,8 +251,8 @@ $("#name").val(''); $("#laboratory").val(''); $("#product_id").val(''); - $("#type").val(0); - $("#form").val(0); + $("#type").val('Bovengist'); + $("#form").val('Vloeibaar'); $("#min_temperature").val(18); $("#max_temperature").val(22); $("#flocculation").val(0); @@ -270,7 +270,7 @@ $("#bacteria").val(0); $("#harvest_top").val(0); $("#harvest_time").val(0); - $("pitch_temperature#").val(0); + $("#pitch_temperature").val(0); $("#pofpos").val(0); $("#zymocide").val(0); $("#popupWindow").jqxWindow('open'); @@ -285,16 +285,8 @@ { text: 'Laboratorium', datafield: 'laboratory', width: 150 }, { text: 'Product ID', datafield: 'product_id', width: 120, menu: false }, { text: 'Gist naam', datafield: 'name', menu: false }, - { text: 'Type', datafield: 'type', align: 'center', cellsalign: 'center', menu: false, width: 110, - cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { - return "
" + YeastTypeData[value].nl + "
"; - } - }, - { text: 'Vorm', datafield: 'form', align: 'center', cellsalign: 'center', menu: false, width: 110, - cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { - return "
" + YeastFormData[value].nl + "
"; - } - }, + { text: 'Type', datafield: 'type', align: 'center', cellsalign: 'center', width: 110 }, + { text: 'Vorm', datafield: 'form', align: 'center', cellsalign: 'center', width: 110 }, { text: 'SVG', datafield: 'attenuation', width: 70, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, { text: 'Tol%', datafield: 'tolerance', width: 60, align: 'right', cellsalign: 'right', menu: false, cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { @@ -308,11 +300,11 @@ cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { var amount = ""; if (value > 0) { - if ((rowdata.form == 0) && (value > 1)) + if ((rowdata.form == 'Vloeibaar') && (value > 1)) amount = dataAdapter.formatNumber(value,"f0")+" pakken"; - else if (rowdata.form == 0) + else if (rowdata.form == 'Vloeibaar') amount = dataAdapter.formatNumber(value,"f0")+" pak"; - else if (rowdata.form == 1) + else if (rowdata.form == 'Droog') amount = dataAdapter.formatNumber(value * 1000,"f1")+" gram"; else amount = dataAdapter.formatNumber(value * 1000,"f1")+" ml"; @@ -340,7 +332,7 @@ $("#notes").val(dataRecord.notes); $("#best_for").val(dataRecord.best_for); $("#max_reuse").val(dataRecord.max_reuse); - if (dataRecord.form == 0) + if (dataRecord.form == 'Vloeibaar') $("#inventory").val(dataRecord.inventory); else $("#inventory").val(dataRecord.inventory * 1000); @@ -370,17 +362,15 @@ calcTotal(); }); $("#inventory").on('change', function (event) { - if (dataRecord.form == 0) + if (dataRecord.form == 'Vloeibaar') dataRecord.inventory = parseFloat(event.args.value); else dataRecord.inventory = parseFloat(event.args.value) / 1000.0; calcTotal(); }); $("#form").on('select', function (event) { - if (event.args) { - dataRecord.form = event.args.index; - calcTotal(); - } + dataRecord.form = $("#form").val(); + calcTotal(); }); // initialize the popup window and buttons. @@ -450,7 +440,7 @@ if (editrow >= 0) { rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); } - if (dataRecord.form == 0) + if (dataRecord.form == 'Vloeibaar') n_inventory = parseFloat($("#inventory").jqxNumberInput('decimal')); else n_inventory = parseFloat($("#inventory").jqxNumberInput('decimal')) / 1000.0; diff -r 217ba4596c4d -r 3c680d1dea35 www/prod_forum.php --- a/www/prod_forum.php Mon Oct 14 23:13:40 2019 +0200 +++ b/www/prod_forum.php Wed Oct 16 21:05:03 2019 +0200 @@ -1,6 +1,7 @@ w - $this->rMargin - $this->lMargin - 160; $cMargin=$this->cMargin; $this->cMargin=2; @@ -119,9 +120,9 @@ global $bottle_sugar_amount; global $keg_sugar; global $keg_sugar_amount; - $added = array( 'Maischen', 'Koken 10 min', 'Vergisten', 'Nagisten/lageren', 'Bottelen', 'Op fust' ); - $ftype = array( 'Mout', 'Suiker', 'Vloeibaar extract', 'Droog extract', 'Ongemout graan' ); - $mtype = array( 'Basismout', 'Geroosterde mout', 'Cara- of crystalmout', 'Geëeste mout', 'Zuurmout', 'Speciale mout', 'Geen mout' ); + global $added; + global $fermentabletype; + global $graintype; $vul = $this->w - $this->rMargin - $this->lMargin - 125; $this->Ln(); $this->AddCol($vul,'Mout, granen en suikers','L'); @@ -160,9 +161,9 @@ $pCara += $percent; if ($item['f_type'] == 0) - $soort = iconv('UTF-8','windows-1252',$mtype[$item['f_graintype']]); + $soort = iconv('UTF-8','windows-1252',$graintype[$item['f_graintype']]); else - $soort = iconv('UTF-8','windows-1252',$ftype[$item['f_type']]); + $soort = iconv('UTF-8','windows-1252',$fermentabletype[$item['f_type']]); if ($item['f_added'] == 4) { $bottle_sugar = $name; @@ -218,8 +219,8 @@ global $total_ibus; global $cost_hops; global $preboil_sg; - $hopform = array( 'Pellets', 'Plugs', 'Bellen', 'Hop nat', 'Cryo Hop' ); - $hopuse = array( 'Maischen', 'First wort', 'Koken', 'Vlamuit', 'Whirlpool', 'Koudhop' ); + global $hopform; + global $hopuse; $vul = $this->w - $this->rMargin - $this->lMargin - 122; $this->Ln(); $this->AddCol($vul,'Hop','L'); @@ -289,8 +290,8 @@ function TableYeasts($row) { global $cost_yeasts; global $svg; - $yeastform = array( 'Vloeibaar', 'Droog', 'Schuine buis', 'Slurry', 'Ingevroren', 'Depot' ); - $yeastuse = array( 'Hoofdgisting', 'Nagisting', 'Lagering', 'Bottelen' ); + global $yeastform; + global $yeastuse; $vul = $this->w - $this->rMargin - $this->lMargin - 110; $this->Ln(); $this->AddCol($vul,'Gist','L'); @@ -365,8 +366,8 @@ function TableMiscs($row) { global $cost_miscs; - $misctype = array( 'Specerij', 'Kruid', 'Smaakstof', 'Klaringsmiddel', 'Brouwzout', 'Gistvoeding', 'Anders' ); - $miscuse = array( 'Starter', 'Maischen', 'Koken', 'Hoofdvergisting', 'Nagisting/lagering', 'Bottelen' ); + global $misctype; + global $miscuse; $vul = $this->w - $this->rMargin - $this->lMargin - 95; if ($this->GetY() > 200) $this->AddPage(); @@ -436,7 +437,7 @@ global $cost_yeasts; global $svg; global $mashkg; - $mashtype = array( 'Infusie', 'Verwarming', 'Decoctie' ); + global $mashtype; $vul = $this->w - $this->rMargin - $this->lMargin - 137; if ($this->GetY() > 250) $this->AddPage(); @@ -567,8 +568,8 @@ global $cost_miscs; global $cost_yeasts; global $mashkg; - $colormethod = array( 'Morey', 'Mosher', 'Daniels' ); - $ibumethod = array( 'Tinseth', 'Rager', 'Daniels' ); + global $colormethod; + global $ibumethod; /* 2 Columns */ if ($this->GetY() > 200) $this->AddPage(); @@ -662,6 +663,8 @@ global $my_brix_correction; global $my_grain_absorbtion; + global $coolingtype; + global $aerationtype; if ($this->GetY() > 180) $this->AddPage(); @@ -735,7 +738,6 @@ $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_aboil_efficiency']))."%",0,0,'L',true); $this->Ln(7); - $coolingtype = array( '-', 'Dompelkoeler', 'Tegenstroomkoeler', 'Au bain marie', 'Laten afkoelen' ); $this->SetX($this->TableX); $this->Cell(35,5,'Spoelwater temperatuur',0,0,'L',true); $this->Cell(50,5,sprintf("%.1f", $row['sparge_temp']).DEG.'C',0,0,'L',true); @@ -792,7 +794,6 @@ $this->Cell(50,5,density_str(floatval($row['brew_fermenter_sg'])),0,0,'L',true); $this->Ln(7); - $aerationtype = array( 'Geen', 'Lucht', 'Zuurstof' ); $this->SetX($this->TableX); $this->Cell(35,5,'Beluchten met',0,0,'L',true); $this->Cell(50,5,$aerationtype[$row['brew_aeration_type']],0,0,'L',true); @@ -1092,7 +1093,7 @@ function Header() { global $row; global $prdate; - $stage = array( 'Plan', 'Wacht', 'Brouwen', 'Hoofdgisting', 'Nagisting', 'Lagering', 'Afvullen', 'Hergisten', 'Rijpen', 'Proeven', 'Gereed', 'Afgesloten' ); + global $stage; $this->Image('images/logo.png',10,10,30); // Title $this->SetFont('Helvetica','B',18); diff -r 217ba4596c4d -r 3c680d1dea35 www/rec_forum.php --- a/www/rec_forum.php Mon Oct 14 23:13:40 2019 +0200 +++ b/www/rec_forum.php Wed Oct 16 21:05:03 2019 +0200 @@ -1,6 +1,7 @@ w - $this->rMargin - $this->lMargin - 120; $cMargin=$this->cMargin; $this->cMargin=2; @@ -100,9 +101,9 @@ global $pCara; global $colorw; global $preboil_sg; - $added = array( 'Maischen', 'Koken 10 min', 'Vergisten', 'Nagisten/lageren', 'Bottelen' ); - $ftype = array( 'Mout', 'Suiker', 'Vloeibaar extract', 'Droog extract', 'Ongemout graan' ); - $mtype = array( 'Basismout', 'Geroosterde mout', 'Cara- of crystalmout', 'Geëeste mout', 'Zuurmout', 'Speciale mout', 'Geen mout' ); + global $added; + global $fermentabletype; + global $graintype; $vul = $this->w - $this->rMargin - $this->lMargin - 125; $this->Ln(); $this->AddCol($vul,'Mout, granen en suikers','L'); @@ -140,9 +141,9 @@ $pCara += $percent; if ($item['f_type'] == 0) - $soort = iconv('UTF-8','windows-1252',$mtype[$item['f_graintype']]); + $soort = iconv('UTF-8','windows-1252',$graintype[$item['f_graintype']]); else - $soort = iconv('UTF-8','windows-1252',$ftype[$item['f_type']]); + $soort = iconv('UTF-8','windows-1252',$fermentabletype[$item['f_type']]); $cost = $amount * $costkg; $cost_fermentables += $cost; @@ -188,8 +189,8 @@ global $total_ibus; global $cost_hops; global $preboil_sg; - $hopform = array( 'Pellets', 'Plugs', 'Bellen', 'Hop nat', 'Cryo Hop' ); - $hopuse = array( 'Maischen', 'First wort', 'Koken', 'Vlamuit', 'Whirlpool', 'Koudhop' ); + global $hopform; + global $hopuse; $vul = $this->w - $this->rMargin - $this->lMargin - 122; $this->Ln(); $this->AddCol($vul,'Hop','L'); @@ -259,8 +260,8 @@ function TableYeasts($row) { global $cost_yeasts; global $svg; - $yeastform = array( 'Vloeibaar', 'Droog', 'Schuine buis', 'Slurry', 'Ingevroren', 'Depot' ); - $yeastuse = array( 'Hoofdgisting', 'Nagisting', 'Lagering', 'Bottelen' ); + global $yeastform; + global $yeastuse; $vul = $this->w - $this->rMargin - $this->lMargin - 110; $this->Ln(); $this->AddCol($vul,'Gist','L'); @@ -317,8 +318,8 @@ function TableMiscs($row) { global $cost_miscs; - $misctype = array( 'Specerij', 'Kruid', 'Smaakstof', 'Klaringsmiddel', 'Brouwzout', 'Gistvoeding', 'Anders' ); - $miscuse = array( 'Starter', 'Maischen', 'Koken', 'Hoofdvergisting', 'Nagisting/lagering', 'Bottelen' ); + global $misctype; + global $miscuse; $vul = $this->w - $this->rMargin - $this->lMargin - 95; if ($this->GetY() > 200) $this->AddPage(); @@ -388,7 +389,7 @@ global $cost_yeasts; global $svg; global $mashkg; - $mashtype = array( 'Infusie', 'Verwarming', 'Decoctie' ); + global $mashtype; $vul = $this->w - $this->rMargin - $this->lMargin - 137; if ($this->GetY() > 250) $this->AddPage(); @@ -518,8 +519,8 @@ global $cost_hops; global $cost_miscs; global $cost_yeasts; - $colormethod = array( 'Morey', 'Mosher', 'Daniels' ); - $ibumethod = array( 'Tinseth', 'Rager', 'Daniels' ); + global $colormethod; + global $ibumethod; /* 2 Columns */ if ($this->GetY() > 200) $this->AddPage();