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

32, arg, array, country_name, del, foreach, function, la, php, san, zone, zones

The argentina_32_1.cif Drupal example source code

<?php

function argentina_install() {
  // Make the entry in the country table.
  // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  db_insert('uc_countries')
    ->fields(array(
      'country_id' => 32,
      'country_name' => 'Argentina',
      'country_iso_code_2' => 'AR',
      'country_iso_code_3' => 'ARG',
      'version' => 1,
    ))
    ->execute();

  // 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'),
  );

  $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  foreach ($zones as $zone) {
    $query->values($zone);
  }
  $query->execute();

  // Set address format
  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.