<?php
// $Id: egypt_818_1.cif,v 1.1.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 egypt_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 (818, 'Egypt', 'EG', 'EGY', 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, 818, 'MUH', 'مرسى مطروح'),"
          ."(%d, 818, 'ALX', 'الاسكندرية'),"
          ."(%d, 818, 'WAD', 'الوادي الجديد'),"
          ."(%d, 818, 'GZ', 'الجيزة'),"
          ."(%d, 818, 'FYM', 'الفيوم'),"
          ."(%d, 818, 'BNS', 'بني سويف'),"
          ."(%d, 818, 'MN', 'المنيا'),"
          ."(%d, 818, 'AST', 'اسيوط'),"
          ."(%d, 818, 'SHG', 'سوهاج'),"
          ."(%d, 818, 'ASN', 'اسوان'),"
          ."(%d, 818, 'SIN', 'شمال سيناء'),"
          ."(%d, 818, 'JS', 'جنوب سيناء'),"
          ."(%d, 818, 'MNF', 'المنوفية'),"
          ."(%d, 818, 'BA', 'البحر الاحمر'),"
          ."(%d, 818, 'SHR', 'الشرقية'),"
          ."(%d, 818, 'KB', 'القليوبية'),"
          ."(%d, 818, 'IS', 'الاسماعيلية'),"
          ."(%d, 818, 'SUZ', 'السويس'),"
          ."(%d, 818, 'BH', 'البحيرة'),"
          ."(%d, 818, 'GH', 'الغربية'),"
          ."(%d, 818, 'KFS', 'كفر الشيخ'),"
          ."(%d, 818, 'DK', 'الدقهلية'),"
          ."(%d, 818, 'UQ', 'الاقصر'),"
          ."(%d, 818, 'PTS', 'بور سعيد'),"
          ."(%d, 818, 'DT', 'دمياط'),"
          ."(%d, 818, 'KN', 'قنا'),"
          ."(%d, 818, 'CAI', 'القاهرة')",
          uc_get_zone_ids(27));

  // 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(818,
    "!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
   ."\r\n!city !zone_name !postal_code\r\n!country_name_if");
}
