<?php
// $Id: romania_642_1.cif,v 1.4.4.3 2010-02-21 03:43:00 tr Exp $

function romania_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 (642, 'Romania', 'RO', 'ROM', 1)");

  // VALUES = %d for ID, Parent Country ID, Zone Abbreviation, Zone Name
  $zones = array(
    array(642, 'AB', 'Alba'),
    array(642, 'AR', 'Arad'),
    array(642, 'AG', 'Arges'),
    array(642, 'BC', 'Bacau'),
    array(642, 'BH', 'Bihor'),
    array(642, 'BN', 'Bistrita-Nasaud'),
    array(642, 'BT', 'Botosani'),
    array(642, 'BV', 'Brasov'),
    array(642, 'BR', 'Braila'),
    array(642, 'B', 'Bucuresti'),
    array(642, 'BZ', 'Buzau'),
    array(642, 'CS', 'Caras-Severin'),
    array(642, 'CL', 'Calarasi'),
    array(642, 'CJ', 'Cluj'),
    array(642, 'CT', 'Constanta'),
    array(642, 'CV', 'Covasna'),
    array(642, 'DB', 'Dimbovita'),
    array(642, 'DJ', 'Dolj'),
    array(642, 'GL', 'Galati'),
    array(642, 'GR', 'Giurgiu'),
    array(642, 'GJ', 'Gorj'),
    array(642, 'HR', 'Harghita'),
    array(642, 'HD', 'Hunedoara'),
    array(642, 'IL', 'Ialomita'),
    array(642, 'IS', 'Iasi'),
    array(642, 'IF', 'Ilfov'),
    array(642, 'MM', 'Maramures'),
    array(642, 'MH', 'Mehedinti'),
    array(642, 'MS', 'Mures'),
    array(642, 'NT', 'Neamt'),
    array(642, 'OT', 'Olt'),
    array(642, 'PH', 'Prahova'),
    array(642, 'SM', 'Satu-Mare'),
    array(642, 'SJ', 'Salaj'),
    array(642, 'SB', 'Sibiu'),
    array(642, 'SV', 'Suceava'),
    array(642, 'TR', 'Teleorman'),
    array(642, 'TM', 'Timis'),
    array(642, 'TL', 'Tulcea'),
    array(642, 'VS', 'Vaslui'),
    array(642, 'VL', 'Valcea'),
    array(642, 'VN', 'Vrancea'),
  );

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

  variable_set('uc_address_format_642',
               "!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
              ."\r\n!city, !postal_code\r\n!zone_name, !country_name_if");
}
