nepal_524_1.cif 1.6 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 nepal_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' => 524,
  12. 'country_name' => 'Nepal',
  13. 'country_iso_code_2' => 'NP',
  14. 'country_iso_code_3' => 'NPL',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(524, '2', 'Madhya Pashchimanchal'),
  21. array(524, '1', 'Madhyamanchal'),
  22. array(524, '3', 'Pashchimanchal'),
  23. array(524, '4', 'Purwanchal'),
  24. array(524, '5', 'Sudur Pashchimanchal'),
  25. array(524, 'BA', 'Bagmati'),
  26. array(524, 'JA', 'Janakpur'),
  27. array(524, 'NA', 'Narayani'),
  28. array(524, 'BH', 'Bheri'),
  29. array(524, 'KA', 'Karnali'),
  30. array(524, 'RA', 'Rapti'),
  31. array(524, 'DH', 'Dhawalagiri'),
  32. array(524, 'GA', 'Gandaki'),
  33. array(524, 'LU', 'Lumbini'),
  34. array(524, 'KO', 'Koshi'),
  35. array(524, 'KO', 'Kosi'),
  36. array(524, 'ME', 'Mechi'),
  37. array(524, 'SA', 'Sagarmatha'),
  38. array(524, 'MA', 'Mahakali'),
  39. array(524, 'SE', 'Seti'),
  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. 524,
  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. }