]> git.nbdom.net Git - nb.git/commitdiff
new libs
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 30 Mar 2015 22:52:36 +0000 (23:52 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 30 Mar 2015 22:52:36 +0000 (23:52 +0100)
lib/php/db.php

index d8e2dd979eabe65f8e0552442847ab5e70021ff7..67cb87b0c66021c4d6693b4bca1a33e648a1c3a3 100644 (file)
@@ -344,7 +344,7 @@ class table {
       $next = 999999;
     }
 
-    echo '<div class="nav" id="nav_bottom">';
+    echo '<div align="center" class="nav" id="nav_bottom">';
 
     if ($prev>=0) echo '<span class="prev"><a href="'.$this->url_params('limit',preg_replace('/^0,/','',"$prev,$y")).'">&lt;&lt;</a></span>&nbsp;';
 
@@ -550,9 +550,11 @@ class table {
     $st = $this->db->conn->prepare($sql);
     $st->execute();
 
-    if (@$GLOBALS['PAGE']['is_html']) echo '<div class="nav" id="nav_top"></div>'.PHP_EOL;
-
     $format = ''.(isset($opt['format']) ? $opt['format'] : 'table');
+
+    if (!@$opt['is_html']) $opt['is_html'] = preg_match('/^(table)$/',$format) ? true : false;
+    if ($opt['is_html']) echo '<div align="center" class="nav" id="nav_top"></div>'.PHP_EOL;
+
     $escape = preg_match('/^(table|row|xml)$/',$format) ? true : false;
     if (preg_match('/^(1)?$/',@$_REQUEST['header'])) echo $this->{"rows_begin_$format"}($opt);
 
@@ -584,7 +586,7 @@ class table {
     }
 
     echo $this->{"rows_end_$format"}($opt);
-    if (@$GLOBALS['PAGE']['is_html']) echo $this->nav($count,$tot,$limit);
+    if ($opt['is_html']) echo $this->nav($count,$tot,$limit);
 
     $st->closeCursor();