From: wbudic Date: Sat, 22 Sep 2018 01:09:38 +0000 (+1000) Subject: Started on record set html pagination. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=f416e80b514fa7db694ea63c0ece73dfb37083b3;p=LifeLog.git Started on record set html pagination. --- diff --git a/htdocs/cgi-bin/main.cgi b/htdocs/cgi-bin/main.cgi index df6dc7b..b7fb027 100755 --- a/htdocs/cgi-bin/main.cgi +++ b/htdocs/cgi-bin/main.cgi @@ -18,6 +18,14 @@ my $userid = ""; my $password = ""; my $dbh = DBI->connect($dsn, $userid, $password, { RaiseError => 1 }) or die "

Error->"& $DBI::errstri &"

"; +my $rs_prev=0; + + + + +#SETTINGS HERE! +my $REC_LIMIT = 0; +#END OF SETTINGS @@ -25,11 +33,10 @@ print $q->header(-expires=>"+6os", -charset=>"UTF-8"); print $q->start_html(-title => "Personal Log", -script=>{-type => 'text/javascript', -src => 'wsrc/main.js'}, - -style =>{-type => 'text/css', -src => 'wsrc/main.css'} - + -style =>{-type => 'text/css', -src => 'wsrc/main.css'}, + -onload => "loadedBody();" ); - my $rv; my $today = DateTime->now; $today->set_time_zone( 'Australia/Sydney' ); @@ -145,7 +152,32 @@ my $tfId = 0; ' '; - $tbl_rc +=1; + $tbl_rc += 1; + + if($REC_LIMIT>0 && $tbl_rc>$REC_LIMIT){ + +#UNDER DEVELOPMENT! + # + if($tfId==1){ + $tfId = 0; + }else{ + $tfId = 1; + } + + $tbl = $tbl . '†'; + + if($rs_prev>0){ + + $tbl = $tbl . '‹‹– Previous'; + + } + + + $tbl = $tbl . 'Next –››'; + + $tbl = $tbl .''; + last; + } } if($tbl_rc==1){ @@ -191,6 +223,10 @@ sub processSubmit { my $log = $q->param('log'); my $cat = $q->param('cat'); my $edit_mode = $q->param('submit_is_edit'); + + + $rs_prev = $q->param("rs_cnt"); + #Apostroph's need to be replaced with doubles and white space fixed for the SQL. $log =~ s/(?<=\w) ?' ?(?=\w)/''/g;