<?php

function germany_install() {
  // Make the entry in the country table.
  // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  db_insert('uc_countries')
    ->fields(array(
      'country_id' => 276,
      'country_name' => 'Germany',
      'country_iso_code_2' => 'DE',
      'country_iso_code_3' => 'DEU',
      'version' => 1,
    ))
    ->execute();

  // Make the entries in the zones table.
  $zones = array(
    array(276, 'BAW', 'Baden-Württemberg'),
    array(276, 'BAY', 'Bayern'),
    array(276, 'BER', 'Berlin'),
    array(276, 'BRG', 'Brandenburg'),
    array(276, 'BRE', 'Bremen'),
    array(276, 'HAM', 'Hamburg'),
    array(276, 'HES', 'Hessen'),
    array(276, 'MEC', 'Mecklenburg-Vorpommern'),
    array(276, 'NDS', 'Niedersachsen'),
    array(276, 'NRW', 'Nordrhein-Westfalen'),
    array(276, 'RHE', 'Rheinland-Pfalz'),
    array(276, 'SAR', 'Saarland'),
    array(276, 'SAS', 'Sachsen'),
    array(276, 'SAC', 'Sachsen-Anhalt'),
    array(276, 'SCN', 'Schleswig-Holstein'),
    array(276, 'THE', 'Thüringen'),
  );

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

  // Set address format
  uc_set_address_format(
    276,
    "!company\r\n".
    "!first_name !last_name\r\n".
    "!street1\r\n".
    "!street2\r\n".
    "!postal_code !city\r\n".
    "!country_name_if"
  );
}
