Skip to content
jfoclpf edited this page Jun 26, 2015 · 20 revisions

Purpose

This calculator allows users to find the true cost of owning and running a car as it considers the 12 car costs items, users need to pay to afford running an automobile. It will normally give them a good estimate of what they really need to spend to afford owning and running an automobile. As the motor bills come in at different points over the year, it's often difficult to really appreciate the total spend on cars. The test version is found at http://autocosts.org/XX.

For more than 20 countries

The project is optimized for a web-based version, but it can be easily adapted to other platforms. It can be forked as well only for one specific country taken from the folder country_files in which we find the php files translations for more than 20 languages/countries. The XX stands for the 2-letter ISO country code, and not for the language, since for example United Kingdom and Australia have the same language but different realities concerning the taxes, the terms applied to automobile costs and the units for fuel efficiency. The translations files apply therefore only to the selected country.

The project already considers all the units and fuel efficiency cases, different in many countries. The variations for fuel efficiency are l/100km, km/l, mpg(US), mpg(imp) and for distance are km, miles and mil (Nordic mile=10km)

Layout

If you don't need a web-based version of the project or if you simply want its pure clean core version, you'll not need all the accessory HTML divs around the centre div. In the layout folder just consider then the three files with the form parts. Change i.php accordingly removing the unnecessary HTML divs, as it shall not be that difficult.

Databases

In the current project version we collect anonymously data from the users' input, stored in a database for statistical analysis. We have a second database for visitors statistics. Nevertheless, the databases and their connections to project functions might be simply removed, in a off-line option for example. It shall be easy to adapt, changing few lines of code, in the function submit_data() called when the user clicks the Run button. You shall also remove files such as counter.php and dbService.php

Output charts

The colourful charts the application outputs are taken from Google Charts, so if you'd like to have them off-line or in other platforms you must find other solutions, like hosted charts platforms. The drawing of the charts are in the drawChartsResult() function. To remove the print-out of the charts simply remove the correspondent divs whose ids are chart_div and graph_div in the file i.php

Mobile version

The project is already adapted to mobile devices, since CSS file changes the layout configuration according with the window width.

Get a pure JS/HTML version

The back-end of the project is purely Javascript, though the middle-end and user-end uses a some php, mainly for the translated words got from the translation files.

An easy way to get a pure HTML/JS version of the project for a certain country might be simply surfing to the country version of the site http://autocosts.org/XX where XX is the 2-letters country code, and obtain the generated HTML/JS code, using a browser like Firefox, pressing CTRL-U.

Clone this wiki locally