guyana_328_1.cif 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function guyana_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' => 328,
  12. 'country_name' => 'Guyana',
  13. 'country_iso_code_2' => 'GY',
  14. 'country_iso_code_3' => 'GUY',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(328, 'GY-BA', 'Barima-Waini'),
  21. array(328, 'GY-CU', 'Cuyuni-Mazaruni'),
  22. array(328, 'GY-DE', 'Demerara-Mahaica'),
  23. array(328, 'GY-EB', 'East Berbice-Corentyne'),
  24. array(328, 'GY-ES', 'Essequibo Islands-West Demerara'),
  25. array(328, 'GY-MA', 'Mahaica-Berbice'),
  26. array(328, 'GY-PM', 'Pomeroon-Supenaam'),
  27. array(328, 'GY-PT', 'Potaro-Siparuni'),
  28. array(328, 'GY-UD', 'Upper Demerara-Berbice'),
  29. array(328, 'GY-UT', 'Upper Takutu-Upper Essequibo'),
  30. );
  31. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  32. foreach ($zones as $zone) {
  33. $query->values($zone);
  34. }
  35. $query->execute();
  36. // Set address format
  37. uc_set_address_format(
  38. 328,
  39. "!company\r\n" .
  40. "!first_name !last_name\r\n" .
  41. "!street1\r\n" .
  42. "!street2\r\n" .
  43. "!city, !zone_name !postal_code\r\n" .
  44. "!country_name_if"
  45. );
  46. }