<?php
// $Id: papua_new_guinea_598_1.cif,v 1.1.2.2 2011-02-23 19:32:56 tr Exp $

/**
 * First implement hook_install() using the name of the country as the base of
 * the function name.
 */
function papua_new_guinea_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 (598, 'Papua New Guinea', 'PG', 'PNG', 1)");

  // Make the entries in the zones table.
  $zones = array(
    array(598, 'CPM', 'Central'),
    array(598, 'CPK', 'Chimbu'),
    array(598, 'EHG', 'Eastern Highlands'),
    array(598, 'EBR', 'East New Britain'),
    array(598, 'ESW', 'East Sepik'),
    array(598, 'EPW', 'Enga'),
    array(598, 'GPK', 'Gulf'),
    array(598, 'MPM', 'Madang'),
    array(598, 'MRL', 'Manus'),
    array(598, 'MBA', 'Milne Bay'),
    array(598, 'MPL', 'Morobe'),
    array(598, 'NCD', 'National Capital District (Port Moresby)'),
    array(598, 'NIK', 'New Ireland'),
    array(598, 'NPP', 'Northern'),
    array(598, 'NSA', 'North Solomons'),
    array(598, 'SAN', 'Sandaun [West Sepik]'),
    array(598, 'SHM', 'Southern Highlands'),
    array(598, 'WPD', 'Western'),
    array(598, 'WHM', 'Western Highlands'),
    array(598, 'WBK', 'West New Britain'),
  );

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