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

Drupal example source code file (iran_364_1.cif)

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

The iran_364_1.cif Drupal example source code

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

/**
 * Implementation of hook_install().
 */
function iran_install() {
  db_query("INSERT INTO {uc_countries} (country_id, country_name, country_iso_code_2, country_iso_code_3, version) VALUES (364, 'ایران', 'IR', 'IRI', 1)");

  // Make the entries in the zones table.
  $zones = array(
    array(364, 'AS', 'آذربایجان شرقی'),
    array(364, 'AG', 'آذربایجان غربی'),
    array(364, 'AR', 'اردبیل'),
    array(364, 'ES', 'اصفهان'),
    array(364, 'IL', 'ایلام'),
    array(364, 'BU', 'بوشهر'),
    array(364, 'TH', 'تهران'),
    array(364, 'CB', 'چهار محال بختیاری'),
    array(364, 'KH', 'خراسان جنوبی'),
    array(364, 'KH', 'خراسان رضوی'),
    array(364, 'KH', 'خراسان شمالی'),
    array(364, 'KZ', 'خوزستان'),
    array(364, 'ZN', 'زنجان'),
    array(364, 'SB', 'سیستان و بلوچستان'),
    array(364, 'SM', 'سمنان'),
    array(364, 'FR', 'فارس'),
    array(364, 'QZ', 'قزوین'),
    array(364, 'QM', 'قم'),
    array(364, 'KD', 'کردستان'),
    array(364, 'KR', 'کرمان'),
    array(364, 'KS', 'کرمانشاه'),
    array(364, 'KB', 'کهگیلویه و بویر احمد'),
    array(364, 'GL', 'گیلان'),
    array(364, 'GS', 'گلستان'),
    array(364, 'LR', 'لرستان'),
    array(364, 'MZ', 'مازندران'),
    array(364, 'MR', 'مرکزی'),
    array(364, 'HR', 'هرمزگان'),
    array(364, 'HM', 'همدان'),
    array(364, 'YZ', 'یزد'),
  );

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

Other Drupal examples (source code examples)

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