<!--- 
 Filename: ChoicePage3b.cfm
 Created by: Nate Weiss (NMW)
 Purpose: Provides navigation elements for films and ratings
--->

<html>
<head><title>Film Information</title></head>
<body>
<h2>Film Information</h2>

<!--- Create self-submitting form --->
<cfform action="#CGI.script_name#" method="post">

  <!--- Attempt database operation --->
  <cftry>
  <!--- Retrieve Films from database --->
  <!--- MovieTitle2 is a bad column. Remove the "2" to fix it. --->
  <cfquery name="getFilms" datasource="#APPLICATION.DataSource#">
  SELECT FilmID, MovieTitle2
  FROM Films
  ORDER BY Films.MovieTitle
  </cfquery>
  
  <!--- Display Film names in a drop-down list --->
  <p>Films:
  <cfselect query="getFilms" name="filmID" value="FilmID" display="MovieTitle"/>
  <cfinput type="submit" name="go" value="Go">
  
  <!--- If any database errors occur during above query, --->
  <cfcatch type="Database">
  <!--- Let user know that the Films data can't be shown right now --->
  <p><i>Sorry, we can't show a real-time list of Films right now.</i></p>
  </cfcatch>
  </cftry>


  <!--- Attempt database operation --->
  <cftry>
  <!--- Retrieve Ratings from database --->
  <cfquery name="getRatings" datasource="#APPLICATION.DataSource#">
  SELECT RatingID, Rating
  FROM FilmsRatings
  ORDER BY Rating
  </cfquery> 
  
  <!--- Display Rating names in a drop-down list --->
  <p>Ratings:
  <cfselect query="getRatings" name="ratingID" value="RatingID" display="Rating"/>
  <cfinput type="submit" name="go" value="Go">
  
  <!--- If any database errors occur during above query, --->
  <cfcatch type="Database">
  <!--- Let user know that the Ratings data can't be shown right now --->
  <p><i>Sorry, we can't show a real-time list of Ratings right now.</i></p>
  </cfcatch> 
  </cftry>
 
</cfform>
 
</body>
</html>
