1
00:00:01,000 --> 00:00:06,880
So now we want to create some code that will allow us to click on a reservation either from this screen,

2
00:00:06,880 --> 00:00:11,800
new reservations or from this screen all reservations and display it.

3
00:00:11,950 --> 00:00:14,590
And I'm going to display it in a form.

4
00:00:14,590 --> 00:00:17,200
So if I want to make changes to it, I can.

5
00:00:17,590 --> 00:00:23,590
And I'm also going to at some point add the functionality to mark a reservation as processed, which

6
00:00:23,590 --> 00:00:28,440
means it will no longer show up on this screen because it will no longer be a new reservation.

7
00:00:29,140 --> 00:00:31,720
So to do that, I'm going to need obviously a handler.

8
00:00:31,900 --> 00:00:37,180
I'm going to need some method of pulling a single reservation out of the database, and I'm going to

9
00:00:37,180 --> 00:00:40,000
need to update the template and change my routes.

10
00:00:40,000 --> 00:00:40,860
So let's get started.

11
00:00:40,900 --> 00:00:43,290
We'll go creating a stub handler first.

12
00:00:43,690 --> 00:00:48,370
So let me go to my Edem and find my handlers here, there.

13
00:00:48,730 --> 00:00:51,730
And let's create a handler that shows one reservation.

14
00:00:52,420 --> 00:01:01,360
First of all, let me add a comment to this, because I didn't do that displays the reservation calendar,

15
00:01:01,360 --> 00:01:02,530
which we're going to get to eventually.

16
00:01:02,530 --> 00:01:09,880
But right now we want to have a handler which has the receiver of type pointer to repository and I'll

17
00:01:09,880 --> 00:01:17,980
call it admin show reservation and it will take a response writer.

18
00:01:23,340 --> 00:01:24,900
And a pointer to a request.

19
00:01:29,790 --> 00:01:34,650
OK, and we'll have it render a template, so I'll just copy this line just to make things a little

20
00:01:34,650 --> 00:01:40,590
faster and paste it in here and I'll call it admin reservation.

21
00:01:41,040 --> 00:01:49,830
It's show and then I'll copy this name and create that template in my templates folder.

22
00:01:53,260 --> 00:02:03,100
New file paste, because I didn't copy the name admin reservations showed up paged at Temple.

23
00:02:04,830 --> 00:02:11,550
And I'll add it to my repository and I will simply put in a copy, something from the dashboard, their

24
00:02:11,730 --> 00:02:20,700
copy this and paste it in here and put this as show reservation just as a placeholder to make sure it

25
00:02:20,700 --> 00:02:21,150
works.

26
00:02:22,590 --> 00:02:24,360
And I'll give the title reservation.

27
00:02:25,680 --> 00:02:26,180
All right.

28
00:02:26,190 --> 00:02:27,870
So we created that handler.

29
00:02:28,020 --> 00:02:29,450
Now let's go create our route.

30
00:02:29,460 --> 00:02:32,160
So we called the handler at Minshall Reservation.

31
00:02:32,190 --> 00:02:33,150
Let's give it a comment.

32
00:02:34,850 --> 00:02:40,400
Shows the registration reservation in the admin tool.

33
00:02:42,260 --> 00:02:48,590
OK, so let's copy the name and go to our roots and create a route for it.

34
00:02:49,430 --> 00:02:53,240
So again, this is going to be in the protected part of our application.

35
00:02:53,690 --> 00:02:55,610
And I'll put in Mark Start yet.

36
00:02:56,390 --> 00:03:02,960
And for a path name, I think I'll use reservations, reservations, because the admin part is added

37
00:03:02,960 --> 00:03:03,710
automatically.

38
00:03:05,360 --> 00:03:11,720
And then I'm going to have the source and remember that on our new reservations page, the link was

39
00:03:12,140 --> 00:03:22,700
admin reservations, knew the ID and on our all reservations page it all ID.

40
00:03:22,730 --> 00:03:26,300
So I need to have a route that actually has a placeholder in it.

