Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6455 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi there,

In the following code, what goes in the "Empty Reference!" brackets:

Page: -*-* <?php $pages=ceil($returnedCount/$groupSize); if($pages>'1'){ $i='1'; $x='0';?>

<? echo $i; ?> <? while($i<$pages){ $x=$i*$groupSize; $i++; echo ' | ' ?><? echo $i; ?> <? } } ?>

Also, what is the following code for:

-*-*

The final effect should look like this:

Page: 1 | 2 | 3 | 4

where the numbers are links to further pages of search results.

Cheers,

Steven

  • 2 months later...
Posted

Did you ever find the answer? I am wondering the same thing and would appreciate it if I could see the code.

  • 2 weeks later...
Posted

It should be the page your search results are on...

ie) what you are trying to do is create a search that looks like:

searchresults.php?i=1

etc.

Posted (edited)

I ended up using some other code. Here it is if anyone's interested:


[color:green]function draw_pager($url, $total_pages, $current_page, $groupSize) {

		

			$URLExtend = '&org_unit='.$_POST['org_unit'].'&department='.$_POST['department'].'&jobFamiliesCombined='.$_POST['jobFamiliesCombined'].'&examplesCombined='.$_POST['examplesCombined'].'&areas_of_education='.$_POST['areas_of_education'].'&areas_other='.$_POST['areas_other'].'&category_employment='.$_POST['category_employment'].'&-lop='.$_POST['-lop'].'&go=Find+Records&-sortfield_1='.$_POST['-sortfield_1'].'&-sortorder_1='.$_POST['-sortorder_1'].'&';

			

			if ( $current_page <= 0 || $current_page > $total_pages ) {

				$current_page = 1;

			}

			

			

			

			if ( $current_page > 1 ) {

				printf( "[start] n" , 0, 1);

				printf( "[Prev] n" , ($current_page - 1) * $groupSize, ($current_page-1));

			}

			

			for( $i = ($current_page-5); $i <= $current_page+5; $i++ ) {

	

				$skip = ($i - 1) * $groupSize;

			

				if ($i < 1) continue;

				if ( $i > $total_pages ) break;

				

				if ( $i != $current_page ) {

					printf( "%2$d n" , $skip, $i);

				} else {

					printf("%2$d n", $skip, $i);

				}

				

			}

			

			if ( $current_page < $total_pages ) {

				printf( "[Next] n", $current_page * $groupSize, ($current_page+1));

				printf( "[End] n", ($total_pages - 1) * $groupSize, $total_pages);

			}

			

		}



			

			$groupSize = 10;

			$pageGroupSize = 2;			

			$pages = ceil($searchResults['foundCount']/$groupSize); 

			$groups = ceil($pages/$pageGroupSize); 

			$url = 'https://domain.edu/ii/search.php';

			$current_page = isset($_POST['page']) ? $_POST['page']  1;



			draw_pager($url, $pages, $current_page, $groupSize)

		

		?>[/color]

Edited by Guest

This topic is 6455 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.