]> lifelog.hopto.org Git - LifeLog.git/commitdiff
Started on record set html pagination.
authorwbudic <redacted>
Sat, 22 Sep 2018 01:09:38 +0000 (11:09 +1000)
committerwbudic <redacted>
Sat, 22 Sep 2018 01:09:38 +0000 (11:09 +1000)
htdocs/cgi-bin/main.cgi

index df6dc7b11ee725a380fcf93440ea6ffeca06e6a3..b7fb027385bdc425154acc92a798d840b41e6c28 100755 (executable)
@@ -18,6 +18,14 @@ my $userid = "";
 my $password = "";
 my $dbh = DBI->connect($dsn, $userid, $password, { RaiseError => 1 }) 
    or die "<p>Error->"& $DBI::errstri &"</p>";
+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;
                          '</td>
                          <td><input class="edit" type="button" value="Edit" onclick="edit(this);return false;"/><input name="chk" type="checkbox" value="'.$row[0].'"/>
                          </td></tr>';
-       $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 . '<tr class="r'.$tfId.'"><td>&dagger;</td>';
+
+                if($rs_prev>0){
+
+                        $tbl = $tbl . '<td>&lsaquo;&lsaquo;&ndash; Previous</td>';
+
+                }
+
+
+               $tbl = $tbl . '<td>Next &ndash;&rsaquo;&rsaquo;</td>';
+
+               $tbl = $tbl .'<td colspan="2"></td></tr>';
+               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;