<?php
// $Id: argentina_32_1.cif,v 1.2.2.8 2010/04/14 05:18:19 tr Exp $

function argentina_install() {
  // 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 (32, 'Argentina', 'AR', 'ARG', 1)");

  // VALUES = %d for ID, Parent Country ID, Zone Abbreviation, Zone Name
  $zones = array(
    array(32, 'A', 'Salta'),
    array(32, 'B', 'Buenos Aires Province'),
    array(32, 'C', 'Capital Federal'),
    array(32, 'D', 'San Luis'),
    array(32, 'E', 'Entre Ríos'),
    array(32, 'F', 'La Rioja'),
    array(32, 'G', 'Santiago del Estero'),
    array(32, 'H', 'Chaco'),
    array(32, 'J', 'San Juan'),
    array(32, 'K', 'Catamarca'),
    array(32, 'L', 'La Pampa'),
    array(32, 'M', 'Mendoza'),
    array(32, 'N', 'Misiones'),
    array(32, 'P', 'Formosa'),
    array(32, 'Q', 'Neuquén'),
    array(32, 'R', 'Río Negro'),
    array(32, 'S', 'Santa Fe'),
    array(32, 'T', 'Tucumán'),
    array(32, 'U', 'Chubut'),
    array(32, 'V', 'Tierra del Fuego'),
    array(32, 'W', 'Corrientes'),
    array(32, 'X', 'Córdoba'),
    array(32, 'Y', 'Jujuy'),
    array(32, 'Z', 'Santa Cruz'),
  );

  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(32, "!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
              ."\r\n!postal_code !zone_name\r\n!country_name");

}
