- Модуль: statistic
- Путь к файлу: ~/bitrix/modules/statistic/classes/general/city.php
- Класс: CCityLookup
- Вызов: CCityLookup::__construct
function __construct($arDBRecord = /*.(array[string]string).*/array())
{
if(is_array($arDBRecord))
{
if(array_key_exists("IPA", $arDBRecord)) $this->ip_addr = $arDBRecord["IPA"];
if(array_key_exists("IPN", $arDBRecord)) $this->ip_number = $arDBRecord["IPN"];
if(array_key_exists("COC", $arDBRecord)) $this->country_code = $arDBRecord["COC"];
if(array_key_exists("COS", $arDBRecord)) $this->country_short_name = $arDBRecord["COS"];
if(array_key_exists("COF", $arDBRecord)) $this->country_full_name = $arDBRecord["COF"];
if(array_key_exists("REN", $arDBRecord)) $this->region_name = $arDBRecord["REN"];
if(array_key_exists("CIN", $arDBRecord)) $this->city_name = $arDBRecord["CIN"];
if(array_key_exists("CID", $arDBRecord)) $this->city_id = $arDBRecord["CID"];
}
else
{
$ip = $this->ip_addr = $_SERVER["REMOTE_ADDR"];
$this->ip_number = ip2number($ip);
}
}