iceland_352_1.cif 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. function iceland_install() {
  3. // Make the entry in the country table.
  4. // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  5. db_insert('uc_countries')
  6. ->fields(array(
  7. 'country_id' => 352,
  8. 'country_name' => 'Iceland',
  9. 'country_iso_code_2' => 'IS',
  10. 'country_iso_code_3' => 'ISL',
  11. 'version' => 1,
  12. ))
  13. ->execute();
  14. // Make the entries in the zones table.
  15. $zones = array(
  16. array(352, 'IS-7', 'Austurland'),
  17. array(352, 'IS-1', 'Höfuðborgarsvæði utan Reykjavíkur'),
  18. array(352, 'IS-6', 'Norðurland eystra'),
  19. array(352, 'IS-5', 'Norðurland vestra'),
  20. array(352, 'IS-0', 'Reykjavík'),
  21. array(352, 'IS-8', 'Suðurland'),
  22. array(352, 'IS-2', 'Suðurnes'),
  23. array(352, 'IS-4', 'Vestfirðir'),
  24. array(352, 'IS-3', 'Vesturland'),
  25. );
  26. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  27. foreach ($zones as $zone) {
  28. $query->values($zone);
  29. }
  30. $query->execute();
  31. // Set address format
  32. uc_set_address_format(
  33. 352,
  34. "!company\r\n".
  35. "!first_name !last_name\r\n".
  36. "!street1\r\n".
  37. "!street2\r\n".
  38. "!postal_code !city\r\n".
  39. "!country_name_if"
  40. );
  41. }