41
00:03:26,330 --> 00:03:29,450
So one the first one will be all or new for now.

42
00:03:29,450 --> 00:03:34,420
So I'll call that SIRC for source where we're coming from and then I'll put ID.

43
00:03:34,760 --> 00:03:41,600
And again, because those are matching parameters or matching parts of our route, I enclose them in

44
00:03:41,600 --> 00:03:49,220
curly brackets and then I want to want to go to Handler's Repo dot admin show reservation.

45
00:03:49,220 --> 00:03:49,970
I think it was.

46
00:03:54,470 --> 00:03:56,040
Yeah, I'm in show reservation.

47
00:03:56,610 --> 00:04:00,100
OK, so we have our route set up, so let's try running this.

48
00:04:00,110 --> 00:04:06,500
So I'll stop my application, run my application just to make sure it works and go back to my mental

49
00:04:06,920 --> 00:04:10,250
reload the page and just click on one reservation.

50
00:04:10,520 --> 00:04:11,120
And there it is.

51
00:04:11,120 --> 00:04:12,190
It's showing the reservation.

52
00:04:12,200 --> 00:04:12,590
Great.

53
00:04:13,040 --> 00:04:16,160
So that's a good start, but it's obviously not enough.

54
00:04:16,160 --> 00:04:21,040
We need to grab information from the database in order to show it on this page.

55
00:04:21,050 --> 00:04:28,160
So right here in our handlers, when I'm showing the reservation, I need to get a reservation from

56
00:04:28,160 --> 00:04:28,820
the database.

57
00:04:30,440 --> 00:04:31,460
So how am I going to do that?

58
00:04:31,490 --> 00:04:36,920
Well, I'm going to open up my postcrisis postgrads, Dongo, and at the very bottom, I'll create a

59
00:04:36,920 --> 00:04:39,200
new function and I'll call it.

60
00:04:39,200 --> 00:04:47,300
Will has to have the receiver of Postgrads DB Repo and I'll call it, um, get one reservation.

61
00:04:47,300 --> 00:04:48,960
I think that's probably a good name.

62
00:04:49,790 --> 00:04:56,420
Now let's call it get reservation by ID, which is exactly what I'm doing here.

63
00:04:56,420 --> 00:05:02,300
And I need to have a parameter which is the ID of type INT and I'm going to return to things, a model

64
00:05:02,420 --> 00:05:05,450
DOT reservation and potentially an error.

65
00:05:06,720 --> 00:05:11,540
OK, so as I always do, I'm going to go copy the context from up here.

66
00:05:13,980 --> 00:05:19,650
I just don't like typing that out and paste it in, and then I'll create a variable which I'll call

67
00:05:19,650 --> 00:05:24,790
Rez of type models, dot reservation to hold the information I'm going to pull from the database.

68
00:05:25,920 --> 00:05:28,470
Now let's write the query and this is a simple select statement.

69
00:05:28,680 --> 00:05:37,440
Query is assigned the value of in back ticks select and because this is a reservation, it's going to

70
00:05:37,440 --> 00:05:41,010
have that room model as part of this struct.

71
00:05:41,220 --> 00:05:42,380
So I'll use an alias.

72
00:05:42,390 --> 00:05:47,850
Our ID Arnaut first name are being an alias to the reservations table.

73
00:05:48,210 --> 00:05:58,380
Our last name, Arnaut email, Arnaut phone Arde start date and I'll go on to the next line just to

74
00:05:58,380 --> 00:05:59,520
make this a little more readable.

75
00:06:00,000 --> 00:06:13,290
Are not end are not room id are not created at are not updated that are processed which is the column

76
00:06:13,290 --> 00:06:15,690
we added in the last lecture or recently anyway.

77
00:06:17,040 --> 00:06:23,940
And then R.M., I'm getting the room information, R.M. ID our room name and again I don't care about

78
00:06:23,940 --> 00:06:26,730
the created or updated at forums so I'll ignore those.

79
00:06:27,450 --> 00:06:36,840
And I'm selecting that from reservations with the alias of our and I'm going to left join rooms R.M.

