<?php
// $Id: vietnam_704_1.cif,v 1.1.2.3 2010/02/21 03:43:00 tr Exp $

function vietnam_install() {
  // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  db_query("INSERT INTO {uc_countries} (country_id, country_name, country_iso_code_2, country_iso_code_3, version) VALUES (704, 'Vietnam', 'VN', 'VNM', 1)");

  $zones = array(
    array(704, 'AG', 'An Giang'),
    array(704, 'BV', 'Ba Ria-Vung Tau'),
    array(704, 'BK', 'Bac Can'),
    array(704, 'BG', 'Bac Giang'),
    array(704, 'BL', 'Bac Lieu'),
    array(704, 'BN', 'Bac Ninh'),
    array(704, 'BR', 'Ben Tre'),
    array(704, 'BD', 'Binh Dinh'),
    array(704, 'BI', 'Binh Duong'),
    array(704, 'BP', 'Binh Phuoc'),
    array(704, 'BU', 'Binh Thuan'),
    array(704, 'CM', 'Ca Mau'),
    array(704, 'CN', 'Can Tho'),
    array(704, 'CB', 'Cao Bang'),
    array(704, 'DA', 'Da Nang'),
    array(704, 'DC', 'Dac Lac'),
    array(704, 'DO', 'Dac Nong'),
    array(704, 'DB', 'Dien Bien'),
    array(704, 'DN', 'Dong Nai'),
    array(704, 'DT', 'Dong Thap'),
    array(704, 'GL', 'Gia Lai'),
    array(704, 'HG', 'Ha Giang'),
    array(704, 'HM', 'Ha Nam'),
    array(704, 'HA', 'Ha Tay'),
    array(704, 'HT', 'Ha Tinh'),
    array(704, 'HD', 'Hai Duong'),
    array(704, 'HP', 'Haiphong'),
    array(704, 'HN', 'Hanoi'),
    array(704, 'HU', 'Hau Giang'),
    array(704, 'HC', 'Ho Chi Minh'),
    array(704, 'HO', 'Hoa Binh'),
    array(704, 'HY', 'Hung Yen'),
    array(704, 'KH', 'Khanh Hoa'),
    array(704, 'KG', 'Kien Giang'),
    array(704, 'KT', 'Kon Tum'),
    array(704, 'LI', 'Lai Chau'),
    array(704, 'LD', 'Lam Dong'),
    array(704, 'LS', 'Lang Son'),
    array(704, 'LO', 'Lao Cai'),
    array(704, 'LA', 'Long An'),
    array(704, 'ND', 'Nam Dinh'),
    array(704, 'NA', 'Nghe An'),
    array(704, 'NB', 'Ninh Binh'),
    array(704, 'NT', 'Ninh Thuan'),
    array(704, 'PT', 'Phu Tho'),
    array(704, 'PY', 'Phu Yen'),
    array(704, 'QB', 'Quang Binh'),
    array(704, 'QM', 'Quang Nam'),
    array(704, 'QG', 'Quang Ngai'),
    array(704, 'QN', 'Quang Ninh'),
    array(704, 'QT', 'Quang Tri'),
    array(704, 'ST', 'Soc Trang'),
    array(704, 'SL', 'Son La'),
    array(704, 'TN', 'Tay Ninh'),
    array(704, 'TB', 'Thai Binh'),
    array(704, 'TY', 'Thai Nguyen'),
    array(704, 'TH', 'Thanh Hoa'),
    array(704, 'TT', 'Thua Thien-Hue'),
    array(704, 'TG', 'Tien Giang'),
    array(704, 'TV', 'Tra Vinh'),
    array(704, 'TQ', 'Tuyen Quang'),
    array(704, 'VL', 'Vinh Long'),
    array(704, 'VC', 'Vinh Phuc'),
    array(704, 'YB', 'Yen Bai'),
  );

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