X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/42bd3e809b0fa95d3a463462e242caf40d98bf79..b7dcd298e5f0565be8e5ca3d9477cb6de97ae3ac:/web/archive.php?ds=sidebyside diff --git a/web/archive.php b/web/archive.php index c403863..1b21599 100644 --- a/web/archive.php +++ b/web/archive.php @@ -23,7 +23,7 @@ } a:visited { text-decoration: none; color:darkblue; } a:link { text-decoration: none; color:blue; } - a:hover { text-decoration: none; color:navy; } + a:hover { text-decoration: underline; color:navy; } @@ -33,6 +33,21 @@ include('config_local.php'); include('calendar.php'); include('units.php'); + $client_ip = $_SERVER["REMOTE_ADDR"]; + + if ((strpos($client_ip, "192.168.") === 0) || (strpos($client_ip, "10.8.") === 0) + || (strpos($client_ip, "2a02:578:5002:8174:") === 0) + || (strpos($client_ip, "2a02:578:5002:196::2") === 0)) { + + $local_net = True; + + } else { + + $local_net = False; + + } + + $year = $_REQUEST['year']; $month = $_REQUEST['month']; $day = $_REQUEST['day']; @@ -58,7 +73,7 @@ if (! $year) { fetch(PDO::FETCH_ASSOC)) { ?> - Данные за год
+ Данные за год prepare ( 'select s.id sensor,p.id param,s.s_description sensor_name,p.st_description param_name, @@ -128,7 +155,7 @@ if (! $year) { v.parameter=p.id and p.st_unit=u.id and v.day>=str_to_date(\''.$year.'-01-01\',\'%Y-%m-%d\') and - v.day prepare( 'select date_format(day,\'%d\') as day from - sensors_ranges + sensors_ranges r,sensors s where + s.id=r.sensor and day>=str_to_date(\''.$year.'-'.$month.'-01\',\'%Y-%m-%d\') and - day prepare ( 'select @@ -221,7 +271,7 @@ if (! $year) { v.parameter=p.id and p.st_unit=u.id and v.day>=str_to_date(\''.$year.'-'.$month.'-01\',\'%Y-%m-%d\') and - v.day prepare( 'select distinct v.sensor as sensor_id,s.s_description,p.id as param_id,p.st_description @@ -270,7 +331,7 @@ if (! $year) { where v.day=str_to_date(\''.$year.'-'.$month.'-'.$day.'\',\'%Y-%m-%d\') and v.sensor=s.id - and v.parameter=p.id' + and v.parameter=p.id'.$filter ); $q -> execute();