papua_new_guinea_598_1.cif 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function papua_new_guinea_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' => 598,
  12. 'country_name' => 'Papua New Guinea',
  13. 'country_iso_code_2' => 'PG',
  14. 'country_iso_code_3' => 'PNG',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(598, 'CPM', 'Central'),
  21. array(598, 'CPK', 'Chimbu'),
  22. array(598, 'EHG', 'Eastern Highlands'),
  23. array(598, 'EBR', 'East New Britain'),
  24. array(598, 'ESW', 'East Sepik'),
  25. array(598, 'EPW', 'Enga'),
  26. array(598, 'GPK', 'Gulf'),
  27. array(598, 'MPM', 'Madang'),
  28. array(598, 'MRL', 'Manus'),
  29. array(598, 'MBA', 'Milne Bay'),
  30. array(598, 'MPL', 'Morobe'),
  31. array(598, 'NCD', 'National Capital District (Port Moresby)'),
  32. array(598, 'NIK', 'New Ireland'),
  33. array(598, 'NPP', 'Northern'),
  34. array(598, 'NSA', 'North Solomons'),
  35. array(598, 'SAN', 'Sandaun [West Sepik]'),
  36. array(598, 'SHM', 'Southern Highlands'),
  37. array(598, 'WPD', 'Western'),
  38. array(598, 'WHM', 'Western Highlands'),
  39. array(598, 'WBK', 'West New Britain'),
  40. );
  41. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  42. foreach ($zones as $zone) {
  43. $query->values($zone);
  44. }
  45. $query->execute();
  46. // Set address format
  47. uc_set_address_format(
  48. 598,
  49. "!company\r\n".
  50. "!first_name !last_name\r\n".
  51. "!street1\r\n".
  52. "!street2\r\n".
  53. "!city !zone_code !postal_code\r\n".
  54. "!country_name_if"
  55. );
  56. }