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

Drupal example source code file (romania_642_1.cif)

This example Drupal source code file (romania_642_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, database, db_query, foreach, function, insert, into, php, sql, values, zone, zone_name, zones

The romania_642_1.cif Drupal example source code

<?php
// $Id: romania_642_1.cif,v 1.4.4.3 2010/02/21 03:43:00 tr Exp $

function romania_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 (642, 'Romania', 'RO', 'ROM', 1)");

  // VALUES = %d for ID, Parent Country ID, Zone Abbreviation, Zone Name
  $zones = array(
    array(642, 'AB', 'Alba'),
    array(642, 'AR', 'Arad'),
    array(642, 'AG', 'Arges'),
    array(642, 'BC', 'Bacau'),
    array(642, 'BH', 'Bihor'),
    array(642, 'BN', 'Bistrita-Nasaud'),
    array(642, 'BT', 'Botosani'),
    array(642, 'BV', 'Brasov'),
    array(642, 'BR', 'Braila'),
    array(642, 'B', 'Bucuresti'),
    array(642, 'BZ', 'Buzau'),
    array(642, 'CS', 'Caras-Severin'),
    array(642, 'CL', 'Calarasi'),
    array(642, 'CJ', 'Cluj'),
    array(642, 'CT', 'Constanta'),
    array(642, 'CV', 'Covasna'),
    array(642, 'DB', 'Dimbovita'),
    array(642, 'DJ', 'Dolj'),
    array(642, 'GL', 'Galati'),
    array(642, 'GR', 'Giurgiu'),
    array(642, 'GJ', 'Gorj'),
    array(642, 'HR', 'Harghita'),
    array(642, 'HD', 'Hunedoara'),
    array(642, 'IL', 'Ialomita'),
    array(642, 'IS', 'Iasi'),
    array(642, 'IF', 'Ilfov'),
    array(642, 'MM', 'Maramures'),
    array(642, 'MH', 'Mehedinti'),
    array(642, 'MS', 'Mures'),
    array(642, 'NT', 'Neamt'),
    array(642, 'OT', 'Olt'),
    array(642, 'PH', 'Prahova'),
    array(642, 'SM', 'Satu-Mare'),
    array(642, 'SJ', 'Salaj'),
    array(642, 'SB', 'Sibiu'),
    array(642, 'SV', 'Suceava'),
    array(642, 'TR', 'Teleorman'),
    array(642, 'TM', 'Timis'),
    array(642, 'TL', 'Tulcea'),
    array(642, 'VS', 'Vaslui'),
    array(642, 'VL', 'Valcea'),
    array(642, 'VN', 'Vrancea'),
  );

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

  variable_set('uc_address_format_642',
               "!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
              ."\r\n!city, !postal_code\r\n!zone_name, !country_name_if");
}

Other Drupal examples (source code examples)

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