seychelles_690_1.cif 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function seychelles_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' => 690,
  12. 'country_name' => 'Seychelles',
  13. 'country_iso_code_2' => 'SC',
  14. 'country_iso_code_3' => 'SYC',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(690, '01', 'Anse aux Pins'),
  21. array(690, '02', 'Anse Boileau'),
  22. array(690, '03', 'Anse Etoile'),
  23. array(690, '04', 'Anse Louis'),
  24. array(690, '05', 'Anse Royale'),
  25. array(690, '06', 'Baie Lazare'),
  26. array(690, '07', 'Baie Sainte Anne'),
  27. array(690, '08', 'Beau Vallon'),
  28. array(690, '09', 'Bel Air'),
  29. array(690, '10', 'Bel Ombre'),
  30. array(690, '11', 'Cascade'),
  31. array(690, '12', 'Glacis'),
  32. array(690, '13', "Grand' Anse Mahe"),
  33. array(690, '14', "Grand' Anse Praslin"),
  34. array(690, '15', 'La Digue'),
  35. array(690, '16', 'La Riviere Anglaise'),
  36. array(690, '17', 'Mont Buxton'),
  37. array(690, '18', 'Mont Fleuri'),
  38. array(690, '19', 'Plaisance'),
  39. array(690, '20', 'Pointe La Rue'),
  40. array(690, '21', 'Port Glaud'),
  41. array(690, '22', 'Saint Louis'),
  42. array(690, '23', 'Takamaka'),
  43. );
  44. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  45. foreach ($zones as $zone) {
  46. $query->values($zone);
  47. }
  48. $query->execute();
  49. // Set address format
  50. uc_set_address_format(
  51. 690,
  52. "!company\r\n".
  53. "!first_name !last_name\r\n".
  54. "!street1\r\n".
  55. "!street2\r\n".
  56. "!city !zone_code !postal_code\r\n".
  57. "!country_name_if"
  58. );
  59. }