12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- /**
- * Implements 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_insert('uc_countries')
- ->fields(array(
- 'country_id' => 818,
- 'country_name' => 'Egypt',
- 'country_iso_code_2' => 'EG',
- 'country_iso_code_3' => 'EGY',
- 'version' => 1,
- ))
- ->execute();
- // Make the entries in the zones table.
- $zones = array(
- array(818, 'MUH', 'مرسى مطروح'),
- array(818, 'ALX', 'الاسكندرية'),
- array(818, 'WAD', 'الوادي الجديد'),
- array(818, 'GZ', 'الجيزة'),
- array(818, 'FYM', 'الفيوم'),
- array(818, 'BNS', 'بني سويف'),
- array(818, 'MN', 'المنيا'),
- array(818, 'AST', 'اسيوط'),
- array(818, 'SHG', 'سوهاج'),
- array(818, 'ASN', 'اسوان'),
- array(818, 'SIN', 'شمال سيناء'),
- array(818, 'JS', 'جنوب سيناء'),
- array(818, 'MNF', 'المنوفية'),
- array(818, 'BA', 'البحر الاحمر'),
- array(818, 'SHR', 'الشرقية'),
- array(818, 'KB', 'القليوبية'),
- array(818, 'IS', 'الاسماعيلية'),
- array(818, 'SUZ', 'السويس'),
- array(818, 'BH', 'البحيرة'),
- array(818, 'GH', 'الغربية'),
- array(818, 'KFS', 'كفر الشيخ'),
- array(818, 'DK', 'الدقهلية'),
- array(818, 'UQ', 'الاقصر'),
- array(818, 'PTS', 'بور سعيد'),
- array(818, 'DT', 'دمياط'),
- array(818, 'KN', 'قنا'),
- array(818, 'CAI', 'القاهرة'),
- );
- $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(
- 818,
- "!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"
- );
- }
|