I am creating a real estate site that allows real estate buyers
to search our database of listed homes.  The homes are searched
by area and price.

I would like to have the option for a cron job which runs periodically
(once every 3 days or so) that returns new found results via
e-mail for each search that was performed (if requested by the
client through an e-mail address text box). If no new entries
are found, no e-mail is sent.

Is this possible with CF?  I have done this with PERL before,
but it took LOTS of code.

This site is nearly completed...I just want to add this feature
to the existing code.

Below is the existing "search" page:


<!---start CF Code


<cfif isdefined("pricerange")>

<cfquery datasource="schome" name="pricerange">
select *
from agenthomelisting


<cfif (pricerange is not "All Price Ranges") or (city is not
"All Areas")>

<cfif isdefined("customerid")>where customerid = '#customerid#'
and <cfelse> where </cfif>

<cfif trim(city) is not "All Areas">city = '#city#'</cfif>

<cfif pricerange is not "All Price Ranges" and city is not "All
Areas"> and </cfif>

<cfif pricerange is "Under $50000"> askingprice <= 50000
<cfelseif pricerange is "$50000 to $60000"> askingprice >=50000
and askingprice <=60000
<cfelseif pricerange is "$60000 to $70000"> askingprice >=60000
and askingprice <=70000
<cfelseif pricerange is "$70000 to $80000"> askingprice >=70000
and askingprice <=80000
<cfelseif pricerange is "$80000 to $90000"> askingprice >=80000
and askingprice <=90000
<cfelseif pricerange is "$90000 to $100000"> askingprice >=90000
and askingprice <=100000
<cfelseif pricerange is "$100000 to $110000"> askingprice >=100000
and askingprice <=110000
<cfelseif pricerange is "$110000 to $120000"> askingprice >=110000
and askingprice <=120000
<cfelseif pricerange is "$120000 to $130000"> askingprice >=120000
and askingprice <=130000
<cfelseif pricerange is "$130000 to $140000"> askingprice >=130000
and askingprice <=140000
<cfelseif pricerange is "$140000 to $150000"> askingprice >=140000
and askingprice <=150000
<cfelseif pricerange is "$150000 to $160000"> askingprice >=150000
and askingprice <=160000
<cfelseif pricerange is "$160000 to $170000"> askingprice >=160000
and askingprice <=170000
<cfelseif pricerange is "$170000 to $180000"> askingprice >=170000
and askingprice <=180000
<cfelseif pricerange is "$180000 to $190000"> askingprice >=180000
and askingprice <=190000
<cfelseif pricerange is "$190000 to $200000"> askingprice >=190000
and askingprice <=200000
<cfelseif pricerange is "$200000 to $210000"> askingprice >=200000
and askingprice <=210000
<cfelseif pricerange is "$210000 to $220000"> askingprice >=210000
and askingprice <=220000
<cfelseif pricerange is "$220000 to $230000"> askingprice >=220000
and askingprice <=230000
<cfelseif pricerange is "$230000 to $240000"> askingprice >=230000
and askingprice <=240000
<cfelseif pricerange is "$240000 to $250000"> askingprice >=240000
and askingprice <=250000
<cfelseif pricerange is "$250000 to $260000"> askingprice >=250000
and askingprice <=260000
<cfelseif pricerange is "$260000 to $270000"> askingprice >=260000
and askingprice <=270000
<cfelseif pricerange is "$270000 to $280000"> askingprice >=270000
and askingprice <=280000
<cfelseif pricerange is "$280000 to $290000"> askingprice >=280000
and askingprice <=290000
<cfelseif pricerange is "$290000 to $300000"> askingprice >=290000
and askingprice <=300000
<cfelseif pricerange is "$300000 to $400000"> askingprice >=300000
and askingprice <=400000
<cfelseif pricerange is "$400000 to $500000"> askingprice >=400000
and askingprice <=500000
<cfelseif pricerange is "Greater than $500000"> askingprice >=500000
</cfif>

<cfelse>

