home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (argentina_32_1.cif)

This example Drupal source code file (argentina_32_1.cif) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

arg, array, del, foreach, function, into, la, php, san, values, zone, zones

The argentina_32_1.cif Drupal example source code

// $Id: argentina_32_1.cif,v 2010/04/14 05:18:19 tr Exp $

function argentina_install() {
  // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  db_query("INSERT INTO {uc_countries} (country_id, country_name, country_iso_code_2, country_iso_code_3, version) VALUES (32, 'Argentina', 'AR', 'ARG', 1)");

  // VALUES = %d for ID, Parent Country ID, Zone Abbreviation, Zone Name
  $zones = array(
    array(32, 'A', 'Salta'),
    array(32, 'B', 'Buenos Aires Province'),
    array(32, 'C', 'Capital Federal'),
    array(32, 'D', 'San Luis'),
    array(32, 'E', 'Entre Ríos'),
    array(32, 'F', 'La Rioja'),
    array(32, 'G', 'Santiago del Estero'),
    array(32, 'H', 'Chaco'),
    array(32, 'J', 'San Juan'),
    array(32, 'K', 'Catamarca'),
    array(32, 'L', 'La Pampa'),
    array(32, 'M', 'Mendoza'),
    array(32, 'N', 'Misiones'),
    array(32, 'P', 'Formosa'),
    array(32, 'Q', 'Neuquén'),
    array(32, 'R', 'Río Negro'),
    array(32, 'S', 'Santa Fe'),
    array(32, 'T', 'Tucumán'),
    array(32, 'U', 'Chubut'),
    array(32, 'V', 'Tierra del Fuego'),
    array(32, 'W', 'Corrientes'),
    array(32, 'X', 'Córdoba'),
    array(32, 'Y', 'Jujuy'),
    array(32, 'Z', 'Santa Cruz'),

  foreach ($zones as $zone) {
    db_query("INSERT INTO {uc_zones} (zone_country_id, zone_code, zone_name) VALUES (%d, '%s', '%s')", $zone);

  uc_set_address_format(32, "!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
              ."\r\n!postal_code !zone_name\r\n!country_name");


Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal argentina_32_1.cif source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.