bahamas_44_1.cif 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function bahamas_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' => 44,
  12. 'country_name' => 'Bahamas',
  13. 'country_iso_code_2' => 'BS',
  14. 'country_iso_code_3' => 'BHS',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(44, 'AC', 'Acklins and Crooked Islands'),
  21. array(44, 'BI', 'Bimini'),
  22. array(44, 'CI', 'Cat Island'),
  23. array(44, 'EX', 'Exuma'),
  24. array(44, 'FP', 'Freeport'),
  25. array(44, 'FC', 'Fresh Creek'),
  26. array(44, 'GH', "Governor's Harbour"),
  27. array(44, 'GT', 'Green Turtle Cay'),
  28. array(44, 'HI', 'Harbour Island'),
  29. array(44, 'HR', 'High Rock'),
  30. array(44, 'IN', 'Inaqua'),
  31. array(44, 'KB', 'Kemps Bay'),
  32. array(44, 'LI', 'Long Island'),
  33. array(44, 'MH', 'Marsh Harbour'),
  34. array(44, 'MG', 'Mayaquana'),
  35. array(44, 'NP', 'New Providence'),
  36. array(44, 'NB', 'Nicholls Town and Berry Islands'),
  37. array(44, 'RI', 'Ragged Island'),
  38. array(44, 'RS', 'Rock Sound'),
  39. array(44, 'SR', 'San Salvador and Rum Cay'),
  40. array(44, 'SP', 'Sandy Point'),
  41. );
  42. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  43. foreach ($zones as $zone) {
  44. $query->values($zone);
  45. }
  46. $query->execute();
  47. // Set address format
  48. uc_set_address_format(
  49. 44,
  50. "!company\r\n" .
  51. "!first_name !last_name\r\n" .
  52. "!street1\r\n" .
  53. "!street2\r\n" .
  54. "!city !zone_code !postal_code\r\n" .
  55. "!country_name_if"
  56. );
  57. }