From: Will Budicm Date: Sat, 11 Jul 2020 22:11:05 +0000 (+1000) Subject: Bug 26 and XHTM page validation layoud fixed. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=2ac81573bbb45fcc3666b390d8143a3bbbccf17f;p=LifeLog.git Bug 26 and XHTM page validation layoud fixed. --- diff --git a/htdocs/cgi-bin/main.cgi b/htdocs/cgi-bin/main.cgi index e0aa4d3..5bf1abb 100755 --- a/htdocs/cgi-bin/main.cgi +++ b/htdocs/cgi-bin/main.cgi @@ -84,6 +84,9 @@ my $DEBUG = &Settings::debug; #END OF SETTINGS my $BUFFER; +sub toBuf { + $BUFFER .= shift; +} my $lang = Date::Language->new(Settings::language()); my $today = DateTime->now; @@ -216,7 +219,7 @@ my $st; my $sqlCAT = "SELECT ID, NAME, DESCRIPTION FROM CAT ORDER BY ID;"; my $sqlVWL = "$stmS STICKY = 1 $stmE"; -PrintB (qq(## Using db -> $dsn\n)) if $DEBUG; +toBuf (qq(## Using db -> $dsn\n)) if $DEBUG; $st = $db->prepare($sqlCAT); $st->execute() or LifeLogException->throw($DBI::errstri); @@ -256,7 +259,7 @@ for my $key ( keys %hshDesc ) { } } my $log_output = -qq(
+qq( @@ -369,7 +372,7 @@ qq( my $re_a_tag = qr/.*<\/a>/si; my $isInViewMode = rindex ($sqlVWL, 'PID<=') > 0 || rindex ($sqlVWL, 'ID_CAT=') > 0 || $prm_aa || rindex ($sqlVWL, 'REGEXP')>0; - PrintB $cgi->pre("###[Session PARAMS->isV:$isInViewMode|vc=$prm_vc|xc=$prm_xc|aa: $prm_aa|xc_lst=$prm_xc_lst|\@xc_lst=@xc_lst|keepExcludes=".&Settings::keepExcludes."] -> ".$sqlVWL) if $DEBUG; + toBuf $cgi->pre("###[Session PARAMS->isV:$isInViewMode|vc=$prm_vc|xc=$prm_xc|aa: $prm_aa|xc_lst=$prm_xc_lst|\@xc_lst=@xc_lst|keepExcludes=".&Settings::keepExcludes."] -> ".$sqlVWL) if $DEBUG; if ( $log_start > 0 ) { @@ -397,7 +400,7 @@ qq( #Following is saying is in page selection, not view selection, or accounting on type of sticky entries. if( !$isInViewMode && !$prm_vc && !$prm_xc && !$rs_keys && !$rs_dat_from ){ $sqlVWL = "$stmS STICKY != 1 $stmE"; - PrintB $cgi->pre("###2 -> ".$sqlVWL) if $DEBUG; + toBuf $cgi->pre("###2 -> ".$sqlVWL) if $DEBUG; ; &buildLog(traceDBExe($sqlVWL)); } @@ -406,18 +409,18 @@ qq( sub traceDBExe { my $sql = shift; try{ - PrintB("do:$sql") if ($DEBUG); + toBuf("do:$sql") if ($DEBUG); my $st = $db->prepare($sql); $st -> execute() or LifeLogException->throw("Execute failed [$DBI::errstri]", show_trace=>1); return $st; }catch{ - LifeLogException->throw(error=>"Database error encountered.", show_trace=>1); + LifeLogException->throw(error=>"Database error encountered.", show_trace=>1); } } sub buildLog { my $pst = shift; - #PrintB "## sqlVWL: $sqlVWL\n"; + #toBuf "## sqlVWL: $sqlVWL\n"; while ( my @row = $pst->fetchrow_array() ) { my $i = 0; $id = $row[$i++]; #ID must be rowid in LOG. @@ -680,58 +683,58 @@ sub buildLog { } #while end }#buildLog - if ( $tfId == 1 ) { $tfId = 0; } - else { $tfId = 1; } - my ($tot,$tin); - $tot = $sum + $ass - abs($exp); - $tin = &cam($sum); - $exp = &cam($exp); - $ass = &cam($ass); - $tot = &cam($tot); - $tot = "$tot" if($tot<0); - - $log_output .= qq( - - - - - ); - - ### - &buildNavigationButtons; - ### - - ## - #Fetch Keywords autocomplete we go by words larger then three. - # - my $aw_cnt = 0; - my $autowords = qq("gas","money","today"); +if ( $tfId == 1 ) { $tfId = 0; } +else { $tfId = 1; } +my ($tot,$tin); +$tot = $sum + $ass - abs($exp); +$tin = &cam($sum); +$exp = &cam($exp); +$ass = &cam($ass); +$tot = &cam($tot); +$tot = "$tot" if($tot<0); + +$log_output .= qq( + + + + +); - &fetchAutocomplete; +### +&buildNavigationButtons; +### - if ( $log_rc == 0 ) { +## +# Fetch Keywords autocomplete we go by words larger then three. +# +my $aw_cnt = 0; +my $autowords = qq("gas","money","today"); - if ($stmD) { - $log_output .= qq('); - } - elsif ($rs_keys) { - my $criter = ""; - if ( $prm_vc > 0 ) { - $criter = "->Criteria[" . $hshCats{$prm_vc} . "]"; - } - $log_output .= qq(); - } - else { - if ($isInViewMode) { $log_output .= '' } - else{ $log_output .= ''} +&fetchAutocomplete; + +if ( $log_rc == 0 ) { + + if ($stmD) { + $log_output .= qq('); + } + elsif ($rs_keys) { + my $criter = ""; + if ( $prm_vc > 0 ) { + $criter = "->Criteria[" . $hshCats{$prm_vc} . "]"; } + $log_output .= qq(); } + else { + if ($isInViewMode) { $log_output .= '' } + else{ $log_output .= ''} + } +} - $log_output .= <<_TXT; +$log_output .= <<_TXT; - - - - - -
Date
# Totals: Assets [ $ass ] Inc [ $tin ] Exp [ $exp ] → Gross [$tot ]
# Totals: Assets [ $ass ] Inc [ $tin ] Exp [ $exp ] → Gross [$tot ]
- Search Failed to Retrive any records on select: [$stmD] !
- Search Failed to Retrive any records on keywords: [$rs_keys]$criter!
You have reached the end of the data view!
Database is New or Empty!
+ Search Failed to Retrive any records on select: [$stmD] !
+ Search Failed to Retrive any records on keywords: [$rs_keys]$criter!
You have reached the end of the data view!
Database is New or Empty!
Show All hidden with ➔ - @@ -742,15 +745,16 @@ sub buildLog {
Keywords: -
+ _TXT +$log_output .= qq(
+ +
Keywords: + +
+
); + my ( $sp1, $sp2, $sp3 ); $sp1 = ''; $sp2 = ''; @@ -804,7 +808,7 @@ _TXT   - + @@ -915,9 +919,9 @@ _TXT      -     +        - Keep In Session + Keep In Session $tdivxc @@ -949,11 +953,11 @@ _TXT my $quill = &quill( $cgi->param('submit_is_edit') ); my $help = &help; - ################################ - # Page PrintBout from here! # -################################ + ################################## + # Final Page Output from here! # + ################################## -printB (qq( +toBuf (qq(