paraguay_600_1.cif 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function paraguay_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' => 600,
  12. 'country_name' => 'Paraguay',
  13. 'country_iso_code_2' => 'PY',
  14. 'country_iso_code_3' => 'PRY',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(600, 'PY-ASU', 'Asunción'),
  21. array(600, 'PY-16', 'Alto Paraguay'),
  22. array(600, 'PY-10', 'Alto Paraná'),
  23. array(600, 'PY-13', 'Amambay'),
  24. array(600, 'PY-19', 'Boquerón'),
  25. array(600, 'PY-05', 'Caaguazú'),
  26. array(600, 'PY-06', 'Caazapá'),
  27. array(600, 'PY-14', 'Canindeyú'),
  28. array(600, 'PY-11', 'Central'),
  29. array(600, 'PY-01', 'Concepción'),
  30. array(600, 'PY-03', 'Cordillera'),
  31. array(600, 'PY-04', 'Guairá'),
  32. array(600, 'PY-07', 'Itapúa'),
  33. array(600, 'PY-08', 'Misiones'),
  34. array(600, 'PY-12', 'Ñeembucú'),
  35. array(600, 'PY-09', 'Paraguarí'),
  36. array(600, 'PY-15', 'Presidente Hayes'),
  37. array(600, 'PY-02', 'San Pedro'),
  38. );
  39. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  40. foreach ($zones as $zone) {
  41. $query->values($zone);
  42. }
  43. $query->execute();
  44. // Set address format
  45. uc_set_address_format(
  46. 600,
  47. "!company\r\n" .
  48. "!first_name !last_name\r\n" .
  49. "!street1\r\n" .
  50. "!street2\r\n" .
  51. "!city, !zone_name !postal_code\r\n" .
  52. "!country_name_if"
  53. );
  54. }