syria_760_1.cif 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function syria_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' => 760,
  12. 'country_name' => 'Syrian Arab Republic',
  13. 'country_iso_code_2' => 'SY',
  14. 'country_iso_code_3' => 'SYR',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(760, 'SY-HA', 'Al Hasakah'),
  21. array(760, 'SY-LA', 'Al Lādhiqīyah'),
  22. array(760, 'SY-QU', 'Al Qunayţirah'),
  23. array(760, 'SY-RA', 'Ar Raqqah'),
  24. array(760, 'SY-SU', "As Suwaydā'"),
  25. array(760, 'SY-DR', 'Darٰā'),
  26. array(760, 'SY-DY', 'Dayr az Zawr'),
  27. array(760, 'SY-DI', 'Dimashq'),
  28. array(760, 'SY-HL', 'Halab'),
  29. array(760, 'SY-HM', 'Hamāh'),
  30. array(760, 'SY-HI', 'Himş'),
  31. array(760, 'SY-ID', 'Idlib'),
  32. array(760, 'SY-RD', 'Rīf Dimashq'),
  33. array(760, 'SY-TA', 'Ţarţūs'),
  34. );
  35. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  36. foreach ($zones as $zone) {
  37. $query->values($zone);
  38. }
  39. $query->execute();
  40. // Set address format
  41. uc_set_address_format(
  42. 760,
  43. "!company\r\n" .
  44. "!first_name !last_name\r\n" .
  45. "!street1\r\n" .
  46. "!street2\r\n" .
  47. "!city, !zone_name !postal_code\r\n" .
  48. "!country_name_if"
  49. );
  50. }