<?php

require_once('inc/conn.php');
$opendb = new mydb();
require_once('inc/char_set.php');
require_once('inc/ls_syscode.php');


date_default_timezone_set('Asia/Shanghai');//设置时区为中国时间

$gifo = new get_gust_info();
$ip_home = '';
$ipadds = $gifo->Getaddress();
foreach($ipadds[0] as $value){
	 $ip_home .= " ".iconv("utf-8","utf-8",$value);    
}
if($ip_home == NULL)
	 $ip_home = "本地";

$insert_pro_feedback_sql=sprintf("insert into ls_statistics(date,ip,explorer,home,system) values (%s,%s,%s,%s,%s)",
			GetSQLValueString(date("Y-m-d H:i:s"),"text"),
			GetSQLValueString($gifo->Getip(),"text"),
			GetSQLValueString($gifo->GetBrowser()." - ".$gifo->GetLang(),"text"),
			GetSQLValueString($ip_home,"text"),
			GetSQLValueString($gifo->GetOs(),"text")
			);

if ($opendb->query($insert_pro_feedback_sql)){
	echo "success";
}else{
	echo "fail";
}

?>