private function setStartingPageRecord($sDefaultPageNo, $iRecordsPerPage, $iAllRecords, $bKeepFullPage = true)
    {
        if (is_null($this->tCmnSuperGlobals->get('page'))) {
            switch ($sDefaultPageNo) {
                case 'last':
                    $iStartingPageRecord = $iAllRecords - $iRecordsPerPage;
                    break;
                case 'first':
                default:
                    $iStartingPageRecord = 0;
                    break;
            }
        } else {
            $iStartingPageRecord = ($this->tCmnSuperGlobals->get('page') - 1 ) * $iRecordsPerPage;
        }
        if (($bKeepFullPage ) && (($iStartingPageRecord + $iRecordsPerPage ) > $iAllRecords)) {
            $iStartingPageRecord = $iAllRecords - $iRecordsPerPage;
        }
        return max(0, $iStartingPageRecord);
    }