1 00:00:00,670 --> 00:00:01,300 Welcome back. 2 00:00:01,660 --> 00:00:05,080 So now what I'm going to do is that I'm going to work on the side menu. 3 00:00:05,080 --> 00:00:08,170 So let me log in first and show you this side. 4 00:00:09,220 --> 00:00:14,200 So in the side menu, we have all of these things and we need to display the dashboard. 5 00:00:14,590 --> 00:00:17,530 And the main thing that I'm going to be displaying in the dashboard is the orders. 6 00:00:18,070 --> 00:00:21,760 I'm going to be displaying the orders of the products, and then I can do these things. 7 00:00:22,180 --> 00:00:24,340 So the side menu here, we have side menu. 8 00:00:24,820 --> 00:00:28,850 I'm going to first display the dashboard and then I'm going to give it a trip. 9 00:00:28,870 --> 00:00:37,570 The trip is just going to be index that HP and the orders as well is going to be the orders is going 10 00:00:37,570 --> 00:00:41,200 to be in the index index. 11 00:00:41,200 --> 00:00:47,300 That is because the orders will be displayed in the index and then we have the products. 12 00:00:47,320 --> 00:00:49,530 I'm going to say here products. 13 00:00:50,930 --> 00:00:51,740 Dot BHP. 14 00:00:53,350 --> 00:00:55,600 And then here I don't need this customers. 15 00:00:55,600 --> 00:01:02,440 I'm going to this and I need a to display just beneath the email of the admin. 16 00:01:03,040 --> 00:01:07,240 And then we need also to display Laney here instead of displaying customers. 17 00:01:07,240 --> 00:01:10,180 I'm going to say add you. 18 00:01:11,650 --> 00:01:11,920 Right. 19 00:01:14,640 --> 00:01:18,750 So I'm going to add I'm going to add this add new product below the account. 20 00:01:20,710 --> 00:01:26,500 So first account and then add new product and then let's add it up. 21 00:01:26,500 --> 00:01:27,490 We need to get the orders. 22 00:01:27,940 --> 00:01:29,230 So at the top of this. 23 00:01:31,770 --> 00:01:38,550 Actually here, we need to say before I go to this lady here at the links, I'm going to say here, 24 00:01:38,550 --> 00:01:44,610 add, add, underscore you underscore project that HP. 25 00:01:45,920 --> 00:01:47,240 And I'm going to say account. 26 00:01:48,840 --> 00:01:49,250 That. 27 00:01:52,270 --> 00:01:53,560 And that's it. 28 00:01:53,590 --> 00:01:58,570 Now, let me go to the index and let's work on the orders. 29 00:01:59,230 --> 00:02:02,500 The good news about the orders is that we already know how to get the orders. 30 00:02:02,560 --> 00:02:13,480 Remember, if you go back to the to your to the account, you remember in the account, which is this, 31 00:02:13,990 --> 00:02:17,200 you will find that we already have a code that gets us three orders. 32 00:02:17,920 --> 00:02:19,290 I think it's here. 33 00:02:19,660 --> 00:02:20,140 It's here. 34 00:02:20,140 --> 00:02:22,500 Get orders so we can't copy this code. 35 00:02:22,540 --> 00:02:23,590 I'm going to copy this code. 36 00:02:25,840 --> 00:02:26,590 I'm going to copy this. 37 00:02:26,590 --> 00:02:26,920 Good. 38 00:02:27,400 --> 00:02:29,200 And then I'm going to base it here in the index. 39 00:02:30,940 --> 00:02:35,800 However, we don't need to use year if statement. 40 00:02:35,830 --> 00:02:40,180 We just need to get the orders as soon as the user, as soon as admin enters this page. 41 00:02:40,900 --> 00:02:44,790 So I'm going to I'm going to remove this statement and then I'm going to say. 42 00:02:45,880 --> 00:02:46,340 Um. 43 00:02:46,690 --> 00:02:48,810 I'm not going to say user I.D.. 44 00:02:49,810 --> 00:02:57,610 Instead, I'm just going to say statement, connection, repair, select all from orders where we orders 45 00:02:57,610 --> 00:03:03,700 waiters know where here I'm going to remove it and we just need to remove that as well. 46 00:03:03,700 --> 00:03:05,710 So because we're just going to be three lines. 47 00:03:06,250 --> 00:03:08,380 However, the problem with this is that. 48 00:03:09,730 --> 00:03:11,020 We have two problems, actually. 49 00:03:11,350 --> 00:03:16,570 The first problem is that in the heather we need to include the connection to the database. 50 00:03:16,910 --> 00:03:17,340 Heather. 51 00:03:17,920 --> 00:03:20,170 We need to make sure that we are connected to the database. 52 00:03:20,590 --> 00:03:22,150 So here in the heather, we need to say. 53 00:03:24,660 --> 00:03:30,690 We need to say each big event included, and then we need to go back. 54 00:03:32,510 --> 00:03:37,640 And then we need to say a server or slash connection. 55 00:03:38,510 --> 00:03:39,260 Not HBO. 56 00:03:39,830 --> 00:03:42,380 So this is the first problem, and I just solved this problem. 57 00:03:42,890 --> 00:03:46,340 The second problem is that we need to add pagination. 58 00:03:46,970 --> 00:03:50,450 Because here, imagine that you have so many orders. 59 00:03:50,450 --> 00:03:51,250 It's not going to work. 60 00:03:51,260 --> 00:03:52,190 It's going to be a problem. 61 00:03:52,690 --> 00:03:58,640 Unfortunately, we already have the pagination in the shop page, so I'm going to get the pagination 62 00:03:58,640 --> 00:03:59,720 quote from the shop page. 63 00:04:00,470 --> 00:04:03,080 So here in this shop page at the top. 64 00:04:04,090 --> 00:04:07,360 Remember at the top, we have this, we have this. 65 00:04:07,510 --> 00:04:08,710 We just need this code. 66 00:04:09,220 --> 00:04:10,050 I'm going to copy this. 67 00:04:10,060 --> 00:04:10,250 Good. 68 00:04:12,420 --> 00:04:13,350 We just need this. 69 00:04:13,350 --> 00:04:13,710 Good. 70 00:04:16,960 --> 00:04:19,390 And then what I'm going to do is that I'm going to paste it in the. 71 00:04:20,880 --> 00:04:22,320 In the index that BHP. 72 00:04:24,870 --> 00:04:30,140 Here in this instead of saying instead of using all of this code, this code is fine. 73 00:04:30,150 --> 00:04:35,460 But the problem with it is that if you have so many orders, it is going to be a problem. 74 00:04:36,000 --> 00:04:38,970 So we need to remove this code and then we need to use the pagination. 75 00:04:39,630 --> 00:04:42,990 So here we need to fix of course, we need to fix many things. 76 00:04:42,990 --> 00:04:44,700 First of all, I'm going to push the code because. 77 00:04:46,080 --> 00:04:49,980 Because now I cannot read it perfectly. 78 00:04:49,980 --> 00:04:51,750 Let me now read the quotes from the beginning. 79 00:04:52,380 --> 00:04:55,680 So here the first thing that we need to do is that we need to use page number. 80 00:04:55,710 --> 00:04:56,760 Everything's fine here. 81 00:04:57,720 --> 00:05:06,900 However, we need to say select count all as total records from orders from orders and then execute 82 00:05:06,900 --> 00:05:08,340 and then total records. 83 00:05:08,970 --> 00:05:11,440 And then total records is equal. 84 00:05:11,460 --> 00:05:13,680 You can say eight, nine, ten, whatever you want. 85 00:05:13,680 --> 00:05:18,460 Let's say ten your offset and then page number. 86 00:05:18,480 --> 00:05:19,560 Everything's fine here. 87 00:05:20,160 --> 00:05:30,870 Then we need to say here, select, prepare, select all from products limit, offset records page. 88 00:05:30,870 --> 00:05:33,840 Here we should say select all from orders. 89 00:05:34,650 --> 00:05:36,420 And we should remove this clearly bracket. 90 00:05:37,110 --> 00:05:39,510 And at the bottom, we need to add the pagination. 91 00:05:39,510 --> 00:05:42,090 So at the bottom, I'm going to give it pagination from the shop. 92 00:05:43,790 --> 00:05:44,360 From the shop. 93 00:05:44,360 --> 00:05:45,890 Here we have this pagination code. 94 00:05:46,960 --> 00:05:47,880 We have this. 95 00:05:48,400 --> 00:05:49,840 We have this navigation bar. 96 00:05:50,620 --> 00:05:53,350 Let me copy it and let me put it in the index here. 97 00:05:54,520 --> 00:05:55,810 We need to paste it here. 98 00:05:58,370 --> 00:05:59,000 We need. 99 00:06:01,010 --> 00:06:04,400 Let me first make sure that I'm going to base it in the right place. 100 00:06:05,060 --> 00:06:06,830 So this Dave belongs. 101 00:06:08,670 --> 00:06:09,570 Too. 102 00:06:09,570 --> 00:06:15,280 I think this they've they make they have and this is this case. 103 00:06:15,280 --> 00:06:15,630 Yes, there are. 104 00:06:15,630 --> 00:06:18,240 So we need to I think we need to get inside the rock. 105 00:06:18,750 --> 00:06:22,090 So we need to add because inside this step. 106 00:06:24,040 --> 00:06:24,940 So here it should. 107 00:06:24,940 --> 00:06:25,930 I think it should be here. 108 00:06:25,930 --> 00:06:27,190 Let me test me out here. 109 00:06:28,690 --> 00:06:32,260 I'm going to say here, B, and then I'm going to say test. 110 00:06:33,040 --> 00:06:35,260 So it should be displayed below the table. 111 00:06:36,310 --> 00:06:38,160 Now it's being displayed here. 112 00:06:38,170 --> 00:06:42,130 So we need to add everything inside below the table. 113 00:06:42,130 --> 00:06:45,940 So it should be here, I should say here for the event test. 114 00:06:49,570 --> 00:06:50,710 So it's below the table. 115 00:06:50,720 --> 00:06:53,200 So here I'm going to place the code. 116 00:06:57,480 --> 00:06:57,630 Here. 117 00:06:57,750 --> 00:06:58,920 I'm going to stick with Leni here. 118 00:06:58,920 --> 00:07:01,680 Remove this test and let me give myself a big space. 119 00:07:02,580 --> 00:07:04,950 I'm going to give myself a big space so that you see. 120 00:07:06,420 --> 00:07:08,790 And then I'm going to basically because he's going to be here. 121 00:07:09,480 --> 00:07:12,960 Let me save a lady here, then over to the browser and refresh. 122 00:07:13,650 --> 00:07:15,390 And as you can see, we have this pagination. 123 00:07:16,290 --> 00:07:19,710 Now we need to loop over the orders. 124 00:07:20,250 --> 00:07:27,330 So in order to loop over the orders, we have to remove all of these records from the table and leave 125 00:07:27,330 --> 00:07:27,960 only one. 126 00:07:28,560 --> 00:07:31,140 So let's start removing from the top. 127 00:07:31,920 --> 00:07:33,030 So from the top. 128 00:07:33,390 --> 00:07:34,110 From the top. 129 00:07:34,110 --> 00:07:42,060 We have we have here ID, we have we have an area and then we need the order ID, the order status, 130 00:07:42,870 --> 00:07:43,800 order status. 131 00:07:43,800 --> 00:07:45,690 And then we need the order date. 132 00:07:46,260 --> 00:07:49,350 We need the order, order, status, order date. 133 00:07:50,330 --> 00:07:51,110 Order date. 134 00:07:52,430 --> 00:07:53,270 Order date. 135 00:07:57,500 --> 00:07:58,430 And read the user. 136 00:07:58,450 --> 00:08:00,080 Let's display first the user. 137 00:08:00,080 --> 00:08:06,100 I'm going to say user or customer I.D., user ID, user ID. 138 00:08:07,130 --> 00:08:13,640 And first, the order I.D. and then the order status and then the order. 139 00:08:14,870 --> 00:08:15,360 I think. 140 00:08:18,400 --> 00:08:20,200 And then we need to say here edit. 141 00:08:22,520 --> 00:08:24,260 And then we need to say also delete. 142 00:08:37,750 --> 00:08:39,640 But we also need the order. 143 00:08:40,210 --> 00:08:44,830 We also need the actually read, also the user phone number. 144 00:08:47,160 --> 00:08:48,360 I'm going to say use our foreign. 145 00:08:50,010 --> 00:08:50,910 He was a reform. 146 00:08:53,280 --> 00:09:01,380 And we can display the user city, for example, or user address. 147 00:09:01,620 --> 00:09:03,900 User Outers, user address. 148 00:09:10,410 --> 00:09:11,550 So that is. 149 00:09:11,550 --> 00:09:11,990 That's it. 150 00:09:12,190 --> 00:09:17,350 Me letting me remove these figures from the table and I'm going to leave only once. 151 00:09:17,350 --> 00:09:21,090 So I'm going to leave this and then I'm going to remove this and this. 152 00:09:21,090 --> 00:09:21,870 All of these. 153 00:09:21,870 --> 00:09:23,250 I'm going to remove all of these. 154 00:09:32,190 --> 00:09:34,490 You need to be very careful while already moving. 155 00:09:34,500 --> 00:09:35,940 So let me keep only one. 156 00:09:36,330 --> 00:09:37,770 Now we have only one lady saved. 157 00:09:37,770 --> 00:09:40,140 And let me make sure that we don't have problems. 158 00:09:40,710 --> 00:09:41,580 Let me refresh. 159 00:09:41,580 --> 00:09:45,900 And as you can see, we have only one drawer and let's work on this. 160 00:09:46,380 --> 00:09:53,400 So here I'm going to add each because I'm going to keep up and then I'm going to say for each. 161 00:09:55,030 --> 00:09:55,870 And then for each. 162 00:09:55,870 --> 00:09:56,230 What? 163 00:09:56,860 --> 00:09:57,850 For each? 164 00:09:58,060 --> 00:09:59,860 We have the orders. 165 00:09:59,860 --> 00:10:02,530 I think here we should say orders. 166 00:10:03,070 --> 00:10:03,580 Orders. 167 00:10:04,720 --> 00:10:07,530 So for each orders as order, I'm going to say. 168 00:10:10,890 --> 00:10:12,780 Order as. 169 00:10:13,890 --> 00:10:16,320 Orders are orders as order. 170 00:10:16,980 --> 00:10:19,020 Orders as order. 171 00:10:19,740 --> 00:10:20,790 And then at the bottom. 172 00:10:22,570 --> 00:10:31,090 We need to say BHP and then close this yearly bracket and in between we need to display first we order 173 00:10:31,090 --> 00:10:34,750 80 BHP and then order. 174 00:10:36,890 --> 00:10:37,900 Order I.D.. 175 00:10:41,040 --> 00:10:42,330 And don't forget to say Echo. 176 00:10:44,720 --> 00:10:46,110 Don't forget to say Echo. 177 00:10:46,610 --> 00:10:50,150 And then instead of doing this many times, I'm going to copy it. 178 00:10:50,150 --> 00:10:51,140 So I'm going to copy this. 179 00:10:51,650 --> 00:10:55,990 And then the second the second draw was for the starter. 180 00:10:56,000 --> 00:10:58,070 So I'm going to say here, order. 181 00:11:00,930 --> 00:11:03,450 And then the third is going to be for the user it. 182 00:11:06,070 --> 00:11:18,340 User I.D. and then the order the order date and then the user form, user form. 183 00:11:19,820 --> 00:11:29,890 And next we have the user form and user address and edit and delete. 184 00:11:30,990 --> 00:11:33,090 So I use a phone and then address user. 185 00:11:35,560 --> 00:11:36,250 Address. 186 00:11:37,310 --> 00:11:42,320 And then your user address and then edit. 187 00:11:43,130 --> 00:11:44,420 So of course edit and delete. 188 00:11:44,420 --> 00:11:48,320 We shouldn't be displaying BGP, we should display buttons. 189 00:11:48,980 --> 00:11:54,860 So I'm going to hear about an attack and then I'm going to say edit. 190 00:11:56,570 --> 00:11:58,490 And then I'm going to say. 191 00:12:00,290 --> 00:12:02,950 Edit I'm going to say it. 192 00:12:03,560 --> 00:12:04,820 Class button. 193 00:12:06,510 --> 00:12:09,060 Beatty and Primary. 194 00:12:10,650 --> 00:12:12,000 And therefore the delete. 195 00:12:13,970 --> 00:12:19,280 I'm going to also create a delete button and I say a attack and then class button. 196 00:12:20,610 --> 00:12:21,450 Beaton. 197 00:12:22,380 --> 00:12:24,090 And meaty end. 198 00:12:24,780 --> 00:12:25,650 Meaty end. 199 00:12:27,280 --> 00:12:29,260 Between danger. 200 00:12:31,410 --> 00:12:32,700 And then I'm going to say delete. 201 00:12:36,270 --> 00:12:38,070 Let me save a linear refresh now. 202 00:12:39,210 --> 00:12:40,650 It's going to look amazing, as you can see. 203 00:12:40,650 --> 00:12:42,030 Now, I'm going to get all orders. 204 00:12:42,040 --> 00:12:44,030 So these are all of the orders that they have. 205 00:12:44,430 --> 00:12:48,990 And I'm going to get only as you can see, I'm going to get one, two, three, four, five, six, 206 00:12:48,990 --> 00:12:50,580 seven, eight, nine, ten. 207 00:12:51,120 --> 00:12:53,750 If I click on two, I'm going to get the rest. 208 00:12:53,760 --> 00:12:56,400 But since I only have ten, I think I have only ten. 209 00:12:56,940 --> 00:13:01,200 I'm going to get one, two, three, four, five, six, seven, eight, nine, ten. 210 00:13:01,980 --> 00:13:05,760 So this is the the the problem. 211 00:13:05,760 --> 00:13:10,110 ZELENY Decrease artists just to make sure that everything is working. 212 00:13:10,680 --> 00:13:13,380 Let me hear say five. 213 00:13:13,660 --> 00:13:15,660 Order five records per page. 214 00:13:16,080 --> 00:13:19,770 If I say five figures for page, I'm going to get only five here. 215 00:13:19,770 --> 00:13:22,530 And if I click on two, I'm going to get another five. 216 00:13:22,530 --> 00:13:24,780 So every pagination now works perfectly. 217 00:13:25,920 --> 00:13:27,750 And lastly, we need to say orders. 218 00:13:29,230 --> 00:13:30,610 So instead of saying. 219 00:13:32,130 --> 00:13:37,080 Instead of saying your section title, I'm going to say orders. 220 00:13:40,000 --> 00:13:41,740 And we are good to go.