WEBVTT 00:05.250 --> 00:15.110 Inside this file We're going to copy the code of the navigation bar where the user is not connected. 00:15.600 --> 00:16.870 OK. 00:17.700 --> 00:24.360 And then we're going to create another file We're going to call it navigation bar 00:29.190 --> 00:29.880 connected 00:35.090 --> 00:39.940 and that's where we're going to place the navigation bar where the user is connected. 00:39.950 --> 00:43.560 So for now I'm going to copy only the old navigation bar. 00:43.580 --> 00:44.400 OK. 00:44.710 --> 00:50.360 So you're going to have the same navigation bars in both files and are going to come back to this one 00:50.740 --> 00:52.560 and change it. 00:52.610 --> 00:59.830 So for now let's go to the index page file and write some PSP code in there. 01:00.310 --> 01:01.330 OK. 01:01.520 --> 01:02.110 So 01:09.440 --> 01:18.070 where are we going to say here we're going to say if the user is connected include the first file if 01:18.070 --> 01:21.160 the user is not connected include the second file. 01:21.370 --> 01:26.550 So to check if the user is going next it we're going to check the session variable. 01:26.920 --> 01:27.840 OK. 01:28.300 --> 01:31.300 We're going to check if the user ID is set. 01:31.500 --> 01:38.080 OK inside the session variables are going to use the function is set and the argument is going to it's 01:38.080 --> 01:43.520 going to take as session user ID. 01:43.660 --> 01:51.700 So the reason why we're doing this is because when we log in the User we said this variable to the user 01:51.700 --> 01:52.290 ID. 01:52.600 --> 01:53.810 OK. 01:55.610 --> 02:04.690 So if that's the case we're going to include the navigation but not connected the navigation but connected. 02:14.470 --> 02:18.670 OK. 02:20.170 --> 02:20.730 Otherwise 02:23.670 --> 02:29.820 you're going to include the other file navigation but not connected. 02:32.840 --> 02:37.040 OK so let's try this and make sure this thing is still working. 02:38.970 --> 02:40.500 So if we log in 02:52.090 --> 02:59.010 basically we are directed straight away to the main page looks and well if we go to the index 03:02.010 --> 03:03.120 those page file 03:06.440 --> 03:10.610 OK so we can see that we of course the variegation Bob Baer. 03:10.710 --> 03:17.140 OK so what are we going to do now are we going to change this navigation bar. 03:20.280 --> 03:25.610 To something like this OK. 03:26.170 --> 03:27.220 So first 03:33.600 --> 03:38.660 this change and to search like base. 03:38.870 --> 03:39.590 OK. 03:40.730 --> 03:43.490 And then you got it's profile 03:48.940 --> 03:59.880 and help and Kentucky says then you call it my trips. 04:00.020 --> 04:07.250 OK so if we click on my trips we're going to be taken to the Crips page. 04:07.270 --> 04:10.590 That's the file main page looks in most places. 04:17.300 --> 04:23.790 OK if we click on the profile link going to be taken to the profile page which is profiled as page we 04:27.900 --> 04:28.190 gay 04:31.180 --> 04:46.340 and then on the right on site we're going to have the logout link. 04:48.360 --> 04:49.680 The ATF without 04:52.480 --> 04:59.450 is going to be indexed those BHB with a promise in there which is the Logos Brahmin's. 04:59.560 --> 05:00.970 So this has been explained 05:03.550 --> 05:04.860 in the notes. 05:04.930 --> 05:13.090 So basically what we're going to do once you click on that button are going to be taken again to the 05:13.090 --> 05:13.680 index. 05:13.700 --> 05:20.880 Those PSAP file and the file was got something other top to deal with the logout. 05:21.010 --> 05:21.370 OK. 05:21.370 --> 05:24.020 So if it finds a problem is the look out. 05:24.130 --> 05:26.000 Going to look to use our apps. 05:26.020 --> 05:27.060 OK. 05:27.100 --> 05:29.010 So make sure that you come to that. 05:29.050 --> 05:34.980 And again this has been explained even though it's up. 05:35.470 --> 05:40.330 The it's for the logout link and then we need the username. 05:41.060 --> 05:52.310 So to get the user name we're going to need to run a query in the database or we can just get inspired 05:52.310 --> 05:56.440 quickly from the main page looked at because this has already been done. 05:56.450 --> 05:59.210 So what we did to get the user name 06:14.120 --> 06:17.270 was by using the session user name. 06:17.420 --> 06:19.150 OK. 06:21.270 --> 06:24.530 Well that's one way of doing it but we need to be careful here. 06:24.690 --> 06:30.180 If we use the session variable we'll need to make sure that if the user updates they use a name from 06:30.180 --> 06:34.520 the profiles profile page we need to update the session variable. 06:34.740 --> 06:36.840 Ok corresponding to the username. 06:37.410 --> 06:40.550 There's one important thing I'm going to follow another way here. 06:40.550 --> 06:44.570 I'm going to go to the database and retrieve the user name from that. 06:44.610 --> 06:49.620 The reason why I'm going to do this is because later on we're going to need to get the picture as well 06:49.950 --> 06:56.160 and just make sure that we don't cause any problems the if the user updates their user name or profile 06:56.160 --> 07:01.080 picture I'm going to go straight to the database and retrieve these. 07:01.140 --> 07:09.790 So while the navigation bar connects it we're going to have some PSP code right at the top of the file. 07:09.980 --> 07:13.940 OK. 07:13.940 --> 07:22.680 So first of all I'm going to guess the user id because we need the user id to write the query. 07:23.420 --> 07:34.370 So we saw the user id when the user logs and inside the session variable and this corresponds to user 07:34.370 --> 07:36.970 id like this. 07:37.220 --> 07:38.440 OK. 07:38.640 --> 07:42.740 And then I'm going to get the user name 07:45.910 --> 07:48.790 by running this query so 07:54.780 --> 08:00.090 I'm going to select all records from the users table. 08:10.540 --> 08:11.210 OK. 08:13.340 --> 08:15.380 Where the user id corresponds 08:20.650 --> 08:21.750 to this user id 08:26.070 --> 08:35.870 OK then you run the query using the choli query function. 08:37.400 --> 08:42.050 So it's going to take a couple of problems is our link variable where we store the connection in the 08:42.340 --> 08:44.680 query cell. 08:45.040 --> 08:49.400 All right so we're expecting one record here. 08:49.460 --> 08:57.170 So let's store the number of records inside a count variable. 08:57.170 --> 09:05.670 So we going to use the function my school-I number of rows to check. 09:05.700 --> 09:13.700 Now when you read cause you of course can slide the results very well. 09:14.540 --> 09:17.460 So if count is 1. 09:18.860 --> 09:19.400 That's me. 09:19.430 --> 09:21.610 Everything is OK. 09:21.680 --> 09:26.730 All right so we're going to fetch one record here. 09:26.910 --> 09:27.530 OK. 09:27.630 --> 09:33.730 So we're going to store the record inside a row variable so to fish the record. 09:33.830 --> 09:38.110 Again we're going to use the function my school-I fetch array. 09:39.210 --> 09:43.510 So if you remember this will take a couple of performances. 09:43.550 --> 09:44.260 OK. 09:44.620 --> 09:52.460 So you can give me only the first barometer are you going to specify those you want a verre OK. 09:53.250 --> 09:56.940 That's the barometer for it's ok. 09:59.910 --> 10:03.920 Once we do that then we can retrieve the user name from the row variable 10:08.000 --> 10:10.320 mean a source inside a variable. 10:10.320 --> 10:13.840 Use any such access the username. 10:13.860 --> 10:22.530 We're going to go to the row array and select the element of index using the 10:25.340 --> 10:33.760 writes If the count is not 1 then we going to echo a an error message. 10:34.270 --> 10:34.520 OK 10:48.040 --> 10:49.420 gates to this 10:52.840 --> 11:08.610 list write some text there something like there was error retrieving the the. 11:08.740 --> 11:13.990 OK so now you cause the username so you can just use that variable. 11:14.280 --> 11:15.010 OK. 11:21.070 --> 11:24.610 Right before the log outs you can have 11:30.280 --> 11:56.540 another other elements in the link inside. 11:56.840 --> 11:58.720 Echo the user name here. 12:08.800 --> 12:09.930 So save 12:18.130 --> 12:19.280 refresh. 12:19.790 --> 12:24.650 OK so we are logged in right now so we can see our user name right there. 12:24.770 --> 12:26.630 We're going to come back to the picture later on. 12:26.630 --> 12:30.920 Once we created the code for uploading a picture. 12:31.160 --> 12:37.840 So that's our navigation bar for a user who has not connects it connects it. 12:38.030 --> 12:39.260 OK. 12:40.090 --> 12:40.600 All right. 12:40.610 --> 12:47.520 Now let's have a look at our navigation bar for a non-connected user. 12:47.600 --> 12:51.520 So we're going to make a quick change there. 12:54.660 --> 13:00.760 Instead of home we want search going 13:05.140 --> 13:08.880 and that's it. 13:09.070 --> 13:09.340 All right. 13:09.340 --> 13:10.690 Now let's have a quick look. 13:10.720 --> 13:13.810 The navigation bar of the Crips page 13:16.680 --> 13:17.640 OK. 13:17.860 --> 13:20.980 So we're going to update that as well. 13:27.110 --> 13:34.070 Let's change the brand to car sharing and also 13:38.360 --> 13:38.990 change 13:42.330 --> 13:53.340 my name to my trips. 13:54.230 --> 13:59.460 And instead of locked in as user name which is going to have the user name like that's 14:02.650 --> 14:06.290 OK you can take the tags 14:09.420 --> 14:10.910 for the bold styling. 14:33.270 --> 14:34.210 OK. 14:34.760 --> 14:37.960 And let's do the same. 14:38.630 --> 14:40.520 Inside the profile page 15:05.020 --> 15:08.570 as you can see in the profile page we're not using the session variable. 15:08.580 --> 15:12.440 We have retrieved actually the user name from this a based race that way. 15:12.820 --> 15:19.660 OK so let's just change this to use a name instead of locked in. 15:19.730 --> 15:21.060 I was using a 15:25.330 --> 15:26.970 T-Dog to car sharing 15:33.700 --> 15:41.980 anti-d's to my trips. 15:42.310 --> 15:42.830 OK. 15:43.090 --> 15:44.380 That looks all right. 15:48.380 --> 15:48.620 Right. 15:48.620 --> 15:51.020 One extra change to the investigation bars. 15:51.260 --> 15:55.820 So you can see the search link just before profile. 15:55.910 --> 15:56.420 OK. 15:57.330 --> 16:02.950 So it is back to the profile navigation bar and the tips page navigation bar. 16:03.140 --> 16:06.880 So we start with the profile since we're already there. 16:08.100 --> 16:13.560 So there's going to be search. 16:13.820 --> 16:15.870 It's not active. 16:16.020 --> 16:22.100 It's going to go to the index last page before they copy this one 16:25.240 --> 16:29.510 to the navigation bar of the page 16:36.820 --> 16:37.380 OK. 16:45.820 --> 16:46.170 OK. 16:46.170 --> 16:48.430 Perfect. 16:48.430 --> 16:48.710 All right. 16:48.720 --> 16:57.780 So in the next video we're going to go to the landing page and build the skeleton and decoration of 16:57.780 --> 17:01.790 this page including the javascript code behind the Google map.