<!--- 
  Filename:     WapIndex.cfm
  Created by:   Nate Weiss (NMW)
  Date Created: 2/18/2001
  Please Note:  
--->

<!--- Include WAP Content-Type and Prologue --->
<CFINCLUDE TEMPLATE="WapIncludePrologue.cfm">

<!--- Get movies from database --->
<CFQUERY 
  DATASOURCE="ows" 
  NAME="GetMovies" 
  CACHEDWITHIN="#CreateTimeSpan(0,0,15,0)#">
  SELECT FilmID, MovieTitle, Summary 
  FROM Films
  ORDER BY MovieTitle
</CFQUERY>


<wml>

  <card id="home">
    <p>
      <!--- Welcome message --->
      <b>OrangeWAP Studios</b><br/>
      <i>Celluloid by Cell</i><br/>

      <!--- Links to other pages --->
      <a href="#movies">Browse Movies</a><br/>
      <a href="#search">Search Movies</a><br/>
    </p>
  </card>

  <card id="movies">
    <!--- Give user a way to get back home --->
    <do type="options" label="Home">
      <go href="#home"/>
    </do>
  
    <!--- Present a link for each movie --->
    <p>
      <b>Orange Whip Movies</b>
      <CFOUTPUT QUERY="GetMovies">
        <a href="WapMov.cfm?FilmID=#FilmID#">#MovieTitle#</a><br/>
      </CFOUTPUT>
    </p>      
  </card>
  

  <card id="search">
    <!--- Run search when "Accept" button pressed --->
    <do type="accept" label="Submit"> 
      <go method="post" href="WapSearch.cfm?"> 
        <postfield name="criteria" value="$criteria"/> 
      </go> 
    </do> 

    <!--- Allow user to type search criteria --->
    <p>
      <b>Movie Search</b><br/>
      Keywords: <input name="criteria"/>
    </p>      
  </card>
</wml>

