slovakia_703_1.cif 1.3 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 slovakia_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' => 703,
  12. 'country_name' => 'Slovakia',
  13. 'country_iso_code_2' => 'SK',
  14. 'country_iso_code_3' => 'SVK',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(703, 'BC', 'Banskobystricky kraj'),
  21. array(703, 'BL', 'Bratislavsky kraj'),
  22. array(703, 'KI', 'Kosicky kraj'),
  23. array(703, 'NI', 'Nitriansky kraj'),
  24. array(703, 'PV', 'Presovsky kraj'),
  25. array(703, 'TC', 'Trenciansky kraj'),
  26. array(703, 'TA', 'Trnavsky kraj'),
  27. array(703, 'ZI', 'Zilinsky kraj'),
  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. 703,
  37. "!company\r\n".
  38. "!first_name !last_name\r\n".
  39. "!street1\r\n".
  40. "!street2\r\n".
  41. "!city !zone_code !postal_code\r\n".
  42. "!country_name_if"
  43. );
  44. }