kyrgyzstan_417_1.cif 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function kyrgyzstan_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' => 417,
  12. 'country_name' => 'Kyrgyzstan',
  13. 'country_iso_code_2' => 'KG',
  14. 'country_iso_code_3' => 'KGZ',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(417, 'KG-GB', 'Bishkek'),
  21. array(417, 'KG-B', 'Batken'),
  22. array(417, 'KG-C', 'Chü'),
  23. array(417, 'KG-J', 'Jalal-Abad'),
  24. array(417, 'KG-N', 'Naryn'),
  25. array(417, 'KG-O', 'Osh'),
  26. array(417, 'KG-T', 'Talas'),
  27. array(417, 'KG-Y', 'Ysyk-Köl'),
  28. );
  29. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  30. foreach ($zones as $zone) {
  31. $query->values($zone);
  32. }
  33. $query->execute();
  34. // Set address format
  35. uc_set_address_format(
  36. 417,
  37. "!company\r\n" .
  38. "!first_name !last_name\r\n" .
  39. "!street1\r\n" .
  40. "!street2\r\n" .
  41. "!city, !zone_name !postal_code\r\n" .
  42. "!country_name_if"
  43. );
  44. }