80
00:06:37,830 --> 00:06:47,520
on our dot room ID equals R.M. ID, which uses that foreign key relationship to join these two tables

81
00:06:47,520 --> 00:06:48,000
together.

82
00:06:48,390 --> 00:06:49,710
And finally my Where clause.

83
00:06:49,710 --> 00:06:52,430
I want this only for one particular ID.

84
00:06:52,440 --> 00:06:57,900
So where are for the reservations table ID equals and my placeholder dollar sign one.

85
00:06:59,190 --> 00:07:00,330
So that should be my query.

86
00:07:00,340 --> 00:07:01,500
Let's make sure we've got it right.

87
00:07:01,920 --> 00:07:05,250
Select Arnaut ID our first name, our last name.

88
00:07:05,250 --> 00:07:12,290
Aadhar email are not from our start date, are not end date, are not remedy, are not created utada

89
00:07:12,360 --> 00:07:13,830
updated, ate and processed.

90
00:07:13,830 --> 00:07:16,590
That's all for the the reservations table.

91
00:07:16,740 --> 00:07:19,770
And then our amde id and our room name.

92
00:07:20,460 --> 00:07:21,600
Yeah that looks right to me.

93
00:07:22,140 --> 00:07:25,260
So this is one record we're getting at most one.

94
00:07:25,260 --> 00:07:30,120
If it finds one little return, one if it finds nothing, well there'll be nothing to stamp so we can

95
00:07:30,120 --> 00:07:41,760
use our query row context which returns one row DB query row context, handed the context handler query

96
00:07:42,030 --> 00:07:45,480
and handed the ID, which is substituted for that same one.

97
00:07:45,960 --> 00:07:51,060
So that's our database query and then we try to scan this into our res variable.

98
00:07:51,690 --> 00:08:00,450
So error is assigned the value of row dot scan and as I always do, I'll put this on separate line so

99
00:08:00,450 --> 00:08:04,260
it's easier to read and I'm going to scan it into the variable.

100
00:08:04,260 --> 00:08:06,900
And the first thing I'm getting from my query is the ID.

101
00:08:07,470 --> 00:08:10,440
Now duplicate that a bunch of times just to make it faster.

102
00:08:11,070 --> 00:08:21,960
The next thing is first name, then the last name, then email, then phone, then start date.

103
00:08:23,460 --> 00:08:24,360
Then end date.

104
00:08:26,460 --> 00:08:27,420
Then room ID.

105
00:08:29,840 --> 00:08:31,430
And a few more duplications.

106
00:08:35,700 --> 00:08:46,740
Then created that, then updated and then processed, and I think there's two more room ID and room

107
00:08:46,740 --> 00:08:56,640
name, so room ID and room dot room name and we check for our error.

108
00:08:57,930 --> 00:09:00,740
If error is not equal to nil, then something went wrong.

109
00:09:00,750 --> 00:09:06,270
Probably it couldn't find that ID and we'll just return our rez and the error.

110
00:09:06,480 --> 00:09:08,580
Otherwise everything worked as expected.

111
00:09:08,730 --> 00:09:15,210
So we'll return Rez and Nhill and that should be it.

112
00:09:15,270 --> 00:09:17,760
So let's copy this and give it a comment.

113
00:09:20,700 --> 00:09:22,950
Returns one reservation.

114
00:09:25,810 --> 00:09:34,630
By ID and then we'll copy the whole thing here and put it in our repository, so let's find a repository

115
00:09:36,670 --> 00:09:43,300
and paste that in and then again copy the whole thing and put it on our test repo and simplify it as

116
00:09:43,300 --> 00:09:44,250
much as possible.

117
00:09:45,790 --> 00:09:49,750
Test repo all the way down here, paste it in.

118
00:09:50,350 --> 00:09:58,120
We don't need any of this stuff and we don't need the context and it has to have the correct receiver.

119
00:09:59,770 --> 00:10:00,130
All right.

