<!--- 
 Filename:   WapSearch.cfm
 Created by:  Nate Weiss (NMW)
 Purpose:   Provides a simple film search interface for WAP users
--->

<!--- 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="WapIndex5.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>
