equatorial_guinea_226_1.cif 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function equatorial_guinea_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' => 226,
  12. 'country_name' => 'Equatorial Guinea',
  13. 'country_iso_code_2' => 'GQ',
  14. 'country_iso_code_3' => 'GNQ',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(226, 'GQ-AN', 'Annobon'),
  21. array(226, 'GQ-BN', 'Bioko Norte'),
  22. array(226, 'GQ-BS', 'Bioko Sur'),
  23. array(226, 'GQ-CS', 'Centro Sur'),
  24. array(226, 'GQ-KN', 'Kie-Ntem'),
  25. array(226, 'GQ-LI', 'Litoral'),
  26. array(226, 'GQ-WN', 'Wele-Nzas'),
  27. );
  28. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  29. foreach ($zones as $zone) {
  30. $query->values($zone);
  31. }
  32. $query->execute();
  33. // Set address format
  34. uc_set_address_format(
  35. 226,
  36. "!company\r\n" .
  37. "!first_name !last_name\r\n" .
  38. "!street1\r\n" .
  39. "!street2\r\n" .
  40. "!city, !zone_name !postal_code\r\n" .
  41. "!country_name_if"
  42. );
  43. }