<?php
// $Id: sri_lanka_144_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 sri_lanka_install() {
  db_query("INSERT INTO {uc_countries} (country_id, country_name, country_iso_code_2, country_iso_code_3, version) VALUES (144, 'Sri Lanka', 'LK', 'LKA', 1)");

  // Make the entries in the zones table.
  $zones = array(
    array(144, '1', 'Basnahira Palata'),
    array(144, '2', 'Central Province'),
    array(144, '3', 'Dakunu Palata'),
    array(144, '5', 'Eastern Province'),
    array(144, '2', 'Madhyama Palata'),
    array(144, '5', 'Negenahira Palata'),
    array(144, '7', 'North Central Province'),
    array(144, '6', 'North Western Province'),
    array(144, '4', 'Northern Province'),
    array(144, '9', 'Sabaragamuwa Palata'),
    array(144, '3', 'Southern Province'),
    array(144, '4', 'Uturu Palata'),
    array(144, '7', 'Uturumeda Palata'),
    array(144, '8', 'Uva Palata'),
    array(144, '6', 'Wayamba Palata'),
    array(144, '1', 'Western Province'),
    array(144, '11', 'Colombo'),
    array(144, '12', 'Gampaha'),
    array(144, '13', 'Kalutara'),
    array(144, '21', 'Kandy'),
    array(144, '22', 'Matale'),
    array(144, '23', 'Nuwara Eliya'),
    array(144, '31', 'Galle'),
    array(144, '33', 'Hambantota'),
    array(144, '32', 'Matara'),
    array(144, '41', 'Jaffna'),
    array(144, '42', 'Kilinochchi'),
    array(144, '43', 'Mannar'),
    array(144, '45', 'Mullaittivu'),
    array(144, '44', 'Vavuniya'),
    array(144, '52', 'Ampara'),
    array(144, '51', 'Batticaloa'),
    array(144, '53', 'Trincomalee'),
    array(144, '61', 'Kurunegala'),
    array(144, '62', 'Puttalam'),
    array(144, '71', 'Anuradhapura'),
    array(144, '72', 'Polonnaruwa'),
    array(144, '81', 'Badulla'),
    array(144, '82', 'Monaragala'),
    array(144, '92', 'Kegalla'),
    array(144, '91', 'Ratnapura'),
  );


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