<cfif pricerange is "Under $50000"> askingprice <= 50000
<cfelseif pricerange is "$50000 to $60000"> askingprice >=50000
and askingprice <=60000
<cfelseif pricerange is "$60000 to $70000"> askingprice >=60000
and askingprice <=70000
<cfelseif pricerange is "$70000 to $80000"> askingprice >=70000
and askingprice <=80000
<cfelseif pricerange is "$80000 to $90000"> askingprice >=80000
and askingprice <=90000
<cfelseif pricerange is "$90000 to $100000"> askingprice >=90000
and askingprice <=100000
<cfelseif pricerange is "$100000 to $110000"> askingprice >=100000
and askingprice <=110000
<cfelseif pricerange is "$110000 to $120000"> askingprice >=110000
and askingprice <=120000
<cfelseif pricerange is "$120000 to $130000"> askingprice >=120000
and askingprice <=130000
<cfelseif pricerange is "$130000 to $140000"> askingprice >=130000
and askingprice <=140000
<cfelseif pricerange is "$140000 to $150000"> askingprice >=140000
and askingprice <=150000
<cfelseif pricerange is "$150000 to $160000"> askingprice >=150000
and askingprice <=160000
<cfelseif pricerange is "$160000 to $170000"> askingprice >=160000
and askingprice <=170000
<cfelseif pricerange is "$170000 to $180000"> askingprice >=170000
and askingprice <=180000
<cfelseif pricerange is "$180000 to $190000"> askingprice >=180000
and askingprice <=190000
<cfelseif pricerange is "$190000 to $200000"> askingprice >=190000
and askingprice <=200000
<cfelseif pricerange is "$200000 to $210000"> askingprice >=200000
and askingprice <=210000
<cfelseif pricerange is "$210000 to $220000"> askingprice >=210000
and askingprice <=220000
<cfelseif pricerange is "$220000 to $230000"> askingprice >=220000
and askingprice <=230000
<cfelseif pricerange is "$230000 to $240000"> askingprice >=230000
and askingprice <=240000
<cfelseif pricerange is "$240000 to $250000"> askingprice >=240000
and askingprice <=250000
<cfelseif pricerange is "$250000 to $260000"> askingprice >=250000
and askingprice <=260000
<cfelseif pricerange is "$260000 to $270000"> askingprice >=260000
and askingprice <=270000
<cfelseif pricerange is "$270000 to $280000"> askingprice >=270000
and askingprice <=280000
<cfelseif pricerange is "$280000 to $290000"> askingprice >=280000
and askingprice <=290000
<cfelseif pricerange is "$290000 to $300000"> askingprice >=290000
and askingprice <=300000
<cfelseif pricerange is "$300000 to $400000"> askingprice >=300000
and askingprice <=400000
<cfelseif pricerange is "$400000 to $500000"> askingprice >=400000
and askingprice <=500000
<cfelseif pricerange is "Greater than $500000"> askingprice >=500000
</cfif>

</cfif>
order by adheading
</cfquery>
</cfif>




<font size="+1"><font face="Verdana">Search for a Property</font>
<br>
<form action="search.cfm" method="post">

<select name="city">
<option selected>All Areas</option>
<option>James Island</option>
<option> Isle Of Palms</option>
<option>Sullivans Island</option>
<option>Summerville</option>
<option>Mt. Pleasant</option>
<option>Goose Creek</option>
<option>Ladson</option>
<option>North Charleston</option>
<option>Moncks Corner</option>
<option>Walterboro</option>
<option>Johns Island</option>
<option>Hanahan</option>
<option>Wild Dunes</option>
<option>Charleston</option>
<option>Kiawah Island</option>
<option>West Ashley</option>
</select>
<p>
<select name="pricerange" size="1">
<option selected>All Price Ranges</option>
<option>Under $50000</option>
<option>$50000 to $60000</option>
<option>$60000 to $70000</option>
<option>$70000 to $80000</option>
<option>$80000 to $90000</option>
<option>$90000 to $100000</option>
<option>$100000 to $110000</option>
<option>$110000 to $120000</option>
<option>$120000 to $130000</option>
<option>$130000 to $140000</option>
<option>$140000 to $150000</option>
<option>$150000 to $160000</option>
<option>$160000 to $170000</option>
<option>$170000 to $180000</option>
<option>$180000 to $190000</option>
<option>$190000 to $200000</option>
<option>$200000 to $210000</option>
<option>$210000 to $220000</option>
<option>$230000 to $240000</option>
<option>$240000 to $250000</option>
<option>$250000 to $260000</option>
<option>$260000 to $270000</option>
<option>$270000 to $280000</option>
<option>$290000 to $300000</option>
<option>$300000 to $400000</option>
<option>$400000 to $500000</option>
<option>Greater than $500000</option>
</select>

