For now, the calculator is available for
and en (english)
Example-Implementation (PHP-Code which generates JS-Code):
$shortname=$vbr->makeShortname("ARDEX B 10",$uid);
$vbr=$vbr->getVbr($shortname,"ARDEX B 10",false,$lang);
<a onClick="openVBR()">Consumption calculator</a>
$uid: is a product-ID. It is only necessary to separate ARDEX WA (the product exists twice, but with the same name) $uid=101 is the grout, $uid=91 is the adhesive. (these ids are used for ARDEX WA in the german product-database, you can change these values in vbr.php)
The comment "false" in "getVBR" means that the code will not be generated for the app, but for the website.
The variable $lang can be de,fr,en or nl at the moment.
The function makeShortname removes all white-spaces from the productname. The resulting name is a unique name, which is used in all other functions. The problem with products like "ARDEX WA" is solved with a special id.
In order to set up new products (or to change them), the following functions have to be added directly to the code:
- getGebinde: creates the product information for each product.
- getForm: creates the HTML-form for each product (here, the calculation factors are transferred to the following function, too).
- getFormel: creates the JS-Code for the calculation.
-getVbr: assembles the JS-Code from all 3 above mentioned functions."
According to the setting of the $lang-variable a tranlation-file is included. This file is named
vb_LANG.php (exampe: vbr_fr.php for the french version)
The file exists of 2 tables, they represent the tranlations german->targetLanguage:
The first table ("$trans_single") is for all translations like "1 bucket" ("one thing").
The second table ("$trans_plural") is for all translations like "2 buckets" ("more than one thing").
Background: In some languages (like german) the singular and plural word for bucket is "Eimer" (like "1 Eimer" or "2 Eimer")
The download includes translations for de,nl,fr and en.
Updates / Fixes:
10.08.2012 : Some plural words were not correctly translated in the plural-matrix