<?php
// $Id: zimbabwe_716_1.cif,v 1.1.2.2 2010-11-02 06:42:17 tr Exp $

/**
 * First implement hook_install() using the name of the country as the base of
 * the function name.
 */
function zimbabwe_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 (716, 'Zimbabwe', 'ZW', 'ZWE', 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, 716, 'BW', 'Bulawayo'),"
          ."(%d, 716, 'HR', 'Harare'),"
          ."(%d, 716, 'MC', 'Manicaland'),"
          ."(%d, 716, 'MSC', 'Mashonaland Central'),"
          ."(%d, 716, 'MSE', 'Mashonaland East'),"
          ."(%d, 716, 'MSW', 'Mashonaland West'),"
          ."(%d, 716, 'MV', 'Masvingo'),"
          ."(%d, 716, 'MBN', 'Matabeleland North'),"
          ."(%d, 716, 'MBS', 'Matabeleland South'),"
          ."(%d, 716, 'ML', 'Midlands')",
           uc_get_zone_ids(10));

  // 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:

  uc_set_address_format(716,
    "!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
   ."\r\n!city\r\n!country_name_if");
}
