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

Drupal example source code file (japan_392_1.cif)

This example Drupal source code file (japan_392_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 japan_392_1.cif Drupal example source code

<?php
// $Id: japan_392_1.cif,v 1.3.4.4 2010/04/14 05:18:19 tr Exp $

/**
* First implement hook_install() using the name of the country as the base of
* the function name.
*/
function japan_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} (country_id, country_name, country_iso_code_2, country_iso_code_3, version) VALUES (392, 'Japan', 'JP', 'JPN', 1)");

  // Make the entries in the zones table.
  $zones = array(
    array(392, '01', '北海道'),
    array(392, '02', '青森県'),
    array(392, '03', '岩手県'),
    array(392, '04', '宮城県'),
    array(392, '05', '秋田県'),
    array(392, '06', '山形県'),
    array(392, '07', '福島県'),
    array(392, '08', '茨城県'),
    array(392, '09', '栃木県'),
    array(392, '10', '群馬県'),
    array(392, '11', '埼玉県'),
    array(392, '12', '千葉県'),
    array(392, '13', '東京都'),
    array(392, '14', '神奈川県'),
    array(392, '15', '新潟県'),
    array(392, '16', '富山県'),
    array(392, '17', '石川県'),
    array(392, '18', '福井県'),
    array(392, '19', '山梨県'),
    array(392, '20', '長野県'),
    array(392, '21', '岐阜県'),
    array(392, '22', '静岡県'),
    array(392, '23', '愛知県'),
    array(392, '24', '三重県'),
    array(392, '25', '滋賀県'),
    array(392, '26', '京都府'),
    array(392, '27', '大阪府'),
    array(392, '28', '兵庫県'),
    array(392, '29', '奈良県'),
    array(392, '30', '和歌山県'),
    array(392, '31', '鳥取県'),
    array(392, '32', '島根県'),
    array(392, '33', '岡山県'),
    array(392, '34', '広島県'),
    array(392, '35', '山口県'),
    array(392, '36', '徳島県'),
    array(392, '37', '香川県'),
    array(392, '38', '愛媛県'),
    array(392, '39', '高知県'),
    array(392, '40', '福岡県'),
    array(392, '41', '佐賀県'),
    array(392, '42', '長崎県'),
    array(392, '43', '熊本県'),
    array(392, '44', '大分県'),
    array(392, '45', '宮崎県'),
    array(392, '46', '鹿児島県'),
    array(392, '47', '沖縄県'),
  );

  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(392,
    "!postal_code\r\n!zone_name!city\r\n!street1\r\n!street2\r\n"
    ."!company\r\n!last_name !first_name\r\n!country_name_if");
}

Other Drupal examples (source code examples)

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