rwanda_646_1.cif 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function rwanda_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' => 646,
  12. 'country_name' => 'Rwanda',
  13. 'country_iso_code_2' => 'RW',
  14. 'country_iso_code_3' => 'RWA',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(646, 'RW-01', 'Ville de Kigali'),
  21. array(646, 'RW-02', 'Est'),
  22. array(646, 'RW-03', 'Nord'),
  23. array(646, 'RW-04', 'Ouest'),
  24. array(646, 'RW-05', 'Sud'),
  25. );
  26. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  27. foreach ($zones as $zone) {
  28. $query->values($zone);
  29. }
  30. $query->execute();
  31. // Set address format
  32. uc_set_address_format(
  33. 646,
  34. "!company\r\n" .
  35. "!first_name !last_name\r\n" .
  36. "!street1\r\n" .
  37. "!street2\r\n" .
  38. "!city, !zone_name !postal_code\r\n" .
  39. "!country_name_if"
  40. );
  41. }