020 555 1111
  • Old fashion, modular, procedural PHP plus some scaffolding techniques to allow it to mimic MVC simplicity.
  • A quick reference to help you find in PHP maze what needs to be done and how to do it.
  • Learn a PHP Object Oriented Programming by building a live discussion forum application.
  • MVC - Model View Controller - real life, easy reference and application.
This product has options, take a look at them and select ones you like the most.
Options are displayed under image section.

Paging: example
[php functions]

 

//paging - page click range, 
//e.g.: 1  2  3  4  =5=  6  7  8  9
//page 5 is selected
//page - current page
//pages - all pages of display
function fn_page_click_range ($page, $pages, $range, $uri = '') {
	global $base_filename;
	
	$side_pages_no = '4';
	$low_range = $page - $side_pages_no;
	if ($low_range<1) $low_range = 1;
	$high_range = $page + $side_pages_no;
	if ($high_range>$pages) $high_range = $pages; 
	//prevent out of data range values
	//e.g. there is 11 pages of data, but someone entered by hand page 23rd etc.
	if ($page > $pages) {
		$low_range = 1;
		$high_range = $side_pages_no;
	}
	$pages_array = range($low_range,$high_range);
	
	//2. create page string - this will display paging navigation to switch between pages
	//note: I use ids to pass page numbers to jQuery paging function located in js.js file
	$pages_string = '';
	if (is_array($pages_array)) {
		if ($page!=1) $pages_string .= '<a id="1" class="css_page click_fetch" href="'.$base_filename.'?'.$uri.'page=1">first</a>';
		foreach($pages_array as $val) {
			if ($page > $pages) $page = 1;
			if ($val == $page) {
				$css_page = 'css_page_select'; //selected/current page
			} else {
				$css_page = 'css_page';
			}
			$pages_string .= '<a id="'.$val.'" class="'.$css_page.' click_fetch" href="'.$base_filename.'?'.$uri.'page='.$val.'">'.$val.'</a>';
		}
		if ($page!=$pages) $pages_string .= '<a id="'.$pages.'" class="css_page click_fetch" href="'.$base_filename.'?'.$uri.'page='.$pages.'">last</a>';
	}
	return $pages_string;
}

//paging - page display range
function fn_page_range ($page, $pages) {
	return sprintf('page %s out of %s',$page, $pages);
}