chad_148_1.cif 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function chad_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' => 148,
  12. 'country_name' => 'Chad',
  13. 'country_iso_code_2' => 'TD',
  14. 'country_iso_code_3' => 'TCD',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(148, 'KA', 'Barh el Ghazel'),
  21. array(148, 'BA', 'Batha'),
  22. array(148, 'BET', 'Borkou'),
  23. array(148, 'CB', 'Chari-Baguirmi'),
  24. array(148, 'BET', 'Ennedi'),
  25. array(148, 'GR', 'Guera'),
  26. array(148, 'HL', 'Hadjer-Lamis'),
  27. array(148, 'KA', 'Kanem'),
  28. array(148, 'LC', 'Lac'),
  29. array(148, 'LO', 'Logone Occidental'),
  30. array(148, 'LR', 'Logone Oriental'),
  31. array(148, 'MA', 'Mandoul'),
  32. array(148, 'ME', 'Mayo-Kebbi Est'),
  33. array(148, 'MO', 'Mayo-Kebbi Ouest'),
  34. array(148, 'MC', 'Moyen-Chari'),
  35. array(148, 'OD', 'Ouaddai'),
  36. array(148, 'SA', 'Salamat'),
  37. array(148, 'OD', 'Sila'),
  38. array(148, 'TA', 'Tandjile'),
  39. array(148, 'BET', 'Tibesti'),
  40. array(148, 'ND', "Ville de N'Djamena"),
  41. array(148, 'WF', 'Wadi Fira'),
  42. );
  43. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  44. foreach ($zones as $zone) {
  45. $query->values($zone);
  46. }
  47. $query->execute();
  48. // Set address format
  49. uc_set_address_format(
  50. 148,
  51. "!company\r\n" .
  52. "!first_name !last_name\r\n" .
  53. "!street1\r\n" .
  54. "!street2\r\n" .
  55. "!city, !zone_name !postal_code\r\n" .
  56. "!country_name_if"
  57. );
  58. }