Pagination example

PHP and HTML

  • «
  • $last){$top=$last;} if($x<=0){$bottom+=1;$top+=1;} } for($i=$bottom;$i<=$top;$i++){ ?>
  • ">
  • »

jQuery

$(document).on("click",".pbutton",function() {
		var selected = this.text; //Selected page
		if(selected=="«"){selected = 1;} //first rows
		if(selected=="»"){selected = $(".last_page").attr("id");} //last rows
		
		$.ajax({
		  url:'admin.php',
		  type:'POST',
		  data:{ 
			command:"show_regular_quotation", //name of var: value of var  
			selected:selected
		  }  
		 }).done(function(data){
			$(".content").html(data);
		});		
	});

The code is perfectly compatible with bootstrap.

Leave a Reply

Your email address will not be published. Required fields are marked *