trinidad_tobago_780_1.cif 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function trinidad_tobago_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' => 780,
  12. 'country_name' => 'Trinidad and Tobago',
  13. 'country_iso_code_2' => 'TT',
  14. 'country_iso_code_3' => 'TTO',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(780, 'TT-CTT', 'Couva-Tabaquite-Talparo'),
  21. array(780, 'TT-DMN', 'Diego Martin'),
  22. array(780, 'TT-ETO', 'Eastern Tobago'),
  23. array(780, 'TT-PED', 'Penal-Debe'),
  24. array(780, 'TT-PRT', 'Princes Town'),
  25. array(780, 'TT-RCM', 'Rio Claro-Mayaro'),
  26. array(780, 'TT-SGE', 'Sangre Grande'),
  27. array(780, 'TT-SJL', 'San Juan-Laventille'),
  28. array(780, 'TT-SIP', 'Siparia'),
  29. array(780, 'TT-TUP', 'Tunapuna-Piarco'),
  30. array(780, 'TT-WTO', 'Western Tobago'),
  31. array(780, 'TT-ARI', 'Arima'),
  32. array(780, 'TT-CHA', 'Chaguanas'),
  33. array(780, 'TT-PTF', 'Point Fortin'),
  34. array(780, 'TT-POS', 'Port of Spain'),
  35. array(780, 'TT-SFO', 'San Fernando'),
  36. );
  37. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  38. foreach ($zones as $zone) {
  39. $query->values($zone);
  40. }
  41. $query->execute();
  42. // Set address format
  43. uc_set_address_format(
  44. 780,
  45. "!company\r\n" .
  46. "!first_name !last_name\r\n" .
  47. "!street1\r\n" .
  48. "!street2\r\n" .
  49. "!city, !zone_name !postal_code\r\n" .
  50. "!country_name_if"
  51. );
  52. }