public/lib/tps.php
/**
     * used to determine database query limits based on provided pageination
     * page number and maxResult.
     * Note: functon will modify input values
     * @access public
     * @param int $pagination current page index
     * @param int $maxResult number of items to in response
     */
used to determine database query limits based on provided pageination
page number and maxResult.
Note: functon will modify input values
@access public
@param int $pagination current page index
@param int $maxResult number of items to in response
used to determine database query limits based on provided pageination page number and maxResult . Note : functon will modify input values @access public @param int $pagination current page index @param int $maxResult number of items to in response
public static function sanitizePagination(&$pagination,&$maxResult){
        if( !is_int($maxResult) || $maxResult > 1000 || $maxResult<1):
            $maxResult = 1000;
        endif;
        if( !is_int($pagination) || $pagination<1):
            $pagination = 1;
        endif;
        $floor = abs(($pagination*$maxResult))-($maxResult+1);
        $ceil = abs($maxResult);
        if ($floor < 0):
            $floor=0;
        endif;
        if($ceil < 0):
            $ceil = abs($ceil);
        endif;
        $pagination = $floor;
        $maxResult = $ceil;
    }
public static function sanitizePagination ( & $ pagination , & $ maxResult ) { if ( ! is_int ( $ maxResult ) || $ maxResult > 1000 || $ maxResult < 1 ) : $ maxResult = 1000 ; endif ; if ( ! is_int ( $ pagination ) || $ pagination < 1 ) : $ pagination = 1 ; endif ; $ floor = abs ( ( $ pagination * $ maxResult ) ) - ( $ maxResult + 1 ) ; $ ceil = abs ( $ maxResult ) ; if ( $ floor < 0 ) : $ floor = 0 ; endif ; if ( $ ceil < 0 ) : $ ceil = abs ( $ ceil ) ; endif ; $ pagination = $ floor ; $ maxResult = $ ceil ; }
used to determine database query limits based on provided pageination
 page number and maxResult.
used to determine database query limits based on provided pageination page number and maxResult .
#abs(($pagination*$maxResult)); // Simply for security. should never happen