@samatair
Ok, this is a challenge but I think we don't really /need/ to be on page one, just pretend it's page one right?
so I would take the value of the page for a particular day (let's say for example day 3 thus page 3) and subtract it from itself and add one (3-3+1) when displaying it for the user.
formula:
current page number - day off set + 1 = viewable page number.
I'm writing this as I go so let's check to see if it works.
The user then presses the "next page" button and I think the following two things should happen according to that formula:
1. In the SQL page 4 is shown, because as far as the application is concerned you were on page 3.
2. In the display, your formula's values would be 4-3+1 = 2. Thus the user see that he's on page 2 (when he's actually on page 4)
Question is, what happens when you go the end. Let's say there is a total of 10 pages 10-3+1 would put you at page 8. User viewed actual pages 3 through 10 which equals displayed page numbers 1 through 8. so how does he view page 1 and 2 (which to the user should display page 9 and 10).
Your application code should have a rotational pagination (meaning whenever you reach the last page, it automatically goes back to page one). so now you have these values to work with to get page 9.
3 = the day/page offset
1 = the true page number
putting this in our original formula would rend 1-3+1 = -1. AHA!!
Here's the solution. Whenever this calculated page number the user sees is less than 1 ADD the total number of pages to it. In this case -1 + 10 = 9. Voila!
So on for page Ten: 2-3+1= 0 + 10 = 10
I just thought of this on-the-fly. Does anybody see a fault in it?
Dan