<?php

function yemen_install() {
  // Make the entry in the country table.


   db_query("INSERT INTO {uc_countries} (country_id, country_name, country_iso_code_2, country_iso_code_3, version)
    VALUES ('887', 'Yemen', 'YE', 'YEM', 1)");

  // Make the entries in the zones table.
  $zones = array(
    array(887, 'YE-SA', "Şan‘ā' [city]"),
    array(887, 'YE-AB', 'Abyān'),
    array(887, 'YE-AD', "'Adan"),
    array(887, 'YE-DA', "Aḑ Ḑāli'"),
    array(887, 'YE-BA', "Al Bayḑā'"),
    array(887, 'YE-HU', 'Al Ḩudaydah'),
    array(887, 'YE-JA', 'Al Jawf'),
    array(887, 'YE-MR', 'Al Mahrah'),
    array(887, 'YE-MW', 'Al Maḩwīt'),
    array(887, 'YE-AM', "'Amrān"),
    array(887, 'YE-DH', 'Dhamār'),
    array(887, 'YE-HD', 'Ḩaḑramawt'),
    array(887, 'YE-HJ', 'Ḩajjah'),
    array(887, 'YE-IB', 'Ibb'),
    array(887, 'YE-LA', 'Laḩij'),
    array(887, 'YE-MA', "Ma'rib"),
    array(887, 'YE-RA', 'Raymah'),
    array(887, 'YE-SD', 'Şā‘dah'),
    array(887, 'YE-SN', "Şan‘ā'"),
    array(887, 'YE-SH', 'Shabwah'),
    array(887, 'YE-TA', 'Tā‘izz'),
  );

foreach ($zones as $zone) {
    db_query("INSERT INTO {uc_zones} (zone_country_id, zone_code, zone_name) VALUES (%d, '%s', '%s')", $zone);
  }

  // Set address format
  uc_set_address_format(
    887,
    "!company\r\n".
    "!first_name !last_name\r\n".
    "!street1\r\n".
    "!street2\r\n".
    "!city, !zone_name  !postal_code\r\n".
    "!country_name_if"
  );
}
