<?php
// $Id: venezuela_862_1.cif,v 1.2.4.3 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 venezuela_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 (862, 'Venezuela', 'VE', 'VEN', 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, 862, 'AM', 'Amazonas'),"
          ."(%d, 862, 'AN', 'Anzoátegui'),"
          ."(%d, 862, 'AP', 'Apure'),"
          ."(%d, 862, 'AR', 'Aragua'),"
          ."(%d, 862, 'BA', 'Barinas'),"
          ."(%d, 862, 'BO', 'Bolívar'),"
          ."(%d, 862, 'CA', 'Carabobo'),"
          ."(%d, 862, 'CO', 'Cojedes'),"
          ."(%d, 862, 'DA', 'Delta Amacuro'),"
          ."(%d, 862, 'DF', 'Dependencias Federales'),"
          ."(%d, 862, 'DC', 'Distrito Capital'),"
          ."(%d, 862, 'FA', 'Falcón'),"
          ."(%d, 862, 'GU', 'Guárico'),"
          ."(%d, 862, 'LA', 'Lara'),"
          ."(%d, 862, 'ME', 'Mérida'),"
          ."(%d, 862, 'MI', 'Miranda'),"
          ."(%d, 862, 'MO', 'Monagas'),"
          ."(%d, 862, 'NE', 'Nueva Esparta'),"
          ."(%d, 862, 'PO', 'Portuguesa'),"
          ."(%d, 862, 'SU', 'Sucre'),"
          ."(%d, 862, 'TA', 'Táchira'),"
          ."(%d, 862, 'TR', 'Trujillo'),"
          ."(%d, 862, 'VA', 'Vargas'),"
          ."(%d, 862, 'YA', 'Yaracuy'),"
          ."(%d, 862, 'ZU', 'Zulia')", uc_get_zone_ids(25));

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