<?php
// $Id: dominican_republic_214_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 dominican_republic_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 (214, 'Dominican Republic', 'DO', 'DOM', 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, 214, 'DN', 'Distrito Nacional'),"
          ."(%d, 214, 'AZ', 'Azua'),"
          ."(%d, 214, 'BC', 'Baoruco'),"
          ."(%d, 214, 'BH', 'Barahona'),"
          ."(%d, 214, 'DJ', 'Dajabon'),"
          ."(%d, 214, 'DU', 'Duarte'),"
          ."(%d, 214, 'EL', 'Elias Pina'),"
          ."(%d, 214, 'SY', 'El Seybo'),"
          ."(%d, 214, 'ET', 'Espaillat'),"
          ."(%d, 214, 'HM', 'Hato Mayor'),"
          ."(%d, 214, 'IN', 'Independencia'),"
          ."(%d, 214, 'AL', 'La Altagracia'),"
          ."(%d, 214, 'RO', 'La Romana'),"
          ."(%d, 214, 'VE', 'La Vega'),"
          ."(%d, 214, 'MT', 'Maria Trinidad Sanchez'),"
          ."(%d, 214, 'MN', 'Monsenor Nouel'),"
          ."(%d, 214, 'MC', 'Monte Cristi'),"
          ."(%d, 214, 'MP', 'Monte Plata'),"
          ."(%d, 214, 'PD', 'Pedernales'),"
          ."(%d, 214, 'PR', 'Peravia (Bani)'),"
          ."(%d, 214, 'PP', 'Puerto Plata'),"
          ."(%d, 214, 'SL', 'Salcedo'),"
          ."(%d, 214, 'SM', 'Samana'),"
          ."(%d, 214, 'SH', 'Sanchez Ramirez'),"
          ."(%d, 214, 'SC', 'San Cristobal'),"
          ."(%d, 214, 'JO', 'San Jose de Ocoa'),"
          ."(%d, 214, 'SJ', 'San Juan'),"
          ."(%d, 214, 'PM', 'San Pedro de Macoris'),"
          ."(%d, 214, 'SA', 'Santiago'),"
          ."(%d, 214, 'ST', 'Santiago Rodriguez'),"
          ."(%d, 214, 'SD', 'Santo Domingo'),"
          ."(%d, 214, 'VA', 'Valverde')",
          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(214,
    "!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");
}
