<?php
// $Id: switzerland_756_1.cif,v 1.4.2.1 2010-11-02 06:42:17 tr Exp $

/**
 * First implement hook_install() using the name of the country as the base of
 * the function name.
 */
function switzerland_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 ('756', 'Switzerland', 'CH', 'CHE', 1)");

  // Make the entries in the zones table.  Use %d for the zone_id and the
  // function uc_get_zone_ids($num) as the second argument for db_query() where
  // $num is the number of zones in the INSERT query.
  // VALUES = %d for ID, Parent Country ID, Zone Abbreviation, Zone Name
  db_query("INSERT INTO {uc_zones} VALUES "
          ."(%d, 756, 'AG', 'Aargau'),"
          ."(%d, 756, 'AI', 'Appenzell Innerrhoden'),"
          ."(%d, 756, 'AR', 'Appenzell Ausserrhoden'),"
          ."(%d, 756, 'BS', 'Basel-Stadt'),"
          ."(%d, 756, 'BL', 'Basel-Landschaft'),"
          ."(%d, 756, 'BE', 'Bern'),"
          ."(%d, 756, 'FR', 'Fribourg'),"
          ."(%d, 756, 'GE', 'Geneva'),"
          ."(%d, 756, 'GL', 'Glarus'),"
          ."(%d, 756, 'GR', 'Graubünden'),"
          ."(%d, 756, 'JU', 'Jura'),"
          ."(%d, 756, 'LU', 'Luzern'),"
          ."(%d, 756, 'NE', 'Neuchâtel'),"
          ."(%d, 756, 'NW', 'Nidwalden'),"
          ."(%d, 756, 'OW', 'Obwalden'),"
          ."(%d, 756, 'SH', 'Schaffhausen'),"
          ."(%d, 756, 'SZ', 'Schwyz'),"
          ."(%d, 756, 'SO', 'Solothurn'),"
          ."(%d, 756, 'SG', 'St. Gallen'),"
          ."(%d, 756, 'TG', 'Thurgau'),"
          ."(%d, 756, 'TI', 'Ticino'),"
          ."(%d, 756, 'UR', 'Uri'),"
          ."(%d, 756, 'VS', 'Valais'),"
          ."(%d, 756, 'VD', 'Vaud'),"
          ."(%d, 756, 'ZG', 'Zug'),"
          ."(%d, 756, 'ZH', 'Zürich')",
          uc_get_zone_ids(26));

  // Use uc_set_address_format() with the country ID as the first argument and
  // an address format string as the second.  Documentation on address formats
  // is available at:
  // http://www.ubercart.org/ubercart_users_guide/country_settings#address_format_docs
  uc_set_address_format(756,
    "!company\r\n!first_name !last_name\r\n!street1\r\n!street2\r\n!postal_code !city\r\n!country_name_if");
}
