<?php

function guinea_install() {
  // Make the entry in the country table.
  // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  db_query("INSERT INTO {uc_countries} (country_id, country_name, country_iso_code_2, country_iso_code_3, version)
  VALUES ('324', 'Guinea', 'GN', 'GIN', 1)");

  // Make the entries in the zones table.
  $zones = array(
    array(324, 'GN-BE', 'Beyla'),
    array(324, 'GN-BF', 'Boffa'),
    array(324, 'GN-BK', 'Boké'),
    array(324, 'GN-CO', 'Coyah'),
    array(324, 'GN-DB', 'Dabola'),
    array(324, 'GN-DL', 'Dalaba'),
    array(324, 'GN-DI', 'Dinguiraye'),
    array(324, 'GN-DU', 'Dubréka'),
    array(324, 'GN-FA', 'Faranah'),
    array(324, 'GN-FO', 'Forécariah'),
    array(324, 'GN-FR', 'Fria'),
    array(324, 'GN-GA', 'Gaoual'),
    array(324, 'GN-GU', 'Guékédou'),
    array(324, 'GN-KA', 'Kankan'),
    array(324, 'GN-KE', 'Kérouané'),
    array(324, 'GN-KD', 'Kindia'),
    array(324, 'GN-KS', 'Kissidougou'),
    array(324, 'GN-KB', 'Koubia'),
    array(324, 'GN-KN', 'Koundara'),
    array(324, 'GN-KO', 'Kouroussa'),
    array(324, 'GN-LA', 'Labé'),
    array(324, 'GN-LE', 'Lélouma'),
    array(324, 'GN-LO', 'Lola'),
    array(324, 'GN-MC', 'Macenta'),
    array(324, 'GN-ML', 'Mali'),
    array(324, 'GN-MM', 'Mamou'),
    array(324, 'GN-MD', 'Mandiana'),
    array(324, 'GN-NZ', 'Nzérékor'),
    array(324, 'GN-PI', 'Pita'),
    array(324, 'GN-SI', 'Siguiri'),
    array(324, 'GN-TE', 'Télimélé'),
    array(324, 'GN-TO', 'Tougué'),
    array(324, 'GN-YO', 'Yomou'),
  );

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

  // Use uc_set_address_format() with the country ID as the first argument and
  // an address format string as the second.  Documentation on address formats
  // is available at:
  // http://www.ubercart.org/ubercart_users_guide/country_settings#address_format_docs
  uc_set_address_format(324,
    "!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");
}
