From 97fcf43bc24f88fa014f4549649f1c796024f0f2 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 19 Apr 2016 17:28:13 +0100 Subject: [PATCH] wp compatible --- lib/php/db/table.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 4b01c8dd..c7f57fec 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -31,7 +31,7 @@ Class Table extends nb { public $created; # hidden, sort, ... fields - public static $params = array( 'db', 'table', 'limit', 'debug', 'action'); + public static $params = array( 'db', 'table', 'limit', 'debug', 'action', 'page'); public $fields; @@ -58,14 +58,16 @@ Class Table extends nb { } // Connection -#bye($opt['db']); if (isset($opt['db'])) { $this->db(is_object($opt['db']) ? $opt['db'] : new Db($opt['db'])); unset($opt['db']); + } elseif(isset($GLOBALS['Db'])) { $this->db($GLOBALS['Db']); + } else { $this->db(new Db()); + } // Order BY @@ -313,7 +315,7 @@ Class Table extends nb { $st = $this->db()->conn->prepare($sql); $st->execute(); - echo '
'.NB_EOL; + echo ''.NB_EOL; echo '
'.NB_EOL; $count = 0; if ( $add or ($row = $st->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT))) { @@ -729,7 +731,7 @@ Class Table extends nb { } } - + # # Row # @@ -959,7 +961,7 @@ Class Table extends nb { $html = ''; #$html .= ''.NB_EOL; - $html .= '
'.NB_EOL; + $html .= '
'.NB_EOL; #if (!empty($opt)) $html .= '' .NB_EOL; if ($this->p('header')!=="0") { @@ -1010,7 +1012,7 @@ Class Table extends nb { Html Div -----------------------------------------------------------------*/ public function rows_begin_div() { - return '
'.NB_EOL; + return '
'.NB_EOL; } public function rows_rec_div(&$row) { @@ -1399,6 +1401,9 @@ Class Table extends nb { $r .= ''; } + // Submit + $r .= ''; + // Order By /* $r .= ''; -- 2.47.3
' . $this->nav($opt['count'],$opt['tot'],$opt['limit']) . '