120
00:10:00,130 --> 00:10:01,390
Let's make sure this compiles.

121
00:10:05,220 --> 00:10:10,320
Good comp. No problem, so let's go back to our handler and grab this reservation.

122
00:10:10,350 --> 00:10:12,410
Now, how are we going to get this reservation?

123
00:10:12,450 --> 00:10:15,030
Remember, it's at the end of the URL.

124
00:10:16,200 --> 00:10:21,900
So there's actually two things I want to pull out of this show reservation on this reservation handler.

125
00:10:22,110 --> 00:10:25,800
And the two things are we'll go back here and have a look at our page.

126
00:10:26,310 --> 00:10:33,390
If we look at all reservations and you look at the world in the lower left hand corner of the screen,

127
00:10:33,690 --> 00:10:38,790
we want to get that all to know what page were coming from, because there's two ways of getting to

128
00:10:38,790 --> 00:10:40,320
the page we're working on right now.

129
00:10:40,320 --> 00:10:44,250
We can get here from new reservations or we can get here from all reservations.

130
00:10:44,430 --> 00:10:48,780
And we also need the ID in the form of an ENT so we can do our database query.

131
00:10:49,350 --> 00:10:49,700
All right.

132
00:10:49,710 --> 00:10:51,020
Well, none of that's too difficult.

133
00:10:51,660 --> 00:10:53,780
So let's have a look and see how we're going to do it.

134
00:10:54,210 --> 00:10:59,070
First of all, I'm going to grab the euro so right above this, because I'm not calling the database

135
00:10:59,070 --> 00:10:59,310
yet.

136
00:10:59,550 --> 00:11:03,570
I want to get the URL and I want to explode it, to split it.

137
00:11:03,570 --> 00:11:06,180
And what I'm going to split it on are the slashes.

138
00:11:06,360 --> 00:11:12,720
So I'll be able to find the individual parts of the user, you or I itself, for you or I or the URL,

139
00:11:12,720 --> 00:11:13,680
whatever you want to call it.

140
00:11:14,010 --> 00:11:20,040
So I'll create a variable called exploded and that's going to be equal to the value of from the strings

141
00:11:20,040 --> 00:11:20,670
package.

142
00:11:21,000 --> 00:11:25,020
The function split and split requires a few parameters.

143
00:11:25,020 --> 00:11:27,770
First of all, what is the string you want to split?

144
00:11:27,780 --> 00:11:33,790
What I can grab that from my request and it's our DOT request, you or I.

145
00:11:34,230 --> 00:11:39,110
So that gives me the UI and then I want to split it on the slash.

146
00:11:39,810 --> 00:11:43,200
So when this happens, see what the split returns.

147
00:11:43,500 --> 00:11:50,070
It returns a slice of strings and we know how to find things from from a particular position in a slice.

148
00:11:50,400 --> 00:11:52,680
The first position in a slice is zero.

149
00:11:52,680 --> 00:11:56,280
The second one is one, the third one is two and so on and so forth.

150
00:11:56,940 --> 00:11:58,890
So I've got my exploded variable.

151
00:11:58,890 --> 00:12:04,710
What I can do now is, first of all, grab the ID, ID and potentially an error is equal to the value

152
00:12:04,710 --> 00:12:14,430
of from the start convert package a two I were converting from alpha alphanumeric to or integer.

153
00:12:16,020 --> 00:12:25,590
And what I want to convert is from the exploded slice of strings at position four and its position four,

154
00:12:25,590 --> 00:12:31,620
because when I go back here and look at it, I'll inspect this so we can actually see it inspect the

155
00:12:31,620 --> 00:12:32,130
element.

156
00:12:32,940 --> 00:12:42,780
The actual you URL is zero for admin, one for reservations, two for all and three for split for slice.

157
00:12:42,780 --> 00:12:43,800
Here I am lying to you.

158
00:12:44,040 --> 00:12:47,940
We actually want it from one, two, three, position four.

159
00:12:47,940 --> 00:12:50,250
It's the fourth position in the slice.

