kazakhstan_398_1.cif 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function kazakhstan_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' => 398,
  12. 'country_name' => 'Kazakhstan',
  13. 'country_iso_code_2' => 'KZ',
  14. 'country_iso_code_3' => 'KAZ',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. $zones = array(
  19. array(398, 'ALA', 'Алматы'),
  20. array(398, 'TSE', 'Астана'),
  21. array(398, 'AKM', 'Акмолинская область'),
  22. array(398, 'AKT', 'Актюбинская область'),
  23. array(398, 'ALM', 'Алматинская область'),
  24. array(398, 'ATR', 'Атырауская область'),
  25. array(398, 'EKZ', 'Восточно-Казахстанская область'),
  26. array(398, 'DZH', 'Жамбылская область'),
  27. array(398, 'WKZ', 'Западно-Казахстанская область'),
  28. array(398, 'KAR', 'Карагандинская область'),
  29. array(398, 'KOR', 'Кызылординская область'),
  30. array(398, 'KUS', 'Костанайская область'),
  31. array(398, 'MAN', 'Мангистауская область'),
  32. array(398, 'PVL', 'Павлодарская область'),
  33. array(398, 'NKZ', 'Северо-Казахстанская область'),
  34. array(398, 'SKZ', 'Южно-Казахстанская область'),
  35. );
  36. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  37. foreach ($zones as $zone) {
  38. $query->values($zone);
  39. }
  40. $query->execute();
  41. // Set address format
  42. uc_set_address_format(
  43. 398,
  44. "!company\r\n" .
  45. "!first_name !last_name\r\n" .
  46. "!street1\r\n" .
  47. "!street2\r\n" .
  48. "!postal_code !city\r\n" .
  49. "!country_name_if"
  50. );
  51. }