georgia_268_1.cif 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function georgia_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' => 268,
  12. 'country_name' => 'Georgia',
  13. 'country_iso_code_2' => 'GE',
  14. 'country_iso_code_3' => 'GEO',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(268, 'AB', 'Abkhazia'),
  21. array(268, 'AJ', 'Ajaria'),
  22. array(268, 'GU', 'Guria'),
  23. array(268, 'IM', "Imeret'i"),
  24. array(268, 'KA', "Kakhet'i"),
  25. array(268, 'KK', "K'vemo K'art'li"),
  26. array(268, 'MM', "Mts'khet'a-Mt'ianet'i"),
  27. array(268, 'RL', "Racha-Lech'khumi-K'vemo"),
  28. array(268, 'SZ', "Samegrelo-Zemo Svanet'i"),
  29. array(268, 'SJ', "Samts'khe-Javakhet'i"),
  30. array(268, 'SK', "Shida K'art'li"),
  31. array(268, 'TB', "T'bilisi"),
  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. 268,
  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. }