160
00:12:50,250 --> 00:12:52,590
We're not counting from zero here at least apparently we're not.

161
00:12:53,070 --> 00:12:53,940
We're about to find out.

162
00:12:55,890 --> 00:12:58,680
Let's just try first of all, looking for there.

163
00:12:58,680 --> 00:13:07,080
If error is not equal to nil, then I will just go helper's dot server error with my response writer

164
00:13:07,080 --> 00:13:08,610
and the error and I'll return.

165
00:13:13,550 --> 00:13:20,660
Not equal to nil, otherwise, let's just print out the ID, log print line ID.

166
00:13:21,650 --> 00:13:27,680
OK, I'm going to stop my application and run because I'm not sure whether you count from slices that

167
00:13:27,680 --> 00:13:29,120
position zero or position one.

168
00:13:29,120 --> 00:13:29,860
And this will tell me.

169
00:13:30,410 --> 00:13:31,460
So I'm going to run this.

170
00:13:34,130 --> 00:13:39,740
Hit enter a few times just to get some blank spaces and then I'll click on one of these and see what

171
00:13:39,740 --> 00:13:44,990
happens, and it gave me five and that's exactly what it should be, because it's five up here in the

172
00:13:44,990 --> 00:13:45,360
URL.

173
00:13:45,410 --> 00:13:46,640
OK, so it's right.

174
00:13:46,640 --> 00:13:50,360
You don't count from position zero in slices, you count from position one, apparently.

175
00:13:51,560 --> 00:13:53,330
No, you know, I'm not I'm not wrong.

176
00:13:53,330 --> 00:13:54,620
Let me go back and look at this again.

177
00:13:57,080 --> 00:14:01,850
It's amazing how quickly you forget things and they go to all reservations or new reservations and inspect

178
00:14:01,850 --> 00:14:05,300
this element recounting by slices.

179
00:14:08,300 --> 00:14:14,930
One, two, three, four, and everything on this side of the slice is the HDTV part, so that's exactly

180
00:14:14,930 --> 00:14:15,200
right.

181
00:14:15,230 --> 00:14:22,570
OK, I thought I was forgetting some basic information about go, but apparently I wasn't.

182
00:14:22,580 --> 00:14:25,390
I'm just having a rough day and clearly require more caffeine.

183
00:14:25,940 --> 00:14:30,530
Now, the next thing I want to get is actually that source variable, which I will use, but not right

184
00:14:30,530 --> 00:14:30,830
now.

185
00:14:30,830 --> 00:14:38,630
So I'm going to say source is a sign the value of from my exploded slice at position three, the one

186
00:14:38,630 --> 00:14:43,010
just before ID, and that will tell me where I'm getting this information.

187
00:14:43,550 --> 00:14:44,570
Now, what am I going to do with that?

188
00:14:44,570 --> 00:14:45,890
I'm going to stick it in my string map.

189
00:14:45,890 --> 00:14:47,180
So let's create a string map.

190
00:14:48,530 --> 00:15:02,690
String map is assign the value of make a map, string, string and string map source as our key is going

191
00:15:02,690 --> 00:15:05,090
to be equal to source.

192
00:15:05,690 --> 00:15:09,140
And I'll stick that in my string map down here.

193
00:15:10,900 --> 00:15:18,600
There now I also want some place I need to now to grab from the database the ID of the given reservation.

194
00:15:18,610 --> 00:15:22,990
So here is where we use that database routinely, just create it.

195
00:15:23,650 --> 00:15:33,460
So I'll call it resource error are assigned the value of my DB dot, get reservation by ID with the

196
00:15:33,460 --> 00:15:35,860
ID I just pulled from the URL up here.

197
00:15:36,430 --> 00:15:39,040
Check for an error and I'll just copy and paste this.

198
00:15:43,460 --> 00:15:49,280
And now I want to have someplace to hold that information so I can pass it to my template, so as we

199
00:15:49,280 --> 00:15:50,960
always do, we'll just create a map.

200
00:15:52,550 --> 00:15:57,170
Data is a sign the value of make a map string.

