<?php
// $Id: korea_republic_of_410_1.cif,v 1.2.4.4 2010-11-02 06:42:17 tr Exp $

/**
 * First implement hook_install() using the name of the country as the base of
 * the function name.
 */
function korea_republic_of_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 (410, 'Korea, Republic of', 'KR', 'KOR', 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, 410, 'CO', 'Ch''ungch''ong-bukto'),"
          ."(%d, 410, 'CH', 'Ch''ungch''ong-namdo'),"
          ."(%d, 410, 'CD', 'Cheju-do'),"
          ."(%d, 410, 'CB', 'Cholla-bukto'),"
          ."(%d, 410, 'CN', 'Cholla-namdo'),"
          ."(%d, 410, 'IG', 'Inch''on-gwangyoksi'),"
          ."(%d, 410, 'KA', 'Kangwon-do'),"
          ."(%d, 410, 'KG', 'Kwangju-gwangyoksi'),"
          ."(%d, 410, 'KD', 'Kyonggi-do'),"
          ."(%d, 410, 'KB', 'Kyongsang-bukto'),"
          ."(%d, 410, 'KN', 'Kyongsang-namdo'),"
          ."(%d, 410, 'PG', 'Pusan-gwangyoksi'),"
          ."(%d, 410, 'SO', 'Soul-t''ukpyolsi'),"
          ."(%d, 410, 'TA', 'Taegu-gwangyoksi'),"
          ."(%d, 410, 'TG', 'Taejon-gwangyoksi')",
          uc_get_zone_ids(15));

  // 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(410,
    "!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");
}
