<form name="tlead" method="post" action="<?=$pagename?>">
	<?php
	if(!empty($post_vars)){
		foreach($post_vars as $vvkey=>$vvalue){
			if(is_array($vvalue)){
				$pvvalue= implode(",", $vvalue);
			}else{
				$pvvalue= $vvalue;
			}
		?>
			<input type="hidden" name="<?=$vvkey?>" value="<?=$pvvalue?>">
	<?php	
		}
	}
	?>
	<input type="hidden" name="_token" value="<?=csrf_token()?>">
<?php 	$mod = ceil($num_rows/$pagesize);?>	
	<?php if($num_pages>1) { ?>
	<p>	
	<?php if ($pageno > 1 ) { ?>
	<a href="<?=$pagename?>&pageno=<?=$pageno-1?>" class="btn btn-sm btn-primary"> Previous</a>&nbsp;&nbsp;
	<?php } else {?>
	<a href="#" class="btn btn-sm btn-default"> Previous</a>&nbsp;&nbsp;
	<?php } //if ?>
	<?php if ($pageno < ($mod-1) ) { ?>
	<a href="<?=$pagename?>&pageno=<?=$pageno+1?>" class="btn btn-sm btn-primary" >Next</a>
	<?php } else {?>
	Next
	<?php } //if ?>
	</p>
	Go To
		<select name="pageno" style=" width: 80px!important;" onChange="javascript:this.form.submit();">
	  <?php
	
		
	  
	  if($num_pages>1) {
			for($i=1;$i<=$mod;$i++) {
		?>
		<option value="<?php echo $i;?>" <?php if($pageno==$i) print("selected") ?>><?php echo $i;?></option>
	<?php
			} //for
		} else { //if
		?>   
		<option value="1">1</option>	
	<?php } ?>
	</select>&nbsp;
	<?php } //if 
	if($pageno==1){
		$sptr = 1;
	}else{
		$sptr = (($pageno-1)*$pagesize) + 1;
	}
	if($pageno==1){
		$eptr = (($pageno-1)*$pagesize) + 1;
	}else{
	$eptr = (((($pageno-1)*$pagesize) + $pagesize)>$num_rows) ? $num_rows : ((($pageno-1)*$pagesize) + $pagesize);
	}
	if(!$eptr) $sptr = 0;
	?>
	Results <?php echo $sptr;?> - <?php echo $eptr;?>&nbsp;of&nbsp;<?php echo $num_rows;?>
</form>
