mauritania_478_1.cif 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function mauritania_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' => 478,
  12. 'country_name' => 'Mauritania',
  13. 'country_iso_code_2' => 'MR',
  14. 'country_iso_code_3' => 'MRT',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(478, 'MR-NKC', 'Nouakchott'),
  21. array(478, 'MR-07', 'Adrar'),
  22. array(478, 'MR-03', 'Assaba'),
  23. array(478, 'MR-05', 'Brakna'),
  24. array(478, 'MR-08', 'Dakhlet Nouâdhibou'),
  25. array(478, 'MR-04', 'Gorgol'),
  26. array(478, 'MR-10', 'Guidimaka'),
  27. array(478, 'MR-01', 'Hodh ech Chargui'),
  28. array(478, 'MR-02', 'Hodh el Gharbi'),
  29. array(478, 'MR-12', 'Inchiri'),
  30. array(478, 'MR-09', 'Tagant'),
  31. array(478, 'MR-11', 'Tiris Zemmour'),
  32. array(478, 'MR-06', 'Trarza'),
  33. );
  34. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  35. foreach ($zones as $zone) {
  36. $query->values($zone);
  37. }
  38. $query->execute();
  39. // Set address format
  40. uc_set_address_format(
  41. 478,
  42. "!company\r\n" .
  43. "!first_name !last_name\r\n" .
  44. "!street1\r\n" .
  45. "!street2\r\n" .
  46. "!city, !zone_name !postal_code\r\n" .
  47. "!country_name_if"
  48. );
  49. }