pakistan_586_1.cif 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function pakistan_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' => 586,
  12. 'country_name' => 'Pakistan',
  13. 'country_iso_code_2' => 'PK',
  14. 'country_iso_code_3' => 'PAK',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table. Use %d for the zone_id and the
  19. // VALUES = Parent Country ID, Zone Abbreviation, Zone Name
  20. $zones = array(
  21. array(586, 'PB', 'Punjab'),
  22. array(586, 'SN', 'Sindh'),
  23. array(586, 'BL', 'Balochistan'),
  24. array(586, 'NW', 'N.W.F.P'),
  25. );
  26. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  27. foreach ($zones as $zone) {
  28. $query->values($zone);
  29. }
  30. $query->execute();
  31. // Set address format
  32. uc_set_address_format(
  33. 586,
  34. "!company\r\n" .
  35. "!first_name !last_name\r\n" .
  36. "!street1\r\n" .
  37. "!street2\r\n" .
  38. "!city, !zone_code\r\n" .
  39. "!country_name_if"
  40. );
  41. }