201
00:15:58,100 --> 00:16:03,350
Interface and data, and I'll call it reservation, because that's what it is.

202
00:16:06,550 --> 00:16:12,820
Is equal to raise, and then I pass that to my template data data.

203
00:16:14,270 --> 00:16:19,420
OK, so let's go back to our women's reservation page and see if we have this information.

204
00:16:19,420 --> 00:16:22,330
And what I'll do here is right in the content.

205
00:16:22,420 --> 00:16:25,380
I will say define a variable rez.

206
00:16:25,390 --> 00:16:34,350
And that's a sign the value of from my data map of string interface index, DOT data reservation.

207
00:16:35,980 --> 00:16:42,730
And here just to show that it's working, I'll put a printout resort first name and.

208
00:16:45,480 --> 00:16:50,580
Reza, last name, and that should give me the information just to show that it works, so let's stop

209
00:16:50,580 --> 00:16:52,440
our application, run our application.

210
00:16:55,100 --> 00:17:01,310
Go back to our Web browser, close this this tab, reload the screen just to make sure everything is

211
00:17:01,310 --> 00:17:05,240
current and I'll click on Jones and I get married.

212
00:17:05,240 --> 00:17:10,210
Jones So there now I'm passing that necessary information to this screen.

213
00:17:11,330 --> 00:17:12,570
So what I want to show here.

214
00:17:12,710 --> 00:17:15,260
Well, I want to show some basic information at the top.

215
00:17:15,260 --> 00:17:20,690
I want to show the guest name, the arrival date, the departure date and the room they're staying in.

216
00:17:20,990 --> 00:17:24,150
And I don't want to have a form that allows me to modify information.

217
00:17:24,320 --> 00:17:26,810
Well, we already have that form mostly built.

218
00:17:27,320 --> 00:17:36,260
If we go back to the Make Reservation page, which is make reservation page two right here, I already

219
00:17:36,260 --> 00:17:39,350
have this form, so I'm going to grab this form, the whole thing.

220
00:17:41,440 --> 00:17:49,450
And I'll copy it and I'll go back to my admin reservation show page template and I'll just paste it

221
00:17:49,450 --> 00:17:51,240
in here and make changes as necessary.

222
00:17:51,850 --> 00:17:55,990
So instead of calling the input, make a reservation, I'll just call it save.

223
00:17:58,250 --> 00:18:01,240
And then we'll go up to the top and we'll start making some changes.

224
00:18:01,280 --> 00:18:03,260
So what's the very first thing that has to change?

225
00:18:03,290 --> 00:18:06,320
Well, we're not going to the action of make reservation.

226
00:18:06,770 --> 00:18:08,030
We're going to go to the action.

227
00:18:08,040 --> 00:18:14,330
That's exactly the same as what we have right here at main reservation and either new or all and then

228
00:18:14,330 --> 00:18:14,900
the ID.

229
00:18:15,020 --> 00:18:16,010
So I'll change that.

230
00:18:16,580 --> 00:18:19,880
Admin reservations.

231
00:18:24,470 --> 00:18:30,470
And then I want to put the source here, so what I'm going to do is just after I grab the reservation

232
00:18:30,470 --> 00:18:35,870
up here, I'll just create a variable SIRC, which is an index of string map.

233
00:18:36,530 --> 00:18:39,730
And the thing I put it in, I believe, was SIRC.

234
00:18:39,740 --> 00:18:40,340
That's the key.

235
00:18:40,340 --> 00:18:40,850
I look it up.

236
00:18:40,980 --> 00:18:42,320
So now I have this is a variable.

237
00:18:42,890 --> 00:18:49,010
So here I can just go sirc and then what's the ID.

238
00:18:49,040 --> 00:18:54,620
Well it's Rezo ID and there's an E in there and that should work.

239
00:18:55,220 --> 00:18:57,020
Method is PPO's class is nothing.

240
00:18:57,020 --> 00:18:57,740
No validate.

241
00:18:57,740 --> 00:18:58,250
Perfect.

