<?php
// $Id: congo_democratic_republic_of_180_1.cif,v 1.1 2011-02-23 10:24:03 tr Exp $

function congo_democratic_republic_of_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' => 180,
      'country_name' => 'Congo, the Democratic Republic of the',
      'country_iso_code_2' => 'CD',
      'country_iso_code_3' => 'COD',
      'version' => 1,
    ))
    ->execute();

  // Make the entries in the zones table.
  $zones = array(
    array(180, 'CD-KN', 'Kinshasa'),
    array(180, 'CD-BN', 'Bandundu'),
    array(180, 'CD-BC', 'Bas-Congo'),
    array(180, 'CD-EQ', 'Equateur'),
    array(180, 'CD-KW', 'Kasai-Occidental'),
    array(180, 'CD-KE', 'Kasai-Oriental'),
    array(180, 'CD-KA', 'Katanga'),
    array(180, 'CD-MA', 'Maniema'),
    array(180, 'CD-NK', 'Nord-Kivu'),
    array(180, 'CD-OR', 'Orientale'),
    array(180, 'CD-SK', 'Sud-Kivu'),
  );

  $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(
    180,
    "!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"
  );
}
