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

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

<!--- We must have search criteria --->
<CFPARAM NAME="Form.Criteria" TYPE="string">

<!--- Get movies from database --->
<CFQUERY 
  DATASOURCE="ows" 
  NAME="GetMovies" 
  CACHEDWITHIN="#CreateTimeSpan(0,0,15,0)#">
  SELECT FilmID, MovieTitle, Summary 
  FROM Films
  WHERE MovieTitle LIKE '%#Form.Criteria#%'
     OR PitchText  LIKE '%#Form.Criteria#%'
     OR Summary    LIKE '%#Form.Criteria#%'
  ORDER BY MovieTitle
</CFQUERY>


<wml>
  <card id="search">
    <!--- Give user way back to "Search" card --->
    <do type="options" label="Again">
      <go href="WapIndex.cfm#search"/>
    </do>

    <p>
      <!--- Show "Results" message, with criteria --->
      <b>Search Results For</b><br/>
      <CFOUTPUT>&quot;<b>#Form.Criteria#</b>&quot;<br/></CFOUTPUT>

      <!--- For each matching movie, provide link --->
      <CFOUTPUT QUERY="GetMovies">
        <a href="WapMov.cfm?FilmID=#FilmID#">#MovieTitle#</a><br/>
      </CFOUTPUT>
    </p>
  </card>
</wml>


