Ignore:
Timestamp:
06/29/07 15:17:46 (17 years ago)
Author:
niltonneto
Message:

Versão nova do ADODB (4.5 para 4.95)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/adodb/adodb-pager.inc.php

    r2 r34  
    22 
    33/* 
    4         V4.51 29 July 2004  (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved. 
     4        V4.94 23 Jan 2007  (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved. 
    55          Released under both BSD license and Lesser GPL library license.  
    66          Whenever there is any discrepancy between the two licenses,  
     
    5858        function ADODB_Pager(&$db,$sql,$id = 'adodb', $showPageLinks = false) 
    5959        { 
    60         global $HTTP_SERVER_VARS,$PHP_SELF,$HTTP_SESSION_VARS,$HTTP_GET_VARS; 
     60        global $PHP_SELF; 
    6161         
    6262                $curr_page = $id.'_curr_page'; 
    63                 if (empty($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; 
     63                if (empty($PHP_SELF)) $PHP_SELF = htmlspecialchars($_SERVER['PHP_SELF']); // htmlspecialchars() to prevent XSS attacks 
    6464                 
    6565                $this->sql = $sql; 
     
    7070                $next_page = $id.'_next_page';   
    7171                 
    72                 if (isset($HTTP_GET_VARS[$next_page])) { 
    73                         $HTTP_SESSION_VARS[$curr_page] = $HTTP_GET_VARS[$next_page]; 
    74                 } 
    75                 if (empty($HTTP_SESSION_VARS[$curr_page])) $HTTP_SESSION_VARS[$curr_page] = 1; ## at first page 
    76                  
    77                 $this->curr_page = $HTTP_SESSION_VARS[$curr_page]; 
     72                if (isset($_GET[$next_page])) { 
     73                        $_SESSION[$curr_page] = (integer) $_GET[$next_page]; 
     74                } 
     75                if (empty($_SESSION[$curr_page])) $_SESSION[$curr_page] = 1; ## at first page 
     76                 
     77                $this->curr_page = $_SESSION[$curr_page]; 
    7878                 
    7979        } 
     
    243243                $this->rows = $rows; 
    244244                 
     245                if ($this->db->dataProvider == 'informix') $this->db->cursorType = IFX_SCROLL; 
     246                 
    245247                $savec = $ADODB_COUNTRECS; 
    246248                if ($this->db->pageExecuteCountRows) $ADODB_COUNTRECS = true; 
     
    264266                $grid = $this->RenderGrid(); 
    265267                $footer = $this->RenderPageCount(); 
     268                 
     269                $this->RenderLayout($header,$grid,$footer); 
     270                 
    266271                $rs->Close(); 
    267272                $this->rs = false; 
    268                  
    269                 $this->RenderLayout($header,$grid,$footer); 
    270273        } 
    271274         
Note: See TracChangeset for help on using the changeset viewer.