0
로그 브라우저, IP, 사용자, 타임 스탬프를 구현하고 싶지만 국가를 추가하고 상태를 원합니다. http://api.ipinfodb.com/에서 일부 매개 변수를 추가하려고했으나 API에서 기본 기능인 json 국가 코드, 국가 및 상태를 추가하기 만하면되므로 매개 변수를 추가하지 않아도됩니다. 600 개 이상의 행이있는 json이 IP 국가, 주 및 지역에 따라 저장해야합니다. 컨트롤러geolocation - IP 주소로 국가 식별하기
public function datatable(){
$array = $this->sessions->datatable();
$this->json($array);
$data = array();
foreach ($array as $rows){
$user_agent = $this->getBrowser($rows['user_agent']);
array_push($data, array(
$user_agent['name'].' on '.$user_agent['platform'],
$rows['ip_address'],
date('m/d/Y H:i:s',$rows['timestamp']),
));
}
$this->json(array('data' => $data));
}
public function tests()
{
$ip = '200.92.39.106';
$this->load->config('geolocation', true);
$config = $this->config->config['geolocation'];
$this->geolocation->initialize($config);
$this->geolocation->set_ip_address($ip);
$city = $this->geolocation->get_city();
if($city === FALSE)
echo $this->geolocation->get_error();
else
echo $city;
}