mozambique_508_1.cif 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function mozambique_install() {
  7. // Make the entry in the country table.
  8. // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  9. db_insert('uc_countries')
  10. ->fields(array(
  11. 'country_id' => 508,
  12. 'country_name' => 'Mozambique',
  13. 'country_iso_code_2' => 'MZ',
  14. 'country_iso_code_3' => 'MOZ',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. $zones = array(
  19. array(508, 'POL', 'Cabo Delgado'),
  20. array(508, 'VJB', 'Gaza'),
  21. array(508, 'INH', 'Inhambane'),
  22. array(508, 'CHI', 'Manica'),
  23. array(508, 'MPM', 'Maputo'),
  24. array(508, 'APL', 'Nampula'),
  25. array(508, 'VXC', 'Niassa'),
  26. array(508, 'BEW', 'Sofala'),
  27. array(508, 'TCV', 'Tete'),
  28. array(508, 'UEL', 'Zambezia'),
  29. );
  30. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  31. foreach ($zones as $zone) {
  32. $query->values($zone);
  33. }
  34. $query->execute();
  35. // Set address format
  36. uc_set_address_format(
  37. 508,
  38. "!company\r\n" .
  39. "!first_name !last_name\r\n" .
  40. "!street1\r\n" .
  41. "!street2\r\n" .
  42. "!city, !zone_name\r\n" .
  43. "!country_name"
  44. );
  45. }