From 474cc6b046653e2836779b1afe72c6521678dbc9 Mon Sep 17 00:00:00 2001 From: Will Budic Date: Sun, 10 May 2020 15:33:59 +1000 Subject: [PATCH] Fixed stats layout style. --- htdocs/cgi-bin/stats.cgi | 65 ++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 19 deletions(-) diff --git a/htdocs/cgi-bin/stats.cgi b/htdocs/cgi-bin/stats.cgi index 690e32f..f2f6337 100755 --- a/htdocs/cgi-bin/stats.cgi +++ b/htdocs/cgi-bin/stats.cgi @@ -7,7 +7,7 @@ use warnings; #no warnings 'uninitialized'; use Switch; -use CGI; +use CGI::Pretty ":standard"; use CGI::Session '-ip_match'; use DBI; use DateTime; @@ -55,21 +55,43 @@ $today->set_time_zone(&Settings::timezone); $ENV{'HOME'} = "~/"; +my $CSS=<header(-expires=>"+6os", -charset=>"UTF-8"); print $cgi->start_html(-title => "Log Data Stats", -BGCOLOR=>&Settings::bgcol, -script=> [{-type => 'text/javascript', -src => 'wsrc/main.js'}, - {-type => 'text/javascript', -src => 'wsrc/jquery.js' }, - {-type => 'text/javascript', -src => 'wsrc/jquery-ui.js' }], + {-type => 'text/javascript', -src => 'wsrc/jquery.js'}, + {-type => 'text/javascript', -src => 'wsrc/jquery-ui.js'}], -style => [{-type => 'text/css', -src => "wsrc/".&Settings::css}, - {-type => 'text/css', -src => 'wsrc/jquery-ui.css' }, - {-type => 'text/css', -src => 'wsrc/jquery-ui.theme.css' }], - + {-type => 'text/css', -src => 'wsrc/jquery-ui.css'}, + {-type => 'text/css', -src => 'wsrc/jquery-ui.theme.css'}, + {-type => 'text/css', -src => 'wsrc/jquery-ui.theme.css'}, + {-script=>$CSS} + ], + -head => style({-type => 'text/css'}, $CSS), -onload => "onBodyLoadGeneric()" ); -my $tbl = ''; - my $log_rc = selectSQL('select count(rowid) from LOG;'); my ($stm1,$stm2) = "SELECT count(date) from LOG where date>=date('now','start of year');"; my $log_this_year_rc = selectSQL($stm1); @@ -121,7 +143,8 @@ my $year =$today->year(); my $IPPublic = `curl -s https://www.ifconfig.me`; my $IPPrivate = `hostname -I`; $IPPrivate =~ s/\s/
/g; -$tbl .=qq( +my $tbl = qq(
* Personal Log Data Statistics *
LifeLog App. Version:).&Settings::release.qq(
+ @@ -141,16 +164,20 @@ print qq(
* Personal Log Data Statistics *
LifeLog App. Version:).&Settings::release.qq(
Number of Records:$log_rc
No. of Records This Year:$log_this_year_rc
No. of RTF Documents:$notes_rc