23 |
23 |
Released under the GNU General Public License
|
24 |
24 |
---------------------------------------------------------------------------------------*/
|
25 |
25 |
|
26 |
|
function xtc_get_countriesList($countries_id = '', $with_iso_codes = false, $only_active = true)
|
|
26 |
function xtc_get_countriesList($countries_id = '', $with_iso_codes = true, $only_active = true)
|
27 |
27 |
{
|
|
28 |
$languageTextManager = MainFactory::create_object('LanguageTextManager', array('countries', $_SESSION['languages_id']));
|
|
29 |
|
28 |
30 |
$countries_array = array();
|
29 |
31 |
if (xtc_not_null($countries_id))
|
30 |
32 |
{
|
... | ... | |
32 |
34 |
{
|
33 |
35 |
$countries = xtc_db_query("select countries_name, countries_iso_code_2, countries_iso_code_3 from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$countries_id . "'" . ($only_active ? " and status = '1'" : "") . " order by countries_name");
|
34 |
36 |
$countries_values = xtc_db_fetch_array($countries);
|
35 |
|
$countries_array = array('countries_name' => $countries_values['countries_name'],
|
|
37 |
$countries_array = array('countries_name' => $languageTextManager->get_text($countries_values['countries_iso_code_2']),
|
36 |
38 |
'countries_iso_code_2' => $countries_values['countries_iso_code_2'],
|
37 |
39 |
'countries_iso_code_3' => $countries_values['countries_iso_code_3']);
|
38 |
40 |
}
|
... | ... | |
51 |
53 |
while ($countries_values = xtc_db_fetch_array($countries))
|
52 |
54 |
{
|
53 |
55 |
$countries_array[] = array('countries_id' => $countries_values['countries_id'],
|
54 |
|
'countries_name' => $countries_values['countries_name'],
|
|
56 |
'countries_name' => $languageTextManager->get_text($countries_values['countries_iso_code_2']),
|
55 |
57 |
'countries_iso_code_2' => $countries_values['countries_iso_code_2'],
|
56 |
58 |
'countries_iso_code_3' => $countries_values['countries_iso_code_3']);
|
57 |
59 |
}
|