1 00:00:00,990 --> 00:00:02,670 So inside the option I'm going to be state. 2 00:00:02,670 --> 00:00:08,220 And then if if the order status is equal to or not paid, then I'm going to say here, echo. 3 00:00:09,690 --> 00:00:11,640 Your echo. 4 00:00:14,460 --> 00:00:15,570 Selected. 5 00:00:16,810 --> 00:00:18,490 And we do the same exact thing. 6 00:00:18,520 --> 00:00:20,170 I'm going to copy the same code now. 7 00:00:20,740 --> 00:00:23,590 And then we need to paste it in every single option here. 8 00:00:24,520 --> 00:00:28,110 This option, we need to say order status is equal to paid. 9 00:00:28,780 --> 00:00:32,650 If it's equal to if it's equal to be repaid, would be selected. 10 00:00:33,210 --> 00:00:34,630 Is equal to shipped. 11 00:00:34,810 --> 00:00:36,220 Shipped would be selected. 12 00:00:36,850 --> 00:00:37,270 Here. 13 00:00:38,140 --> 00:00:38,740 Shipped. 14 00:00:40,450 --> 00:00:41,670 Lastly delivered. 15 00:00:43,750 --> 00:00:44,200 You're. 16 00:00:46,940 --> 00:00:47,960 Deliver. 17 00:00:50,810 --> 00:00:51,860 And that's it. 18 00:00:51,890 --> 00:00:52,370 Now. 19 00:00:53,600 --> 00:00:54,500 We are good to go. 20 00:00:55,430 --> 00:00:56,450 They only thing this form. 21 00:00:56,990 --> 00:00:59,720 We need to add a method and action. 22 00:00:59,720 --> 00:01:04,010 So I'm going to remove this type and then I'm going to say method, method. 23 00:01:04,010 --> 00:01:10,700 The method is going to be forced of the action is just going to be the same page I'm going to say edit 24 00:01:10,880 --> 00:01:19,490 underscore order that HP and the name the status name is status and that's it. 25 00:01:19,520 --> 00:01:24,890 Now at the top we need to say else if. 26 00:01:26,110 --> 00:01:31,360 And then is set is set lost. 27 00:01:32,970 --> 00:01:35,330 Lost and then it. 28 00:01:36,950 --> 00:01:38,490 Or order. 29 00:01:38,540 --> 00:01:39,270 In order. 30 00:01:39,810 --> 00:01:41,130 Let me check the brand name. 31 00:01:41,520 --> 00:01:45,420 So the bottom here at the bottom, it has a edit order. 32 00:01:46,110 --> 00:01:52,320 So I'm going to say if we want to edit the order, then let me copy the code from the edit product because 33 00:01:52,320 --> 00:01:53,250 it's going to be similar. 34 00:01:53,910 --> 00:01:56,070 So I'm going to copy this. 35 00:01:56,070 --> 00:01:58,440 Good, actually with this line. 36 00:02:00,910 --> 00:02:04,180 These lines are going to use them in the edit order here. 37 00:02:05,890 --> 00:02:07,600 And we need to edit a few things. 38 00:02:07,630 --> 00:02:08,800 Let me first push this. 39 00:02:09,670 --> 00:02:12,650 First, we need to get the order status. 40 00:02:12,650 --> 00:02:16,420 So I'm going to say order underscore status. 41 00:02:17,050 --> 00:02:19,360 So the order status is going to be equal to most. 42 00:02:20,620 --> 00:02:21,130 Most. 43 00:02:22,980 --> 00:02:23,520 Order. 44 00:02:23,550 --> 00:02:24,420 Underscore. 45 00:02:25,830 --> 00:02:27,690 Let me check the names of the name. 46 00:02:28,500 --> 00:02:29,970 The name was status. 47 00:02:29,970 --> 00:02:30,630 Your status. 48 00:02:31,260 --> 00:02:32,640 And we also need the order ID. 49 00:02:32,790 --> 00:02:35,340 So the order ID is here. 50 00:02:35,370 --> 00:02:37,410 Let's hear Liberty. 51 00:02:37,410 --> 00:02:37,920 Get ahead. 52 00:02:37,920 --> 00:02:47,760 In leaving, you could get a haven input and input and then type type is type is given. 53 00:02:49,260 --> 00:03:08,550 Type is equal to event and name is equal to order ID and value is equal to BHP and then are equal. 54 00:03:09,890 --> 00:03:10,880 Echo our. 55 00:03:12,860 --> 00:03:13,540 Order I.D.. 56 00:03:14,060 --> 00:03:14,570 Order! 57 00:03:14,810 --> 00:03:15,530 Score I.D.. 58 00:03:17,750 --> 00:03:24,050 And in order not to confuse you, I'm going to say here, the name is order status. 59 00:03:24,050 --> 00:03:26,120 Instead of status, just order status. 60 00:03:26,750 --> 00:03:27,770 So add it up now. 61 00:03:28,960 --> 00:03:35,070 What we need to do is that we need to see order, underscore status and then order it. 62 00:03:37,550 --> 00:03:42,830 Order underscore it, and then past is equal to past. 63 00:03:44,470 --> 00:03:48,430 Order in order underscore it. 64 00:03:49,720 --> 00:03:51,280 And then I'm going to say here, statement. 65 00:03:51,280 --> 00:03:52,870 Go on, prepare. 66 00:03:52,870 --> 00:03:55,630 Update orders set. 67 00:03:56,640 --> 00:03:57,330 Order. 68 00:03:58,050 --> 00:04:02,520 Underscore status is the equal is equal to question mark. 69 00:04:02,940 --> 00:04:10,830 And then I'm going to remove all of these where we're order ID is equal to question mark. 70 00:04:13,350 --> 00:04:13,950 Order. 71 00:04:14,520 --> 00:04:16,050 It is equal to question mark. 72 00:04:16,530 --> 00:04:19,350 And then I'm going to say statements by Bahram. 73 00:04:20,340 --> 00:04:24,710 And then as I and then we pass two parameters. 74 00:04:24,720 --> 00:04:25,830 We don't need all of these. 75 00:04:26,460 --> 00:04:28,230 We only need two parameters. 76 00:04:28,230 --> 00:04:30,660 We need to pass the order status. 77 00:04:31,850 --> 00:04:32,540 And the order it. 78 00:04:34,390 --> 00:04:35,650 Order, status and order. 79 00:04:36,760 --> 00:04:50,560 And here we just say in case of success we say index that BHP and then order a date it is equal to order 80 00:04:51,550 --> 00:04:56,830 has been updated successfully or and then in case of error message order. 81 00:04:59,290 --> 00:04:59,890 Not. 82 00:05:01,580 --> 00:05:02,400 Update it or. 83 00:05:02,440 --> 00:05:03,030 Order! 84 00:05:04,110 --> 00:05:04,550 Order! 85 00:05:06,020 --> 00:05:06,380 Order! 86 00:05:06,380 --> 00:05:09,110 Updated order field. 87 00:05:09,320 --> 00:05:10,520 Let's say order field. 88 00:05:12,320 --> 00:05:12,800 That's it. 89 00:05:12,830 --> 00:05:17,400 Now we are going to go to your else else. 90 00:05:17,690 --> 00:05:23,300 I'm just going to say header and then location. 91 00:05:25,160 --> 00:05:25,880 Index. 92 00:05:27,890 --> 00:05:29,270 Index that BHP. 93 00:05:34,170 --> 00:05:35,220 And exit. 94 00:05:37,890 --> 00:05:47,100 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 95 00:05:47,100 --> 00:05:52,200 test this and in the index we can display the messages if you want to display the messages above. 96 00:05:52,200 --> 00:05:53,640 The above. 97 00:05:55,450 --> 00:05:57,160 Here, actually here. 98 00:05:58,300 --> 00:06:01,330 Above, below this, below this, you can display the messages. 99 00:06:02,110 --> 00:06:08,080 So I'm going to get the messages from the event, from the products, if you open up the products here. 100 00:06:09,070 --> 00:06:10,570 Products, you will find the messages. 101 00:06:10,570 --> 00:06:13,380 So we have two messages one for success and one for failure. 102 00:06:13,390 --> 00:06:19,540 I'm going to copy them and then I'm going to base them in the index just below the table. 103 00:06:19,540 --> 00:06:28,900 So we have here in the index below above the table, I'm going to base them of every success is order 104 00:06:29,710 --> 00:06:36,610 underscore updated and the order underscore updated. 105 00:06:37,300 --> 00:06:41,170 In case of failure we just say order failed. 106 00:06:44,100 --> 00:06:45,150 And here, order. 107 00:06:47,250 --> 00:06:51,240 Field and here, make sure that the key is correct. 108 00:06:52,080 --> 00:06:52,620 Order. 109 00:06:54,160 --> 00:06:55,180 Updated. 110 00:06:57,050 --> 00:06:57,410 That's it. 111 00:06:57,830 --> 00:06:59,480 Now, here. 112 00:07:00,640 --> 00:07:02,980 I think we have a problem here. 113 00:07:05,660 --> 00:07:05,990 Here. 114 00:07:05,990 --> 00:07:07,280 We need to close the. 115 00:07:07,670 --> 00:07:08,960 Remember I opened. 116 00:07:08,960 --> 00:07:10,150 I opened before each. 117 00:07:10,160 --> 00:07:12,320 But I forgot to close the already for each. 118 00:07:12,860 --> 00:07:14,660 So this is a big problem. 119 00:07:14,660 --> 00:07:15,770 We need to fix it quickly. 120 00:07:15,770 --> 00:07:20,270 We need to say here BHP and then close the curly brackets and we are good to go. 121 00:07:20,690 --> 00:07:22,530 Now let me hit it over to the browser and test. 122 00:07:22,580 --> 00:07:28,070 So I'm going to go back to the orders LME, refresh the orders LME, click on edit. 123 00:07:28,460 --> 00:07:34,370 If I click on edit LME change first we have an error in line 84. 124 00:07:34,820 --> 00:07:44,540 So in line 84, if I go to line 84, it says here, line 84, 84, this rest echo order price. 125 00:07:45,080 --> 00:07:46,350 So we have a problem. 126 00:07:46,380 --> 00:07:50,480 The problem says undefined index order price. 127 00:07:51,140 --> 00:07:54,050 So the reason I think. 128 00:07:56,550 --> 00:08:03,180 Is because Ricky in the in the database was order cost not ordered price order cost. 129 00:08:03,900 --> 00:08:06,110 Now it should now it should be fixed. 130 00:08:06,150 --> 00:08:07,230 Let me refresh. 131 00:08:07,680 --> 00:08:10,200 And as you can see, the order of the error is gone. 132 00:08:10,620 --> 00:08:14,610 So here I'm going to display the order ID and the order price and then the status. 133 00:08:14,880 --> 00:08:16,020 You can't change the status. 134 00:08:16,020 --> 00:08:18,990 So, for example, let me go back to show you the process from the beginning. 135 00:08:19,320 --> 00:08:22,020 Suppose that you want to to edit the paid here. 136 00:08:22,020 --> 00:08:27,250 Suppose that you have shipped the product and you want to you you ship the product and the product is, 137 00:08:27,360 --> 00:08:30,030 is on its way to the customer. 138 00:08:30,360 --> 00:08:37,170 You can here click on edit and then you can edit the paid edit the status from pay to shipped and then 139 00:08:37,170 --> 00:08:38,310 you can click on edit. 140 00:08:38,790 --> 00:08:41,550 And as you can see, the status has been updated. 141 00:08:41,970 --> 00:08:46,860 And if an once user or a customer. 142 00:08:47,950 --> 00:08:48,220 Here. 143 00:08:48,250 --> 00:08:49,330 Have a here. 144 00:08:49,330 --> 00:08:50,500 I have another problem. 145 00:08:50,800 --> 00:08:54,640 Let me finish this and then I'm going to fix this problem here. 146 00:08:56,590 --> 00:09:02,390 Once the customer receives the order, you can click on edit and then update this one more time to deliver 147 00:09:02,800 --> 00:09:04,930 and then click on edit and then it will update it. 148 00:09:05,500 --> 00:09:08,110 Here we have a problem undefined index order updated. 149 00:09:08,110 --> 00:09:12,010 So in line 95, again in line 95. 150 00:09:12,460 --> 00:09:13,600 I should say here. 151 00:09:15,040 --> 00:09:17,420 I should say this. 152 00:09:17,470 --> 00:09:18,130 Order! 153 00:09:18,160 --> 00:09:18,460 Order! 154 00:09:18,460 --> 00:09:18,940 Status. 155 00:09:20,140 --> 00:09:20,590 Order. 156 00:09:20,590 --> 00:09:21,370 Updated. 157 00:09:24,060 --> 00:09:24,300 Ah. 158 00:09:24,310 --> 00:09:25,500 Not in this file actually. 159 00:09:25,500 --> 00:09:25,860 In law. 160 00:09:25,860 --> 00:09:26,640 In index. 161 00:09:27,030 --> 00:09:33,060 So in the index no line 95 here I should say or underscore updated. 162 00:09:33,750 --> 00:09:35,400 So let me try one more time. 163 00:09:36,530 --> 00:09:43,010 Let me here refresh and let me edit, for example, this one I'm going to click on edit and I'm going 164 00:09:43,010 --> 00:09:45,950 to say shift and I'm going to click on edit. 165 00:09:45,950 --> 00:09:47,390 And as you can see, it has been updated. 166 00:09:47,840 --> 00:09:53,900 And by the way, you should be careful with this because you cannot just change the order after it has 167 00:09:53,900 --> 00:09:54,610 been delivered. 168 00:09:54,880 --> 00:09:59,240 You cannot go from you cannot go from delivered to not paid. 169 00:09:59,660 --> 00:10:02,600 Once the order has been delivered, it's over. 170 00:10:02,600 --> 00:10:03,530 You cannot change it. 171 00:10:03,530 --> 00:10:06,110 If you do this, you are going to mess with your system. 172 00:10:06,470 --> 00:10:12,020 But since you are the admin and since people who are going to work with you are admins, we should know 173 00:10:12,020 --> 00:10:12,260 this. 174 00:10:12,260 --> 00:10:14,210 You shouldn't go back. 175 00:10:14,300 --> 00:10:15,560 You shouldn't go back and forth. 176 00:10:15,950 --> 00:10:20,180 The process only is from goes forward, not backward.