Cheetah
modules
cheetah
zipcodesearch
classes
ChZIPDb.php
Go to the documentation of this file.
1
<?
php
2
8
ch_import
(
'ChWsbModuleDb'
);
9
10
class
ChZIPDb
extends
ChWsbModuleDb
11
{
12
var
$_oConfig
;
13
14
function
__construct
(&$oConfig)
15
{
16
parent::__construct();
17
$this->_oConfig = $oConfig;
18
}
19
20
function
getCountriesGeonames
()
21
{
22
$a = $this->
getPairs
(
"SELECT `t1`.`ISO2`, `t1`.`Country` FROM `sys_countries` AS `t1` INNER JOIN `ch_zip_countries_geonames` AS `t2` ON `t1`.`ISO2` = `t2`.`ISO2`"
,
'ISO2'
,
'Country'
);
23
$this->
_countriesSortAndTranslate
($a);
24
return
$a;
25
}
26
27
function
getCountriesGoogle
()
28
{
29
$a = $this->
getPairs
(
"SELECT `t1`.`ISO2`, `t1`.`Country` FROM `sys_countries` AS `t1` INNER JOIN `ch_zip_countries_google` AS `t2` ON `t1`.`ISO2` = `t2`.`ISO2`"
,
'ISO2'
,
'Country'
);
30
$this->
_countriesSortAndTranslate
($a);
31
return
$a;
32
}
33
34
function
_countriesSortAndTranslate
(&$a)
35
{
36
foreach
($a
as
$k => $v)
37
$a[$k] =
_t
(
'__'
.$v);
38
asort ($a);
39
}
40
41
function
getSettingsCategory
()
42
{
43
return
$this->
getOne
(
"SELECT `ID` FROM `sys_options_cats` WHERE `name` = 'ZIP Code Search' LIMIT 1"
);
44
}
45
}
ChZIPDb\getCountriesGeonames
getCountriesGeonames()
Definition:
ChZIPDb.php:20
ch_import
ch_import($sClassName, $aModule=array())
Definition:
utils.inc.php:1218
php
ChWsbModuleDb
Definition:
ChWsbModuleDb.php:12
ChZIPDb\getCountriesGoogle
getCountriesGoogle()
Definition:
ChZIPDb.php:27
ChWsbDb\getPairs
getPairs($sQuery, $sFieldKey, $sFieldValue, $aBindings=[])
Definition:
ChWsbDb.php:363
ChZIPDb
Definition:
ChZIPDb.php:11
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition:
languages.inc.php:509
ChWsbDb\getOne
getOne($sQuery, $aBindings=[], $iIndex=0)
Definition:
ChWsbDb.php:263
ChZIPDb\__construct
__construct(&$oConfig)
Definition:
ChZIPDb.php:14
ChZIPDb\$_oConfig
$_oConfig
Definition:
ChZIPDb.php:12
ChZIPDb\_countriesSortAndTranslate
_countriesSortAndTranslate(&$a)
Definition:
ChZIPDb.php:34
ChZIPDb\getSettingsCategory
getSettingsCategory()
Definition:
ChZIPDb.php:41
as
as
Definition:
Filter.ExtractStyleBlocks.Escaping.txt:10
Generated by
1.8.20