<?php

/**
 * First implement hook_install() using the name of the country as the base of
 * the function name.
 */
function mauritius_install() {
  db_query("INSERT INTO {uc_countries} (country_id, country_name, country_iso_code_2, country_iso_code_3, version) VALUES (480, 'Mauritius', 'MU', 'MUS', 1)");

  // Make the entries in the zones table.
  $zones = array(
    array(480, 'AG', 'Agalega Islands'),
    array(480, 'BR', 'Beau Bassin-Rose'),
    array(480, 'BL', 'Black River'),
    array(480, 'CC', 'Cargados Carajos'),
    array(480, 'CU', 'Curepipe'),
    array(480, 'FL', 'Flacq'),
    array(480, 'GP', 'Grand Port'),
    array(480, 'MO', 'Moka'),
    array(480, 'PA', 'Pamplemousses'),
    array(480, 'PW', 'Plaines Wilhems'),
    array(480, 'PL', 'Port Louis'),
    array(480, 'PU', 'Port Louis'),
    array(480, 'QB', 'Quatre Bornes'),
    array(480, 'RR', 'Riviere du Rempart'),
    array(480, 'RO', 'Rodrigues Island'),
    array(480, 'CC', 'Saint Brandon Islands'),
    array(480, 'SA', 'Savanne'),
    array(480, 'VP', 'Vacoas-Phoenix'),
  );

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