<?php
class Paging {
  
  public $_ls;
  public $_bs;
  public $_limit;
  public $_count;
  public $_start;
  public $_end;
  public $_link;

  function __construct( $ls, $bs, $limit, $count, $link )
  {
    $this -> _ls    = $ls;
    $this -> _bs    = $bs;
    $this -> _limit = $limit;
    $this -> _count = $count;
    $this -> _start = ( $bs - 1 ) * $limit + 1;
    $this -> _end   = $bs * $limit;
    $this -> _link  = $link;
  }
  
  public function draw()
  {
    $tpl = new \Savant3;
    $tpl -> _ls     = $this -> _ls;
    $tpl -> _bs     = $this -> _bs;
    $tpl -> _limit  = $this -> _limit;
    $tpl -> _count  = $this -> _count;
    $tpl -> _start  = $this -> _start;
    $tpl -> _end    = $this -> _end;
    $tpl -> _link   = $this -> _link;
    return $tpl -> fetch( 'other/pager' );
  }
}
?>
