So how did you make out with the pagination of the old subscriptions page, as you can see here, I
have it done, so I have five on this page and one in the next page, just enough to ensure that it's
doing exactly what I want.
And implementing this, of course, was virtually identical to implementing it on the sales page.
So let's go have a look in my code.
I modified the subscriptions page.
Basically, I added the pagination part here with the idea of pagination exactly the same as in the
old sales page.
And I did the same thing in the script.
I defined a current page on a page size.
I added the pagination function, which is identical to the one that we have in the other one.
And of course this is code duplication and you could always put this in a shared library.
Then I created an update table function.
And really the only difference here is that I'm calling it mean all subscriptions instead of instead
of all sales.
And this stays pretty much exactly the same.
I modified this, of course, to be exactly as it was on the previous version of the old subscriptions
page, because we're displaying things slightly differently in the table.
It goes to a different URL and I have cancelled instead of refunded here, but otherwise it's pretty
much exactly the same.
So that's the front end.
Now, the handlers, all I did was copy all all sales, paste it as all subscriptions and come down
here and modify the query.
To be get all subscriptions patinated instead of get all sales patinated, then I went over to my models,
file models, Dargo and I created the get all subscriptions pageant, basically a copy and get all pages
patinated, pasted it and change this where clause here on line five.
Sixty five of my code to be WSC is recurring equals one.
And you can't forget this part.
I had to do the same thing in this query, make that one equal to one.
Otherwise your total records will be wrong and you're going to have some mathematical problems.
So that was pretty straightforward.
All right.
In the next section of the course, we'll move on to managing users, adding editing and deleting admin
users.