<?php
// $Id: afghanistan_4_1.cif,v 1.2.4.3 2010-11-02 06:42:16 tr Exp $

/**
 * First implement hook_install() using the name of the country as the base of
 * the function name.
 */
function Afghanistan_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} VALUES ('4', 'Afghanistan', 'AF', 'AFG', 1)");

  // Make the entries in the zones table.  Use %d for the zone_id and the
  // function uc_get_zone_ids($num) as the second argument for db_query() where
  // $num is the number of zones in the INSERT query.
  // VALUES = %d for ID, Parent Country ID, Zone Abbreviation, Zone Name
  db_query("INSERT INTO {uc_zones} VALUES "
          ."(%d, 4, 'BDS', 'Badakhshan'),"
          ."(%d, 4, 'BDG', 'Badghis'),"
          ."(%d, 4, 'BGL', 'Baghlan'),"
          ."(%d, 4, 'BAL', 'Balkh'),"
          ."(%d, 4, 'BAM', 'Bamian'),"
          ."(%d, 4, 'FRA', 'Farah'),"
          ."(%d, 4, 'FYB', 'Faryab'),"
          ."(%d, 4, 'GHA', 'Ghazni'),"
          ."(%d, 4, 'GHO', 'Ghowr'),"
          ."(%d, 4, 'HEL', 'Helmand'),"
          ."(%d, 4, 'HER', 'Herat'),"
          ."(%d, 4, 'JOW', 'Jowzjan'),"
          ."(%d, 4, 'KAB', 'Kabul'),"
          ."(%d, 4, 'KAN', 'Kandahar'),"
          ."(%d, 4, 'KAP', 'Kapisa'),"
          ."(%d, 4, 'KHO', 'Khost'),"
          ."(%d, 4, 'KNR', 'Konar'),"
          ."(%d, 4, 'KDZ', 'Kondoz'),"
          ."(%d, 4, 'LAG', 'Laghman'),"
          ."(%d, 4, 'LOW', 'Lowgar'),"
          ."(%d, 4, 'NAN', 'Nangrahar'),"
          ."(%d, 4, 'NIM', 'Nimruz'),"
          ."(%d, 4, 'NUR', 'Nurestan'),"
          ."(%d, 4, 'ORU', 'Oruzgan'),"
          ."(%d, 4, 'PIA', 'Paktia'),"
          ."(%d, 4, 'PKA', 'Paktika'),"
          ."(%d, 4, 'PAR', 'Parwan'),"
          ."(%d, 4, 'SAM', 'Samangan'),"
          ."(%d, 4, 'SAR', 'Sar-e Pol'),"
          ."(%d, 4, 'TAK', 'Takhar'),"
          ."(%d, 4, 'WAR', 'Wardak'),"
          ."(%d, 4, 'ZAB', 'Zabol')",
          uc_get_zone_ids(32));

  // Use uc_set_address_format() with the country ID as the first argument and
  // an address format string as the second.  Documentation on address formats
  // is available at:
  // http://www.ubercart.org/ubercart_users_guide/country_settings#address_format_docs
  uc_set_address_format(4,
    "!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");
}
