Hi friends, welcome to Tutas Funnich channel
In our last class we have completed the model section of the flight transaction, how to implement
the relationship and everything we have taught in our last video. This is very must
Okay, when you implement the decision is very much. The flight transaction belongs
One passenger belongs, many transactions. So this is the many side. You have to say belongs
Okay, the many side, one passenger has many side as many. I have explained clearly these things, okay, you know, need to review, all the things I have
clearly mentioned. Now let's go to our flight master transaction table here
So here we have to implement all the things. Flight MasterMots here, we as is decided
So you have to put it here. First you have to here, implement at Lose, app modules, the flight, this one, the flight
transaction so yeah the name flight transaction so not only one model so we have
everything got important another one is that this one is a so flight this one
also we need that flight passenger so we have all things we are combining all
the table so we have need all things third one is we have a make it as a flight
aircraft model how the flight master
So we need a, these are the models we need it. So let's say all. Right
Now what I'm going to do is, first we have looked at the index page
Index page, what you're going to rest here. First I'm going to go to the thing is I'll be explaining
width so here we have a width so what are the relationship we have to associated the
flight transaction you have to these are the three things we have to associate the
flight transfer passenger flight master paragraph we have to give here we are here
flight transaction passenger passenger flight master thing is a warehouse right that's the thing you have provided after that we have to do
the another thing is here what about the things you are did it sir if you associate
the relationship you have tried the flight master model here when you lower the index page flight master you have write a flight transaction this is a model
name with we have associated with the relationship if you have one relationship only passenger
you have put on passengers only so we have a three relationship we have to associate it so that we
have to write it here passenger comma flight master come up air draft you have write as a get
right you have get the data as an array form so we have write as a get
Okay, so we have to get the data as an array format you have to using the gate
Okay, you have to use it like this. It's a simple way you have right here
Okay, it's a simple way. After that, we have to load those tables
So, in order to load the combo works. So you have to write down. So you have write the same thing
So passengers, so you have passengers, flight masters, aircraft, aircraft. Right
So we have to call the relevant model names. So passenger is a model name, a public passenger
Flight master, they are craft. These are the models we have to load it
That's it. That's a simple stuff we have to do. that we have to return into the view which we have written flight mass flight transaction
view flight transaction view okay flight transaction index page flight transaction transaction index page in next stage alarm with passengers flight
master and aircraft and this one as well this one as well as well
passengers flight masters and okay so the aircraft comma this one what's
the then main one this flight transaction these are the things you have to
use in the compact key it associate these things to pass into the view Okay, this model, all things are we have to load it and pass in the respective views
But that's the thing we have to do it over here. Right
Okay, that's the thing we have right it out here. Right. Now what you're going to do is now, now what you're going to do is now here, this is this is
this is a index page. So let's go to our view page
So view resources, view pages. Now I going to create another page a right transaction flight transaction into the flight transaction page I going to create the these things these two pages I just
copied so index page only I'm going to copy paste into this flight
transaction page right so here this is a flight transaction index plate
So we have to change this one as a flight transaction. Right
So adding you, we have changed as flight transaction. So that here we have a, we have to change all the things
The first one is that we have to look at in the flight transaction and what other things are there
Let's do one by one. Sheet number date fair. So yeah
Now here we have put the relevant select fields. So I just copy this to face
So I just copy this to face. categories and brands. So here we have put a due tag
Let's copy these two things first. Let's go here. This one we have to know this one
This instead of input box we have given as a drop-dance categories
So not a which is a, we have to select it. Load it. As we have drop down as a as a drop down as a
drop down as a passenger was a passenger name seat number date we are arrived
arrive time we no needed okay flight master so passenger so passenger I
I so ID or name. So you have write it here. Drop down, you can drop down it as passenger ID or name
So let passenger ID. Let's add the passenger ID. So you have passenger
Passenger. Right. Passenger here, we have to load from the combo box. You have to select the passenger ID
But you have to write your name. You can get it over here. Okay, passenger ID. So you present your ID
your name to get it here so I'm in load it as a select field select field
so to paste it over here this one you can load it whatever it is it is it is
right so you have right it's a passenger passenger ID passenger ID let's select the passenger name whatever I'm going to get a passenger name
You will select a passenger I name, it will be selected as a passenger ID
It is added. So you have to change it. The same thing, you have to do this another one as well
This one should be the what is passengers. Passengers. Passenger. Select the passenger
like that passenger. Copy this and paste it over here. This one should be the
flight master flight. Flight master. Flight master. Flight Master
Flight Master Flight Masters
Flight Masters Flight Master Flight's faster name Like this one, place it out here Aircraft
Thank you That the thing we have to do it
Right, that's the thing you have to do it
So that's the thing we have to do it. Right fly starts your name
Here also you have changed that field. all things passenger okay so here
sheet number date fare
sorry flight master aircraft right traction right here this you have to do it the flight masters flight
transactions where you'll get go to the control section out of the
name is flight by transactions section it's okay so it's coming like this this
way record is transfer passengers flight masters and aircrafts okay so yeah
let's get them here flight masters flight masters like transactions
we have transactions here After that we are just copy this, place it below. Passenger
Flight master name, passenger name, you're right like this. We already associate the relationship over here
That's the thing you've created. In order to the flight transaction edit button
Flight master, flight transaction, destroy method
That's something you've provided. Others are same as it is. same as it is so let's do the things so the store method let's go to the
flight transaction here this one so I'm going to go to flight control here
select this one copy this I'm going to paste over the store method this one
this one flight transactions So we haven't do the configuration part of it
So let's set it quickly. So this constructor you have a constructor method
Flight transaction. Flight transactions
This one should be the flight transaction. file transactions create all the request coming it's create all the
richest right now let's solve things that we have done we have create the path
as well it's a route but implement the route folder copy this place it here
you have got the flight sorry fight transaction Flight transaction is go to the controller which is a flight transaction
copy this flight transaction controller but implement the path as well is reside out
here flight transaction all right right now let implement this this copy this URL Now you have paste it over here
Flight transaction, so it's getting there a flight transaction. Indexed flight transaction right here
This, getting the folder. If you get this, folder, a file transaction
transaction rename it basic flight transaction index okay now let's take it back it
fried transaction index what is the things
Alright the problem here. So add a plan out to the problem here
So the pages, here are the pages inside the page here. There's a pages, inside the pages flight master
So that's the problem. So we are the controller. Controls the same one and bring back to the application again
The passengers, the problems of passengers, we have the problem to passengers
Right. So there is error. So we are, we are, I have sort of this error. So that's why the passengers, you just copy this. It will be scumming to here
We are scumming to. That's why I show it. The same name you're implemented over here. Passengers. Yeah. Passengers
Here you wrongly we have type that's why the error okay so not passengers so the same thing
have to be passengers here you have the passenger name you're right now let's take it
aircrafts okay say aircrafts so let's go over here what's up here what
doing have got here aircrafts aircrafts index with what I return
right now it's aircrafts right now it's working here it's working here it's working
here. It's working but the thing is not loaded. Why? What's the problem? I think the data
is not available, I think. So passenger. So let's go to the passenger. Copy this with passenger
So there's no data. So I have passenger arrow age 35, select as a gender, male, phone number, something like that
Let register button. Registered successfully. So let's refresh them. See, the Arun is selected
Okay, here. It's working now perfectly well. Now flight also, flight master also, we have to select the flight master
Flight master. departure India arrival cities Sri Lanka departure time 8 p.m. 2 let's let's
be a good okay let's apply okay so okay now let's select the here so let's select
the here as a flight master Flight master, so the name is not there
Flight master, the smart, the departure date is there. The flight master ID, just put it in the Lightmaster ID
Not name, name is not there. Here's not, but the flight master ID
If you want to add the ID you have to add it here, I just put it the auto increment
same part. Flight Master ID 1, Aircraft. Aircraft also, we have to select the aircraft as well. aircraft
yeah craft something number model
yeah aircraft let's go to what are the fields of the aircraft
just check it the models aircraft number I need to get our aircraft number
to here that's by bring to the aircraft number Now let's take it just add that
Ah this is so sorry that that's a problem description that that's not a problem to description so so so so
So the aircraft we are say aircraft The model also I haven't added this description or description
I'll say all now let's say that I just that it's working so you can have to have to add a
to some model description, some model number, that's working
You can see that's working. Now if you go over here, flight transaction
Now you'll be able to see the fear, passenger, flight master
your sheet number date and fare all things your check register button it will be
record with the data database tape okay uh this thing i'm going to teach in my next video
tutorial thank you for watching