Question: How can I solve a problem in the output loop display page of The paging class? & Lt ;? Phpclass & nbsp; PageClass & nbsp; {private & nbsp; $ total_record; // total record private & nbsp; $ page_size; // The number of page records. private & newbie's question: an output loop is displayed on pages. how can this problem be solved?
Class PageClass {
Private $ total_record; // total records
Private $ page_size; // Number of page Records
Private $ current_page; // current page
Private $ total_page_size; // total number of pages
Private $ page_url; // page url
Private $ page_start; // Start Page
Private $ page_stop; // end page
Public $ page_limit; // limit,
Function _ construct ($ total_record = 0, $ page_size = 1, $ current_page = 1, $ page_url ){
$ This-> total_record = $ this-> numeric ($ total_record );
$ This-> page_size = $ this-> numeric ($ page_size );
$ This-> current_page = $ this-> numeric ($ current_page );
$ This-> page_limit = ($ this-> current_page * $ this-> page_size)-$ this-> page_size;
$ This-> page_url = $ page_url;
If ($ this-> current_page <1 ){
$ This-> current_page = 1;
}
If ($ this-> current_page <0 ){
$ This-> current_page = 0;
}
$ Total_page_size = ceil ($ total_record/$ page_size );
If ($ this-> total_page_size <1 ){
$ This-> total_page_size = 1;
}
If ($ this-> current_page> $ this-> total_page_size ){
$ This-> crrent_page = $ this-> total_page_size;
}
$ This-> page_start = $ this-> current_page;
$ This-> page_stop = $ this-> current_page + 5;
If ($ this-> page_stop> $ this-> total_page_size ){
$ This-> page_stop = $ this-> total_page_size;
$ This-> page_start =$ this-> page_stop-5;
}
If ($ this-> page_start <1 ){
$ This-> page_start = 1;
If ($ this-> page_stop> $ this-> total_page_size ){
$ This-> page_stop = $ this-> total_page_size;
}