Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. /*
  2. Loop through all the specific vehicle types inside the provinceWeightFuelPricesData object
  3. */
  4. for (var vehicleType in roadTaxData.provinceWeightFuelPricesData) {
  5. /*
  6. Where the data is getting stored for each vehicle type
  7. */
  8. var data = {},
  9. /*
  10. Every province with its data contained in the vehicle type
  11. */
  12. provinces = roadTaxData.provinceWeightFuelPricesData[vehicleType];
  13.  
  14. /*
  15. Loop through all province's with its data in the specific vehicle type
  16. */
  17. for (var province in provinces) {
  18. /*
  19. Define each province data
  20. */
  21. var provinceData = provinces[province];
  22. /*
  23. Add the province to the object as an key
  24. */
  25. data[province] = [];
  26. /*
  27. Loop through the data which belongs to every province
  28. */
  29. for (var provinceDataIndex = 0; provinceDataIndex < provinceData.length; provinceDataIndex++) {
  30.  
  31. /*
  32. Add the province data to the array
  33. */
  34. data[province].push(provinceData[provinceDataIndex]);
  35. }
  36. console.log('Parsed a the province: ' + province + " from the vehicle type " + vehicleType);
  37. }
  38. console.log('Parsed the vehicle type: ' + vehicleType);
  39. //console.log(data);
  40. passToPHP(vehicleType, JSON.stringify(data))
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement