Chapter 5 Dynamical Calculations
Overview <ul><li>In this chapter you will: </li></ul><ul><ul><li>Dynamically populate a drop-down menu. </li></ul></ul><ul...
Dynamically populated drop-down menus. The next activity will create a drop-down menu which is populated from the database...
Dynamic calculation  <ul><li>Remember the Tour Calculator. </li></ul><ul><li>We are going to change it to dynamically put ...
Create a tourprice recordset Test the recordset View the sql statement with the advanced button.
Dynamic drop-down <ul><li>Open tourprice.php page and select the list/menu. </li></ul><ul><li>Select the dynamic button. <...
<ul><li>Fill the dialog as shown. </li></ul>Dynamic drop-down-2
<ul><li>Save and view as shown. </li></ul>Dynamic drop-down-3
Next Activity: C reating dynamic text tourprice.php tourprice_processor.php Click on the submit button. The data in the fo...
<ul><li>Open tourprice_processor.php page. </li></ul><ul><li>Create a new recordset (shown on next slide), with the follow...
<ul><li>Click the Test button. Enter 9 in the Please Provide a Test Value dialog, and click OK.  </li></ul><ul><li>Click O...
<ul><li>Place xx as shown. </li></ul><ul><li>Highlight xx. </li></ul><ul><li>Select Dynamic Text as shown. </li></ul><ul><...
<ul><li>Delete the code that sets the base price. </li></ul><ul><li>Add the following lines </li></ul>Fixing up the price.
<ul><li>Save and view the pages. </li></ul>Save and view
Lab 5 - 1 <ul><li>In this lab you will; </li></ul><ul><ul><li>Create a dynamic list/menu for the reservation.php page, sho...
Lab 5 - 2 Reservation.php <ul><li>Dynamic tour list </li></ul><ul><li>Note: Duplicate entries because the same trip is off...
Lab 5 – 3 reservation.php Static Featured tours Dynamic Feature tours The reservation page has static values for the “Feat...
Lab 5 - 4 <ul><li>reservations.php page.  </li></ul><ul><li>create a recordset  </li></ul><ul><ul><li>named rs_tours from ...
Lab 5 - 5 <ul><li>Create a recordset </li></ul><ul><li>Delete the text under the Featured Tours heading. </li></ul><ul><li...
Upcoming SlideShare
Loading in …5
×

Dynamic Web Pages Ch 5 V1.0

1,260 views

Published on

Published in: Technology, Design
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,260
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
42
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Dynamic Web Pages Ch 5 V1.0

  1. 1. Chapter 5 Dynamical Calculations
  2. 2. Overview <ul><li>In this chapter you will: </li></ul><ul><ul><li>Dynamically populate a drop-down menu. </li></ul></ul><ul><ul><li>Create a recordset using a filter from the form data on the previous asp page. </li></ul></ul><ul><ul><li>Insert dynamic text. </li></ul></ul><ul><ul><li>Write the code to handle errors when data has not validated. </li></ul></ul>
  3. 3. Dynamically populated drop-down menus. The next activity will create a drop-down menu which is populated from the database through a recordset. tourprice.php
  4. 4. Dynamic calculation <ul><li>Remember the Tour Calculator. </li></ul><ul><li>We are going to change it to dynamically put the tour locations in the list/menu, (with the ID being the value) on the tourprice.php page. </li></ul><ul><li>On the tourprice_processor.php, we will then use the id to select the adult and child rate to calculate the cost or the tour. </li></ul>
  5. 5. Create a tourprice recordset Test the recordset View the sql statement with the advanced button.
  6. 6. Dynamic drop-down <ul><li>Open tourprice.php page and select the list/menu. </li></ul><ul><li>Select the dynamic button. </li></ul><ul><li>Remove the static labels and values with the – button. </li></ul>
  7. 7. <ul><li>Fill the dialog as shown. </li></ul>Dynamic drop-down-2
  8. 8. <ul><li>Save and view as shown. </li></ul>Dynamic drop-down-3
  9. 9. Next Activity: C reating dynamic text tourprice.php tourprice_processor.php Click on the submit button. The data in the form is transferred to the tourprice_processor.php page. The price is calculated using the form data. Dynamic text
  10. 10. <ul><li>Open tourprice_processor.php page. </li></ul><ul><li>Create a new recordset (shown on next slide), with the following attributes: </li></ul><ul><ul><li>Name = rsTourpricesFiltered </li></ul></ul><ul><ul><li>Connection = conn_newland </li></ul></ul><ul><ul><li>Table = tours </li></ul></ul><ul><ul><li>Columns = selected tourID, tourName, basePriceAdult, basePriceChild </li></ul></ul>Dynamic calculation
  11. 11. <ul><li>Click the Test button. Enter 9 in the Please Provide a Test Value dialog, and click OK. </li></ul><ul><li>Click OK to exit the test output, and again to save the recordset. </li></ul>Filtered recordset Note: This recordset has a filter on it. The recordset will only select a tour id that equals tour is that was selected from the pervious asp page.
  12. 12. <ul><li>Place xx as shown. </li></ul><ul><li>Highlight xx. </li></ul><ul><li>Select Dynamic Text as shown. </li></ul><ul><li>The dialog shown appears, select tourName and click OK. </li></ul>Displaying dynamic text
  13. 13. <ul><li>Delete the code that sets the base price. </li></ul><ul><li>Add the following lines </li></ul>Fixing up the price.
  14. 14. <ul><li>Save and view the pages. </li></ul>Save and view
  15. 15. Lab 5 - 1 <ul><li>In this lab you will; </li></ul><ul><ul><li>Create a dynamic list/menu for the reservation.php page, shown on the next slide. </li></ul></ul><ul><ul><li>Add a dynamic feature tour list, as shown on the following slides. </li></ul></ul><ul><ul><ul><li>To do this you need to detach this page from the template. </li></ul></ul></ul>
  16. 16. Lab 5 - 2 Reservation.php <ul><li>Dynamic tour list </li></ul><ul><li>Note: Duplicate entries because the same trip is offered on different dates. </li></ul>
  17. 17. Lab 5 – 3 reservation.php Static Featured tours Dynamic Feature tours The reservation page has static values for the “Featured Tours” data. In this lab you are going to change it from static to dynamic.
  18. 18. Lab 5 - 4 <ul><li>reservations.php page. </li></ul><ul><li>create a recordset </li></ul><ul><ul><li>named rs_tours from the tours table. </li></ul></ul><ul><ul><li>Select only TourID, TourName, and TourDate </li></ul></ul><ul><ul><li>sort by TourName. </li></ul></ul><ul><li>Click the Dynamic button in the Property inspector. </li></ul><ul><ul><li>Dynamically fill the values from the recordset that you just created. The values are the TourID </li></ul></ul><ul><ul><li>Labels are the TourName </li></ul></ul><ul><ul><li>Click OK to close the dynamic dialog. </li></ul></ul><ul><li>Save the page and preview it. Drop down the list to see the dynamic values. </li></ul>
  19. 19. Lab 5 - 5 <ul><li>Create a recordset </li></ul><ul><li>Delete the text under the Featured Tours heading. </li></ul><ul><li>Add a dynamic table as shown. Remember border=0. Save and view. </li></ul>

×