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

Drupal example source code file (colombia_170_1.cif)

This example Drupal source code file (colombia_170_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

array, db_query, de, foreach, function, insert, into, php, san, sql, values, zone, zones

The colombia_170_1.cif Drupal example source code

<?php
// $Id: colombia_170_1.cif,v 1.1.2.3 2010/04/14 05:18:19 tr Exp $ 1.0.0

/**
 * First implement hook_install() using the name of the country as the base of
 * the function name.
 */
function colombia_install() {
  db_query("INSERT INTO {uc_countries} (country_id, country_name, country_iso_code_2, country_iso_code_3, version) VALUES (170, 'Colombia', 'CO', 'COL', 1)");

  // Make the entries in the zones table.
  $zones = array(
    array(170, 'AMA', 'Amazonas'),
    array(170, 'ANT', 'Antioquia'),
    array(170, 'ARA', 'Arauca'),
    array(170, 'ATL', 'Atlantico'),
    array(170, 'BOL', 'Bolivar'),
    array(170, 'CAL', 'Caldas'),
    array(170, 'CAQ', 'Caqueta'),
    array(170, 'CAS', 'Casanare'),
    array(170, 'CAU', 'Cauca'),
    array(170, 'CES', 'Cesar'),
    array(170, 'CHO', 'Choco'),
    array(170, 'COR', 'Cordoba'),
    array(170, 'CUN', 'Cundinamarca'),
    array(170, 'DC', 'Distrito Capital de Bogota'),
    array(170, 'GUA', 'Guainia'),
    array(170, 'GUV', 'Guaviare'),
    array(170, 'HUI', 'Huila'),
    array(170, 'LAG', 'La Guajira'),
    array(170, 'MAG', 'Magdalena'),
    array(170, 'MET', 'Meta'),
    array(170, 'NAR', 'Narino'),
    array(170, 'NSA', 'Norte de Santander'),
    array(170, 'PUT', 'Putumayo'),
    array(170, 'QUI', 'Quindio'),
    array(170, 'RIS', 'Risaralda'),
    array(170, 'SAP', 'San Andres, Providencia y Santa Catalina'),
    array(170, 'SAN', 'Santander'),
    array(170, 'SUC', 'Sucre'),
    array(170, 'TOL', 'Tolima'),
    array(170, 'VAC', 'Valle del Cauca'),
    array(170, 'VAU', 'Vaupes'),
    array(170, 'VID', 'Vichada'),
  );

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

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal colombia_170_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.