<!--- template settings --->
<CFSET SearchDirectory = "C:\Inetpub\wwwroot\HR\Docs\">
<CFSET SearchCollection = "HRDocs">
<CFSET UseURLPath = "YES">



<!--- retrieve requested files --->
<CFSEARCH 
   name = "GetResults"
   collection = "#SearchCollection#"
   criteria = "#Form.Criteria#"
   maxRows = "#Evaluate(Form.MaxRows + 1)#"
   startRow = "#Form.StartRow#"
>



<HTML><HEAD>
    <TITLE>Personnel Policy Documents - Search Results</TITLE>
</HEAD><BODY bgcolor="ffffff">

<FONT size="+1">Personnel Policy Documents</FONT> <BR>
<FONT size="+2"><B>Search Results</B></FONT>

<P>

<!--- no files found for specified criteria? --->
<CFIF GetResults.RecordCount is 0>
   <B>No files found for specified criteria</B>

<!--- ... else at least one file found --->
<CFELSE>

   <TABLE cellspacing=0 cellpadding=2>

   <!--- table header --->
   <TR bgcolor="cccccc">
      <TD><B>No</B></TD>
      <TD><B>Score</B></TD>
      <TD><B>File</B></TD>
      <TD><B>Title</B></TD>
   </TR>

   <CFOUTPUT query="GetResults" maxRows="#Form.MaxRows#">
   <TR bgcolor="#IIf(CurrentRow Mod 2, DE('ffffff'), DE('ffffcf'))#">

      <!--- current row information --->
      <TD>#Evaluate(Form.StartRow + CurrentRow - 1)#</TD>

      <!--- score --->
      <TD>#Score#&nbsp;</TD>

      <!--- file name with the link returning the file --->
      <TD>
         <CFIF UseURLPath>   <!--- URL parameter from cfsearch contains URL path info --->
            <CFSET href = Replace(URL, " ", "%20", "ALL")>
         <CFELSE>         <!--- ... else use OpenFile to return the file --->
            <CFSET href = "MyApplication_VOpenFile.cfm?serverFilePath=#URLEncodedFormat(Key)#">
         </CFIF>
         <A href="#href#">#GetFileFromPath(Key)#</A>
      </TD>

      <!--- title for HTML files --->
      <TD>#Title#&nbsp;</TD>

   </TR>
   </CFOUTPUT>

   </TABLE>


   <!--- CFSEARCH tried to retrieve one more file than the number specified in the
      Form.MaxRows parameter. If number of retrieved files is greater than MaxRows
      we know that there is at least one file left. The following form contains only
      one button which reloads this template with the new StartRow parameter. --->

   <CFIF GetResults.RecordCount gt Form.MaxRows>
      <FORM action="PersonnelPolicyDocuments_VSearchResult.cfm" method="post">
      <CFOUTPUT>
         <INPUT type="hidden" name="Criteria" value="#Replace(Form.Criteria, """", "'", "ALL")#">
         <INPUT type="hidden" name="MaxRows" value="#Form.MaxRows#">
         <INPUT type="hidden" name="StartRow" value="#Evaluate(Form.StartRow + Form.MaxRows)#">
         <INPUT type="submit" value="    More ...   ">
      </CFOUTPUT>
      </FORM>
   </CFIF>

</CFIF>

</BODY></HTML>
