ethiopia_231_1.cif 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. function ethiopia_install() {
  3. // Make the entry in the country table.
  4. // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  5. db_insert('uc_countries')
  6. ->fields(array(
  7. 'country_id' => 231,
  8. 'country_name' => 'Ethiopia',
  9. 'country_iso_code_2' => 'ET',
  10. 'country_iso_code_3' => 'ETH',
  11. 'version' => 1,
  12. ))
  13. ->execute();
  14. // Make the entries in the zones table.
  15. $zones = array(
  16. array(231, 'ET-AA', 'Addis Ababa'),
  17. array(231, 'ET-DD', 'Dire Dawa'),
  18. array(231, 'ET-AF', 'Afar'),
  19. array(231, 'ET-AM', 'Amara'),
  20. array(231, 'ET-BE', 'Benshangul-Gumaz'),
  21. array(231, 'ET-GA', 'Gambela Peoples'),
  22. array(231, 'ET-HA', 'Harari People'),
  23. array(231, 'ET-OR', 'Oromia'),
  24. array(231, 'ET-SO', 'Somali'),
  25. array(231, 'ET-TI', 'Tigrai'),
  26. array(231, 'ET-SN', 'Southern Nations, Nationalities and Peoples'),
  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. 231,
  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. }