0
ログブラウザ、IP、ユーザー、タイムスタンプを実装したいが、国を追加したいと思う。私は http://api.ipinfodb.com/からいくつかのパラメータを追加しようとしていましたが、それは私のデフォルト機能のjson国コード、国、およびAPIの状態を追加する必要があるためではありません。私は保存する必要がある600以上の行を持つjsonをip国、州および地域に依存する。 コントローラジオロケーション - 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;
}