242
00:18:58,250 --> 00:18:59,840
I need the CSIRAC token.

243
00:18:59,840 --> 00:19:03,170
I don't care about this stuff so I'll get rid of those three hidden fields.

244
00:19:03,170 --> 00:19:04,060
They don't matter at all.

245
00:19:04,820 --> 00:19:05,990
And then we have first name.

246
00:19:05,990 --> 00:19:07,400
First name that's all.

247
00:19:07,400 --> 00:19:07,970
Correct.

248
00:19:07,970 --> 00:19:08,480
Good.

249
00:19:08,570 --> 00:19:10,880
But I notice that I'm using a form here.

250
00:19:10,880 --> 00:19:18,940
So back in my handlers when I display this I had better pass it a form variable form forms dot new nil

251
00:19:19,340 --> 00:19:21,530
so it'll actually render the page without an error.

252
00:19:21,530 --> 00:19:22,150
So that's OK.

253
00:19:23,540 --> 00:19:24,440
We have first name.

254
00:19:24,440 --> 00:19:25,370
We have last name.

255
00:19:25,370 --> 00:19:26,330
We have email.

256
00:19:26,330 --> 00:19:27,410
We have phone.

257
00:19:27,410 --> 00:19:29,330
And that's all the basic information.

258
00:19:29,520 --> 00:19:36,050
OK, but I also want to add at this point a cancel button and the cancel should take me back to either

259
00:19:36,680 --> 00:19:43,190
here new reservations, if that's where I came from or here, which is reservations all.

260
00:19:43,640 --> 00:19:48,110
And you notice that the Uighurs are almost identical at the end of the all one.

261
00:19:48,110 --> 00:19:51,680
We have Dasch all at the end of the new one, we have Dasch new.

262
00:19:51,710 --> 00:19:53,120
So I can actually create a cancel out.

263
00:19:53,120 --> 00:20:02,180
And just by saying a HSF equals and I'm going to go to admin reservations and then just put in my source

264
00:20:02,180 --> 00:20:10,280
variable sorry, reservations dash and then my source variable, which is either new or all, and we'll

265
00:20:10,280 --> 00:20:11,270
just make this look good.

266
00:20:11,810 --> 00:20:20,150
Class equals button and I'll say button warning just to give it a different color and put cancel here

267
00:20:22,040 --> 00:20:24,440
so that hopefully will work.

268
00:20:24,780 --> 00:20:26,900
I think I have everything in here the way it should be.

269
00:20:27,290 --> 00:20:32,090
OK, at the top here, I want to change the what's being displayed used to make this a little bit better.

270
00:20:32,510 --> 00:20:36,740
So I'll say in a paragraph tag, cut that and paste it here.

271
00:20:37,700 --> 00:20:40,760
And I already know their first name and last name because it's on the form.

272
00:20:40,760 --> 00:20:46,640
So I'll say arrival and I'll make that in the strong arrival.

273
00:20:47,090 --> 00:20:47,900
I'll try that again.

274
00:20:48,350 --> 00:20:50,450
Strong arrival.

275
00:20:51,950 --> 00:20:53,180
And that's going to be.

276
00:20:55,130 --> 00:21:03,340
Reza, start date, but I wanted to look nice, so let's take advantage of that human date function.

277
00:21:03,350 --> 00:21:09,170
We made a lecture or two ago and then on a new line, and I'll just duplicate this and change this to

278
00:21:09,170 --> 00:21:12,140
end date and change this to departure.

279
00:21:13,940 --> 00:21:14,900
And then we need the room.

280
00:21:14,900 --> 00:21:24,890
So I'll duplicate that again and save room and change this to rez dorm room, dorm room name.

281
00:21:26,000 --> 00:21:29,570
OK, there's too many EMS and admin, so let's fix that.

282
00:21:29,900 --> 00:21:30,500
Perfect.

283
00:21:31,730 --> 00:21:35,600
OK, let's see what we got wrong, so let's stop our application started our application.

284
00:21:37,360 --> 00:21:40,670
And it's not populating any information in the form yet, but will be shortly.

