egypt_818_1.cif 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function egypt_install() {
  7. // Make the entry in the country table.
  8. // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  9. db_insert('uc_countries')
  10. ->fields(array(
  11. 'country_id' => 818,
  12. 'country_name' => 'Egypt',
  13. 'country_iso_code_2' => 'EG',
  14. 'country_iso_code_3' => 'EGY',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(818, 'MUH', 'مرسى مطروح'),
  21. array(818, 'ALX', 'الاسكندرية'),
  22. array(818, 'WAD', 'الوادي الجديد'),
  23. array(818, 'GZ', 'الجيزة'),
  24. array(818, 'FYM', 'الفيوم'),
  25. array(818, 'BNS', 'بني سويف'),
  26. array(818, 'MN', 'المنيا'),
  27. array(818, 'AST', 'اسيوط'),
  28. array(818, 'SHG', 'سوهاج'),
  29. array(818, 'ASN', 'اسوان'),
  30. array(818, 'SIN', 'شمال سيناء'),
  31. array(818, 'JS', 'جنوب سيناء'),
  32. array(818, 'MNF', 'المنوفية'),
  33. array(818, 'BA', 'البحر الاحمر'),
  34. array(818, 'SHR', 'الشرقية'),
  35. array(818, 'KB', 'القليوبية'),
  36. array(818, 'IS', 'الاسماعيلية'),
  37. array(818, 'SUZ', 'السويس'),
  38. array(818, 'BH', 'البحيرة'),
  39. array(818, 'GH', 'الغربية'),
  40. array(818, 'KFS', 'كفر الشيخ'),
  41. array(818, 'DK', 'الدقهلية'),
  42. array(818, 'UQ', 'الاقصر'),
  43. array(818, 'PTS', 'بور سعيد'),
  44. array(818, 'DT', 'دمياط'),
  45. array(818, 'KN', 'قنا'),
  46. array(818, 'CAI', 'القاهرة'),
  47. );
  48. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  49. foreach ($zones as $zone) {
  50. $query->values($zone);
  51. }
  52. $query->execute();
  53. // Set address format
  54. uc_set_address_format(
  55. 818,
  56. "!company\r\n" .
  57. "!first_name !last_name\r\n" .
  58. "!street1\r\n" .
  59. "!street2\r\n" .
  60. "!city !zone_code !postal_code\r\n" .
  61. "!country_name_if"
  62. );
  63. }