sint_maarten_534_1.cif 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function sint_maarten_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' => 534,
  12. 'country_name' => 'Sint Maarten',
  13. 'country_iso_code_2' => 'SX',
  14. 'country_iso_code_3' => 'SXM',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(534, 'AD', 'Almond Grove'),
  21. array(534, 'BH', 'Beacon Hill'),
  22. array(534, 'BV', 'Belvedere'),
  23. array(534, 'CB', 'Cole Bay'),
  24. array(534, 'CC', 'Cupecoy'),
  25. array(534, 'CH', 'Cay Hill'),
  26. array(534, 'DB', 'Dawn Beach'),
  27. array(534, 'DC', 'Dutch Cul De Sac'),
  28. array(534, 'DF', 'Defiance'),
  29. array(534, 'DQ', 'Dutch Quarter'),
  30. array(534, 'EZ', 'Ebenezer'),
  31. array(534, 'FP', 'Fresh Pond'),
  32. array(534, 'GB', 'Guana Bay'),
  33. array(534, 'GR', 'Great Bay'),
  34. array(534, 'HE', 'Hope Estate'),
  35. array(534, 'KB', 'Cay Bay'),
  36. array(534, 'LB', 'Little Bay'),
  37. array(534, 'LL', 'Low Lands'),
  38. array(534, 'LP', 'Lower Prince Quarter'),
  39. array(534, 'MA', 'Marian Estate'),
  40. array(534, 'MB', 'Mullet Bay'),
  41. array(534, 'MD', 'Madam Estate'),
  42. array(534, 'MH', 'Maho'),
  43. array(534, 'ML', 'Middle Land'),
  44. array(534, 'OP', 'Oyster Pond'),
  45. array(534, 'PB', 'Point Blanche'),
  46. array(534, 'PH', 'Philispburg'),
  47. array(534, 'SB', 'Simpson Bay'),
  48. array(534, 'SD', 'Saunders'),
  49. array(534, 'SG', 'Sucker Garden'),
  50. array(534, 'SP', 'St Peters'),
  51. array(534, 'SR', 'South Reward'),
  52. array(534, 'UP', 'Upper Prince Quarter'),
  53. array(534, 'VY', 'Vineyard'),
  54. );
  55. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  56. foreach ($zones as $zone) {
  57. $query->values($zone);
  58. }
  59. $query->execute();
  60. // Set address format
  61. uc_set_address_format(
  62. 534,
  63. "!company\r\n" .
  64. "!first_name !last_name\r\n" .
  65. "!street1\r\n" .
  66. "!street2\r\n" .
  67. "!city, !zone_code\r\n" .
  68. "!country_name_if"
  69. );
  70. }