lebanon_422_1.cif 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function lebanon_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' => 422,
  12. 'country_name' => 'Lebanon',
  13. 'country_iso_code_2' => 'LB',
  14. 'country_iso_code_3' => 'LBN',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(422, 'LB-AK', 'Aakkâr'),
  21. array(422, 'LB-BH', 'Baalbek-Hermel'),
  22. array(422, 'LB-BI', 'Beqaa'),
  23. array(422, 'LB-BA', 'Beyrouth'),
  24. array(422, 'LB-AS', 'Liban-Nord'),
  25. array(422, 'LB-JA', 'Liban-Sud'),
  26. array(422, 'LB-JL', 'Mont-Liban'),
  27. array(422, 'LB-NA', 'Nabatîyé'),
  28. );
  29. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  30. foreach ($zones as $zone) {
  31. $query->values($zone);
  32. }
  33. $query->execute();
  34. // Set address format
  35. uc_set_address_format(
  36. 422,
  37. "!company\r\n" .
  38. "!first_name !last_name\r\n" .
  39. "!street1\r\n" .
  40. "!street2\r\n" .
  41. "!city, !zone_name !postal_code\r\n" .
  42. "!country_name_if"
  43. );
  44. }