So inside the option I'm going to be state.
And then if if the order status is equal to or not paid, then I'm going to say here, echo.
Your echo.
Selected.
And we do the same exact thing.
I'm going to copy the same code now.
And then we need to paste it in every single option here.
This option, we need to say order status is equal to paid.
If it's equal to if it's equal to be repaid, would be selected.
Is equal to shipped.
Shipped would be selected.
Here.
Shipped.
Lastly delivered.
You're.
Deliver.
And that's it.
Now.
We are good to go.
They only thing this form.
We need to add a method and action.
So I'm going to remove this type and then I'm going to say method, method.
The method is going to be forced of the action is just going to be the same page I'm going to say edit
underscore order that HP and the name the status name is status and that's it.
Now at the top we need to say else if.
And then is set is set lost.
Lost and then it.
Or order.
In order.
Let me check the brand name.
So the bottom here at the bottom, it has a edit order.
So I'm going to say if we want to edit the order, then let me copy the code from the edit product because
it's going to be similar.
So I'm going to copy this.
Good, actually with this line.
These lines are going to use them in the edit order here.
And we need to edit a few things.
Let me first push this.
First, we need to get the order status.
So I'm going to say order underscore status.
So the order status is going to be equal to most.
Most.
Order.
Underscore.
Let me check the names of the name.
The name was status.
Your status.
And we also need the order ID.
So the order ID is here.
Let's hear Liberty.
Get ahead.
In leaving, you could get a haven input and input and then type type is type is given.
Type is equal to event and name is equal to order ID and value is equal to BHP and then are equal.
Echo our.
Order I.D..
Order!
Score I.D..
And in order not to confuse you, I'm going to say here, the name is order status.
Instead of status, just order status.
So add it up now.
What we need to do is that we need to see order, underscore status and then order it.
Order underscore it, and then past is equal to past.
Order in order underscore it.
And then I'm going to say here, statement.
Go on, prepare.
Update orders set.
Order.
Underscore status is the equal is equal to question mark.
And then I'm going to remove all of these where we're order ID is equal to question mark.
Order.
It is equal to question mark.
And then I'm going to say statements by Bahram.
And then as I and then we pass two parameters.
We don't need all of these.
We only need two parameters.
We need to pass the order status.
And the order it.
Order, status and order.
And here we just say in case of success we say index that BHP and then order a date it is equal to order
has been updated successfully or and then in case of error message order.
Not.
Update it or.
Order!
Updated order field.
Let's say order field.
That's it.
Now we are going to go to your else else.
I'm just going to say header and then location.
Index.
Index that BHP.
And exit.
Just like a year is just like the IT product and now we are good to go and we can now test we can now
test this and in the index we can display the messages if you want to display the messages above.
The above.
Here, actually here.
Above, below this, below this, you can display the messages.
So I'm going to get the messages from the event, from the products, if you open up the products here.
Products, you will find the messages.
So we have two messages one for success and one for failure.
I'm going to copy them and then I'm going to base them in the index just below the table.
So we have here in the index below above the table, I'm going to base them of every success is order
underscore updated and the order underscore updated.
In case of failure we just say order failed.
And here, order.
Field and here, make sure that the key is correct.
Order.
Updated.
That's it.
Now, here.
I think we have a problem here.
Here.
We need to close the.
Remember I opened.
I opened before each.
But I forgot to close the already for each.
So this is a big problem.
We need to fix it quickly.
We need to say here BHP and then close the curly brackets and we are good to go.
Now let me hit it over to the browser and test.
So I'm going to go back to the orders LME, refresh the orders LME, click on edit.
If I click on edit LME change first we have an error in line 84.
So in line 84, if I go to line 84, it says here, line 84, 84, this rest echo order price.
So we have a problem.
The problem says undefined index order price.
So the reason I think.
Is because Ricky in the in the database was order cost not ordered price order cost.
Now it should now it should be fixed.
Let me refresh.
And as you can see, the order of the error is gone.
So here I'm going to display the order ID and the order price and then the status.
You can't change the status.
So, for example, let me go back to show you the process from the beginning.
Suppose that you want to to edit the paid here.
Suppose that you have shipped the product and you want to you you ship the product and the product is,
is on its way to the customer.
You can here click on edit and then you can edit the paid edit the status from pay to shipped and then
you can click on edit.
And as you can see, the status has been updated.
And if an once user or a customer.
Here.
Have a here.
I have another problem.
Let me finish this and then I'm going to fix this problem here.
Once the customer receives the order, you can click on edit and then update this one more time to deliver
and then click on edit and then it will update it.
Here we have a problem undefined index order updated.
So in line 95, again in line 95.
I should say here.
I should say this.
Order!
Status.
Order.
Updated.
Ah.
Not in this file actually.
In law.
In index.
So in the index no line 95 here I should say or underscore updated.
So let me try one more time.
Let me here refresh and let me edit, for example, this one I'm going to click on edit and I'm going
to say shift and I'm going to click on edit.
And as you can see, it has been updated.
And by the way, you should be careful with this because you cannot just change the order after it has
been delivered.
You cannot go from you cannot go from delivered to not paid.
Once the order has been delivered, it's over.
You cannot change it.
If you do this, you are going to mess with your system.
But since you are the admin and since people who are going to work with you are admins, we should know
this.
You shouldn't go back.
You shouldn't go back and forth.
The process only is from goes forward, not backward.