tunisia_788_1.cif 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function tunisia_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' => 788,
  12. 'country_name' => 'Tunisia',
  13. 'country_iso_code_2' => 'TN',
  14. 'country_iso_code_3' => 'TUN',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(788, '31', 'Beja'),
  21. array(788, '13', 'Ben Arous'),
  22. array(788, '23', 'Bizerte'),
  23. array(788, '81', 'Gabes'),
  24. array(788, '71', 'Gafsa'),
  25. array(788, '32', 'Jendouba'),
  26. array(788, '41', 'Kairouan'),
  27. array(788, '42', 'Kasserine'),
  28. array(788, '73', 'Kebili'),
  29. array(788, '14', 'La Manouba'),
  30. array(788, '12', "L'Ariana"),
  31. array(788, '33', 'Le Kef'),
  32. array(788, '53', 'Mahdia'),
  33. array(788, '82', 'Medenine'),
  34. array(788, '52', 'Monastir'),
  35. array(788, '21', 'Nabeul'),
  36. array(788, '61', 'Sfax'),
  37. array(788, '43', 'Sidi Bouzid'),
  38. array(788, '34', 'Siliana'),
  39. array(788, '51', 'Sousse'),
  40. array(788, '83', 'Tataouine'),
  41. array(788, '72', 'Tozeur'),
  42. array(788, '11', 'Tunis'),
  43. array(788, '22', 'Zaghouan'),
  44. );
  45. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  46. foreach ($zones as $zone) {
  47. $query->values($zone);
  48. }
  49. $query->execute();
  50. // Set address format
  51. uc_set_address_format(
  52. 788,
  53. "!company\r\n".
  54. "!first_name !last_name\r\n".
  55. "!street1\r\n".
  56. "!street2\r\n".
  57. "!city !zone_code !postal_code\r\n".
  58. "!country_name_if"
  59. );
  60. }