ecuador_218_1.cif 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function ecuador_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' => 218,
  12. 'country_name' => 'Ecuador',
  13. 'country_iso_code_2' => 'EC',
  14. 'country_iso_code_3' => 'ECU',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(218, 'A', 'Azuay'),
  21. array(218, 'B', 'Bolivar'),
  22. array(218, 'F', 'Canar'),
  23. array(218, 'C', 'Carchi'),
  24. array(218, 'H', 'Chimborazo'),
  25. array(218, 'X', 'Cotopaxi'),
  26. array(218, 'O', 'El Oro'),
  27. array(218, 'E', 'Esmeraldas'),
  28. array(218, 'W', 'Galapagos'),
  29. array(218, 'G', 'Guayas'),
  30. array(218, 'I', 'Imbabura'),
  31. array(218, 'L', 'Loja'),
  32. array(218, 'R', 'Los Rios'),
  33. array(218, 'M', 'Manabi'),
  34. array(218, 'S', 'Morona-Santiago'),
  35. array(218, 'N', 'Napo'),
  36. array(218, 'D', 'Orellana'),
  37. array(218, 'Y', 'Pastaza'),
  38. array(218, 'P', 'Pichincha'),
  39. array(218, 'U', 'Sucumbios'),
  40. array(218, 'T', 'Tungurahua'),
  41. array(218, 'Z', 'Zamora-Chichipe'),
  42. );
  43. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  44. foreach ($zones as $zone) {
  45. $query->values($zone);
  46. }
  47. $query->execute();
  48. // Set address format
  49. uc_set_address_format(
  50. 218,
  51. "!company\r\n".
  52. "!first_name !last_name\r\n".
  53. "!street1\r\n".
  54. "!street2\r\n".
  55. "!city !zone_code !postal_code\r\n".
  56. "!country_name_if"
  57. );
  58. }