afghanistan_4_1.cif 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function afghanistan_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' => 4,
  12. 'country_name' => 'Afghanistan',
  13. 'country_iso_code_2' => 'AF',
  14. 'country_iso_code_3' => 'AFG',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. // VALUES = Parent Country ID, Zone Abbreviation, Zone Name
  20. $zones = array(
  21. array(4, 'BDS', 'Badakhshan'),
  22. array(4, 'BDG', 'Badghis'),
  23. array(4, 'BGL', 'Baghlan'),
  24. array(4, 'BAL', 'Balkh'),
  25. array(4, 'BAM', 'Bamian'),
  26. array(4, 'FRA', 'Farah'),
  27. array(4, 'FYB', 'Faryab'),
  28. array(4, 'GHA', 'Ghazni'),
  29. array(4, 'GHO', 'Ghowr'),
  30. array(4, 'HEL', 'Helmand'),
  31. array(4, 'HER', 'Herat'),
  32. array(4, 'JOW', 'Jowzjan'),
  33. array(4, 'KAB', 'Kabul'),
  34. array(4, 'KAN', 'Kandahar'),
  35. array(4, 'KAP', 'Kapisa'),
  36. array(4, 'KHO', 'Khost'),
  37. array(4, 'KNR', 'Konar'),
  38. array(4, 'KDZ', 'Kondoz'),
  39. array(4, 'LAG', 'Laghman'),
  40. array(4, 'LOW', 'Lowgar'),
  41. array(4, 'NAN', 'Nangrahar'),
  42. array(4, 'NIM', 'Nimruz'),
  43. array(4, 'NUR', 'Nurestan'),
  44. array(4, 'ORU', 'Oruzgan'),
  45. array(4, 'PIA', 'Paktia'),
  46. array(4, 'PKA', 'Paktika'),
  47. array(4, 'PAR', 'Parwan'),
  48. array(4, 'SAM', 'Samangan'),
  49. array(4, 'SAR', 'Sar-e Pol'),
  50. array(4, 'TAK', 'Takhar'),
  51. array(4, 'WAR', 'Wardak'),
  52. array(4, 'ZAB', 'Zabol'),
  53. );
  54. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  55. foreach ($zones as $zone) {
  56. $query->values($zone);
  57. }
  58. $query->execute();
  59. // Set address format
  60. uc_set_address_format(
  61. 4,
  62. "!company\r\n".
  63. "!first_name !last_name\r\n".
  64. "!street1\r\n".
  65. "!street2\r\n".
  66. "!city, !zone_code !postal_code\r\n".
  67. "!country_name_if"
  68. );
  69. }