<input type="submit" value="Submit">
</form>
<p>
<cfif isdefined("pricerange")>
<cfoutput query="pricerange">

<table border="0" width="75%">
  <tr>
    <td VALIGN="MIDDLE" COLSPAN="2"><a href="results.cfm?placeid=#placeid#"><b><font
    face="Verdana">#city#</font><font FACE="VERDANA,ARIAL,HELVETICA"
SIZE="1" COLOR="BLACK"><b>,
    </b></font><font face="Verdana">#state#</font><font FACE="VERDANA,ARIAL,HELVETICA"
    SIZE="1" COLOR="BLACK"><b> </b></font></b></td>
  </tr>
  <tr>
    <td WIDTH="90"><table WIDTH="90" CELLPADDING="0" CELLSPACING="0"
BORDER="0">
      <tr>
           <td></a><a href="results.cfm?placeid=#placeid#"><img src="images/#photo#"
width="90"
        height="60" border="0"><br>
        </td>
      </tr>
    </table>
    </td>
    <td WIDTH="100%"><table WIDTH="100%" CELLPADDING="1" CELLSPACING="2"
BORDER="0">
      <tr VALIGN="TOP">
        <td WIDTH="100%"><table WIDTH="100%">
          <tr>
            <td BGCOLOR="CCCCCC"><b><font FACE="VERDANA,ARIAL,HELVETICA"
SIZE="2" COLOR="BLACK">Price:<br>
            </font></b></a><font size="-1" face="Verdana"><a
name="top">#dollarformat(AskingPrice)#</a></font></td>
            <td BGCOLOR="CCCCCC"><b><font FACE="VERDANA,ARIAL,HELVETICA"
SIZE="1" COLOR="BLACK">BR:<br>
            </font></b><font size="-1" face="Verdana">#NumberofBedrooms#</font></td>
            <td BGCOLOR="CCCCCC"><b><font FACE="VERDANA,ARIAL,HELVETICA"
SIZE="1" COLOR="BLACK">BA:<br>
            </font></b><font size="-1" face="Verdana">#Bathrooms#</font></td>
            <td BGCOLOR="CCCCCC"><b><font FACE="VERDANA,ARIAL,HELVETICA"
SIZE="1" COLOR="BLACK">Sq.
            Ft.:<br>
            </font></b><font size="-1" face="Verdana" 
color="000000">#SquareFootage#</font></td>
            <td BGCOLOR="CCCCCC"><font FACE="VERDANA,ARIAL,HELVETICA"
SIZE="1" COLOR="BLACK"><b>Approx.
            Age:<br>
            </b></font><font size="-1" face="Verdana">#Age#</font></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr VALIGN="TOP">
        <td><font FACE="Verdana,Arial,Helvetica" 
SIZE="1"><b>Description:&nbsp;</b></font><font
        face="Verdana"><a name="top"><font size="-1">#adheading#</font></a><font
        FACE="Verdana,Arial,Helvetica" SIZE="1"><br>
        </font></font></td>
      </tr>
      <tr VALIGN="TOP">
        <td WIDTH="100%"></td>
      </tr>
    </table>
    </td>
  </tr>
</table>

<hr>

</cfoutput>
</cfif>
<font face="Arial"><em><strong>

<p>If you don't find what you're looking for, e-mail our staff
agent <a
href="mailto:">here</a>.</strong></em></font>
</p>
</body>
</html>

---thank you for your help>








-----
Sent using MailStart.com ( http://MailStart.Com/welcome.html )
The FREE way to access your mailbox via any web browser, anywhere!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to