<?php
// $Id: 

/**
* First implement hook_install() using the name of the country as the base of
* the function name.
*/
function latvia_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} VALUES (428, 'Latvija', 'LV', 'LVA', 1)");

  // Make the entries in the zones table.  Use %d for the zone_id and the
  // function uc_get_zone_ids($num) as the second argument for db_query() where
  // $num is the number of zones in the INSERT query.
  // VALUES = %d for ID, Parent Country ID, Zone Abbreviation, Zone Name
  db_query("INSERT INTO {uc_zones} VALUES "
."(%d, 428, 'AI', 'Aizkraukles rajons'),"
."(%d, 428, 'AL', 'Alūksnes rajons'),"
."(%d, 428, 'BL', 'Balvu rajons'),"
."(%d, 428, 'BU', 'Bauskas rajons'),"
."(%d, 428, 'CE', 'Cēsu rajons'),"
."(%d, 428, 'DGV', 'Daugavpils pilsēta'),"
."(%d, 428, 'DA', 'Daugavpils rajons'),"
."(%d, 428, 'DO', 'Dobeles rajons'),"
."(%d, 428, 'GU', 'Gulbenes rajons'),"
."(%d, 428, 'JK', 'Jēkabpils rajons'),"
."(%d, 428, 'JEL', 'Jelgavas pilsēta'),"
."(%d, 428, 'JL', 'Jelgavas rajons'),"
."(%d, 428, 'JUR', 'Jūrmalas pilsēta'),"
."(%d, 428, 'KR', 'Krāslavas rajons'),"
."(%d, 428, 'KU', 'Kuldīgas rajons'),"
."(%d, 428, 'LPX', 'Liepājas pilsēta'),"
."(%d, 428, 'LE', 'Liepājas rajons'),"
."(%d, 428, 'LM', 'Limbažu rajons'),"
."(%d, 428, 'LU', 'Ludzas rajons'),"
."(%d, 428, 'MA', 'Madonas rajons'),"
."(%d, 428, 'OG', 'Ogres rajons'),"
."(%d, 428, 'PR', 'Preiļu rajons'),"
."(%d, 428, 'REZ', 'Rēzeknes pilsēta'),"
."(%d, 428, 'RE', 'Rēzeknes rajons'),"
."(%d, 428, 'RIX', 'Rīgas pilsēta'),"
."(%d, 428, 'RI', 'Rīgas rajons'),"
."(%d, 428, 'SA', 'Saldus rajons'),"
."(%d, 428, 'TA', 'Talsu rajons'),"
."(%d, 428, 'TU', 'Tukuma rajons'),"
."(%d, 428, 'VK', 'Valkas rajons'),"
."(%d, 428, 'VM', 'Valmieras rajons'),"
."(%d, 428, 'VEN', 'Ventspils pilsēta'),"
."(%d, 428, 'VE', 'Ventspils rajons')",
           uc_get_zone_ids(33));

  // Use uc_set_address_format() with the country ID as the first argument and
  // an address format string as the second.
  uc_set_address_format(428,
    "!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
   ."\r\n!city, !postal_code\r\n!country_name_if");
}
