<?php

function cyprus_install() {
  db_insert('uc_countries')
    ->fields(array(
      'country_id' => '196',
      'country_name' => 'Cyprus',
      'country_iso_code_2' => 'CY',
      'country_iso_code_3' => 'CYP',
      'version' => 1,
    ))
    ->execute();

  // Make the entries in the zones table.
  $zones = array(
    array(196, '04', 'Famagusta'),
    array(196, '06', 'Kyrenia'),
    array(196, '03', 'Larnaca'),
    array(196, '02', 'Limassol'),
    array(196, '01', 'Nicosia'),
    array(196, '05', 'Paphos')
  );

  $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  foreach ($zones as $zone) {
    $query->values($zone);
  }
  $query->execute();

  uc_set_address_format(196, "!company\n!first_name !last_name\n!street1\n!street2\n!city, !zone_code !postal_code\n!country_name_if");
}
