<?php

function burkina_faso_install() {
  // Make the entry in the country table.
  // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  db_insert('uc_countries')
    ->fields(array(
      'country_id' => 854,
      'country_name' => 'Burkina Faso',
      'country_iso_code_2' => 'BF',
      'country_iso_code_3' => 'BFA',
      'version' => 1,
    ))
    ->execute();

  // Make the entries in the zones table.
  $zones = array(
    array(854, 'BAL', 'Bale'),
    array(854, 'BAM', 'Bam'),
    array(854, 'BAN', 'Banwa'),
    array(854, 'BAZ', 'Bazega'),
    array(854, 'BGR', 'Bougouriba'),
    array(854, 'BLG', 'Boulgou'),
    array(854, 'BLK', 'Boulkiemde'),
    array(854, 'COM', 'Comoe'),
    array(854, 'GAN', 'Ganzourgou'),
    array(854, 'GNA', 'Gnagna'),
    array(854, 'GOU', 'Gourma'),
    array(854, 'HOU', 'Houet'),
    array(854, 'IOB', 'Ioba'),
    array(854, 'KAD', 'Kadiogo'),
    array(854, 'KEN', 'Kenedougou'),
    array(854, 'KMD', 'Komandjoari'),
    array(854, 'KMP', 'Kompienga'),
    array(854, 'KOS', 'Kossi'),
    array(854, 'KOP', 'Koulpelogo'),
    array(854, 'KOT', 'Kouritenga'),
    array(854, 'KOW', 'Kourweogo'),
    array(854, 'LER', 'Leraba'),
    array(854, 'LOR', 'Loroum'),
    array(854, 'MOU', 'Mouhoun'),
    array(854, 'NAO', 'Nahouri'),
    array(854, 'NAM', 'Namentenga'),
    array(854, 'NAY', 'Nayala'),
    array(854, 'NOU', 'Noumbiel'),
    array(854, 'OUB', 'Oubritenga'),
    array(854, 'OUD', 'Oudalan'),
    array(854, 'PAS', 'Passore'),
    array(854, 'PON', 'Poni'),
    array(854, 'SNG', 'Sanguie'),
    array(854, 'SMT', 'Sanmatenga'),
    array(854, 'SEN', 'Seno'),
    array(854, 'SIS', 'Sissili'),
    array(854, 'SOM', 'Soum'),
    array(854, 'SOR', 'Sourou'),
    array(854, 'TAP', 'Tapoa'),
    array(854, 'TUI', 'Tuy'),
    array(854, 'YAG', 'Yagha'),
    array(854, 'YAT', 'Yatenga'),
    array(854, 'ZIR', 'Ziro'),
    array(854, 'ZON', 'Zondoma'),
    array(854, 'ZOU', 'Zoundweogo'),
  );

  $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  foreach ($zones as $zone) {
    $query->values($zone);
  }
  $query->execute();

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