So let's get started improving our front end to make it more obvious which charges have been refunded
and which have not.
Now, obviously, we have not updated our handler to set the status ID of a particular order to refunded
when we refund it.
But we'll get to that eventually.
Right now, let's just work on the front end and make things a little prettier.
So we'll start with this old sales page.
And what we'll do is add a column here with a little badge that says if something is just a normal charge
or if something has been refunded.
So let's go back to our idea and let's look at the old sales page, which is right here.
OK, so the first thing I'll do is just add a column right up here in the table and I'll call this status
and then I'll go down to the part where we actually populate the table.
And all I'll do here is inside this.
This for each loop is I'll just add a new cell and that's going to be equal to newRow dot insert cell,
same as before.
And then we'll just make a decision if I dot status ID, if that's not equal to one, then we'll put
some code in there else, put some other item on there.
So in the first case, if it's not equal to one, in our case it's probably equal to two because those
are the only two are actually handling.
So we'll set new cells in our TMO
equal to and I'll use bootstraps badge class spane class equals badge, BGU, Dash Dange, which makes
it red and I'll say refund it, then close my span and close my back tax and then I'll copy this whole
thing and paste it in here
and change this to big success and we'll make that charged.
OK, so let's go to our database and find an order that we've just refunded and we'll update its status
ID.
So back to our database and we'll look at orders and I'll refresh this.
So the most recent one would be the highest ID, so I'll change its status ID to two and that should
be refunded and it is OK.
So let's stop our application like start started make start and just see if that looks OK.
Back to my Web browser and I'll just reload this page and we have nothing in there, I must have closed
something that left it incorrect.
HTML, that's a bit of a mistake, so we'll save that mixed up next year.
I'm not sure what inhered HTML is, but we don't want and reload this and it looks better.
So this one's been refunded and that one has been charged.
So the next step is when we go in here.
If this has already been refunded, I probably should put a little message up here saying it's been
refunded and I probably should hide this refund order button and we'll take care of that in the next
lecture.