<?php
// $Id: tanzania_834_1.cif,v 1.1.2.3 2010-04-14 05:18:19 tr Exp $ 1.0.0

/**
 * First implement hook_install() using the name of the country as the base of
 * the function name.
 */
function tanzania_install() {
  db_query("INSERT INTO {uc_countries} (country_id, country_name, country_iso_code_2, country_iso_code_3, version) VALUES (834, 'Tanzania', 'TZ', 'TZA', 1)");

  // Make the entries in the zones table.
  $zones = array(
    array(834, '01', 'Arusha'),
    array(834, '19', 'Coast'),
    array(834, '02', 'Dar es Salaam'),
    array(834, '03', 'Dodoma'),
    array(834, '04', 'Iringa'),
    array(834, '05', 'Kagera'),
    array(834, '06', 'Kaskazini Pemba'),
    array(834, '07', 'Kaskazini Unguja'),
    array(834, '08', 'Kigoma'),
    array(834, '09', 'Kilimanjaro'),
    array(834, '10', 'Kusini Pemba'),
    array(834, '11', 'Kusini Unguja'),
    array(834, '12', 'Lindi'),
    array(834, '26', 'Manyara'),
    array(834, '13', 'Mara'),
    array(834, '14', 'Mbeya'),
    array(834, '15', 'Mjini Mgharibi'),
    array(834, '16', 'Morogoro'),
    array(834, '17', 'Mtwara'),
    array(834, '18', 'Mwanza'),
    array(834, '06', 'Pemba North'),
    array(834, '10', 'Pemba South'),
    array(834, '19', 'Pwani'),
    array(834, '20', 'Rukwa'),
    array(834, '21', 'Ruvuma'),
    array(834, '22', 'Shinyanga'),
    array(834, '23', 'Singida'),
    array(834, '24', 'Tabora'),
    array(834, '25', 'Tanga'),
    array(834, '07', 'Zanzibar North'),
    array(834, '11', 'Zanzibar South'),
    array(834, '15', 'Zanzibar West'),
  );

  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(834,
    "!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");
}
