malaysia_458_1.cif 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. function malaysia_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' => 458,
  8. 'country_name' => 'Malaysia',
  9. 'country_iso_code_2' => 'MY',
  10. 'country_iso_code_3' => 'MYS',
  11. 'version' => 1,
  12. ))
  13. ->execute();
  14. // Make the entries in the zones table.
  15. $zones = array(
  16. array(458, 'JHR', 'Johor'),
  17. array(458, 'KDH', 'Kedah'),
  18. array(458, 'KTN', 'Kelantan'),
  19. array(458, 'MLK', 'Melaka'),
  20. array(458, 'NSN', 'Negeri Sembilan'),
  21. array(458, 'PHG', 'Pahang'),
  22. array(458, 'PNG', 'Pulau Pinang'),
  23. array(458, 'PRK', 'Perak'),
  24. array(458, 'PLS', 'Perlis'),
  25. array(458, 'SGR', 'Selangor'),
  26. array(458, 'TRG', 'Terengganu'),
  27. array(458, 'SBH', 'Sabah'),
  28. array(458, 'SRW', 'Sarawak'),
  29. array(458, 'KUL', 'Kuala Lumpur'),
  30. array(458, 'LBN', 'Labuan'),
  31. array(458, 'PJY', 'Putrajaya'),
  32. );
  33. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  34. foreach ($zones as $zone) {
  35. $query->values($zone);
  36. }
  37. $query->execute();
  38. // Set address format
  39. uc_set_address_format(
  40. 458,
  41. "!company\r\n".
  42. "!first_name !last_name\r\n".
  43. "!street1\r\n".
  44. "!street2\r\n".
  45. "!city, !zone_code !postal_code\r\n".
  46. "!country_name_if"
  47. );
  48. }