cambodia_116_1.cif 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function cambodia_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' => 116,
  12. 'country_name' => 'Cambodia',
  13. 'country_iso_code_2' => 'KH',
  14. 'country_iso_code_3' => 'KHM',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(116, '2', 'Baat Dambang'),
  21. array(116, '1', 'Banteay Mean Chey'),
  22. array(116, '1', 'Banteay Meanchey'),
  23. array(116, '2', 'Batdambang'),
  24. array(116, '3', 'Kampong Chaam'),
  25. array(116, '3', 'Kampong Cham'),
  26. array(116, '4', 'Kampong Chhnang'),
  27. array(116, '5', 'Kampong Spoe'),
  28. array(116, '5', 'Kampong Spueu'),
  29. array(116, '6', 'Kampong Thum'),
  30. array(116, '7', 'Kampot'),
  31. array(116, '8', 'Kandaal'),
  32. array(116, '8', 'Kandal'),
  33. array(116, '9', 'Kaoh Kong'),
  34. array(116, '10', 'Kracheh'),
  35. array(116, '23', 'Krong Kaeb'),
  36. array(116, '23', 'Krong Keb'),
  37. array(116, '24', 'Krong Pailin'),
  38. array(116, '18', 'Krong Preah Sihanouk'),
  39. array(116, '11', 'Mondol Kiri'),
  40. array(116, '22', 'Otdar Mean Chey'),
  41. array(116, '22', 'Otdar Meanchey'),
  42. array(116, '12', 'Phnom Penh'),
  43. array(116, '12', 'Phnum Penh'),
  44. array(116, '15', 'Pousaat'),
  45. array(116, '15', 'Pouthisat'),
  46. array(116, '13', 'Preah Vihear'),
  47. array(116, '14', 'Prey Veaeng'),
  48. array(116, '14', 'Prey Veng'),
  49. array(116, '16', 'Rotanak Kiri'),
  50. array(116, '16', 'Rotanokiri'),
  51. array(116, '17', 'Siem Reab'),
  52. array(116, '17', 'Siemreab'),
  53. array(116, '19', 'Stoeng Treng'),
  54. array(116, '19', 'Stueng Traeng'),
  55. array(116, '20', 'Svaay Rieng'),
  56. array(116, '20', 'Svay Rieng'),
  57. array(116, '21', 'Taakaev'),
  58. array(116, '21', 'Takev'),
  59. );
  60. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  61. foreach ($zones as $zone) {
  62. $query->values($zone);
  63. }
  64. $query->execute();
  65. // Set address format
  66. uc_set_address_format(
  67. 116,
  68. "!company\r\n".
  69. "!first_name !last_name\r\n".
  70. "!street1\r\n".
  71. "!street2\r\n".
  72. "!city !zone_code !postal_code\r\n".
  73. "!country_name_if"
  74. );
  75. }