brunei_darussalam_96_3.cif 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. function brunei_darussalam_install() {
  3. // Make the entry in the country table.
  4. // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  5. db_insert('uc_countries')
  6. ->fields(array(
  7. 'country_id' => 96,
  8. 'country_name' => 'Brunei Darussalam',
  9. 'country_iso_code_2' => 'BN',
  10. 'country_iso_code_3' => 'BRN',
  11. 'version' => 3,
  12. ))
  13. ->execute();
  14. // Make the entries in the zones table.
  15. $zones = array(
  16. array(96, 'BN-BE', 'Belait'),
  17. array(96, 'BN-BM', 'Brunei-Muara'),
  18. array(96, 'BN-TE', 'Temburong'),
  19. array(96, 'BN-TU', 'Tutong'),
  20. );
  21. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  22. foreach ($zones as $zone) {
  23. $query->values($zone);
  24. }
  25. $query->execute();
  26. // Set address format
  27. uc_set_address_format(
  28. 96,
  29. "!company\r\n".
  30. "!first_name !last_name\r\n".
  31. "!street1\r\n".
  32. "!street2\r\n".
  33. "!city !postal_code\r\n".
  34. "!zone_name\r\n".
  35. "!country_name_if"
  36. );
  37. }
  38. function brunei_darussalam_update($version) {
  39. switch ($version) {
  40. case 2:
  41. // Correct the address format
  42. uc_set_address_format(
  43. 96,
  44. "!company\r\n".
  45. "!first_name !last_name\r\n".
  46. "!street1\r\n".
  47. "!street2\r\n".
  48. "!city !postal_code\r\n".
  49. "!zone_name\r\n".
  50. "!country_name_if"
  51. );
  52. break;
  53. case 3:
  54. // Correct ISO-3166-1 country name
  55. db_update('uc_countries')
  56. ->fields(array('country_name' => 'Brunei Darussalam'))
  57. ->condition('country_id', 96)
  58. ->execute();
  59. break;
  60. }
  61. }