1 00:00:00,420 --> 00:00:01,110 Welcome back. 2 00:00:01,500 --> 00:00:03,810 Now, what we need to do is that we need to get orders. 3 00:00:04,170 --> 00:00:08,820 So as soon as a user places an order, we need to display the order here. 4 00:00:09,120 --> 00:00:15,420 And if the order has been filled, we also need to display a history of all orders that the user has 5 00:00:16,080 --> 00:00:23,280 made so we can display the order and the date, and we can also display the the status of the order, 6 00:00:23,280 --> 00:00:26,770 whether the order was delivered or paid or not paid. 7 00:00:26,790 --> 00:00:30,900 All of these things must be displayed in the user account. 8 00:00:31,380 --> 00:00:32,700 So let's work on this area. 9 00:00:32,700 --> 00:00:40,160 So this area exists in the remember in the order in the account that we be in the order in the orders 10 00:00:40,440 --> 00:00:41,670 under this order section. 11 00:00:42,210 --> 00:00:49,620 So under this order section we have, we don't have a form or anything because there will be no form. 12 00:00:50,220 --> 00:00:52,710 There will be in a set, there will be a script. 13 00:00:52,710 --> 00:00:54,930 I'm going to create a script that's going to get all of the orders. 14 00:00:55,470 --> 00:01:04,770 So to do this here in this account at the beginning here, let me close this so that our code becomes 15 00:01:04,770 --> 00:01:06,750 a little shorter here. 16 00:01:07,410 --> 00:01:08,610 So we have all of this code. 17 00:01:08,610 --> 00:01:14,520 Let me close all of these and here I'm going to add a comment and then I'm going to say get orders. 18 00:01:15,300 --> 00:01:23,490 So to get the orders first we need to say F and then we need to get all of the orders and to get all 19 00:01:23,490 --> 00:01:26,220 of the orders, we need to make sure that the user is logged in. 20 00:01:26,220 --> 00:01:27,570 So I'm going to say a session. 21 00:01:32,260 --> 00:01:33,430 Is set. 22 00:01:35,040 --> 00:01:36,300 If a user is logged in. 23 00:01:38,610 --> 00:01:39,630 Then what we need to do. 24 00:01:42,290 --> 00:01:44,630 Logged in. 25 00:01:49,390 --> 00:01:53,020 What we need to do is that we need to get all of the orders and to get all of the orders. 26 00:01:53,680 --> 00:02:01,960 We can use the code that we already have, which if you open the server and then get get order or get 27 00:02:01,960 --> 00:02:08,370 codes, for example, you can copy this code and then paste it here inside this statement. 28 00:02:09,580 --> 00:02:14,410 But we need to import the server so we are the importer, the connection server connection. 29 00:02:15,010 --> 00:02:22,450 So here, instead of saying, instead of saying prepare, select all from products, we need to say 30 00:02:23,350 --> 00:02:33,480 select all, select all from orders orders we're user ID, user underscore ID. 31 00:02:33,760 --> 00:02:35,680 Let me show you that in the database. 32 00:02:36,550 --> 00:02:45,970 In the order we can get the order by bye bye up by knowing the user ID. 33 00:02:46,270 --> 00:02:50,800 So we need to know the user ID so that we get only orders that belong to that specific user. 34 00:02:51,400 --> 00:02:53,830 So here I'm going to say where user ID is equal to. 35 00:02:55,040 --> 00:02:56,390 And then question mark. 36 00:02:58,340 --> 00:02:58,940 That's it. 37 00:02:59,840 --> 00:03:06,680 And then what I'm going to do is that I'm going to say is the empty bind. 38 00:03:09,660 --> 00:03:11,930 Bind param. 39 00:03:12,810 --> 00:03:14,760 Then we need to bind the user ID. 40 00:03:16,730 --> 00:03:20,180 So to get the user ID, we need to use a session. 41 00:03:21,480 --> 00:03:23,580 User underscore ID session. 42 00:03:26,200 --> 00:03:26,770 Session. 43 00:03:26,770 --> 00:03:27,400 User 80. 44 00:03:28,860 --> 00:03:30,290 User the score 80. 45 00:03:32,550 --> 00:03:41,550 And here we need to pass the user I.D., user I.D. and here execute and then get our results and then 46 00:03:41,550 --> 00:03:43,080 get here. 47 00:03:43,080 --> 00:03:43,950 I'm going to say orders. 48 00:03:44,250 --> 00:03:45,060 This is going to be order. 49 00:03:45,060 --> 00:03:51,210 So orders are going to be equal to a statement, get result, very, very simple. 50 00:03:51,870 --> 00:03:55,140 And then we need to loop over all all of the orders. 51 00:03:55,620 --> 00:04:03,720 So the orders will contain the order ID the order cost the order status, which is very important. 52 00:04:04,320 --> 00:04:10,050 The user for number, the city, the user address, these these things are not important. 53 00:04:10,050 --> 00:04:17,880 These things are for us because we as the the owner of the website, we need to order their business, 54 00:04:17,880 --> 00:04:19,320 the owners of the business business. 55 00:04:19,320 --> 00:04:23,940 We need to know the user address of the user city and the user phone number in order to contact the 56 00:04:23,940 --> 00:04:24,330 user. 57 00:04:24,750 --> 00:04:31,020 But for the user, we just need to display reference to the user such as the order ID, the order cost 58 00:04:31,020 --> 00:04:34,680 and the status and the and and the date as well. 59 00:04:34,680 --> 00:04:36,480 So let's display these things. 60 00:04:37,470 --> 00:04:41,790 I'm going to display the order ID cost status and date. 61 00:04:42,630 --> 00:04:45,060 So here remember we have. 62 00:04:48,530 --> 00:04:49,970 We have here order. 63 00:04:50,060 --> 00:04:51,250 We have product date. 64 00:04:51,260 --> 00:04:53,920 We only have the product and date and they don't want that. 65 00:04:53,930 --> 00:05:02,660 Instead I'm going to say order item and I'm going to create another column and that is going to be for 66 00:05:02,660 --> 00:05:04,520 the order cost. 67 00:05:08,510 --> 00:05:09,020 Cost. 68 00:05:10,030 --> 00:05:10,690 And then. 69 00:05:13,770 --> 00:05:15,480 The hatch, the edge. 70 00:05:15,480 --> 00:05:18,110 And then what else? 71 00:05:18,120 --> 00:05:18,720 Order. 72 00:05:20,330 --> 00:05:23,210 Order course or order status, which is very important. 73 00:05:23,960 --> 00:05:25,280 Order status. 74 00:05:26,060 --> 00:05:27,620 And then date ordered it. 75 00:05:29,840 --> 00:05:31,940 And we need to hear to get a look. 76 00:05:32,060 --> 00:05:35,180 So here I'm going to take it. 77 00:05:35,570 --> 00:05:41,570 Instead of displaying this static code, I'm going to remove this card or coming this card out. 78 00:05:42,290 --> 00:05:43,940 And instead I'm going to create a loop here. 79 00:05:43,950 --> 00:05:45,170 I'm going to say BHP. 80 00:05:49,380 --> 00:05:52,110 And here I'm going to say while. 81 00:05:54,470 --> 00:06:01,430 While then clearly bracket only up in the early bracket and then orders. 82 00:06:03,540 --> 00:06:04,200 And then. 83 00:06:06,070 --> 00:06:06,760 Fetch. 84 00:06:08,610 --> 00:06:09,840 Fetch a sauce. 85 00:06:10,820 --> 00:06:16,010 And then I'm going to say here, raw is equal to orders. 86 00:06:16,020 --> 00:06:19,610 Fetch a sauce and then in between, I'm going to display this. 87 00:06:19,850 --> 00:06:22,150 I'm going to now uncomment this. 88 00:06:22,520 --> 00:06:23,740 Lamy, uncomment this. 89 00:06:24,650 --> 00:06:26,510 Lamy, uncomment this. 90 00:06:31,180 --> 00:06:32,470 And I'm going to push it as well. 91 00:06:32,470 --> 00:06:33,220 Let me push it. 92 00:06:34,830 --> 00:06:36,870 And by law, we need to close the. 93 00:06:38,060 --> 00:06:40,970 Here was the Hurley bracket here. 94 00:06:40,970 --> 00:06:44,990 I'm going to say HP and then I'm going to close the Haley bucket. 95 00:06:46,100 --> 00:06:51,500 And in between I'm going to here say instead of the image, I'm going to we don't need this image. 96 00:06:51,500 --> 00:06:52,850 I'm going to call this image out. 97 00:06:53,780 --> 00:06:57,470 And instead of going to display the order here, I'm going to display the order. 98 00:06:57,470 --> 00:07:03,260 I'm going to say order ID, which is going to be beach P. 99 00:07:05,030 --> 00:07:05,660 BHP. 100 00:07:06,650 --> 00:07:08,960 Ra echo ra. 101 00:07:11,830 --> 00:07:12,550 Order, I. 102 00:07:15,350 --> 00:07:16,550 Order underscore 80. 103 00:07:18,350 --> 00:07:19,970 So this is for the city. 104 00:07:19,970 --> 00:07:21,140 The for the city. 105 00:07:21,740 --> 00:07:23,060 And then we want. 106 00:07:24,360 --> 00:07:27,440 We want to go yet another to here, Dee Dee. 107 00:07:28,470 --> 00:07:30,930 And then this CD is going to be for the. 108 00:07:32,150 --> 00:07:34,970 Uh, order it for the Oracle. 109 00:07:35,210 --> 00:07:36,930 So this CD is going to be for the order? 110 00:07:36,930 --> 00:07:38,240 Of course I'm going to say Span. 111 00:07:39,980 --> 00:07:42,650 And then BHP. 112 00:07:48,710 --> 00:07:49,550 And then echo. 113 00:07:51,880 --> 00:07:53,620 And then raw. 114 00:08:01,460 --> 00:08:02,120 Order cost. 115 00:08:05,560 --> 00:08:07,390 I mean, the status of it already. 116 00:08:08,020 --> 00:08:10,540 So I'm going to copy this and then I'm going to pay. 117 00:08:10,630 --> 00:08:13,720 It'll be law and then I'm going to say Order status. 118 00:08:16,680 --> 00:08:18,960 And finally order date instead of this. 119 00:08:21,020 --> 00:08:22,880 I'm going to say order date. 120 00:08:27,050 --> 00:08:29,630 Laney save and let's say then over to the browser to test. 121 00:08:30,780 --> 00:08:34,620 So now let me refresh here and I should get all of the I should get all of the orders. 122 00:08:34,620 --> 00:08:36,630 And as you can see, I will not get any orders. 123 00:08:37,590 --> 00:08:41,160 And as you can see, I will not get any orders because I didn't make any orders. 124 00:08:41,640 --> 00:08:48,160 But let me change intentionally change my user I.D.. 125 00:08:49,300 --> 00:08:57,070 Two one because I need you to number one has made all of these IDs and I have a user I.D. of one of 126 00:08:57,070 --> 00:08:57,360 eight. 127 00:08:57,370 --> 00:09:00,880 So I'm going to say one, I'm going to change my ID here like this. 128 00:09:01,570 --> 00:09:08,650 Of course, you should be doing this in a real system because otherwise you will ruin your system. 129 00:09:10,000 --> 00:09:16,300 And by the way, I need to log out because, uh, the ID, the ID restored in this session. 130 00:09:16,300 --> 00:09:19,090 So I'm going to log out and then I'm going to log in one more time. 131 00:09:20,110 --> 00:09:21,610 I'm going to log in and. 132 00:09:28,840 --> 00:09:29,140 Now. 133 00:09:29,140 --> 00:09:30,270 I should get all of the orders. 134 00:09:30,520 --> 00:09:32,940 As you can see, I'm going to get all of these orders. 135 00:09:32,950 --> 00:09:35,230 I'm going to guess the order number. 136 00:09:35,230 --> 00:09:38,860 Six, seven, eight, five, six, seven, eight. 137 00:09:39,220 --> 00:09:40,170 And they belong to me. 138 00:09:40,180 --> 00:09:42,310 The reason why I got these, because they belong to me. 139 00:09:42,820 --> 00:09:44,950 And they'll let me fix the table a little. 140 00:09:44,950 --> 00:09:47,770 To fix the table, we just need to remove this glass. 141 00:09:47,770 --> 00:09:49,090 Let me remove this glass. 142 00:09:51,140 --> 00:09:53,330 And let me refresh. 143 00:09:54,730 --> 00:09:59,830 And it didn't fix it because I think we don't need all of this. 144 00:10:00,550 --> 00:10:03,840 We actually don't need all of this. 145 00:10:03,850 --> 00:10:06,220 I'm going to comment this out or delete this completely. 146 00:10:06,910 --> 00:10:12,430 And instead I'm going to be using a spam just like like the other. 147 00:10:15,240 --> 00:10:16,170 Like the other. 148 00:10:16,860 --> 00:10:17,280 Across. 149 00:10:18,030 --> 00:10:21,030 So here I'm going to use a Spanish that I'm going to say here Spanish. 150 00:10:21,690 --> 00:10:26,490 And then I'm going to say Order I.D. and here, order it. 151 00:10:26,790 --> 00:10:28,290 So it should work now. 152 00:10:30,600 --> 00:10:31,650 So it's now better. 153 00:10:31,650 --> 00:10:32,460 Now it's better. 154 00:10:32,460 --> 00:10:35,340 And we just need to, uh. 155 00:10:36,240 --> 00:10:40,470 Uh, let me head on over to the order. 156 00:10:40,470 --> 00:10:43,080 So, MVC, MVC case, let me quickly fix this. 157 00:10:44,380 --> 00:10:47,290 So in the style and the orders. 158 00:10:59,010 --> 00:10:59,760 We have here. 159 00:10:59,760 --> 00:11:02,510 The orders are the action. 160 00:11:03,000 --> 00:11:04,770 The child is on the right side. 161 00:11:04,770 --> 00:11:06,090 So we need to comment this out. 162 00:11:07,320 --> 00:11:09,110 And we need to. 163 00:11:10,120 --> 00:11:11,920 I think this is perfect. 164 00:11:14,130 --> 00:11:15,360 So this is perfectly me. 165 00:11:15,370 --> 00:11:18,240 Try to refresh and test. 166 00:11:19,480 --> 00:11:20,580 So this should fix it. 167 00:11:20,600 --> 00:11:21,910 As you can see, it has been fixed. 168 00:11:23,320 --> 00:11:25,390 The order date, I think the order date. 169 00:11:26,660 --> 00:11:30,200 Is here the order. 170 00:11:31,880 --> 00:11:33,600 Here takes a line left. 171 00:11:33,620 --> 00:11:34,790 We need to comment this out. 172 00:11:34,820 --> 00:11:37,940 Just comment this out, and they should fix it. 173 00:11:40,270 --> 00:11:41,620 So as you can see, it has been fixed. 174 00:11:41,620 --> 00:11:44,380 So now we have all the orders and all of it is on the right side. 175 00:11:45,190 --> 00:11:50,650 And lastly, I'm going to display a button to take the user to a new page to display information about 176 00:11:50,650 --> 00:11:51,220 each order. 177 00:11:51,760 --> 00:11:53,020 Therefore, in the. 178 00:11:54,160 --> 00:11:55,450 In the. 179 00:11:57,000 --> 00:12:02,420 Uh, in the account here, what I'm going to do is that I'm going to add a new to each year. 180 00:12:02,430 --> 00:12:03,420 I'm going to say the edge. 181 00:12:04,230 --> 00:12:05,230 And then I'm going to say. 182 00:12:06,380 --> 00:12:08,840 Order and full order details. 183 00:12:10,680 --> 00:12:12,720 And then I'm going to hear. 184 00:12:14,310 --> 00:12:16,080 Creative TV, I'm going to say TV. 185 00:12:17,340 --> 00:12:23,190 And then here we just need to create a. 186 00:12:26,870 --> 00:12:32,000 A for leaving the forum then obviously input. 187 00:12:33,040 --> 00:12:36,040 And then I'm going to say a class. 188 00:12:37,420 --> 00:12:38,080 Button. 189 00:12:38,410 --> 00:12:41,620 B The end button and types of mat. 190 00:12:44,170 --> 00:12:49,830 And value is details. 191 00:12:53,320 --> 00:12:59,230 Let me refresh and we should have your order detail so we can see all the details and it's clickable 192 00:12:59,260 --> 00:13:08,200 so you can add the order details and let's use the the order. 193 00:13:10,190 --> 00:13:11,570 One of the classes that we had. 194 00:13:11,570 --> 00:13:14,660 So we can see at the end. 195 00:13:15,560 --> 00:13:17,270 And then I have, I think you. 196 00:13:18,490 --> 00:13:24,460 We have the class, this class, but they don't want to use any other class that couldn't do in our 197 00:13:24,460 --> 00:13:24,820 design. 198 00:13:24,820 --> 00:13:26,310 So we can't do it quickly. 199 00:13:28,420 --> 00:13:31,750 In these cases, we can create a class. 200 00:13:32,950 --> 00:13:33,730 Here in the orders. 201 00:13:33,730 --> 00:13:35,980 I've been asking about orders. 202 00:13:38,440 --> 00:13:39,130 Orders. 203 00:13:40,370 --> 00:13:43,190 And in the orders this. 204 00:13:44,710 --> 00:13:46,570 Uh, this order. 205 00:13:47,440 --> 00:13:53,890 So in this order, what I'm going to do is that I'm going to say, uh, details. 206 00:13:54,970 --> 00:13:57,610 That order. 207 00:14:00,810 --> 00:14:01,860 Details. 208 00:14:03,300 --> 00:14:05,880 But in the colour. 209 00:14:08,450 --> 00:14:09,410 Is it going to be white? 210 00:14:15,040 --> 00:14:16,180 And the background color. 211 00:14:18,610 --> 00:14:19,710 Is it going to be orange? 212 00:14:23,070 --> 00:14:25,800 So now it should now display an awesome button. 213 00:14:27,350 --> 00:14:30,040 Uh, by the way, I forgot to add here the button. 214 00:14:30,050 --> 00:14:30,650 I'm going to say. 215 00:14:31,520 --> 00:14:32,690 Order, order. 216 00:14:33,710 --> 00:14:34,560 Details about it. 217 00:14:34,700 --> 00:14:35,560 Details. 218 00:14:36,620 --> 00:14:37,010 Button. 219 00:14:38,540 --> 00:14:39,380 Order, hyphen. 220 00:14:39,380 --> 00:14:39,890 Details. 221 00:14:39,890 --> 00:14:40,670 Hyphen, body. 222 00:14:41,740 --> 00:14:43,270 Let me now refresh one more time. 223 00:14:44,850 --> 00:14:46,590 And as you can see, we will have these parents.