<?php
header("content-type: text/html; charset=gb2312");

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>访问记录</title>
</head>

<body>
<h3>访问记录</h3>
<?php
@ini_set('display_errors', false);
error_reporting(E_ERROR | E_WARNING | E_PARSE);
require ('../../writable/set/set.php');


if(!file_exists('../../readonly/weather/ip.dat')){
  die('城市IP数据库文件ip.dat不存在！请联系官方升级安装。</body>
</html>');
}
$d_ = gmdate('Ymd', time() + floatval($web['time_pos']) * 3600);
$arrw =array();

if($arr=@glob('../../writable/__temp__/weather_*.txt')){
    foreach($arr as $v){
      if(gmdate('Ymd',filemtime($v) + floatval($web['time_pos']) * 3600)==$d_){
	    $a = preg_replace('/(%\w{2})2?$/iU', '$1', basename($v,'.txt'));
	    $a = substr($a, 8);
	    $arrw[$a] = urldecode($a).' - '.gmdate('Y/m/d H:i:s',filemtime($v) + floatval($web['time_pos']) * 3600);
	    unset($a);
	  } else {
	    @unlink($v);
	  }
    }
}
$n = count($arrw);
echo '总计'.$n.'条记录<br /><br />';
if($n>0){
  echo @implode('<br />', $arrw);
}
?>

</body>
</html>
