burundi_108_1.cif 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function burundi_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' => 108,
  12. 'country_name' => 'Burundi',
  13. 'country_iso_code_2' => 'BI',
  14. 'country_iso_code_3' => 'BDI',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(108, 'BB', 'Bubanza'),
  21. array(108, 'BM', 'Bujumbura Mairie'),
  22. array(108, 'BJ', 'Bujumbura Rural'),
  23. array(108, 'BR', 'Bururi'),
  24. array(108, 'CA', 'Cankuzo'),
  25. array(108, 'CI', 'Cibitoke'),
  26. array(108, 'GI', 'Gitega'),
  27. array(108, 'KR', 'Karuzi'),
  28. array(108, 'KY', 'Kayanza'),
  29. array(108, 'KI', 'Kirundo'),
  30. array(108, 'MA', 'Makamba'),
  31. array(108, 'MU', 'Muramvya'),
  32. array(108, 'MY', 'Muyinga'),
  33. array(108, 'MW', 'Mwaro'),
  34. array(108, 'NG', 'Ngozi'),
  35. array(108, 'RT', 'Rutana'),
  36. array(108, 'RY', 'Ruyigi'),
  37. );
  38. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  39. foreach ($zones as $zone) {
  40. $query->values($zone);
  41. }
  42. $query->execute();
  43. // Set address format
  44. uc_set_address_format(
  45. 108,
  46. "!company\r\n" .
  47. "!first_name !last_name\r\n" .
  48. "!street1\r\n" .
  49. "!street2\r\n" .
  50. "!city, !zone_code !postal_code\r\n" .
  51. "!country_name_if"
  52. );
  53. }