Default hyperlink href set to PHP_SELF.
[fa-stable.git] / includes / ui / db_pager_view.inc
index dfd2ecc534f0130171726f446396dbbbd77415fc..7fe7754ed22124b30532987de0bd9119bab6fa27 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 /**********************************************************************
     Copyright (C) FrontAccounting, LLC.
-       Released under the terms of the GNU Affero General Public License,
-       AGPL, as published by the Free Software Foundation, either version 
-       of the License, or (at your option) any later version.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
-    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 //--------------------------------------------------------------------------------------------------
 function pager_link($link_text, $url, $icon=false)
@@ -59,7 +59,7 @@ function display_db_pager(&$pager) {
                }
        }
     /* show a table of records returned by the sql */
-    start_table("$table_style width=".$pager->width);
+    start_table("$table_style width=$pager->width");
     table_header($headers, 'nowrap');
 
        if($pager->header_fun) {        // if set header handler
@@ -104,9 +104,9 @@ function display_db_pager(&$pager) {
                    case 'time':
                          label_cell($cell, "width=40"); break;
                    case 'date':
-                         label_cell(sql2date($cell), "align='center' width=50"); break;
+                         label_cell(sql2date($cell), "align='center' nowrap"); break;
                    case 'dstamp':      // time stamp displayed as date
-                         label_cell(sql2date(substr($cell, 0, 10)), "align='center'"); break;
+                         label_cell(sql2date(substr($cell, 0, 10)), "align='center' nowrap"); break;
                    case 'tstamp':      // time stamp - FIX user format
                          label_cell(sql2date(substr($cell, 0, 10)).
                          ' '. substr($cell, 10), "align='center'"); break;
@@ -153,32 +153,33 @@ function display_db_pager(&$pager) {
                end_row();
        }
 
-       end_table();
-       start_table("$table_style align='center' class='navibar' width=".$pager->width);
-       start_row();
+       start_row("class='navibar'");
+       $colspan = count($pager->columns);
         if($pager->rec_count) {
-               $from = ($pager->curr_page-1)*$pager->page_len+1;
-               $to = $from + $pager->page_len - 1;
-               if ($to > $pager->rec_count)
-                 $to = $pager->rec_count;
-               $all = $pager->rec_count;
-               label_cell(sprintf( _('Records %d-%d of %d'), $from, $to, $all),
-                       "style='border:none'");
-               echo "<td style='border:none'>";
+               echo "<td colspan=$colspan class='navibar' style='border:none;padding:3px;'>";
+               echo "<div style='float:right;'>";
                $but_pref = $pager->name.'_page_';
-           start_table("align='right'");
+           start_table();
                start_row();
                echo navi_button_cell($but_pref.'first', _('First'), $pager->first_page, 'right');
                echo navi_button_cell($but_pref.'prev', _('Prev'), $pager->prev_page,'right');
                echo navi_button_cell($but_pref.'next', _('Next'), $pager->next_page,'right');
                echo navi_button_cell($but_pref.'last', _('Last'), $pager->last_page, 'right');
                end_row(); 
-               end_table();    
+               end_table();
+               echo "</div>";
+               $from = ($pager->curr_page-1)*$pager->page_len+1;
+               $to = $from + $pager->page_len - 1;
+               if ($to > $pager->rec_count)
+                 $to = $pager->rec_count;
+               $all = $pager->rec_count;
+               echo sprintf( _('Records %d-%d of %d'), $from, $to, $all);
                echo "</td>";
        } else {
-         label_cell( _('No records'));
+         label_cell( _('No records'), "colspan=$colspan class='navibar'");
        }
        end_row();
+
        end_table();
 
    if (isset($pager->marker_txt))