24
1 Chapter 6 Chapter 6 Filtering & Displaying Data Filtering & Displaying Data

Dynamic Web Pages Ch 6 V1.0

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Dynamic Web Pages Ch 6 V1.0

1

Chapter 6Chapter 6Chapter 6Chapter 6

Filtering & Displaying DataFiltering & Displaying Data

Page 2: Dynamic Web Pages Ch 6 V1.0

2

Overview• In this chapter you will:

– Transfer dynamic data through the URL.

– Add repeating regions.– Creating recordsets with information

from the URL.– Adding images dynamically.

Page 3: Dynamic Web Pages Ch 6 V1.0

3

Changing profiles.php• The profiles page displays the countries

statically.• We are going to change this to

dynamically from the database.

Profiles current page

Page 4: Dynamic Web Pages Ch 6 V1.0

4

Profiles_details.php• Create a profiles_details.php page

from the generic template.

Page 5: Dynamic Web Pages Ch 6 V1.0

5

profiles.php - 1• Delete the countries so the

profiles.php page is as shown.

Page 6: Dynamic Web Pages Ch 6 V1.0

6

profiles.php - 2• Create a recordset as shown.

Page 7: Dynamic Web Pages Ch 6 V1.0

7

profiles.php - 3• Insert a country

name field binding, as shown.

• With this insertion highlighted click on the browse icon for a link.

• Filling the browse as shown.

• Select the parameters button.

Page 8: Dynamic Web Pages Ch 6 V1.0

8

profiles.php – 4• In the parameters dialog

box, click under the name column heading and type the names as shown.

• Click on the lighting bolt and select as shown for both values.

• This parameters button writes the url code in the link.

• Here we are passing the country ID and name in the URL.

Page 9: Dynamic Web Pages Ch 6 V1.0

9

profiles.php – 5• Notice now the binding is a link.

• Notice the link sends the id of the country in the URL.

• With the link highlighted– In the server behavioursPanel click + and chooseRepeat Region, as shown.

Page 10: Dynamic Web Pages Ch 6 V1.0

10

profiles.php – 6• Adding a repeat region and click on

OK.

• A section page of the page is shown. Check that the break is inside the repeat region

Page 11: Dynamic Web Pages Ch 6 V1.0

11

profiles.php – 5• View the page. It should look like

Page 12: Dynamic Web Pages Ch 6 V1.0

12

profiles_details.php• Open the profiles_details.php• Create a recordset and complete the page to look like below.• The following slide have the details on how complete it.

Heading 1

Heading 2

process_details.php

Page 13: Dynamic Web Pages Ch 6 V1.0

13

Create the recordest

Click the advanced.. button.

Page 14: Dynamic Web Pages Ch 6 V1.0

14

Combining two tables• Add the other table; region.• Add the where clause to join the

tables.

Page 15: Dynamic Web Pages Ch 6 V1.0

15

Add Bindings & View• Add the bindings as shown on the pervious slides.• The finished page should look like:

Page 16: Dynamic Web Pages Ch 6 V1.0

16

Inspecting the pervious sql

• Take a look at the Sql• What does it mean

Page 17: Dynamic Web Pages Ch 6 V1.0

17

Dynamic images -1• Now we are going to add the image

that go with the country.• Place the cursor as shown.

• From the menu select insert->image.

Page 18: Dynamic Web Pages Ch 6 V1.0

18

Dynamic images -2• Select as

shown and click OK.

• Create the imageright css rule and apply it to the image.

Page 19: Dynamic Web Pages Ch 6 V1.0

19

Dynamic images -4• Completed page.

Page 20: Dynamic Web Pages Ch 6 V1.0

20

Lab 6 -1• Dynamically creating a repeated region

for the tour packages and their dates.• Then the tour ID is sent in the URL to

open the tourpackages.php page.• The tourpackage.php page uses the

tour ID to display the info about the selected tour package.

• The following slides show the changes of the two pages.

Page 21: Dynamic Web Pages Ch 6 V1.0

21

Lab 6 -2• What the page look like now.

tours.php

Page 22: Dynamic Web Pages Ch 6 V1.0

22

Lab 6 -3• What the page will look like at the

end

tours.php

Page 23: Dynamic Web Pages Ch 6 V1.0

23

Lab 6 -4• Current

page

tourpackages.php

Page 24: Dynamic Web Pages Ch 6 V1.0

24

Lab 6 -5• What the page will look like at the end

tourpackages.php