1 00:00:00,570 --> 00:00:01,200 Welcome back. 2 00:00:01,620 --> 00:00:03,930 Now it's time to work on editing and order. 3 00:00:04,290 --> 00:00:08,160 And if you click on edit and order here, nothing is going to happen. 4 00:00:08,160 --> 00:00:09,810 So we need to work on this button first. 5 00:00:10,200 --> 00:00:11,850 So I'm going to go to the index. 6 00:00:11,910 --> 00:00:13,560 The orders are in the index. 7 00:00:14,190 --> 00:00:18,300 So in the index, the first thing that I'm going to do is that I'm going to head on over to the order 8 00:00:18,300 --> 00:00:18,690 button. 9 00:00:18,690 --> 00:00:19,710 Remember, we have here. 10 00:00:21,030 --> 00:00:21,390 Order. 11 00:00:21,390 --> 00:00:27,750 Button this, button this button, edit it not order button ever. 12 00:00:28,200 --> 00:00:36,390 So the edit button will have a trip and this is going to take the user to the edit that edit underscore 13 00:00:36,930 --> 00:00:45,870 order dot BHP and I'm going to add here the the guess parameter is going to be order ID, we need to 14 00:00:45,870 --> 00:00:47,640 pass the order of the order. 15 00:00:47,640 --> 00:00:48,990 It is going to be equal to. 16 00:00:50,320 --> 00:00:54,690 The the order, it is going to be equal to the order. 17 00:00:54,910 --> 00:00:55,150 Right. 18 00:00:55,240 --> 00:00:56,500 So I'm going to add BHP. 19 00:00:56,500 --> 00:00:57,430 I'm going to say BHP. 20 00:00:59,090 --> 00:00:59,720 BHP. 21 00:01:01,640 --> 00:01:02,500 And then echo. 22 00:01:04,420 --> 00:01:04,950 Order. 23 00:01:07,300 --> 00:01:07,980 Order 80. 24 00:01:10,790 --> 00:01:15,560 And by the way, the older ID page is very similar to other pages. 25 00:01:16,220 --> 00:01:17,690 There is nothing different they have added. 26 00:01:18,380 --> 00:01:21,710 They had their file and they also have imported the. 27 00:01:23,230 --> 00:01:27,510 I have also imported the side menu, which is this, and that's it. 28 00:01:27,520 --> 00:01:36,010 And then I have here the edits in the page and every page has will only have a form and that form will 29 00:01:36,010 --> 00:01:41,740 only allow that you allow the admin to edit the order status because there is, there is nothing you 30 00:01:41,740 --> 00:01:43,090 need to edit about the order. 31 00:01:43,480 --> 00:01:47,290 The only thing that you might need to to edit the order is the order status. 32 00:01:47,680 --> 00:01:52,800 You will need to change the order status from not paid to paid or shipped or delivered. 33 00:01:53,230 --> 00:02:00,670 And this also is not this also is not always important because after the user pays, the order will 34 00:02:00,670 --> 00:02:06,190 go from not being to paid immediately, automatically, automatically and immediately. 35 00:02:06,700 --> 00:02:11,530 And that you might in some cases you might need to change the order from not be to paid. 36 00:02:11,950 --> 00:02:17,500 So for example, if if something with payments went wrong or for some other reason, you might need 37 00:02:17,500 --> 00:02:22,240 to do this and then you might also need to change the pay to shipped or delivered. 38 00:02:22,510 --> 00:02:26,020 So this is the only the only thing that's important here. 39 00:02:26,470 --> 00:02:32,440 But first, let me turn over to the let here there over to the index and let me click on one of these 40 00:02:32,440 --> 00:02:34,000 buttons on the edit buttons. 41 00:02:34,000 --> 00:02:38,620 One of the buttons, if you click on this, it should take me to the edit page. 42 00:02:38,620 --> 00:02:43,210 And here, as you can see, we only have this form and I'm just going to display the order ID and the 43 00:02:43,210 --> 00:02:44,710 price and the date. 44 00:02:45,160 --> 00:02:47,680 The status is the only thing that you can change. 45 00:02:47,830 --> 00:02:55,720 So now in the edit order, what we need to do is that the first thing is that at the top below the header, 46 00:02:56,170 --> 00:03:02,230 we need to create a code that's going to get the product information from a database and we already 47 00:03:02,230 --> 00:03:07,480 have a code and the edit product that which we at the top remember we have here this code. 48 00:03:07,720 --> 00:03:08,560 So I'm going to copy this. 49 00:03:08,560 --> 00:03:08,890 Good. 50 00:03:09,610 --> 00:03:12,610 And then I'm going to pasted in the edit order here. 51 00:03:12,610 --> 00:03:16,300 I'm going to say BHP and then I'm going to be here. 52 00:03:17,080 --> 00:03:18,790 However, we need to edit a few things. 53 00:03:18,790 --> 00:03:23,350 First, we need to say order in order ID. 54 00:03:24,160 --> 00:03:34,960 So the order ID here, order it is going to be equal to order ID, order ID and then we need to get 55 00:03:34,960 --> 00:03:45,700 the select select select all from products where select all from orders where order ID. 56 00:03:47,780 --> 00:03:55,700 Or it is equal to or is equal to question mark and then statement bind bahram i and then order and then 57 00:03:55,700 --> 00:03:58,550 we execute and then we get the order. 58 00:03:59,300 --> 00:04:02,330 I'm going to say the order and that's it. 59 00:04:02,690 --> 00:04:06,020 And here, don't forget to close the clearly bracket. 60 00:04:06,560 --> 00:04:11,360 So this is going to get us the order and here we need to display the order information. 61 00:04:11,360 --> 00:04:23,000 So in the form we need to say here first we need to say inside this form we need to say for each, even 62 00:04:23,000 --> 00:04:25,760 though this is an array of only one element, I'm going to say. 63 00:04:26,810 --> 00:04:28,520 HB And then for each. 64 00:04:29,630 --> 00:04:30,650 For each. 65 00:04:33,710 --> 00:04:34,280 Order. 66 00:04:35,120 --> 00:04:39,980 As far as our because I don't want to confuse you. 67 00:04:40,790 --> 00:04:47,390 And then for each order as ah, I'm going to say ah here BHP and then Echo. 68 00:04:50,130 --> 00:04:51,120 Echo are. 69 00:04:53,640 --> 00:04:54,270 Order. 70 00:04:54,270 --> 00:04:55,440 I ordered rice. 71 00:04:55,440 --> 00:04:57,900 He ordered rice and. 72 00:05:00,380 --> 00:05:05,720 Or it is a year I'm going to say BHP Echo are. 73 00:05:07,320 --> 00:05:09,740 Product, not product. 74 00:05:09,750 --> 00:05:10,140 Order. 75 00:05:10,300 --> 00:05:11,220 Order I.D.. 76 00:05:13,290 --> 00:05:17,700 And lastly, we have here the order date. 77 00:05:21,090 --> 00:05:21,460 Here. 78 00:05:21,480 --> 00:05:24,180 I'm going to say beach B and then. 79 00:05:26,990 --> 00:05:27,620 Echo. 80 00:05:32,670 --> 00:05:33,180 Are. 81 00:05:34,870 --> 00:05:36,130 Or date. 82 00:05:38,560 --> 00:05:45,250 And for the category four or not, the category actually for the this is not the category. 83 00:05:45,250 --> 00:05:46,130 This is the status. 84 00:05:46,140 --> 00:05:52,840 So for this status, I'm going to say you status the name is status point is that as we want to add 85 00:05:52,840 --> 00:05:57,430 the if statement and check which one is is selected. 86 00:05:58,150 --> 00:06:00,100 So I'm going to say here if. 87 00:06:01,620 --> 00:06:02,700 BHP and then. 88 00:06:05,190 --> 00:06:07,260 If our. 89 00:06:10,000 --> 00:06:10,750 Status. 90 00:06:12,050 --> 00:06:12,410 Order. 91 00:06:12,410 --> 00:06:12,950 Status. 92 00:06:13,490 --> 00:06:14,170 Order. 93 00:06:14,880 --> 00:06:16,430 Underscore status. 94 00:06:20,160 --> 00:06:22,770 Is equal to is equal to. 95 00:06:22,770 --> 00:06:23,610 Not paid. 96 00:06:23,850 --> 00:06:24,960 Not paid. 97 00:06:25,680 --> 00:06:26,490 Then we. 98 00:06:26,490 --> 00:06:27,390 We say. 99 00:06:29,180 --> 00:06:35,930 We echo here let me really copy this code actually when you to this plate inside the option so here.