<?php
// $Id: colombia_170_1.cif,v 1.1.2.3 2010/04/14 05:18:19 tr Exp $ 1.0.0

/**
 * First implement hook_install() using the name of the country as the base of
 * the function name.
 */
function colombia_install() {
  db_query("INSERT INTO {uc_countries} (country_id, country_name, country_iso_code_2, country_iso_code_3, version) VALUES (170, 'Colombia', 'CO', 'COL', 1)");

  // Make the entries in the zones table.
  $zones = array(
    array(170, 'AMA', 'Amazonas'),
    array(170, 'ANT', 'Antioquia'),
    array(170, 'ARA', 'Arauca'),
    array(170, 'ATL', 'Atlantico'),
    array(170, 'BOL', 'Bolivar'),
    array(170, 'CAL', 'Caldas'),
    array(170, 'CAQ', 'Caqueta'),
    array(170, 'CAS', 'Casanare'),
    array(170, 'CAU', 'Cauca'),
    array(170, 'CES', 'Cesar'),
    array(170, 'CHO', 'Choco'),
    array(170, 'COR', 'Cordoba'),
    array(170, 'CUN', 'Cundinamarca'),
    array(170, 'DC', 'Distrito Capital de Bogota'),
    array(170, 'GUA', 'Guainia'),
    array(170, 'GUV', 'Guaviare'),
    array(170, 'HUI', 'Huila'),
    array(170, 'LAG', 'La Guajira'),
    array(170, 'MAG', 'Magdalena'),
    array(170, 'MET', 'Meta'),
    array(170, 'NAR', 'Narino'),
    array(170, 'NSA', 'Norte de Santander'),
    array(170, 'PUT', 'Putumayo'),
    array(170, 'QUI', 'Quindio'),
    array(170, 'RIS', 'Risaralda'),
    array(170, 'SAP', 'San Andres, Providencia y Santa Catalina'),
    array(170, 'SAN', 'Santander'),
    array(170, 'SUC', 'Sucre'),
    array(170, 'TOL', 'Tolima'),
    array(170, 'VAC', 'Valle del Cauca'),
    array(170, 'VAU', 'Vaupes'),
    array(170, 'VID', 'Vichada'),
  );

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

  uc_set_address_format(170,
    "!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");
}
