<?php

function bhutan_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 (64,'Bhutan','BT','BTN',1)");
  // Make the entries in the zones table.
  $zones = array(
     array(64, 'GA', 'Gasa'),
     array(64, 'TY', 'Tashi Yangtse'),
     array(64, '11', 'Paro'),
     array(64, '12', 'Chhukha'),
     array(64, '13', 'Ha'),
     array(64, '14', 'Samchi'),
     array(64, '15', 'Thimphu'),
     array(64, '21', 'Chirang'),
     array(64, '22', 'Daga'),
     array(64, '23', 'Punakha'),
     array(64, '24', 'Wangdi Phodrang'),
     array(64, '31', 'Geylegphug'),
     array(64, '32', 'Tongsa'),
     array(64, '33', 'Bumthang'),
     array(64, '34', 'Shemgang'),
     array(64, '41', 'Tashigang'),
     array(64, '42', 'Mongar'),
     array(64, '43', 'Pemagatsel'),
     array(64, '44', 'Lhuntshi'),
     array(64, '45', 'Samdrup Jongkhar'),
  );

  foreach ($zones as $zone) {
    db_query("INSERT INTO {uc_zones} (zone_country_id, zone_code, zone_name) VALUES (%d, '%s', '%s')", $zone);
  }

  // Set address format
  uc_set_address_format(
    64,
    "!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"
  );
}