285
00:21:41,980 --> 00:21:43,840
Let's try clicking on it and see if we got it right.

286
00:21:46,410 --> 00:21:47,040
Looks good.

287
00:21:47,390 --> 00:21:51,050
It does look good and it's actually already put the information in the form.

288
00:21:52,530 --> 00:21:53,630
Why did it do that?

289
00:21:53,880 --> 00:22:00,420
Because I'm actually already using that same information here for er checking on the other other page.

290
00:22:00,420 --> 00:22:02,790
So, hey, most of our work is already done.

291
00:22:03,120 --> 00:22:04,770
Arrival is formatted properly.

292
00:22:04,770 --> 00:22:05,370
Departure.

293
00:22:05,380 --> 00:22:06,870
There's two columns in all of these.

294
00:22:06,870 --> 00:22:07,920
Let's go fix that.

295
00:22:08,520 --> 00:22:09,720
Don't need the colon's there.

296
00:22:13,390 --> 00:22:14,960
Reload looks good.

297
00:22:15,340 --> 00:22:22,600
The only thing that I don't like is that this admin template doesn't bould the labels for form tags,

298
00:22:22,600 --> 00:22:23,980
so I kind of like that.

299
00:22:23,990 --> 00:22:25,750
Let's go back and fix the labels.

300
00:22:26,200 --> 00:22:27,510
Too many O's in room there.

301
00:22:28,360 --> 00:22:30,010
So we'll go to our admin layout.

302
00:22:30,490 --> 00:22:38,200
And right here I'll just redefine the tag label so it doesn't have a dot or a hashmark or anything in

303
00:22:38,200 --> 00:22:38,650
front of it.

304
00:22:38,980 --> 00:22:45,550
And I'll just say font weight bould save that reload.

305
00:22:45,910 --> 00:22:46,540
That looks better.

306
00:22:47,180 --> 00:22:49,660
OK, so we have this done.

307
00:22:49,810 --> 00:22:52,450
The next step is, well there's actually a couple of steps left.

308
00:22:53,000 --> 00:22:55,270
One is to make sure that this works.

309
00:22:56,600 --> 00:22:58,900
Look at that admin reservation slash new.

310
00:22:59,350 --> 00:23:01,300
I'm just full of typographical errors today.

311
00:23:01,300 --> 00:23:07,750
So back here, find that cancel, get rid of the slash, reload this.

312
00:23:08,050 --> 00:23:09,190
Let's make sure this works.

313
00:23:09,190 --> 00:23:11,650
So we'll go to our reservation's new reservations.

314
00:23:11,680 --> 00:23:15,880
When I click on this one, it should take me back to new reservations.

315
00:23:16,390 --> 00:23:17,140
And it does.

316
00:23:17,470 --> 00:23:20,680
And let's go to all reservations and click on this one.

317
00:23:21,370 --> 00:23:24,340
And they should take me back to all reservations.

318
00:23:24,340 --> 00:23:25,060
And it does.

319
00:23:25,510 --> 00:23:27,340
So we're almost ready to go.

320
00:23:27,640 --> 00:23:28,900
There's a couple of things left to do.

321
00:23:29,410 --> 00:23:29,740
No.

322
00:23:29,740 --> 00:23:33,310
One we want to means to mark this as processed.

323
00:23:33,640 --> 00:23:38,470
Number two, we want a means to delete this entirely in case we don't want this reservation.

324
00:23:38,490 --> 00:23:42,880
It was just something that we entered ourselves or was done in error, whatever we want, the ability

325
00:23:42,880 --> 00:23:43,540
to delete it.

326
00:23:44,260 --> 00:23:49,930
And finally, we want the ability to modify this information, to update the reservation, to change

327
00:23:49,930 --> 00:23:53,320
the email address or change the phone or whatever it may be.

328
00:23:53,380 --> 00:23:55,120
And none of that is difficult.

329
00:23:55,300 --> 00:23:58,720
And we'll take care of that in the next lecture or two.
