function generate_pagination_links($totalpages, $totalrecords, $pagenumber, $pagesize)
 {
     $script = "";
     $firstbound = 0;
     $lastbound = 0;
     $tooltip = "";
     $lst = new pagination();
     if ($this->paginationstyle == 1) {
         $arr = $lst->advance_pagination_links($totalpages, $pagenumber);
     } else {
         $arr = $lst->simple_pagination_links($totalpages, 15, $pagenumber);
     }
     if (count($arr) > 0) {
         foreach ($arr as $item) {
             $firstbound = ($item - 1) * $pagesize + 1;
             $lastbound = $firstbound + $pagesize - 1;
             if ($lastbound > $totalrecords) {
                 $lastbound = $totalrecords;
             }
             $tooltip = "showing " . $firstbound . " - " . $lastbound . " records  of " . $totalrecords . " records";
             $css = "";
             if ($item == $pagenumber) {
                 $css = " class=\"active\"";
             }
             $script .= "<li" . $css . "><a id=\"pg_" . $item . "\" href=\"" . $this->prepareUrl($item) . "\" class=\"pagination-css\" data-toggle=\"tooltip\" title=\"" . $tooltip . "\">" . $item . "</a></li>\n";
         }
     }
     return $script;
 }