<?php
// $Id: greenland_304_1.cif,v 1.1.2.2 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 greenland_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 ('304', 'Greenland', 'GL', 'GRL', 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, 304, 'NK', 'Nuuk'),"
          ."(%d, 304, 'NQ', 'Nuussuaq'),"
          ."(%d, 304, 'KQ', 'Kangerlussuaq'),"
          ."(%d, 304, 'ST', 'Sisimiut'),"
          ."(%d, 304, 'MQ', 'Maniitsoq'),"
          ."(%d, 304, 'TQ', 'Tasiilaq'),"
          ."(%d, 304, 'KK', 'Kulusuk'),"
          ."(%d, 304, 'AP', 'Alluitsup Paa'),"
          ."(%d, 304, 'QQ', 'Qaqortoq'),"
          ."(%d, 304, 'NA', 'Narsaq'),"
          ."(%d, 304, 'NK', 'Nanortalik'),"
          ."(%d, 304, 'NR', 'Narsarsuaq'),"
          ."(%d, 304, 'IQ', 'Ikerasassuaq'),"
          ."(%d, 304, 'KT', 'Kangilinnguit'),"
          ."(%d, 304, 'AK', 'Arsuk'),"
          ."(%d, 304, 'PT', 'Paamiut'),"
          ."(%d, 304, 'AT', 'Aasiaat'),"
          ."(%d, 304, 'QT', 'Qasigiannguit'),"
          ."(%d, 304, 'IL', 'Ilulissat'),"
          ."(%d, 304, 'QE', 'Qeqertarsuaq'),"
          ."(%d, 304, 'KA', 'Kangaatsiaq'),"
          ."(%d, 304, 'UM', 'Uummannaq'),"
          ."(%d, 304, 'UP', 'Upernavik'),"
          ."(%d, 304, 'QA', 'Qaarsut'),"
          ."(%d, 304, 'PT', 'Pituffik'),"
          ."(%d, 304, 'QN', 'Qaanaaq'),"
          ."(%d, 304, 'SN', 'Station Nord'),"
          ."(%d, 304, 'IT', 'Ittoqqortoormiit'),"
          ."(%d, 304, 'MV', 'Mestersvig'),"
          ."(%d, 304, 'DH', 'Danmarkshavn'),"
          ."(%d, 304, 'CP', 'Constable Pynt'),"
          ."(%d, 304, 'SS', 'Slædepatruljen Sirius')",
           uc_get_zone_ids(32));

  // 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(304,
    "!company\r\n!first_name !last_name\r\n!street1\r\n!street2\r\n!postal_code !city\r\n!country_name_if");
}
