<?php
// $Id: mexico_484_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 mexico_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 ('484', 'Mexico', 'MX', 'MEX', 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, 484, 'AGS','Aguascalientes'),"
    ."(%d, 484, 'BC','Baja California'),"
    ."(%d, 484, 'BCS','Baja California Sur'),"
    ."(%d, 484, 'CAM','Campeche'),"
    ."(%d, 484, 'CHIS','Chiapas'),"
    ."(%d, 484, 'CHI','Chihuahua'),"
    ."(%d, 484, 'COAH','Coahuila'),"
    ."(%d, 484, 'COL','Colima'),"
    ."(%d, 484, 'DF','Distrito Federal'),"
    ."(%d, 484, 'DGO','Durango'),"
    ."(%d, 484, 'GTO','Guanajuato'),"
    ."(%d, 484, 'GRO','Guerrero'),"
    ."(%d, 484, 'HGO','Hidalgo'),"
    ."(%d, 484, 'JAL','Jalisco'),"
    ."(%d, 484, 'ME','México'),"
    ."(%d, 484, 'MICH','Michoacán'),"
    ."(%d, 484, 'MOR','Morelos'),"
    ."(%d, 484, 'NAY','Nayarit'),"
    ."(%d, 484, 'NL','Nuevo León'),"
    ."(%d, 484, 'OAX','Oaxaca'),"
    ."(%d, 484, 'PUE','Puebla'),"
    ."(%d, 484, 'QUE','Querétaro'),"
    ."(%d, 484, 'QR','Quintana Roo'),"
    ."(%d, 484, 'SLP','San Luis Potosi'),"
    ."(%d, 484, 'SIN','Sinaloa'),"
    ."(%d, 484, 'SON','Sonora'),"
    ."(%d, 484, 'TAB','Tabasco'),"
    ."(%d, 484, 'TAM','Tamaulipas'),"
    ."(%d, 484, 'TLA','Tlaxcala'),"
    ."(%d, 484, 'VER','Veracruz'),"
    ."(%d, 484, 'YUC','Yucatán'),"
    ."(%d, 484, 'ZAC','Zacatecas')",
     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(484,
    "!company\n!first_name !last_name\n!street1\n!street2"
   ."\n!postal_code !city\n!country_name_if");
}
