iraq_368_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 iraq_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' => 368,
  12. 'country_name' => 'Iraq',
  13. 'country_iso_code_2' => 'IQ',
  14. 'country_iso_code_3' => 'IRQ',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(368, 'IQ-AN', 'Al Anbār'),
  21. array(368, 'IQ-BA', 'Al Başrah'),
  22. array(368, 'IQ-MU', 'Al Muthanná'),
  23. array(368, 'IQ-QA', 'Al Qādisīyah'),
  24. array(368, 'IQ-NA', 'An Najaf'),
  25. array(368, 'IQ-AR', 'Arbīl'),
  26. array(368, 'IQ-SU', 'As Sulaymānīyah'),
  27. array(368, 'IQ-TS', "At Ta'mīm"),
  28. array(368, 'IQ-BB', 'Babil !Bābil'),
  29. array(368, 'IQ-BG', 'Baghdād'),
  30. array(368, 'IQ-DA', 'Dahūk'),
  31. array(368, 'IQ-DQ', 'Dhī Qār'),
  32. array(368, 'IQ-DI', 'Diyālá'),
  33. array(368, 'IQ-KA', "Karbalā'"),
  34. array(368, 'IQ-MA', 'Maysān'),
  35. array(368, 'IQ-NI', 'Nīnawá'),
  36. array(368, 'IQ-SD', 'Şalāḩ ad Dīn'),
  37. array(368, 'IQ-WA', 'Wāsiţ'),
  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. 368,
  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. }